cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java XSPJavaProcessor.java
Date Wed, 05 Jan 2000 16:12:24 GMT
stefano     00/01/05 08:12:24

  Modified:    src/org/apache/cocoon/processor/xsp XSPProcessor.java
               src/org/apache/cocoon/processor/xsp/language/java
                        XSPJavaProcessor.java
  Log:
  ... added fixme
  
  Revision  Changes    Path
  1.4       +11 -5     xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java
  
  Index: XSPProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPProcessor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSPProcessor.java	2000/01/03 01:42:50	1.3
  +++ XSPProcessor.java	2000/01/05 16:12:23	1.4
  @@ -1,4 +1,4 @@
  -/*-- $Id: XSPProcessor.java,v 1.3 2000/01/03 01:42:50 stefano Exp $ --
  +/*-- $Id: XSPProcessor.java,v 1.4 2000/01/05 16:12:23 stefano Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -71,7 +71,7 @@
    * This class implements the XSP engine.
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version $Revision: 1.3 $ $Date: 2000/01/03 01:42:50 $
  + * @version $Revision: 1.4 $ $Date: 2000/01/05 16:12:23 $
    */
   public class XSPProcessor extends AbstractActor
     implements Processor, Configurable, Status
  @@ -180,21 +180,27 @@
     }
   
     public void init(Configurations conf) {
  -    conf = conf.getConfigurations("xsp");
   
       // Initialize repository
  +    conf = conf.getConfigurations("xsp");
  +        
  +    // FIXME: the XSP processor should use the Cocoon internal object store
  +    // rather than providing its own. This is a quick and dirty hack to 
  +    // make it work with Ricardo's code. But we'll create smoother integration
  +    // in future versions (SM)
  +    
       String repositoryName = (String) conf.get("repository");
       this.repositoryFile = new File(repositoryName);
       if (!this.repositoryFile.exists()) {
         if (!this.repositoryFile.mkdirs()) {
  -        throw new RuntimeException("Can't create XSP repository: "
  +        throw new RuntimeException("Can't create store repository: "
             + repositoryFile.getAbsolutePath()
             + ". Make sure it's there or you have writing permissions.");
         }
       }
   
       if (!(this.repositoryFile.canRead() && this.repositoryFile.canWrite())) {
  -      throw new RuntimeException("Can't access XSP repository: "
  +      throw new RuntimeException("Can't access store repository: "
           + repositoryFile.getAbsolutePath()
           + ". Make sure you have writing permissions.");
       }
  
  
  
  1.5       +11 -27    xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/XSPJavaProcessor.java
  
  Index: XSPJavaProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/language/java/XSPJavaProcessor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XSPJavaProcessor.java	2000/01/03 18:04:54	1.4
  +++ XSPJavaProcessor.java	2000/01/05 16:12:24	1.5
  @@ -1,4 +1,4 @@
  -/*-- $Id: XSPJavaProcessor.java,v 1.4 2000/01/03 18:04:54 ricardo Exp $ --
  +/*-- $Id: XSPJavaProcessor.java,v 1.5 2000/01/05 16:12:24 stefano Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -55,7 +55,6 @@
   import org.w3c.dom.*;
   import javax.servlet.http.*;
   
  -import Jindent;
   import sun.tools.javac.Main;
   
   import org.apache.cocoon.processor.xsp.*;
  @@ -63,7 +62,7 @@
   
   /**
    * @@author <a href="mailto:ricardo@@apache.org">Ricardo Rocha</a>
  - * @@version $Revision: 1.4 $ $Date: 2000/01/03 18:04:54 $
  + * @@version $Revision: 1.5 $ $Date: 2000/01/05 16:12:24 $
    */
   public class XSPJavaProcessor implements XSPLanguageProcessor {
     // Create class loader
  @@ -93,32 +92,12 @@
       this.format = format;
     }
   
  +
     public String formatCode(String code) throws Exception {
  +    // FIXME: do nothing for now. In the future, we should hook some
  +    // open source java pretty printer or write our own using JavaCC stuff
  +    // or similar to allow easier XSP code debugging (SM)
       return code;
  -
  -    // Commented out while we find an open source code formatter
  -/*
  -    if (!this.format) {
  -      return code;
  -    }
  -
  -    String[] params = {
  -      "-m",
  -    };
  -
  -    Jindent.initParser(params);
  -
  -    ByteArrayOutputStream out = new ByteArrayOutputStream();
  -
  -    Jindent.parseInputStream(
  -      new ByteArrayInputStream(
  -        (new String(code)).getBytes()
  -      ),
  -      out
  -    );
  -
  -    return out.toString();
  -*/
     }
   
     public void compile(String filename) throws Exception {
  @@ -140,6 +119,11 @@
       };
   
       ByteArrayOutputStream err = new ByteArrayOutputStream();
  +    
  +    // FIXME: we should make this reflection based and also allowed other
  +    // compilers to be plugged in. Maybe we can steal... ehmmm, borrow.. some
  +    // Tomcat code for this :) (SM)
  +    
       Main compiler = new Main(err, "javac");
   
       if (!compiler.compile(compilerArgs)) {
  
  
  

Mime
View raw message