本文整理汇总了Java中org.alfresco.service.cmr.action.ActionService类的典型用法代码示例。如果您正苦于以下问题:Java ActionService类的具体用法?Java ActionService怎么用?Java ActionService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionService类属于org.alfresco.service.cmr.action包,在下文中一共展示了ActionService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mockServices
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* @return ServiceRegistry
*/
private ServiceRegistry mockServices()
{
ActionService mockActionService = mockActionService();
NodeService mockNodeService = mockNodeService();
PersonService mockPersonService = mockPersonService();
SearchService mockSearchService = mockSearchService();
SiteService mockSiteService = mockSiteService();
FileFolderService mockFileFolderService = mockFileFolderService();
RepoAdminService mockRepoAdminService = mockRepoAdminService();
SysAdminParams sysAdminParams = new SysAdminParamsImpl();
ServiceRegistry services = mock(ServiceRegistry.class);
when(services.getActionService()).thenReturn(mockActionService);
when(services.getNodeService()).thenReturn(mockNodeService);
when(services.getPersonService()).thenReturn(mockPersonService);
when(services.getSearchService()).thenReturn(mockSearchService);
when(services.getSiteService()).thenReturn(mockSiteService);
when(services.getFileFolderService()).thenReturn(mockFileFolderService);
when(services.getSysAdminParams()).thenReturn(sysAdminParams);
when(services.getRepoAdminService()).thenReturn(mockRepoAdminService);
return services;
}
示例2: mockServices
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* @return ServiceRegistry
*/
private ServiceRegistry mockServices()
{
ActionService mockActionService = mockActionService();
NodeService mockNodeService = mockNodeService();
PersonService mockPersonService = mockPersonService();
SearchService mockSearchService = mockSearchService();
SiteService mockSiteService = mockSiteService();
FileFolderService mockFileFolderService = mockFileFolderService();
ServiceRegistry services = mock(ServiceRegistry.class);
when(services.getActionService()).thenReturn(mockActionService);
when(services.getNodeService()).thenReturn(mockNodeService);
when(services.getPersonService()).thenReturn(mockPersonService);
when(services.getSearchService()).thenReturn(mockSearchService);
when(services.getSiteService()).thenReturn(mockSiteService);
when(services.getFileFolderService()).thenReturn(mockFileFolderService);
return services;
}
示例3: setUp
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
@Before
public void setUp()
{
appCtx = ApplicationContextHelper.getApplicationContext();
// The user that will create locks, this should be different from the user that queries them (ALF-19465)
lockOwner = "jbloggs";
// The 'current' user.
userName = AuthenticationUtil.getAdminUserName();
AuthenticationUtil.setFullyAuthenticatedUser(userName);
transactionService = (TransactionService) appCtx.getBean("TransactionService");
nodeService = (NodeService) appCtx.getBean("NodeService");
rawNodeService = (NodeService) appCtx.getBean("dbNodeService");
lockStore = (LockStore) appCtx.getBean("lockStore");
rootNode = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
interceptor = (LockableAspectInterceptor) appCtx.getBean("lockableAspectInterceptor");
lockService = (LockService)appCtx.getBean("lockService");
fileFolderService = (FileFolderService) appCtx.getBean("FileFolderService");
actionService = (ActionService) appCtx.getBean("ActionService");
}
示例4: onSetUpInTransaction
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* Called at the beginning of all tests
*/
@Override
protected void onSetUpInTransaction() throws Exception
{
this.checkOutCheckInService = (CheckOutCheckInService) this.applicationContext.getBean("checkOutCheckInService");
this.nodeService = (NodeService)this.applicationContext.getBean("nodeService");
this.ruleService = (RuleService)this.applicationContext.getBean("ruleService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
transactionHelper = (RetryingTransactionHelper)applicationContext.getBean("retryingTransactionHelper");
fileFolderService = applicationContext.getBean("fileFolderService", FileFolderService.class);
contentService = applicationContext.getBean("contentService", ContentService.class);
AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent");
authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
// Create the store and get the root node
this.testStoreRef = this.nodeService.createStore(
StoreRef.PROTOCOL_WORKSPACE, "Test_"
+ System.currentTimeMillis());
this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef);
// Get the executer instance
this.executer = (ExecuteAllRulesActionExecuter)this.applicationContext.getBean(ExecuteAllRulesActionExecuter.NAME);
}
示例5: onSetUpInTransaction
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* On setup in transaction override
*/
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
super.onSetUpInTransaction();
// Get a reference to the node service
this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
this.contentService = (ContentService) this.applicationContext.getBean("contentService");
this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
this.transactionService = (TransactionService)this.applicationContext.getBean("transactionComponent");
// Authenticate as the system user
authenticationComponent = (AuthenticationComponent) this.applicationContext
.getBean("authenticationComponent");
authenticationComponent.setSystemUserAsCurrentUser();
// Create the store and get the root node
this.storeRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis());
this.rootNodeRef = this.nodeService.getRootNode(this.storeRef);
}
示例6: setUp
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
this.transactionService = (TransactionService) getServer().getApplicationContext().getBean("TransactionService");
this.nodeService = (NodeService) getServer().getApplicationContext().getBean("NodeService");
this.fileFolderService = (FileFolderService) getServer().getApplicationContext().getBean("FileFolderService");
this.ruleService = (RuleService) getServer().getApplicationContext().getBean("RuleService");
this.actionService = (ActionService) getServer().getApplicationContext().getBean("ActionService");
this.authenticationComponent = (AuthenticationComponent) getServer().getApplicationContext().getBean("authenticationComponent");
this.authenticationComponent.setSystemUserAsCurrentUser();
createTestFolders();
assertNotNull(testWorkNodeRef);
assertNotNull(testNodeRef);
assertNotNull(testNodeRef2);
}
示例7: setUp
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
@Before
public void setUp()
{
// The user that will create locks, this should be different from the user that queries them (ALF-19465)
lockOwner = "jbloggs";
// The 'current' user.
userName = AuthenticationUtil.getAdminUserName();
AuthenticationUtil.setFullyAuthenticatedUser(userName);
transactionService = (TransactionService) appCtx.getBean("TransactionService");
nodeService = (NodeService) appCtx.getBean("NodeService");
rawNodeService = (NodeService) appCtx.getBean("dbNodeService");
lockStore = (LockStore) appCtx.getBean("lockStore");
rootNode = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
interceptor = (LockableAspectInterceptor) appCtx.getBean("lockableAspectInterceptor");
lockService = (LockService)appCtx.getBean("lockService");
fileFolderService = (FileFolderService) appCtx.getBean("FileFolderService");
actionService = (ActionService) appCtx.getBean("ActionService");
}
示例8: onSetUpInTransaction
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* Called at the beginning of all tests
*/
@Override
protected void onSetUpInTransaction() throws Exception
{
this.checkOutCheckInService = (CheckOutCheckInService) this.applicationContext.getBean("checkOutCheckInService");
this.nodeService = (NodeService)this.applicationContext.getBean("nodeService");
this.ruleService = (RuleService)this.applicationContext.getBean("ruleService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
transactionHelper = (RetryingTransactionHelper)applicationContext.getBean("retryingTransactionHelper");
AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent");
authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
// Create the store and get the root node
this.testStoreRef = this.nodeService.createStore(
StoreRef.PROTOCOL_WORKSPACE, "Test_"
+ System.currentTimeMillis());
this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef);
// Get the executer instance
this.executer = (ExecuteAllRulesActionExecuter)this.applicationContext.getBean(ExecuteAllRulesActionExecuter.NAME);
}
示例9: createCreateThumbnailAction
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
public static Action createCreateThumbnailAction(ThumbnailDefinition thumbnailDef, ServiceRegistry services)
{
ActionService actionService = services.getActionService();
Action action = actionService.createAction(CreateThumbnailActionExecuter.NAME);
action.setParameterValue(CreateThumbnailActionExecuter.PARAM_THUMBANIL_NAME, thumbnailDef.getName());
decorateAction(thumbnailDef, action, actionService);
return action;
}
示例10: decorateAction
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
private static void decorateAction(ThumbnailDefinition thumbnailDef, Action action, ActionService actionService)
{
final FailureHandlingOptions failureOptions = thumbnailDef.getFailureHandlingOptions();
long retryPeriod = failureOptions == null ? FailureHandlingOptions.DEFAULT_PERIOD : failureOptions.getRetryPeriod() * 1000l;
int retryCount = failureOptions == null ? FailureHandlingOptions.DEFAULT_RETRY_COUNT : failureOptions.getRetryCount();
long quietPeriod = failureOptions == null ? FailureHandlingOptions.DEFAULT_PERIOD : failureOptions.getQuietPeriod() * 1000l;
boolean quietPeriodRetriesEnabled = failureOptions == null ?
FailureHandlingOptions.DEFAULT_QUIET_PERIOD_RETRIES_ENABLED : failureOptions.getQuietPeriodRetriesEnabled();
// The thumbnail/action should only be run if it is eligible.
Map<String, Serializable> failedThumbnailConditionParams = new HashMap<String, Serializable>();
failedThumbnailConditionParams.put(NodeEligibleForRethumbnailingEvaluator.PARAM_THUMBNAIL_DEFINITION_NAME, thumbnailDef.getName());
failedThumbnailConditionParams.put(NodeEligibleForRethumbnailingEvaluator.PARAM_RETRY_PERIOD, retryPeriod);
failedThumbnailConditionParams.put(NodeEligibleForRethumbnailingEvaluator.PARAM_RETRY_COUNT, retryCount);
failedThumbnailConditionParams.put(NodeEligibleForRethumbnailingEvaluator.PARAM_QUIET_PERIOD, quietPeriod);
failedThumbnailConditionParams.put(NodeEligibleForRethumbnailingEvaluator.PARAM_QUIET_PERIOD_RETRIES_ENABLED, quietPeriodRetriesEnabled);
ActionCondition thumbnailCondition = actionService.createActionCondition(NodeEligibleForRethumbnailingEvaluator.NAME, failedThumbnailConditionParams);
// If it is run and if it fails, then we want a compensating action to run which will mark
// the source node as having failed to produce a thumbnail.
Action applyBrokenThumbnail = actionService.createAction("add-failed-thumbnail");
applyBrokenThumbnail.setParameterValue(AddFailedThumbnailActionExecuter.PARAM_THUMBNAIL_DEFINITION_NAME, thumbnailDef.getName());
applyBrokenThumbnail.setParameterValue(AddFailedThumbnailActionExecuter.PARAM_FAILURE_DATETIME, new Date());
action.addActionCondition(thumbnailCondition);
action.setCompensatingAction(applyBrokenThumbnail);
}
示例11: processActionConstraints
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* This method creates a list of {@link FieldConstraint field constraints}, if there are any.
*
* @return a List<FieldConstraint> if there are any, else Collections.emptyList()
*/
private List<FieldConstraint> processActionConstraints(ParameterDefinition parameterDef,
ActionService actionService)
{
List<FieldConstraint> fieldConstraints = Collections.emptyList();
String paramConstraintName = parameterDef.getParameterConstraintName();
if (paramConstraintName != null)
{
ParameterConstraint paramConstraint = actionService.getParameterConstraint(paramConstraintName);
if (paramConstraint == null)
{
throw new FormException("ParameterConstraint name '" + paramConstraintName + "' not recognised.");
}
else
{
// This map is of allowedValue : display label for that value.
Map<String, String> allowableValuesMap = paramConstraint.getAllowableValues();
// We need to concatenate each key-value entry into a String like "value|displaylabel"
// Then the FormService can display the labels but deal with the values as the underlying data.
List<String> pipeSeparatedAllowedValues = new ArrayList<String>(allowableValuesMap.size());
for (Map.Entry<String, String> entry : allowableValuesMap.entrySet())
{
pipeSeparatedAllowedValues.add(entry.getKey() + "|" + entry.getValue());
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("allowedValues", pipeSeparatedAllowedValues);
// Finally wrap it up in a parameter map.
fieldConstraints = new ArrayList<FieldConstraint>(allowableValuesMap.size());
fieldConstraints.add(new FieldConstraint("LIST", params));
}
}
return fieldConstraints;
}
示例12: getRegistered
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* Gets the list of registered action names
*
* @return the registered action names
*/
public String[] getRegistered()
{
ActionService actionService = services.getActionService();
List<ActionDefinition> defs = actionService.getActionDefinitions();
String[] registered = new String[defs.size()];
int i = 0;
for (ActionDefinition def : defs)
{
registered[i++] = def.getName();
}
return registered;
}
示例13: create
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
/**
* Create an Action
*
* @param actionName
* the action name
* @return the action
*/
public ScriptAction create(String actionName)
{
ScriptAction scriptAction = null;
ActionService actionService = services.getActionService();
ActionDefinition actionDef = actionService.getActionDefinition(actionName);
if (actionDef != null)
{
Action action = actionService.createAction(actionName);
scriptAction = new ScriptAction(this.services, action, actionDef);
scriptAction.setScope(getScope());
}
return scriptAction;
}
示例14: setApplicationContext
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
public void setApplicationContext(ApplicationContext applicationContext)
{
nodeService = (NodeService)applicationContext.getBean("NodeService");
actionService = (ActionService)applicationContext.getBean("ActionService");
transactionService = (TransactionService)applicationContext.getBean("transactionService");
runtimeActionService = (RuntimeActionService)applicationContext.getBean("actionService");
}
示例15: setup
import org.alfresco.service.cmr.action.ActionService; //导入依赖的package包/类
@Before
public void setup() throws SystemException, NotSupportedException
{
try
{
nodeService = (NodeService)ctx.getBean("nodeService");
fileFolderService = (FileFolderService)ctx.getBean("fileFolderService");
transactionService = (TransactionService)ctx.getBean("transactionService");
bulkImporter = (MultiThreadedBulkFilesystemImporter)ctx.getBean("bulkFilesystemImporter");
contentService = (ContentService)ctx.getBean("contentService");
actionService = (ActionService)ctx.getBean("actionService");
ruleService = (RuleService)ctx.getBean("ruleService");
versionService = (VersionService)ctx.getBean("versionService");
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
String s = "BulkFilesystemImport" + System.currentTimeMillis();
txn = transactionService.getUserTransaction();
txn.begin();
AuthenticationUtil.pushAuthentication();
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, s);
rootNodeRef = nodeService.getRootNode(storeRef);
top = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName("{namespace}top"), ContentModel.TYPE_FOLDER).getChildRef();
topLevelFolder = fileFolderService.create(top, s, ContentModel.TYPE_FOLDER);
txn.commit();
}
catch(Throwable e)
{
fail(e.getMessage());
}
}