cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark H. Wood" <mw...@IUPUI.Edu>
Subject Re: Documentation for component-configurations, global-variables?
Date Thu, 15 Oct 2015 19:30:24 GMT
On Wed, Jan 19, 2011 at 10:27:40PM +0100, Luca Morandini wrote:
> On 01/19/2011 07:54 PM, Mark H. Wood wrote:
> >
> > It appears that 2.2 wants us to use Spring to do something analogous,
> > but first I need to know in detail what the old way is doing so that I
> > can work out how to do the same thing the new way.
> 
> In 2.1 you can use global variables throughout the sitemap (it is just another 
> input module), like in:
> <map:generate element="body" src="cocoon://{global:theme-path}/index.html"/>
> 
> In 2.2 you can use the Cocoon-Spring configurator to the same effect, but it is 
> way more flexible then the old "global-variables" definition.

Yes, but specifically how is the old way used, and how is the new way
used to do the same thing?  I've found no documentation for the deprecated
<map:component-configurations/> element, and no examples of the
<configurator:*/> elements, nor a definitive description of the
configurator namespace.

[spend half a day grubbing through the code]

The deprecation message in question appears to come from
org.apache.cocoon.core.container.spring.avalon.SitemapHelper.getGlobalSitemapVariables.
That code winkles out the global-variables element and pokes its
content into a Properties, which is then used by the caller
(createDefinition) which seems to be building a StringBuffer that
eventually contains a Spring <beans/> element and lots of content,
which is returned to createContainer (which returns a
WebApplicationContext to somewhere).  So it looks like the translation
of:

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>

    <map:component-configurations>
      <global-variables>
        <theme-path>IUPUIScholarWorks</theme-path>
	<theme-name>IUPUIScholarWORKS theme</theme-name>
      </global-variables>
    </map:component-configurations>
		    ...

is:

<beans
        xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:util="http://www.springframework.org/schema/util"
        xmlns:configurator="http://cocoon.apache.org/schema/configurator"
        xmlns:avalon="http://cocoon.apache.org/schema/avalon"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
	        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        	http://www.springframework.org/schema/util
        	http://www.springframework.org/schema/util/spring-util-2.0.xsd
        	http://cocoon.apache.org/schema/configurator
        	http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.xsd
        	http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd\">

  <configurator:child-settings name='SITEMAP LOCATION'>
    <configurator:property name='theme-path'
                           value='IUPUIScholarWorks'/>
    <configurator:property name='theme-name'
                           value='IUPUIScholarWORKS theme'/>
  </configurator:child-settings>
</beans>
			...

I'm still figuring out for certain what SITEMAP LOCATION is supposed
to be, though it does seem somewhat obvious.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu

Mime
View raw message