How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

ulrich.mueller

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

Carlos Rovira-2
Hi Ulrich,

please check ApplicationParametersBead and ApplicationParametersCaseInsensitiveBead


I still didn't use it so others could hopefully give more detail

Best

Carlos




El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 



--
Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

Alex Harui-2

Those beads or their equivalent are baked in to the emulation components.

 

FlexGlobals.topLevelApplication.parameters exists in the emulation components.  It may not be wired up correctly yet, but if not, it will be.  However, it will be wired by default to the URL parameters for the hosting webpage.  I don’t think we’ve dealt with flashvars yet.  If your hosting web page has set up your flashvars to be different from the URL parameters then you may tweak some code in the hosting web page.  If this is the case, can you share more about how you determine your flashvars?  I couldn’t quite get it from the snippets you provided.  It wasn’t clear if the JSP was putting the flashvars into a global or local variable and when it got passed to the SWFObject.  There won’t be a SWFObject in Royale.  Maybe we’ll make it so the parameters first look for a global flashvars variable or something like that.

 

Let us know,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 9:46 AM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

please check ApplicationParametersBead and

ApplicationParametersCaseInsensitiveBead



 

I still didn't use it so others could hopefully give more detail

 

Best

 

Carlos

 

 

 

 

El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 


 

--

Carlos Rovira

 

Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

ulrich.mueller
In reply to this post by ulrich.mueller

Hello,

 

the current workflow for some applications for our customers:

 

 

https://some-tomcat.local/blazeds/App/App.jsp

 

  • The .jsp file is practically the .html template (from Flash Builder)
  • We employ flashvars to configure the applications without using URL parameters that can be seen by users
  • The Tomcat is used to call Waffle to find out the current Windows Domain User (https://github.com/Waffle/waffle)
  • The user information is passed to the SWF

 

<script type="text/javascript">

            // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.

            var swfVersionStr = "11.1.0";

            // To use express install, set to playerProductInstall.swf, otherwise the empty string.

            var xiSwfUrlStr = "playerProductInstall.swf";

            var flashvars = {};

 

            flashvars.user = '<%=request.getAttribute("ntuser")%>';  // created by Waffle filter and some processing

 

            var params = {};

            params.quality = "high";

            params.bgcolor = "#ffffff";

            params.allowscriptaccess = "sameDomain";

            params.allowfullscreen = "true";

            var attributes = {};

            attributes.id = "MyApp";

            attributes.name = "MyApp";

            attributes.align = "middle";

            swfobject.embedSWF(

                "MyApp.swf", "flashContent",

                "100%", "100%",

                swfVersionStr, xiSwfUrlStr,

                flashvars, params, attributes);

            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.

            swfobject.createCSS("#flashContent", "display:block;text-align:left;");

</script>

 

 

App.mxml

 

var user:String = FlexGlobals.topLevelApplication.parameters.user as String;

// Show user specific data …

 

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Donnerstag, 25. Oktober 2018 19:47
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Those beads or their equivalent are baked in to the emulation components.

 

FlexGlobals.topLevelApplication.parameters exists in the emulation components.  It may not be wired up correctly yet, but if not, it will be.  However, it will be wired by default to the URL parameters for the hosting webpage.  I don’t think we’ve dealt with flashvars yet.  If your hosting web page has set up your flashvars to be different from the URL parameters then you may tweak some code in the hosting web page.  If this is the case, can you share more about how you determine your flashvars?  I couldn’t quite get it from the snippets you provided.  It wasn’t clear if the JSP was putting the flashvars into a global or local variable and when it got passed to the SWFObject.  There won’t be a SWFObject in Royale.  Maybe we’ll make it so the parameters first look for a global flashvars variable or something like that.

 

Let us know,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "
[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 9:46 AM
To: "
[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

please check ApplicationParametersBead and

ApplicationParametersCaseInsensitiveBead

 

 

I still didn't use it so others could hopefully give more detail

 

Best

 

Carlos

 

 

 

 

El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 


 

--

Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

Alex Harui-2

Hi Ulrich,

 

I think I understand your workflow.  Since you are generating your own html file, you can make it pass the flashvars to the Application.  I just pushed a change to make the Application’s parameters writable and allow you to pass parameters in through the SystemManager.

 

Currently, the body of the html of a Royale app using the emulation components looks something like:

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start();

                </script>

</body>

 

If your JSP generates a variable called flashvars, then you can pass it into the “start” method.

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start(flashvars);

                </script>

</body>

 

There might be a few other bugs to work out once you get to the point of actually trying this code.

 

HTH,

-Alex

 

From: "[hidden email]" <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 10:26 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hello,

 

the current workflow for some applications for our customers:

 

 

https://some-tomcat.local/blazeds/App/App.jsp

 

·         The .jsp file is practically the .html template (from Flash Builder)

·         We employ flashvars to configure the applications without using URL parameters that can be seen by users

·         The Tomcat is used to call Waffle to find out the current Windows Domain User (https://github.com/Waffle/waffle)

·         The user information is passed to the SWF

 

<script type="text/javascript">

            // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.

            var swfVersionStr = "11.1.0";

            // To use express install, set to playerProductInstall.swf, otherwise the empty string.

            var xiSwfUrlStr = "playerProductInstall.swf";

            var flashvars = {};

 

            flashvars.user = '<%=request.getAttribute("ntuser")%>';  // created by Waffle filter and some processing

 

            var params = {};

            params.quality = "high";

            params.bgcolor = "#ffffff";

            params.allowscriptaccess = "sameDomain";

            params.allowfullscreen = "true";

            var attributes = {};

            attributes.id = "MyApp";

            attributes.name = "MyApp";

            attributes.align = "middle";

            swfobject.embedSWF(

                "MyApp.swf", "flashContent",

                "100%", "100%",

                swfVersionStr, xiSwfUrlStr,

                flashvars, params, attributes);

            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.

            swfobject.createCSS("#flashContent", "display:block;text-align:left;");

</script>

 

 

App.mxml

 

var user:String = FlexGlobals.topLevelApplication.parameters.user as String;

// Show user specific data …

 

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Donnerstag, 25. Oktober 2018 19:47
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Those beads or their equivalent are baked in to the emulation components.

 

FlexGlobals.topLevelApplication.parameters exists in the emulation components.  It may not be wired up correctly yet, but if not, it will be.  However, it will be wired by default to the URL parameters for the hosting webpage.  I don’t think we’ve dealt with flashvars yet.  If your hosting web page has set up your flashvars to be different from the URL parameters then you may tweak some code in the hosting web page.  If this is the case, can you share more about how you determine your flashvars?  I couldn’t quite get it from the snippets you provided.  It wasn’t clear if the JSP was putting the flashvars into a global or local variable and when it got passed to the SWFObject.  There won’t be a SWFObject in Royale.  Maybe we’ll make it so the parameters first look for a global flashvars variable or something like that.

 

Let us know,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "
[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 9:46 AM
To: "
[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

please check ApplicationParametersBead and

ApplicationParametersCaseInsensitiveBead

 

 

I still didn't use it so others could hopefully give more detail

 

Best

 

Carlos

 

 

 

 

El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 


 

--

Carlos Rovira

 

Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

ulrich.mueller
In reply to this post by ulrich.mueller

Hello Alex,

 

thanks for the work.

 

For testing I have created a most simple app:

 

<?xml version="1.0" encoding="utf-8"?>

 

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:local="*"                

                   xmlns:js="library://ns.apache.org/royale/basic"

                   applicationComplete="complete()"

                   >

 

    <fx:Script>

        <![CDATA[

            protected function complete():void{

                var foo:String = "test1234";                

            }  // breakpoint

        ]]>

    </fx:Script>    

 

    <js:valuesImpl>

        <js:SimpleCSSValuesImpl />

    </js:valuesImpl>

</js:Application>

 

 

In index.html I have put after compiling:

 

<body>

       <script type="text/javascript">

              var flashvars = {};

              flashvars.ntuser = "Ulrich";

              new TestApp().start(flashvars);

       </script>

</body>

 

During debugging (now working 😊 thx ) I could not see ntuser, parameters or something. Most likely it did not work as you said it was meant for emulation. We have no problem to redevelop some critical parts of the applications so here we can stick to native Royale.

 

Anyway how can we support the development of Apache Royale in general?

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Freitag, 26. Oktober 2018 08:41
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

I think I understand your workflow.  Since you are generating your own html file, you can make it pass the flashvars to the Application.  I just pushed a change to make the Application’s parameters writable and allow you to pass parameters in through the SystemManager.

 

Currently, the body of the html of a Royale app using the emulation components looks something like:

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start();

                </script>

</body>

 

If your JSP generates a variable called flashvars, then you can pass it into the “start” method.

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start(flashvars);

                </script>

</body>

 

There might be a few other bugs to work out once you get to the point of actually trying this code.

 

HTH,

-Alex

 

From: "[hidden email]" <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 10:26 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hello,

 

the current workflow for some applications for our customers:

 

 

https://some-tomcat.local/blazeds/App/App.jsp

 

·       The .jsp file is practically the .html template (from Flash Builder)

·       We employ flashvars to configure the applications without using URL parameters that can be seen by users

·       The Tomcat is used to call Waffle to find out the current Windows Domain User (https://github.com/Waffle/waffle)

·       The user information is passed to the SWF

 

<script type="text/javascript">

            // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.

            var swfVersionStr = "11.1.0";

            // To use express install, set to playerProductInstall.swf, otherwise the empty string.

            var xiSwfUrlStr = "playerProductInstall.swf";

            var flashvars = {};

 

            flashvars.user = '<%=request.getAttribute("ntuser")%>';  // created by Waffle filter and some processing

 

            var params = {};

            params.quality = "high";

            params.bgcolor = "#ffffff";

            params.allowscriptaccess = "sameDomain";

            params.allowfullscreen = "true";

            var attributes = {};

            attributes.id = "MyApp";

            attributes.name = "MyApp";

            attributes.align = "middle";

            swfobject.embedSWF(

                "MyApp.swf", "flashContent",

                "100%", "100%",

                swfVersionStr, xiSwfUrlStr,

                flashvars, params, attributes);

            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.

            swfobject.createCSS("#flashContent", "display:block;text-align:left;");

</script>

 

 

App.mxml

 

var user:String = FlexGlobals.topLevelApplication.parameters.user as String;

// Show user specific data …

 

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Donnerstag, 25. Oktober 2018 19:47
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Those beads or their equivalent are baked in to the emulation components.

 

FlexGlobals.topLevelApplication.parameters exists in the emulation components.  It may not be wired up correctly yet, but if not, it will be.  However, it will be wired by default to the URL parameters for the hosting webpage.  I don’t think we’ve dealt with flashvars yet.  If your hosting web page has set up your flashvars to be different from the URL parameters then you may tweak some code in the hosting web page.  If this is the case, can you share more about how you determine your flashvars?  I couldn’t quite get it from the snippets you provided.  It wasn’t clear if the JSP was putting the flashvars into a global or local variable and when it got passed to the SWFObject.  There won’t be a SWFObject in Royale.  Maybe we’ll make it so the parameters first look for a global flashvars variable or something like that.

 

Let us know,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "
[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 9:46 AM
To: "
[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

please check ApplicationParametersBead and

ApplicationParametersCaseInsensitiveBead

 

 

I still didn't use it so others could hopefully give more detail

 

Best

 

Carlos

 

 

 

 

El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 


 

--

Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

Alex Harui-2

Hi Ulrich,

 

While Flex supported two component sets (MX and Spark) and they were more or less interoperable, Royale supports multiple component sets.  There is the Basic set, there is Express, Jewel, and the Emulation Components.  Like Flex, each component set has a different XML namespace.

 

The changes I made last night were to the Application in the MX Emulation Components.  So you would need to get the latest nightly build, and your application should look something like:

 

<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:local="*"                

                   xmlns:js="library://ns.apache.org/royale/basic"

                   xmlns:mx="library://ns.apache.org/royale/mx"

                   applicationComplete="complete()"

                   >

 

And you won’t need to specify a valuesImpl, the MX Application will take care of that.  The emulation components are designed to reduce the amount of code changes required to migrate a Flex application to Royale.  The Basic components and other components sets are not guaranteed to be interoperable with other sets.  Basic’s main goal is to produce the smallest, fastest application, but it requires more time to assemble exactly the pieces you need.  Express is designed to make it faster to build a Basic application but you will pay for some overhead.  Jewel is a new look-and-feel and introduces some new UI widgets that didn’t exist in Flex.

 

Regarding supporting Royale, we are looking for folks like you who want to use it and will hopefully contribute to it.  Apache open source projects are volunteer-driven.  There is no company like Adobe driving it.  We hope that users like yourself will help by, at minimum, using the code and providing feedback, but also by providing patches/pull-requests with fixes and improvements.  Folks who contribute a series of good patches are granted write-access to the repo and then the project and its community grows stronger and faster.  So, we hope you will choose to use Apache Royale and will help find and fix bugs in the process of getting your application to run on Royale.  You can also hire people to help you migrate your code and find and fix bugs.  I think there are at least a couple of folks who might have extra cycles to help.

 

Thanks,

-Alex

 

 

From: "[hidden email]" <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Friday, October 26, 2018 at 5:29 AM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hello Alex,

 

thanks for the work.

 

For testing I have created a most simple app:

 

<?xml version="1.0" encoding="utf-8"?>

 

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:local="*"                

                   xmlns:js="library://ns.apache.org/royale/basic"

                   applicationComplete="complete()"

                   >

 

    <fx:Script>

        <![CDATA[

            protected function complete():void{

                var foo:String = "test1234";                

            }  // breakpoint

        ]]>

    </fx:Script>    

 

    <js:valuesImpl>

        <js:SimpleCSSValuesImpl />

    </js:valuesImpl>

</js:Application>

 

 

In index.html I have put after compiling:

 

<body>

       <script type="text/javascript">

              var flashvars = {};

              flashvars.ntuser = "Ulrich";

              new TestApp().start(flashvars);

       </script>

</body>

 

During debugging (now working 😊 thx ) I could not see ntuser, parameters or something. Most likely it did not work as you said it was meant for emulation. We have no problem to redevelop some critical parts of the applications so here we can stick to native Royale.

 

Anyway how can we support the development of Apache Royale in general?

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Freitag, 26. Oktober 2018 08:41
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

I think I understand your workflow.  Since you are generating your own html file, you can make it pass the flashvars to the Application.  I just pushed a change to make the Application’s parameters writable and allow you to pass parameters in through the SystemManager.

 

Currently, the body of the html of a Royale app using the emulation components looks something like:

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start();

                </script>

</body>

 

If your JSP generates a variable called flashvars, then you can pass it into the “start” method.

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start(flashvars);

                </script>

</body>

 

There might be a few other bugs to work out once you get to the point of actually trying this code.

 

HTH,

-Alex

 

From: "[hidden email]" <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 10:26 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hello,

 

the current workflow for some applications for our customers:

 

 

https://some-tomcat.local/blazeds/App/App.jsp

 

·         The .jsp file is practically the .html template (from Flash Builder)

·         We employ flashvars to configure the applications without using URL parameters that can be seen by users

·         The Tomcat is used to call Waffle to find out the current Windows Domain User (https://github.com/Waffle/waffle)

·         The user information is passed to the SWF

 

<script type="text/javascript">

            // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.

            var swfVersionStr = "11.1.0";

            // To use express install, set to playerProductInstall.swf, otherwise the empty string.

            var xiSwfUrlStr = "playerProductInstall.swf";

            var flashvars = {};

 

            flashvars.user = '<%=request.getAttribute("ntuser")%>';  // created by Waffle filter and some processing

 

            var params = {};

            params.quality = "high";

            params.bgcolor = "#ffffff";

            params.allowscriptaccess = "sameDomain";

            params.allowfullscreen = "true";

            var attributes = {};

            attributes.id = "MyApp";

            attributes.name = "MyApp";

            attributes.align = "middle";

            swfobject.embedSWF(

                "MyApp.swf", "flashContent",

                "100%", "100%",

                swfVersionStr, xiSwfUrlStr,

                flashvars, params, attributes);

            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.

            swfobject.createCSS("#flashContent", "display:block;text-align:left;");

</script>

 

 

App.mxml

 

var user:String = FlexGlobals.topLevelApplication.parameters.user as String;

// Show user specific data …

 

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Donnerstag, 25. Oktober 2018 19:47
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Those beads or their equivalent are baked in to the emulation components.

 

FlexGlobals.topLevelApplication.parameters exists in the emulation components.  It may not be wired up correctly yet, but if not, it will be.  However, it will be wired by default to the URL parameters for the hosting webpage.  I don’t think we’ve dealt with flashvars yet.  If your hosting web page has set up your flashvars to be different from the URL parameters then you may tweak some code in the hosting web page.  If this is the case, can you share more about how you determine your flashvars?  I couldn’t quite get it from the snippets you provided.  It wasn’t clear if the JSP was putting the flashvars into a global or local variable and when it got passed to the SWFObject.  There won’t be a SWFObject in Royale.  Maybe we’ll make it so the parameters first look for a global flashvars variable or something like that.

 

Let us know,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "
[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 9:46 AM
To: "
[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

please check ApplicationParametersBead and

ApplicationParametersCaseInsensitiveBead

 

 

I still didn't use it so others could hopefully give more detail

 

Best

 

Carlos

 

 

 

 

El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 


 

--

Carlos Rovira

 

Reply | Threaded
Open this post in threaded view
|

Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

ulrich.mueller
In reply to this post by ulrich.mueller

Hello Alex,

 

I can confirm it’s working. Thank you!

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Freitag, 26. Oktober 2018 18:10
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

While Flex supported two component sets (MX and Spark) and they were more or less interoperable, Royale supports multiple component sets.  There is the Basic set, there is Express, Jewel, and the Emulation Components.  Like Flex, each component set has a different XML namespace.

 

The changes I made last night were to the Application in the MX Emulation Components.  So you would need to get the latest nightly build, and your application should look something like:

 

<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:local="*"                

                   xmlns:js="library://ns.apache.org/royale/basic"

                   xmlns:mx="library://ns.apache.org/royale/mx"

                   applicationComplete="complete()"

                   >

 

And you won’t need to specify a valuesImpl, the MX Application will take care of that.  The emulation components are designed to reduce the amount of code changes required to migrate a Flex application to Royale.  The Basic components and other components sets are not guaranteed to be interoperable with other sets.  Basic’s main goal is to produce the smallest, fastest application, but it requires more time to assemble exactly the pieces you need.  Express is designed to make it faster to build a Basic application but you will pay for some overhead.  Jewel is a new look-and-feel and introduces some new UI widgets that didn’t exist in Flex.

 

Regarding supporting Royale, we are looking for folks like you who want to use it and will hopefully contribute to it.  Apache open source projects are volunteer-driven.  There is no company like Adobe driving it.  We hope that users like yourself will help by, at minimum, using the code and providing feedback, but also by providing patches/pull-requests with fixes and improvements.  Folks who contribute a series of good patches are granted write-access to the repo and then the project and its community grows stronger and faster.  So, we hope you will choose to use Apache Royale and will help find and fix bugs in the process of getting your application to run on Royale.  You can also hire people to help you migrate your code and find and fix bugs.  I think there are at least a couple of folks who might have extra cycles to help.

 

Thanks,

-Alex

 

 

From: "[hidden email]" <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Friday, October 26, 2018 at 5:29 AM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hello Alex,

 

thanks for the work.

 

For testing I have created a most simple app:

 

<?xml version="1.0" encoding="utf-8"?>

 

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:local="*"                

                   xmlns:js="library://ns.apache.org/royale/basic"

                   applicationComplete="complete()"

                   >

 

    <fx:Script>

        <![CDATA[

            protected function complete():void{

                var foo:String = "test1234";                

            }  // breakpoint

        ]]>

    </fx:Script>    

 

    <js:valuesImpl>

        <js:SimpleCSSValuesImpl />

    </js:valuesImpl>

</js:Application>

 

 

In index.html I have put after compiling:

 

<body>

       <script type="text/javascript">

              var flashvars = {};

              flashvars.ntuser = "Ulrich";

              new TestApp().start(flashvars);

       </script>

</body>

 

During debugging (now working 😊 thx ) I could not see ntuser, parameters or something. Most likely it did not work as you said it was meant for emulation. We have no problem to redevelop some critical parts of the applications so here we can stick to native Royale.

 

Anyway how can we support the development of Apache Royale in general?

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Freitag, 26. Oktober 2018 08:41
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

I think I understand your workflow.  Since you are generating your own html file, you can make it pass the flashvars to the Application.  I just pushed a change to make the Application’s parameters writable and allow you to pass parameters in through the SystemManager.

 

Currently, the body of the html of a Royale app using the emulation components looks something like:

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start();

                </script>

</body>

 

If your JSP generates a variable called flashvars, then you can pass it into the “start” method.

 

<body>

                <script type="text/javascript">

                                new MyApp_mx_managers_SystemManager().start(flashvars);

                </script>

</body>

 

There might be a few other bugs to work out once you get to the point of actually trying this code.

 

HTH,

-Alex

 

From: "[hidden email]" <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 10:26 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hello,

 

the current workflow for some applications for our customers:

 

 

https://some-tomcat.local/blazeds/App/App.jsp

 

·       The .jsp file is practically the .html template (from Flash Builder)

·       We employ flashvars to configure the applications without using URL parameters that can be seen by users

·       The Tomcat is used to call Waffle to find out the current Windows Domain User (https://github.com/Waffle/waffle)

·       The user information is passed to the SWF

 

<script type="text/javascript">

            // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.

            var swfVersionStr = "11.1.0";

            // To use express install, set to playerProductInstall.swf, otherwise the empty string.

            var xiSwfUrlStr = "playerProductInstall.swf";

            var flashvars = {};

 

            flashvars.user = '<%=request.getAttribute("ntuser")%>';  // created by Waffle filter and some processing

 

            var params = {};

            params.quality = "high";

            params.bgcolor = "#ffffff";

            params.allowscriptaccess = "sameDomain";

            params.allowfullscreen = "true";

            var attributes = {};

            attributes.id = "MyApp";

            attributes.name = "MyApp";

            attributes.align = "middle";

            swfobject.embedSWF(

                "MyApp.swf", "flashContent",

                "100%", "100%",

                swfVersionStr, xiSwfUrlStr,

                flashvars, params, attributes);

            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.

            swfobject.createCSS("#flashContent", "display:block;text-align:left;");

</script>

 

 

App.mxml

 

var user:String = FlexGlobals.topLevelApplication.parameters.user as String;

// Show user specific data …

 

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

CARNET GmbH

Chemnitz, Germany

www.carnet-gmbh.de

 

 

 

Von: Alex Harui <[hidden email]>
Gesendet: Donnerstag, 25. Oktober 2018 19:47
An: [hidden email]
Betreff: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Those beads or their equivalent are baked in to the emulation components.

 

FlexGlobals.topLevelApplication.parameters exists in the emulation components.  It may not be wired up correctly yet, but if not, it will be.  However, it will be wired by default to the URL parameters for the hosting webpage.  I don’t think we’ve dealt with flashvars yet.  If your hosting web page has set up your flashvars to be different from the URL parameters then you may tweak some code in the hosting web page.  If this is the case, can you share more about how you determine your flashvars?  I couldn’t quite get it from the snippets you provided.  It wasn’t clear if the JSP was putting the flashvars into a global or local variable and when it got passed to the SWFObject.  There won’t be a SWFObject in Royale.  Maybe we’ll make it so the parameters first look for a global flashvars variable or something like that.

 

Let us know,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "
[hidden email]" <[hidden email]>
Date: Thursday, October 25, 2018 at 9:46 AM
To: "
[hidden email]" <[hidden email]>
Subject: Re: How to use FlexGlobals.topLevelApplication.parameters? Alternatives?

 

Hi Ulrich,

 

please check ApplicationParametersBead and

ApplicationParametersCaseInsensitiveBead

 

 

I still didn't use it so others could hopefully give more detail

 

Best

 

Carlos

 

 

 

 

El jue., 25 oct. 2018 a las 17:36, <[hidden email]> escribió:

Hello,

 

first of all: Many thanks to all contributers of Apache Royale. It looks very promising.  Thanks.

 

We have a large set of customer specific Flex applications targeted to Flash output. We are currently evaluating if we can use Royale/JS to replace them without must redevelopment.

 

Is there an infrastructure to use FlexGlobals.topLevelApplication.parameters and the flashvar within the template? We have some variables filled there (by an Tomcat Server via an JSP page).

 

 

App.jsp

 

var flashvars = {};

flashvars.myvar= '<%=request.getAttribute("someindex")%>';

 

 

App.mxml

 

var myvar:String = FlexGlobals.topLevelApplication.parameters.myvar as String;

 

 

 

Mit freundlichen Grüßen / Best regards

 

Ulrich Müller

Dipl. Inf.

 

 

CARNET GmbH

Chemnitz, Germany

 

 

 


 

--