cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Custom Property to nt:file node

ajaiking
Champ in-the-making
Champ in-the-making
Hi,

When we try to add a custom property to the nt:file node that i created using JCR API. I am getting a Null Pointer Exception.
Also i tried creating a nt:unstructured node, but it seems Alfresco doesn't have a implementation for it.

Kindly guide me how to create a custom property.

The exception that i get while creating a custom property is


Exception in thread "main" java.lang.NullPointerException
   at org.alfresco.jcr.item.PropertyImpl.checkSingleValued(PropertyImpl.java:638)
   at org.alfresco.jcr.item.PropertyImpl.setPropertyValue(PropertyImpl.java:517)
   at org.alfresco.jcr.item.NodeImpl.setProperty(NodeImpl.java:362)
   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 $Proxy79.setProperty(Unknown Source)
   at org.alfresco.sample.AlfrescoActions.importFile(AlfrescoActions.java:180)
   at org.alfresco.sample.AlfrescoActions.main(AlfrescoActions.java:64)


I am in need of this info very urgently.

Thanks
Ajai G
2 REPLIES 2

sumit057
Champ in-the-making
Champ in-the-making
Did you came to know how to do it?? even i wanted to do it

alexer
Champ in-the-making
Champ in-the-making
Hi,
I think the best thing to do would be to make a custom folder type
that inherits from nt:folder and add the necessary properties to it.