<?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 know type of node (content or folder) when I have NodeRef and NodeService in scope (Java API) in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-know-type-of-node-content-or-folder-when-i-have-noderef/m-p/109406#M30674</link>
    <description>&lt;P&gt;I have a particular nodeRef variable and nodeService variable in scope inside the java code/method. How can I know the type of the nodeRef - whether it is of type contnet, or type folder.&lt;/P&gt;&lt;P&gt;It seems that nodeRef ( org.alfresco.service.cmr.repository.NodeRef&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; API does not offer any method like getType, or getNodeType.&lt;/P&gt;&lt;P&gt;With nodeRef in scope, how can I know whether the type is content or folder?&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 16:59:38 GMT</pubDate>
    <dc:creator>SG</dc:creator>
    <dc:date>2020-05-13T16:59:38Z</dc:date>
    <item>
      <title>How to know type of node (content or folder) when I have NodeRef and NodeService in scope (Java API)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-know-type-of-node-content-or-folder-when-i-have-noderef/m-p/109406#M30674</link>
      <description>&lt;P&gt;I have a particular nodeRef variable and nodeService variable in scope inside the java code/method. How can I know the type of the nodeRef - whether it is of type contnet, or type folder.&lt;/P&gt;&lt;P&gt;It seems that nodeRef ( org.alfresco.service.cmr.repository.NodeRef&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; API does not offer any method like getType, or getNodeType.&lt;/P&gt;&lt;P&gt;With nodeRef in scope, how can I know whether the type is content or folder?&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 16:59:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-know-type-of-node-content-or-folder-when-i-have-noderef/m-p/109406#M30674</guid>
      <dc:creator>SG</dc:creator>
      <dc:date>2020-05-13T16:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to know type of node (content or folder) when I have NodeRef and NodeService in scope (Java</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-know-type-of-node-content-or-folder-when-i-have-noderef/m-p/109407#M30675</link>
      <description>&lt;P&gt;Well you are looking into wrong class. You have nodeRef and nodeService.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when you call nodeService.getType(nodeRef), you will get the type as QName.&amp;nbsp;&lt;/P&gt;

&lt;PRE&gt;&lt;STRONG&gt;final QName nodeType = &lt;FONT color="#FF0000"&gt;nodeService.getType&lt;/FONT&gt;(nodeRef);
&lt;/STRONG&gt;
&lt;U&gt;Some examples:
&lt;/U&gt;
&lt;U&gt;If nodeRef is of content type (cm:content), you will get following result when you print the node type:
&lt;/U&gt;
{http://www.alfresco.org/model/content/1.0}content 

&lt;U&gt;If nodeRef is of content type (cm:folder), you will get following result when you print the node type:
&lt;/U&gt;
{http://www.alfresco.org/model/content/1.0}folder

&lt;U&gt;If nodeRef is of custom type (demo:whitePaper), you will get following result when you print the node type:
&lt;/U&gt;
{http://www.xyz.com/model/demo/1.0}whitePaper (here http://www.xyz.com/model/demo/1.0 is namespace of your custom model)

Refer this javadoc to know more about QName : http://dev.alfresco.com/resource/AlfrescoOne/5.0/PublicAPI/org/alfresco/service/namespace/QName.html
&lt;/PRE&gt;


&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Refer this javadoc for more detail on nodeService methods and getType method:&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dev.alfresco.com/resource/AlfrescoOne/5.0/PublicAPI/org/alfresco/service/cmr/repository/NodeService.html#getType(org.alfresco.service.cmr.repository.NodeRef)" target="_blank" rel="noopener nofollow noreferrer"&gt;http://dev.alfresco.com/resource/AlfrescoOne/5.0/PublicAPI/org/alfresco/service/cmr/repository/NodeService.html#getType(org.alfresco.service.cmr.repository.NodeRef)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 21:05:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-know-type-of-node-content-or-folder-when-i-have-noderef/m-p/109407#M30675</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-05-13T21:05:29Z</dc:date>
    </item>
  </channel>
</rss>

