Using remote actions
Remote actions are used in the query string of a URL to trigger
actions from the IBM® Lotus Web Content Management™ application.
Remote actions are appended to the URL of an authoring portlet. For example:http://[host]/wps/myportal/wcmAuthoring?wcmAuthoringAction=action
You 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:Note: 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. For example, com.ibm.workplace.wcm.api.WCM_Content/ID1
- approve
- Used to 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
- ?wcmAuthoringAction=approve&docid=com.ibm.workplace.wcm.api.WCM_Content/ID1&docid=com.ibm.workplace.wcm.api.WCM_Content/ID2
- decline
- Used to 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
- ?wcmAuthoringAction=decline&docid=com.ibm.workplace.wcm.api.WCM_Content/ID1&docid=com.ibm.workplace.wcm.api.WCM_Content/ID2
- delete
- Used to 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
- ?wcmAuthoringAction=delete&docid=com.ibm.workplace.wcm.api.WCM_Content/ID1&docid=com.ibm.workplace.wcm.api.WCM_Content/ID2
- edit
- Used to 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
- ?wcmAuthoringAction=edit&docid=com.ibm.workplace.wcm.api.WCM_Content/ID1&docid=com.ibm.workplace.wcm.api.WCM_Content/ID2
- read
- Used to 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
- ?wcmAuthoringAction=read&docid=com.ibm.workplace.wcm.api.WCM_Content/ID1&docid=com.ibm.workplace.wcm.api.WCM_Content/ID2
- openmainview
- Used to 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
- Used to 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
- move
- Used to 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&pid=com.ibm.workplace.wcm.api.WCM_SiteArea/ID2
- ?wcmAuthoringAction=move&docid=com.ibm.workplace.wcm.api.WCM_SiteArea/ID1&pid=com.ibm.workplace.wcm.api.WCM_Site/ID2
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
- Used to 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
- Used to 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.)Note: 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 00: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=/wps/wcm/jsp/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:
- &useReferenceLinkText=true
- Specifying an image to display as the link, add this to the URL:
- &linkImage=imagecomponentID
- Specifying the text of the link, add this to the URL:
- &linkText=text
- Specifying the description of the link, add this to the URL:
- &linkDescription=text
- Specifying a link target, add this to the URL:
- &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:
- 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
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
Parent topic: Extending Web Content Management
|
|
|