I am absolutely new in LifeRay portlet development and now I am working on a project that use Struts 2 based portlet and I have many doubts about how a portlet is configured.
So for example I have an "Hello World" portlet that have the following configuration inside the portlet.xml file:
<portlet-name>provaAndrea</portlet-name>
<display-name>Prova Andrea</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<init-param>
<name>viewNamespace</name>
<value>/nuovaPortlet</value>
</init-param>
<init-param>
<name>defaultViewAction</name>
<value>startTestPortlet1</value>
</init-param>
<init-param>
<name>editNamespace</name>
<value>/nuovaPortlet</value>
</init-param>
<init-param>
<name>defaultEditAction</name>
<value>provaAndreaPropertiesShowAction</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>Prova Andrea</title>
</portlet-info>
</portlet>
So can you help me to understand what exactly this file is setting?
My doubts are:
1) What exactly is the difference between the title setted into the section and the portlet-name setted at the beginning of the portlet configuration?
2) Then there are some sections. It seems to me that these sets the behavior of my portlet (if it is in view mode or in configuration mode).
So I have two couple, the first one is related to the view mode:
<init-param>
<name>viewNamespace</name>
<value>/nuovaPortlet</value>
</init-param>
<init-param>
<name>defaultViewAction</name>
<value>startTestPortlet1</value>
</init-param>
and the second one is related to the edit mode:
<init-param>
<name>editNamespace</name>
<value>/nuovaPortlet</value>
</init-param>
<init-param>
<name>defaultEditAction</name>
<value>provaAndreaPropertiesShowAction</value>
</init-param>
But what exactly mean?
For example what exactly represent the viewNamespace and the defaultViewAction ? I think that this is something related to the content of my struts.xml file because inside it I have something like
<action name="startTestPortlet1" class="testPortlet1Action" method="startTest">
<result name="success">/testPortlet1/testPortlet1.jsp</result>
</action>
Or is it related to the metodo call inside my controller class?
public String startTest() {
this.setMessage("Hello World inner !!!");
return SUCCESS;
}
How exactly work?