+

Search Tips   |   Advanced Search

Using remote actions

Remote actions are used to trigger actions from the IBM Web Content Manager application.

We can reference remote actions using plugin tags using the following format:

[plugin:RemoteAction action=" " docid=" " 
dialog=" " dialogSize=" " dialogTitle=" " useCurrentContext=" " showInfoMsg=" " ]

Remote actions can also be appended to the URL of an authoring portlet. For example:

http://[host]/wps/myportal/wcmAuthoring?wcmAuthoringAction=action&param=value
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.

Custom authoring interfaces: There are limitations to the functionality delivered using remote actions. For example, remote actions only support plain text. We cannot use remote actions to add markup into elements such as HTML elements. To create custom authoring interfaces, use the Web Content Manager API in combination with remote actions.

Each web content item 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 using the DocumentID.getID() API method. 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


Remote action types


Populating fields when creating or editing content items and site areas

When using the "new" or "edit" parameters with content items and site areas, we can also add data to different fields in the item using a URL.

For example, to add "newcontent" as the name of the content item, you would use this URL:

The following parameters can be used to populate fields when creating or editing content items and site areas:

For example, when populating content item fields with user ids use this format:

For example, when populating content item workflow and category fields use the document IDs as their values:

For example, when populating content item 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:

The date and time set here are based on the server's timezone, not the timezone of the user's computer.

For example, when populating a content item JSP element, specify the path to the JSP file:

For example, when populating a content item component reference element, we specify the component to reference. For example:

For example, when populating a content item option selection element, we specify each selection option. For example:

For example, when populating a content item user selection element, we specify each user. For example:

For example, when populating a content item link element, we can specify the following parameters:


Save parameters

We can add the following "save" parameters to a remote action tag.


Add comments to the item history

When creating items that use a workflow with "Enter comment on approval" set to true, we can add a comment to the item history by adding comment="comment text" to the URL.

For example:

[plugin:RemoteAction action="edit" docid="com.ibm.workplace.wcm.api.WCM_Content/ID1" 
createDraft="true" comment="comment text"]


Examples

Open the versions view for an item:

Open the history view for an item:

Open a content item in read mode:

Open a content item in edit mode:

Move a content item up:

Move a site area down:

Create a new content item with title of 'newcontent':

To open a content item in edit mode and automatically change keywords:

To edit a content item, automatically change the keywords and use autosave to automatically save the content (no dialog opens):

To edit a content item, automatically save the item and prevent any validation exception from being displayed, use autosave with saveValidate=false:

To create a 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:

To edit a content item and create a draft on the edit and set the history log comment:


Parent: Developing

Related:

Custom authoring interfaces

Create a custom launch page