cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject cvs commit: xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting AbstractDatabaseAction.java
Date Thu, 02 Jan 2003 20:48:14 GMT
tcurdt      2003/01/02 12:48:14

  Modified:    src/blocks/databases/java/org/apache/cocoon/acting
                        AbstractDatabaseAction.java
  Log:
  factored out the image stuff
  
  Revision  Changes    Path
  1.2       +9 -8      xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting/AbstractDatabaseAction.java
  
  Index: AbstractDatabaseAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting/AbstractDatabaseAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractDatabaseAction.java	18 Oct 2002 14:04:27 -0000	1.1
  +++ AbstractDatabaseAction.java	2 Jan 2003 20:48:14 -0000	1.2
  @@ -59,7 +59,8 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.environment.Request;
  -import org.apache.cocoon.generation.ImageDirectoryGenerator;
  +import org.apache.cocoon.util.ImageProperties;
  +import org.apache.cocoon.util.ImageUtils;
   
   import java.io.*;
   import java.math.BigDecimal;
  @@ -324,7 +325,7 @@
                   value = new Integer(set.getInt(dbcol));
                   break;
           case Types.STRUCT:
  -        value = (Struct) set.getObject(dbcol);
  +        value = set.getObject(dbcol);
           break;
           case Types.OTHER:
           value = set.getObject(dbcol);
  @@ -612,11 +613,11 @@
                           size, width, and height in a static table **/
                       Parameters parameters = new Parameters();
                       parameters.setParameter("image-size", Long.toString(file.length()));
  -                    int [] dimensions = ImageDirectoryGenerator.getSize(file);
  -                    String type = ImageDirectoryGenerator.getFileType(file);
  -                    parameters.setParameter("image-width", Integer.toString(dimensions[0]));
  -                    parameters.setParameter("image-height", Integer.toString(dimensions[1]));
  -                    parameters.setParameter("image-mime-type",type);
  +                    ImageProperties prop = ImageUtils.getImageProperties(file);
  +                    parameters.setParameter("image-width", Integer.toString(prop.width));
  +                    parameters.setParameter("image-height", Integer.toString(prop.height));
  +                    // TC: if it's really mime-type shouldn't we prepend "image/"?
  +                    parameters.setParameter("image-mime-type",prop.type);
                       synchronized (this.files) {
                           this.files.put(file, parameters);
                       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message