Converting your old CMS database to XML format that can be imported into OpenCDS.

As we are currently working on migration from my company old CMS to OpenCDS so I have to migrate the old data from the old CMS database (MSSQL Server) to OpenCDS database (Oracle) and offcourse the two ERDs are completely different.
So the solution that I follow is to export the data from my old CMS to XML files then use XML_Submission to insert this data into OpenCDS and this will guarantee that the relation for each piece of content is created correctly.

I will discuess in this Article how to export the data from your old CMS database to XML files with format that can be imported into OpenCDS.

Mainly we have four classes and XSLT for each xml format.

The four classes are:

  4. (Main Class)
  • First I will speak about the four Java classes:

      in this classes I have used Echo.xsl to just generate XML file that is identical to the DOM created in the memory.
      then I will use Content.xsl to transform this file into multiple files that are ready for importing into OpenCDS using the following command
      java net.sf.saxon.Transform data/Content.xml xslt/Content.xsl
      you have to create folder called transformed as I fixed this folder in the Content.xsl so that all generated XML will be placed in this folder.

      A better approche is to use Content.xsl inside the java code to transform directly form the DOM created into memory to multiple files that are ready to import into OpenCDS.

    2. Which is an abstract class that implements the SAX2 XMLReader interface. The intent of this class is to make it easy for subclasses to act as SAX2 XMLReader implementations. This makes it possible, for example, for them to emit SAX2 events that can be fed into an XSLT processor for transformation.
      The code is attached.

    4. Which is a class that extends InputSource.
      The intent of this class is to just holds a copy of the ResultSet object for the XML reader to use it.
      The code is attached.

    1. The following XSLT is responisble for generating XML that is valid for OpenCDS

      This XSLT are used to transform the generate XML files(one XML for each Record) and those XML are ready to be imported to OPenCDS from the DOM created in the memory by the Java Code above.

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="2.0"

      <xsl:output method="text" media-type="text/xml" indent="yes" encoding="UTF-8" />
      <xsl:output method="xml" indent="yes" name="xml" encoding="UTF-8"/>

      <xsl:template match="/">
      <xsl:for-each select="/Content/ROW">
      <xsl:variable select="Content_Name" name="contentName" />
      <xsl:variable select="Content_File_ID" name="newfile" />
      Creating <xsl:value-of select="concat('transformed/', $newfile, '.xml')" />
      <xsl:result-document href="{concat('transformed/', $newfile, '.xml')}" >
      <Action value="New"/>
      <ContentType>]]><xsl:value-of select="Type_Name"/><![CDATA[</ContentType>]]>
      <![CDATA[<ContentURL src="]]><xsl:value-of select="Content_URL"/><![CDATA["/>]]>
      <![CDATA[<EditionName>]]><xsl:value-of select="File_Name"/><![CDATA[</EditionName>]]>
      <xsl:variable select="Wap_Preview" name="wapPreview" />
      <xsl:variable select="Web_Preview" name="webPreview" />
      <xsl:when test="($wapPreview != '' and $wapPreview != null) or ($webPreview != '' and $webPreview != null)">
      <xsl:when test="$wapPreview = '' or $wapPreview = null">
      <xsl:for-each select="Wap_Preview"><![CDATA[<File caption="caption" src="]]><xsl:value-of select="."/><![CDATA["/>]]></xsl:for-each>
      <xsl:when test="$webPreview = '' or $webPreview = null ">
      <xsl:for-each select="Web_Preview"><![CDATA[<File caption="caption" src="]]><xsl:value-of select="."/><![CDATA["/>]]></xsl:for-each>
      <![CDATA[<Capability name="deliverytype" value="OTA"/>
      <Category>Home:]]><xsl:value-of select="Provider_Name" />:<xsl:value-of select="Type_Class_Name" />:<xsl:value-of select="Type_SubClass_Name" />:<xsl:value-of select="Type_Name" /><![CDATA[</Category>
      <DisplayName>]]><xsl:value-of select="$contentName"/><![CDATA[</DisplayName>
      <ShortDescription>]]><xsl:value-of select="$contentName"/><![CDATA[</ShortDescription>
      <LongDescription>]]><xsl:value-of select="$contentName"/><![CDATA[</LongDescription>



    2. The following is a sample echo XSLT file:

      This XSLT are used to just generate XML file that is identical to the DOM created in the memory.

      <xsl:stylesheet version="1.0"

      <xsl:output method="xml" indent="yes"/>

      <xsl:template match="node()">





awesome post that will I have been examine I favor that however it could be a lot more fascinating in case you compose document concerning getaway people just like at this website Pulau Tidung Pulau Seribu

I like this idea. I followed

I like this idea. I followed through, and it gave me a good result in the end. - Dony McGuire

Powered by Drupal - Design by artinet