cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl SizingAspect.java
Date Tue, 02 Sep 2003 08:55:26 GMT
cziegeler    2003/09/02 01:55:26

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/coplet/status
                        SizingStatus.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
                        SizingAspect.java
  Log:
  Updating code
  
  Revision  Changes    Path
  1.4       +2 -1      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/SizingStatus.java
  
  Index: SizingStatus.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/SizingStatus.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SizingStatus.java	26 May 2003 13:18:20 -0000	1.3
  +++ SizingStatus.java	2 Sep 2003 08:55:26 -0000	1.4
  @@ -62,5 +62,6 @@
   
       public final static Integer STATUS_MINIMIZED = new Integer(0);
       public final static Integer STATUS_MAXIMIZED = new Integer(1);
  +    public final static Integer STATUS_MAXPAGED  = new Integer(2);
   
   }
  
  
  
  1.6       +38 -9     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
  
  Index: SizingAspect.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SizingAspect.java	18 Jul 2003 14:41:44 -0000	1.5
  +++ SizingAspect.java	2 Sep 2003 08:55:26 -0000	1.6
  @@ -62,6 +62,9 @@
   import org.xml.sax.SAXException;
   
   /**
  + * This renderer aspect tests, if a coplet is sizable and/or maxpageable.
  + * 
  + * TODO: make the names of the aspects to test configurable
    *
    * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
    * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  @@ -81,28 +84,54 @@
           
           CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
   
  -        Boolean sizable = (Boolean)cid.getCopletData().getAspectData("sizable");
  -        if ( sizable.booleanValue() ) {
  -            Integer size = (Integer)cid.getAspectData("size");
  +        boolean showContent = true;
  +        
  +        boolean sizable = ((Boolean)cid.getCopletData().getAspectData("sizable")).booleanValue();
  +        Integer size = null;
  +        
  +        if ( sizable ) {
  +            size = (Integer)cid.getAspectData("size");
               if ( size == null ) {
                   size = SizingStatus.STATUS_MAXIMIZED;
               }
   
               ChangeCopletInstanceAspectDataEvent event;    
   
  -            if ( !size.equals(SizingStatus.STATUS_MINIMIZED)) {
  +            if ( size.equals(SizingStatus.STATUS_MAXIMIZED) ) {
                   event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MINIMIZED);
                   XMLUtils.createElement(handler, "minimize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
               }
   
  -            if ( !size.equals(SizingStatus.STATUS_MAXIMIZED)) {
  +            if ( size.equals(SizingStatus.STATUS_MINIMIZED)) {
                   event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXIMIZED);
                   XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
               }
  -            if (size != SizingStatus.STATUS_MINIMIZED) {
  -                context.invokeNext(layout, service, handler);
  +            
  +            if (size == SizingStatus.STATUS_MINIMIZED) {
  +                showContent = false;
  +            }
  +        } 
  +/*        boolean maxPageable = ((Boolean)cid.getCopletData().getAspectData("maxpageable")).booleanValue();
  +        if ( maxPageable ) {
  +            if ( size == null ) {
  +                size = (Integer)cid.getAspectData("size");
  +                if ( size == null ) {
  +                    size = SizingStatus.STATUS_MAXIMIZED;
  +                }
  +            }
  +            ChangeCopletInstanceAspectDataEvent event;    
  +
  +            if ( size == SizingStatus.STATUS_MAXIMIZED) {
  +                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXPAGED);
  +                XMLUtils.createElement(handler, "maxpage-uri", service.getComponentManager().getLinkService().getLinkURI(event));
  +            }
  +            if ( size == SizingStatus.STATUS_MAXPAGED) {
  +                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXIMIZED);
  +                XMLUtils.createElement(handler, "minpage-uri", service.getComponentManager().getLinkService().getLinkURI(event));
               }
  -        } else {
  +        }
  +*/               
  +        if ( showContent ) {
               context.invokeNext(layout, service, handler);
           }
   	}
  
  
  

Mime
View raw message