Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha1
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration

      Description


      ICEfaces is configured through web.xml and potentially other mechanisms. Configuration parameters should be obtained in a consistent manner and configuration problems should be easily diagnosed.

      The current Configuration Class is effective, but should be improved:

        - repackaged into org.icefaces.application.Configuration
        - full attribute names appear in source code in one place:

      private static String PUSH_ESTABLISH = "org.icefaces.push.establish";

        - typesafe configuration getters

        public String getPushEstablish()

        - full configuration dump on startup

      DEBUG: org.icefaces.push.establish = lazy

        Activity

        Hide
        Ted Goddard added a comment -

        A fairly elegant form of the API could assume a FacesContext in scope:

        public String getPushEstablish()

        but it is likely that Configuration will need to be accessed during non-JSF contexts, so a reasonable API may be

        public String getPushEstablish(Object context)

        where acceptable context objects are FacesContext, ServletContext, or PortletContext.

        Since new methods must be added for each configuration parameter, it should not be necessary to add both forms of the getter.

        Show
        Ted Goddard added a comment - A fairly elegant form of the API could assume a FacesContext in scope: public String getPushEstablish() but it is likely that Configuration will need to be accessed during non-JSF contexts, so a reasonable API may be public String getPushEstablish(Object context) where acceptable context objects are FacesContext, ServletContext, or PortletContext. Since new methods must be added for each configuration parameter, it should not be necessary to add both forms of the getter.
        Hide
        Ted Goddard added a comment -

        It may be desirable to have an API that allows configuration to be changed at runtime.

        Show
        Ted Goddard added a comment - It may be desirable to have an API that allows configuration to be changed at runtime.
        Hide
        Deryk Sinotte added a comment -

        After looking at the EnvUtils and EnvConfig classes, here are my initial thoughts. Assuming that the purpose of centralized configuration is to mainly meet the requirements set out in the description:

        • full attribute names appear in source code in one place:
        • typesafe configuration getters
        • full configuration dump on startup

        1) I don't see an obvious requirement to keep separate classes. I think a single class can be used as the external facing API. If necessary, we can add other supporting classes for utility or environment specific purposes but I think a single class "Environment" or "Configuration" or whatever should suffice and is desirable for core developers. Even more important if we expect application developers to access this as well.

        2) I think the logging, currently set for INFO on the attributes we are currently supporting, should be set to a lower level (DEBUG perhaps) and potentially dumped out all in one go when the decoding is done rather than logged per call to decode.

        3) Not sure I agree with the non-type safe nature of the (Object context) parameter suggestion if that's what's being pitched. If we were using a different language maybe . ServletContext can be done via ServletContextListener, PortletContext can be done via the bridge. Since they are application scoped, neither really needs to be passed in to a method at all - they can be set at app startup. If it requires a FacesContext to access it, then non-Faces threads will have problems as noted. So we should have a simple, consistent way to guard against that and have it logged appropriately.

        Show
        Deryk Sinotte added a comment - After looking at the EnvUtils and EnvConfig classes, here are my initial thoughts. Assuming that the purpose of centralized configuration is to mainly meet the requirements set out in the description: full attribute names appear in source code in one place: typesafe configuration getters full configuration dump on startup 1) I don't see an obvious requirement to keep separate classes. I think a single class can be used as the external facing API. If necessary, we can add other supporting classes for utility or environment specific purposes but I think a single class "Environment" or "Configuration" or whatever should suffice and is desirable for core developers. Even more important if we expect application developers to access this as well. 2) I think the logging, currently set for INFO on the attributes we are currently supporting, should be set to a lower level (DEBUG perhaps) and potentially dumped out all in one go when the decoding is done rather than logged per call to decode. 3) Not sure I agree with the non-type safe nature of the (Object context) parameter suggestion if that's what's being pitched. If we were using a different language maybe . ServletContext can be done via ServletContextListener, PortletContext can be done via the bridge. Since they are application scoped, neither really needs to be passed in to a method at all - they can be set at app startup. If it requires a FacesContext to access it, then non-Faces threads will have problems as noted. So we should have a simple, consistent way to guard against that and have it logged appropriately.
        Hide
        Ted Goddard added a comment -

        1) This sounds good – there should be only one public API class. Two implementation classes may still make sense since one class can be concerned only with extracting the values from the startup configuration, not from view-based configuration.

        2) Packing the configuration into a single log entry would be best. Each decode can append to the one log String rather than writing directly. If there is only one log entry, INFO is probably fine since one of the main uses of this feature is to obtain diagnostics from people who are generally having difficulty.

        3) This suggestion does not appear to be in the implementation and it's not clear that any configuration is actually required outside of a JSF context. If such configuration appears, we can add another type-safe method for accessing it.

        Show
        Ted Goddard added a comment - 1) This sounds good – there should be only one public API class. Two implementation classes may still make sense since one class can be concerned only with extracting the values from the startup configuration, not from view-based configuration. 2) Packing the configuration into a single log entry would be best. Each decode can append to the one log String rather than writing directly. If there is only one log entry, INFO is probably fine since one of the main uses of this feature is to obtain diagnostics from people who are generally having difficulty. 3) This suggestion does not appear to be in the implementation and it's not clear that any configuration is actually required outside of a JSF context. If such configuration appears, we can add another type-safe method for accessing it.
        Hide
        Ken Fyten added a comment -

        For the Beta release the priority is to finalize the public-facing API. The other changes can be made prior to 2.0 final release.

        Show
        Ken Fyten added a comment - For the Beta release the priority is to finalize the public-facing API. The other changes can be made prior to 2.0 final release.
        Hide
        Deryk Sinotte added a comment -

        I've "converged" the configuration handling into EnvUtils and removed the older classes.

        Show
        Deryk Sinotte added a comment - I've "converged" the configuration handling into EnvUtils and removed the older classes.
        Hide
        Deryk Sinotte added a comment -

        The utility class now captures and logs all of the following parameters and their potentially default settings:

        INFO: ICEfaces Configuration:
        org.icefaces.render.auto: true [default]
        org.icefaces.autoid: true [default]
        org.icefaces.aria.enabled: true [default]
        org.icefaces.blockUIOnSubmit: false [default]
        org.icefaces.compressDOM: false [default]
        org.icefaces.compressResources: true [default]
        org.icefaces.connectionLostRedirectURI: null [default]
        org.icefaces.deltaSubmit: false [default]
        org.icefaces.sessionExpiredRedirectURI: null [default]
        org.icefaces.deltaSubmit: false [default]
        org.icefaces.windowScopeExpiration = 1000 [default]

        Show
        Deryk Sinotte added a comment - The utility class now captures and logs all of the following parameters and their potentially default settings: INFO: ICEfaces Configuration: org.icefaces.render.auto: true [default] org.icefaces.autoid: true [default] org.icefaces.aria.enabled: true [default] org.icefaces.blockUIOnSubmit: false [default] org.icefaces.compressDOM: false [default] org.icefaces.compressResources: true [default] org.icefaces.connectionLostRedirectURI: null [default] org.icefaces.deltaSubmit: false [default] org.icefaces.sessionExpiredRedirectURI: null [default] org.icefaces.deltaSubmit: false [default] org.icefaces.windowScopeExpiration = 1000 [default]
        Hide
        Deryk Sinotte added a comment -

        Fixed the double entry for deltaSubmit and made sure that standardFormSerialization was listed:

        ICEfaces Configuration:
        org.icefaces.render.auto: true [default]
        org.icefaces.autoid: true [default]
        org.icefaces.aria.enabled: true [default]
        org.icefaces.blockUIOnSubmit: false [default]
        org.icefaces.compressDOM: false [default]
        org.icefaces.compressResources: true [default]
        org.icefaces.connectionLostRedirectURI: null [default]
        org.icefaces.deltaSubmit: false [default]
        org.icefaces.sessionExpiredRedirectURI: null [default]
        org.icefaces.standardFormSerialization: false [default]
        org.icefaces.windowScopeExpiration = 1000 [default]

        Show
        Deryk Sinotte added a comment - Fixed the double entry for deltaSubmit and made sure that standardFormSerialization was listed: ICEfaces Configuration: org.icefaces.render.auto: true [default] org.icefaces.autoid: true [default] org.icefaces.aria.enabled: true [default] org.icefaces.blockUIOnSubmit: false [default] org.icefaces.compressDOM: false [default] org.icefaces.compressResources: true [default] org.icefaces.connectionLostRedirectURI: null [default] org.icefaces.deltaSubmit: false [default] org.icefaces.sessionExpiredRedirectURI: null [default] org.icefaces.standardFormSerialization: false [default] org.icefaces.windowScopeExpiration = 1000 [default]

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: