You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/10/30 16:20:46 UTC

cvs commit: xml-cocoon2/src/org/apache/cocoon/generation VelocityGenerator.java

cziegeler    01/10/30 07:20:46

  Modified:    src/org/apache/cocoon/components/resolver ResolverImpl.java
               src/org/apache/cocoon/generation VelocityGenerator.java
  Log:
  removed some more getRealPath()
  
  Revision  Changes    Path
  1.7       +3 -3      xml-cocoon2/src/org/apache/cocoon/components/resolver/ResolverImpl.java
  
  Index: ResolverImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/resolver/ResolverImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ResolverImpl.java	2001/10/11 07:28:18	1.6
  +++ ResolverImpl.java	2001/10/30 15:20:46	1.7
  @@ -31,7 +31,7 @@
   
   /**
    * A component that uses catalogs for resolving Entities. This implementation
  - * uses the XML Entity and URI Resolvers from 
  + * uses the XML Entity and URI Resolvers from
    * http://www.sun.com/xml/developers/resolver/
    * published by Sun's Norman Walsh. More information on the catalogs can be
    * found at
  @@ -44,7 +44,7 @@
    * </resolver>
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.6 $ $Date: 2001/10/11 07:28:18 $
  + * @version CVS $Revision: 1.7 $ $Date: 2001/10/30 15:20:46 $
    */
   public class ResolverImpl extends AbstractLoggable
           implements Resolver, Contextualizable, Composable, Configurable, ThreadSafe, Disposable {
  @@ -94,7 +94,7 @@
           String catalogFile = params.getParameter("catalog",
             "/resources/entities/catalog");
           try {
  -            String catalogURL = this.context.getRealPath(catalogFile);
  +            String catalogURL = this.context.getResource(catalogFile).toExternalForm();
               getLogger().debug("System Catalog URL is " + catalogURL);
               catalogResolver.getCatalog().parseCatalog(catalogURL);
           } catch (Exception e) {
  
  
  
  1.10      +5 -2      xml-cocoon2/src/org/apache/cocoon/generation/VelocityGenerator.java
  
  Index: VelocityGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/VelocityGenerator.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- VelocityGenerator.java	2001/10/11 07:28:21	1.9
  +++ VelocityGenerator.java	2001/10/30 15:20:46	1.10
  @@ -23,7 +23,7 @@
   
   /**
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.9 $ $Date: 2001/10/11 07:28:21 $
  + * @version CVS $Revision: 1.10 $ $Date: 2001/10/30 15:20:46 $
    */
   public class VelocityGenerator extends ServletGenerator implements Recyclable {
   
  @@ -46,7 +46,10 @@
               {
                   initVelocity = true;
   
  -                String templatePath = ((org.apache.cocoon.environment.http.HttpContext)super.context).getRealPath("/templates");
  +                String templatePath = super.context.getResource("/templates").toExternalForm();
  +                if (templatePath.startsWith("file:") == true) {
  +                    templatePath = templatePath.substring(5);
  +                }
                   getLogger().debug("Templates Directory:" + templatePath);
   
                   Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, templatePath);
  
  
  

----------------------------------------------------------------------
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