WCM - Remote actions
Remote actions are used in the query string of a URL to trigger actions from the IBM Lotus WCM application. Remote actions are appended to the URL of an authoring portlet.
For example:
http://[host]/wps/myportal/wcmAuthoring?wcmAuthoringAction=actionYou can also append remote actions to the URL of a local Web Content Viewer portlet. This can be useful in sites that feature inline editing of content items.
Remote action types
A remote action is triggered using the query string parameter...
?wcmAuthoringAction=action...where action is one of the following:
Each document can be identified by a DocumentId. The "docid" can be retrieved using the Web content API. In the following examples, the value of the "docid" parameter should be the DocumentId as retrieved by using the API. A document ID consists of a document type and a unique ID. The "docid" values provided in the examples are placeholders for real document IDs.
- approve
- Approve an item in a workflow. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=approve&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
- decline
- Decline an item in a workflow. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=decline&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
- delete
- Delete an item. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=delete&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
- edit
- Open an item form in edit mode. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
- read
- Open an item form in read-only mode. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=read&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
- openmainview
- Open a view within an authoring portlet. You must also specify a "view" parameter.
For example:
?wcmAuthoringAction=openmainview&view=contentbysitearea
The following view parameters can be used:
- contentbysitearea
- contentbytitle
- myrecent
- mydraft
- mypendingapproval
- mypublished
- myexpired
- mydeleted
- alldraftitems
- allexpireditems
- allpublisheditems
- alldeleteditems
- componentsbytype
- new
- Open new item form. You must also specify a "type" parameter.For example:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content
The following type parameters can be used:
- com.ibm.workplace.wcm.api.WCM _AuthoringTemplate
- com.ibm.workplace.wcm.api.WCM _Category
- com.ibm.workplace.wcm.api.WCM _Content
- com.ibm.workplace.wcm.api.WCM _DateComponent
- com.ibm.workplace.wcm.api.WCM _FileComponent
- com.ibm.workplace.wcm.api.WCM _HTMLComponent
- com.ibm.workplace.wcm.api.WCM _ImageComponent
- com.ibm.workplace.wcm.api.WCM _NumericComponent
- com.ibm.workplace.wcm.api.WCM _PresentationTemplate
- com.ibm.workplace.wcm.api.WCM _RichTextComponent
- com.ibm.workplace.wcm.api.WCM _ShortTextComponent
- com.ibm.workplace.wcm.api.WCM _Site
- com.ibm.workplace.wcm.api.WCM _SiteArea
- com.ibm.workplace.wcm.api.WCM _Taxonomy
- com.ibm.workplace.wcm.api.WCM _TextComponent
- com.ibm.workplace.wcm.api.WCM _Workflow
- com.ibm.workplace.wcm.api.WCM _WorkflowStage
When creating a new content item, you can specify a default authoring template by providing the document ID of the authoring template in the "atid" parameter:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&atid=com.ibm.workplace.wcm.api.WCM _AuthoringTemplate/ID1
When creating site areas, content items and categories, you can specify the document ID of the parent item to save the new item under. Specify this ID in the "pid" parameter:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&pid=com.ibm.workplace.wcm.api.WCM _SiteArea/ID
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _SiteArea&pid=com.ibm.workplace.wcm.api.WCM _Site/ID
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Category&pid=com.ibm.workplace.wcm.api.WCM _Taxonomy/ID
When creating site areas you can specify the position of the new site area using an &position parameter. You can specify to save the new site area at the start or end relative to any existing site areas. If not specified, the new site area will be saved at the start relative to any existing site areas:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _SiteArea&position=start
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _SiteArea&position=end
- move
- Move a site area or content item.
For example, to open the move dialog for a content item or site area:
?wcmAuthoringAction=move&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
A move direction is specified as "1" for up and "-1" for down.
For example, to move a content item up one position:
?wcmAuthoringAction=move&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&pid=com.ibm.workplace.wcm.api.WCM _SiteArea/ID1&moveDirection=1
- viewversions
- Open the versions dialog for an item. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=viewversions&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
- viewhistory
- Open the history dialog for an item. You must also specify the "docid" of the item.
For example:
?wcmAuthoringAction=viewhistory&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
Populating fields during content creation
When using the new and edit parameters with content items, you can also add data to different fields in the content item using a URL.
For example, to add "newcontent" as the name of the content item, you would use this URL:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.content.name=newcontent
The following parameters can be used to populate fields during content creation:
- &wcmfield.content.name=
- &wcmfield.content.title=
- &wcmfield.content.description=
- &wcmfield.content.authors=
- &wcmfield.content.owners=
- &wcmfield.content.publishDate=
- &wcmfield.content.expiryDate=
- &wcmfield.content.generalDateOne=
- &wcmfield.content.generalDateTwo=
- &wcmfield.content.workflow=
- &wcmfield.content.categories=
- &wcmfield.content.keywords=
- &wcmfield.element.[elementname]= (You replace [elementname] with the name of the element you are populating.)
The element parameter can only be used with the following element types:
- Text
- Html
- Rich text
- Option Selection
- User Selection
- Date and time
- Number
- JSP
- Link
- Component Reference
When populating fields that can include more than one value (authors, owners, categories, keywords) you can specify multiple values:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.content.keywords=keyword1&wcmfield.content.keywords=keyword2
When populating fields with user ids your must use this format:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.content.authors=uid=usera
When populating date fields, the date format must be US English. Either a date and time, or just a date can be specified. If only a date is specified, the time used will be 12:00:00 AM.
For example:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.content.generalDateOne=Feb 14, 2008 12:53:03 PM
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.content.generalDateOne=Feb 14, 2008
The date and time set here are based on the server's timezone, not the timezone of the user's computer. When populating a JSP element, you need to specify the path to the JSP file:
?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.element.jspelementname=/wjsp/html/example.jsp
When populating a component reference element, you specify the component to reference.
For example:
&wcmfield.element.mycompref.type=com.aptrix.pluto.cmpnt.NavigatorCmpnt&wcmfield.element.mycompref.id=e4bdf10042d0769698ccbeb0e25cc973
When populating an option selection element, you specify each selection option.
For example:
&wcmfield.element.[elementname]=AA&wcmfield.element.[elementname]=BB
When populating a user selection element, you specify each user.
For example:
&wcmfield.element.[elementname]=uid=wpsadmin,o=default organization&wcmfield.element.[elementname]=uid=wpsadmin2,o=default organization
When populating a Link element, you can specify the following parameters:
- Adding a link to a content item:
- &wcmfield.element.[elementname].type=content&wcmfield.element.[elementname].id=contentID
- Adding a link to a link component:
- &wcmfield.element.[elementname].type=link&wcmfield.element.[elementname].id=linkcomponentID
- Adding a link to an image or file resource component:
- &wcmfield.element.[elementname].type=resource&wcmfield.element.[elementname].id=componentID
- Adding a link to a URL:
- &wcmfield.element.[elementname].type=external&wcmfield.element.[elementname].externalReference=myurl
- To specify whether to use the name of the item you are linking to as the link text, add this to the URL:
- &wcmfield.element.[elementname].useReferenceLinkText=true
- Specifying an image to display as the link, add this to the URL:
- &wcmfield.element.[elementname].linkImage=imagecomponentID
- Specifying the text of the link, add this to the URL:
- &wcmfield.element.[elementname].linkText=text
- Specifying the description of the link, add this to the URL:
- &wcmfield.element.[elementname].linkDescription=text
- Specifying a link target, add this to the URL:
- &wcmfield.element.[elementname].linkTarget=
- _blank
- _parent
- _self
- _top
- targetname
Save actions
- autoSave
- This is used to save a controllable. This happens in the background and is not displayed to users.
For example:
&wcmfield.autosave=true
- saveValidate
- This parameter determines if warning and error messages resulting from the autosave will be displayed to the user. If set to "true", warning and error messages will be displayed to the user. If set to false, messages are suppressed. The default is true.
For example:
&wcmfield.saveValidate=false
Add comments to the item history
You can add a comment to the item history by adding &comment=comment to the URL.
For example:
http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&createDraft=true&comment=comment
Examples
Open the versions view for an item: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=viewversions&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
Open the history view for an item: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=viewhistory&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
Open a content item in read mode: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=read&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
Open a content item in edit mode: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1
Move a content item up: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=move&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&moveDirection=1&pid=com.ibm.workplace.wcm.api.WCM _SiteArea/ID1
Move a site area down: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=move&docid=com.ibm.workplace.wcm.api.WCM _SiteArea/ID1&moveDirection=-1&pid=com.ibm.workplace.wcm.api.WCM _SiteArea/ID1
Create a new content item with title of 'newcontent': http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&wcmfield.content.title=newcontent
To open a content item in edit mode and automatically change keywords: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&wcmfield.content.keywords=keyword1&wcmfield.content.keywords=keyword2
To edit a content item, automatically change the keywords and use autosave to automatically save the content (no dialog opens): http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&wcmfield.content.keywords=keyword1&wcmfield.content.keywords=keyword2&wcmfield.autosave=true
To edit a content item, automatically save the item and prevent any validation exception from being displayed, use autosave with saveValidate=false: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&wcmfield.content.keywords=keyword1&wcmfield.autosave=true&wcmfield.saveValidate=false
To create content item, set the name and use autosave to automatically save the content (no dialog opens). The authoring template used by the content item must have a workflow pre-selected: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=new&type=com.ibm.workplace.wcm.api.WCM _Content&atid=com.aptrix.pluto.presentation.Template/ID1&pid=com.ibm.workplace.wcm.api.WCM _SiteArea/ID2&wcmfield.content.name=newcontent&wcmfield.autosave=true&wcmfield.saveValidate=true
To edit a content item and create a draft on the edit and set the history log comment: http://<host>/wps/myportal/wcmAuthoring?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM _Content/ID1&createDraft=true&comment=comment
Parent topic
Extending WCM