04-25-2008 10:24 AM
<!–***************************–>
<!–* Preparateur de document *–>
<!–***************************–>
<bean id="lpr-prepare-document" class="lpr.alfresco.repo.PrepareDocument" parent="action-executer" >
<property name="nodeService">
<ref bean="nodeService" />
</property>
<property name="permissionService">
<ref bean="permissionService" />
</property>
<!–property name="fileFolderService">
<ref bean="FileFolderService" />
</property–>
<!–property name="contentService">
<ref bean="contentService" />
</property–>
</bean>
04-25-2008 12:20 PM
Rule rule = new Rule();
rule.setRuleType("inbound");
// setup the rule and add it to the space
rule.setTitle("Document Preparator (In)");
rule.setDescription("Prepare new document imported in repository");
rule.applyToChildren(true);
rule.setExecuteAsynchronously(true);
rule.setRuleDisabled(false);
CompositeAction compositeAction = actionService.createCompositeAction();
rule.setAction(compositeAction);
compositeAction.addAction(actionService.createAction("lpr-prepare-document"));
compositeAction.addActionCondition(actionService.createActionCondition("no-condition"));
ruleService.saveRule(nodeRef, rule);
compositeAction.addActionCondition(actionService.createActionCondition("no-condition"));
compositeAction.addActionCondition(actionService.createActionCondition("is-subtype"));
04-28-2008 06:40 AM
04-28-2008 07:04 AM
Il faut utiliser la seconde méthode createActionCondition, celle qui permet de passer une map de paramètres pour construire la condition. Tu peux alors spécifier le type qui t'intéresse (param "type", voir classe IsSubTypeEvaluator).
Rule rule = new Rule();
rule.setRuleType("inbound");
// setup the rule and add it to the space
rule.setTitle("Processus Space Creator (In)");
rule.setDescription("Make Processus Space");
rule.applyToChildren(false);
rule.setExecuteAsynchronously(false);
rule.setRuleDisabled(false);
CompositeAction compositeAction = actionService.createCompositeAction();
rule.setAction(compositeAction);
compositeAction.addAction(actionService.createAction("lpr-make-processus-space"));
//compositeAction.addActionCondition(actionService.createActionCondition("no-condition"));
Map<String,Serializable> actionMap = new HashMap<String, Serializable>();
actionMap.put("type", ContentModel.TYPE_FOLDER);
compositeAction.addActionCondition(actionService.createActionCondition("is-subtype",actionMap));
ruleService.saveRule(nodeRef, rule);
<!–*********************************–>
<!–* Createur d'arborescence *–>
<!–*********************************–>
<bean id="lpr-make-processus-space" class="lpr.alfresco.repo.MakeProcessusSpace" parent="action-executer" >
<property name="nodeService">
<ref bean="nodeService" />
</property>
<property name="fileFolderService">
<ref bean="FileFolderService" />
</property>
<property name="ruleService">
<ref bean="RuleService" />
</property>
<property name="actionService">
<ref bean="ActionService" />
</property>
</bean>
<bean id="lpr-make-processus-space-action-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco/messages/action-executer/lpr-make-processus-space-action-messages</value>
</list>
</property>
</bean>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.