You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steven Dolg <st...@indoqa.com> on 2010/06/02 12:02:56 UTC

Re: [C3] Reloading the sitemap

Hugh Sparks schrieb:
> Is there a way for a C3 webapp to notice and deal with
> changes to sitemap.xmap? In cocoon22, it was possible to
> specify this behavior using a property:
>
> WEB-INF/cocoon/properties/core.properties:
>
>        org.apache.cocoon.reloading.sitemap=true
>
> This doesn't seem to have any effect now.
> Thanks for any suggestions.

AFAIK, Cocoon 3 does not support this directly.

I know the ReloadingClassloader can be used to take care of that.
However that might or might not be suitable for your situation and/or 
introduce other behaviour you may want or not... :-\


HTH,
Steven

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


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


Re: [C3] Reloading the sitemap

Posted by Hugh Sparks <hu...@csparks.com>.
> Steven Dolg writes:
>> [...]
>> However I would guess that's rather far from the
>> current use-cases
>> [...]

Quite right:
I'm very interested in a departure from current use-cases: 
I want to use Cocoon to configure and maintain a live site
where changes can be made with minimal or no interruptions.

Although not as nice as reloading the sitemap alone,
I found a satisfactory solution by having the servlet
container automatically reload the whole spring context
when the sitemap changes.

Using Tomcat, this can be done very concisely:

myWebapp/META-INF/context.xml:

    <?xml version="1.0"?>
    <Context reloadable="true">
        <WatchedResource>sitemap.xmap</WatchedResource>
    </Context>

Alternatively, it can be done with a context file in tomcat/conf:

tomcat/conf/Catalina/localhost/myWebapp.xml:

    <?xml version="1.0"?>
    <Context docBase="Absolute path to myWebapp" reloadable="true">
        <WatchedResource>Absolute path to myWebapp/sitemap.xmap</WatchedResource>
    </Context>

The deed can also be done using maven-jetty-plugin and a ScanTarget element:

myWebapp/pom.xml:
    ...
    <plugin>
        <groupId>org.mortbay.jetty</groupId>
       ....
        <configuration>
            ....
            <scanIntervalSeconds>5</scanIntervalSeconds>
            <scanTargets>
                <scanTarget>${webapp.root}/sitemap.xmap</scanTarget>
            </scanTargets>
        </configuration>
        ...

I haven't yet found a solution when using Jetty without Maven.

It would be nice if Spring could do a trick like this.
I'm not really happy with methods that depend on the servlet container...

Thanks,

-Hugh Sparks




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


Re: [C3] Reloading the sitemap

Posted by Steven Dolg <st...@indoqa.com>.
Hugh Sparks schrieb:
>
> ----- Original Message ----- From: "Steven Dolg" <st...@indoqa.com>
> To: <us...@cocoon.apache.org>
> Sent: 2010-06-02 7:02
> Subject: Re: [C3] Reloading the sitemap
>
>
>> Hugh Sparks schrieb:
>>> Is there a way for a C3 webapp to notice and deal with
>>> changes to sitemap.xmap? [...]
>
>> Steven Dolg replies:
>> AFAIK, Cocoon 3 does not support this directly.
>>
>> I know the ReloadingClassloader can be used to take care of that.
>> However that might or might not be suitable for your situation and/or 
>> introduce other behaviour you may want or not... :-\
>
> This may be an indelicate question, but has anything ever been written
> about how to use the ReloadingClassloader for something other than
> reloading classes? Like watching just one file...

I'm afraid I cannot answer that.

However I would guess that's rather far from the current use-cases and 
might even require some kind of callbacks and in turn (potentially) a 
dependency from your application to the ReloadingClassloader.

If you just want to watch the filesystem and be notified about changes 
there is the FilesystemAlterationMonitor (FAM) in 
http://commons.apache.org/jci/commons-jci-fam/index.html
But this will require some glue code to be integrated into your application.

I guess if it's just one specific file it's reasonable to check it yourself.
But then the desire for more control and configuration creeps up and you 
start adding and tweaking...  you know what I mean... :-P


HTH
>
> Thanks very much,
>
> -Hugh Sparks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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


Re: [C3] Reloading the sitemap

Posted by Hugh Sparks <hu...@csparks.com>.
----- Original Message ----- 
From: "Steven Dolg" <st...@indoqa.com>
To: <us...@cocoon.apache.org>
Sent: 2010-06-02 7:02
Subject: Re: [C3] Reloading the sitemap


> Hugh Sparks schrieb:
>> Is there a way for a C3 webapp to notice and deal with
>> changes to sitemap.xmap? [...]

> Steven Dolg replies:
> AFAIK, Cocoon 3 does not support this directly.
> 
> I know the ReloadingClassloader can be used to take care of that.
> However that might or might not be suitable for your situation and/or 
> introduce other behaviour you may want or not... :-\

This may be an indelicate question, but has anything ever been written
about how to use the ReloadingClassloader for something other than
reloading classes? Like watching just one file...

Thanks very much,

-Hugh Sparks



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