4 Replies Latest reply on Oct 5, 2008 10:17 PM by jgilbert

    Medium Grained Pages.xml

    jgilbert

      Currently it is possible to have a global pages.xml file or a .page.xml per page.


      I would like to be able to define multiple meta-inf/pages.xml and have them all merged similar to the way meta-inf/components.xml works.


      It looks like I could just modify Pages.initialize() to work similar to the way Initialization.initComponentsFromXmlDocuments() works something like this:


      public void initialize() {
         // leave existing impl
         for (String resource: resources) {
            InputStream stream = ResourceLoader.instance().getResourceAsStream(resource);      
            parse(stream);
         }
         
         // add adding approach
         Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources("META-INF/pages.xml");
         while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            parse(url.openStream());
         }
      }



      Does anyone see any unintended side effects or problems with doing this?