08-29-2012 01:37 PM
NodeRef target = new NodeRef(new StoreRef("workspace://SpacesStore"), target.getUUID());
this.nodeService.moveNode(source, target, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CHILDREN);
but target.getUUID() is not correct.08-29-2012 03:37 PM
08-30-2012 03:37 AM
08-30-2012 03:43 AM
08-31-2012 04:16 AM
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
Boolean activeFlag = (Boolean)action.getParameterValue(PARAM_ACTIVE);
if (activeFlag == null) activeFlag = true;
if (logger.isDebugEnabled()) logger.debug("Inside executeImpl");
// set the sc:isActive property to true
// set the sc:published property to now
Map<QName, Serializable> properties = nodeService.getProperties(actionedUponNodeRef);
properties.put(SomeCoModel.PROP_IS_ACTIVE, activeFlag);
if (activeFlag) {
properties.put(SomeCoModel.PROP_PUBLISHED, new Date());
}
Node node = new Node(actionedUponNodeRef);
// if the aspect has already been added, set the properties
if (node.hasAspect(SomeCoModel.ASPECT_SC_WEBABLE)) {
if (logger.isDebugEnabled()) logger.debug("Node has aspect");
nodeService.setProperties(actionedUponNodeRef, properties);
} else {
// otherwise, add the aspect and set the properties
if (logger.isDebugEnabled()) logger.debug("Node does not have aspect");
nodeService.addAspect(actionedUponNodeRef, SomeCoModel.ASPECT_SC_WEBABLE, properties);
}
if (logger.isDebugEnabled()) logger.debug("Ran web enable/disable action");
}
08-31-2012 04:43 AM
// Get all children of the action node
List<ChildAssociationRef> children = nodeService.getChildAssocs(actionedUponNodeRef);
for (ChildAssociationRef childAssociationRef : children){
NodeRef nodeToMove = childAssociationRef.getChildRef();
// For every child call nodeService.move with you target folder nodeRef.
}
08-31-2012 08:52 AM
08-31-2012 09:17 AM
09-03-2012 11:47 AM
protected NodeRef getFolderRef()
{
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
ResultSet resultSet = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "PATH:\"/app:company_home/cm:selectedDocs\"");
return resultSet.getNodeRef(0);
}
and catch a NullPointerException on searchService.query09-04-2012 03:22 AM
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.