keeps/roda

Allow extending of roda from outside location using web-fragments

MatthiasWalchhofer opened this issue · 1 comments

Hi,

I would like to add some (servlet based) functionatlities to roda by using web-fragments.

Web-Fragments are part of the servlet spec since version 3.0 and ongoing (https://jakarta.ee/specifications/servlet/6.0/jakarta-servlet-spec-6.0.pdf - 8.2. Pluggability).

But since web-fragments are required to be placed within WEB-INF/lib directory they can't be used to extend an application from an outside location by default.

Tomcat-only solution:
Therefore I would request, roda.war to be shipped e.g. with following context.xml within META-INF directory:

<Context>
    <Resources>
        <PreResources
                base="/roda/config/extensions"
                className="org.apache.catalina.webresources.DirResourceSet"
                webAppMount="/WEB-INF/lib"
        />
    </Resources>
</Context>

This would allow to drop an example-extension.jar (having a META-INF/web-fragment.xml) file under /roda/config/extensions and get it loaded as specified in the servlet spec.

This may create security issues, so I am wary of adding this to the default configuration.
Instead, I believe you could extend the RODA image and inject this configuration to the WAR file.