6 Replies Latest reply on May 30, 2010 5:14 PM by Brian Carothers

    Registering Namespaces in config file

    Andreas Drobisch Newbie

      Hello Community,

      After setting up a repositoy I tried to use the image sequencer in my current project, but I am not able to register the "image" prefix. The sequencer is throwing this:

       

      org.modeshape.graph.property.NamespaceException: There is no namespace  registered for the prefix "image"
      

       

      Am I using the

      <mode:namespaces>
      

      Tag wrong (seeconfig below) ? I adapted the use from the repositories example.

       

      I also tried to register via code with

      session.getWorkspace().getNamespaceRegistry().registerNamespace("image", "http://www.modeshape.org/images/1.0");
      

       

      but thats not working either.  There are no other error log entries besides the exeption.

       

      Could somebody clear this up for me? How to register a namespace properly?

      Thanks for reading!

       

       

      <mode:sequencers>
              <mode:sequencer jcr:name="Image Sequencer" mode:classname="org.modeshape.sequencer.image.ImageMetadataSequencer">
                  <mode:description>Image metadata sequencer</mode:description>        
                  <mode:pathExpression>//(*.(jpg|jpeg|gif|bmp|pcx|png)[*])/jcr:content[@jcr:data] => /images/$1</mode:pathExpression>
              </mode:sequencer>
          </mode:sequencers>
      
      
          <!-- Define the JCR repositories -->
          <mode:repositories>
              <!-- Specify the source that should be used for the repository -->
              <mode:repository jcr:name="cleanAtticRepository">
                  <mode:source>repositorySource</mode:source>
                  <!-- Define the options for the JCR repository, using camelcase version of JcrRepository.Option names-->
                  <mode:options jcr:primaryType="mode:options">
                      <mode:projectNodeTypes jcr:primaryType="mode:option" mode:value="false"/>
                  </mode:options>
                  <mode:nodeTypes mode:resource="sequencer.cnd" />
              <mode:namespaces jcr:primaryType="mode:namespaces">
                      <image jcr:primaryType="mode:namespace" mode:uri="http://www.modeshape.org/images/1.0" />
                  </mode:namespaces>
              </mode:repository>
          </mode:repositories>