Details

    • Branch Version/s:
      6.0.x
    • Backported to Branch:
      Committed
    • Liferay Contributor's Agreement:
      Accept
    • Similar Issues:
      Show 4 results 

      Description

      I have several pages with WIKIs scoped to them.
      I have intentionally the same content in these liferay pages. One liferay page ID is 'installation-guide', the second 'user-manual'. The first pages' wiki has ID = 10289, the second 10368.
      When I use search portlet to find any content, I am getting the following results:

      1) http://localhost:8080/web/guest/installation-guide/-/wiki/10289/FrontPage/maximized?p_p_auth=71YD4jO7
      2) http://localhost:8080/web/guest/installation-guide/-/wiki/10289/Child+Page/maximized?p_p_auth=71YD4jO7
      3) http://localhost:8080/web/guest/installation-guide/-/wiki/10368/FrontPage/maximized?p_p_auth=71YD4jO7
      4) http://localhost:8080/web/guest/installation-guide/-/wiki/10368/Child+Page/maximized?p_p_auth=71YD4jO7

      When first two link are clicked, the proper layout is diplayed. But the rest not (instead of user-manual it is displayed in installation-guide page).
      I see the problem in the hyperlink. Why is there 'installation-guide' for all the entries?

        Activity

        Hide
        Jorge Ferrer added a comment -

        Hey Juan,

        I'm trying to apply the patch to trunk, but as mentioned above, too many things have changed in this code so I'm going to need your help. Also, it seems the new method you have added to WikiOpenSearchImpl started as a copy of the method in the upper class. Could you explain what you have modified from the base method and why?

        If possible I plan to add some protected methods to the upper class that allow customizing the result without doing a full copy of the method in the subclass.

        Show
        Jorge Ferrer added a comment - Hey Juan, I'm trying to apply the patch to trunk, but as mentioned above, too many things have changed in this code so I'm going to need your help. Also, it seems the new method you have added to WikiOpenSearchImpl started as a copy of the method in the upper class. Could you explain what you have modified from the base method and why? If possible I plan to add some protected methods to the upper class that allow customizing the result without doing a full copy of the method in the subclass.
        Hide
        Juan G added a comment -

        Hi Jorge,
        Yep, it seems many changes has been made to OpenSearch!

        The problem I had to override the method was plid. If you want to apply the second patch (layout is going to be from the result one and not from the source one which made the search) then the best approach could be adding a protected method (getPlid for example) in BaseOpenSearchImpl. Then this method should be overriden from WikiOpenSearch because plid should be obtained from search result layout (not default layout that is today's default behaviour):

        BaseOpenSearchImpl.java
         
        protected PortletURL getPortletURL(
        			HttpServletRequest request, String portletId, long groupId)
        		throws Exception {
        
        		long plid = getPlid(....); //THIS IS NEW!
        
        		PortletURL portletURL = PortletURLFactoryUtil.create(
        			request, portletId, plid, PortletRequest.RENDER_PHASE);
        
        		portletURL.setWindowState(WindowState.MAXIMIZED);
        		portletURL.setPortletMode(PortletMode.VIEW);
        
        		return portletURL;
        	}
        }
          protected long getPlid(....) {
           //same behaviour as today (copied from trunk getPortletURL method)
        long plid = LayoutServiceUtil.getDefaultPlid(
        			groupId, false, portletId);
        
        		if (plid == 0) {
        			plid = LayoutServiceUtil.getDefaultPlid(
        				groupId, true, portletId);
        		}
        
        		if (plid == 0) {
        			Layout layout = (Layout)request.getAttribute(WebKeys.LAYOUT);
        
        			if (layout != null) {
        				plid = layout.getPlid();
        			}
        		}
        }	
        
        WikiOpenSearchImpl.java
          protected long getPlid(....) {
        return PortalUtil.getPlidFromPortletId(resultGroupId, portletId);
        }	
        
        Show
        Juan G added a comment - Hi Jorge, Yep, it seems many changes has been made to OpenSearch! The problem I had to override the method was plid. If you want to apply the second patch (layout is going to be from the result one and not from the source one which made the search) then the best approach could be adding a protected method (getPlid for example) in BaseOpenSearchImpl. Then this method should be overriden from WikiOpenSearch because plid should be obtained from search result layout (not default layout that is today's default behaviour): BaseOpenSearchImpl.java protected PortletURL getPortletURL( HttpServletRequest request, String portletId, long groupId) throws Exception { long plid = getPlid(....); //THIS IS NEW! PortletURL portletURL = PortletURLFactoryUtil.create( request, portletId, plid, PortletRequest.RENDER_PHASE); portletURL.setWindowState(WindowState.MAXIMIZED); portletURL.setPortletMode(PortletMode.VIEW); return portletURL; } } protected long getPlid(....) { //same behaviour as today (copied from trunk getPortletURL method) long plid = LayoutServiceUtil.getDefaultPlid( groupId, false , portletId); if (plid == 0) { plid = LayoutServiceUtil.getDefaultPlid( groupId, true , portletId); } if (plid == 0) { Layout layout = (Layout)request.getAttribute(WebKeys.LAYOUT); if (layout != null ) { plid = layout.getPlid(); } } } WikiOpenSearchImpl.java protected long getPlid(....) { return PortalUtil.getPlidFromPortletId(resultGroupId, portletId); }
        Hide
        Pani Gui (Inactive) added a comment - - edited

        FAILED Manual Testing using the following steps:
        1. Create a page named "Wiki Page 1".
        2. Add Wiki portlet and scope it to this page.
        3. Create a frontpage and a childpage named "hello".
        4. Create a page named "Wiki Page 2".
        5. Add Wiki portlet and scope it to this page.
        6. Create a frontpage and a childpage named "hello".
        7. Create a page named "Search Page".
        8. Add Search portlet.
        9. Enter "hello" to search the wiki contents.
        10. Click each wiki content in search results.

        Reproduced on:
        Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.0.5 CE.
        Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.0.6 CE.

        Fixed on:
        Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.1.x Revision 85727.

        Failed on:
        Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.0.x Revision 85727.

        The results URLs aren't correct. It's displayed "web/guest/search page" instead of "web/guest/wiki page 1" or "web/guest/wiki page 2".
        After clicking the wiki content on Search portlet, it isn't navigated to the wiki content with the scoped page.
        Note: the Global scope works fine.

        Show
        Pani Gui (Inactive) added a comment - - edited FAILED Manual Testing using the following steps: 1. Create a page named "Wiki Page 1". 2. Add Wiki portlet and scope it to this page. 3. Create a frontpage and a childpage named "hello". 4. Create a page named "Wiki Page 2". 5. Add Wiki portlet and scope it to this page. 6. Create a frontpage and a childpage named "hello". 7. Create a page named "Search Page". 8. Add Search portlet. 9. Enter "hello" to search the wiki contents. 10. Click each wiki content in search results. Reproduced on: Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.0.5 CE. Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.0.6 CE. Fixed on: Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.1.x Revision 85727. Failed on: Tomcat 6.0.32 + MySQL 5. Firefox 5.0. 6.0.x Revision 85727. The results URLs aren't correct. It's displayed "web/guest/search page" instead of "web/guest/wiki page 1" or "web/guest/wiki page 2". After clicking the wiki content on Search portlet, it isn't navigated to the wiki content with the scoped page. Note: the Global scope works fine.
        Hide
        Pani Gui (Inactive) added a comment -

        PASSED Manual Testing following steps in previous comment.

        Fixed on:
        Tomcat 6.0.33 + MySQL 5. Firefox 6.0. 6.0.x Revision 89412.

        When hovering the mouse on the searched result on Search portlet, on the bottom of browser will show the article's link. After clicking the article on Search portlet, the page returns to the article located page.

        Show
        Pani Gui (Inactive) added a comment - PASSED Manual Testing following steps in previous comment. Fixed on: Tomcat 6.0.33 + MySQL 5. Firefox 6.0. 6.0.x Revision 89412. When hovering the mouse on the searched result on Search portlet, on the bottom of browser will show the article's link. After clicking the article on Search portlet, the page returns to the article located page.
        Hide
        Vicki Tsang (Inactive) added a comment -

        This is being bulk closed in preparation for the new workflow.

        Show
        Vicki Tsang (Inactive) added a comment - This is being bulk closed in preparation for the new workflow.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 43 weeks, 2 days ago

              Development

                Subcomponents

                  Structure Helper Panel