You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by yuryx <yu...@mobicomk.donpac.ru> on 2002/03/03 18:18:18 UTC
use DefaultConfiguration class (avalon API)
Hi !
Can anyone help me with following:
With my 'cocoon's action' I have to use DefaultConfiguration class. I
need modify my config file from this class (with use methods
setAttribute and setValue) -it possible?
But I dont know how to create it (I need examples :( ) with link to my
config file. :(
Thanx.
Yury.
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: use DefaultConfiguration class (avalon API)
Posted by yuryx <yu...@mobicomk.donpac.ru>.
Thanx Vadim!
It work! :)
Regards.
Yury.
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: use DefaultConfiguration class (avalon API)
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
>
> >Creating configuration object is quite simple. Snippet from
> >JavascriptProgram.java:
> >--------------------------------------
> > config = new DefaultConfiguration("", "GeneratorSelector");
> > child = new DefaultConfiguration("file", "");
> > child.setValue(file.toString());
> > config.addChild(child);
> >
> > for (Iterator i = dependecies.iterator(); i.hasNext(); ) {
> > child = new DefaultConfiguration("dependency", "");
> > child.setValue(i.next().toString());
> > config.addChild(child);
> > }
> >--------------------------------------
> >
> >Vadim
>
> Thanx Vadim, but what is the dependecies ? It's may be something
class
> (object)?
It's a Collection object if you take a look at the source file mentioned
above. In the current context (how-to-create-configuration-object) it is
totally does not matter what it is. What you need is to understand how
configuration is created and how to add children and how to set values.
> And how define path-to-file ? As full path (real path like
> /home/.../config.file) or with cocoon-context path (like
> docs/samples/config.file)?
That's your file, so you are the person to know where your file is
located.
Vadim
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: use DefaultConfiguration class (avalon API)
Posted by yuryx <yu...@mobicomk.donpac.ru>.
>
>
>
>Creating configuration object is quite simple. Snippet from
>JavascriptProgram.java:
>--------------------------------------
> config = new DefaultConfiguration("", "GeneratorSelector");
> child = new DefaultConfiguration("file", "");
> child.setValue(file.toString());
> config.addChild(child);
>
> for (Iterator i = dependecies.iterator(); i.hasNext(); ) {
> child = new DefaultConfiguration("dependency", "");
> child.setValue(i.next().toString());
> config.addChild(child);
> }
>--------------------------------------
>
>Vadim
>
>
>---------------------------------------------------------------------
>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: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
Thanx Vadim, but what is the dependecies ? It's may be something class
(object)?
And how define path-to-file ? As full path (real path like
/home/.../config.file) or with cocoon-context path (like
docs/samples/config.file)?
Yury.
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: use DefaultConfiguration class (avalon API)
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: yuryx [mailto:yuryx@mobicomk.donpac.ru]
>
> Hi !
> Can anyone help me with following:
> With my 'cocoon's action' I have to use DefaultConfiguration class. I
> need modify my config file from this class (with use methods
> setAttribute and setValue) -it possible?
Try DefaultConfigurationSerializer from the
org.apache.avalon.framework.configuration.
> But I dont know how to create it (I need examples :( ) with link to my
> config file. :(
Creating configuration object is quite simple. Snippet from
JavascriptProgram.java:
--------------------------------------
config = new DefaultConfiguration("", "GeneratorSelector");
child = new DefaultConfiguration("file", "");
child.setValue(file.toString());
config.addChild(child);
for (Iterator i = dependecies.iterator(); i.hasNext(); ) {
child = new DefaultConfiguration("dependency", "");
child.setValue(i.next().toString());
config.addChild(child);
}
--------------------------------------
Vadim
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>