Hi Erik,
    Actually I have been using this feature of OXF against Subversion
(development only) for quite some time now and it does work very well! :-)

I came up with an Apache hack that generates a last-modified header for
Subversion. The advantage of using slide though would be a speed increase
because my apache/subversion hack disables caching. :-(  The other thing
that is a bit hacky about this hack is that I need to give OXF special
access to the DAV repository. Ideally the urlresourcemanager would support
basic authenticated servers..

<param-name>oxf.resources.url.username</param-name>
<param-name>oxf.resources.url.password</param-name>

Cheers,
Damon.


=============

1. Generate the current date time in the correct format for last-modified

    RewriteEngine       on

    # Nasty kludge to generate the current datetime in an env variable
called now
    RewriteCond %{TIME_MON}  ^01$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Jan\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^02$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Feb\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^03$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Mar\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^04$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Apr\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^05$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ May\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^06$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Jun\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^07$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Jul\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^08$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Aug\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^09$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Sep\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^10$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Oct\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^11$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Nov\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT
    RewriteCond %{TIME_MON}  ^12$
    RewriteRule ^(.*)$ $1---Mon\,\ %{TIME_DAY}\ Dec\ %{TIME_YEAR}\
%{TIME_HOUR}:%{TIME_MIN}:%{TIME_SEC}\ GMT

    RewriteRule ^(.*)---(.*)$ $1 [env=now:$2]

2. Then use the new environment variable where appropriate..

        Header add Last-Modified %{now}e

3. And allow anonymous read from OXF

        # Reading is allowed from OXF or with a password
        <Limit GET PROPFIND OPTIONS REPORT>
          Order Deny,Allow
          Deny from all

          Require group svn_readers

          SetEnvIf User-Agent ^Java/1.4.* agent-oxf
          Allow from env=agent-oxf

          Satisfy Any

        </Limit>


----- Original Message ----- 
From: "Erik Bruchez" <[EMAIL PROTECTED]>
To: "OXF Users" <[EMAIL PROTECTED]>
Sent: Saturday, April 03, 2004 6:00 AM
Subject: OXF and Slide


> All,
>
> Following-up on discussions about using Subversion as a WebDAV server
> for OXF resources, I wanted to mention that I experimented a little
> bit with Slide 2.0 beta and OXF. OXF does not yet have support for
> WebDAV itself, but it has a built-in URLResourceManagerFactory which
> allows it to access its resources through, for example, HTTP. Since
> WebDAV is an extension of HTTP, OXF can access resources through a
> WebDAV server such as Apache Slide (with anonymous access). For
> example, try a configuration like this in your web.xml:
>
>    <context-param>
>      <param-name>oxf.resources.url.base</param-name>
>
<param-value>http://localhost:8889/slide/files/resources</param-value>
>    </context-param>
>    <context-param>
>      <param-name>oxf.resources.priority.1</param-name>
>
<param-value>org.orbeon.oxf.resources.URLResourceManagerFactory</param-value
>
>    </context-param>
>
> This allows update your application resources through a Slide
> repository. OXF picks them up automatically as it detects that the
> last modification date of files has changed.
>
> Slide does not seem to be blazing fast at the moment, but this may be
> a good enough option for development until Subversion supports the
> last modified header and/or OXF supports WebDAV natively!
>
> -Erik
>
> _______________________________________________
> oxf-users mailing list
> [EMAIL PROTECTED]
> http://mail.orbeon.com/mailman/listinfo/oxf-users
>

_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to