I think we need to remove that <switch> altogether, and write the 
implementation instead in a style like this:

  <class name="rtmp">
     <handler name="oninit">
        if ($as3) {
          ;
        } else if ($debug) {
          Debug.error("RTMP service is not available in this runtime");
        }
     </handler>

    etc.

Another approach would be to write the component like drawview, by writing an 
interface that specifies the schema and then having a totally script 
implementation of the class:

  if ($as3)
    class $lzc$class_rtmp { ... }
  } else if ($debug) {
    Debug.error ("RTMP service is not available in this runtime");
  }

Clearly this latter would be easier if we had better support for writing tag 
classes in script that did not require wizard knowledge about the boilerplate 
and naming conventions.

On 2010-10-07, at 23:24, Henry Minsky wrote:

> approved.
> 
> That gets rid of the <switch>  statement for Flash runtimes, but we still
> have to come up with a workaround for the remaining <switch> clause which is
> at the start of most of the av components which nulls out the code for
> DHTML.
> 
>  <switch>
>    <when runtime="dhtml">
>      <!-- no support for RTMP in DHTML -->
>    </when>
>    <otherwise>
> 
> I can't think of anything really clever right now. Maybe we need a flavor of
> <switch> which compiles all of it's clauses into script blocks
> conditionalized as  "if ($something) ... " , as opposed to the way it works
> now where the parser evaluates the <switch> conditions at parse time.
> 
> 
> 
> On Thu, Oct 7, 2010 at 9:45 PM, Max Carlson <[email protected]> wrote:
> 
>> Change maxcarlson-20101007-pI7 by [email protected] on 2010-10-07
>> 19:42:47 MDT
>>   in /Users/maxcarlson/openlaszlo/trunk2
>>   for http://svn.openlaszlo.org/openlaszlo/trunk
>> 
>> Summary: Use <passthrough when=""> instead of <switch> in components
>> 
>> Bugs Fixed: lPP-4932 - Use <passthrough when=""> instead of <switch> in
>> components
>> 
>> Technical Reviewer: hminsky
>> QA Reviewer: mdemmon
>> 
>> Details: I'm going to check this in, hoping it makes LZOs that include
>> components.
>> 
>> Move passthroughs outside switch statements.
>> 
>> Tests: Visual inspection.
>> 
>> Files:
>> M       lps/components/incubator/uploader/fileupload.lzx
>> M       lps/components/extensions/printer.lzx
>> M       lps/components/extensions/av/microphone.lzx
>> M       lps/components/extensions/av/camera.lzx
>> M       lps/components/extensions/av/mediastream.lzx
>> M       lps/components/extensions/av/mediadevice.lzx
>> M       lps/components/extensions/av/videoview.lzx
>> M       lps/components/extensions/av/rtmpconnection.lzx
>> M       lps/components/utils/diagnostic/inspector/inspector.lzx
>> M       lps/components/utils/diagnostic/memorymonitor.lzx
>> M       lps/components/av/videoscreen.lzx
>> 
>> Changeset:
>> http://svn.openlaszlo.org/openlaszlo/patches/maxcarlson-20101007-pI7.tar
>> 
> 
> 
> 
> -- 
> Henry Minsky
> Software Architect
> [email protected]


Reply via email to