[Laszlo-checkins] r9031 - in openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo: cm compiler js2doc utils

hqm@openlaszlo.org hqm at openlaszlo.org
Wed May 7 11:03:01 PDT 2008


Author: hqm
Date: 2008-05-07 11:02:56 -0700 (Wed, 07 May 2008)
New Revision: 9031

Added:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/TrackingFileResolver.java
Modified:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CachedInfo.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CompilationManager.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/DependencyTracker.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ConditionalState.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/utils/DeploySOLODHTML.java
Log:
Change 20080507-hqm-6 by hqm at badtzmaru.home on 2008-05-07 13:34:17 EDT
    in /Users/hqm/openlaszlo/trunk4
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: merge in nexb changes for IDE support

New Features:

Bugs Fixed:

Technical Reviewer: hqm
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

+ changes merged in for IDE support


Tests:

lztest,
 amazon (dhtml, swf), 
run-lzunit
smokecheck (dhtml, swf)
deploy solo dhtml application, amazon,  from command line lzdeploy tool




Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CachedInfo.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CachedInfo.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CachedInfo.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -3,7 +3,7 @@
 * ****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2004, 2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -97,6 +97,15 @@
         p.flush();
         ostream.close();
     }
+    
+    /**
+     * @return <code>true</code> if this {@link CachedInfo} instance has a
+     *         {@link Canvas} associated with it, or <code>false</code>
+     *         otherwise.
+     */
+    public boolean hasCanvas() {
+        return this.mCanvas != null;
+    }
 
     public Canvas getCanvas() {
         mLogger.debug(

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CompilationManager.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CompilationManager.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/CompilationManager.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -3,7 +3,7 @@
  * ****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -769,7 +769,7 @@
     /**
      * @return a cache key for the given compile
      */
-    static Serializable computeKey(String pathname, Properties props) {
+    protected static Serializable computeKey(String pathname, Properties props) {
 
         TreeSet  sorted = new TreeSet ();
         for (java.util.Enumeration e = props.propertyNames();
@@ -840,55 +840,3 @@
     }
 }
 
-/** A FileResolver that tracks dependencies.
- *
- * @author Oliver Steele
- */
-class TrackingFileResolver implements FileResolver {
-    private final FileResolver mBaseResolver;
-    private final DependencyTracker mDependencies;
-
-    TrackingFileResolver(FileResolver baseResolver,
-                         DependencyTracker tracker) {
-        this.mBaseResolver = baseResolver;
-        this.mDependencies = tracker;
-    }
-    
-    public Set getBinaryIncludes() { return mBaseResolver.getBinaryIncludes(); }
-
-    /**
-     * Implement the FileResolver interface.
-     *
-     * @param pathname a <code>String</code> value
-     * @param base a <code>String</code> value
-     * @param asLibrary a <code>boolean</code> value
-     * @return a <code>File</code> value
-     * @exception FileNotFoundException if an error occurs
-     */
-    public File resolve(String pathname, String base, boolean asLibrary)
-        throws FileNotFoundException
-    {
-        File file = mBaseResolver.resolve(pathname, base, asLibrary);
-        mDependencies.addFile(file);
-        return file;
-    }
-
-    public File resolve(CompilationEnvironment env, String pathname, String base, boolean asLibrary)
-        throws FileNotFoundException
-    {
-        File file = mBaseResolver.resolve(env, pathname, base, asLibrary);
-        mDependencies.addFile(file);
-        return file;
-    }
-
-
-    /** For debugging. */
-    /*void writeResults() {
-        System.out.println("depends on");
-        for (java.util.Iterator e = mDependencies.iterator();
-             e.hasNext(); ) {
-             FileInfo fi = (FileInfo) e.next();
-            System.out.println(fi.mPathname + " -> " + fi.mChecksum);
-        }
-        }*/
-}

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/DependencyTracker.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/DependencyTracker.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/DependencyTracker.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -3,7 +3,7 @@
 * ****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2004, 2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -23,7 +23,7 @@
  *
  * @author Oliver steele
  */
-class DependencyTracker implements java.io.Serializable {
+public class DependencyTracker implements java.io.Serializable {
     private static Logger mLogger  = Logger.getLogger(DependencyTracker.class);
 
     /** Records information about the version of a file.
@@ -74,7 +74,7 @@
     private Properties mProperties;
     private String mWebappPath;
 
-    DependencyTracker(Properties properties) {
+    public DependencyTracker(Properties properties) {
         this.mProperties = properties;
         this.mWebappPath = LPS.HOME(); // get it from global
     }
@@ -82,7 +82,7 @@
     /** Add the specified file to the list of file dependencies.
      * @param file a file
      */
-    void addFile(File file) {
+    public void addFile(File file) {
         mLogger.debug("addFile Path is " + file.getPath());
         FileInfo fi = new FileInfo(file.getPath());
         try {
@@ -98,7 +98,7 @@
      * Copy file info from the given tracker to me, omitting
      * omitting then given file.
      */
-    void copyFiles(DependencyTracker t, File omitMe) {
+    public void copyFiles(DependencyTracker t, File omitMe) {
         try {
             for (Iterator e = t.mDependencies.iterator(); e.hasNext(); ) {
                 FileInfo f = (FileInfo)e.next();
@@ -116,7 +116,7 @@
      * webappPath once the DependencyTracker object has been reconstitutded
      * from ondisk cache.
      */
-    void updateWebappPath() {
+    public void updateWebappPath() {
         String webappPath = LPS.HOME(); // get it from global
         if (webappPath.equals(mWebappPath))
             return;
@@ -161,13 +161,18 @@
         }
         mWebappPath = webappPath;
     }
+    
+    public boolean isUpToDate(Properties properties) {
+        return isUpToDate(properties, null);
+    }
 
     /** Returns true iff all the files listed in this tracker's
      * dependency list exist and are at the same version as when they
      * were recorded.
      * @return a boolean
      */
-    boolean isUpToDate(Properties properties) {
+    public boolean isUpToDate(Properties properties, List staleDeps) 
+    {
         Iterator e;
         
         // fixes bug 962 
@@ -211,6 +216,8 @@
                 }
             }
         }
+        
+        boolean isUpToDate = true;
 
         for (e = mDependencies.iterator(); e.hasNext(); ) {
             FileInfo saved = (FileInfo) e.next();
@@ -219,9 +226,17 @@
                 mLogger.debug(saved.mPathname + " has changed");
                 mLogger.debug("was " + saved.mLastMod);
                 mLogger.debug(" is " + current.mLastMod);
-                return false;
+                
+                isUpToDate = false;
+                
+                if (staleDeps != null) {
+                    staleDeps.add(new File(saved.mPathname));
+                } else {
+                    break;
+                }
             }
         }
-        return true;
+        
+        return isUpToDate;
     }
 }

Added: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/TrackingFileResolver.java


Property changes on: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/cm/TrackingFileResolver.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -12,19 +12,19 @@
 
 /** Contains information about an attribute of a laszlo viewsystem class.
  */
-class AttributeSpec {
+public class AttributeSpec {
     /** The source Element from which this attribute was parsed */
     Element source = null;
     /** The attribute name */
-    String name;
+    public String name;
     /** The default value */
-    String defaultValue = null;
+    public String defaultValue = null;
     /** The setter function */
     String setter;
     /** The type of the attribute value*/ 
-    Type type;
+    public Type type;
     /** Is this attribute required to instantiate an instance of this class? */
-    boolean required = false;
+    public boolean required = false;
     /** When does the initial value for this attribute get evaluated? */
     String when = NodeModel.WHEN_IMMEDIATELY;
 
@@ -35,7 +35,7 @@
     String allocation = NodeModel.ALLOCATION_INSTANCE;
 
     /** If this is a method, the arglist */
-    String arglist = null;
+    public String arglist = null;
 
     /** Can this attribute be overridden without a warning? value is null, 'true' or 'false' */
     String isfinal = null;
@@ -134,7 +134,7 @@
         this.when = XMLUtils.getAttributeValue(source, "when", NodeModel.WHEN_IMMEDIATELY);
     }
 
-    AttributeSpec (String name, Type type, String defaultValue, String setter) {
+    public AttributeSpec (String name, Type type, String defaultValue, String setter) {
         this.name = name;
         this.type = type;
         this.defaultValue = defaultValue;

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -11,13 +11,14 @@
 import org.openlaszlo.sc.ScriptCompiler;
 import org.openlaszlo.sc.ScriptClass;
 
-class ClassModel implements Comparable {
+public class ClassModel implements Comparable {
     protected final ViewSchema schema;
     /** This is really the LZX tag name */
-    protected final String className;
+    public final String className;
     protected boolean builtin = false;
     // This is null for the root class
-    protected final ClassModel superclass;
+    protected ClassModel superclass;
+    
     // This is null for the root class
     protected final Element definition;
     protected String kind;
@@ -33,14 +34,16 @@
     protected String superclassName = null;
     protected boolean hasInputText = false;
     protected boolean isInputText = false;
+        
+    public Set traitNames = new HashSet(2, 0.6f);
     
     /* Class or superclass has an <attribute type="text"/>  */
     protected boolean supportsTextAttribute = false;
     /** Map attribute name to type */
-    protected final Map attributeSpecs = new LinkedHashMap();
+    public final Map attributeSpecs = new LinkedHashMap();
     protected final Map classAttributeSpecs = new LinkedHashMap();
 
-    protected boolean inline = false;
+    public boolean inline = false;
     protected String sortkey = null;
 
     public String toString() {
@@ -53,7 +56,7 @@
     }
 
     // Construct a user-defined class
-    ClassModel(String className, ClassModel superclass,
+    public ClassModel(String className, ClassModel superclass,
                ViewSchema schema, Element definition) {
         this.className = className;
         this.superclass = superclass;
@@ -69,6 +72,11 @@
         }
     }
 
+  // Construct a builtin class
+  public ClassModel(String className, ViewSchema schema) {
+    this(className, null, schema, null);
+  }
+
   public int compareTo(Object other) throws ClassCastException {
     ClassModel o = (ClassModel)other;
     int order = this.sortkey.startsWith(o.sortkey) ? +1 : this.sortkey.compareTo(o.sortkey);
@@ -299,9 +307,9 @@
     return isBuiltin() || hasNodeModel() || "interface".equals(kind);
   }
 
-    ClassModel getSuperclassModel() {
+  public ClassModel getSuperclassModel() {
       return superclass;
-    }
+  }
 
   private Map mergedAttributes;
 
@@ -355,12 +363,12 @@
   }
 
     /** This is really the LZX tag name */
-    String getClassName () {
+    public String getClassName () {
      return this.className;
     }
     
     /** This is really the LZX tag name */
-    String getSuperclassName() {
+    public String getSuperclassName() {
         if (superclassName != null) {
             return superclassName; 
         } else if (superclass == null) {
@@ -370,6 +378,14 @@
         }
     }
     
+    public void setSuperclassName(String name) {
+        this.superclassName = name;
+    }
+    
+    void setSuperclassModel(ClassModel superclass) {
+        this.superclass = superclass;
+    }
+    
     /** Return the AttributeSpec for the attribute named attrName.
         Only returns locally defined attribute, does not follow up the
         class hierarchy.
@@ -484,6 +500,10 @@
         }
         return false;
     }
+        
+    public Collection getLocalAttributes () {
+        return Collections.unmodifiableCollection(attributeSpecs.values());
+    }
     
     NodeModel applyClass(NodeModel instance) {
         final String DEFAULTPLACEMENT_ATTR_NAME = "defaultPlacement";

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -26,6 +26,10 @@
  */
 public class CompilationEnvironment {
     private final Properties mProperties;
+    
+    // TODO this is suspicious. What if we want to change the build folder?
+    public static final String DEFAULT_OUTPUT_DIR = "build";
+    
     public static final String RUNTIME_PROPERTY = "runtime";
     public static final String PROXIED_PROPERTY           = "lzproxied";
     public static final String DEBUG_PROPERTY             = "debug";
@@ -50,7 +54,10 @@
     // tag manually. If they didn't, we need to add a call to instantiate one.
     public static final String USER_DEBUG_WINDOW     = "userdebugwindow";
 
-
+    // Flag used by tooling - causes the compiler to skip code generation, and
+    // build the ViewSchema only.
+    public static final String NO_CODE_GENERATION = "nocodegeneration";
+    
     /** Cache for holding DOM tree from parsing library file */
     public HashMap parsedLibraryCache = new HashMap();
 
@@ -186,9 +193,9 @@
         mParser.basePathnames.add(LPS.getLFCDirectory());
     }
 
-  void setObjectFile(File file) {
-    mObjectFile = file;
-  }
+    public void setObjectFile(File file) {
+      mObjectFile = file;
+    }
 
     // For an app named /path/to/myapp.lzx, returns /path/to/build/myapp
     public String getLibPrefix() {
@@ -202,7 +209,7 @@
             parent = ".";
         }
 
-        String path = parent + "/" + "build" + "/" + basename;
+        String path = parent + "/" + DEFAULT_OUTPUT_DIR + "/" + basename;
         return path;
     }
 
@@ -213,7 +220,7 @@
 
         String basename = FileUtils.getBase(appname);
 
-        String path = "build" + "/" + basename;
+        String path = DEFAULT_OUTPUT_DIR + "/" + basename;
         return path;
     }
 

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -212,6 +212,10 @@
             }
         }
     }
+    
+    public Properties getProperties() {
+        return (Properties)mProperties.clone();
+    }
 
   ObjectWriter createObjectWriter(Properties props,  OutputStream ostr, CompilationEnvironment env, Element root) {
         if ("false".equals(props.getProperty(env.LINK_PROPERTY))) {
@@ -259,6 +263,7 @@
         // runtime) from props arg to CompilationEnvironment
         String runtime = props.getProperty(env.RUNTIME_PROPERTY);
         boolean linking = (! "false".equals(env.getProperty(CompilationEnvironment.LINK_PROPERTY)));
+        boolean noCodeGeneration = "true".equals(env.getProperty(CompilationEnvironment.NO_CODE_GENERATION));
 
         if (runtime != null) {
             mLogger.info("canvas compiler compiling runtime = " + runtime);
@@ -391,6 +396,11 @@
                 );
             }
             Compiler.updateRootSchema(root, env, schema, externalLibraries);
+                        
+            if (noCodeGeneration) {
+                return null;
+            }
+            
             Properties nprops = (Properties) env.getProperties().clone();
             Map compileTimeConstants = new HashMap();
             compileTimeConstants.put("$debug", new Boolean(

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -596,6 +596,15 @@
         return (ClassModel) mClassMap.get(elementName);
     }
 
+    /**
+     * @return a readonly {@link Map} with all of the {@link ClassModel}
+     * instances known by this {@link ViewSchema}, indexed by their
+     * {@link String} names.
+     */
+    public Map getClassMap() {
+        return Collections.unmodifiableMap(mClassMap);
+    }
+
     public String toLZX() {
       return toLZX("");
     }

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ConditionalState.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ConditionalState.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ConditionalState.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -3,7 +3,7 @@
  * ****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2006-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2006-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -16,7 +16,7 @@
 /**
 
  */
-class ConditionalState {
+public class ConditionalState {
 
     static private Logger logger = Logger.getLogger("org.openlaszlo.js2doc");
 

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -24,9 +24,9 @@
 
     static private Logger logger = Logger.getLogger("org.openlaszlo.js2doc");
 
-    static class InternalError extends RuntimeException {
+    public static class InternalError extends RuntimeException {
 
-        SimpleNode node;
+        public SimpleNode node;
         
         /** Constructs an instance.
          * @param message a string
@@ -158,7 +158,7 @@
             node.setAttribute(attr, oldvalue + " " + value.trim());
     }
 
-    static void describeConditionalState(ConditionalState state, org.w3c.dom.Element docNode) {
+    public static void describeConditionalState(ConditionalState state, org.w3c.dom.Element docNode) {
         if (state.inferredValue == ConditionalState.indeterminateValue) {
             Set includeSet = new HashSet();
             Set excludeSet = new HashSet();
@@ -242,7 +242,7 @@
         return classPrefix + propertyName + conditionSuffix;
     }
     
-    static String optionsToString(Collection options) {
+    public static String optionsToString(Collection options) {
         List c = new ArrayList(options);
         Collections.sort(c);
         String s = "";
@@ -266,7 +266,7 @@
             return "";
     }
     
-    static void debugPrintNode(SimpleNode parseNode) {
+    public static void debugPrintNode(SimpleNode parseNode) {
         debugPrintNode(parseNode, 0, 0);
     }
     
@@ -281,7 +281,7 @@
         }
     }
 
-    static void checkChildrenLowerBounds(SimpleNode node, int min, int expectedMax, String methodName) {
+    public static void checkChildrenLowerBounds(SimpleNode node, int min, int expectedMax, String methodName) {
         SimpleNode[] children = node.getChildren();
 
         if (children.length < min) {

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/utils/DeploySOLODHTML.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/utils/DeploySOLODHTML.java	2008-05-07 16:21:16 UTC (rev 9030)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/utils/DeploySOLODHTML.java	2008-05-07 18:02:56 UTC (rev 9031)
@@ -124,10 +124,12 @@
             org.openlaszlo.compiler.Compiler compiler = new org.openlaszlo.compiler.Compiler();
 
             //FIXME: this may create temp file anywhere
-            String mediaCacheDir = LPS.getWorkDirectory() + File.separator + "cache" + File.separator + "cmcache";
-            CompilerMediaCache cache = new CompilerMediaCache(new File(mediaCacheDir), new Properties());
+            File cacheDir = File.createTempFile("cmcache", "", null);
+            cacheDir.delete();
+            cacheDir.mkdir();
+            cacheDir.deleteOnExit();
+            CompilerMediaCache  cache = new CompilerMediaCache(cacheDir, new Properties());
             compiler.setMediaCache(cache);
-            LPS.initialize();
 
             canvas = compiler.compile(sourcefile, tempFile, compilationProperties);
         }
@@ -154,7 +156,7 @@
             "lps=\"" + lpspath + "\" " +
             "url=\"" + url + "\" " +
             "/>";
-        
+
         String canvasXML = canvas.getXML(request);
         Properties properties = new Properties();
         TransformUtils.applyTransform(styleSheetPathname, properties, canvasXML, wrapperbuf);



More information about the Laszlo-checkins mailing list