flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com.INVALID>
Subject Re: Remote object for Flex JS
Date Fri, 01 Sep 2017 18:38:06 GMT
Hi Folks,

I just pushed changes that include a back port of amf.js to ActionScript.
In doing so, the AMF code now uses the Reflection APIs that Greg Dove
contributed.  The test still only passes a String to the server, but in
doing so, it has to wrap the String in an AsyncMessage subclass and I
think I have watched the AMF code correctly serialize and deserialize
those FlexJS classes to AMF and back.

Next step is to try it with an actual ValueObject.  Can someone help with
what changes would need to be made to the service to handle a custom Java
class instead of just a String?

One other note:  In doing the back port, I created an AMFBinaryData that
works like BinaryData, but doesn't subclass it.  That's because it appears
to me that APIs like writeUTF do differently things.  Maybe we can factor
out some common base class at some point.  But I think you can now use
AMFBinaryData.writeObject/readObject to clone objects like we do with
ByteArray.  AMFBinaryData is currently only for JS, but I think it could
easily have SWF code that writes to a ByteArray added to it.

Thanks,
-Alex

On 8/23/17, 10:32 AM, "Alex Harui" <aharui@adobe.com.INVALID> wrote:

>Hi Prashant,
>
>The AMF work is in a separate branch so make sure you get the latest code.
> Maybe Piotr or another volunteer will merge the branch into develop so it
>appears in the nightly.
>
>-Alex
>
>On 8/23/17, 9:52 AM, "PKumar" <prashakumar@gmail.com> wrote:
>
>>Sure, I will download the FlexJS nightly build and check it.
>>
>>On 23-Aug-2017 10:01 PM, "Alex Harui-2 [via Apache Flex Users]" <
>>ml+s2333346n15807h2@n4.nabble.com> wrote:
>>
>>> Hi Prashant,
>>>
>>> If you could add to RemoteObjectAMFTest and SampleAmfWebApp to work
>>>with
>>> an actual ValueObject, that would be great!
>>>
>>> Thanks,
>>> -Alex
>>>
>>> On 8/23/17, 9:21 AM, "PKumar" <[hidden email]
>>> <http:///user/SendEmail.jtp?type=node&node=15807&i=0>> wrote:
>>>
>>> >Really great Alex,  if you  need my help in testing  or creating demo.
>>>Do
>>> >please let me know.
>>> >
>>> >On 23-Aug-2017 9:46 PM, "Alex Harui-2 [via Apache Flex Users]" <
>>> >[hidden email] <http:///user/SendEmail.jtp?type=node&node=15807&i=1>>
>>> wrote:
>>> >
>>> >> Hi Prashant,
>>> >>
>>> >> Yes, the RemoteObjectAMFTest only tries to send a String.  To handle
>>> >>true
>>> >> ValueObjects we would need to leverage the amfjs class mapping.  I
>>> added
>>> >> code to the compiler to generate a map for the [RemoteClass]
>>>metadata
>>> >>but
>>> >> I didn't hook that up on the JS side yet.  It sounds like the
>>>interest
>>> >>is
>>> >> in backporting amfjs to AS and make the API similar to regular Flex.
>>> In
>>> >> that case, I will refactor the amfjs class map to use the one in our
>>> >> Reflection library.
>>> >>
>>> >> -Alex
>>> >>
>>> >> On 8/23/17, 9:08 AM, "PKumar" <[hidden email]
>>> >> <http:///user/SendEmail.jtp?type=node&node=15804&i=0>>
wrote:
>>> >>
>>> >> >Alex,
>>> >> >
>>> >> >It will really great, if this works same or mostly similar as
>>>regular
>>> >> Flex
>>> >> >SDK.
>>> >> >
>>> >> >One more point on amfJS library , it also supports class mapping.
>>>It
>>> >>has
>>> >> >one method *registerClasses* that can be used for Java class to
>>>flex
>>> >> >mapping.
>>> >> >
>>> >> >On 23-Aug-2017 11:12 AM, "Alex Harui-2 [via Apache Flex Users]"
<
>>> >> >[hidden email]
>>><http:///user/SendEmail.jtp?type=node&node=15804&i=1>>
>>> >> wrote:
>>> >> >
>>> >> >> So, I played around with AMF today, adding SWF code for
>>> RemoteObject.
>>> >> >>For
>>> >> >> me, the RemoteObjectAMFTest in examples/flexjs is working against
>>> the
>>> >> >> SampleAmfWebApp in examples/amf for both SWF and JS.  I don't
>>>think
>>> I
>>> >> >>had
>>> >> >> to touch the JS code in amf.js.  That's better than I was
>>>expecting.
>>> >> >>Am I
>>> >> >> not doing something right or is there some other problem that
>>>needs
>>> >> >> solving?
>>> >> >>
>>> >> >> Some observations along the way:
>>> >> >>
>>> >> >> I was able to talk to the server in SWF code just by using
>>> >> >> NetConnection.call and passing in CommandMessages and
>>> >>RemotingMessages,
>>> >> >> but the amf.js code seems to be sending an ActionMessage wrapped
>>> >>around
>>> >> >> the CommandMessage and RemotingMessage.  Is that wrapping what
>>> >> >> NetConnection does?
>>> >> >>
>>> >> >> I'm tempted to try to refactor amf.js into several AS classes.
>>>Is
>>> >>that
>>> >> >> worth doing or are there bigger fish to fry?
>>> >> >>
>>> >> >> The amf.js code includes a Promise implementation.  If we
>>>refactor
>>> to
>>> >> >>AS,
>>> >> >> should we try to use promises or make the API more compatible
>>>with
>>> >> >>regular
>>> >> >> Flex?  I'm leaning towards compatibility with regular Flex.
>>> >> >>
>>> >> >> Thoughts?
>>> >> >> -Alex
>>> >> >>
>>> >> >> On 8/21/17, 11:02 AM, "Harbs" <[hidden email]
>>> >> >> <http:///user/SendEmail.jtp?type=node&node=15798&i=0>>
wrote:
>>> >> >>
>>> >> >> >There’s probably an advantage to converting it to FlexJS.
You
>>>could
>>> >> >> >probably leverage BinaryData for some of the functionality.
>>> >> >> >
>>> >> >> >You can also create typedefs if you want.
>>> >> >> >
>>> >> >> >> On Aug 21, 2017, at 8:53 PM, PKumar <[hidden email]
>>> >> >> <http:///user/SendEmail.jtp?type=node&node=15798&i=1>>
wrote:
>>> >> >> >>
>>> >> >> >> Alex,
>>> >> >> >>
>>> >> >> >> As per my analysis & testing, AMFJS supports following
>>>features:
>>> >> >> >>
>>> >> >> >> - All dataType serialization & deserialization
support
>>>including
>>> >> >> >>Object ,
>>> >> >> >> Vector
>>> >> >> >> -  Connection with BlazeDS
>>> >> >> >> - Conection with AMFPHP
>>> >> >> >> -  Class Mapping Support using Alias Name & Class
>>> >> >> >> -   Inbuilt support for sending AMF request  &
response
>>> >> >> >>
>>> >> >> >> I also checked James ward implementation but that
does  not
>>> >>support
>>> >> >> >>vector
>>> >> >> >> and blazeds connectivity.
>>> >> >> >>
>>> >> >> >> I prepared  a demo for class mapping and blazeDs connection.
>>>If
>>> >>you
>>> >> >> >>want to
>>> >> >> >> check, please let me know. I will share on github.
>>> >> >> >>
>>> >> >> >> one query i want  to ask , can we convert this amfJS
library
>>>to
>>> >> >>FlexJS
>>> >> >> >> Typedef  just like createJS library?
>>> >> >> >>
>>> >> >> >>
>>> >> >> >> Regards,
>>> >> >> >> Prashant
>>> >> >> >>
>>> >> >> >>
>>> >> >> >>
>>> >> >> >> -----
>>> >> >> >> Regards,
>>> >> >> >> Prashant
>>> >> >> >> --
>>> >> >> >> View this message in context:
>>> >> >> >>https://na01.safelinks.protection.outlook.com/?url=
>>> >> >> http%3A%2F%2Fapache-fl
>>> >> >>
>>> >>
>>> 
>>>>>>>>>ex-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-tp15510
>>>>>>>>>p
>>>>>>>>>15
>>>
>>> >>>>>>78
>>> >>
>>> >> >>>>2.
>>> >> >>
>>> >> >>
>>> >>
>>> 
>>>>>>>>>html&data=02%7C01%7C%7C1af098eb84194e4a169c08d4e8bebf0f%7Cfa7b1b5a
>>>>>>>>>7
>>>>>>>>>b3
>>>
>>> >>>>>>44
>>> >>
>>> >> >>>>38
>>> >> >>
>>> >> >>
>>> >>
>>> 
>>>>>>>>>794aed2c178decee1%7C0%7C0%7C636389353321386860&sdata=9Vgilc%2FEEN6
>>>>>>>>>e
>>>>>>>>>QE
>>>
>>> >>>>>>Gj
>>> >>
>>> >> >>>>Dw
>>> >> >>
>>> >> >> >>mmQV8N952XqBSbgweg1VQ41g4%3D&reserved=0
>>> >> >> >> Sent from the Apache Flex Users mailing list archive
at
>>> >>Nabble.com.
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> ------------------------------
>>> >> >> If you reply to this email, your message will be added to the
>>> >> discussion
>>> >> >> below:
>>> >> >>
>>> >> >>https://na01.safelinks.protection.outlook.com/?url=
>>> >> http%3A%2F%2Fapache-fl
>>> >>
>>> 
>>>>>>>ex-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-&data=02%
>>>>>>>7
>>>>>>>C0
>>>
>>> >>>>1%
>>> >>
>>> >>
>>> 
>>>>>>>7C%7C3a1ce1deff3f47dff8ef08d4ea413522%7Cfa7b1b5a7b34438794aed2c178de
>>>>>>>c
>>>>>>>ee
>>>
>>> >>>>1%
>>> >>
>>> >>
>>> 
>>>>>>>7C0%7C0%7C636391013164618149&sdata=%2FOcSNyohTV1%2FJaKe%2BgW%2BHspE%
>>>>>>>2
>>>>>>>FV
>>>
>>> >>>>%2
>>> >>
>>> >> >>FtaoyEdCq2YOzUmq4%3D&reserved=0
>>> >> >> tp15510p15798.html
>>> >> >> To start a new topic under Apache Flex Users, email
>>> >> >> [hidden email]
>>><http:///user/SendEmail.jtp?type=node&node=15804&i=2>
>>>
>>> >> >> To unsubscribe from Apache Flex Users, click here
>>> >> >>
>>> >> >><https://na01.safelinks.protection.outlook.com/?url=
>>> >> http%3A%2F%2Fapache-f
>>> >>
>>> 
>>>>>>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro
>>>>>>>%
>>>>>>>3D
>>>
>>> >>>>un
>>> >>
>>> >>
>>> 
>>>>>>>subscribe_by_code%26node%3D1%26code%3DcHJhc2hha3VtYXJAZ21haWwuY29tfD
>>>>>>>F
>>>>>>>8L
>>>
>>> >>>>TU
>>> >>
>>> >>
>>> 
>>>>>>>0MTcyMzE2NA&data=02%7C01%7C%7C3a1ce1deff3f47dff8ef08d4ea413522%7Cfa7
>>>>>>>b
>>>>>>>1b
>>>
>>> >>>>5a
>>> >>
>>> >>
>>> 
>>>>>>>7b34438794aed2c178decee1%7C0%7C0%7C636391013164618149&sdata=oG9TQOL2
>>>>>>>W
>>>>>>>HD
>>>
>>> >>>>Im
>>> >>
>>> >> >>7ixmXea4gFCoUw4j8b0HUsYOw7f4Pk%3D&reserved=0==>
>>> >> >> .
>>> >> >> NAML
>>> >> >>
>>> >> >><https://na01.safelinks.protection.outlook.com/?url=
>>> >> http%3A%2F%2Fapache-f
>>> >>
>>> 
>>>>>>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro
>>>>>>>%
>>>>>>>3D
>>>
>>> >>>>ma
>>> >>
>>> >>
>>> 
>>>>>>>cro_viewer%26id%3Dinstant_html%2521nabble%253Aemail.naml%26base%3Dna
>>>>>>>b
>>>>>>>bl
>>>
>>> >>>>e.
>>> >>
>>> >>
>>> 
>>>>>>>naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamesp
>>>>>>>a
>>>>>>>ce
>>>
>>> >>>>-n
>>> >>
>>> >>
>>> 
>>>>>>>abble.view.web.template.NodeNamespace%26breadcrumbs%3Dnotify_subscri
>>>>>>>b
>>>>>>>er
>>>
>>> >>>>s%
>>> >>
>>> >>
>>> 
>>>>>>>2521nabble%253Aemail.naml-instant_emails%2521nabble%253Aemail.naml-s
>>>>>>>e
>>>>>>>nd
>>>
>>> >>>>_i
>>> >>
>>> >>
>>> 
>>>>>>>nstant_email%2521nabble%253Aemail.naml&data=02%7C01%7C%7C3a1ce1deff3
>>>>>>>f
>>>>>>>47
>>>
>>> >>>>df
>>> >>
>>> >>
>>> 
>>>>>>>f8ef08d4ea413522%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636391
>>>>>>>0
>>>>>>>13
>>>
>>> >>>>16
>>> >>
>>> >>
>>> 
>>>>>>>4618149&sdata=IBL7nGCu8Fr2VJyGGJvN4eo2j3ciNKaqdMySmNqzEH8%3D&reserve
>>>>>>>d
>>>>>>>=0
>>>
>>> >>>>>
>>> >>
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >-----
>>> >> >Regards,
>>> >> >Prashant
>>> >> >--
>>> >> >View this message in context:
>>> >> >https://na01.safelinks.protection.outlook.com/?url=
>>> >> http%3A%2F%2Fapache-fle
>>> >> >x-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-
>>> >> tp15510p15803.ht
>>> >>
>>> 
>>>>>>ml&data=02%7C01%7C%7C3a1ce1deff3f47dff8ef08d4ea413522%7Cfa7b1b5a7b344
>>>>>>3
>>>>>>87
>>>
>>> >>>94
>>> >>
>>> >>
>>> 
>>>>>>aed2c178decee1%7C0%7C0%7C636391013164618149&sdata=J3LsrJ3Zxc%2FxglCYj
>>>>>>8
>>>>>>zw
>>>
>>> >>>cX
>>> >>
>>> >> >vDzIX9nCPn0S%2Brd%2BVE9O0%3D&reserved=0
>>> >> >Sent from the Apache Flex Users mailing list archive at Nabble.com.
>>> >>
>>> >>
>>> >>
>>> >> ------------------------------
>>> >> If you reply to this email, your message will be added to the
>>> discussion
>>> >> below:
>>> >>
>>> >>https://na01.safelinks.protection.outlook.com/?url=
>>> http%3A%2F%2Fapache-fl
>>> 
>>>>>ex-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-&data=02%7C
>>>>>0
>>>>>1%
>>>
>>> 
>>>>>7C%7Cf10440168a264ce4a83308d4ea42fce0%7Cfa7b1b5a7b34438794aed2c178dece
>>>>>e
>>>>>1%
>>>
>>> 
>>>>>7C0%7C0%7C636391020812650097&sdata=4dXIVzqiXbxllGLy9oymfR5lLMIhps6NQmj
>>>>>p
>>>>>8t
>>>
>>> >>VmRVo%3D&reserved=0
>>> >> tp15510p15804.html
>>> >> To start a new topic under Apache Flex Users, email
>>> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=15807&i=2>
>>> >> To unsubscribe from Apache Flex Users, click here
>>> >>
>>> >><https://na01.safelinks.protection.outlook.com/?url=
>>> http%3A%2F%2Fapache-f
>>> 
>>>>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro%3
>>>>>D
>>>>>un
>>>
>>> 
>>>>>subscribe_by_code%26node%3D1%26code%3DcHJhc2hha3VtYXJAZ21haWwuY29tfDF8
>>>>>L
>>>>>TU
>>>
>>> 
>>>>>0MTcyMzE2NA&data=02%7C01%7C%7Cf10440168a264ce4a83308d4ea42fce0%7Cfa7b1
>>>>>b
>>>>>5a
>>>
>>> 
>>>>>7b34438794aed2c178decee1%7C0%7C0%7C636391020812650097&sdata=4dcQPrPyC3
>>>>>p
>>>>>pE
>>>
>>> >>x36S3f%2B950UpNNwOJEfiG5e%2BGXpALg%3D&reserved=0==>
>>> >> .
>>> >> NAML
>>> >>
>>> >><https://na01.safelinks.protection.outlook.com/?url=
>>> http%3A%2F%2Fapache-f
>>> 
>>>>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro%3
>>>>>D
>>>>>ma
>>>
>>> 
>>>>>cro_viewer%26id%3Dinstant_html%2521nabble%253Aemail.naml%26base%3Dnabb
>>>>>l
>>>>>e.
>>>
>>> 
>>>>>naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespac
>>>>>e
>>>>>-n
>>>
>>> 
>>>>>abble.view.web.template.NodeNamespace%26breadcrumbs%3Dnotify_subscribe
>>>>>r
>>>>>s%
>>>
>>> 
>>>>>2521nabble%253Aemail.naml-instant_emails%2521nabble%253Aemail.naml-sen
>>>>>d
>>>>>_i
>>>
>>> 
>>>>>nstant_email%2521nabble%253Aemail.naml&data=02%7C01%7C%7Cf10440168a264
>>>>>c
>>>>>e4
>>>
>>> 
>>>>>a83308d4ea42fce0%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63639102
>>>>>0
>>>>>81
>>>
>>> 
>>>>>2650097&sdata=XnllokaW1joWP0zh%2Fy1zvmzruvn%2BneggkXh6xHdsunE%3D&reser
>>>>>v
>>>>>ed
>>>
>>> >>=0>
>>> >>
>>> >
>>> >
>>> >
>>> >
>>> >-----
>>> >Regards,
>>> >Prashant
>>> >--
>>> >View this message in context:
>>> >https://na01.safelinks.protection.outlook.com/?url=
>>> http%3A%2F%2Fapache-fle
>>> >x-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-
>>> tp15510p15805.ht
>>> 
>>>>ml&data=02%7C01%7C%7Cf10440168a264ce4a83308d4ea42fce0%7Cfa7b1b5a7b34438
>>>>7
>>>>94
>>>
>>> 
>>>>aed2c178decee1%7C0%7C0%7C636391020812650097&sdata=HBbOQ1Hn1n0lAG%2FGYHd
>>>>z
>>>>bg
>>>
>>> >vrwKxd8pWLrxm46FJSAnY%3D&reserved=0
>>> >Sent from the Apache Flex Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the
>>>discussion
>>> below:
>>> 
>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f
>>>l
>>>ex-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-&data=02%7C01
>>>%
>>>7C%7C5d32ae4db4c14fd8227a08d4ea476740%7Cfa7b1b5a7b34438794aed2c178decee1
>>>%
>>>7C0%7C0%7C636391039781390709&sdata=2zBxDD8UoNESAJZyvKWBerW8UiGUFbpCHf%2B
>>>n
>>>iUgm0aA%3D&reserved=0
>>> tp15510p15807.html
>>> To start a new topic under Apache Flex Users, email
>>> ml+s2333346n1h16@n4.nabble.com
>>> To unsubscribe from Apache Flex Users, click here
>>> 
>>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-
>>>f
>>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro%3Du
>>>n
>>>subscribe_by_code%26node%3D1%26code%3DcHJhc2hha3VtYXJAZ21haWwuY29tfDF8LT
>>>U
>>>0MTcyMzE2NA&data=02%7C01%7C%7C5d32ae4db4c14fd8227a08d4ea476740%7Cfa7b1b5
>>>a
>>>7b34438794aed2c178decee1%7C0%7C0%7C636391039781390709&sdata=u9qzMLM9zEaI
>>>C
>>>Vfd8TuFsLmf8Tjcw4G%2BEN6U2Jf35tc%3D&reserved=0==>
>>> .
>>> NAML
>>> 
>>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-
>>>f
>>>lex-users.2333346.n4.nabble.com%2Ftemplate%2FNamlServlet.jtp%3Fmacro%3Dm
>>>a
>>>cro_viewer%26id%3Dinstant_html%2521nabble%253Aemail.naml%26base%3Dnabble
>>>.
>>>naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-
>>>n
>>>abble.view.web.template.NodeNamespace%26breadcrumbs%3Dnotify_subscribers
>>>%
>>>2521nabble%253Aemail.naml-instant_emails%2521nabble%253Aemail.naml-send_
>>>i
>>>nstant_email%2521nabble%253Aemail.naml&data=02%7C01%7C%7C5d32ae4db4c14fd
>>>8
>>>227a08d4ea476740%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6363910397
>>>8
>>>1390709&sdata=AByKY5e%2BF3ekcVN7l1hKEfp0TkaMEy3p%2BSw7wuHHCzI%3D&reserve
>>>d
>>>=0>
>>>
>>
>>
>>
>>
>>-----
>>Regards,
>>Prashant
>>--
>>View this message in context:
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>>e
>>x-users.2333346.n4.nabble.com%2FRemote-object-for-Flex-JS-tp15510p15809.h
>>t
>>ml&data=02%7C01%7C%7C5d32ae4db4c14fd8227a08d4ea476740%7Cfa7b1b5a7b3443879
>>4
>>aed2c178decee1%7C0%7C0%7C636391039781390709&sdata=OBijYEbbq0BjTiZ44ouvJ9w
>>a
>>D4N1Gd49pm0aO36ZGcI%3D&reserved=0
>>Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Mime
View raw message