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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]