Run Forrest Run!


"Run Forrest Run" – do you remember that scene from the movie Forrest Gump? Well, that seems to be the trend nowadays with government agencies running away from costly entreprise solutions towards more open source software because it is, well, free.  Luckily, Forrest Gump unshackles himself from his polio braces and breaks free; and so so did many government agencies. In my prior blog on open source Web Content Management (WCM) systems, I mentioned Drupal as a strong open source replacement candidate for WebCenter Interaction (WCI). And today, I’d like to help you run away from WCI Publisher as seamlessly as possible to whatever WCM solution you choose to implement; and hopefully it is an open source one :-)

As we all know, WCI Publisher is a proprietary content management software as it has its unique templates for data and presentation that are difficult to map and replicate on any target WCM solution but what we care about most here is the content since odds are you will re-skin your website.  In Publisher, you might have hundreds of content types with different data entry templates, so let’s take an example.  Say you have a content type of type employee linked to its respective data entry template. For such a content item we might have the following Publisher properties defined in the data entry template

  • First name
  • Last name
  • Date of birth
  • email
  • Telephone
  • Gender
  • Address
  • City
  • State
  • Zip code

Obviously, to export these content items out of Publisher, we can write a custom Java or .Net module that utilizes the Publisher APIs and output the result in XML format for subsequent import in whatever WCM software.  But, instead, we can leverage Publisher’s PCS Tags (funny the page still caries the “BEA” logo) as an easier alternative to perform that export functionality.  The steps are as follows:

  • Create a presentation template and define its publishing name as '.XML'
  • Don’t link it to any data entry templates.
  • In the code section we will use the conditional, value, and iterator tags; the syntax is:
<?xml version="1.0" encoding="UTF-8" ?>
      <pcs:foreach var="employee" expr="filter(folderByPath('employees'),
                 'filtered.published !=null &and; !filtered.hidden')">
                <pcs:if expr="employee.first_name != NULL &and;
                                 employee.first_name != ''">
                   <![CDATA[<pcs:value expr="employee.first_name"></pcs:value>]]>
                <pcs:if expr="employee.last_name != NULL &and;
                                 employee.last_name != ''">
                   <![CDATA[<pcs:value expr="employee.last_name"></pcs:value>]]>
                <pcs:if expr="employee.birth_date != NULL &and;
                                employee.birth_date != ''">
                   <![CDATA[<pcs:value expr="employee.birth_date"></pcs:value>]]>
             <!--- add same syntax for the other employee properties -- >
  • Save and publish the presentation template.
  • The output should be an XML formatted output of all the content items of type “employee” stored in the “employees” publisher folder; e.g.
<?xml version="1.0" encoding="UTF-8" ?>
          <address>1600 Pennsylvania Avenue</address>

We can apply the same technique for the any other content type.  The above example was for straight data entry templates property types, if you got a multi-selection property; for example skillset where en employee can have one more or skills; the <pcs> syntax would be:

   <pcs:foreach var="condition" expr="employee.skillt">
         <pcs:if expr="employee.skill &gt; 1"></pcs:if><pcs:value expr="font-size: small; skill"></pcs:value>

and the output XML would be


Now that we got an XML output of the different Publisher content items, we should be able to migrate this content into any WCM solution. In the case of Drupal, we have a custom solution to import this XML data as new content.


Subscribe to Our Newsletter

Stay In Touch