Re: [FlexJS] Support in BlazeDS communication
On 11/4/16, 11:12 AM, "PKumar" wrote: >Thanks Alex, I am new to FlexJS and your comments are really helping me >improve my FlexJS understanding. >Regarding tag, is there any option/command available so >that >compiler automatically include the injected file in to output folder. The compiler doesn't do that today. I'm not sure it should. Shouldn't we be encouraging the usage of external scripts from off the internet instead of local copies? There is a separate discussion going on right now about copying local "other stuff". It may be that if you happen to want to use a local copy there is a way to have that local copy copied to the output folder, but you'd have to get the remote copy yourself. I'm not sure about having a compiler download something and place it locally. > >I am also planning to compile RemoteObject with FlexJS. I checked the >AMFChannel implementation and found that AMFChannel containing the flash >netConnection & netStatus related code. So i will wrap the flash flash >dependent code inside COMPILE::SWF block and will wrap amfjs >implementation >inside COMPILE::JS block. Please suggest on this also. > Sounds great! It will be interesting to see what other Flash dependencies you run into. Good luck, -Alex
Re: [FlexJS] Support in BlazeDS communication
Thanks Alex, I am new to FlexJS and your comments are really helping me improve my FlexJS understanding. Regarding tag, is there any option/command available so that compiler automatically include the injected file in to output folder. I am also planning to compile RemoteObject with FlexJS. I checked the AMFChannel implementation and found that AMFChannel containing the flash netConnection & netStatus related code. So i will wrap the flash flash dependent code inside COMPILE::SWF block and will wrap amfjs implementation inside COMPILE::JS block. Please suggest on this also. - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p14048.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
On 11/2/16, 10:35 AM, "PKumar" wrote: >Thanks Alex, better to use github URl to save the effort. but one more >thing >i want to ask. can i use the "externc" compiler command to convert amfjs >to action script? > It depends on what you are trying to do. All ExternC does is convert externs-formatted JS files to AS. IOW, it only knows about API signatures and can't convert function bodies and lots of other things, so it isn't a migration from JS to AS tool. Depending on how you've written your code, you may need to create an externs-formatted copy of amfjs and run it through ExternC. That's how the createjs.swc in flex-typedefs repo is handled. That allows other developers to call CreateJS APIs directly. The externs-formatted file is needed to convince the Google Closure Compiler to not minify the variable names in your code that call APIs in the CreateJS library. In some other cases, the APIs of an existing library are not very Flex-like and the library needs to be wrapped in another, more Flex-oriented layer. The CreateJS.swc in the flex-asjs repo puts an MXML-friendly layer on top of the createjs.swc from the flex-typedefs repo. HTH, -Alex
Re: [FlexJS] Support in BlazeDS communication
Thanks Alex, better to use github URl to save the effort. but one more thing i want to ask. can i use the "externc" compiler command to convert amfjs to action script? - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p14015.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
On 10/31/16, 10:40 PM, "PKumar" wrote: >problem with is that it is not copying the amf.js inside the >bin-debug/bin-release folder. i also tried -include-resources compiler >option but nothing working. That's correct. is for "linking" to code. For the debug builds, there are a pile of JS files to load. allows you to add
Re: [FlexJS] Support in BlazeDS communication
I did not modify the amf.js but I am keeping the amf.js locally instead picking from git repo. But problem with is that it is not copying the amf.js inside the bin-debug/bin-release folder. i also tried -include-resources compiler option but nothing working. - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13989.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
problem with is that it is not copying the amf.js inside the bin-debug/bin-release folder. i also tried -include-resources compiler option but nothing working. - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13988.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
On 10/31/16, 10:47 AM, "PKumar" wrote: >I have successfully created a prototype of AMFJS That's sound really exciting! >and now i am trying to >create a swc file. but i could not include the amf.js in my swc file. So >is >there any compiler option to include the amf.js in my swc file so that it >can be copied in final output. Have you made any modifications to amf.js? It might make more sense just to use inject_html and have folks get it that way. Thanks, -Alex
Re: [FlexJS] Support in BlazeDS communication
I have successfully created a prototype of AMFJS and now i am trying to create a swc file. but i could not include the amf.js in my swc file. So is there any compiler option to include the amf.js in my swc file so that it can be copied in final output. - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13986.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
Make sure JS.swc is in the -external-library-path. On 10/29/16, 11:49 PM, "PKumar" wrote: >Thanks Alex, is working fine. It was my fault. > >Now i have successfully injected the amf.js in the index.html but i am >not >getting how can i acccess & call java script variable & methods. I >checked >the createJS & cordova implementation but luck. I am trying to access >"document" in my class but getting compiler error. Please suggest. > >public function serialize():void >{ > COMPILE::JS > { > var data:Object = {any: 'data',you: 'like!'}; > var encodedData:Object = document.AMF.stringify(data); // AMF is a >javascript object. > trace(encodedData); > } >} > > > >- >Regards, >Prashant >-- >View this message in context: >http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-c >ommunication-tp11562p13976.html >Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
Thanks Alex, is working fine. It was my fault. Now i have successfully injected the amf.js in the index.html but i am not getting how can i acccess & call java script variable & methods. I checked the createJS & cordova implementation but luck. I am trying to access "document" in my class but getting compiler error. Please suggest. public function serialize():void { COMPILE::JS { var data:Object = {any: 'data',you: 'like!'}; var encodedData:Object = document.AMF.stringify(data); // AMF is a javascript object. trace(encodedData); } } - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13976.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
On 10/29/16, 2:10 AM, "PKumar" wrote: >i check the "" in createJS. but it is used with Application >constructor. can i used it with any custom class constructor, as below? Yes. Any class should be able to use inject_html -Alex
Re: [FlexJS] Support in BlazeDS communication
i check the "" in createJS. but it is used with Application constructor. can i used it with any custom class constructor, as below? COMPILE::JS public class AMFJS { /** * * * */ public function AMFJS() { } } - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13972.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
Well, it depends on your API goals. If you want to completely replicate the RemoteObject API, then you might want to copy all the RemoteObject related classes from the flex-sdk's RPC project, then add COMPILE::JS conditional compilation code to make calls to amfjs.js where it is needed. If you just want the simplest AMF API, maybe copy the FlexJS HTTPService, call it AMFService and have the send() method call amfjs.js inside a COMPILE::JS conditional and NetConnection inside COMPILE::SWF. If you want to port amfjs.js to ActionScript, you can do that as well, then there isn't a separate amfjs.js file to load at compile-time or runtime. If you want to use amfjs.js as an external file, you can get it injected into the HTML by using like we did in the CreateJS project. HTH, -Alex On 10/26/16, 11:14 AM, "PKumar" wrote: >i have managed to create the amfjs.swc, but i need to use this swc and >create the action script code. I created a library project and keeping the >amfjs.swc inside the libs folder. i created an action script class named >AMFJS.as but i do not know how i will write the amf specific code. Below >are >the lines in js side, > > > > > > > >- >Regards, >Prashant >-- >View this message in context: >http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-c >ommunication-tp11562p13951.html >Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
i have managed to create the amfjs.swc, but i need to use this swc and create the action script code. I created a library project and keeping the amfjs.swc inside the libs folder. i created an action script class named AMFJS.as but i do not know how i will write the amf specific code. Below are the lines in js side, - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13951.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
Hi Carlos, FlexJS outputs JS so you should be able to integrate with any other JS code you find out there. The main issue, IMO, is whether that code is written in an object-oriented manner. The more it is, the easier it is to work with from FlexJS. You can thinly wrap an ActionScript class definition around the methods and "it should just work". However, it is tempting for existing libraries to not be so object-oriented because of speed and size and the lack of structure of JS. JS is like clay. AS is like a construction kit. If something doesn't quite fit in JS, you can force it. In AS, the structure definitely tells you that it isn't supposed to go together that way. So, you should be able to try Atmosphere if you want and try to wrap it in AS. However, the CORS issue ran into should apply in all cases, whether you use Atmosphere, AMFJS with hand-coded JS or AMFJS in FlexJS. I think as long as you are going cross-domain you have to "do the right thing" to give permission. I'm not an expert on CORS at all, but I think you have to have a server that serves CORS headers, sort of like crossdomain.xml. It may not work from file://. You may get different results from http:// than file:// If you can set up a test case where the domain is the same as the domain that serves the HTML/JS/CSS you shouldn't have a CORS issue and then we'd know whether it works for same-domain configurations. HTH, -Alex On 10/24/16, 9:58 PM, "Carlos Cruz" wrote: >This is my experience trying to connect to BlazeDS with AMFJS: > >I tried connecting AMFJS to BlazeDS , ping only, it worked with Internet >Explorer 11 and with MS Edge using url: >http://localhost/ccradius_2/amfjstest.html. With Firefox, Opera and >Chrome I >get: CORS header 'Access-Control-Allow-Origin' missing with either url. > >If it helps anyone: >Html server ulr = http://test.ccradius_2.com/amfjstest.html >Also tried Html server ulr = http://localhost/ccradius_2/amfjstest.html >Tomcat/BlazeDS server url = >http://localhost:8080/ccurbiz/messagebroker/amf > >I did try to add a domain exception in the Apache httpd server in the >VirtualHosts with: (I tried a bunch of stuff this is the latest) > >ErrorLog "logs/error-debug.log" ># CustomLog "logs/error-custom.log" > >Header set Access-Control-Allow-Origin "*" > >Header set X-Frame-Options: "sameorigin" >Header set X-XSS-Protection: "1; mode=block" > >Header always set Content-Security-Policy "default-src 'self' >http://localhost:8080; script-src 'self' 'unsafe-inline' 'unsafe-eval' >http://localhost:8080 'self' http://localhost:8080; object-src 'self' ; >block-all-mixed-content; plugin-types application/pdf;" > > >As for the AS script I'm just using AMFJS's example code: > > document.getElementById("lableid").value = "change in text >or whatever 200"; > >var amfClient = new amf.Client("flex", >"<a rel="nofollow" href="http://localhost:8080/ccurbiz/messagebroker/amf"">http://localhost:8080/ccurbiz/messagebroker/amf"</a>;); >var p = amfClient.invoke("com.ccradius.test.Test ", "ping", []); > >p.then( >function(res) { > document.getElementById("lableid2").value = >"SUCCESS"; >console.log(res.data); >}, >function(err) { > document.getElementById("lableid2").value = >"ERROR"; > console.log("ping errror"); >} >); > > > >Unless I find a work around, I'm going to try to Atmosphere >(https://github.com/Atmosphere/atmosphere) , but I have a question similar >to the previous post would I be able to use atmosphere with FlexJS code >and >compile? > >Thx! >Carlos > >-Original Message- >From: PKumar [mailto:prashaku...@gmail.com] >Sent: Wednesday, October 19, 2016 5:14 AM >To: users@flex.apache.org >Subject: Re: [FlexJS] Support in BlazeDS communication > >Hi Alex, > >I tried to connect with webORB.net using AMFJS and it is working. I will >check it with BlazeDS also. I am having one query here, can I compile >AMFJS >to FlexJS library, as currently FlexJS havig JQuery support? > > > >- >Regards, >Prashant >-- >View this message in context: >http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-c >om >munication-tp11562p13855.html >Sent from the Apache Flex Users mailing list archive at Nabble.com. >
RE: [FlexJS] Support in BlazeDS communication
This is my experience trying to connect to BlazeDS with AMFJS: I tried connecting AMFJS to BlazeDS , ping only, it worked with Internet Explorer 11 and with MS Edge using url: http://localhost/ccradius_2/amfjstest.html. With Firefox, Opera and Chrome I get: CORS header 'Access-Control-Allow-Origin' missing with either url. If it helps anyone: Html server ulr = http://test.ccradius_2.com/amfjstest.html Also tried Html server ulr = http://localhost/ccradius_2/amfjstest.html Tomcat/BlazeDS server url = http://localhost:8080/ccurbiz/messagebroker/amf I did try to add a domain exception in the Apache httpd server in the VirtualHosts with: (I tried a bunch of stuff this is the latest) ErrorLog "logs/error-debug.log" # CustomLog "logs/error-custom.log" Header set Access-Control-Allow-Origin "*" Header set X-Frame-Options: "sameorigin" Header set X-XSS-Protection: "1; mode=block" Header always set Content-Security-Policy "default-src 'self' http://localhost:8080; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:8080 'self' http://localhost:8080; object-src 'self' ; block-all-mixed-content; plugin-types application/pdf;" As for the AS script I'm just using AMFJS's example code: document.getElementById("lableid").value = "change in text or whatever 200"; var amfClient = new amf.Client("flex", "<a rel="nofollow" href="http://localhost:8080/ccurbiz/messagebroker/amf"">http://localhost:8080/ccurbiz/messagebroker/amf"</a>;); var p = amfClient.invoke("com.ccradius.test.Test ", "ping", []); p.then( function(res) { document.getElementById("lableid2").value = "SUCCESS"; console.log(res.data); }, function(err) { document.getElementById("lableid2").value = "ERROR"; console.log("ping errror"); } ); Unless I find a work around, I'm going to try to Atmosphere (https://github.com/Atmosphere/atmosphere) , but I have a question similar to the previous post would I be able to use atmosphere with FlexJS code and compile? Thx! Carlos -Original Message- From: PKumar [mailto:prashaku...@gmail.com] Sent: Wednesday, October 19, 2016 5:14 AM To: users@flex.apache.org Subject: Re: [FlexJS] Support in BlazeDS communication Hi Alex, I tried to connect with webORB.net using AMFJS and it is working. I will check it with BlazeDS also. I am having one query here, can I compile AMFJS to FlexJS library, as currently FlexJS havig JQuery support? - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-com munication-tp11562p13855.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
Hi Alex, I tried to connect with webORB.net using AMFJS and it is working. I will check it with BlazeDS also. I am having one query here, can I compile AMFJS to FlexJS library, as currently FlexJS havig JQuery support? - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13855.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: [FlexJS] Support in BlazeDS communication
On 10/17/16, 3:07 PM, "Justin Mclean" wrote: >Hi, > >> I'm hoping to start testing FlexJS in the very near future and one of >>the JS >> libraries I was going to try to test is amfjs >> (https://github.com/emilkm/amfjs). > >Licensing wise it's Apache licensed and bundles some MIT code (Promises >license) [1] and one item [2] under the "do the fuck what you want” >license. [3] > >It is however missing a NOTICE file so would be nice if the 3rd party be >contacted to correct that. > >Both are compatible with Apache, so we can use this with some >modification to our LICENSE/NOTICE files. Thanks for looking Justin. I guess that folks who want to try out amfjs can try to use it wholesale or look into porting it to work against the FlexJS binary data classes. Thanks, -Alex
Re: [FlexJS] Support in BlazeDS communication
Hi, > I'm hoping to start testing FlexJS in the very near future and one of the JS > libraries I was going to try to test is amfjs > (https://github.com/emilkm/amfjs). Licensing wise it's Apache licensed and bundles some MIT code (Promises license) [1] and one item [2] under the "do the fuck what you want” license. [3] It is however missing a NOTICE file so would be nice if the 3rd party be contacted to correct that. Both are compatible with Apache, so we can use this with some modification to our LICENSE/NOTICE files. Thanks, Justin 1. https://github.com/Zolmeister/promiz 2. https://gist.github.com/jed/982883#file-license-txt 3. http://www.wtfpl.net
Re: [FlexJS] Support in BlazeDS communication
On 10/17/16, 12:13 PM, "PKumar" wrote: >Alex, > >If you will provide initial guidelines then i can move forward on AMFJS. > I haven't looked at it in detail. It depends on whether you want to start from some of the existing implementations or work from the spec on your own. There are licensing issues to resolve if you work with existing implementations. Either way, I think I would look at the FlexJS classes for handling binary data and reflection and see if you can piece together a solution. Feel free to ask question on the d...@flex.apache.org mailing list. Thanks, -Alex
Re: [FlexJS] Support in BlazeDS communication
Alex, If you will provide initial guidelines then i can move forward on AMFJS. - Regards, Prashant -- View this message in context: http://apache-flex-users.246.n4.nabble.com/FlexJS-Support-in-BlazeDS-communication-tp11562p13825.html Sent from the Apache Flex Users mailing list archive at Nabble.com.
RE: [FlexJS] Support in BlazeDS communication
I will certainly share my findings here, another feature I liked of Flex/BlazeDS is the ability to have real-time communications with a backend server. My .5¢ (half a cent) input is I'm in the camp that thinks as far as big web applications is concerned JavaScript is a big step backwards. I really wish I was a better coder to be able to contribute more, but I would really like to see FlexJS be the leading platform for big web applications. Carlos -Original Message- From: Alex Harui [mailto:aha...@adobe.com] Sent: Monday, October 17, 2016 1:09 AM To: users@flex.apache.org Subject: Re: [FlexJS] Support in BlazeDS communication On 10/16/16, 9:55 AM, "Carlos Cruz" wrote: >I know I'm very late to the party, but I think for anyone that works on >large Flex applications it's an important topic. A few years ago I did >some tests comparing REST calls VS BlazeDS to communicate with another >Apache project OFBiz. BlazeDS was significantly much faster. When >interfacing an application to retrieve 100's / 1000's of DB records >speed becomes an important factor. > >I'm hoping to start testing FlexJS in the very near future and one of >the JS libraries I was going to try to test is amfjs >(https://github.com/emilkm/amfjs). I'm definitely interested in what you find out. My main concern is AMF performance in the browser. I think we can write enough code to make it work, but if the speed you saw in your past test was because AMF was handled by the runtime, you may not see the same results when we handle AMF in JS. But we definitely need a volunteer to write the code to truly understand how fast/slow it will be compared to JSON, especially JSON with compression over the network. My 2 cents, -Alex
Re: [FlexJS] Support in BlazeDS communication
On 10/16/16, 9:55 AM, "Carlos Cruz" wrote: >I know I'm very late to the party, but I think for anyone that works on >large Flex applications it's an important topic. A few years ago I did >some >tests comparing REST calls VS BlazeDS to communicate with another Apache >project OFBiz. BlazeDS was significantly much faster. When interfacing an >application to retrieve 100's / 1000's of DB records speed becomes an >important factor. > >I'm hoping to start testing FlexJS in the very near future and one of the >JS >libraries I was going to try to test is amfjs >(https://github.com/emilkm/amfjs). I'm definitely interested in what you find out. My main concern is AMF performance in the browser. I think we can write enough code to make it work, but if the speed you saw in your past test was because AMF was handled by the runtime, you may not see the same results when we handle AMF in JS. But we definitely need a volunteer to write the code to truly understand how fast/slow it will be compared to JSON, especially JSON with compression over the network. My 2 cents, -Alex
RE: [FlexJS] Support in BlazeDS communication
I know I'm very late to the party, but I think for anyone that works on large Flex applications it's an important topic. A few years ago I did some tests comparing REST calls VS BlazeDS to communicate with another Apache project OFBiz. BlazeDS was significantly much faster. When interfacing an application to retrieve 100's / 1000's of DB records speed becomes an important factor. I'm hoping to start testing FlexJS in the very near future and one of the JS libraries I was going to try to test is amfjs (https://github.com/emilkm/amfjs). Carlos -Original Message- From: Christofer Dutz [mailto:christofer.d...@c-ware.de] Sent: Wednesday, December 2, 2015 4:42 AM To: users@flex apache. org Subject: AW: [FlexJS] Support in BlazeDS communication We're currently discussing exactly this issue on the dev-list. Currently there seem to be several options: a) Implement AMF in Javascript b) Drop to JSON in Flash c) Continue to use AMF for Flash and JSON for JavaScript, but giving up on Remote-Objects migrating to REST-Like communication. Chris Von: Evyatar Ben Halevi-Arbib Gesendet: Mittwoch, 2. Dezember 2015 09:12 An: users@flex apache. org Betreff: [FlexJS] Support in BlazeDS communication Hello, We have several large scale Flex applications that communicate with WebLogic servers using BlazeDS. Just out of curiosity I wondered how would the communication with the server-side would work in case we would compile our projects using FlexJS. Thanks in advance, Evyatar
AW: [FlexJS] Support in BlazeDS communication
We're currently discussing exactly this issue on the dev-list. Currently there seem to be several options: a) Implement AMF in Javascript b) Drop to JSON in Flash c) Continue to use AMF for Flash and JSON for JavaScript, but giving up on Remote-Objects migrating to REST-Like communication. Chris Von: Evyatar Ben Halevi-Arbib Gesendet: Mittwoch, 2. Dezember 2015 09:12 An: users@flex apache. org Betreff: [FlexJS] Support in BlazeDS communication Hello, We have several large scale Flex applications that communicate with WebLogic servers using BlazeDS. Just out of curiosity I wondered how would the communication with the server-side would work in case we would compile our projects using FlexJS. Thanks in advance, Evyatar
[FlexJS] Support in BlazeDS communication
Hello, We have several large scale Flex applications that communicate with WebLogic servers using BlazeDS. Just out of curiosity I wondered how would the communication with the server-side would work in case we would compile our projects using FlexJS. Thanks in advance, Evyatar