gpt4 book ai didi

liferay - 如何在控制面板部分添加自定义 portlet

转载 作者:行者123 更新时间:2023-12-04 10:26:49 24 4
gpt4 key购买 nike

如何将自定义 portlet 添加到 Portal控制面板部分,如下图所示:

enter image description here

最佳答案

这是如何做到的:

  • 在您的 portlet 的 liferay-portlet.xml 中(您可以查看此 xml 的 DTD 以获取有关其他标签的更多信息)在您的 <portlet> 中包含两个标签标签如图所示:

    <portlet>
    <portlet-name>MyCustomPortlet</portlet-name>
    <icon>/mycustom.png</icon>
    <!--
    These are the two entries which are required for the portlet
    to appear in the control panel
    -->
    <!--
    Set the control-panel-entry-category value to "my", "content",
    "portal" or "server" to make this portlet available in the
    Control Panel under that category.
    -->
    <control-panel-entry-category>portal</control-panel-entry-category>

    <!--
    Set the control-panel-entry-weight value to a double number
    to control the position of the entry within its Control Panel
    category. Higher values mean that the entry will appear lower
    in the Control Panel menu.
    -->
    <control-panel-entry-weight>100</control-panel-entry-weight>

    <instanceable>false</instanceable>
    <header-portlet-css>/css/main.css</header-portlet-css>
    <footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
    <css-class-wrapper>mycustomportlet-portlet</css-class-wrapper>
    </portlet>
  • 此外,如果您不希望您的 portlet 出现在 Add Menu 中以便它不会放在其他页面上,然后在您的liferay-display.xml你可以包括:

    <display>
    <category name="category.hidden">
    <!--
    Adding your portlet to the hidden category would not display
    the portlet in the ADD Menu on the top-left-hand corner
    -->
    <portlet id="MyCustomPortlet"></portlet>
    </category>
    </display>
  • 构建和部署您的 portlet,一切顺利。
  • 关于liferay - 如何在控制面板部分添加自定义 portlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14066674/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com