cancel
Showing results for 
Search instead for 
Did you mean: 

JCR predefined primary node types

anweber
Champ in-the-making
Champ in-the-making
Hi,

The JCR specification says, in chapter 6.7.22, that the definition of the primary node types described in JCR are optional, except for nt:base.

Which of those node types are defined in Alfresco (nt:file, nt:linkedFile, nt:folder, nt:nodeType, nt:query, nt:resource, …)?  If I use those types, will I obtain a view of my objects with the webClient?  In the wiki example in the "org.alfresco.jcr.example" package, those types are not used (but types from Alfresco like "cm:folder" ou "cm:content"); why?


   Thanks for your help,

           Andre
2 REPLIES 2

davidc
Star Contributor
Star Contributor
That's correct, those node types are optional.  By default, Alfresco does not provide definitions of them.

The Alfresco Web Client is layered on Alfresco's Content Model (as defined in contentModel.xml).  This model provides definitions for folders, content, locking, auditing, dublin core etc.  We have this model to support all the rich capabilities of Alfresco.

Every model defined in Alfresco is exposed via the JCR API (as Node Type definitions) which includes the Alfresco content model above.  There's nothing stopping you from defining equivalent nt: types in Alfresco and using them via the JCR api.  However, they will not be picked up by the Alfresco web client.

In the future, we may automatically map JCR nt: types to equivalent Alfresco content model types.

naveenkumar
Champ in-the-making
Champ in-the-making
I created new content type which includes the cm:content as parent.and stored the newcontent model under extension folder.here is the code
 <type name="dml:rsscontent"> 
         <title>rsscontent</title>
         <parent>cm:content</parent>
         <properties>
            <property name="rss:title">
               <type>d:text</type>
            </property>
            <property name="rss:description">
               <type>d:text</type>
            </property>
            <property name="rss:link">
               <type>d:text</type>
            </property>
            <property name="rss:author">
               <type>d:text</type>
            </property>           
         </properties>
      </type>
 

when i create content through alfresco i am able to select the new content type(i mean rsscontent). content was created and i could view through web client.
when i addnew node through jcr api…. i want to use my new content type(i mean rsscontent) to create a content..here is my java code
Node content = rssFeeds.addNode("dml:" + item.getTitle(),"dml:rsscontent");//Here i am pointing towards my new content type but using this i am not able to create contents.
is there any other properties i need to set?            
is it possible to store the metainformation without adding content using jcr-api?