Liferay 6.1 - 私有插件安装程序"disapear"或在控制面板中被禁用

Mar*_*rra 7 java portlet liferay

我正在开发Liferay 6.1 EE GA3的应用程序.

在控制面板下,我们有一个私有插件安装程序部分,我们可以在其中安装/部署新的portlet.我正在使用面板,该部分工作正常.

然后我尝试安装自定义portlet.由于某种原因安装失败,我从"部署"文件夹中删除了portlet,我甚至重新启动了服务器.这个portlet没有做任何特别的事情,只是针对Liferay的Lucene搜索引擎运行一些自定义查询.

然后,在此过程之后,"服务器>插件安装>私有插件安装程序"部分从我的屏幕"消失".

下面是我在访问"服务器>服务器管理"和"服务器>插件安装"部分时看到的屏幕(您可以看到它显示为空,没有私有插件安装程序的链接):

屏幕截图1:服务器>服务器管理(显示空屏幕)

在此输入图像描述

屏幕截图2:服务器>插件安装(显示空屏幕)

在此输入图像描述

在这个屏幕上,您可以看到我的用户拥有安装插件所需的所有管理权限:

屏幕截图3:我的用户个人资料和权限 在此输入图像描述

在下面的屏幕中,您可以看到私有插件安装程序Hook安装在webapps文件夹中(实际上它已经一直安装),以及其他一些钩子,主题和portlet:

屏幕截图4:Tomcat的webaaps文件夹 在此输入图像描述

以下是/html/portlet/admin/view.jsp和/html/portlet/admin/view.portal.jsp的内容(从代码中删除了初始注释).这些文件未手动编辑.

/html/portlet/admin/view.jsp的内容

<%@ include file="/html/portlet/admin/view.portal.jsp" %>
Run Code Online (Sandbox Code Playgroud)

/html/portlet/admin/view.portal.jsp的内容

<%@ include file="/html/portlet/admin/init.jsp" %>

<c:choose>
    <c:when test="<%= permissionChecker.isOmniadmin() %>">

        <%
        String tabs1 = ParamUtil.getString(request, "tabs1", "server");

        boolean showTabs1 = false;

        if (portletName.equals(PortletKeys.ADMIN_INSTANCE)) {
            tabs1 = "instances";
        }
        else if (portletName.equals(PortletKeys.ADMIN_PLUGINS)) {
            tabs1 = "plugins";
        }
        else if (portletName.equals(PortletKeys.ADMIN_SERVER)) {
            tabs1 = "server";
        }
        else if (portletName.equals(PortletKeys.ADMIN)) {
            showTabs1 = true;
        }

        String tabs2 = ParamUtil.getString(request, "tabs2");
        String tabs3 = ParamUtil.getString(request, "tabs3");

        if (tabs1.equals("plugins")) {
            if (!tabs2.equals("portlet-plugins") && !tabs2.equals("theme-plugins") && !tabs2.equals("layout-template-plugins") && !tabs2.equals("hook-plugins") && !tabs2.equals("web-plugins")) {
                tabs2 = "portlet-plugins";
            }
        }

        int cur = ParamUtil.getInteger(request, SearchContainer.DEFAULT_CUR_PARAM);
        int delta = ParamUtil.getInteger(request, SearchContainer.DEFAULT_DELTA_PARAM);

        PortletURL portletURL = renderResponse.createRenderURL();

        portletURL.setParameter("struts_action", "/admin/view");
        portletURL.setParameter("tabs1", tabs1);
        portletURL.setParameter("tabs2", tabs2);
        portletURL.setParameter("tabs3", tabs3);
        %>

        <portlet:renderURL var="redirectURL">
            <portlet:param name="struts_action" value="/admin/view" />
            <portlet:param name="tabs1" value="<%= tabs1 %>" />
            <portlet:param name="tabs2" value="<%= tabs2 %>" />
            <portlet:param name="tabs3" value="<%= tabs3 %>" />
            <portlet:param name="cur" value="<%= String.valueOf(cur) %>" />
        </portlet:renderURL>

        <aui:form action="<%= portletURL.toString() %>" method="post" name="fm">
            <aui:input name="<%= Constants.CMD %>" type="hidden" />
            <aui:input name="tabs1" type="hidden" value="<%= tabs1 %>" />
            <aui:input name="tabs2" type="hidden" value="<%= tabs2 %>" />
            <aui:input name="tabs3" type="hidden" value="<%= tabs3 %>" />
            <aui:input name="redirect" type="hidden" value="<%= redirectURL %>" />
            <aui:input name="portletId" type="hidden" />

            <c:if test="<%= showTabs1 %>">
                <liferay-ui:tabs
                    names="server,instances,plugins"
                    url="<%= portletURL.toString() %>"
                />
            </c:if>

            <c:choose>
                <c:when test='<%= tabs1.equals("server") %>'>
                    <%@ include file="/html/portlet/admin/server.jspf" %>

                    <aui:script use="liferay-admin">
                        new Liferay.Portlet.Admin(
                            {
                                form: document.<portlet:namespace />fm,
                                namespace: '<portlet:namespace />',
                                url: '<portlet:actionURL><portlet:param name="struts_action" value="/admin/edit_server" /></portlet:actionURL>'
                            }
                        );
                    </aui:script>
                </c:when>
                <c:when test='<%= tabs1.equals("instances") %>'>
                    <%@ include file="/html/portlet/admin/instances.jspf" %>
                </c:when>
                <c:when test='<%= tabs1.equals("plugins") %>'>

                    <%
                    PortletURL marketplaceURL = null;

                    if ((PrefsPropsUtil.getBoolean(PropsKeys.AUTO_DEPLOY_ENABLED, PropsValues.AUTO_DEPLOY_ENABLED) || PortalUtil.isOmniadmin(user.getUserId())) && PortletLocalServiceUtil.hasPortlet(themeDisplay.getCompanyId(), PortletKeys.MARKETPLACE_STORE)) {
                        marketplaceURL = ((RenderResponseImpl)renderResponse).createRenderURL(PortletKeys.MARKETPLACE_STORE);
                    }

                    boolean showEditPluginHREF = false;
                    boolean showReindexButton = true;
                    %>

                    <%@ include file="/html/portlet/plugins_admin/plugins.jspf" %>
                </c:when>
            </c:choose>
        </aui:form>

        <aui:script>
            function <portlet:namespace />saveServer(cmd) {
                document.<portlet:namespace />fm.<portlet:namespace /><%= Constants.CMD %>.value = cmd;
                document.<portlet:namespace />fm.<portlet:namespace />redirect.value = "<portlet:renderURL><portlet:param name="struts_action" value="/admin/view" /><portlet:param name="tabs1" value="<%= tabs1 %>" /><portlet:param name="tabs2" value="<%= tabs2 %>" /><portlet:param name="tabs3" value="<%= tabs3 %>" /><portlet:param name="<%= SearchContainer.DEFAULT_CUR_PARAM %>" value="<%= String.valueOf(cur) %>" /><portlet:param name="<%= SearchContainer.DEFAULT_DELTA_PARAM %>" value="<%= String.valueOf(delta) %>" /></portlet:renderURL>";
                submitForm(document.<portlet:namespace />fm, "<portlet:actionURL><portlet:param name="struts_action" value="/admin/edit_server" /></portlet:actionURL>");
            }
        </aui:script>
    </c:when>
    <c:otherwise>
        <liferay-util:include page="/html/portal/portlet_access_denied.jsp" />
    </c:otherwise>
</c:choose>
Run Code Online (Sandbox Code Playgroud)

感谢您的关注

Mar*_*rra 0

我已经放弃了解决这个问题,但我设法做到了。

我正在开发一个使用 Lucene 操作和搜索内容(来自 Liferay 文档库)的 portlet,因此,我停止并重新启动了 Liferay 实例,并在 Portal-ext.properties 中取消注释了以下行

索引.on.startup=true

令我惊讶的是,在所有门户内容都已重新索引并且启动过程完成后,链接“服务器 > 服务器管理”、“服务器 > 插件安装”和专用插件安装程序再次工作。我不会撒谎:我不知道为什么“index.on.startup=true”解决了这个问题。如果有人对此有一些想法或理论,我会很高兴听到。感谢您的帮助。