Как добавить пользовательский портлет в раздел Панели управления

Как добавить пользовательский портлет в раздел Portal панели управления, как показано на следующем рисунке:

введите здесь описание изображения


person Prakash K    schedule 28.12.2012    source источник


Ответы (2)


Вот как это сделать:

  1. В вашем портлете liferay-portlet.xml (вы можете проверить DTD этого xml для получения дополнительной информации о других тегах) включите два тега в свой тег <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>
    
  2. Также, если вы не хотите, чтобы ваш портлет отображался в 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>
    
  3. Создайте и разверните свой портлет, и все готово.

person Prakash K    schedule 28.12.2012

Помимо ответа Пракаша К., ajaxable и instanciable должны быть ложными.

person Dharmen Panchal    schedule 18.06.2015