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

          Mircea Toma created issue -
          Mircea Toma made changes -
          Field Original Value New Value
          Salesforce Case []
          Fix Version/s 3.1 [ 10312 ]
          Affects [Documentation (User Guide, Ref. Guide, etc.)]
          Affects Version/s 3.1.0.BETA1 [ 10335 ]
          Assignee Mircea Toma [ mircea.toma ]
          Mircea Toma made changes -
          Salesforce Case []
          Assignee Priority P1
          Mircea Toma made changes -
          Link This issue blocks ICE-8163 [ ICE-8163 ]
          Mircea Toma made changes -
          Link This issue blocks ICE-8048 [ ICE-8048 ]
          Ken Fyten made changes -
          Salesforce Case []
          Assignee Priority P1 P2
          Ken Fyten made changes -
          Link This issue blocks ICE-8014 [ ICE-8014 ]
          Ken Fyten made changes -
          Fix Version/s 3.2 [ 10338 ]
          Fix Version/s 3.1 [ 10312 ]
          Mircea Toma made changes -
          Salesforce Case []
          Assignee Priority P2 P1
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30388 Mon Aug 06 08:38:44 MDT 2012 mircea.toma ICE-8171 Add first cut for the resource ordering implementation. Added also resource dependency metadata for core, compat, ace and showcase sub-projects.
          Files Changed
          Commit graph ADD /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/resources/META-INF
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/JavaScriptRunnerSetup.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
          Commit graph ADD /icefaces3/trunk/icefaces/compat/core/src/main/resources/META-INF/resource-dependency.xml
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/test.xml
          Commit graph ADD /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/resources/META-INF/resource-dependency.xml
          Commit graph MODIFY /icefaces3/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/component/JavaScriptContextSetup.java
          Commit graph ADD /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/META-INCLUDE/resource-dependency.xml
          Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resource-dependency.xml
          Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/ResourceOrdering.java
          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.
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30389 Mon Aug 06 16:42:23 MDT 2012 mircea.toma ICE-8171 Simplify comparison by normalizing both the dependency data read from the files and the resource component attributes.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/ResourceOrdering.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30390 Mon Aug 06 16:54:53 MDT 2012 mircea.toma ICE-8171 Create document builder once, outside the loop.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/ResourceOrdering.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30391 Mon Aug 06 16:55:39 MDT 2012 mircea.toma ICE-8171 Remove sysout.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/ResourceOrdering.java
          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?
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30503 Wed Aug 15 08:55:31 MDT 2012 mircea.toma ICE-8171 Use different facet names in Myfaces to lookup the head and body resource container components.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/ResourceOrdering.java
          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.
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Salesforce Case []
          Affects [Documentation (User Guide, Ref. Guide, etc.)] [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration]
          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.
          Mircea Toma made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #30570 Wed Aug 22 08:46:54 MDT 2012 mircea.toma ICE-8171 Cleaned up resource dependency tree for ACE components.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/META-INCLUDE/resource-dependency.xml
          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.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #31861 Tue Oct 30 16:39:09 MDT 2012 ken.fyten ICE-8171 - Modified resource dependency files to ensure that ACE combined.css is loaded prior to theme .css, which in turn is loaded prior to application override.css.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/resources/META-INF/resource-dependency.xml
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/META-INCLUDE/resource-dependency.xml
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #31869 Wed Oct 31 10:57:21 MDT 2012 jack.van.ooststroom Fixed JIRA ICE-8171 : Implement resource ordering based on declared resource interdependencies; Change from getContent() to getInputStream()
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/ResourceOrdering.java
          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.
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P1 [ 10010 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: