AnsweredAssumed Answered

Custom content types

Question asked by naveenkumar on Apr 25, 2007
Latest reply on May 7, 2007 by naveenkumar
I created my own content types, i want to use them while adding node using JCR API. lets take my content type is dml:rsscontent.
here is my java class.

Node rootNode = session.getRootNode();
         // first, access the company home
         Node companyHome = rootNode.getNode("app:company_home");
         Node rssFeeds = companyHome.getNode("app:user_homes");
         //To get items from rss feeds.                       
         // create the content nodegud morning
         Node channelContent = rssFeeds.addNode("cm:","dml:rsscontent");

while executing the above class i am getting this error

org.alfresco.service.namespace.NamespaceException: Namespace prefix dml is not mapped to a namespace URI
   at org.alfresco.service.namespace.QName.createQName(QName.java:103)
   at org.alfresco.service.namespace.QName.createQName(QName.java:125)
   at org.alfresco.jcr.item.NodeImpl.addNode(NodeImpl.java:188)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.alfresco.jcr.util.JCRProxyFactory$SessionContextInvocationHandler.invoke(JCRProxyFactory.java:138)
   at $Proxy82.addNode(Unknown Source)
   at com.cognizant.digitalmedialab.cms.business.JCRManagerMeta.getJCRRepository(JCRManagerMeta.java:46)
   at com.cognizant.digitalmedialab.cms.business.RssFeeds.getChannelDetails(RssFeeds.java:34)
   at com.cognizant.digitalmedialab.cms.business.JCRManagerMeta.main(JCRManagerMeta.java:107)


I found similar kind of problem in this link http://issues.alfresco.com/browse/AR-1179?page=history
as well as the solution.not able to do that way.

Please any one help me……………..


Thanks
Naveen

Outcomes