cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r494440 - in /cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator: GeneratorSelector.java ProgramGeneratorImpl.java
Date Tue, 09 Jan 2007 15:39:54 GMT
Author: cziegeler
Date: Tue Jan  9 07:39:53 2007
New Revision: 494440

URL: http://svn.apache.org/viewvc?view=rev&rev=494440
Log:
Use settings object

Modified:
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java?view=diff&rev=494440&r1=494439&r2=494440
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java
(original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java
Tue Jan  9 07:39:53 2007
@@ -31,9 +31,9 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.cocoon.Constants;
 import org.apache.cocoon.components.classloader.ClassLoaderManager;
 import org.apache.cocoon.components.language.programming.Program;
+import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.xsp.handler.AbstractComponentHandler;
 import org.apache.cocoon.xsp.handler.ComponentHandler;
 
@@ -68,8 +68,9 @@
 
         this.classManager = (ClassLoaderManager) manager.lookup(ClassLoaderManager.ROLE);
 
+        final Settings settings = (Settings)manager.lookup(Settings.ROLE);
         try {
-            this.classManager.addDirectory((File) this.context.get(Constants.CONTEXT_WORK_DIR));
+            this.classManager.addDirectory(new File(settings.getWorkDirectory()));
         } catch (Exception e) {
             throw new ServiceException(ROLE, "Could not add repository to ClassLoaderManager",
e);
         }

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java?view=diff&rev=494440&r1=494439&r2=494440
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
(original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
Tue Jan  9 07:39:53 2007
@@ -36,6 +36,7 @@
 import org.apache.cocoon.components.language.programming.CodeFormatter;
 import org.apache.cocoon.components.language.programming.Program;
 import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
+import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.util.IOUtils;
 import org.apache.excalibur.source.Source;
@@ -91,10 +92,6 @@
 
     /** Contextualize this class */
     public void contextualize(Context context) throws ContextException {
-        if (this.workDir == null) {
-            this.workDir = (File) context.get(Constants.CONTEXT_WORK_DIR);
-        }
-
         if (this.contextDir == null) {
             org.apache.cocoon.environment.Context ctx =
                 (org.apache.cocoon.environment.Context) context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
@@ -131,6 +128,10 @@
         this.cache = (GeneratorSelector) this.manager.lookup(GeneratorSelector.ROLE + "Selector");
         this.markupSelector = (ServiceSelector)this.manager.lookup(MarkupLanguage.ROLE +
"Selector");
         this.languageSelector = (ServiceSelector)this.manager.lookup(ProgrammingLanguage.ROLE
+ "Selector");
+        final Settings settings = (Settings)this.manager.lookup(Settings.ROLE);
+        if (this.workDir == null) {
+            this.workDir = new File(settings.getWorkDirectory());
+        }
     }
 
     /**



Mime
View raw message