You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Mark H. Wood" <mw...@IUPUI.Edu> on 2011/01/19 19:54:43 UTC

Documentation for component-configurations, global-variables?

I need to understand a sitemap that begins:

<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>

Apparently this stuff didn't exist in 2.0 and is deprecated in 2.2,
and I haven't tracked it down in the 2.1 documentation either.  We're
currently running on 2.2 and getting some deprecation messages that
I'd like to address as time permits.

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.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Asking whether markets are efficient is like asking whether people are smart.

Re: Documentation for component-configurations, global-variables?

Posted by "Mark H. Wood" <mw...@IUPUI.Edu>.
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

Re: Documentation for component-configurations, global-variables?

Posted by Luca Morandini <lm...@ieee.org>.
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.

Regards,

Luca Morandini
http://www.lucamorandini.it


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org