<?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: Retrieve content type hierarchy using Java API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/retrieve-content-type-hierarchy-using-java-api/m-p/198087#M151217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried out your code, and it worked for me.&amp;nbsp; I did change one thing though - your for loop had an extra ')' in there after rootContentType.getName() .&amp;nbsp; I'm sure that wasn't your problem though, since you were able to run and generate that exception which would only be possible if you were able to compile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DictionaryService dictionaryService = _serviceRegistry.getDictionaryService();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TypeDefinition rootContentType = dictionaryService.getType(QName.createQName("{" + NamespaceService.CONTENT_MODEL_1_0_URI + "}content"));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (QName name : dictionaryService.getSubTypes(rootContentType.getName(), false)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(" +– QName : " + name.toString());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, in looking closer at the exception, you have a NullPointerException in there.&amp;nbsp; In looking at the source code, it appears that the only way you could get a NullPointer there is if something was wrong with the content model.&amp;nbsp; Therefore, I suggest checking your log file upon server startup (at $TOMCAT_HOME/logs/catalina.out).&amp;nbsp; If there are any exceptions output there as a result of a content model not being parsed, I would think that would cause a the NullPointer you're seeing.&amp;nbsp; If that is the case, be sure to fix your content model problem before trying again.&amp;nbsp; If that is not the case, then all I can suggest is that you download the Alfresco source code, connect a remote debugger, and step through the code until you can see exactly what is going on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Oct 2008 04:23:11 GMT</pubDate>
    <dc:creator>brian_robinson</dc:creator>
    <dc:date>2008-10-14T04:23:11Z</dc:date>
    <item>
      <title>Retrieve content type hierarchy using Java API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retrieve-content-type-hierarchy-using-java-api/m-p/198086#M151216</link>
      <description>Hi Alfresco’s gurus,Using the Java API, I’m trying to retrieve a tree of subtypes inherited from the cm:content type. I’d like to display a tree of document type hierarchy. I used the dictionaryService bean and tried to use the following code but getting an error (see below):TypeDefinition rootConte</description>
      <pubDate>Mon, 13 Oct 2008 07:52:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retrieve-content-type-hierarchy-using-java-api/m-p/198086#M151216</guid>
      <dc:creator>webroro</dc:creator>
      <dc:date>2008-10-13T07:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve content type hierarchy using Java API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retrieve-content-type-hierarchy-using-java-api/m-p/198087#M151217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried out your code, and it worked for me.&amp;nbsp; I did change one thing though - your for loop had an extra ')' in there after rootContentType.getName() .&amp;nbsp; I'm sure that wasn't your problem though, since you were able to run and generate that exception which would only be possible if you were able to compile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DictionaryService dictionaryService = _serviceRegistry.getDictionaryService();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TypeDefinition rootContentType = dictionaryService.getType(QName.createQName("{" + NamespaceService.CONTENT_MODEL_1_0_URI + "}content"));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (QName name : dictionaryService.getSubTypes(rootContentType.getName(), false)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(" +– QName : " + name.toString());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, in looking closer at the exception, you have a NullPointerException in there.&amp;nbsp; In looking at the source code, it appears that the only way you could get a NullPointer there is if something was wrong with the content model.&amp;nbsp; Therefore, I suggest checking your log file upon server startup (at $TOMCAT_HOME/logs/catalina.out).&amp;nbsp; If there are any exceptions output there as a result of a content model not being parsed, I would think that would cause a the NullPointer you're seeing.&amp;nbsp; If that is the case, be sure to fix your content model problem before trying again.&amp;nbsp; If that is not the case, then all I can suggest is that you download the Alfresco source code, connect a remote debugger, and step through the code until you can see exactly what is going on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2008 04:23:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retrieve-content-type-hierarchy-using-java-api/m-p/198087#M151217</guid>
      <dc:creator>brian_robinson</dc:creator>
      <dc:date>2008-10-14T04:23:11Z</dc:date>
    </item>
  </channel>
</rss>

