taylor 02/05/13 23:33:00
Modified: src/java/org/apache/jetspeed/daemon/impl/util/diskcachedaemon
PortletRefresher.java
src/java/org/apache/jetspeed/daemon/impl/util/feeddaemon
Instantiator.java
src/java/org/apache/jetspeed/modules/actions/portlets/browser
DatabaseBrowserAction.java
src/java/org/apache/jetspeed/portal BasePortletConfig.java
PortletConfig.java
src/java/org/apache/jetspeed/portal/portlets
ApplicationsPortlet.java PortletInfoPortlet.java
VelocityPortlet.java
src/java/org/apache/jetspeed/services PortletFactory.java
src/java/org/apache/jetspeed/services/portletfactory
JetspeedPortletFactoryService.java
PortletFactoryService.java
src/java/org/apache/jetspeed/util/template JetspeedTool.java
webapp/WEB-INF/conf demo-portlets.xreg
webapp/WEB-INF/psml/anon/html/en default.psml
Added: src/java/org/apache/jetspeed/portal/portlets
AbstractInstancePortlet.java BogusPortlet.java
Log:
Initial implementation of 'Portlet instance' in the PortletConfig.
By extending PortletConfig with instance state: the portlet-instance id, and the
page id. The page id is incomplete. I couldn't find a clean way to implement it, will
revisit tomorrow.
There is a new AbstractInstancePortlet, extending AbstractPortlet.
AbstractInstancePortlet is now the base class for VelocityPortlet.
AbstractInstancePortlet uses the portletconfig's new instance data to create the
handle, based on
page-id + portlet-id
(actually its just portlet-id until we figure out how to cleanly get the page-id to
the portletconfig)
(another solution is to use the IdGenerator service)
NOTE: BogusPortlet.java is there for testing this new feature. I will delete it soon.
Submitted by: David Sean Taylor
Reviewed by: Busby (le chien)
Revision Changes Path
1.15 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/daemon/impl/util/diskcachedaemon/PortletRefresher.java
Index: PortletRefresher.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/daemon/impl/util/diskcachedaemon/PortletRefresher.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- PortletRefresher.java 29 Jul 2001 13:41:51 -0000 1.14
+++ PortletRefresher.java 14 May 2002 06:32:58 -0000 1.15
@@ -71,7 +71,7 @@
</p>
@author <A HREF="mailto:[EMAIL PROTECTED]">Kevin A. Burton</A>
-@version $Id: PortletRefresher.java,v 1.14 2001/07/29 13:41:51 raphael Exp $
+@version $Id: PortletRefresher.java,v 1.15 2002/05/14 06:32:58 taylor Exp $
*/
public class PortletRefresher implements Runnable {
@@ -92,7 +92,7 @@
try {
if ( JetspeedResources.getBoolean(
JetspeedResources.AUTOCREATE_PORTLETS_KEY ) ) {
- PortletFactory.getPortlet( this.entry.getName() );
+ PortletFactory.getPortlet( this.entry.getName(), "0" );
}
1.22 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/daemon/impl/util/feeddaemon/Instantiator.java
Index: Instantiator.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/daemon/impl/util/feeddaemon/Instantiator.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Instantiator.java 17 Dec 2001 15:32:25 -0000 1.21
+++ Instantiator.java 14 May 2002 06:32:58 -0000 1.22
@@ -84,7 +84,7 @@
</p>
@author <A HREF="mailto:[EMAIL PROTECTED]">Kevin A. Burton</A>
-@version $Id: Instantiator.java,v 1.21 2001/12/17 15:32:25 sgala Exp $
+@version $Id: Instantiator.java,v 1.22 2002/05/14 06:32:58 taylor Exp $
*/
public class Instantiator implements Runnable {
@@ -208,7 +208,7 @@
if ( JetspeedResources.getBoolean(
JetspeedResources.AUTOCREATE_PORTLETS_KEY ) )
{
- PortletFactory.getPortlet( this.entry.getName() );
+ PortletFactory.getPortlet( this.entry.getName(), "0" );
}
1.19 +6 -5
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser/DatabaseBrowserAction.java
Index: DatabaseBrowserAction.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser/DatabaseBrowserAction.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- DatabaseBrowserAction.java 10 May 2002 00:41:28 -0000 1.18
+++ DatabaseBrowserAction.java 14 May 2002 06:32:58 -0000 1.19
@@ -75,10 +75,11 @@
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.StringUtils;
import org.apache.turbine.util.DynamicURI;
-import org.apache.turbine.util.db.pool.DBConnection;
-import org.apache.turbine.services.db.TurbineDB;
import org.apache.turbine.services.localization.LocalizationTool;
+import org.apache.torque.Torque;
+import org.apache.torque.pool.DBConnection;
+
// turbine om
import org.apache.turbine.om.security.User;
import org.apache.turbine.om.security.Group;
@@ -112,7 +113,7 @@
* according to the quey speciified by the user.
*
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
- * @version $Id: DatabaseBrowserAction.java,v 1.18 2002/05/10 00:41:28 taylor Exp $
+ * @version $Id: DatabaseBrowserAction.java,v 1.19 2002/05/14 06:32:58 taylor Exp $
*/
public class DatabaseBrowserAction extends VelocityPortletAction implements
BrowserQuery
{
@@ -327,7 +328,7 @@
ResultSet rs = null;
try
{
- dbConn = TurbineDB.getConnection();
+ dbConn = Torque.getConnection();
Connection con = dbConn.getConnection();
selectStmt = con.prepareStatement(sql);
Iterator it = sqlParameters.iterator();
@@ -407,7 +408,7 @@
if (null != rs)
rs.close();
if (null != dbConn) //closes con also
- TurbineDB.releaseConnection(dbConn);
+ Torque.releaseConnection(dbConn);
}
catch (Exception e)
1.9 +25 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletConfig.java
Index: BasePortletConfig.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletConfig.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- BasePortletConfig.java 26 Mar 2002 09:06:54 -0000 1.8
+++ BasePortletConfig.java 14 May 2002 06:32:58 -0000 1.9
@@ -71,7 +71,7 @@
* about the running environment of a given Portlet.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
- * @version $Id: BasePortletConfig.java,v 1.8 2002/03/26 09:06:54 taylor Exp $
+ * @version $Id: BasePortletConfig.java,v 1.9 2002/05/14 06:32:58 taylor Exp $
*/
public class BasePortletConfig extends BaseConfig implements PortletConfig
{
@@ -84,7 +84,9 @@
private transient PortletSet currentSet;
private CapabilityMap cm = null;
private boolean cachedOnURL = true;
-
+ private String pageId;
+ private String portletId;
+
/**
Init this PortletConfig providing the basic info.
*/
@@ -365,4 +367,25 @@
{
this.cm = cm;
}
+
+ public void setPageId(String pageId)
+ {
+ this.pageId = pageId;
+ }
+
+ public String getPageId()
+ {
+ return this.pageId;
+ }
+
+ public void setPortletId(String portletId)
+ {
+ this.portletId = portletId;
+ }
+
+ public String getPortletId()
+ {
+ return this.portletId;
+ }
+
}
1.48 +6 -1
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/PortletConfig.java
Index: PortletConfig.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/PortletConfig.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- PortletConfig.java 26 Mar 2002 09:06:54 -0000 1.47
+++ PortletConfig.java 14 May 2002 06:32:58 -0000 1.48
@@ -67,7 +67,7 @@
about the running environment of a given Portlet.
@author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
-@version $Id: PortletConfig.java,v 1.47 2002/03/26 09:06:54 taylor Exp $
+@version $Id: PortletConfig.java,v 1.48 2002/05/14 06:32:58 taylor Exp $
*/
public interface PortletConfig extends Config
@@ -224,5 +224,10 @@
/**
*/
public void setCapabilityMap( CapabilityMap cm );
+
+ public void setPortletId(String portletId);
+ public String getPortletId();
+ public void setPageId(String pageId);
+ public String getPageId();
}
1.35 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/ApplicationsPortlet.java
Index: ApplicationsPortlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/ApplicationsPortlet.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- ApplicationsPortlet.java 17 Dec 2001 15:32:27 -0000 1.34
+++ ApplicationsPortlet.java 14 May 2002 06:32:59 -0000 1.35
@@ -81,7 +81,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Santiago Gala</a>
- * @version $Id: ApplicationsPortlet.java,v 1.34 2001/12/17 15:32:27 sgala Exp $
+ * @version $Id: ApplicationsPortlet.java,v 1.35 2002/05/14 06:32:59 taylor Exp $
*/
public class ApplicationsPortlet extends AbstractPortlet {
@@ -130,7 +130,7 @@
String url = PortletURIManager.getPortletMaxURI( entry, data
).toString();
Portlet portlet = null;
try {
- portlet = PortletFactory.getPortlet(entry.getName());
+ portlet = PortletFactory.getPortlet(entry.getName(), "0");
} catch (PortletException e) {
continue;
}
1.41 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/PortletInfoPortlet.java
Index: PortletInfoPortlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/PortletInfoPortlet.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- PortletInfoPortlet.java 29 Jul 2001 13:41:58 -0000 1.40
+++ PortletInfoPortlet.java 14 May 2002 06:32:59 -0000 1.41
@@ -94,7 +94,7 @@
</p>
@author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
-@version $Id: PortletInfoPortlet.java,v 1.40 2001/07/29 13:41:58 raphael Exp $
+@version $Id: PortletInfoPortlet.java,v 1.41 2002/05/14 06:32:59 taylor Exp $
*/
public class PortletInfoPortlet extends AbstractPortlet {
@@ -134,7 +134,7 @@
Portlet portlet = null;
try {
- portlet = PortletFactory.getPortlet( portletName );
+ portlet = PortletFactory.getPortlet( portletName, "0" );
} catch (PortletException e) {
Log.error(e);
return new StringElement( e.getMessage() );
1.17 +1 -1
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/VelocityPortlet.java
Index: VelocityPortlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/VelocityPortlet.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- VelocityPortlet.java 14 Apr 2002 16:49:09 -0000 1.16
+++ VelocityPortlet.java 14 May 2002 06:32:59 -0000 1.17
@@ -87,7 +87,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Spencer</a>
*/
-public class VelocityPortlet extends AbstractPortlet
+public class VelocityPortlet extends AbstractInstancePortlet
{
1.1
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/AbstractInstancePortlet.java
Index: AbstractInstancePortlet.java
===================================================================
package org.apache.jetspeed.portal.portlets;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
import org.apache.jetspeed.portal.PortletConfig;
/** ClearPortlet
* Empty Portlet which displays no content
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
*/
public class AbstractInstancePortlet extends AbstractPortlet
{
public static Object getHandle(Object config)
{
//this implementation expects a PortletConfig object as its
// configuration
PortletConfig pc = null;
if (!(config instanceof PortletConfig))
{
return null;
}
// By default, only take into account the init parameters
pc = (PortletConfig)config;
StringBuffer handle = new StringBuffer(256);
//handle.append(pc.getPageId());
//handle.append("/");
handle.append(pc.getPortletId());
return handle.toString();
}
}
1.1
jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/BogusPortlet.java
Index: BogusPortlet.java
===================================================================
package org.apache.jetspeed.portal.portlets;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
import org.apache.jetspeed.portal.PortletConfig;
/** ClearPortlet
* Empty Portlet which displays no content
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
*/
public class BogusPortlet extends AbstractInstancePortlet
{
/**
* Insert the method's description here.
* Creation date: (12/4/2000 1:49:50 PM)
* @return org.apache.ecs.ConcreteElement
* @param data org.apache.turbine.util.RunData
*/
public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData
data)
{
String s1 = "Config ID: " + getPortletConfig().getPortletId();
String s2 = ", Portlet ID: " + getID();
String s3 = ", Page ID: " + getPortletConfig().getPageId();
return new org.apache.ecs.ClearElement( s1 + s2 + s3);
}
}
1.3 +3 -3
jakarta-jetspeed/src/java/org/apache/jetspeed/services/PortletFactory.java
Index: PortletFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/PortletFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PortletFactory.java 22 Mar 2002 18:51:56 -0000 1.2
+++ PortletFactory.java 14 May 2002 06:32:59 -0000 1.3
@@ -65,7 +65,7 @@
* Static wrapper around the PortletFactoryService
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
- * @version $Id: PortletFactory.java,v 1.2 2002/03/22 18:51:56 taylor Exp $
+ * @version $Id: PortletFactory.java,v 1.3 2002/05/14 06:32:59 taylor Exp $
*/
public class PortletFactory
{
@@ -98,9 +98,9 @@
* @param name the name of a portlet in the registry
* @return an instanciated portlet corresponding to this entry
*/
- public static Portlet getPortlet( String name ) throws PortletException
+ public static Portlet getPortlet( String name, String id ) throws
PortletException
{
- return getService().getPortlet( name );
+ return getService().getPortlet( name, id );
}
}
1.10 +10 -6
jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletfactory/JetspeedPortletFactoryService.java
Index: JetspeedPortletFactoryService.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletfactory/JetspeedPortletFactoryService.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JetspeedPortletFactoryService.java 13 May 2002 00:57:16 -0000 1.9
+++ JetspeedPortletFactoryService.java 14 May 2002 06:32:59 -0000 1.10
@@ -90,7 +90,7 @@
* Simple implementation of the PortalFactoryService.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
- * @version $Id: JetspeedPortletFactoryService.java,v 1.9 2002/05/13 00:57:16
ggolden Exp $
+ * @version $Id: JetspeedPortletFactoryService.java,v 1.10 2002/05/14 06:32:59
taylor Exp $
*/
public class JetspeedPortletFactoryService extends TurbineBaseService
implements PortletFactoryService
@@ -119,6 +119,7 @@
* Given a PSML Entry return an instanciated Portlet.
*
* @param entry a PSML Entry describing a portlet
+ * @param id the PSML entry's portlet id
* @return an instanciated portlet corresponding to this entry
*/
public Portlet getPortlet( Entry entry ) throws PortletException
@@ -135,7 +136,7 @@
throw new PortletException("PortletFactory: can't instanciate abstract
registry entry: "+regEntry.getName());
}
- PortletConfig pc = getPortletConfig(regEntry);
+ PortletConfig pc = getPortletConfig(regEntry, entry.getId());
pc.getInitParameters().putAll(getParameters(entry));
@@ -150,7 +151,7 @@
* @param name the name of a portlet in the registry
* @return an instanciated portlet corresponding to this entry
*/
- public Portlet getPortlet( String name ) throws PortletException
+ public Portlet getPortlet( String name, String id ) throws PortletException
{
PortletEntry regEntry = (PortletEntry)Registry.getEntry(Registry.PORTLET,
name );
@@ -164,7 +165,7 @@
throw new PortletException("PortletFactory: can't instanciate abstract
registry entry: "+name);
}
- PortletConfig pc = getPortletConfig(regEntry);
+ PortletConfig pc = getPortletConfig(regEntry, id);
return getPortlet( regEntry.getClassname(), pc, null );
}
@@ -175,7 +176,7 @@
*
* @param classname the classname of the portlet to instanciate
* @param pc the PortletConfig object to be associated with this object
- * @param id The portlet's unique id (from the psml entry).
+ * @param id the PSML entry's portlet id
* @return the Portlet created or retrieve from cache
*/
protected Portlet getPortlet( String classname, PortletConfig pc, String id )
@@ -355,9 +356,10 @@
Given a PSML Entry, get the value of what its PortletConfig would be.
@param entry the PSML Entry containing the config
+ @param portletId the PSML entry's portlet id
@return the newly created PortletConfig object
*/
- protected PortletConfig getPortletConfig( PortletEntry entry )
+ protected PortletConfig getPortletConfig( PortletEntry entry, String id)
{
Map map = new HashMap();
map.putAll(entry.getParameterMap());
@@ -368,6 +370,8 @@
pc.setMetainfo( getMetaData( entry ) );
pc.setURL( entry.getURL() );
pc.setCachedOnURL( entry.isCachedOnURL() );
+ //pc.setPageId(pageId); // LEFT OFF HERE: need to get the page id somehow
+ pc.setPortletId(id);
return pc;
}
1.3 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletfactory/PortletFactoryService.java
Index: PortletFactoryService.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletfactory/PortletFactoryService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PortletFactoryService.java 22 Mar 2002 18:51:56 -0000 1.2
+++ PortletFactoryService.java 14 May 2002 06:32:59 -0000 1.3
@@ -64,7 +64,7 @@
* This service handles the creation of Portlet objects
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
- * @version $Id: PortletFactoryService.java,v 1.2 2002/03/22 18:51:56 taylor Exp $
+ * @version $Id: PortletFactoryService.java,v 1.3 2002/05/14 06:32:59 taylor Exp $
*/
public interface PortletFactoryService extends Service
{
@@ -86,6 +86,6 @@
* @param name the name of a portlet in the registry
* @return an instanciated portlet corresponding to this entry
*/
- public Portlet getPortlet( String name ) throws PortletException;
+ public Portlet getPortlet( String name, String id ) throws PortletException;
}
1.18 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/JetspeedTool.java
Index: JetspeedTool.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/JetspeedTool.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- JetspeedTool.java 29 Mar 2002 20:12:33 -0000 1.17
+++ JetspeedTool.java 14 May 2002 06:32:59 -0000 1.18
@@ -88,7 +88,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
*
- * @version $Id: JetspeedTool.java,v 1.17 2002/03/29 20:12:33 taylor Exp $
+ * @version $Id: JetspeedTool.java,v 1.18 2002/05/14 06:32:59 taylor Exp $
*/
public class JetspeedTool implements ApplicationTool
{
@@ -285,7 +285,7 @@
try
{
- customizer = PortletFactory.getPortlet(name);
+ customizer = PortletFactory.getPortlet(name, p.getID());
customizer.getPortletConfig()
.setPortletSkin(p.getPortletConfig().getPortletSkin());
PortletControl control = PortalToolkit.getControl((String)null);
1.13 +7 -0 jakarta-jetspeed/webapp/WEB-INF/conf/demo-portlets.xreg
Index: demo-portlets.xreg
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/demo-portlets.xreg,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- demo-portlets.xreg 20 Apr 2002 12:51:57 -0000 1.12
+++ demo-portlets.xreg 14 May 2002 06:32:59 -0000 1.13
@@ -204,4 +204,11 @@
<parameter name="windowSize" value="5" hidden="false"/>
<media-type ref="html"/>
</portlet-entry>
+ <portlet-entry name="Bogus" hidden="false" type="instance" application="false">
+ <classname>org.apache.jetspeed.portal.portlets.BogusPortlet</classname>
+ <media-type ref="html"/>
+ <meta-info>
+ <title>Bogus</title>
+ </meta-info>
+ </portlet-entry>
</registry>
1.11 +2 -0 jakarta-jetspeed/webapp/WEB-INF/psml/anon/html/en/default.psml
Index: default.psml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/psml/anon/html/en/default.psml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- default.psml 23 Mar 2002 22:18:17 -0000 1.10
+++ default.psml 14 May 2002 06:32:59 -0000 1.11
@@ -26,6 +26,8 @@
</portlets>
<portlets>
+ <entry id="808" parent="Bogus"/>
+ <entry id="809" parent="Bogus"/>
<entry parent="Jetspeed"/>
<entry parent="Welcome"/>
</portlets>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>