Geoff Howard wrote: >Wasn't sure what to call this. > >I have a need to make some shared information available to components. I'd >want the information cached in memory to cut down on the overhead of reading >it from the filesystem or database. I'll need it within custom generators >for now, but it'd be a plus to generalize this to others such as actions and >great if the same info could be called in the sitemap. Because of this I'm >thinking that some component would be best and may already exist. I've read >up on the new module stuff but can't tell whether it's meant for this use or >not. >
Yes, a module (more precisely an InputModule) can be used for this. And the sitemap feature you're talking about has been voted last week on cocoon-dev, and I'm starting its implementation (for version 2.1) : if your module is named "layout" in cocoon.xconf, you will be able to write e.g. <map:transform src="{layout:foo}/page.xsl"/> >Example: >We have subsites organized into page-layouts by a separate cms system. Each >subsite has a default "front page" page-layout id and there are many places >I need to look this up for fallback behavior. > >The information rarely changes, but is stored in the database for use by the >cms and thus the lookup operation is too expensive to just read it each >time. I thought about using a cached pipeline to hold the information as >xml but that makes accessing it from within other components difficult. > > If the information rarely change, you could have your module implementation cache the result. >I thought of defining a singleton class with public >getSubsiteID(page-layoutID) methods, etc. but thought there was a more >"cocoon" way of doing this that would make the availibilty more general. > Sylvain -- Sylvain Wallez Anyware Technologies Apache Cocoon http://www.anyware-tech.com mailto:[EMAIL PROTECTED] --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>