<?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: NodeRef syntax in JavaScript API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70629#M45617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kevin, again something that I'll try out once we get to the 1.4 release.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2006 08:04:09 GMT</pubDate>
    <dc:creator>simon</dc:creator>
    <dc:date>2006-09-05T08:04:09Z</dc:date>
    <item>
      <title>NodeRef syntax in JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70625#M45613</link>
      <description>Hi Alfresco,I'm trying to add categories to a document but started with a locale as this seems less complex to start with. Problem is I need to assign a nodeRef to the property but how should this nodeRef look like? In the node browser a nodeRef looks like workspace://SpacesStore/666345ce-1d81-11db-</description>
      <pubDate>Mon, 04 Sep 2006 10:59:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70625#M45613</guid>
      <dc:creator>simon</dc:creator>
      <dc:date>2006-09-04T10:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: NodeRef syntax in JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70626#M45614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JavaScript API does not deal with NodeRef values - everything is wrapped in an OO style API, so it deals with scriptable Node objects. This means any 'd:noderef' property value should be assigned a Node object directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you need to get hold the Node that represents your category - by query i expect or from an existing Node that has the category you need already assigned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var folder = companyhome;&lt;BR /&gt;var copy = document.copy(folder);&lt;BR /&gt;if (copy != null)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; copy.name = "new_";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // Add the English category to the document &lt;BR /&gt;&amp;nbsp;&amp;nbsp; var node = search.luceneSearch(……)[0];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; document.properties["cm:locale"] = node;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; copy.save();&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;/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;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 11:08:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70626#M45614</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2006-09-04T11:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: NodeRef syntax in JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70627#M45615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kevin, it works like it should! I can add a locale with JavaScript now. One small extra question… how to realize this for collection aspects, the generalclassifiable for example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var nodeRef = search.luceneSearch("TYPE:\"{&lt;A href="http://www.alfresco.org/model/content/1.0}category\" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}category\&lt;/A&gt;" AND&amp;nbsp; PATH:\"/cm:generalclassifiable//cm:MyCategory\"")[0];&lt;BR /&gt;copy.properties["cm:generalclassifiable"] = nodeRef;&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Doesn't work because the copy.properties excepts a collection element. Tried to remove the index ([0]) at the end of the nodRef and to add an index at the end of the copy.properties but this doesn't solve it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I add this nodeRef without removing the other categories?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 14:56:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70627#M45615</guid>
      <dc:creator>simon</dc:creator>
      <dc:date>2006-09-04T14:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: NodeRef syntax in JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70628#M45616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The 1.4 JavaScript engine now correctly supports multi-value properties - so you will be able to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var categories = new Array(1);&lt;BR /&gt;var nodeRef = search.luceneSearch("TYPE:\"{&lt;A href="http://www.alfresco.org/model/content/1.0}category\" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}category\&lt;/A&gt;" AND&amp;nbsp; PATH:\"/cm:generalclassifiable//cm:MyCategory\"")[0];&lt;BR /&gt;categories[0] = nodeRef;&lt;BR /&gt;// … add further categories here to the array&lt;BR /&gt;copy.properties["cm:generalclassifiable"] = categories; &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;So to set a multi-value property, you simply fill an array with the appropriate object type and assign that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 16:56:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70628#M45616</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2006-09-04T16:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: NodeRef syntax in JavaScript API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70629#M45617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kevin, again something that I'll try out once we get to the 1.4 release.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 08:04:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/noderef-syntax-in-javascript-api/m-p/70629#M45617</guid>
      <dc:creator>simon</dc:creator>
      <dc:date>2006-09-05T08:04:09Z</dc:date>
    </item>
  </channel>
</rss>

