Picon
Gravatar

Microphone.getEnhancedMicrophone(); throws compiler error

Hi,

the script
Microphone.getEnhancedMicrophone();

throws a compiler error that there is a static reference to .. I guess
non existing method.

Microphone.getMicrophone();

works. However, that is of course no "enhancedMicrophone" then.

Anybody got an idea how to solve or workaround that?

Sebastian

--

-- 
Sebastian Wagner
http://www.openmeetings.de
http://incubator.apache.org/openmeetings/
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner <at> gmail.com

Will Daniels | 3 Feb 02:42
Picon

Re: Microphone.getEnhancedMicrophone(); throws compiler error

Hi! I think it has to do with the fact the Laszlo is not currently compiled against the latest Flex SDK, so none of the new classes seem to be available.

Raju and I are working on that...but help is always appreciated :)

On Thu, Feb 2, 2012 at 11:00 AM, seba.wagner <at> gmail.com <seba.wagner <at> gmail.com> wrote:
Hi,

the script
Microphone.getEnhancedMicrophone();

throws a compiler error that there is a static reference to .. I guess
non existing method.

Microphone.getMicrophone();

works. However, that is of course no "enhancedMicrophone" then.

Anybody got an idea how to solve or workaround that?

Sebastian

--
Sebastian Wagner
http://www.openmeetings.de
http://incubator.apache.org/openmeetings/
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner <at> gmail.com

Frank Guo | 3 Feb 11:34
Favicon

LPP-10129 bug fixing

 
Summary: Fix lazyreplicator.insertNode(), classroot

New Features:

Bugs Fixed: LPP-10129
 

Documentation:

Release Notes:

Overview:

when compiling file include user type definition to lzo,
there are some generated code out side the XML.

Details:
TypeCompiler.java

It is because the TypeCompiler generate the lzs code when it resolve the type element. 
The moment is too early, so the lzs code for user type declaration  will appear at the top of lzo file. 
But the compile method of  TypeCompiler  is empty, so it will not generate any code, when compile the type element.

 

Files:
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/TypeCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java

After tracing the OL code, I found the reason of LPP-10129, the lzo problem. 


It is because the TypeCompiler generate the lzs code when resolve the the type element. 
The moment is too early, so the lzs code for user  type declaration  will appear at the top of lzo file. 
But the compile method of  TypeCompiler  is empty, so it will not generate any code, when compile the type element.

I read the code of ClassCompiler,  use the idea of it. I added the content of compile method of TypeCompiler, move the code that can generate lzs code from resolve method to compile method. 

After some basic test, I found it works well. Do you think we can fix the bug like this. 

I attach the file I had changed, I add a method to ViewSchema class, to get Type Class model.  

 

thanks 


frank 

Attachment (TypeCompiler.java): text/x-java, 5078 bytes
Attachment (ViewSchema.java): text/x-java, 33 KiB
Index: compiler/TypeCompiler.java
===================================================================
--- compiler/TypeCompiler.java	(revision 19507)
+++ compiler/TypeCompiler.java	(working copy)
@@ -47,10 +47,15 @@

     @Override
     public ClassModel resolve(CompilationEnvironment env)
-         throws CompilationError
-      {
+         throws CompilationError {
+             
         if (resolved) { return this; }
         resolved = true;
+        return this;
+    }
+    
+    protected void compile(CompilationEnvironment env, boolean force) {
+    
         String typename = XMLUtils.requireAttributeValue(definition, "name");
         LinkedHashMap<String, Object> instanceAttributes = new LinkedHashMap<String, Object>();
         LinkedHashMap<String, Object> classAttributes = new LinkedHashMap<String, Object>();
@@ -70,12 +75,11 @@
               "The tag '" + childName + "' cannot be used as a child of <type>", definition);
           }
         }
-        classAttributes.put("lzxtype", ScriptCompiler.quote(typename));
+        classAttributes.put("lzxtype", ScriptCompiler.quote(typename));    	
         ScriptClass scriptClass = new ScriptClass(className, "$lz$class_PresentationType", null,
instanceAttributes, classAttributes, "", "class");
         env.compileScript(scriptClass.toString(), definition);
         env.compileScript("lz.Type.addType('" + typename + "', new " + className + "());");
-        return this;
-      }
+    }
   }

     /**
@@ -103,8 +107,18 @@
     }

     @Override
-    public void compile(Element element)
-    {
+    public void compile(Element element) {
+    
+        String tagName = element.getAttributeValue("name");
+        if (tagName.equals("anonymous")) {
+              CompilationError cerr = new CompilationError(
+                  "The type 'anonymous' is reserved for system use, please choose another class name"
+                  , element);
+              throw(cerr);
+        }        
+              
+        ClassModel classModel = mEnv.getSchema().getInstanceTypeClassModel(element);
+        classModel.compile(mEnv, true);
     }
 }

Index: compiler/ViewSchema.java
===================================================================
--- compiler/ViewSchema.java	(revision 19507)
+++ compiler/ViewSchema.java	(working copy)
@@ -19,6 +19,7 @@
 import org.jdom.Element;
 import org.jdom.JDOMException;
 import org.openlaszlo.xml.internal.Schema;
+import org.openlaszlo.xml.internal.XMLUtils;
 import org.openlaszlo.utils.ChainedException;
 import org.openlaszlo.server.*;

@@ -341,6 +342,16 @@
       }
       return model;
     }
+    
+    ClassModel getInstanceTypeClassModel(Element element) {
+        String kind = KIND_TYPE;
+        String typename = XMLUtils.requireAttributeValue(element, "name");
+        ClassModel model = getClassModel(kind, typename);
+        if (model == null ) {
+          throw new CompilationError("no type"+typename, element);
+        }
+        return model;
+  }

   ClassModel getInstanceClassModel(Element element) {
     return getInstanceClassModel(element, true);
P T Withington | 3 Feb 17:10
Picon
Favicon
Gravatar

Re: LPP-10129 bug fixing

This looks great Frank.  I don't know why I thought I should compile the type in the resolve step.  I think I was
worried that types needed to be defined very early on, but it seems not necessary now, because I think there
is a later step in the compiler that re-orders definitions to avoid forward references.

Nice work!

On 2012-02-03, at 05:34, Frank Guo wrote:

>  
> Summary: Fix lazyreplicator.insertNode(), classroot 
> 
> New Features: 
> 
> Bugs Fixed: LPP-10129
>   
> 
> Documentation: 
> 
> Release Notes: 
> 
> Overview: 
> 
> when compiling file include user type definition to lzo, 
> there are some generated code out side the XML.
> 
> Details: 
> TypeCompiler.java
> 
> It is because the TypeCompiler generate the lzs code when it resolve the type element.  
> The moment is too early, so the lzs code for user type declaration  will appear at the top of lzo file.  
> But the compile method of  TypeCompiler  is empty, so it will not generate any code, when compile the type
element. 
> 
>  
> 
> Files: 
> M       WEB-INF/lps/server/src/org/openlaszlo/compiler/TypeCompiler.java
> M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
> 
> After tracing the OL code, I found the reason of LPP-10129, the lzo problem.  
> 
> 
> It is because the TypeCompiler generate the lzs code when resolve the the type element.  
> The moment is too early, so the lzs code for user  type declaration  will appear at the top of lzo file.  
> But the compile method of  TypeCompiler  is empty, so it will not generate any code, when compile the type
element. 
> 
> I read the code of ClassCompiler,  use the idea of it. I added the content of compile method of TypeCompiler,
move the code that can       generate lzs code from resolve method to compile method.  
> 
> After some basic test, I found it works well. Do you think we can fix the bug like this.  
> 
> I attach the file I had changed, I add a method to ViewSchema class, to get Type Class model.   
> 
>   
> 
> thanks  
> 
> 
> frank  
> 
> <TypeCompiler.java><ViewSchema.java><diff.txt>

Raju Bitter | 3 Feb 18:45

Re: [Laszlo-user] Microphone.getEnhancedMicrophone(); throws compiler error

Are you looking for the acoustic echo cancellation feature? That has
been added with FP 10.3 - and OpenLaszlo only supports 10.1.
http://groups.adobe.com/index.cfm?event=post.display&postid=35211

I'm going to share the information on upgrading the Flex SDK through
Google Docs, will post the link here later.

- Raju

On Fri, Feb 3, 2012 at 11:56 AM, seba.wagner <at> gmail.com
<seba.wagner <at> gmail.com> wrote:
> Hm,
>
> okay, where do you commit your results to?
>
> Sebastian
>
>
> 2012/2/3 Will Daniels <willops79 <at> gmail.com>
>>
>> Hi! I think it has to do with the fact the Laszlo is not currently
>> compiled against the latest Flex SDK, so none of the new classes seem to be
>> available.
>>
>> Raju and I are working on that...but help is always appreciated :)
>>
>>
>> On Thu, Feb 2, 2012 at 11:00 AM, seba.wagner <at> gmail.com
>> <seba.wagner <at> gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> the script
>>> Microphone.getEnhancedMicrophone();
>>>
>>> throws a compiler error that there is a static reference to .. I guess
>>> non existing method.
>>>
>>> Microphone.getMicrophone();
>>>
>>> works. However, that is of course no "enhancedMicrophone" then.
>>>
>>> Anybody got an idea how to solve or workaround that?
>>>
>>> Sebastian
>>>
>>> --
>>> Sebastian Wagner
>>> http://www.openmeetings.de
>>> http://incubator.apache.org/openmeetings/
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner <at> gmail.com
>>
>>
>
>
>
> --
> Sebastian Wagner
> http://www.openmeetings.de
> http://incubator.apache.org/openmeetings/
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner <at> gmail.com

Raju Bitter | 3 Feb 22:41

OpenLaszlo and Git - dealing with SVN dependencies in build scripts

Has anyone ever tried to replace the SVN dependencies in the
build-tools/build-opt.xml with compatible Git commands? Or how did you
go about building OpenLaszlo running on Git instead of SVN?

Picon
Gravatar

Re: [Laszlo-user] Microphone.getEnhancedMicrophone(); throws compiler error

Hi Raju,

did you had a chance to publish the docs somewhere? Or are those actually already somewhere in the wiki?

Thanks,
Sebastian

2012/2/3 Raju Bitter <r.bitter.mailinglists <at> googlemail.com>
Are you looking for the acoustic echo cancellation feature? That has
been added with FP 10.3 - and OpenLaszlo only supports 10.1.
http://groups.adobe.com/index.cfm?event=post.display&postid=35211

I'm going to share the information on upgrading the Flex SDK through
Google Docs, will post the link here later.

- Raju

On Fri, Feb 3, 2012 at 11:56 AM, seba.wagner <at> gmail.com
<seba.wagner <at> gmail.com> wrote:
> Hm,
>
> okay, where do you commit your results to?
>
> Sebastian
>
>
> 2012/2/3 Will Daniels <willops79 <at> gmail.com>
>>
>> Hi! I think it has to do with the fact the Laszlo is not currently
>> compiled against the latest Flex SDK, so none of the new classes seem to be
>> available.
>>
>> Raju and I are working on that...but help is always appreciated :)
>>
>>
>> On Thu, Feb 2, 2012 at 11:00 AM, seba.wagner <at> gmail.com
>> <seba.wagner <at> gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> the script
>>> Microphone.getEnhancedMicrophone();
>>>
>>> throws a compiler error that there is a static reference to .. I guess
>>> non existing method.
>>>
>>> Microphone.getMicrophone();
>>>
>>> works. However, that is of course no "enhancedMicrophone" then.
>>>
>>> Anybody got an idea how to solve or workaround that?
>>>
>>> Sebastian
>>>
>>> --
>>> Sebastian Wagner
>>> http://www.openmeetings.de
>>> http://incubator.apache.org/openmeetings/
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner <at> gmail.com
>>
>>
>
>
>
> --
> Sebastian Wagner
> http://www.openmeetings.de
> http://incubator.apache.org/openmeetings/
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner <at> gmail.com



--
Sebastian Wagner
http://www.openmeetings.de
http://incubator.apache.org/openmeetings/
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner <at> gmail.com
Daniel Ju | 8 Feb 04:24
Favicon

[laszlo-dev] Add test cases for lzo compiler of <type/>

Change dju-20120207-PiR by dju <at> dju-laptop on 2012-02-07 16:19:17 CST 
    in /home/dju/src/svn/openlaszlo/trunk 
    for http://svn.openlaszlo.org/openlaszlo/trunk 

Summary: Add test cases for <type/> lzo compilation in lztest suite 

New Features: 

Bugs Fixed: LPP-10134 

Technical Reviewer: fguo 
QA Reviewer: dju 
Doc Reviewer: 

Documentation: 

Release Notes: 

Overview: 
Added special test cases in lztest test suite for <type/> lzo 
compilation check 
     
Details: 
Added 2 test cases 
Test point: 
1. The <type/> can be compiled to lzo successfully 
2. The lzo should work as expectation format (see LPP-10129 issue) 

Tests: 
ant lztest 

Files: 
A test/lztest/lzotype 
A test/lztest/lzotype/lztest-type.lzx 
A test/lztest/lzotype/lztest-type-include 
A test/lztest/lzotype/lztest-type-include/lztest-type-include.lzx 
A test/lztest/lzotype/lztest-type-include/lztest-type-include.benchmark 
A test/lztest/lzotype/lztest-type.benchmark 
M build-tools/runlztest.sh 
A build-tools/type-lzo-test.sh 

 
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/dju-20120207-PiR.tar  

Thanks,
Daniel Ju

Picon
Gravatar

Re: [Laszlo-user] Microphone.getEnhancedMicrophone(); throws compiler error

I think some information is also provided in this Issue report:
http://jira.openlaszlo.org/jira/browse/LPP-9081

It includes the SVN log of the an update of the Flex Compiler.

I think this issue:
http://jira.openlaszlo.org/jira/browse/LPP-9903
can be closed, as there is already Flex 4.6 available.

However, for me it seems like upgrading Flex doesn't require many source code changes in the OpenLaszlo framework.
As far as I can see only this file is concerned:
/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java

So this file here:
http://www.openlaszlo.org/svn/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
=>I think SWF9External.java sets a number of compiler options to trigger the flex-sdk-compiler.

The rest of the updated files seem like a copy/update/compare of needed JARs,executables and other library stuff of the Flex SDK.
So, if there are no changes in the way Flex works and for example how it does does throw compiler errors, the update should potentially work.

Are there other known obstacles that need to be addressed?

Sebastian

2012/2/7 seba.wagner <at> gmail.com <seba.wagner <at> gmail.com>
Hi Raju,

did you had a chance to publish the docs somewhere? Or are those actually already somewhere in the wiki?

Thanks,
Sebastian


2012/2/3 Raju Bitter <r.bitter.mailinglists <at> googlemail.com>
Are you looking for the acoustic echo cancellation feature? That has
been added with FP 10.3 - and OpenLaszlo only supports 10.1.
http://groups.adobe.com/index.cfm?event=post.display&postid=35211

I'm going to share the information on upgrading the Flex SDK through
Google Docs, will post the link here later.

- Raju

On Fri, Feb 3, 2012 at 11:56 AM, seba.wagner <at> gmail.com
<seba.wagner <at> gmail.com> wrote:
> Hm,
>
> okay, where do you commit your results to?
>
> Sebastian
>
>
> 2012/2/3 Will Daniels <willops79 <at> gmail.com>
>>
>> Hi! I think it has to do with the fact the Laszlo is not currently
>> compiled against the latest Flex SDK, so none of the new classes seem to be
>> available.
>>
>> Raju and I are working on that...but help is always appreciated :)
>>
>>
>> On Thu, Feb 2, 2012 at 11:00 AM, seba.wagner <at> gmail.com
>> <seba.wagner <at> gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> the script
>>> Microphone.getEnhancedMicrophone();
>>>
>>> throws a compiler error that there is a static reference to .. I guess
>>> non existing method.
>>>
>>> Microphone.getMicrophone();
>>>
>>> works. However, that is of course no "enhancedMicrophone" then.
>>>
>>> Anybody got an idea how to solve or workaround that?
>>>
>>> Sebastian
>>>
>>> --
>>> Sebastian Wagner
>>> http://www.openmeetings.de
>>> http://incubator.apache.org/openmeetings/
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner <at> gmail.com
>>
>>
>
>
>
> --
> Sebastian Wagner
> http://www.openmeetings.de
> http://incubator.apache.org/openmeetings/
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner <at> gmail.com



--
Sebastian Wagner
http://www.openmeetings.de
http://incubator.apache.org/openmeetings/
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner <at> gmail.com



--
Sebastian Wagner
http://www.openmeetings.de
http://incubator.apache.org/openmeetings/
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner <at> gmail.com
Frank Guo | 8 Feb 17:03
Favicon

How to generate uncompressed javascript

Hi Tucker / Max,

I want to fix some javascript bugs by using debug tools of browsers,
like firebug.
But I found it's difficult to debug compressed javascript.
Do you have way to make OL generated uncompressed js,
especially LFC kernel classes, like LzSprite.
They are written in js, but the OL make them unreadable.

Do you have any method to make them maintain their original format?

Thanks a lot
Frank


Gmane