ICEfaces
  1. ICEfaces
  2. ICE-6318

Configuration parameter for MandatoryResource annotation

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces, ACE

      Description


      A context parameter is required to configure resource loading via the MandatoryResource annotation. Currently, all resources for all components are added, whether those components are used in the application or not. For instance, fileEntry does not require any YUI resources, but is included in the same .jar file as other components that force the loading of these resources.

      org.icefaces.mandatoryResourceConfiguration will be a web.xml context parameter as follows:
      undefined: all resources will be loaded
      empty string: no resources will be loaded
      space separated list: named components will have their resources loaded

        Activity

        Hide
        Ted Goddard added a comment -

        Tested in ace-showcase with the following web.xml configuration parameter:

        <context-param>
        <param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
        <param-value>org.icefaces.component.sliderentry.SliderEntry org.icefaces.component.datetimeentry.DateTimeEntry</param-value>
        </context-param>

        Feature was modified to expect a space-separated list rather than comma-separated. Classnames specify which components will have their resources added to every application page. If the component page is visited via a link, the resources will still be loaded for that page. (The only complication arises if a component is added dynamically via Ajax.)

        Show
        Ted Goddard added a comment - Tested in ace-showcase with the following web.xml configuration parameter: <context-param> <param-name>org.icefaces.mandatoryResourceConfiguration</param-name> <param-value>org.icefaces.component.sliderentry.SliderEntry org.icefaces.component.datetimeentry.DateTimeEntry</param-value> </context-param> Feature was modified to expect a space-separated list rather than comma-separated. Classnames specify which components will have their resources added to every application page. If the component page is visited via a link, the resources will still be loaded for that page. (The only complication arises if a component is added dynamically via Ajax.)
        Hide
        Ted Goddard added a comment -

        This is not likely to help in the portlet case since it does not entirely prevent the JavaScript resources from being loaded – preventing that would be difficult as the components contain annotations that are automatically processed by JSF.

        Show
        Ted Goddard added a comment - This is not likely to help in the portlet case since it does not entirely prevent the JavaScript resources from being loaded – preventing that would be difficult as the components contain annotations that are automatically processed by JSF.
        Hide
        Ted Goddard added a comment -

        It's possible that this should remain an undocumented feature since the specifics of how components declare their resources is subject to change.

        Show
        Ted Goddard added a comment - It's possible that this should remain an undocumented feature since the specifics of how components declare their resources is subject to change.
        Hide
        Ted Goddard added a comment -

        Configure as follows to suppress all preloading of YUI JavaScript:

        <context-param>
        <param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
        <param-value></param-value>
        </context-param>

        If this parameter is omitted from web.xml, all YUI JavaScript will be preloaded.

        Show
        Ted Goddard added a comment - Configure as follows to suppress all preloading of YUI JavaScript: <context-param> <param-name>org.icefaces.mandatoryResourceConfiguration</param-name> <param-value></param-value> </context-param> If this parameter is omitted from web.xml, all YUI JavaScript will be preloaded.
        Hide
        Ted Goddard added a comment -

        "Suppress preloading" is likely the correct value for ace-showcase since navigation is through full page redirects.

        Show
        Ted Goddard added a comment - "Suppress preloading" is likely the correct value for ace-showcase since navigation is through full page redirects.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: