<?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 How to apply a custom property to a node in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275725#M228855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have the following code and I'm trying to create a new document of a custom type with a custom property. It successfully creates the node with the custom type({&lt;/SPAN&gt;&lt;A href="http://www.someco.com/model/content/1.0}mine" rel="nofollow noopener noreferrer"&gt;http://www.someco.com/model/content/1.0}mine&lt;/A&gt;&lt;SPAN&gt;) , but it's not assigning the custom property ({&lt;/SPAN&gt;&lt;A href="http://www.someco.com/model/content/1.0}section" rel="nofollow noopener noreferrer"&gt;http://www.someco.com/model/content/1.0}section&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any hints on how to accomplish this? What am I doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;$newNode = $companyHome-&amp;gt;createChild('{&lt;A href="http://www.someco.com/model/content/1.0}mine" rel="nofollow noopener noreferrer"&gt;http://www.someco.com/model/content/1.0}mine&lt;/A&gt;', 'cm_contains', $contentName);&lt;BR /&gt;&lt;BR /&gt;$contentData = new ContentData($newNode, 'cm:content');&lt;BR /&gt;&lt;BR /&gt;$contentData-&amp;gt;mimetype = 'text/html';&lt;BR /&gt;$contentData-&amp;gt;content= "&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;This is my content&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;Content&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;";&lt;BR /&gt;$newNode-&amp;gt;cm_name = $contentName;&lt;BR /&gt;$newNode-&amp;gt;cm_description = 'Page Description';&lt;BR /&gt;$newNode-&amp;gt;sc_section = "ENGL316001";&lt;BR /&gt;$properties = $newNode-&amp;gt;getProperties();&lt;BR /&gt;$properties['{&lt;A href="http://www.someco.com/model/content/1.0}section" rel="nofollow noopener noreferrer"&gt;http://www.someco.com/model/content/1.0}section&lt;/A&gt;'] = "ENGL316001";&lt;BR /&gt;$contentData-&amp;gt;encoding = 'UTF-8';&lt;BR /&gt;$newNode-&amp;gt;cm_content = $contentData;&lt;BR /&gt;$session-&amp;gt;save();&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>Tue, 22 Mar 2011 21:46:51 GMT</pubDate>
    <dc:creator>dallinns</dc:creator>
    <dc:date>2011-03-22T21:46:51Z</dc:date>
    <item>
      <title>How to apply a custom property to a node</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275725#M228855</link>
      <description>I have the following code and I'm trying to create a new document of a custom type with a custom property. It successfully creates the node with the custom type({http://www.someco.com/model/content/1.0}mine) , but it's not assigning the custom property ({http://www.someco.com/model/content/1.0}secti</description>
      <pubDate>Tue, 22 Mar 2011 21:46:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275725#M228855</guid>
      <dc:creator>dallinns</dc:creator>
      <dc:date>2011-03-22T21:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a custom property to a node</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275726#M228856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I needed to call&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;$upload-&amp;gt;setProperties($properties);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;after &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;$properties = $upload-&amp;gt;getProperties();&lt;BR /&gt;$properties['{&lt;A href="http://www.someco.com/model/content/1.0}section" rel="nofollow noopener noreferrer"&gt;http://www.someco.com/model/content/1.0}section&lt;/A&gt;'] = "ENGL316001";&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;to apply the properties to the new node before calling save().&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 18:34:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275726#M228856</guid>
      <dc:creator>dallinns</dc:creator>
      <dc:date>2011-03-23T18:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a custom property to a node</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275727#M228857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thats right … also a quick possibility is to edit the "NamespaceMap.php" and add your Custom Content Model namespace and prefix like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;private $namespaceMap = array(&lt;BR /&gt;"d"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; "&lt;A href="http://www.alfresco.org/model/dictionary/1.0" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0&lt;/A&gt;",&lt;BR /&gt;"sc"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; "&lt;A href="http://www.someco.com/model/content/1.0" rel="nofollow noopener noreferrer"&gt;http://www.someco.com/model/content/1.0&lt;/A&gt;",&lt;BR /&gt;….&lt;BR /&gt;);&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;And then you can edit properties on a Node via the __get and __set like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;$Node-&amp;gt;sc_section = "ENGL316001";&lt;BR /&gt;$Node-&amp;gt;cm_title = "My Title";&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2011 12:43:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-apply-a-custom-property-to-a-node/m-p/275727#M228857</guid>
      <dc:creator>ddanninger</dc:creator>
      <dc:date>2011-03-28T12:43:56Z</dc:date>
    </item>
  </channel>
</rss>

