I am running the following code to register custom nodetypes:

mport javax.jcr.Workspace;
import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
import org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader;
import java.io.FileReader;
import java.util.List;
import java.util.Iterator;

public class TipoNoCustomizado {
    public static void RegisterCustomNodeTypes(Workspace ws, String 
cndFileName){
        try{
        // Read in the CND file
        FileReader fileReader = new FileReader(cndFileName);

        // Create a CompactNodeTypeDefReader
        CompactNodeTypeDefReader cndReader = new 
CompactNodeTypeDefReader(fileReader, cndFileName);

        // Get the List of NodeTypeDef objects
        List ntdList = cndReader.getNodeTypeDefs();

        // Get the NodeTypeManager from the Workspace.
        // Note that it must be cast from the generic JCR NodeTypeManager to the
        // Jackrabbit-specific implementation.
        NodeTypeManagerImpl ntmgr =(NodeTypeManagerImpl)ws.getNodeTypeManager();

        // Acquire the NodeTypeRegistry
        NodeTypeRegistry ntreg = ntmgr.getNodeTypeRegistry();

        // Loop through the prepared NodeTypeDefs
        for (Iterator i = ntdList.iterator(); i.hasNext();) {

            // Get the NodeTypeDef...
            NodeTypeDef ntd = (NodeTypeDef)i.next();
            System.out.println(ntd.getName());
            // ...and register it
            ntreg.registerNodeType(ntd);
        }
        }catch(Exception e){            System.err.println(e);}
    }
}

and I am getting the following exception:

javax.jcr.NamespaceException: seilameu: is not a registered namespace uri.

But, what is a registered namespace uri I can use in my node type definition 
file?? Help me please.

<xxx = 'seilameu'>



[xxx:temporizavel] mixin



- xxx:tempoinicial(date) mandatory copy

- xxx:tempofinal(date) mandatory copy

Reply via email to