cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Morandini <lmorand...@ieee.org>
Subject Re: Block param
Date Tue, 18 Nov 2008 12:40:05 GMT
Jose Luis Carmona wrote:
> Hi all,
> 
> I have a block with my own Generator, and I want to define a param (a 
> path to write) accessible inside all the classes of this block. Where 
> should I declare this param?. How should I access to the param's value 
> inside of the Generator?

Parameters to Cocoon components are passed using "setup" and "configure" 
methods, like in:

    public void configure(Configuration conf) throws
	ConfigurationException {

	this.mimetype = conf.getAttribute("mime-type");
	factory.setOutputStreamType(mimetype);

	try {
	    factory.setup();
	} catch (Exception e) {
	    getLogger().error("Configuration error", e);
	}

	getLogger().debug("Configure");
     }

These parameters are defined in the sitemap, either in the pipelines 
("setup" method, using "map:parameter" elements) or components' 
configuration section ("configure" method).

Using the input modules you can get parameters' values from request 
parameters, session attributes, external XML files, configuration 
properties file, etc.

Hence, you have a fair degree of flexibility in passing parameters to 
components.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


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


Mime
View raw message