jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hsp" <piccina...@ibest.com.br>
Subject is not a registered namespace uri......
Date Fri, 10 Mar 2006 19:08:47 GMT
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){
        // 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();
            // ...and register it
    	}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

<xxx = 'seilameu'>

[xxx:temporizavel] mixin

- xxx:tempoinicial(date) mandatory copy

- xxx:tempofinal(date) mandatory copy

View raw message