ICEfaces
  1. ICEfaces
  2. ICE-8203

ICEpushResourceHandler.initialize(...) assumes that there is only one lifecycleId

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, 3.1.0.BETA1
    • Fix Version/s: 3.1.0.BETA2, 3.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Discovered with Liferay Faces Bridge, but it's a generic problem.
    • Assignee Priority:
      P1
    • Workaround Exists:
      Yes
    • Workaround Description:
      For now, I've worked around this issue in Liferay Faces Bridge.

      Description

      I recently patched the following issue in Liferay Faces Bridge:
      http://issues.liferay.com/browse/FACES-1252

      And the solution was to have a separate Lifecycle instance for each of the enum values in javax.portlet.faces.Bridge.PortletPhase:
      http://myfaces.apache.org/portlet-bridge/2.0/api/apidocs/javax/portlet/faces/Bridge.PortletPhase.html

      The problem is that ICEpushResourceHandler.initialize(...) assumes that there is only one lifecycleId, meaning the default one:

      {code}
                  ((LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY)).
                          getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE).addPhaseListener(icePushResourceHandler);{code}

      Here is a patch:
      {code}
                  LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
                  Iterator<String> lifecycleIds = lifecycleFactory.getLifecycleIds();
                  while (lifecycleIds.hasNext()) {
                   String lifecycleId = lifecycleIds.next();
           Lifecycle lifecycle = lifecycleFactory.getLifecycle(lifecycleId);
      lifecycle.addPhaseListener(icePushResourceHandler);
                  }
      {code}

        Activity

        Hide
        Neil Griffin added a comment -

        Corresponding issue in the Liferay Issue Tracker: http://issues.liferay.com/browse/FACES-1259

        Show
        Neil Griffin added a comment - Corresponding issue in the Liferay Issue Tracker: http://issues.liferay.com/browse/FACES-1259
        Hide
        Deryk Sinotte added a comment -

        Fix applied. Resolving.

        Show
        Deryk Sinotte added a comment - Fix applied. Resolving.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: