2 Replies Latest reply on Feb 15, 2007 2:44 PM by quilleashm

    Programmatic control of Pages component

      Currently (1.1.6) it is possible to programmatically build the Page components that are usually read from pages.xml by doing

      Pages.getPage( viewId )

      with a viewId that doesn't have a pages.xml entry (it creates an empty page with the viewId if one is already present from pages.xml and a "viewId.pages.xml" file does not exist).

      Just wondering if this is a) intentional and b) going to be preserved in future versions. I can see the ability to do this coming in VERY useful for me in the near future but I didn't want to rely on something that may not be an intended feature.

      (I have a bunch of pages that all need the same action invoking before the page is rendered and don't want to churn out a load of duplicate pages.xml or run the risk of forgetting one in the future.)



        • 1. Re: Programmatic control of Pages component

          The facility will remain, but I can't give you a firm guarantee that the actual API won't change slightly from time to time (we've been adding functionality to pages.xml pretty regularly). So I can't guarantee there will be no non-breaking changes, but I can promise that there will always be some way to do what you are trying to do.

          • 2. Re: Programmatic control of Pages component

            Excellent, thanks. A minor API change I can handle.

            A minor followup. Would it be possible to add a way of overriding an existing pages.xml definition for a view. At the moment the only entry point I could see was getPage() which always returns the existing metadata. Maybe something like Pages.newPage( viewId ) which will always return an empty Page and replace an existing cached entry?