As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
… <bean id="createProjectBundle" class="org.eve.repo.action.executer.CreateProjectBundleActionExecuter" parent="action-executer"> <property name="eveService"> <ref bean="EveService"/> </property> <!– <property name="applicableTypes"> <list> <value>{http://ec.europa.eu/eve/model/1.0}activity</value> <value>{http://www.alfresco.org/model/content/1.0}folder</value> </list> </property> –> </bean> …
package org.eve.repo.action.executer; import java.util.List; import org.alfresco.repo.action.executer.ActionExecuterAbstractBase; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ParameterDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.eve.EveService; import org.alfresco.repo.action.ParameterDefinitionImpl; public class CreateProjectBundleActionExecuter extends ActionExecuterAbstractBase { public static final String NAME = "createProjectBundle"; public final static String PARAM_BUNDLE_NAME = "bundle-name"; public final static String PARAM_BUNDLE_TITLE = "bundle-title"; public final static String PARAM_BUNDLE_DESCRIPTION = "bundle-description"; /** * The eve service */ private EveService eveService; /** * Set the eve service * * @param eveService * the eve service */ public void setEveService(EveService eveService) { this.eveService = eveService; } @Override protected void executeImpl(Action action, NodeRef actionedUponNodeRef) { eveService.createProjectBundle(actionedUponNodeRef, (String) action.getParameterValue(PARAM_BUNDLE_NAME), (String) action.getParameterValue(PARAM_BUNDLE_TITLE), (String) action.getParameterValue(PARAM_BUNDLE_DESCRIPTION)); } @Override protected void addParameterDefinitions(List<ParameterDefinition> paramList) { // The title passed paramList.add( new ParameterDefinitionImpl( // Create a new parameter defintion to add to the list PARAM_BUNDLE_NAME, // The name used to identify the parameter DataTypeDefinition.TEXT, // The parameter value type true, // Indicates whether the parameter is mandatory getParamDisplayLabel(PARAM_BUNDLE_NAME))); // The parameters display label // The title passed paramList.add(new ParameterDefinitionImpl(PARAM_BUNDLE_TITLE,DataTypeDefinition.TEXT,false,getParamDisplayLabel(PARAM_BUNDLE_TITLE))); // The description passed paramList.add(new ParameterDefinitionImpl(PARAM_BUNDLE_DESCRIPTION,DataTypeDefinition.TEXT,false,getParamDisplayLabel(PARAM_BUNDLE_DESCRIPTION))); // TODO Associated with an action is a title and description. In addition, each parameter has a displayable title. // All these string should be retrieved from I18N bundles to ensure that the repository remains I18N'able. // see http://wiki.alfresco.com/wiki/Custom_Actions#Internationalization_.28I18N.29_of_the_action } }
var createProjectBundle= actions.create("createProjectBundle"); createProjectBundle.parameters.bundle-name = "testbundle"; createProjectBundle.parameters.bundle-title= "testbundle-title"; createProjectBundle.parameters.bundle-description= "testbundle-description"; createPB .execute(space);