Posts Tagged ‘Programming’

Pulling External Content Into XSL Using ASP

Tuesday, November 4th, 2008

Problem: how to pull content into an XSL transformation process using ASP. ASP will give us the opportunity to make runtime decisions. In my case, determining what sort of template XHTML code to retrieve for inclusion into the final page render.

Let’s say we have an ASP file called ASPResources.asp that retrieves XHTML content from a webserver by passing a filename like such:

Sample ASP:

<%
Class ASPResources

‘ Returns string of HTML content based on filename
Public Function GetHttpContent(fileName)

Dim xml, url, strData
url = “http://localhost/templates/” + fileName + “.asp”
strData = “”

‘ Create an xmlhttp object
Set xml = Server.CreateObject(“Msxml2.ServerXMLHTTP.4.0″)

‘ Open the connection to the remote server.
xml.Open “GET”, url, False

‘ Send the request and returns the data:
xml.Send()

‘ Return content
GetHttpContent = xml.ResponseText

‘ Cleanup
Set xml = Nothing

End Function

End Class
%>

Pretty basic stuff. You’ll want to add error handling and so forth.

Now, to perform the transformation, we have another ASP file called XMLTransformer.asp. This file grabs our XSL and XML files. Then, we create an XSLT (transformation) object from these. The next part is crucial (and bolded below). Instantiate your custom ASP class and add it to the XSL Processor providing a URN, in this case asp-resources.

Sample ASP:

<%
‘ Declare locals
dim xslt
dim xslDoc
dim xslProc
dim xmlDoc

‘ Create XSLT and XSL objects
Set xslt = Server.CreateObject(“Msxml2.XSLTemplate”)
Set xslDoc = Server.CreateObject(“Msxml2.FreeThreadedDOMDocument”)

‘ Load XSL
xslDoc.async = false
xslDoc.resolveExternals = true
xslDoc.load Server.MapPath(pathToXsl)

‘ Set the XSL on the XSLT
Set xslt.stylesheet = xslDoc

‘ Load XML
Set xmlDoc = Server.CreateObject(“Msxml2.DOMDocument”)
xmlDoc.async = false
xmlDoc.resolveExternals = true
xmlDoc.preserveWhiteSpace = true
xmlDoc.load Server.MapPath(pathToXml)

‘ Set the XSLProcessor
Set xslProc = xslt.createProcessor
xslProc.input = xmlDoc

‘ Create our custom object
Set aspr = new ASPResources

‘ Add custom object to XSL template
call xslProc.addObject(aspr, “urn:asp-resources”)

‘ Transform the document
xslProc.transform()

‘ Send the result
Response.Write xslProc.output

‘ Clean up
Set xslt = Nothing
Set xslDoc = Nothing
Set xslProc = Nothing
Set xmlDoc = Nothing
Set aspr = Nothing

%>

At this point, our custom ASP code is now available to the XSL Processor. That’s a happy place to be. But, we’re not quite done yet. We still need to call the custom object from within our XSL. To do so, it is necessary to add the new URN to the list of XMLNS (XML Namespaces) in the XSL file:

<xsl:stylesheet version=”1.0″
xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”
xmlns=”http://www.w3.org/1999/xhtml”
xmlns:aspr=”urn:asp-resources”>

Without this, the XSL transformation will complain about aspr not being a valid namespace. But, with it, we now have access to the custom ASP code and can call its methods elsewhere in our in the XSL code:

<xsl:value-of
select=”aspr:GetHttpContent(‘header’)”
disable-output-escaping=”yes” />

Don’t omit the disable-output-escaping=”yes” parameter. Doing so will cause the parser escape the < and > characters (among others) breaking your XHTML output.

Here we are sending “header” as our filename to the GetHttpContent method resulting in a call to header.asp. This file itself can execute ASP code or simply return XHTML code. The call to GetHttpContent can be done repeatedly in the XSL each time sending a different filename parameter as needed.

Does ROWE Really Work?

Sunday, November 2nd, 2008

What is ROWE?

ROWE (Results-Only Work Environment): ROWE in practice means “each person is free to do whatever they want, whenever they want as long as the work gets done.” Employees control their own calendars, and are not required to be in the office if they can complete their tasks elsewhere. It is generally accepted that there are times when collocation will be necessary. Under normal circumstances, work when and where you like.

Who is using ROWE?

The most widely known adopter is none other than Best Buy. Brad Anderson, CEO of Best Buy, agreed with the work culture change so much that he wrote the forward to the CultureRx book entitled, “Why Work Sucks and How to Fix It”. Finding additional companies using ROWE is a bit harder. I have made inquiries to get more examples that will be shared when they become available. A company that I work for has implemented a version of ROWE in the Information Services department. I would estimate that over 75 people participate in the ongoing program.

UPDATE: I’ve gotten in touch with Cali and Jodi, the originators of ROWE, and they have informed me that J.A. Counter & Associates are another company that uses ROWE. A larger list of organizations are due to be published within a month’s time. So, expect further updates when the info is released.

So, Does It Work?

Short answer: yes. We have employed ROWE for well over a year. Employee satisfaction has increased an order of magnitude. That said, ROWE is not a cure all. You will still find many annoying drawbacks that plague most organizations. How to address them may well lay outside of the issues ROWE addresses. Employees truly love the benefits that ROWE does provide.

Stumbling Blocks

  • Abusers. These are in the extreme minority. Fear not. Their performance will be the tell-tale that exposes abuse of the ROWE system. Afterall, if the results based on performance are poor and the excuses many, it will quickly become apparent that the individual is not playing by the rules. Solution? Temporarily revoke those ROWE rights. You’ll be amazed at just how quickly performance improves to win back ROWE privileges.
  • Reduced osmotic communication. I talked at length about this in another article. It is a real issue. The benefits FAR outweigh the introduction of this problem. Solution? Find tools that emulate osmotic communication and fit into your company’s way of doing business.
  • The death of camaraderie. Well, sort of. Nobody likes fabricated situations. Isn’t it awkward when the company forces people without a mutual social interest to participate in personal and social team building exercises? Yes. Yes, it is. Solution? People who genuinely like one another will naturally gravitate. With ROWE, this often takes the form of coffee shop sit-ins, living room office parties and the infamous happy hours. Be sure to have the occasional meeting so that new employees meet existing ones and new relationships can be formed face-to-face.
  • The work/home blur. This does seem to occur occasionally. If you are working at strange hours, there are times when it is hard to differentiate between the two. The clear separation becomes a little vague. Solution? Managers are warned not to take advantage of this. Let your employees live their lives. Employees should expect that their companies may contact them during normal business hours and that they should respond during those hours.
  • Manager fear. The irrational belief by managers that they will no longer be needed. Especially troublesome to the micro manager whose personality traits desire control. Solution? Educate. Managers will find that coordination is still greatly needed in a ROWE enabled workforce. Relax and let go. Managers who trust their direct reports will always get better results than those who do not.

Benefits

  • Productivity increases. People using ROWE got more done in less time.
  • Goodbye, commute.
  • More time dedicated to personal life. This is healthy. This brings joy. Happy employees are productive. Productivity increases. And so forth…
  • Employee retention. ROWE is hard to give up once you’ve experienced it. Employees have a tendency to stay put.

Conclusion

If there are segments of your workforce that are candidates for ROWE, you owe it to yourself (and them!) to seriously consider making the change. The employee satisfaction and increased productivity are reason enough to make a trial run at the minimum. ROWE pays dividends and costs organizations very little to implement.

Osmotic Communication under ROWE

Saturday, November 1st, 2008

I know; it sounds like the basis for a thesis. Not to worry. We’ll keep it lite. Let’s begin by agreeing to a common understanding for the terms being thrown about like so much bathe water.

  • Osmotic Comunication: “Osmotic communication means that information flows into the background hearing of members of the team, so that they pick up relevant information as though by osmosis. This is normally accomplished by seating them in the same room. Then, when one person asks a question, others in the room can either tune in or tune out, contributing to the discussion or continuing with their work.” From Crystal Clear by Alistair Cockburn of Agile software development fame.
  • ROWE (Results-Only Work Environment): ROWE in practice means “each person is free to do whatever they want, whenever they want as long as the work gets done.” Employees control their own calendars, and are not required to be in the office if they can complete their tasks elsewhere. It is generally accepted that there are times when collocation will be necessary. Under normal circumstances, work when and where you like.

Software As A Solution

Chris Spagnuolo’s Edgehopper provided some recommended software tools for distributed teams. These are certainly useful and a good starting place but are they applicable to osmotic knowledge sharing? On the surface it seems as though osmotic communication in a remote work environment is an impossibility. In the strictest of terms, this is true. But if we loosen out grip on semantics just a little, perhaps we’ll find that there are ways to rub elbows at the office although geographically being worlds apart.

Instant Messaging / Chat

My initial research has revealed that many IT shops are using chat rooms as a means to try to replicate ‘office chatter’. For this to be effective, participants must all sign into a single chat room where all the members have simultaneous sessions. The solution requires that general discussion take place in that chat room. In this way they can ‘overhear’ one another’s discussions and perhaps absorb information osmotically. Seems reasonable. It is true that a person can’t see every bit of chat that scrolls past the screen. But, neither can they overhear every discussion at the office. A chat client will allow for paging back and seeing earlier talk; something not possible with the immediacy of verbal conversation.

Web Conferencing / VOIP

For those considering this route, I have a couple of suggestions. On the commercial side (and if your company has some $$$ to spend), check out Microsoft Office Communicator. It integrates with many other Office products and works very well as a general chat communication tool. For a much more robust and feature-rich platform, consider Cisco Unified MeetingPlace. MeetingPlace may be overkill for some organizations as it provides webex, telecom/voip and video functionality. It also does provide chat, shared whiteboards/applications and more. Communicator and MeetingPlace are in no way mutually exclusive. Each product lends itself to the strengths of their respective companies.

Wikis / Sharepoint

I’m not a big proponent of these type products as a communication tool. This is especially true of osmotic communication. While the content is coming from the users themselves, there is a reliance on the users to visit the websites and find the latest updates. There is no subscription model (i.e. push). Sharepoint has a completely unintuitive interface. If your going to ask developers to keep information current, you better make it REAL easy otherwise it’s just not going to happen. If you must, check out mindtouch wiki software. It is the best I’ve seen to date and pushes the boundaries of what wiki software is expected to offer.

Forums / Blogs

Yes, please. These days there is very little difference between forum and blogging software. Modern versions have categories, subcategories, topics, threaded discussion/comments, search and so forth. Perhaps most important are the ease-of-use and subscription services. I can’t stress this enough. Developers are very busy people! Make it simple for information to be added. Make it automatic for information to be consumed. I’m interested to find digesting features for these tools. Perhaps a weekly update email with a digest of new items and updates.

Not Quite the Real Thing

Have we accomplished osmotic communication? No. But perhaps we’ve identified some tools that provide a common ground. Ultimately, the goal is to stay informed while keeping it simple and natural. I’d be glad to hear of other software that is being used to fill this void like Mind Mapping software as an example.


All works licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License. And that's a mouthful!