Details

    • Fix Priority:
      4
    • Liferay Contributor's Agreement:
      Accept
    • Similar Issues:
      Show 5 results 

      Description

      List View in Document Library (in SO 2.0 site) does not use the file_entry_action.jsp file from so-hook as expected. Stock JSP is always used.

      Cause of this is that when using following construct in JSP (the key is the method ResultRow.addJSP(), taken from /html/portlet/document_library/view_entries.jsp):

        List resultRows = searchContainer.getResultRows();
        ResultRow row = new ResultRow(curFolder, curFolder.getPrimaryKey(), i);
        ...
      
        row.addJSP("/html/portlet/document_library/file_entry_action.jsp");
      
        ...
        resultRows.add(row);
      

      the JSP file being actually used is always the stock JSP (or standard-hook-overridden one, whatever file is physically in the ROOT webapp under given path). But it will never be the one coming from Application Adapter applied to given group. In the case of SO 2.0, so-hook is used as an adapter for all SO sites. Hook so-hook contains override of /html/portlet/document_library/file_entry_action.jsp, but it's used only in Icon and Descriptiove view, as those are using another way to render the search container (<liferay-util:include />).

      All ResultRow.addJSP() methods should somehow support Application Adapters, the same way as <liferay-util:include /> does (I've looked into portal-service -> com.liferay.taglib.util.IncludeTag.getCustomPage()).

      1. InputPermissionsTag.java
        5 kB
        Francesco Fornasari
      2. SearchContainerColumnJSPTag.java
        4 kB
        Francesco Fornasari

        Activity

        Hide
        Josef Šustáček added a comment -

        <liferay-ui:search-container-column-jsp> using class com.liferay.taglib.ui.SearchContainerColumnJSPTag will most likely suffer from the same, as it is not looking for custom JSP from adapter either.

        Show
        Josef Šustáček added a comment - <liferay-ui:search-container-column-jsp> using class com.liferay.taglib.ui.SearchContainerColumnJSPTag will most likely suffer from the same, as it is not looking for custom JSP from adapter either.
        Hide
        Francesco Fornasari added a comment -

        Dear All,
        we have fix this problem in this way. We'd modified two java classes:

        com.liferay.taglib.ui.SearchContainerColumnJSPTag

        com.liferay.taglib.ui.InputPermissionsTag

        by adding this piece of code (I.E: line 63 of SearchContainerColumnJSPTag class):

        //jspSearchEntry.setPath(getPath());
        jspSearchEntry.setPath(getCustomPage(pageContext.getServletContext(), (HttpServletRequest)pageContext.getRequest(), getPath()));

        and the java method getCustomPage():

        protected String getCustomPage(ServletContext servletContext, HttpServletRequest request, String path) {
        ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
        WebKeys.THEME_DISPLAY);

        if (themeDisplay == null)

        { return null; }

        Group group = themeDisplay.getScopeGroup();

        UnicodeProperties typeSettingsProperties =
        group.getTypeSettingsProperties();

        String customJspServletContextName = typeSettingsProperties.getProperty(
        "customJspServletContextName");

        if (Validator.isNull(customJspServletContextName))

        { return path; }

        String customPage = CustomJspRegistryUtil.getCustomJspFileName(
        customJspServletContextName, path);

        if (FileAvailabilityUtil.isAvailable(servletContext, customPage))

        { return customPage; }

        return path;
        }

        Could you tell us if this solution is correct?
        In attach you can download our modified classes.

        Best Regard,
        Francesco and Elisa.

        Show
        Francesco Fornasari added a comment - Dear All, we have fix this problem in this way. We'd modified two java classes: com.liferay.taglib.ui.SearchContainerColumnJSPTag com.liferay.taglib.ui.InputPermissionsTag by adding this piece of code (I.E: line 63 of SearchContainerColumnJSPTag class): //jspSearchEntry.setPath(getPath()); jspSearchEntry.setPath(getCustomPage(pageContext.getServletContext(), (HttpServletRequest)pageContext.getRequest(), getPath())); and the java method getCustomPage(): protected String getCustomPage(ServletContext servletContext, HttpServletRequest request, String path) { ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute( WebKeys.THEME_DISPLAY); if (themeDisplay == null) { return null; } Group group = themeDisplay.getScopeGroup(); UnicodeProperties typeSettingsProperties = group.getTypeSettingsProperties(); String customJspServletContextName = typeSettingsProperties.getProperty( "customJspServletContextName"); if (Validator.isNull(customJspServletContextName)) { return path; } String customPage = CustomJspRegistryUtil.getCustomJspFileName( customJspServletContextName, path); if (FileAvailabilityUtil.isAvailable(servletContext, customPage)) { return customPage; } return path; } Could you tell us if this solution is correct? In attach you can download our modified classes. Best Regard, Francesco and Elisa.
        Hide
        Francesco Fornasari added a comment -

        //jspSearchEntry.setPath(getPath());
        //12/12 - LPS30219 jspSearchEntry.setPath(getCustomPage(pageContext.getServletContext(), (HttpServletRequest)pageContext.getRequest(), getPath()));

        //12/12 - LPS30219
        protected String getCustomPage(ServletContext servletContext, HttpServletRequest request, String path) {

        ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
        WebKeys.THEME_DISPLAY);

        if (themeDisplay == null)

        { return null; }

        Group group = themeDisplay.getScopeGroup();

        UnicodeProperties typeSettingsProperties =
        group.getTypeSettingsProperties();

        String customJspServletContextName = typeSettingsProperties.getProperty(
        "customJspServletContextName");

        if (Validator.isNull(customJspServletContextName))

        { return path; }

        String customPage = CustomJspRegistryUtil.getCustomJspFileName(
        customJspServletContextName, path);

        if (FileAvailabilityUtil.isAvailable(servletContext, customPage))

        { return customPage; }

        return path;
        }

        Show
        Francesco Fornasari added a comment - //jspSearchEntry.setPath(getPath()); //12/12 - LPS30219 jspSearchEntry.setPath(getCustomPage(pageContext.getServletContext(), (HttpServletRequest)pageContext.getRequest(), getPath())); //12/12 - LPS30219 protected String getCustomPage(ServletContext servletContext, HttpServletRequest request, String path) { ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute( WebKeys.THEME_DISPLAY); if (themeDisplay == null) { return null; } Group group = themeDisplay.getScopeGroup(); UnicodeProperties typeSettingsProperties = group.getTypeSettingsProperties(); String customJspServletContextName = typeSettingsProperties.getProperty( "customJspServletContextName"); if (Validator.isNull(customJspServletContextName)) { return path; } String customPage = CustomJspRegistryUtil.getCustomJspFileName( customJspServletContextName, path); if (FileAvailabilityUtil.isAvailable(servletContext, customPage)) { return customPage; } return path; }
        Hide
        Edward Gonzales added a comment -

        Hi Francesco and Josef! Thanks for identifying this bug. Can you help us with providing with the following missing requirements 1) test against Master 2) github commit link? Thanks for your effort in improving Liferay Portal!

        Show
        Edward Gonzales added a comment - Hi Francesco and Josef! Thanks for identifying this bug. Can you help us with providing with the following missing requirements 1) test against Master 2) github commit link? Thanks for your effort in improving Liferay Portal!
        Hide
        Francesco Fornasari added a comment -

        Dear Edward,
        we had written our contribution under github. We hope it is useful for you.

        Best Regards,
        Francesco.

        Show
        Francesco Fornasari added a comment - Dear Edward, we had written our contribution under github. We hope it is useful for you. Best Regards, Francesco.
        Hide
        Edward Gonzales added a comment -

        Hi Francesco, thanks for your response! We are in the process of verifying your contribution. Thanks for the follow up message. We will keep you updated with any news. Thanks again for your contribution!

        Show
        Edward Gonzales added a comment - Hi Francesco, thanks for your response! We are in the process of verifying your contribution. Thanks for the follow up message. We will keep you updated with any news. Thanks again for your contribution!
        Hide
        Edward Gonzales added a comment -

        Hello everyone! We are in the process of removing component "Portlet" from LPS. Please make the necessary adjustments to affected filters. Thanks!

        Show
        Edward Gonzales added a comment - Hello everyone! We are in the process of removing component "Portlet" from LPS. Please make the necessary adjustments to affected filters. Thanks!

          People

          • Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Days since last comment:
              2 years, 20 weeks ago

              Development

                Subcomponents

                  Structure Helper Panel