|
|
|
Posted by Aashish Patil (patil_aashish AT emc.com) on September 28, 2006
|
Historically, the developer website has posted most of the articles as PDF files. More than a year ago we started slowly moving to publish more articles as HTML. This is a more readable format for the web than PDF, which is a perfectly good format for storing documents and printing them. HTML articles also provide us means to increase interactivity with the community by easily hyperlinking with interactivity tools or embedding interaction functionality within articles.
Previously, the only way we could interact with the community was with newsletters or via email. Developers would contact us with issues or questions and we would answer them. However, this dialog was not known to the entire community which could have also benefited from it. To overcome this, we experimented with creating a thread in the support forums and linking it from an article. We tried this with the WDK Eclipse Plugin and Repository Interrogation Utility. The disadvantages of this were that we had to manually create a thread and also the links to the thread would break quite often or the user would be redirected to the forum home page instead of the actual thread. We still thought that forums were the right way to go but this was going to take time.
While mulling over alternatives, we came upon Haloscan while going through the newsletter of our subsidiary VMWare. Haloscan provides a commenting and trackback service for blogs. This service is equally applicable to any other HTML content. Haloscan is free but if you donate at least $12, you get a premium account with lots of advantages.
How Haloscan Works
Haloscan associates a unique identifier (key) with each article for which commenting or trackback is enabled. They provide a few lines of markup and JavaScript that needs to be embedded in the HTML content. This piece of code generates a Comments (or Trackback) link, which upon clicking passes the unique identifier to Haloscan, which then returns all the comments linked to that unique identifier. The unique identifier must be supplied by the creator of the article.
Integrating with Web Publisher
The entire developer site is managed using Documentum Web Publisher. Our HTML articles are written using an XML template which is then transformed using XSL to HTML and the HTML stored as a publishable rendition of the XML. We use the i_chronicle_id of an article as the unique identifier for an article.
Documentum has good support for XML and this support allows a developer to access Documentum repository functionality within a XSL file. When a XSL file is run as part of a DFC Transformation Operation (something Web Publisher does to create the rendition), the transform operation provides the XSL file the r_object_id of the source file (XML file) being transformed. The r_object_id is provided as a XSL PARAM. Using this r_object_id, our XSL file runs a XDQL query (DQL that returns results as XML) to obtain the i_chronicle_id of the r_object_id. This i_chronicle_id is then fed as the argument to the Haloscan JavaScript function call rendered by the XSL. We also prefix the i_chronicle_id with the object_name which helps us recognize the comments for a particular article.
The reason we use i_chronicle_id and not r_object_id is because r_object_id changes for each version of a document. If we used r_object_id, we would lose all comments made for the previous versions because Haloscan would be getting a new unique id for every version. The i_chronicle_id, on the other hand, stays the same for all versions.
Here is the XSL code that renders the Haloscan link on our pages.
<xsl:template match="comments-link">
<xsl:variable name="xdqlSelect">
select r_object_id,i_chronicle_id,object_name from dm_document
where r_object_id='<xsl:value-of select="$DMS_INPUT_OBJECT_ID"/>'
</xsl:variable>
<xsl:variable name="dql" select="string($xdqlSelect)"/>
<xsl:variable name="xdql" select="java:com.documentum.xml.xdql.DfXmlQuery.new()"/>
<xsl:variable name="init" select="java:init($xdql)"/>
<xsl:variable name="setDql" select="java:setDql($xdql,$dql)"/>
<xsl:variable name="setContentEncoding" select="java:setContentEncoding($xdql,'dom')"/>
<xsl:variable name="setContentFormat" select="java:setContentFormat($xdql,'xml')"/>
<xsl:variable name="setRootNode" select="java:setRootNode($xdql,'xdql')"/>
<xsl:variable name="Repeatingasnested" select="java:setRepeatingAsNested($xdql,false())"/>
<xsl:variable name="includeContent" select="java:includeContent($xdql,false())"/>
<xsl:variable name="execute" select="java:execute($xdql,'DF_READ_QUERY',$DMS_SESSION_ID)"/>
<xsl:variable name="results" select="java:getXMLDOM($xdql)"/>
<xsl:variable name="chronId" select="$results//i_chronicle_id"/>
<h2></h2>
<p class="bodyText">
<xsl:variable name="commentId">
<xsl:value-of select="$chronId"/>_
<xsl:value-of select="translate(string($results//object_name),'. ','__')"/>
</xsl:variable>
<a href="javascript:HaloScan('{$commentId}');" target="_self">
<script type="text/javascript">
<xsl:text>
postCount('</xsl:text><xsl:value-of select="$commentId"/><xsl:text>');
</xsl:text>
</script>
</a>
</p>
</xsl:template>
|
Notifications
While Haloscan is great for commenting, it does not have a notification mechanism. Thus, people involved in the comments don't get notified when a new comment is posted. This is understandable because they are meant to be comments and not discussions but it would be a nice feature to have.
Comments / Discussion
|