Saturday, March 14, 2009

Beautifying HTML

You may already know that I'm impressed by AirSet. I'm using it to publish the web site of Willowbrook Arts Camp, a non-profit daycamp on which I am a board member.

Although I am impressed by the service - and I will continue to use it - there are some frustrations. The one I want to discuss in this blog entry is editing the HTML in AirSet pages.

AirSet has a WYSIWYG page editor, and most people will probably never use their HTML editor. If, however, you want to do this, you should be prepared for the fact that carriage returns and line feeds are removed every time you leave HTML edit mode. So every time you enter HTML edit mode, the HTML you see will not be formatted in a way conducive to manual editting.

I had a conversation with their developers, and they understand the issue; but changing it is not high on their list of priorities - which I understand, given that most people won't use it.

But since I do use it, I decided to take some time to find an alternative solution.

One solution, the least technical, is to simply maintain the HTML outside AirSet, using another editor. When you want to make a change, edit the HTML, and then copy it over your AirSet page. While simple, this can become tedious. And if you maintain the HTML on your computer, you can't edit your AirSet pages from another computer without your HTML files getting out of sync.

I looked unsuccessfully for a FireFox plugin that could beautify HTML in text area fields. The Web Developer plugin has a tool for validating HTML, but it can't deal with AirSet's pages when you try to have it "clean up the markup with HTML Tidy".

I also looked at the documentation for HTML Tidy. I thought that it might be able to clean up HTML in the clipboard. And while I found it was discussed, it is not currently capable of doing this.

So I decided to use macro playing software to do the following:
  1. Copy the HTML to my clipboard.
  2. Create a temporary file for the HTML.
  3. Copy the HTML to the temporary file.
  4. Run HTML Tidy on the file.
  5. Copy the cleaned up HTML back to my clipboard.
Before running this macro, I open the AirSet page for editing and change to HTML mode. When the macro is done, I can then copy the cleaned up HTML back into the AirSet page.

It probably sounds more complex than it is in daily usage, as it's really only 2 extra steps (starting the macro and copying the HTML back into the page).

So, in case you want to do the same thing, here is how I'm doing it.

Note that I'm doing this on a Windows machine. I'm also using AutoHotKey. If you don't have it, install it.

Next, download the AutoHotKey script.

You'll probably have to edit the script, as it stores its temporary file in c:\users\bill\desktop\temp, a folder which probably doesn't exist on your pc.

To start the script, double-click on it. When you start it, it does nothing other than registering the hotkey combination a.

When you are ready to edit the HTML of your AirSet page, open the page for editing and change to HTML mode. Make sure your cursor is in the textarea field. Now press a. When the macro is done, the beautified HTML will be in your clipboard. You can now paste it back to your AirSet page.

2 more notes:

One, you can start the macro when you boot your pc by putting it in your Startup folder.

Two, this macro is good for any HTML - not just that in AirSet. For example, if you are editing an HTML file in Notepad, you can use the same method to beautify it.

Saturday, March 07, 2009

SharePoint for Internal Collaboration? Fail!

There's a lot of buzz about SharePoint in the corporate world. It seems to have come out of nowhere, but I believe SharePoint has hit its stride because it provides a safe answer for IT management when asked about their strategy for web 2.0 in the enterprise. It's a clear continuation of the IT management thought process that's been around since the '70's - what started with the statement: "you can't go wrong if you buy from IBM." The other cya vendors - IBM, Oracle, CA,... Haven't had a good story here, so Microsoft has won by default.

The only problem is that SharePoint sucks. Ok, maybe that's a bit harsh. SharePoint is ok as a document repository. But really, it does suck at facilitating collaboration in the enterprise. If you've followed my writing, you know that I don't normally use harsh adjectives or make overly bold statements. But this one is easy. SharePoint is just not in the same league as so many other tools. Let's go through some of SharePoint's disadvantages.

Web 2.0 - the philosophy

The premise behind web 2.0 is that:
  • People are more than executors of commands - they have important and relevant knowledge, and they are sources of good ideas.
  • Significant value is gained by allowing people to collaborate, work out problems on the open stage, and make that knowledge available and easily findable. Better decisions can be made (people will have better information with which to make them), decisions and tasks can be completed more quickly (they will spend less time finding relevant information), and the organization will be less brittle (knowledge will be stored centrally, rather than solely in people's heads).
  • People - on the whole - are smart and ethical.
A change in management culture is often required of organizations that want to take part in this. Historically, organizations were based on "command and control", with jobs and tasks specified from the top down; and information was shared "on a need to know basis." But Web 2.0 in the enterprise requires trust, a willingness to listen to the ideas of people at every level of the organization (and to act and allow action on good ideas), and acceptance of a more open, transparent, and collaborative environment.

SharePoint - Web 2.0 or not Web 2.0?

With roots in document management, SharePoint provides for significant security configuration. While this should be a good thing, in practice it makes it too easy to secure content from general access. Wikis and blogs generally default to open access, and wikis generally default to open editing. This latter approach is better aligned with the philosophy of Web 2.0. You can do this with SharePoint, but you may have a more difficult fight with those who want to stick with access "on a need to know basis."

SharePoint TCO

Proliferation of SharePoint sites is also a common problem in organizations. It's easy to find yourself with dozens - or hundreds - of sites. And unless you know about them or they are referenced elsewhere, they remain hidden from view. Microsoft's response to this? Put in place a governance framework. Microsoft's web site has a whole set of documentation on governance for SharePoint. Of course with this you get added overhead and bureaucracy. Oh, and there's 3rd party commercial software available to help with this.

Which leads to the next issue with SharePoint: it is definitely NOT a "light" solution. Technically, Microsoft recommends development, test, and production environments; you'll need Active Directory, IIS, the .Net Framework, SQL Server databases, and antivirus software for the server. Microsoft kindly provides a sample deployment project plan for deploying SharePoint - 381 tasks requiring 129 days and people in 9 different roles. Organizationally, Microsoft recommends maintaining an ongoing staff of people for the roles of business analyst, creative designer, trainer, infrastructure specialist, developer, and architect.

SharePoint as Antagonist to the Flexible Enterprise

This may be obvious, yet I feel it still needs to be said: SharePoint only runs on Windows. In contrast, many other collaboration tools will run on Windows, Solaris, or Linux. Oh, and if you want integration with Microsoft Office, your users will need to be running Windows (and Microsoft Office).

Productivity Enhancer? Or Drain?

SharePoint's roots are as a document management system - a place to store your Word, Excel, Powerpoint files. Microsoft knows it has a cash cow in Microsoft Office, and it's not going to allow the product to be be put out to pasture without a fight. And Microsoft knows nothing better than how to fight. In this game, Microsoft is building hooks between SharePoint and Office - Microsoft makes it easy to save a file to a SharePoint site, to open and edit a file stored in SharePoint, and to save changes back to SharePoint; and your calendar, tasks, and contacts can be synchronized between Outlook and SharePoint (of course, if you want this latter functionality, you will also need an Exchange Server and Active Directory). Microsoft hopes this keeps you captive. If this were a good solution, so be it. But it's not.

When you click on a link, you expect to see content relating to the text of the link. But with Microsoft's solution, you get a popup window asking if you want to open or save the file that contains the content related to the link. Failure #4. Now I don't know about your experience with browsers, but I've found that opening documents in my browser (IE, Firefox, Opera, ...) is hit or miss. Sometimes it works. Sometimes it causes my browser to grab the CPU and not let go, sometimes it makes my browser greedy for RAM, sometimes my browser crashes. This has trained me to save all downloadable files to my hard disk, and then open them in their native apps. Failure #5. Of course when I'm done looking at the file and I move on, the file is still there, taking up disk space on my PC. I have to periodically empty the folder I've set up for these files - failure #6. And until I do this, these files increase the bandwidth, time, and storage space required by our corporate backup solution - failure #7.

Now let's compare SharePoint with wikis with respect to versioning. With SharePoint your content is in a file. If you want to make a change, you download the file, make the change, and upload it. If you want - and if you know how - you can have MS Word store a record of changes in Word documents. Excel has a change tracking feature, though it's somewhat crippled (e.g. it can't track formatting changes, when you use it some other features become unavailable...). PowerPoint doesn't have a change tracking feature. Additionally, when you save a file back to SharePoint, it doesn't delete the old version. So you could conceivably compare the versions side by side.

Using wiki applications, you write content directly on the page. If you want to make a change, you click an "edit" button, make the change, and click the "save" button. Most wiki applications keep both the old and new versions, and they make it easy for you to see what has been changed.

So it's not that you can't view content changes with SharePoint, it's just that it's so much more difficult than with wikis. Failure #8.

SharePoint as Virus Vector

One more issue to chew on: Microsoft Office documents can be carriers of malicious code, whereas wiki pages have much less risk. Microsoft includes "Forefront Security" with SharePoint, but why should you have to increase your risk, and install - and administer - even more software for your solution?

Bottom Line

If all you want is to enhance communication and collaboration in your enterprise, there is a plethora of tools available that could satisfy your requirements and protect you from all of the problems with SharePoint (for example, check out Atlassian Confluence or Mindtouch Deki). Don't make the mistake I've seen in other organizations - choosing SharePoint without understanding what they were getting into and what alternatives were available.

Consider yourself warned!