Besides the biggy of source control another advantage of having an XML-based offline system of record of our Documentum artefacts is that we can use standard XML tools on those artefacts.
For example you could generate HTML docs from them; DarDocs if you will.
Take a transform like this:-
<!–XML Transform to generate HTML from Documentum Type Artefacts–>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:xmi="http://www.omg.org/XMI" xmlns:Artifact="http://documentum.emc.com/infrastructure/12012007/artifact" >
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="Artifact:Artifact/dataModel/type">
<tr>
<td>Document Type</td>
<td><xsl:value-of select="@name"/></td>
</tr>
<tr>
<td>Super Type</td>
<td><xsl:value-of select="substring-before(substring-after(super_name/@href,’name=’), ‘#’)"/></td>
</tr>
<tr bgcolor="#9acd32">
<th>Attribute Name</th>
<th>Attribute Type</th>
<th>Attribute length</th>
<th>Attribute Label</th>
<th>Help Text</th>
<th>Comment</th>
</tr>
<xsl:for-each select="primaryElement/attributes">
<tr>
<td><xsl:value-of select="@attr_name"/></td>
<td><xsl:value-of select="attr_type/@values"/></td>
<td><xsl:value-of select="@attr_length"/></td>
<td><xsl:value-of select="attrAnnotations/locales/@label_text"/></td>
<td><xsl:value-of select="attrAnnotations/locales/@help_text"/></td>
<td><xsl:value-of select="attrAnnotations/locales/@comment_text"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
And a simple ant task like this:-
<?xml version="1.0" encoding="UTF-8"?>
<project default="generateDocs">
<target description="Generate DarDocs" name="generateDocs">
<xslt basedir="Artifacts" destdir="Documents" style="style/DocTypes.xsl">
<mapper type="glob" from="*.type" to="*.html"/>
</xslt>
</target>
</project>
And run it over a project with a few types in and you should get an html file for each type that looks something like this:-
Document Type | soptype | ||||
Super Type | dm_document | ||||
Attribute Name | Attribute Type | Attribute length | Attribute Label | Help Text | Comment |
---|---|---|---|---|---|
attr1 | STRING | 10 | attr1_label | Some user help on attr1 | Developer comment for attr1 |
attr2 | INTEGER | 10 | attr2 label | Some user help for attr2 | Developer comment for attr2 |
It would be simple enough for a release engineer to add this to your releng build so that each build also produces a set of DarDocs for your Dars.
Hat tip to Eddie Doey from UK Consulting for providing this great example.
Happy Composing!