[prev in list] [next in list] [prev in thread] [next in thread]
List: xml-cocoon-users
Subject: Anyone? (was Re: More sub-sitemap questions)
From: Justin Fagnani-Bell <justin () paraliansoftware ! com>
Date: 2002-10-31 17:38:17
[Download RAW message or body]
So I still don't know the answer to this question, but while
experimenting trying to find the answer I discovered that I can't
access any components defined in a sub-cocoon.xconf that require a
ComponentSelector, specifically a datasource.
I have one component that's defined in my sub-cocoon.xconf and takes a
parameter that's the name of a datasource, I get an Excalibur error
when that component tries to load the datasource. here's the code:
this.dataSourceName = params.getParameter("datasource","NodeDB");
debug("SQLNodeStore.parameterize(): dataSourceName="+dataSourceName);
ComponentSelector selector = (ComponentSelector)
manager.lookup(DataSourceComponent.ROLE + "Selector");
this.datasource = (DataSourceComponent) selector.select(dataSourceName);
and here's the error from the log file:
DEBUG (2002-10-31) 09:24.36:845 [cocoon ](/projects/spectra/)
Thread-5/SQLNodeStore: SQLNodeStore.parameterize():
dataSourceName=NodeDB
DEBUG (2002-10-31) 09:24.36:845 [cocoon ](/projects/spectra/)
Thread-5/ExcaliburComponentSelector: UnnamedSelector: ComponentSelector
could not find the component for hint: NodeDB
This all works fine if the components are defined in the main
cocoon.xconf file. I know the sub-cocoon.xconf file is being read
because I can load my SQLNodeStore component. I think what's happening
is that there's a seperation between the two cocoon.xconf files, and
when I load the ComponentSelector I'm getting a ComponentSelector for
the main file, which doesn't have a datasource called NodeDB. Is this
possible? If so, is this a bug, or do I need to do something different?
Any help is much appreciated.
Thanks,
Justin
On Tuesday, October 29, 2002, at 01:51 PM, Justin Fagnani-Bell wrote:
> Good afternoon (in Cali),
>
> As I mentioned in my last email (anyone figure an answer yet? I
> haven't), I'm trying to keep all my Cocoon projects running live on my
> development server via auto mounting sub-sitemaps. The ability for
> each mount to have it's own cocoon.xconf file seems to be the last
> piece that makes this possible.
>
> I setup datasources and some custom components in cocoon.xconf. My
> question is how are name conflicts dealt with if you have components
> with the same name in the main cocoon.xconf file and the sub
> cocoon.xconf file?
>
> More specifically, if I have this in my code:
>
> public void compose(ComponentManager manager) throws
> ComponentException {
> super.compose(manager);
> if (nodeStore == null) {
> this.nodeStore = (NodeStore)manager.lookup(NodeStore.ROLE);
> }
> }
>
> and I have a NodeStore component defined in both cocoon.xconf files,
> is there any guarantee which component I will get? (the reason it
> matters is because my NodeStores are setup up to access different
> databases)
>
> Thanks,
> Justin
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic