Carsten Ziegeler wrote:
Sylvain Wallez wrote:
Yes, I know - so following your road we could just skip the whole cocoon.xconf and put it in the root sitemap :)No, please not - with 2.2 we have the official include feature and imho this is sufficient for this.
Yeah, but technically speaking, this makes absolutely no difference, as <include> does nothing but expanding the contents of an xconf within <map:components>
Components are not used directly in the sitemap (except sitemap components), so we shouldn't start defining them in the sitemap. Of course this is a little bit different with input modules which just has historical reasons that they're in the xconf.
If we restrict ourselves to components "used directly in the sitemap", then yes, other component don't fit there.
Now things are different if we consider a sitemap a modularization unit in a Cocoon application. Why should we define in the global cocoon.xconf e.g. a JDBC datasource that is used only in a particular subsitemap, or a business component used in a particular sitemap's flowscript?
A concrete example: imagine an admin tool for a webapp which has write access to the user database whereas all other parts of the application have read-only access. Allowing the datasource to be defined in the admin sitemap cleanly isolates it from the rest of the application. And if for some reason we decide that admin should not be possible through the web, then just delete the admin directory and you're done, without modifying the main xconf.
I think it's better to move everything out of the sitemap into xconf files that *belong* to the sitemap than the opposite.
I understand your point. Does this mean you would be ok for the datasource mentioned above to be declared in an xconf file included by the admin sitemap? From my POV this is just a syntax detail and I'm ok with moving sitemap-related components (considered as a modularization unit) to an xconf file beside the sitemap.
WDYT?
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }