Use remote actions

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

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

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

action

docid

useCurrentContext

dialog

dialogSize

dialogTitle

showInfoMsg

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

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: Remote actions are not intended to be used to create a custom authoring interface. There are limitations to the functionality delivered using remote actions. For example, remote actions only support plain text. You cannot use remote actions to add markup into elements such as HTML elements. You instead use the Web Content Manager API to create custom authoring interfaces.

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 by 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

new

delete

edit

read

openmainview

move

link

copy

approve

decline

saveandapprove

previousstage

viewversions

viewhistory


Populating fields when creating or editing content

When using the "new" or "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:

The following parameters can be used to populate fields when creating or editing content:

When populating fields with user ids use this format:

When populating workflow and category fields use the document IDs as their values:

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:

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:

When populating a component reference element, you specify the component to reference. For example:

When populating an option selection element, you specify each selection option. For example:

When populating a user selection element, you specify each user. For example:

When populating a Link element, you can specify the following parameters:

Add a link to a content item:

Add a link to a link component:

Add a link to an image or file resource component:

Add a link to a URL:

To specify whether to use the name of the item you are linking to as the link text, add this to the tag:

When specifying an image to display as the link, add this to the tag:

When specifying the text of the link, add this to the URL:

When specifying the description of the link, add this to the URL:

When specifying a link target, add this to the URL:


Save parameters

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

autoSave

saveValidate


Add comments to the item history

When creating items that use a workflow with "Enter comment on approval" set to true, you 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:


Developing

Related

Custom authoring interfaces

Create a custom launch page

December 14, 2011
   

 

Apr 1, 2011 1:26:17 PM

});


+

Search Tips   |   Advanced Search