Author: theute
Date: 2011-09-06 07:41:54 -0400 (Tue, 06 Sep 2011)
New Revision: 7314
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
Log:
JBEPP-1116: Add possibility to specify WSRP portlets in pages.xml
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java 2011-09-06
11:36:51 UTC (rev 7313)
+++
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java 2011-09-06
11:41:54 UTC (rev 7314)
@@ -102,6 +102,7 @@
//
Application<?> app;
+ TransientApplicationState state;
if ("application".equals(m_name))
{
String instanceId = ctx.parseElementText(m_uri, "instance-id");
@@ -112,7 +113,6 @@
String ownerId = instanceId.substring(i0 + 1, i1);
String persistenceid = instanceId.substring(i1 + 2);
String[] persistenceChunks = split("/", persistenceid);
- TransientApplicationState<Portlet> state;
if (persistenceChunks.length == 2)
{
state = new TransientApplicationState<Portlet>(
@@ -131,9 +131,8 @@
ownerId,
persistenceChunks[2]);
}
- Application<Portlet> application =
Application.createPortletApplication();
- application.setState(state);
- app = application;
+ app = Application.createPortletApplication();
+ app.setState(state);
}
// Since we don't support dashboard's here, this only works for gadgets
using the gadget wrapper portlet.
else if ("gadget-application".equals(m_name))
@@ -144,18 +143,31 @@
// Once the gadget portlet wrapper is able to use gadget userPref's, include
parsing logic here.
// Gadget gadget = new Gadget();
// gadget.setUserPref();
- TransientApplicationState<Gadget> state = new
TransientApplicationState<Gadget>(gadgetName, gadget);
- Application<Gadget> application = Application.createGadgetApplication();
- application.setState(state);
- app = application;
+ state = new TransientApplicationState<Gadget>(gadgetName, gadget);
+ app = Application.createGadgetApplication();
+ app.setState(state);
ctx.parsePastEndTag(m_uri, "gadget");
}
else
{
- ctx.parsePastStartTag(m_uri, "portlet");
- String applicationName = ctx.parseElementText(m_uri,
"application-ref");
- String portletName = ctx.parseElementText(m_uri, "portlet-ref");
- TransientApplicationState<Portlet> state;
+ String contentId;
+ boolean isWSRP = false;
+ if(ctx.isAt(m_uri, "wsrp"))
+ {
+ contentId = ctx.parseElementText(m_uri, "wsrp");
+ app = Application.createWSRPApplication();
+ isWSRP = true;
+ }
+ else
+ {
+
+ ctx.parsePastStartTag(m_uri, "portlet");
+ String applicationName = ctx.parseElementText(m_uri,
"application-ref");
+ String portletName = ctx.parseElementText(m_uri, "portlet-ref");
+ contentId = applicationName + "/" + portletName;
+ app = Application.createPortletApplication();
+ }
+
if (ctx.isAt(m_uri, "preferences"))
{
PortletBuilder builder = new PortletBuilder();
@@ -166,16 +178,19 @@
builder.add(value.getName(), value.getValues(), value.isReadOnly());
}
ctx.parsePastEndTag(m_uri, "preferences");
- state = new TransientApplicationState<Portlet>(applicationName +
"/" + portletName, builder.build());
+ state = new TransientApplicationState(contentId, builder.build());
}
else
{
- state = new TransientApplicationState<Portlet>(applicationName +
"/" + portletName, null);
+ state = new TransientApplicationState(contentId, null);
}
- Application<Portlet> application =
Application.createPortletApplication();
- application.setState(state);
- app = application;
- ctx.parsePastEndTag(m_uri, "portlet");
+
+ if(!isWSRP)
+ {
+ ctx.parsePastEndTag(m_uri, "portlet");
+ }
+
+ app.setState(state);
}
//
Modified:
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2011-09-06
11:36:51 UTC (rev 7313)
+++
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2011-09-06
11:41:54 UTC (rev 7314)
@@ -24,8 +24,8 @@
<page-set
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_1
http://www.gatein.org/xml/ns/gatein_objects_1_1"
-
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_1">
+
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2
http://www.gatein.org/xml/ns/gatein_objects_1_2"
+
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
<page>
<name>wsrpConfiguration</name>
@@ -41,6 +41,12 @@
<access-permissions>manager:/platform/administrators</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
+ <!--<portlet-application>
+ <wsrp>selfv2./richFacesPortlet.richFacesPortlet</wsrp>
+ <title>RichFaces</title>
+
<access-permissions>manager:/platform/administrators</access-permissions>
+ <show-info-bar>true</show-info-bar>
+ </portlet-application>-->
</page>
</page-set>