Forums de discussion

Multiple Portlets in one Project - suddenly incorrect names

Christian Freihoff, modifié il y a 10 années.

Multiple Portlets in one Project - suddenly incorrect names

Junior Member Publications: 36 Date d'inscription: 03/12/12 Publications récentes
I took a maven archetype for vaadin portlets in liferay. In there I implemented two portlets, changed all the relevant configuration files, and everything worked.
Now I added a third portlet, changed the config again, and with the deploy the two older portlets appeared as undeployed (not updated like on the redeploys before). The funny thing ist, that the 1st portlet still has its name/id in the selection menu and in the portlet head. But the other both portlets wear the name/id of the 3rd one. Although the name is set correctly in my opinion.
Obviously there must be something wrong in the config files, but i can't find, what...

Here are the (liferay-)relevant configs:

liferay-display.xml
<!--?xml version="1.0"?-->


<display>
    <category name="J1 FAS Portlets">
        <!-- portlets corresponding to mockups -->
        <portlet id="Augmentee Overview" />
        <portlet id="Augmentee Details" />
        <portlet id="TestPortlet" />
    </category>
</display>

liferay-plugin-package.properties
name=J1FAS Portlets
short-description=j1fasPortlets
module-group-id=J1 FAS Portlets
#change-log=
#page-uri=
#author=
license=Proprietary
portal-dependency-jars=\
    vaadin.jar 

liferay-portlet.xml
<!--?xml version="1.0"?-->


<liferay-portlet-app>
    <portlet>
        <portlet-name>AugmenteeOverview</portlet-name>
        <instanceable>true</instanceable>       
        <ajaxable>false</ajaxable>
    </portlet>
    <portlet>
        <portlet-name>AugmenteeDetails</portlet-name>
        <instanceable>true</instanceable>       
        <ajaxable>false</ajaxable>
    </portlet>
    <portlet>
        <portlet-name>TestPortlet</portlet-name>
        <instanceable>true</instanceable>       
        <ajaxable>false</ajaxable>
    </portlet>
</liferay-portlet-app>

portlet.xml
<!--?xml version="1.0" encoding="UTF-8"?-->

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
                        http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">

    <!-- portlets corresponding to mockups -->
    <portlet>
        <description>Portlet for the Augmentee Overview</description>
        <portlet-name>AugmenteeOverview</portlet-name>
        <display-name>Augmentee Overview</display-name>

        <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>

        <init-param>
            <name>application</name>
            <value>mypackage.AugmenteeOverviewPortlet</value>
        </init-param>
        
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
            <portlet-mode>edit</portlet-mode>
            <portlet-mode>help</portlet-mode>
        </supports>
        

        <portlet-info>
            <title>AugmenteeOverview</title>
            <short-title>AugmenteeOverview</short-title>
            <keywords>put keywords here</keywords>
        </portlet-info>
    </portlet>
    <portlet>
        <description>Portlet for the Augmentee Details</description>
        <portlet-name>AugmenteeDetails</portlet-name>
        <display-name>Augmentee Details</display-name>

        <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>

        <init-param>
            <name>application</name>
            <value>mypackage.AugmenteeDetailsPortlet</value>
        </init-param>
        
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
            <portlet-mode>edit</portlet-mode>
            <portlet-mode>help</portlet-mode>
        </supports>
        

        <portlet-info>
            <title>TestPortlet</title>
            <short-title>TestPortlet</short-title>
            <keywords>put keywords here</keywords>
        </portlet-info>
    </portlet>
   
    <portlet>
        <description>Portlet for Testing</description>
        <portlet-name>TestPortlet</portlet-name>
        <display-name>TestPortlet</display-name>

        <portlet-class>com.vaadin.terminal.gwt.server.ApplicationPortlet2</portlet-class>

        <init-param>
            <name>application</name>
            <value>mypackage.TestPortlet</value>
        </init-param>
        
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
            <portlet-mode>edit</portlet-mode>
            <portlet-mode>help</portlet-mode>
        </supports>
        

        <portlet-info>
            <title>TestPortlet</title>
            <short-title>TestPortlet</short-title>
            <keywords>put keywords here</keywords>
        </portlet-info>
    </portlet>
   
</portlet-app>

web.xml
<!--?xml version="1.0" encoding="UTF-8"?-->

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>J1FAS Portlets</display-name>
    
</web-app>

As mentioned before, that project worked without problems with two portlets. At the end it should contain a couple of different portlet applications.

Another questin could be: what to to with the liferay-plugin-package.properties. As I know, only one name can be inserted there. So how to config that for multiple portlets, or should it run anyway?

Thanks in advance
thumbnail
David H Nebinger, modifié il y a 10 années.

RE: Multiple Portlets in one Project - suddenly incorrect names

Liferay Legend Publications: 14914 Date d'inscription: 02/09/06 Publications récentes
You should use portlet ids in the liferay-display.xml file, not portlet display names.

Change to:

<!--?xml version="1.0"?-->


<display>
    <category name="J1 FAS Portlets">
        <!-- portlets corresponding to mockups -->
        <portlet id="AugmenteeOverview" />
        <portlet id="AugmenteeDetails" />
        <portlet id="TestPortlet" />
    </category>
</display>
Christian Freihoff, modifié il y a 10 années.

RE: Multiple Portlets in one Project - suddenly incorrect names

Junior Member Publications: 36 Date d'inscription: 03/12/12 Publications récentes
solved my problem. Thanks!