bloritsch    01/04/09 08:56:53

  Modified:    src/org/apache/cocoon/generation Tag: xml-cocoon2
                        PhpGenerator.java
  Log:
  Fixed PHPGenerator for compilation.
  Two inner classes needed to get the Logger, and PHPServlet requires
  explicit casts of HttpServletRequest/Response and Context.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.16  +9 -8      
xml-cocoon/src/org/apache/cocoon/generation/Attic/PhpGenerator.java
  
  Index: PhpGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/PhpGenerator.java,v
  retrieving revision 1.1.2.15
  retrieving revision 1.1.2.16
  diff -u -r1.1.2.15 -r1.1.2.16
  --- PhpGenerator.java 2001/04/03 20:14:47     1.1.2.15
  +++ PhpGenerator.java 2001/04/09 15:56:51     1.1.2.16
  @@ -18,6 +18,7 @@
   import org.apache.cocoon.components.parser.Parser;
   
   import org.apache.avalon.Poolable;
  +import org.apache.cocoon.Roles;
   
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  @@ -28,7 +29,7 @@
    * results into SAX events.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Sam Ruby</a>
  - * @version CVS $Revision: 1.1.2.15 $ $Date: 2001/04/03 20:14:47 $
  + * @version CVS $Revision: 1.1.2.16 $ $Date: 2001/04/09 15:56:51 $
    */
   public class PhpGenerator extends ServletGenerator implements Poolable {
   
  @@ -78,7 +79,7 @@
               try {
                   output.write(data.getBytes());
               } catch (IOException e) {
  -                getLogger().debug("PhpGenerator.write()", e);
  +                PhpGenerator.this.getLogger().debug("PhpGenerator.write()", 
e);
                   throw new RuntimeException(e.getMessage());
               }
           }
  @@ -91,14 +92,14 @@
               try {
                   service(request, response, input);
               } catch (ServletException e) {
  -                getLogger().error("PhpGenerator.run()", e);
  +                PhpGenerator.this.getLogger().error("PhpGenerator.run()", e);
                   this.exception = e;
               }
   
               try {
                   output.close();
               } catch (IOException e) {
  -                getLogger().error("PhpGenerator.run():SHOULD NEVER HAPPEN", 
e);
  +                
PhpGenerator.this.getLogger().error("PhpGenerator.run():SHOULD NEVER HAPPEN", 
e);
                   // should never happen
               }
           }
  @@ -122,15 +123,15 @@
   
               // start PHP producing results into the pipe
               PhpServlet php = new PhpServlet();
  -            php.init(new config(context));
  +            php.init(new config((ServletContext)context));
               php.setInput(systemId.substring(6));
               php.setOutput(new PipedOutputStream(input));
  -            php.setRequest(request);
  -            php.setResponse(response);
  +            php.setRequest((HttpServletRequest)request);
  +            php.setResponse((HttpServletResponse)response);
               new Thread(php).start();
   
               // pipe the results into the parser
  -            Parser 
parser=(Parser)this.manager.getComponent("org.apache.cocoon.components.parser.Parser");
  +            Parser parser=(Parser)this.manager.lookup(Roles.PARSER);
               parser.setContentHandler(this.contentHandler);
               parser.setLexicalHandler(this.lexicalHandler);
               parser.parse(new InputSource(input));
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to