<?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: Fetching custom aspect, its properties and its constraints in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/fetching-custom-aspect-its-properties-and-its-constraints/m-p/287594#M240724</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How you want to present this is not hugely clear, but in your webscript you need to get a reference to a document and then everything to do with this is "within" that document object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you had a document nodeRef in your webscript you could do&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;document = search.findNode(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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you had a name or path you would need to do a search which would always return an array of document nodeRefs (even if it only returns a single node it will return an array with one element).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you can get properties using code like:-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var myprop = document.properties["cm:name"];&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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;subsituting "cm:name" with your property name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to check if a document has an aspect you can use&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;document.hasAspect("aspectname");&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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bob Johnson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jun 2013 14:30:02 GMT</pubDate>
    <dc:creator>rjohnson</dc:creator>
    <dc:date>2013-06-07T14:30:02Z</dc:date>
    <item>
      <title>Fetching custom aspect, its properties and its constraints</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/fetching-custom-aspect-its-properties-and-its-constraints/m-p/287593#M240723</link>
      <description>I'm new to alfresco and the webscript development. I have a requirement to fetch customs aspects with its properties and constraints (if any). Is there any possible way to achieve this in JS webscript? I'd like to go with JS on the first hand. If this is not possible with JS, how can we do this in j</description>
      <pubDate>Fri, 07 Jun 2013 09:27:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/fetching-custom-aspect-its-properties-and-its-constraints/m-p/287593#M240723</guid>
      <dc:creator>vishal3521</dc:creator>
      <dc:date>2013-06-07T09:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching custom aspect, its properties and its constraints</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/fetching-custom-aspect-its-properties-and-its-constraints/m-p/287594#M240724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How you want to present this is not hugely clear, but in your webscript you need to get a reference to a document and then everything to do with this is "within" that document object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you had a document nodeRef in your webscript you could do&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;document = search.findNode(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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you had a name or path you would need to do a search which would always return an array of document nodeRefs (even if it only returns a single node it will return an array with one element).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you can get properties using code like:-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var myprop = document.properties["cm:name"];&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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;subsituting "cm:name" with your property name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to check if a document has an aspect you can use&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;document.hasAspect("aspectname");&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;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bob Johnson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 14:30:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/fetching-custom-aspect-its-properties-and-its-constraints/m-p/287594#M240724</guid>
      <dc:creator>rjohnson</dc:creator>
      <dc:date>2013-06-07T14:30:02Z</dc:date>
    </item>
  </channel>
</rss>

