03-23-2015 04:12 AM
NodeRef nodeRef = null;
       
try {
       
    properties.put(ContentModel.PROP_NAME, name);  
   
    nodeRef = getNodeService().createNode(
                           parent, 
                           ContentModel.ASSOC_CONTAINS, 
                           QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name),
                           type, 
                           properties).getChildRef();
                     
          
    if (nodeRef!=null) {
           
        QName CUSTOM_ASPECT_QNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, Constants.aspectTitled);
        Map<QName,Serializable> aspectValues = new HashMap<QName,Serializable>();
        aspectValues.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, Constants.titleProperty), title);
        aspectValues.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, Constants.descriptionProperty), description);
        getNodeService().addAspect(nodeRef, CUSTOM_ASPECT_QNAME, aspectValues);
           
    }
boolean readonly = false;
boolean requiresNew = true
RetryingTransactionCallback<Object> txnWork = new RetryingTransactionCallback<Object>() {
   public Object execute() throws Throwable {
               Create the node…
             }
};
      
TransactionService transactionService = serviceRegistry.getTransactionService();
return transactionService.getRetryingTransactionHelper().doInTransaction(txnWork, readonly, requiresNew);
03-23-2015 06:32 AM
03-23-2015 07:04 AM
03-25-2015 04:33 AM
07-24-2015 05:30 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.