<?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 where should nodes get created? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222595#M175725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have put something similar to the following in the executeImpl method of an ActionExecuterAbstractBase subclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;NodeRef parent = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();&lt;BR /&gt;Map&amp;lt;QName, Serializable&amp;gt; props = new TreeMap&amp;lt;QName, Serializable&amp;gt;();&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "name"), "test dump");&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "title"), "testing node create");&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "author"), "Glenn");&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "description"), "test description");&lt;BR /&gt;nodeService.createNode(parent, &lt;BR /&gt;ContentModel.ASSOC_CHILDREN, &lt;BR /&gt;QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "test dump"), &lt;BR /&gt;QName.createQName("kato.model", "criteria"), &lt;BR /&gt;props);&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Which, when run, generates this error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to run Actions due to error: 00020002 Found 1 integrity violations: The association source type is incorrect: Source Node: workspace://SpacesStore/b1761401-a167-4fdc-9241-885e9526543e Association: Association[ class=ClassDef[name={&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/system/1.0}container" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/system/1.0}container&lt;/A&gt;&lt;SPAN&gt;], name={&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/system/1.0}children" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/system/1.0}children&lt;/A&gt;&lt;SPAN&gt;, target class={&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/system/1.0}base" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/system/1.0}base&lt;/A&gt;&lt;SPAN&gt;, source role=null, target role=null] Required Source Type: {&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/system/1.0}container" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/system/1.0}container&lt;/A&gt;&lt;SPAN&gt; Actual Source Type: {&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/content/1.0}folder" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}folder&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying to put this new node in the same folder as the node on which this action is being run.&amp;nbsp; What is the difference between a container and a folder? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I have registered a kato.model with a custom content type called criteria.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I replaced that first line in the code excerpt with this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;NodeRef parent = nodeService.getRootNode(Repository.getStoreRef());&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The node gets created and I can find it in search results but not by browsing around. Also, the node has a description but no content in it. How do you create a node with content?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Jan 2010 23:15:22 GMT</pubDate>
    <dc:creator>gengstrand</dc:creator>
    <dc:date>2010-01-02T23:15:22Z</dc:date>
    <item>
      <title>where should nodes get created?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222595#M175725</link>
      <description>I have put something similar to the following in the executeImpl method of an ActionExecuterAbstractBase subclass.NodeRef parent = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();Map&amp;lt;QName, Serializable&amp;gt; props = new TreeMap&amp;lt;QName, Serializable&amp;gt;();props.put(QName.createQN</description>
      <pubDate>Sat, 02 Jan 2010 23:15:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222595#M175725</guid>
      <dc:creator>gengstrand</dc:creator>
      <dc:date>2010-01-02T23:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: where should nodes get created?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222596#M175726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You probably want to use cm:contains rather than sys:children.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To write a content property there are some convienence methods on the Node Service that allow you to write Strings to a content properties.&amp;nbsp;&amp;nbsp; And you should also look at the Content Service that will allow you to get a ContentWriter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2010 23:29:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222596#M175726</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2010-01-04T23:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: where should nodes get created?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222597#M175727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, mrogers, your advise was perfect. Here is the corrected, and working, sample code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;NodeRef parent = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();&lt;BR /&gt;props = new TreeMap&amp;lt;QName, Serializable&amp;gt;();&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "name"), "test dump");&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "title"), "testing node create");&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "author"), "Glenn");&lt;BR /&gt;props.put(QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "description"), "test description");&lt;BR /&gt;ChildAssociationRef td = nodeService.createNode(parent, &lt;BR /&gt;&amp;nbsp; ContentModel.ASSOC_CONTAINS, &lt;BR /&gt;&amp;nbsp; QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "test dump"),&lt;BR /&gt;&amp;nbsp; QName.createQName("kato.model", "criteria"),&lt;BR /&gt;&amp;nbsp; props);&lt;BR /&gt;ContentWriter writer = contentService.getWriter(td.getChildRef(), ContentModel.PROP_CONTENT, true);&lt;BR /&gt;writer.putContent("test content");&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;/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>Wed, 06 Jan 2010 05:24:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/where-should-nodes-get-created/m-p/222597#M175727</guid>
      <dc:creator>gengstrand</dc:creator>
      <dc:date>2010-01-06T05:24:53Z</dc:date>
    </item>
  </channel>
</rss>

