05-06-2008 05:50 AM
…
NodeRef compHomeRef = getCompanyHomeNode(actionedUponNodeRef.getStoreRef());
NodeRef uploadFolderRef = nodeService.getChildByName(compHomeRef, ContentModel.ASSOC_CONTAINS, UPLOAD_FOLDER);
NodeRef taskFolderRef = nodeService.getChildByName(uploadFolderRef, ContentModel.ASSOC_CONTAINS, folderName);
Map<String, Serializable> params = new HashMap<String, Serializable>(1);
params.put(TransformActionExecuter.PARAM_MIME_TYPE, MimetypeMap.MIMETYPE_PDF);
params.put(TransformActionExecuter.PARAM_DESTINATION_FOLDER, taskFolderRef);
params.put(TransformActionExecuter.PARAM_ASSOC_TYPE_QNAME, ContentModel.ASSOC_CHILDREN);
params.put(TransformActionExecuter.PARAM_ASSOC_QNAME, QName.createQName("http://www.namespace.com/model/workflow/1.0", "transformed"));
Action tAction = new ActionImpl(taskFolderRef,ID,TransformActionExecuter.NAME,null);
transformAction = (TransformActionExecuter)applicationContext.getBean(TransformActionExecuter.NAME);
tAction.setParameterValues(params);
transformAction.execute(tAction, taskFolderRef);
…
05-07-2008 04:53 AM
private void doTransformation(Action action, NodeRef folderRef, String MIME)
{
Iterator<ChildAssociationRef> it = nodeService.getChildAssocs(folderRef).iterator();
while(it.hasNext())
{
ChildAssociationRef cref = (ChildAssociationRef)it.next();
ContentData content = (ContentData)nodeService.getProperty(cref.getChildRef(), ContentModel.PROP_CONTENT);
if(content.getMimetype().equals(MIME))
{
this.transformAction.execute(action, cref.getChildRef());
}
}
}
The action is set up like in the previous post holding the destination folder and other params.
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.