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.
List<Node> listNode = browseBean.getContent() ;
public void updateDocumentProperties() { Node currentSpace = this.browseBean.getActionSpace(); FacesContext context = FacesContext.getCurrentInstance(); List<Node> listNode = browseBean.getContent() ; if(listNode != null) { for (Node node : listNode) { UserTransaction tx = null; try { tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); tx.begin(); Map<String, Object> props = currentSpace.getProperties() ; Iterator<String> iterProps = props.keySet().iterator(); while (iterProps.hasNext()) { String propName = iterProps.next(); QName qname = QName.createQName(propName); // make sure the property is represented correctly Serializable propValue = (Serializable)props.get(propName); // check for empty strings when using number types, set to null in this case if(qname.toPrefixString(this.namespaceService).indexOf("custom:") == 0) this.nodeService.setProperty(node.getNodeRef(),QName.createQName(propName),propValue) ; } // give subclasses a chance to perform custom processing before committing performCustomProcessing(context); // commit the transaction tx.commit(); } catch (Throwable e) { // rollback the transaction try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} Utils.addErrorMessage(MessageFormat.format(Application.getMessage( FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e); } } } }
List<NodeRef> childNodes = new ArrayList<NodeRef>(); List<ChildAssociationRef> childRefs = this.nodeService.getChildAssocs(currentSpace, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef ref: childRefs) { // create our Node representation from the NodeRef NodeRef nodeRef = ref.getChildRef(); if (this.nodeService.exists(nodeRef)) { <if node is content> (type checking omitted for brevity) childNodes.add(nodeRef); } }