<?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: [Resolved] How to know if a nodeRef has the property in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222826#M175956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know the context of your needs, but maybe you can attach this single property to a dedicated aspect, and then test if the Node has the aspect, with the nodeService.hasAspect method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would that be OK ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Oct 2009 15:33:07 GMT</pubDate>
    <dc:creator>jayjayecl</dc:creator>
    <dc:date>2009-10-23T15:33:07Z</dc:date>
    <item>
      <title>[Resolved] How to know if a nodeRef has the property</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222825#M175955</link>
      <description>Hello,I would like to test if a nodeRef has the property "myProperty". If I do this :QName PROP_QNAME_MY_PROPERTY = QName.createQName("http://www.custom.ch/model/custom/1.0", "myProperty");Object value = nodeService.getProperty(destination, PROP_QNAME_MY_PROPERTY);if (value==null){&amp;nbsp; …}else{&amp;nbsp; …}‍‍‍‍‍</description>
      <pubDate>Fri, 23 Oct 2009 13:34:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222825#M175955</guid>
      <dc:creator>dranakan</dc:creator>
      <dc:date>2009-10-23T13:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: [Resolved] How to know if a nodeRef has the property</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222826#M175956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know the context of your needs, but maybe you can attach this single property to a dedicated aspect, and then test if the Node has the aspect, with the nodeService.hasAspect method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would that be OK ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2009 15:33:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222826#M175956</guid>
      <dc:creator>jayjayecl</dc:creator>
      <dc:date>2009-10-23T15:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: [Resolved] How to know if a nodeRef has the property</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222827#M175957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Alfresco uses a very liberal property policy, which allows you to add non-defined QNAME's to nodes (via setProperty). That means that the reverse method, (getProperty) does not know if the property has been defined; it only checks if it has been set. If you want to see which properties are defined, you have to retrieve the node type and aspect types - and use the dictionary service to cross reference these types to their definitions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be certainly easier to use an aspect if this is a one-time check though &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 07:27:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222827#M175957</guid>
      <dc:creator>rogier_oudshoor</dc:creator>
      <dc:date>2009-10-26T07:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: [Resolved] How to know if a nodeRef has the property</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222828#M175958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks JayJayECL and rogier.oudshoorn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;this single property to a dedicated aspect&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I already to that in some cases and it's work perfectly. But in my model I have define a property at top level (concern all documents), therefore I use simple property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;use the dictionary service&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I think I need to get the URI of the NodeRef and compare to the URI of my models… but I wanted avoid this because if I create in the futur a new model extending this with the property that I check, I have to add this new model URI in the comparaison…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 08:52:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222828#M175958</guid>
      <dc:creator>dranakan</dc:creator>
      <dc:date>2009-10-26T08:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: [Resolved] How to know if a nodeRef has the property</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222829#M175959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To know if a property (setted or not setted) to a document : &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;…&lt;BR /&gt;Node currentNode =new Node(actionedUponNodeRef);&lt;BR /&gt;String currentNodeURI=currentNode.getType().getNamespaceURI();&lt;BR /&gt;if (currentNodeURI.equals("&lt;A href="http://www.custom.ch/model/general/1.0" rel="nofollow noopener noreferrer"&gt;http://www.custom.ch/model/general/1.0&lt;/A&gt;")){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // I know that the property is setted on the document in this model &lt;A href="http://www.custom.ch/model/general/1.0" rel="nofollow noopener noreferrer"&gt;http://www.custom.ch/model/general/1.0&lt;/A&gt;.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;In this exemple the property to check is setted to a main document in the model &lt;/SPAN&gt;&lt;A href="http://www.custom.ch/model/general/1.0" rel="nofollow noopener noreferrer"&gt;http://www.custom.ch/model/general/1.0&lt;/A&gt;&lt;SPAN&gt;. (All documents in this model have the properties). If someone want to check a property which is not apply to all documents : compare the URI + type (compare the QNames).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The disadvantage of the comparaison with the URI is when we create a new model extending &lt;/SPAN&gt;&lt;A href="http://www.custom.ch/model/general/1.0" rel="nofollow noopener noreferrer"&gt;http://www.custom.ch/model/general/1.0&lt;/A&gt;&lt;SPAN&gt;, (the property will be also on all document), we have to add in the test…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another way to compare if a property is in noderef is to set a value by default and compare with the method described in the firt post.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 10:40:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/resolved-how-to-know-if-a-noderef-has-the-property/m-p/222829#M175959</guid>
      <dc:creator>dranakan</dc:creator>
      <dc:date>2009-10-26T10:40:17Z</dc:date>
    </item>
  </channel>
</rss>

