As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
NodeRef target = new NodeRef(new StoreRef("workspace://SpacesStore"), target.getUUID()); this.nodeService.moveNode(source, target, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CHILDREN);
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"); }
// 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. }
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); }
<bean id="format" class="my.company.alfresco.action.MyActionExecuter" parent="action-executer"> <property name="searchService"> <ref bean="SearchService" /> </property> <property name="nodeService"> <ref bean="NodeService"></ref> </property> </bean>
results = searchService.query(workspaceStore, SearchService.LANGUAGE_XPATH, ?????????????);
results = searchService.query(workspaceStore, SearchService.LANGUAGE_LUCENE, "+PATH:\"/app:company_home/cm:selectedDocs\"");