10-03-2008 03:12 AM
06-29-2009 06:25 AM
06-29-2009 07:24 AM
06-29-2009 07:45 AM
10-20-2009 08:48 AM
10-28-2009 06:45 AM
12-09-2009 07:46 PM
05-25-2010 11:42 AM
05-28-2010 11:33 AM
05-29-2010 03:06 AM
private void setupSpaceRuleConvToPDF(NodeRef data){
Rule rule=new Rule();
rule.setRuleType("inbound");
rule.setTitle("Transform to PDF n copy to Data-PDF");
rule.setDescription("Transform to PDF n copy to Data-PDF");
rule.applyToChildren(false);
// rule.setExecuteAsynchronously(true);
System.out.println("Rule creation started…Part-II");
CompositeAction compositeAction = getActionService().createCompositeAction();
rule.setAction(compositeAction);
ActionCondition actionCondition = getActionService().createActionCondition("no-condition");
actionCondition.setParameterValues(new HashMap());
compositeAction.addActionCondition(actionCondition);
IHandler handler=null;
Map repoActionParams = new HashMap();
Map actionParams=new HashMap();
NodeRef destination = new NodeRef(Repository.getStoreRef(),(String)getNodeService().getProperty(data, ContentModel.ASPECT_COPIEDFROM));
actionParams.put("actionName", "transform");
actionParams.put("transformer", "application/pdf");
actionParams.put("destinationLocation",destination); // prntDestinationNodeRef
actionParams.put("actionSummary", "Transform and copy content to a specific space");
try {
handler=(IHandler)Class.forName("org.alfresco.web.bean.actions.handlers.TransformHandler").newInstance();
} catch (Exception e) {
System.out.println("Class Generation Exception:"+e);
}
if(handler != null){
handler.prepareForSave(actionParams, repoActionParams);
}
//System.out.println("B4 saving action");
Action action = getActionService().createAction("transform");
action.setParameterValues(repoActionParams);
compositeAction.addAction(action);
getRuleService().saveRule(data, rule);
}
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.