ICEfaces
  1. ICEfaces
  2. ICE-8171

Implement resource ordering based on declared resource interdependencies

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0.BETA1
    • Fix Version/s: 3.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JSF
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration

      Description

      Many times the required resources need to be loaded in a certain order. Unfortunately JSF doesn't provide any mechanism for ordering the resources. To solve the problem we ned to introduce an additional resource annotation that can be used to declare the dependency of a resource on other resources. These annotations will provide then enough information to correctly order resources.

      The ordering will also solve the problem of different resource ordering that we see now between full page loads vs postbacks. See ICE-8048 and ICE-8023 .

        Issue Links

          Activity

          Hide
          Mircea Toma added a comment -

          Added first cut for the resource ordering implementation. Added also resource dependency metadata for core, compat, ace and showcase sub-projects.

          Show
          Mircea Toma added a comment - Added first cut for the resource ordering implementation. Added also resource dependency metadata for core, compat, ace and showcase sub-projects.
          Hide
          Deryk Sinotte added a comment -

          The ResourceOrdering class is throwing this exception when running with MyFaces and just attempting to load the app:

          java.lang.NullPointerException
          org.icefaces.impl.event.ResourceOrdering.orderResources(ResourceOrdering.java:117)
          org.icefaces.impl.event.ResourceOrdering.processEvent(ResourceOrdering.java:107)
          javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
          ...

          The problem seems to be in orderResources() where it tries to get the headResourceContainer:

          UIComponent headResourceContainer = root.getFacets().get("javax_faces_location_" + target.toUpperCase());

          I added a secondary approach:

          UIComponent headResourceContainer = root.getFacets().get("javax_faces_location_" + target.toUpperCase());
          if( headResourceContainer == null )

          { //MyFaces requires a slightly different approach it seems headResourceContainer = root.getFacet("head"); }

          This seemed to help it at least get over the NPE hurdle and allow the page to load but then the client complains:

          Uncaught ReferenceError: ice is not defined showcase.jsf:13
          Uncaught ReferenceError: ice is not defined showcase.jsf:168
          Uncaught ReferenceError: ice is not defined showcase.jsf:169
          Uncaught ReferenceError: ice is not defined showcase.jsf:170
          Uncaught ReferenceError: ice is not defined showcase.jsf:171
          Uncaught ReferenceError: ice is not defined showcase.jsf:172
          Uncaught ReferenceError: ice is not defined showcase.jsf:174
          Uncaught ReferenceError: ice is not defined showcase.jsf:180
          Uncaught ReferenceError: ice is not defined showcase.jsf:183
          Uncaught ReferenceError: ice is not defined showcase.jsf:348
          Uncaught ReferenceError: ice is not defined showcase.jsf:349
          Uncaught ReferenceError: ice is not defined showcase.jsf:354
          Uncaught ReferenceError: ice is not defined showcase.jsf:356

          I can see that the bridge.js loaded but perhaps too late to be of use?

          Show
          Deryk Sinotte added a comment - The ResourceOrdering class is throwing this exception when running with MyFaces and just attempting to load the app: java.lang.NullPointerException org.icefaces.impl.event.ResourceOrdering.orderResources(ResourceOrdering.java:117) org.icefaces.impl.event.ResourceOrdering.processEvent(ResourceOrdering.java:107) javax.faces.event.SystemEvent.processListener(SystemEvent.java:43) ... The problem seems to be in orderResources() where it tries to get the headResourceContainer: UIComponent headResourceContainer = root.getFacets().get("javax_faces_location_" + target.toUpperCase()); I added a secondary approach: UIComponent headResourceContainer = root.getFacets().get("javax_faces_location_" + target.toUpperCase()); if( headResourceContainer == null ) { //MyFaces requires a slightly different approach it seems headResourceContainer = root.getFacet("head"); } This seemed to help it at least get over the NPE hurdle and allow the page to load but then the client complains: Uncaught ReferenceError: ice is not defined showcase.jsf:13 Uncaught ReferenceError: ice is not defined showcase.jsf:168 Uncaught ReferenceError: ice is not defined showcase.jsf:169 Uncaught ReferenceError: ice is not defined showcase.jsf:170 Uncaught ReferenceError: ice is not defined showcase.jsf:171 Uncaught ReferenceError: ice is not defined showcase.jsf:172 Uncaught ReferenceError: ice is not defined showcase.jsf:174 Uncaught ReferenceError: ice is not defined showcase.jsf:180 Uncaught ReferenceError: ice is not defined showcase.jsf:183 Uncaught ReferenceError: ice is not defined showcase.jsf:348 Uncaught ReferenceError: ice is not defined showcase.jsf:349 Uncaught ReferenceError: ice is not defined showcase.jsf:354 Uncaught ReferenceError: ice is not defined showcase.jsf:356 I can see that the bridge.js loaded but perhaps too late to be of use?
          Hide
          Mircea Toma added a comment -

          Use different facet names in Myfaces to lookup the head and body resource container components.

          Show
          Mircea Toma added a comment - Use different facet names in Myfaces to lookup the head and body resource container components.
          Hide
          Mircea Toma added a comment - - edited

          Need to finish up declaring all resource dependencies for ACE components.

          Show
          Mircea Toma added a comment - - edited Need to finish up declaring all resource dependencies for ACE components.
          Hide
          Mircea Toma added a comment -

          Cleaned up resource dependency tree for ACE components.

          Show
          Mircea Toma added a comment - Cleaned up resource dependency tree for ACE components.
          Hide
          Jack Van Ooststroom added a comment - - edited

          Changed from URL.getContent() to URL.getInputStream() is we only seem to be interested in the InputStream. On JBoss AS 7.1.1 when using URL.getContent() a org.jboss.vfs.VirtualFile instance is returned which cannot be cast to anything useful.

          Show
          Jack Van Ooststroom added a comment - - edited Changed from URL.getContent() to URL.getInputStream() is we only seem to be interested in the InputStream. On JBoss AS 7.1.1 when using URL.getContent() a org.jboss.vfs.VirtualFile instance is returned which cannot be cast to anything useful.

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Mircea Toma
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: