AnsweredAssumed Answered

How to createNode in java backed?

Question asked by dark_rider on Oct 7, 2010
Latest reply on Oct 8, 2010 by dark_rider
I am trying to create a new node but not success. How could I perform it? Basicly I want to copy a node and change its content.

final String NAMESPACE = "";
final QName PROP_QNAME_MY_PROPERTY = QName.createQName("custom.model", "myProperty");

NodeRef newNodeRef = getNodeService().createNode(parentRef, ContentModel.ASSOC_CONTAINS, QName.createQName(NAMESPACE, newNodeName), PROP_QNAME_MY_PROPERTY).getChildRef();

I get this exception
java.lang.IllegalArgumentException: Class {custom.model}myProperty has not been defined in the data dictionary

How can I create node simply? Could you please help me?