当前位置: 首页>>代码示例>>Java>>正文


Java CompositeAction.setTitle方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.action.CompositeAction.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeAction.setTitle方法的具体用法?Java CompositeAction.setTitle怎么用?Java CompositeAction.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.action.CompositeAction的用法示例。


在下文中一共展示了CompositeAction.setTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAsyncCompositeActionExecute

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
/**
 * Test async composite action execution
 */
public void testAsyncCompositeActionExecute()
{
    // Create the composite action
    Action action1 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action1.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_LOCKABLE);
    Action action2 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action2.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);        
    CompositeAction compAction = this.actionService.createCompositeAction();
    compAction.setTitle("title");
    compAction.setDescription("description");
    compAction.addAction(action1);
    compAction.addAction(action2);
    compAction.setExecuteAsynchronously(true);
    
    // Execute the composite action
    this.actionService.executeAction(compAction, this.nodeRef);
    
    setComplete();
    endTransaction();
    
    final NodeService finalNodeService = this.nodeService;
    final NodeRef finalNodeRef = this.nodeRef;
    
    postAsyncActionTest(
            this.transactionService,
            1000, 
            10, 
            new AsyncTest()
            {
                public String executeTest() 
                {
                    boolean result = finalNodeService.hasAspect(finalNodeRef, ContentModel.ASPECT_VERSIONABLE) &&
                    finalNodeService.hasAspect(finalNodeRef, ContentModel.ASPECT_LOCKABLE);
                    return result ? null : "Expected aspects Versionable & Lockable";
                };
            });
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:ActionServiceImplTest.java

示例2: testAsyncCompositeActionExecute

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
/**
 * Test async composite action execution
 */
public void testAsyncCompositeActionExecute()
{
    // Create the composite action
    Action action1 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action1.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_LOCKABLE);
    Action action2 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action2.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);        
    CompositeAction compAction = this.actionService.createCompositeAction();
    compAction.setTitle("title");
    compAction.setDescription("description");
    compAction.addAction(action1);
    compAction.addAction(action2);
    compAction.setExecuteAsynchronously(true);
    
    // Execute the composite action
    this.actionService.executeAction(compAction, this.nodeRef);
    
    setComplete();
    endTransaction();
    
    final NodeService finalNodeService = this.nodeService;
    final NodeRef finalNodeRef = this.nodeRef;
    
    postAsyncActionTest(
            this.transactionService,
            1000, 
            10, 
            new AsyncTest()
            {
                public String executeTest() 
                {
                	boolean result = finalNodeService.hasAspect(finalNodeRef, ContentModel.ASPECT_VERSIONABLE) &&
                    finalNodeService.hasAspect(finalNodeRef, ContentModel.ASPECT_LOCKABLE);
                	return result ? null : "Expected aspects Versionable & Lockable";
                };
            });
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:41,代码来源:ActionServiceImplTest.java

示例3: testExecuteAction

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
/**
 * Test execute action
 */
public void testExecuteAction()
{
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    Action action = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);
    
    this.actionService.executeAction(action, this.nodeRef);
    assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.nodeService.removeAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE);
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    ActionCondition condition = this.actionService.createActionCondition(ComparePropertyValueEvaluator.NAME);
    condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "*.doc");
    action.addActionCondition(condition);
            
    this.actionService.executeAction(action, this.nodeRef);
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.actionService.executeAction(action, this.nodeRef, true);
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.actionService.executeAction(action, this.nodeRef, false);
    assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.nodeService.removeAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE);
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.nodeService.setProperty(this.nodeRef, ContentModel.PROP_NAME, "myDocument.doc");
    this.actionService.executeAction(action, this.nodeRef);
    assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.nodeService.removeAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE);
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    this.nodeService.removeAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE);
    assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
    
    // Create the composite action
    Action action1 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action1.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_LOCKABLE);
    Action action2 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action2.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);        
    CompositeAction compAction = this.actionService.createCompositeAction();
    compAction.setTitle("title");
    compAction.setDescription("description");
    compAction.addAction(action1);
    compAction.addAction(action2);
    
    // Execute the composite action
    this.actionService.executeAction(compAction, this.nodeRef);
    
    assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_LOCKABLE));
    assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:60,代码来源:ActionServiceImplTest.java

示例4: testSyncFailureBehaviour

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
/**
 * Test sync failure behaviour
 */
public void testSyncFailureBehaviour()
{
    // Create an action that is going to fail
    Action action = createFailingMoveAction(true);
    
    try
    {
        this.actionService.executeAction(action, this.nodeRef);
        
        // Fail if we get there since the exception should have been raised
        fail("An exception should have been raised.");
    }
    catch (RuntimeException exception)
    {
        // Good!  The exception was raised correctly
    }
    
    // Test what happens when a element of a composite action fails (should raise and bubble up to parent bahviour)        
    // Create the composite action
    Action action1 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action1.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_LOCKABLE);
    Action action2 = this.actionService.createAction(AddFeaturesActionExecuter.NAME);
    action2.setParameterValue(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, QName.createQName("{test}badDogAspect"));        
    CompositeAction compAction = this.actionService.createCompositeAction();
    compAction.setTitle("title");
    compAction.setDescription("description");
    compAction.addAction(action1);
    compAction.addAction(action2);
    
    try
    {
        // Execute the composite action
        this.actionService.executeAction(compAction, this.nodeRef);
        
        fail("An exception should have been raised here !!");
    }
    catch (RuntimeException runtimeException)
    {
        // Good! The exception was raised
    }        
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:45,代码来源:ActionServiceImplTest.java


注:本文中的org.alfresco.service.cmr.action.CompositeAction.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。