<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to create nodes using a CMLCreate[]? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250000#M203130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Uhm…I've find a rude way to create the PathRefernce, but I suspect there must be a smarter one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;ParentReference mainParentReference = …&lt;BR /&gt;CMLCreate create1 = new CMLCreate();&lt;BR /&gt;…&lt;BR /&gt;&lt;BR /&gt;// now create a reference to the to-be-created node&lt;BR /&gt;ParentReference previousNodeParentReference = new ParentReference();&lt;BR /&gt;previousNodeParentReference.setPath( mainParentReference.getPath() + "/" + ISO9075.encode( mainParentreference.getChildName() ) );&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;So the idea is to compute the name of each node using the root + "/" + name of inner node.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a simpler and smarter way to obtain the path of to-be-created node?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jan 2011 16:06:07 GMT</pubDate>
    <dc:creator>fluca1978</dc:creator>
    <dc:date>2011-01-20T16:06:07Z</dc:date>
    <item>
      <title>how to create nodes using a CMLCreate[]?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/249999#M203129</link>
      <description>Hi,suppose I want to take advantage of executing an array of CMLCreate as a single transaction to create a folder and content tree. I've got the first CMLCreate that can work fine, but how can I get the parent reference to create the following CMLCreate so that they refer to the first created conten</description>
      <pubDate>Thu, 20 Jan 2011 15:11:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/249999#M203129</guid>
      <dc:creator>fluca1978</dc:creator>
      <dc:date>2011-01-20T15:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to create nodes using a CMLCreate[]?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250000#M203130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Uhm…I've find a rude way to create the PathRefernce, but I suspect there must be a smarter one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;ParentReference mainParentReference = …&lt;BR /&gt;CMLCreate create1 = new CMLCreate();&lt;BR /&gt;…&lt;BR /&gt;&lt;BR /&gt;// now create a reference to the to-be-created node&lt;BR /&gt;ParentReference previousNodeParentReference = new ParentReference();&lt;BR /&gt;previousNodeParentReference.setPath( mainParentReference.getPath() + "/" + ISO9075.encode( mainParentreference.getChildName() ) );&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;So the idea is to compute the name of each node using the root + "/" + name of inner node.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a simpler and smarter way to obtain the path of to-be-created node?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 16:06:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250000#M203130</guid>
      <dc:creator>fluca1978</dc:creator>
      <dc:date>2011-01-20T16:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to create nodes using a CMLCreate[]?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250001#M203131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe I found a smarter way, but I've got still the doubt if this is correct or no: since each CMLCreate contains a ParentReference I can get the parent reference of each CMLCreate and compose the parent reference path and the parent reference child name to get the final path of the node the CML create refers to. Is a stable way of achieving this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jan 2011 10:15:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250001#M203131</guid>
      <dc:creator>fluca1978</dc:creator>
      <dc:date>2011-01-21T10:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to create nodes using a CMLCreate[]?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250002#M203132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is a way. Here's an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;…&lt;BR /&gt;// Create folder (parentFolder where you want to create your folder)&lt;BR /&gt;CMLCreate createFolder = new CMLCreate("1", parentFolder, null, Constants.ASSOC_CONTAINS, null, Constants.TYPE_FOLDER, folderProperties);&lt;BR /&gt;// Create document in newly future created folder (notice id "1" - 3rd parameter)&lt;BR /&gt;CMLCreate create1 = new CMLCreate("2", null, "1", Constants.ASSOC_CONTAINS, null, documentTypeQName, properties);&lt;BR /&gt;// Create another document&lt;BR /&gt;CMLCreate create2 = new CMLCreate("2", null, "1", Constants.ASSOC_CONTAINS, null, documentTypeQName1, properties2);&lt;BR /&gt;cml.setCreate(new CMLCreate[] { createFolder, create1, create2 });&lt;BR /&gt;UpdateResult[] results = getRepositoryService().update(cml);&lt;BR /&gt;…&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jan 2011 12:59:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-create-nodes-using-a-cmlcreate/m-p/250002#M203132</guid>
      <dc:creator>jcustovic</dc:creator>
      <dc:date>2011-01-27T12:59:26Z</dc:date>
    </item>
  </channel>
</rss>

