You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joose Vettenranta <jo...@iki.fi> on 2004/07/05 18:27:22 UTC

global variables from file?

Hi,

is it possible to load global variables from file?

Why? because this is how I could create config-file which could be 
edited through some sort of interface and not to have to touch 
sitemap-file.

It could be created so that when sending some signal to some object, it 
would read that file again and read parameters from that file. (so not 
checking that file everytime request comes).

skin-example is good:

config.xml would be like this:

<globals>
<skin>myskin</skin>
</globals>

then i could create web-page with what I could alter that 
skin-variable. Then push submit and it would change skin to something 
else!

- Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: global variables from file?

Posted by Joose Vettenranta <jo...@iki.fi>.
5.7.2004 kello 19:55, Stephan Coboos kirjoitti:
>> is it possible to load global variables from file?
> I don't know wether it is what you want, but you can use the 
> PropertiesFileModule or the XMLFileModule to access config datas 
> coming from a (local) file:

seems not to be what I'm looking for or I just don't know how to 
implement that.

on sitemap.xmap file there can be:

    <global-variables>
       <!--+
           | Define global parameters here:
           |   <skin>my_skin</skin>
           |   ...
           | You can access them by {global:*name*}, e.g. {global:skin}.
           | These values are inherited into sub-sitemaps and can
           | be extended there.
           +-->
    </global-variables>

I would like these global-variables to be loaded from a xml-file or 
from properties file, or what ever file, as long as I can load them 
from file and signal cocoon that the file has changed.

then I could do in sitemap like this:

<transform src="templates/{global:skin}/template.xsl" />

- Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: XMLFileModule problem [SOLVED]

Posted by Joose Vettenranta <jo...@iki.fi>.
It was a bug and is fixed in CVS.

- Joose

6.7.2004 kello 13:39, Stephan Coboos kirjoitti:
>> Seems like that it does not read new settings..
> Hmm, seems to be a bug. Please ask this question in the dev group 
> dev@cocoon.apache.org.
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: XMLFileModule problem

Posted by Stephan Coboos <cr...@gmx.net>.
Joose Vettenranta wrote:

> Seems like that it does not read new settings..
>
> I changed file line to:
>
> <file src="cocoon:/internal/config.xml" reloadable="true"  
> cacheable="false" cache-xpaths="false" />
>
>
> then changed content of the config.xml
>
> reloaded many times.. -> still reading old values
>
> How to refresh those values?

Hmm, seems to be a bug. Please ask this question in the dev group 
dev@cocoon.apache.org.

Regards
Stephan

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


XMLFileModule problem

Posted by Joose Vettenranta <jo...@iki.fi>.
Seems like that it does not read new settings..

I changed file line to:

<file src="cocoon:/internal/config.xml" reloadable="true"  
cacheable="false" cache-xpaths="false" />


then changed content of the config.xml

reloaded many times.. -> still reading old values

How to refresh those values?

Thanks, Joose

6.7.2004 kello 12:40, Joose Vettenranta kirjoitti:

  Seems like that is what I can use..
>
> I put in cocoon.xconf like this:
>
> <component-instance  
> class="org.apache.cocoon.components.modules.input.XMLFileModule"  
> logger="core.modules.xml" name="foo">
>  <file src="cocoon:/internal/config.xml" />
> </component-instance>
>
> and in sitemap
>
> <map:match pattern="internal/config.xml">
>  <map:generate type="file" src="config.xml" />
>  <map:serialize type="xml" />
> </map:match>
>
> and it's working well =)
>
> Thanks,
>
> Joose
>
> 5.7.2004 kello 19:55, Stephan Coboos kirjoitti:
>> I don't know wether it is what you want, but you can use the  
>> PropertiesFileModule or the XMLFileModule to access config datas  
>> coming from a (local) file:
>>
>> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
>> modules/input/PropertiesFileModule.html
>> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
>> modules/input/XMLFileModule.html
>>
>> Regards
>> Stephan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
> --
> "Always remember that you are unique, just like everyone else!"
> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: global variables from file? [SOLVED, kinda]

Posted by Joose Vettenranta <jo...@iki.fi>.
Seems like that is what I can use..

I put in cocoon.xconf like this:

<component-instance  
class="org.apache.cocoon.components.modules.input.XMLFileModule"  
logger="core.modules.xml" name="foo">
  <file src="cocoon:/internal/config.xml" />
</component-instance>

and in sitemap

<map:match pattern="internal/config.xml">
  <map:generate type="file" src="config.xml" />
  <map:serialize type="xml" />
</map:match>

and it's working well =)

Thanks,

Joose

5.7.2004 kello 19:55, Stephan Coboos kirjoitti:
> I don't know wether it is what you want, but you can use the  
> PropertiesFileModule or the XMLFileModule to access config datas  
> coming from a (local) file:
>
> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
> modules/input/PropertiesFileModule.html
> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
> modules/input/XMLFileModule.html
>
> Regards
> Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: global variables from file?

Posted by Stephan Coboos <cr...@gmx.net>.
Joose Vettenranta wrote:

> Hi,
>
> is it possible to load global variables from file?
>
> Why? because this is how I could create config-file which could be 
> edited through some sort of interface and not to have to touch 
> sitemap-file.
>
> It could be created so that when sending some signal to some object, 
> it would read that file again and read parameters from that file. (so 
> not checking that file everytime request comes).
>
> skin-example is good:
>
> config.xml would be like this:
>
> <globals>
> <skin>myskin</skin>
> </globals>
>
> then i could create web-page with what I could alter that 
> skin-variable. Then push submit and it would change skin to something 
> else!

I don't know wether it is what you want, but you can use the 
PropertiesFileModule or the XMLFileModule to access config datas coming 
from a (local) file:

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/PropertiesFileModule.html
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/XMLFileModule.html

Regards
Stephan

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