-
1. Re: Registering Namespaces in config file
bcarothers May 25, 2010 10:21 PM (in response to androbit)What you did does not work, but I think that it should.
ModeShape basically has a tree of namespace registries that handle the translation from prefixes to URIs and back. There's a top-level namespace registry at the JcrEngine level and separate registries for each JCR repository. The repository registries are based on the top-level registry but can also add additional mappings that only apply to that repository.
When you add namespaces to the repository (with the mode:namespaces tag), you are adding them in the namespace registry for that repository only. But sequencers use the top-level repository. That's why your sequencer doesn't recognize the mapping. I suspect that the other error that you're seeing when you try to register from JCR is because that prefix is already mapped.
I suspect that this behavior will be changed in trunk in the next few days, but in the meantime, a workaround is to add some code like this to wherever you initialize your JcrEngine:
JcrConfiguration config = ...;
JcrEngine engine = config.loadFrom(...).build();
String uri = ...;
engine.getExecutionContext().getNamespaceRegistry().register("image", uri);
Once you do this, you can comment out the mode:namespaces section from your configuration file for now.
So, in short, you're not wrong - this should work. Thanks for catching this!
-
2. Re: Registering Namespaces in config file
androbit May 26, 2010 2:54 AM (in response to bcarothers)Thanks for clearing this up, good to know whats happening!
I am getting the JCR repository from JNDI and I dont want to introduce modeshape as dependency at the moment, so I can't use the workaround.
Is there already an issue for this? I will work with the trunk as soon as its fixed.
-
3. Re: Registering Namespaces in config file
bcarothers May 26, 2010 5:40 PM (in response to androbit)I've created MODE-771 to track a fix to this issue. It should be in trunk sometime between tomorrow morning (EST) and Monday morning (EST).
-
4. Re: Registering Namespaces in config file
bcarothers May 27, 2010 9:03 AM (in response to bcarothers)I committed the MODE-771 changes to trunk a few minutes ago. Please let me know if this resolves your problem. Thanks!
-
5. Re: Registering Namespaces in config file
androbit May 30, 2010 3:13 PM (in response to bcarothers)Thank you very much! I built modeshape from trunk today and its sequencing my uploaded images now . I appreciate your fast response and support!
-
6. Re: Registering Namespaces in config file
bcarothers May 30, 2010 5:14 PM (in response to androbit)Good deal. Thanks for the feedback!