While cleaning up the poms and moving the static resource servlet from
kernel to common, I realized that we've got an ugly antipattern in how we
register our UIs.  For each OSGI bundle that wants to mount a static
resources to a URL, we require the bundle to register a component via an XML
file and an entry in the pom.  Any time we change the details of this
registration process, we need to change tons of XML files.

I'd like to change this approach so that the UI providing bundles simply add
the following lines to their poms:

<Http-Alias>/myurlspace</Http-Alias>
<Http-Classpath>/ui</Http-Classpath>
<Http-Welcome>index.html</Http-Welcome>

The kernel will take care of mounting the resources, so that's all that
needs to be done.  In many cases, we can remove the <Service-Component>
section of the pom and the src/main/resources/OSGI-INF directory altogether.

One potential issue with this approach is that only one alias and one
classpath can be mounted per bundle.  We don't currently have any cases
where we try to do this multiple times in a single bundle, so I don't
consider this to be a problem.

Thanks for any feedback,
Josh
_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn


To unsubscribe please email
[email protected]
_______________________________________________

Reply via email to