raphael 01/06/09 08:36:47
Modified: src/java/org/apache/jetspeed/services/portaltoolkit
JetspeedPortalToolkitService.java
Log:
allow portlet set to be retrieved by tree position during customization
Revision Changes Path
1.4 +19 -4
jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java
Index: JetspeedPortalToolkitService.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JetspeedPortalToolkitService.java 2001/06/04 19:42:33 1.3
+++ JetspeedPortalToolkitService.java 2001/06/09 15:36:46 1.4
@@ -81,7 +81,7 @@
* Simple implementation of the PortalFactoryService.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Raphaël Luta</a>
- * @version $Id: JetspeedPortalToolkitService.java,v 1.3 2001/06/04 19:42:33
raphael Exp $
+ * @version $Id: JetspeedPortalToolkitService.java,v 1.4 2001/06/09 15:36:46
raphael Exp $
*/
public class JetspeedPortalToolkitService extends TurbineBaseService
implements PortalToolkitService
@@ -352,12 +352,27 @@
*/
public PortletSet getSet( Portlets portlets )
{
-
+ return getSet( portlets, 0 );
+ }
+
+ /**
+ * Creates a PortletSet from a PSML portlets description, updating
+ * the portletset name based on its position within the tree
+ *
+ * @param portlets the PSML portlet set description
+ * @param count the portletset number within the complete tree
+ * @return a new instance of PortletSet
+ */
+ protected PortletSet getSet( Portlets portlets, int count)
+ {
// Create a new BasePortletSet to handle the portlets
PortletSet set = new BasePortletSet();
PortletController controller = getController( portlets.getController() );
set.setController( controller );
-
+ set.setName(String.valueOf(count));
+
+ count++;
+
//FIXME: this sucks ! we should either associate the portlet set
//with its portlets peer or set the porpoerties directly on the portlet
//set object
@@ -370,7 +385,7 @@
{
Map constraints = getParameters(subsets[i].getLayout());
int position = getPosition( subsets[i].getLayout() );
- set.addPortlet( getSet( subsets[i] ),
+ set.addPortlet( getSet( subsets[i], count + i ),
controller.getConstraints(constraints),
position );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]