2

I'm building a website for internal management of a research group. The concept behind the website is that anybody can load a data model containing the fields and formats of the information to be contained in a web page. Moreover, I have a collection of views (for managing different data models) and a set of templates (HTML4, HTML5, different-form-factors for mobile/pad devices).

I'm using mongo as database.

The website is URL centric. A user defines a web page and assigns it a URL within the scope of the url space available to the site. Thus, when a request arrives to the website, a view provider assigns a view to the request (and the view has the template hardcoded in the code).

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ply="http://java.sun.com/jsf/composite/pervasive/layout"
template="/WEB-INF/templates/siteconfiguration/datamodelloader.tmpl.jspx">

As shown in the previous example, I have both the views and templates stored in the WEB-INF folder and I would like to have them stored in different collections in the database. I would like to tell JSF where are them or to provide JSF an input stream or byte array containing the template and the view instead of having them in the WEB-INF folder. In such a way, I can edit, delete or update them in a more convenient way.

However, I'm lost. Can you please help me?

Thanks

Markus
  • 2,071
  • 4
  • 22
  • 44
  • related to this http://stackoverflow.com/questions/10953066/uicomposition-template-template-from-jar – sudmong Oct 06 '12 at 11:23
  • Possible duplicate of [Obtaining Facelets templates/files from an external filesystem or database](http://stackoverflow.com/questions/13292272/obtaining-facelets-templates-files-from-an-external-filesystem-or-database) – Kukeltje Sep 18 '16 at 19:46

1 Answers1

1

You may register a custom ResourceResolver (see also this answer) and make it point to a servlet, which will return a dynamically generated (or fetched from DB) view.

Community
  • 1
  • 1
jarek.jpa
  • 565
  • 1
  • 5
  • 18