[jboss-user] [JBoss Seam] - Layering / overloading resources approach

utiba_davidr do-not-reply at jboss.com
Mon Jun 25 01:04:57 EDT 2007


Hi,

  I originally raised this issue in another thread that seems to have been overlooked, probably not the best place to raise it. So I have decided to raise my query again, hopefully not angering anyone in the process.

  What we want to achieve is to be able to layer our JSF projects. Typically we have a "framework", that a "product" extends from and then a "site" may be introduced to capture any site specific customisations to the "product". Each layer ("framework", "product" and "site") will have their own collection of Java beans, XHTML components and XML and property configuration files. All of these should be able to override the previous implementation, whilst at the same time still being able to access them to "extend" them (i.e. Java inheritance and Facelets style XHTML extending).

Problem: How to layer "Beans", "XHTML components" and "configuration".

Solution: Beans.

  This is quite easy, and Seam has already provided functionality for this using the @Install annotation. I simply need to annotate the beans at the framework layer with an @Install precedence lower than the "product", and the same with the "product" lower than the "site".

Solved: Configuration: property files - using Seam's internationalization approach I could layer property files as well as provide internationalization support. Is this the correct approach?

Unsolved: XML configuration
  Not sure what the solution would be? It seems that multiple pages.xml files can be loaded - but is overriding allowed within pages.xml files?
  
Unsolved: XHTML
  Ideally what I would like is to have the following structure:

/view/product/function/main.xhtml
  | /view/product/function/two.xhtml

And then say, introduce the overloaded version of "main.xhtml":

/view/site/product/function/main.xhtml
  | 

And some how to refer to them both as the same name, either using EL (#{pages.product.function.main}) or using "/product/function/main.xhtml" and overloading some resource loader to scan multiple places for "/product/function/main.xhtml".

I am still as yet a little unclear as to what the best approach to take is, I can only assume (based on the presence of the @Install annotation) that others have faced the same problem. I am also interested in how you can load resources from JAR files - for the XHTML files as well as standard resources.. Weblets seems a little bit windy to me in this regard.

I hope I have been clear in what I am asking, if I have not - please let me know.. I would rather clarify than get no response.. I am pulling a few hairs out trying to figure out the best approach on this one.

Cheers,

David



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057233#4057233

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057233



More information about the jboss-user mailing list