MyFaces Core
  1. MyFaces Core
  2. MYFACES-556

MyFacesGenericPortlet does not support mode change

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Portlet_Support
    • Labels:
      None
    • Environment:
      Jetspeed2

      Description

      I have defined my own view selector that returns different values depending on the portlet mode (view, edit). Changing from view to edit works fine. But when I want to return to view mode (clicking on the appropriate button on the portlet decorator) the portal resumes view mode (button changes) but the content displayed is still the edit page.

        Issue Links

          Activity

          Hide
          Stan Silvert added a comment -

          You have to extend MyFacesGenericPortlet. Have you seen this?:
          http://wiki.apache.org/myfaces/UsingPortletModes

          Also, we plan to address this in the JSF spec after 1.2, but that is far in the future. For now, it takes some hacking to get it to work.

          Show
          Stan Silvert added a comment - You have to extend MyFacesGenericPortlet. Have you seen this?: http://wiki.apache.org/myfaces/UsingPortletModes Also, we plan to address this in the JSF spec after 1.2, but that is far in the future. For now, it takes some hacking to get it to work.
          Hide
          Michael Lipp added a comment -

          Actually, I have done something similar to what is described in the wiki, except in a more general way (all pages configurable in portlet.xml) as I'm going to write several portlets.

          Is your development in any way synchronized with the portals-bridges project? I tried their bridge – that seems to try to solve the portlet/JSF issue independant of any particular implementation --, but had to abandon the approach due to PB-7 (http://issues.apache.org/jira/browse/PB-7). Maybe it would save effort to "fix" the bridge from the portal-bridges project that already has support for different views.

          Show
          Michael Lipp added a comment - Actually, I have done something similar to what is described in the wiki, except in a more general way (all pages configurable in portlet.xml) as I'm going to write several portlets. Is your development in any way synchronized with the portals-bridges project? I tried their bridge – that seems to try to solve the portlet/JSF issue independant of any particular implementation --, but had to abandon the approach due to PB-7 ( http://issues.apache.org/jira/browse/PB-7 ). Maybe it would save effort to "fix" the bridge from the portal-bridges project that already has support for different views.
          Hide
          Stan Silvert added a comment -

          No, I haven't done anything with portals-bridges. Let me know what you find. I'd like to figure out a general solution to this problem but I haven't had time to work on it. For right now, mode handling requires a lot of hand coding.

          Show
          Stan Silvert added a comment - No, I haven't done anything with portals-bridges. Let me know what you find. I'd like to figure out a general solution to this problem but I haven't had time to work on it. For right now, mode handling requires a lot of hand coding.
          Hide
          Michael Lipp added a comment -

          Attached is a modified MyFacesGenericPortlet.java that really works. Page reloads in the portlet re-produce the current state of the portlet, switching between view and edit mode works etc. It also prepares submitted files for subsequent access by JSF actions, though it does not support the submit tag (cannot be done because of type problems).

          Show
          Michael Lipp added a comment - Attached is a modified MyFacesGenericPortlet.java that really works. Page reloads in the portlet re-produce the current state of the portlet, switching between view and edit mode works etc. It also prepares submitted files for subsequent access by JSF actions, though it does not support the submit tag (cannot be done because of type problems).
          Hide
          Stan Silvert added a comment -

          Michael,

          Shinsuke Sugaya has volunteered to do some testing on the file upload part. I'm going to look at the modes stuff.

          Shinsuke noticed that the MyFacesAdaptedPortlet has a GPL license. We will need to deal with that problem before it can get comitted.

          Stan

          Show
          Stan Silvert added a comment - Michael, Shinsuke Sugaya has volunteered to do some testing on the file upload part. I'm going to look at the modes stuff. Shinsuke noticed that the MyFacesAdaptedPortlet has a GPL license. We will need to deal with that problem before it can get comitted. Stan
          Hide
          Shinsuke Sugaya added a comment -

          The file upload part depends on commons-fileupload 1.1(not release yet..).
          Therefore we need to ask commons-fileupload developer to release it.

          commons-fileupload seems to depend on commons-io 1.1 and wait it.
          But commons-io 1.1 has been released, so I think they can release commons-fileupload 1.1.

          Show
          Shinsuke Sugaya added a comment - The file upload part depends on commons-fileupload 1.1(not release yet..). Therefore we need to ask commons-fileupload developer to release it. commons-fileupload seems to depend on commons-io 1.1 and wait it. But commons-io 1.1 has been released, so I think they can release commons-fileupload 1.1.
          Hide
          Michael Lipp added a comment -

          (1) The file has the GPL note simply because our project is GPL'ed (and it is noted in the header that the file is based on Apache code). But I have submitted it with the option "Licensed for inclusion in ASF works", so you may safely remove the GPL note.

          (2) I'm not sure, but maybe commons-fileupload 1.0 is sufficient. I have used 1.1 simply because it has been available in my environment.

          Show
          Michael Lipp added a comment - (1) The file has the GPL note simply because our project is GPL'ed (and it is noted in the header that the file is based on Apache code). But I have submitted it with the option "Licensed for inclusion in ASF works", so you may safely remove the GPL note. (2) I'm not sure, but maybe commons-fileupload 1.0 is sufficient. I have used 1.1 simply because it has been available in my environment.
          Hide
          Shinsuke Sugaya added a comment -

          For commons-fileupload, MyFacesAdaptedPortlet needs 1.1. But 1.1 is not released yet. If it's not released in a few month, we can use MYFACES-434 code.

          Show
          Shinsuke Sugaya added a comment - For commons-fileupload, MyFacesAdaptedPortlet needs 1.1. But 1.1 is not released yet. If it's not released in a few month, we can use MYFACES-434 code.
          Hide
          Leonardo Uribe added a comment -

          The code of MYFACES-434 MyFaces's Portlet enhancement was committed, so this issue should be closed as duplicate.

          Show
          Leonardo Uribe added a comment - The code of MYFACES-434 MyFaces's Portlet enhancement was committed, so this issue should be closed as duplicate.

            People

            • Assignee:
              Stan Silvert
              Reporter:
              Michael Lipp
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development