本文整理汇总了Java中org.alfresco.service.cmr.action.Action.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Action.setTitle方法的具体用法?Java Action.setTitle怎么用?Java Action.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.action.Action
的用法示例。
在下文中一共展示了Action.setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSimpleProperties
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
public void testSimpleProperties()
{
Action action = (Action)create();
// Check the default values
assertFalse(action.getExecuteAsychronously());
assertNull(action.getCompensatingAction());
// Set some values
action.setTitle("title");
action.setDescription("description");
action.setExecuteAsynchronously(true);
Action compensatingAction = new ActionImpl(null, GUID.generate(), "actionDefintionName", null);
action.setCompensatingAction(compensatingAction);
// Check the values have been set
assertEquals("title", action.getTitle());
assertEquals("description", action.getDescription());
assertTrue(action.getExecuteAsychronously());
assertEquals(compensatingAction, action.getCompensatingAction());
}
示例2: testOwningNodeRef
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
public void testOwningNodeRef()
{
// Create the action
Action action = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
String actionId = action.getId();
// Set the parameters of the action
action.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);
// Set the title and description of the action
action.setTitle("title");
action.setDescription("description");
action.setExecuteAsynchronously(true);
// Check the owning node ref
//assertNull(action.getOwningNodeRef());
// Save the action
this.actionService.saveAction(this.nodeRef, action);
// Get the action
this.actionService.getAction(this.nodeRef, actionId);
}
示例3: populateActionProperties
import org.alfresco.service.cmr.action.Action; //导入方法依赖的package包/类
/**
* Populates the action properties from the node reference
*
* @param actionNodeRef the action node reference
* @param action the action
*/
private void populateActionProperties(NodeRef actionNodeRef, Action action)
{
Map<QName, Serializable> props = this.nodeService.getProperties(actionNodeRef);
action.setTitle((String) props.get(ActionModel.PROP_ACTION_TITLE));
action.setDescription((String) props.get(ActionModel.PROP_ACTION_DESCRIPTION));
Boolean trackStatusObj = (Boolean) props.get(ActionModel.PROP_TRACK_STATUS);
action.setTrackStatus(trackStatusObj); // Allowed to be null
Boolean executeAsynchObj = (Boolean) props.get(ActionModel.PROP_EXECUTE_ASYNCHRONOUSLY);
boolean executeAsynch = executeAsynchObj == null ? false : executeAsynchObj.booleanValue();
action.setExecuteAsynchronously(executeAsynch);
((ActionImpl) action).setCreator((String) props.get(ContentModel.PROP_CREATOR));
((ActionImpl) action).setCreatedDate((Date) props.get(ContentModel.PROP_CREATED));
((ActionImpl) action).setModifier((String) props.get(ContentModel.PROP_MODIFIER));
((ActionImpl) action).setModifiedDate((Date) props.get(ContentModel.PROP_MODIFIED));
((ActionImpl) action).setExecutionStartDate((Date) props.get(ActionModel.PROP_EXECUTION_START_DATE));
((ActionImpl) action).setExecutionEndDate((Date) props.get(ActionModel.PROP_EXECUTION_END_DATE));
((ActionImpl) action).setExecutionStatus(ActionStatus.valueOf(props.get(ActionModel.PROP_EXECUTION_ACTION_STATUS)));
((ActionImpl) action).setExecutionFailureMessage((String) props.get(ActionModel.PROP_EXECUTION_FAILURE_MESSAGE));
// Get the compensating action
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(actionNodeRef, RegexQNamePattern.MATCH_ALL,
ActionModel.ASSOC_COMPENSATING_ACTION);
if (assocs.size() != 0)
{
Action compensatingAction = createAction(assocs.get(0).getChildRef());
action.setCompensatingAction(compensatingAction);
}
}