Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper - Websphere

This is a discussion on Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper - Websphere ; We are developing JSR 286 JSF portlets using WPS 6.1 with WAS 6.1.0.19 and RSA 7.5 on Windows XP. We have a requirement to provide a link to the edit page of different portlet on a different page from the ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

  1. Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    We are developing JSR 286 JSF portlets using WPS 6.1 with WAS 6.1.0.19 and RSA 7.5 on Windows XP.

    We have a requirement to provide a link to the edit page of different portlet on a different page from the current portlet by passing some parameters.

    In order to achieve that, I used generateUrl method in the wp.l2.url.helper to target the Edit mode.

    It is working fine and I am able to successfully pass the parameters.

    We are noticing a problem when we manually change the mode of that portlet from edit to view (by clicking a link to the search page from the details page changing the JSP)

    Then, generateUrl returns the view mode url instead of edit mode url, though edit mode is passed to the generateUrl method as a parameter.

    If we manually put that page back in edit mode, then again the generateUrl seems to be returning the correct url.

    How can I ensure that the link always goes to the edit mode?

    I would appreciate any help on this.

    Here is the code....

    //From the link on jsp I call an action method in the backing bean

    //From there I get the url as follows and redirect it.

    FacesContext fc = FacesContext.getCurrentInstance();
    String url = PortletURLHelper.generateUrl("test.page", "test.page.xyzportlet",
    params1,
    true,
    (javax.portlet.PortletRequest)fc.getExternalContex t().getRequest(),
    (javax.portlet.PortletResponse)fc.getExternalConte xt().getResponse(),
    javax.portlet.PortletMode.EDIT.toString());


    fc.getExternalContext().redirect(url);
    fc.responseComplete();

  2. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    where is this link being generated to? does it show up in edit mode? I am confused how you are seeing the link in both views, how is this jsp being showed for both views?



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  3. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    Thanks for your response.

    Let me explain....

    We have 2 portlets PortletA and PortletB.

    We provide Search/Add/Edit/Delete of some business entities through them.

    PortletA displays a list of PortletB related entities also. And the idea is to provide a link on the PortletA results list so that the user can go directly to the PortletB details page when clicked on.

    PortletA has a Search screen JSP
    PortletB has 2 modes (view and edit) and 2 corresponding jsps. Default is Search Page.

    PortletA and PortletB are on 2 different pages (PageA and PageB) along with 2 other Menu portlets.

    Within the portlet there are other command links that use JSF navigation to switch from Search page to details/edit pages and vice versa.

    The link that I am having problem is the one from PortletA on PageA to PortletB on PageB.

    After the user logs into the application, when a search is performed on the PageA and when clicked on the link to go to PageB, the link is working correctly and we are able to see PageB with PortletB in Edit mode (details page).

    Problem is when the user from PageB goes back to PortletB's Search page(using JSF navigation) then goes to PageA and then invokes the link again to PageB details, PageB opens up but in view mode.

    If the PortletB is left on Details page, then the link from PageA works correctly.

    If PortletB is left on Search Page, PortletA link takes us to PortletB's search page instead of details page.

    I tried to handle this issue using JSF by reading the request parameters in the prerender method of PortletB - Search page and redirect it to Edit if it is relevant.

    Redirect is not working. And dispatch is giving Assertion Failed exception.


    Hope this helps you understand.

    Please let me know if you have any questions.

    Thanks!

  4. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    try changing the true to false to not save state


    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  5. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    It works now. Thank you very much.

  6. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    I noticed a new problem with it now. If I login as wp administrator, the portlet - portlet link works correctly. If I login as some other user that has permission to the portlet/page, I am getting "You are not authorized to use this portlet.".
    Is there a way to get around this?

  7. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    what version? and what permissions? and what mode?



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  8. Re: Problem in switching the Portlet Mode in JSF Portlet usingwp.l2.url.helper

    This is related to the portlet - portlet (Edit mode) link issue.

    You suggested me to use false in the save state to make the link always go to Edit mode.

    We are using WPS 6.1 with WAS 6.1.0.19 and RSA 7.5 on Windows XP.

    This link is working when I login as portal admin.

    For this application we have some security roles defined and I have assigned the appropriate roles to the source and the target portlets and pages.

    When I login as any other app user, this link is giving You are not authorized to view this portlet message.

    Instead of using this link, if I directly access the target portlet, I am able to access it fine.

    Thanks,
    Latha.

+ Reply to Thread