OL 4.2: NetRemotecalls annihilated?

View: New views
4 Messages — Rating Filter:   Alert me  

OL 4.2: NetRemotecalls annihilated?

by Tim Dauer :: Rate this Message:

| View Threaded | Show Only this Message

Hi List!

Until last friday I used to proxy my applications in OpenLaszlo 4.0.11 -
most things worked fine, but I missed some fearures. This monday the
idea came up to update the programcode to OL 4.2 and I followed the
migration guide on the OL website. As I killed the main issues referred
on that site, I had a look at about 16 compilation warnings that said:

"The tag 'netremotecall' cannot be used as a child of rtmpconnection"

So I looked into the rtmpconnection class (where the netremotecall was
located in 4.0.xx) but there was no class declaration of the netremotecall.

Hard to believe, but: Is the feature of netremotecalls abandoned or am I
looking at the wrong place?

Greets
Tim

Re: OL 4.2: NetRemotecalls annihilated?

by Henry Minsky-2 :: Rate this Message:

| View Threaded | Show Only this Message

It looks like the netremotecall class was not ported to 4.2.

I made the following modifications to get it to compile in swf9. Note
that I had to change
the name of the "call" method to "callmethod" because the name 'call'
conflicts with the builtin 'call'
javascript method.

Try the attached file in place of the
lps/components/extensions/av/rtmpconnection.lzx, and see
if it works for you.



    <class name="netremotecall" extends="node">
        <!--- Name of the remote function. -->
        <attribute name="funcname" value="$once{null}" type="string" />
        <attribute name="remotecontext" value="null" />
        <attribute name="dataobject" value="null" />

        <!--- Call the remote method, passing the array of params. -->
        <method name="callmethod" args="params"><![CDATA[
            if (this.funcname == null) {
                Debug.write("No funcname given");
                if (this.onerror) {
                    this.onerror.sendEvent("No funcname given");
                }
                return;
            }

            if (params == null) {
                params = [];

                var subnodes = this.subnodes;
                if (subnodes != null) {
                    var i;
                    var n = subnodes.length;
                    for (i = 0; i < n; i++) {
                        // If getValue method is declared in param, call that
                        // instead to get value.
                        var tsi = subnodes[i];
                        if ((tsi["getValue"] != null) &&
                            (tsi.getValue["prototype"] != null)) {
                            params[i] = tsi.getValue();
                        } else {
                            params[i] = tsi.value;
                        }
                    }
                }

            } else if (params instanceof Array) {
                Debug.write(this.name, "error: first argument (params)
is not an array");
                return -1;
            }
            var rtmpObject = null;
            if (this.parent instanceof lz.rtmpconnection){
                rtmpObject = this.parent;
            } else if(this.remotecontext  instanceof lz.rtmpconnection){
                rtmpObject = this.remotecontext;
            } else {
                Debug.write("ERROR: no remotecontext availible abort call");
            }

            //Debug.write("call", this, this.parent, this.parent.status);

            if (parent.status == "connected"){
                parent.call(this.funcname, this, params);
            }

          ]]>
        </method>


        <!--- Handle the result returned from the remote method. -->
        <method name="onResult" args="value"><![CDATA[
            // Can be overriden.
            // Would be great if it can be used with dataobject,
            // but I don't know how to convert Array/primitive to
LzDataset/LzDataPointer.
            //Debug.write("onResult: ",this,value,dataobject);
            if (this.dataobject!=null) this.dataobject.valueToElement(value);
            this.ondata.sendEvent(value);
          ]]>
        </method>


    </class>


    <!---
        Net parameter.
        Element to use inside netremotecall.
        @todo Document netparam class.
    -->
    <class name="netparam" extends="node">

        <!--- The value of the netparam. -->
        <attribute name="value" value="null"/>

    </class>


On Thu, Feb 5, 2009 at 4:00 AM, Tim Dauer <tim.dauer@...> wrote:

> Hi List!
>
> Until last friday I used to proxy my applications in OpenLaszlo 4.0.11 -
> most things worked fine, but I missed some fearures. This monday the idea
> came up to update the programcode to OL 4.2 and I followed the migration
> guide on the OL website. As I killed the main issues referred on that site,
> I had a look at about 16 compilation warnings that said:
>
> "The tag 'netremotecall' cannot be used as a child of rtmpconnection"
>
> So I looked into the rtmpconnection class (where the netremotecall was
> located in 4.0.xx) but there was no class declaration of the netremotecall.
>
> Hard to believe, but: Is the feature of netremotecalls abandoned or am I
> looking at the wrong place?
>
> Greets
> Tim
>


--
Henry Minsky
Software Architect
hminsky@...


rtmpconnection.lzx (20K) Download Attachment

Re: OL 4.2: NetRemotecalls annihilated?

by Tobias Wolf-2 :: Rate this Message:

| View Threaded | Show Only this Message

Henry Minsky schrieb:
> It looks like the netremotecall class was not ported to 4.2.
>
Can anyone explain, if there was a special reason for this? Is this feature so
rarely in use?

For myself, it seems a great thing to be able to do server-side function calls,
in order to give a client updated information. This feature was one reason for
choosing this technology, otherwise the same could be achieved with standard
Web2.0 techniques and asking the server every 5 secs if something interesting
has happened, but this seems for me like a waste of bandwith.

But it is good to hear, that there seems to be a way to use netremotecalls also
in 4.2. So we do not have to get stuck at an older version ...

Kind regards,

--

   Tobias Wolf


Re: OL 4.2: NetRemotecalls annihilated?

by seba.wagner@gmail.com :: Rate this Message:

| View Threaded | Show Only this Message

hi,

I contributed some parts of the netremotecall. I ported it to SWF8 in LPS-4.2.x in openmeetings but I never tested with SWF9.

OM-Version of netremotecall:
http://openmeetings.googlecode.com/svn/trunk/client/base/remote/rtmpConnection.lzx

There is also a slightly modified version in the red5phone:
http://red5phone.googlecode.com/svn/branches/webapp_rework/webapp/sip/lps4_2/base/remote/rtmpConnection.lzx

the second one includes a Fix so that you can also push multiple params to a client function.


sebastian

2009/2/10 Tobias Wolf <tobias.wolf@...>
Henry Minsky schrieb:

It looks like the netremotecall class was not ported to 4.2.

Can anyone explain, if there was a special reason for this? Is this feature so rarely in use?

For myself, it seems a great thing to be able to do server-side function calls, in order to give a client updated information. This feature was one reason for choosing this technology, otherwise the same could be achieved with standard Web2.0 techniques and asking the server every 5 secs if something interesting has happened, but this seems for me like a waste of bandwith.

But it is good to hear, that there seems to be a way to use netremotecalls also in 4.2. So we do not have to get stuck at an older version ...

Kind regards,

--

 Tobias Wolf




--
Sebastian Wagner
http://www.webbase-design.de
http://openmeetings.googlecode.com
http://www.laszlo-forum.de
seba.wagner@...