+

Search Tips   |   Advanced Search

+

Search Tips   |   Advanced Search


Programmatically Displaying IBM Web Content Manager (WCM) Content

The following is my experience with displaying IBM WCM content programatically, based on the article Programmatically Displaying IBM Web Content Manager (WCM) Content

  1. Download and unzip SampleWCMSPA.zip

  2. Install and deploy paa file...

      cd /IBM/WebSphere/ConfigEngine
      ./ConfigEngine.sh install-paa -DPAALocation=/path/to/SampleWCMAPI.paa -DWasPassword=WAS_PASSWORD -DPortalAdminPwd=PORTAL_PASSWORD
      ./ConfigEngine.sh deploy-paa -DappName=SampleWCMAPI -DWasPassword=WAS_PASSWORD -DPortalAdminPwd=PORTAL_PASSWORD

    Deploying the SampleWCMAPI paa file creates the "WCM SPA" library.

  3. Use the Configure option in Web Content Authoring to Add the WCM SPA library into Selected Libraries

  4. You should now see SPA content items and components...

  5. The presentation template...

      Libraries | WCM SPA | Presentation Templates | JSON

    ...uses the standard WCM tag library to display the results in a JSON format. For example the name key value pair is ‘name’: followed by the WCM Property tag of the current content items title field. The summary, body and imageUri are similar but use different WCM tags and formatting.

      {
      "name":"[Property context="current" type="content" htmlencode="true" field="title"]",
      "summary":"[Plugin:CopyText count="1" format="trim" escape="json" text="[Element context='current' type='content' key='Summary']"]",
      "body": "[Plugin:CopyText format="trim" count="1" escape="json" text="[Element context='current' type='content' key='Body']"]",
      "imageUri": "[Plugin:CopyText count="1" format="trim" escape="json" text="[Element context='current' type='content' key='Library Index Image' format='url']"]"
      }

  6. To help with JSON debugging, install plugins RESTClient for Firefox and Postman for Google Chrome.

    FireFox Developer Edition is also useful.