WebPublisher Apply Presentation from the command line

February 3, 2009 at 9:25 am | Posted in Continous Integration | 3 Comments
Tags: , ,

Update 5 July 2010: corrected an error in the method calling string
Ever thought it would be useful to be able to utilise the WebPublisher Apply Presentation functionality from the command line but didn’t want to have a whole application server install to make it work? Perhaps you need to put together installation scripts or an automated testing environment. Here is the ‘under-the-covers’ method that is behind the Apply Presentation logic in WebPublisher.

Much of the back-end logic that is exposed by the WebPublisher front end goes through a java server method called wcm_utils. Suppose you have:

  • a docbase DB1
  • install owner of dmadmin
  • xsl template with object id 090ff0ff80003852
  • xml object to be transformed 090ff0ff8000f921

then you need to call the wcm_utils method with the following arguments:

-docbase_name DB1 -user dmadmin -action 12 
    -object_id 090ff0ff80003852 -object_ids 090ff0ff8000f921

for example in IAPI this would be:

apply,c,NULL,DO_METHOD,METHOD,S,wcm_utils,
     ARGUMENTS,S,-docbase_name DB1 -user dmadmin -action 12 
     -object_id 090ff0ff80003852 -object_ids 090ff0ff8000f921

You can also use this interface to transform more than 1 xml object, just separate the -object_ids parameter with colons:

apply,c,NULL,DO_METHOD,METHOD,S,wcm_utils,
     ARGUMENTS,S,-docbase_name DB1 -user dmadmin -action 12 
     -object_id 090ff0ff80003852 -object_ids 
    090ff0ff8000f921:090ff0ff8000f922:090ff0ff8000f924
Advertisements

Create a free website or blog at WordPress.com.
Entries and comments feeds.