weaver 2004/06/11 13:02:54
Modified: portal/src/webapp/WEB-INF/pages testsuite.psml
portal/src/java/org/apache/jetspeed/util/descriptor
PortletApplicationDescriptor.java
portal/src/java/org/apache/jetspeed/deployment/impl
DeployPortletAppEventListener.java
Added: portal/src/webapp/WEB-INF/pages RssPortlet.psml
Log:
Fixes to get any portlet to deploy to jetspeed 2. Also added a psml for the
RssPortlet from the POST
site at sourceforge.
Revision Changes Path
1.6 +9 -4
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/pages/testsuite.psml
Index: testsuite.psml
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/pages/testsuite.psml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- testsuite.psml 18 Mar 2004 19:38:15 -0000 1.5
+++ testsuite.psml 11 Jun 2004 20:02:52 -0000 1.6
@@ -13,17 +13,22 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<page id="p001">
+<page id="testsuite_page">
<defaults
skin="orange"
- layout-decorator="clear"
- portlet-decorator="portletstd"
+ layout-decorator="jetspeed"
+ portlet-decorator="jetspeed"
/>
+
<title>Test Suite Page</title>
<fragment id="2" type="layout" name="jetspeed::VelocityTwoColumns">
- <fragment id="18" type="portlet" name="TestPortlet1">
+ <fragment id="testsuite_page:1" type="portlet" name="testsuite:TestPortlet">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
+ <fragment id="testsuite_page:2" type="portlet" name="testsuite:TestPortlet2">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
</fragment>
</page>
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/pages/RssPortlet.psml
Index: RssPortlet.psml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<page id="RssPortlet">
<defaults
skin="orange"
layout-decorator="jetspeed"
portlet-decorator="jetspeed"
/>
<title>Plumtree RSS Portlet</title>
<fragment id="2" type="layout" name="jetspeed::VelocityTwoColumns">
<fragment id="rrsPortlet1" type="portlet" name="RssPortlet::RssPortlet">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
</fragment>
</page>
1.2 +17 -1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java
Index: PortletApplicationDescriptor.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PortletApplicationDescriptor.java 9 Jun 2004 14:56:41 -0000 1.1
+++ PortletApplicationDescriptor.java 11 Jun 2004 20:02:52 -0000 1.2
@@ -23,6 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
import org.apache.jetspeed.om.impl.LanguageImpl;
import org.apache.jetspeed.om.impl.ParameterDescriptionImpl;
import org.apache.jetspeed.om.impl.PortletDescriptionImpl;
@@ -149,6 +150,21 @@
PortletApplicationDefinitionImpl pd =
(PortletApplicationDefinitionImpl) digester.parse(portletXmlReader);
pd.setName(appName);
+ if(pd.getApplicationIdentifier() == null)
+ {
+ pd.setApplicationIdentifier(appName);
+ }
+
+ Iterator portletDefs = pd.getPortletDefinitions().iterator();
+ while(portletDefs.hasNext())
+ {
+ PortletDefinitionComposite portletDef =
(PortletDefinitionComposite) portletDefs.next();
+ if(portletDef.getPortletIdentifier() == null)
+ {
+ portletDef.setPortletIdentifier(portletDef.getName());
+ }
+ }
+
return pd;
}
1.12 +6 -2
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java
Index: DeployPortletAppEventListener.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DeployPortletAppEventListener.java 11 Jun 2004 18:01:35 -0000 1.11
+++ DeployPortletAppEventListener.java 11 Jun 2004 20:02:52 -0000 1.12
@@ -79,7 +79,11 @@
String id = portletApp.getAttributeValue("id");
if (id == null)
{
- throw new PortletApplicationException("<portlet-app>
requires a unique \"id\" attribute.");
+
+ String warFileName = handler.getFile().getName();
+ int extensionIdx = warFileName.lastIndexOf(".war");
+ id = warFileName.substring(0, extensionIdx);
+ log.info("Application id not defined in portlet.xml so
using war name "+id);
}
PortletRegistryComponent regsitry =
(PortletRegistryComponent)
Jetspeed.getComponentManager().getComponent(PortletRegistryComponent.class);
if (regsitry.getPortletApplicationByIdentifier(id) != null)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]