AnsweredAssumed Answered

Using jcrModel.xml

Question asked by dnatarajan on Nov 22, 2010
Hi -

How do I use the types defined in jcrModel.xml. I am particularly interested in

    <type name="nt:resource">
         <parent>nt:base</parent>
         <properties>
            <property name="jcr:encoding">
               <type>d:text</type>
               <protected>false</protected>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>
            <property name="jcr:mimeType">
               <type>d:text</type>
               <protected>false</protected>
               <mandatory>true</mandatory>
               <multiple>false</multiple>
            </property>




I understand from a previous post that the optional nt: types would not be picked up by Alfresco Web Client. Is there a roadmap for this implementation?

Also, in one of the examples, a comment mentions that it is not possible to use JCR to set mime-type for content nodes. Is this true? How can a JCR/RMI application then use the Foundation API to do this??

Would code as shown below work against Alfresco Enterprise 3.3 (JCR/RMI) work with little/no changes?


Node fileNode = node1.addNode(file.getName(), "nt:file");
Node resNode = fileNode.addNode("jcr:content", "nt:resource");
resNode.setProperty("jcr:mimeType", mimeType);
resNode.setProperty("jcr:encoding", "");
resNode.setProperty("jcr:data", new FileInputStream(file));
Calendar lastModified = Calendar.getInstance();
lastModified.setTimeInMillis(file.lastModified());
resNode.setProperty("jcr:lastModified", lastModified);

We are trying to figure a lot out and are currently stuck in our evaluation of Alfreso Enterprise. Any help would be greatly appreciated.

Outcomes