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

3 Comments »

RSS feed for comments on this post. TrackBack URI

  1. This is great Robin; if only I could figure a way of updating the id’s automatically / programmatically for when content is updated life would be a bit more complete 😀

  2. Phil, not sure what you mean. Reading your comment literally isn’t that what WebPublisher does for you. I’ve probably misunderstood, but I’m a literal kind of fella.

    Great website by the way
    Robin

  3. Oops – sorry I’m not sure why I wrote that! I meant to say if only I could figure out a way of scheduling that – but piping in an up to date list of xsl ids and their children id’s from dm_relation I could make a mini Create_Dynamic_Content. Or multiples so one type of xsl gets updated hourly; another daily etc. Thanks for the comments about my site; it’s built with WordPress not Web Publisher although sometime I wish it was; and other times I wish the work one was with WordPress hehe!


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: