02-23-2012 08:52 AM
02-23-2012 03:52 PM
02-24-2012 01:42 AM
02-24-2012 04:36 PM
http://localhost:8080/alfresco/s/someco/example/moveCategory?sourceNodeRef=workspace://SpacesStore/4...
And here is the code: protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) {
final String sourceNodeRefString = req.getParameter("sourceNodeRef");
final String targetNodeRefString = req.getParameter("targetNodeRef");
if (sourceNodeRefString == null || targetNodeRefString == null) {
logger.debug("Source or target node ref not set");
status.setCode(400);
status.setMessage("Required data has not been provided");
status.setRedirect(true);
}
NodeRef sourceNodeRef = new NodeRef(sourceNodeRefString);
NodeRef targetNodeRef = new NodeRef(targetNodeRefString);
String sourceName = (String) nodeService.getProperty(sourceNodeRef, ContentModel.PROP_NAME);
nodeService.moveNode(sourceNodeRef, targetNodeRef, ContentModel.ASSOC_SUBCATEGORIES, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, sourceName));
Map<String, Object> model = new HashMap<String, Object>();
model.put("sourceNodeRef", sourceNodeRefString);
model.put("sourceName", sourceName);
model.put("targetNodeRef", targetNodeRefString);
return model;
}
If you want me to email you an Eclipse project with this code ready to deploy, just PM me.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.