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
        Jan Tošovský added a comment -

        In which phase that wrong link (.../guest/

        {wrong_part}

        /-/...) is generated? Is it during indexing for full text search or when the search results are rendered on the result page? I'd like to help with this issue, but I don't know where to start.

        Show
        Jan Tošovský added a comment - In which phase that wrong link (.../guest/ {wrong_part} /-/...) is generated? Is it during indexing for full text search or when the search results are rendered on the result page? I'd like to help with this issue, but I don't know where to start.
        Hide
        Juan G added a comment -

        This issue is currently being addressed in Sprint 3 of the 100 PaperCuts program. Please see http://liferay.com/community/100-papercuts

        Show
        Juan G added a comment - This issue is currently being addressed in Sprint 3 of the 100 PaperCuts program. Please see http://liferay.com/community/100-papercuts
        Hide
        Cynthia Wilburn (Inactive) added a comment -

        Updating affected version from 6.0.5 to 6.0.6. Key issues that were closed in 6.0.6 are in the 6.0.6 release notes.

        Show
        Cynthia Wilburn (Inactive) added a comment - Updating affected version from 6.0.5 to 6.0.6. Key issues that were closed in 6.0.6 are in the 6.0.6 release notes.
        Hide
        Juan G added a comment -

        Hi Jan,
        I've tried to reproduce the issue but I guess I've found a bug on a previous step. I can't add a second wiki on another page and change its scope to that page with current trunk version.
        I'll try to reproduce it for 6.0.6 with steps provided.

        Show
        Juan G added a comment - Hi Jan, I've tried to reproduce the issue but I guess I've found a bug on a previous step. I can't add a second wiki on another page and change its scope to that page with current trunk version. I'll try to reproduce it for 6.0.6 with steps provided.
        Hide
        Juan G added a comment -

        Patch to solve the issue. Search in WikiOpenSearchImp have been overriden (copy/pasted from base class and modified) to create portlet URL properly (and for those wiki portlets with page scope).

        Please Jan, can you test this patch and tell if it solves the issue? (if so, click in "Accept Contribution" to get Liferay staff to know this). Thanks!

        Show
        Juan G added a comment - Patch to solve the issue. Search in WikiOpenSearchImp have been overriden (copy/pasted from base class and modified) to create portlet URL properly (and for those wiki portlets with page scope). Please Jan, can you test this patch and tell if it solves the issue? (if so, click in "Accept Contribution" to get Liferay staff to know this). Thanks!
        Hide
        Juan G added a comment -

        Solution provided in previous uploaded patch

        Show
        Juan G added a comment - Solution provided in previous uploaded patch
        Hide
        Jan Tošovský added a comment -

        Juan, sounds great! I'd like to help but I am not experienced programmer with ability to build that patch and incorporate it into my Liferay instance. Up to now I have done this procedure just for small independent portlets which were build and deployed as war file. I doubt this wiki issue can be done in the same way as it is incorporated into Liferay more tightly I think. I can try if there is any step by step procedure how to do it. But don't waste time to write it especially for me.

        Show
        Jan Tošovský added a comment - Juan, sounds great! I'd like to help but I am not experienced programmer with ability to build that patch and incorporate it into my Liferay instance. Up to now I have done this procedure just for small independent portlets which were build and deployed as war file. I doubt this wiki issue can be done in the same way as it is incorporated into Liferay more tightly I think. I can try if there is any step by step procedure how to do it. But don't waste time to write it especially for me.
        Hide
        Juan G added a comment -

        Hi Jan,

        Please can you read this thread to know how to apply patches?

        http://www.liferay.com/es/community/forums/-/message_boards/message/6922386#_19_message_6921956

        Tell me any problem you encounter.

        Show
        Juan G added a comment - Hi Jan, Please can you read this thread to know how to apply patches? http://www.liferay.com/es/community/forums/-/message_boards/message/6922386#_19_message_6921956 Tell me any problem you encounter.
        Hide
        Jan Tošovský added a comment -

        There is no tag for 6.0.6 so I patched 6.0.5. It builts correctly, but in search results there is always 'home' instead of appropriate 'layout' name.

        original: http://localhost:8080/web/guest/installation-guide/-/wiki/10289/FrontPage/maximized?p_p_auth=71YD4jO7
        new: http://localhost:8080/web/guest/home/-/wiki/10289/FrontPage/maximized?p_p_auth=71YD4jO7

        I think that 'layout' feature was added later, in 6.0.5+ (when scope is set to the current page, there is a 'layout' in the combobox).
        So I tried to patch the trunk version, but there was build problem with the addSearchResults method (not matching parameters).
        Which version of 'src' is required for this patch?

        Show
        Jan Tošovský added a comment - There is no tag for 6.0.6 so I patched 6.0.5. It builts correctly, but in search results there is always 'home' instead of appropriate 'layout' name. original: http://localhost:8080/web/guest/installation-guide/-/wiki/10289/FrontPage/maximized?p_p_auth=71YD4jO7 new: http://localhost:8080/web/guest/home/-/wiki/10289/FrontPage/maximized?p_p_auth=71YD4jO7 I think that 'layout' feature was added later, in 6.0.5+ (when scope is set to the current page, there is a 'layout' in the combobox). So I tried to patch the trunk version, but there was build problem with the addSearchResults method (not matching parameters). Which version of 'src' is required for this patch?
        Hide
        Juan G added a comment -

        Hi Jan,

        6.0.6 doesn't have tag, it's inside a branch only:

        http://svn.liferay.com/repos/public/portal/branches/6.0.6/

        About the layouts, I got the URL the way you said /<layout_id>/-(wiki..... but this caused to break the "Back to page" link (it got back only to current layout, not to where the search portlet layout was).

        Show
        Juan G added a comment - Hi Jan, 6.0.6 doesn't have tag, it's inside a branch only: http://svn.liferay.com/repos/public/portal/branches/6.0.6/ About the layouts, I got the URL the way you said /<layout_id>/-(wiki..... but this caused to break the "Back to page" link (it got back only to current layout, not to where the search portlet layout was).
        Hide
        Jan Tošovský added a comment -

        Hi Juan,
        thanks for instructions. I've successfuly built it with your patch, but I don't see any difference. In search result I am getting the same results as described in the original comment - all the links have the same 'layout' part so they are displayed in inappropriate layout when Return to full page is pressed, and also a breadcrumb is incorrect (it displays path that belongs to that inappropriate layout). I don't think this is the correct behaviour. What do you mean by that 'Back to page' comment? Form what you've written I think it would be intended behaviour (got back only to the current layout).

        Show
        Jan Tošovský added a comment - Hi Juan, thanks for instructions. I've successfuly built it with your patch, but I don't see any difference. In search result I am getting the same results as described in the original comment - all the links have the same 'layout' part so they are displayed in inappropriate layout when Return to full page is pressed, and also a breadcrumb is incorrect (it displays path that belongs to that inappropriate layout). I don't think this is the correct behaviour. What do you mean by that 'Back to page' comment? Form what you've written I think it would be intended behaviour (got back only to the current layout).
        Hide
        Juan G added a comment -

        Hi Jan,
        Yep I think the link should have the same layout, because all of them belongs to the source portlet (in this case, search portlet). The important thing here is that component is correctly rendered (the content get rendered 100% ok before).

        If layout changes, then "Back to full page" link won't work, because the layout is the same as where the destination portlet (wiki) is.

        If you want I can upload another patch where layout changes (as you asked for), but IMHO that isn't the correct behaviour.

        Show
        Juan G added a comment - Hi Jan, Yep I think the link should have the same layout, because all of them belongs to the source portlet (in this case, search portlet). The important thing here is that component is correctly rendered (the content get rendered 100% ok before). If layout changes, then "Back to full page" link won't work, because the layout is the same as where the destination portlet (wiki) is. If you want I can upload another patch where layout changes (as you asked for), but IMHO that isn't the correct behaviour.
        Hide
        Jan Tošovský added a comment -

        Hmm, if a modified URL with the correct layout is entered directly into the browser address, I don't see any faulty behaviour in my case. This is the reason why I thought that it is bug, not a feature. I understand 'back to full page' feature to show displayed portlet in the appropriate layout. As the WIKI is scoped to the one LR page, that page/layout can be easily determined I thought.
        In my case the search portlet is in the home page, but the WIKI content is in deeper levels. Btw, what exactly solves the current patch? Does it fix another problems in handling search results?

        Show
        Jan Tošovský added a comment - Hmm, if a modified URL with the correct layout is entered directly into the browser address, I don't see any faulty behaviour in my case. This is the reason why I thought that it is bug, not a feature. I understand 'back to full page' feature to show displayed portlet in the appropriate layout. As the WIKI is scoped to the one LR page, that page/layout can be easily determined I thought. In my case the search portlet is in the home page, but the WIKI content is in deeper levels. Btw, what exactly solves the current patch? Does it fix another problems in handling search results?
        Hide
        Jan Tošovský added a comment -

        Can I help with this somehow? Should I clarify what I mean or is it clear enough?

        Show
        Jan Tošovský added a comment - Can I help with this somehow? Should I clarify what I mean or is it clear enough?
        Hide
        Jan Tošovský added a comment -

        In the trunk code I've found updated methods which probably solves the same issue (and due to this the proposed patch compiles with errors).
        I am not acceping this patch as it doesn't solve my original problem, though I believe it is a nice addition moving this matter ahead.
        I'd suggest attaching also the second approach via /<layout_id>/-(wiki.. URL. I offer testing such a patch.
        Maybe somebody from Liferay staff could also clarify how the Back to page link should behave.

        Show
        Jan Tošovský added a comment - In the trunk code I've found updated methods which probably solves the same issue (and due to this the proposed patch compiles with errors). I am not acceping this patch as it doesn't solve my original problem, though I believe it is a nice addition moving this matter ahead. I'd suggest attaching also the second approach via /<layout_id>/-(wiki.. URL. I offer testing such a patch. Maybe somebody from Liferay staff could also clarify how the Back to page link should behave.
        Hide
        Juan G added a comment -

        Patch for getting wiki search results to open in wiki results layout.

        Show
        Juan G added a comment - Patch for getting wiki search results to open in wiki results layout.
        Hide
        Juan G added a comment -

        Hi Jan,

        Please test the patch I've just uploaded and tell me your thoughts....

        Show
        Juan G added a comment - Hi Jan, Please test the patch I've just uploaded and tell me your thoughts....
        Hide
        Jan Tošovský added a comment -

        Excellent! LPS-15494-build-76244-target_layout.patch works as expected.
        It could be enhanced by removing that /maximized? part of URL to avoid displaying the portlet in the maximized state (and rendering that Return to Full Page link). If the portlet is scoped to the particular page, why not to display directly that page. I think it is a normal user expectation - to click on a link and to see the whole page. No extra step to display the rest of the page.
        As written above, this code will need some modifications to work in the trunk code properly.
        I am almost satisfied
        Juan, thanks a lot for your valuable work!

        Show
        Jan Tošovský added a comment - Excellent! LPS-15494 -build-76244-target_layout.patch works as expected. It could be enhanced by removing that /maximized? part of URL to avoid displaying the portlet in the maximized state (and rendering that Return to Full Page link). If the portlet is scoped to the particular page, why not to display directly that page. I think it is a normal user expectation - to click on a link and to see the whole page. No extra step to display the rest of the page. As written above, this code will need some modifications to work in the trunk code properly. I am almost satisfied Juan, thanks a lot for your valuable work!
        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 added a comment -

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

        Show
        Vicki Tsang 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, 29 weeks, 4 days ago

              Development

                Structure Helper Panel