portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raph...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers AbstractPortletController.java CardPortletController.java GridPortletController.java RowColumnPortletController.java SinglePortletController.java
Date Mon, 04 Jun 2001 17:37:19 GMT
raphael     01/06/04 10:37:19

  Modified:    src/java/org/apache/jetspeed/portal/controllers
                        AbstractPortletController.java
                        CardPortletController.java
                        GridPortletController.java
                        RowColumnPortletController.java
                        SinglePortletController.java
  Log:
  add a new Constraints interface for layout information in PortletSet
  
  Revision  Changes    Path
  1.17      +20 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/AbstractPortletController.java
  
  Index: AbstractPortletController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/AbstractPortletController.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractPortletController.java	2001/05/29 22:55:39	1.16
  +++ AbstractPortletController.java	2001/06/04 17:37:09	1.17
  @@ -71,15 +71,21 @@
   //ecs stuff
   import org.apache.ecs.*;
   
  +import java.util.Map;
   import java.util.Iterator;
   
   /**
    @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  - @version $Id: AbstractPortletController.java,v 1.16 2001/05/29 22:55:39 raphael Exp $
  + @version $Id: AbstractPortletController.java,v 1.17 2001/06/04 17:37:09 raphael Exp $
   */
   public abstract class AbstractPortletController implements PortletController
   {
   
  +    /**
  +     *  Default padding to be displayed between portlets
  +     */
  +    public int DEFAULT_PADDING = 3;
  +
       private String width="100%";
       private PortletSet portlets = null;
       private PortletControllerConfig conf = null;
  @@ -257,4 +263,17 @@
           return new ElementContainer();
       }
       
  +    /**
  +     * Creates a constraint object based on an original map source.
  +     *
  +     * @param original the source for this constraint object
  +     * @return a new Constraints object appropriate for this controller
  +     */
  +    public PortletSet.Constraints getConstraints( Map original )
  +    {
  +        PortletSet.Constraints constraints = new BasePortletSetConstraints();        
  +        constraints.putAll(original);        
  +        return constraints;
  +    }
  +        
   }
  
  
  
  1.16      +3 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/CardPortletController.java
  
  Index: CardPortletController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/CardPortletController.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CardPortletController.java	2001/05/29 22:55:12	1.15
  +++ CardPortletController.java	2001/06/04 17:37:10	1.16
  @@ -81,7 +81,7 @@
   or with an invalid value, use the first portlet (position 0)</li>
   </p>
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: CardPortletController.java,v 1.15 2001/05/29 22:55:12 raphael Exp $
  +@version $Id: CardPortletController.java,v 1.16 2001/06/04 17:37:10 raphael Exp $
   */
   public class CardPortletController extends AbstractPortletController
   {
  @@ -170,7 +170,7 @@
           
           // save the selected pane is session and parameters
           setCard( pane );
  -        rundata.getSession().setAttribute(getParameterName(), pane);
  +        rundata.getUser().setTemp("card-"+getParameterName(), pane);
           
           return base;
   
  @@ -194,7 +194,7 @@
           if (pane == null)
           {
               // the parameter is undefined, search for sticky value in session
  -            pane = (String)rundata.getSession().getAttribute( getParameterName() );
  +            pane = (String)rundata.getUser().getTemp( "card-"+getParameterName() );
               
               if (pane == null)
               {
  
  
  
  1.12      +5 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/GridPortletController.java
  
  Index: GridPortletController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/GridPortletController.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- GridPortletController.java	2001/03/07 06:45:54	1.11
  +++ GridPortletController.java	2001/06/04 17:37:10	1.12
  @@ -98,7 +98,7 @@
   first cell of the table</p>
   
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: GridPortletController.java,v 1.11 2001/03/07 06:45:54 taylor Exp $
  +@version $Id: GridPortletController.java,v 1.12 2001/06/04 17:37:10 raphael Exp $
   */
   public class GridPortletController extends AbstractPortletController {
   
  @@ -132,14 +132,14 @@
              
           PortletConfig portletConf = portlet.getPortletConfig();
   
  -        int col = Integer.parseInt( portletConf.getLayout( "column","0" ) );
  +        int col = portletConf.getConstraints().getColumn().intValue();
   
           
           if ( col + 1 > this.getColumn() ) {
               this.setColumn( col + 1 );
           }
              
  -        int row = Integer.parseInt( portletConf.getLayout( "row", "0" ) ) ;
  +        int row = portletConf.getConstraints().getRow().intValue();
   
           
           if ( row + 1 > this.getRow() ) {
  @@ -202,8 +202,8 @@
               Portlet p = (Portlet)en.nextElement();
               PortletConfig pConf = p.getPortletConfig();
   
  -            int colnum = Integer.parseInt( pConf.getLayout("column", "0" ) );
  -            int rownum = Integer.parseInt( pConf.getLayout("row", "0") );
  +            int colnum = pConf.getConstraints().getColumn().intValue();
  +            int rownum = pConf.getConstraints().getRow().intValue();
   
               elements[rownum % rows][colnum % cols]
                   .addElement( p.getContent( rundata ) );
  
  
  
  1.15      +2 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/RowColumnPortletController.java
  
  Index: RowColumnPortletController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/RowColumnPortletController.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- RowColumnPortletController.java	2001/05/29 22:55:40	1.14
  +++ RowColumnPortletController.java	2001/06/04 17:37:12	1.15
  @@ -84,7 +84,7 @@
   </p>
   
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: RowColumnPortletController.java,v 1.14 2001/05/29 22:55:40 raphael Exp $
  +@version $Id: RowColumnPortletController.java,v 1.15 2001/06/04 17:37:12 raphael Exp $
   */
   public class RowColumnPortletController extends AbstractPortletController {
   
  @@ -130,7 +130,7 @@
                                        }
                                    );
   
  -            setWidth(pc.getLayout("width",getWidth()));
  +            setWidth("100%");
   
               Table t = new Table().setWidth( this.getWidth() )
                                     .setCellPadding(this.getPadding())
  
  
  
  1.6       +1 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/SinglePortletController.java
  
  Index: SinglePortletController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controllers/SinglePortletController.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SinglePortletController.java	2001/05/29 22:55:41	1.5
  +++ SinglePortletController.java	2001/06/04 17:37:13	1.6
  @@ -102,7 +102,7 @@
   
               Enumeration en = portlets.getPortlets();
   
  -            setWidth(pc.getLayout("width",getWidth()));
  +            setWidth("100%");
   
               Table t = new Table().setWidth( this.getWidth() )
                                    .setCellPadding(this.getPadding())
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message