You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/10/17 21:26:15 UTC

[royale-asjs] branch develop updated: Add the Jewel example for MX RO to test as an additional file, so we can use it instead of the current one to test the release mode (but needs to be linked to use it instead of the original one)

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7d75d37  Add the Jewel example for MX RO to test as an additional file, so we can use it instead of the current one to test the release mode (but needs to be linked to use it instead of the original one)
7d75d37 is described below

commit 7d75d3781f44bcceff95ebe75df38ac4a5c4a475
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Oct 17 23:26:07 2018 +0200

    Add the Jewel example for MX RO to test as an additional file, so we can use it instead of the current one to test the release mode (but needs to be linked to use it instead of the original one)
---
 examples/mxroyale/RemoteObjectAMFTest/pom.xml      |  16 ++-
 .../src/main/royale/App_Jewel.mxml                 | 133 +++++++++++++++++++++
 2 files changed, 148 insertions(+), 1 deletion(-)

diff --git a/examples/mxroyale/RemoteObjectAMFTest/pom.xml b/examples/mxroyale/RemoteObjectAMFTest/pom.xml
index 4b54651..4779ba2 100644
--- a/examples/mxroyale/RemoteObjectAMFTest/pom.xml
+++ b/examples/mxroyale/RemoteObjectAMFTest/pom.xml
@@ -49,7 +49,7 @@
           <mainClass>App.mxml</mainClass>
           <targets>SWF,JSRoyale</targets>
           <debug>false</debug>
-          <additionalCompilerOptions>-source-map=true;-js-dynamic-access-unknown-members=true</additionalCompilerOptions>
+          <!-- <additionalCompilerOptions>-source-map=true;-js-dynamic-access-unknown-members=true</additionalCompilerOptions> -->
         </configuration>
       </plugin>
       <plugin>
@@ -87,6 +87,20 @@
       <classifier>js</classifier>
     </dependency>
     <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Jewel</artifactId>
+      <version>0.9.5-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>swf</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Jewel</artifactId>
+      <version>0.9.5-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>js</classifier>
+    </dependency>
+    <dependency>
         <groupId>org.apache.royale.framework</groupId>
         <artifactId>Reflection</artifactId>
         <version>0.9.5-SNAPSHOT</version>
diff --git a/examples/mxroyale/RemoteObjectAMFTest/src/main/royale/App_Jewel.mxml b/examples/mxroyale/RemoteObjectAMFTest/src/main/royale/App_Jewel.mxml
new file mode 100644
index 0000000..57e5fb8
--- /dev/null
+++ b/examples/mxroyale/RemoteObjectAMFTest/src/main/royale/App_Jewel.mxml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+               xmlns:j="library://ns.apache.org/royale/jewel"
+               xmlns:js="library://ns.apache.org/royale/basic"
+               xmlns:mx="library://ns.apache.org/royale/mx"
+               >
+
+    <fx:Style source="../../main/resources/styles.css"/>
+
+    <fx:Script>
+		<![CDATA[
+            import valueObjects.ClientValueObject;
+            import valueObjects.Product;
+            import valueObjects.Zone;
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+            import mx.rpc.remoting.Operation;
+            import mx.rpc.AsyncToken;
+            import mx.rpc.Responder;
+            
+			private function onFault(evt:FaultEvent):void
+			{
+                trace("Fault= " + evt.message);
+				for(var key:String in evt["message"])
+				{
+					var element:Object = evt["message"][key];
+					trace(key + ", " + element);					
+				}
+				//trace("Fault = " + evt.message);
+			}
+
+            // Test AsyncToken - Responder
+            private var token:AsyncToken;
+            private var responder:Responder;
+            private function sendEcho(evt:MouseEvent):void
+			{
+                responder = new Responder(onEchoResult, onFault);
+                token = serviceResp.echo.send(nameResp_txt.text);
+                token.addResponder(responder);
+                trace(token);
+            }
+
+            private function onEchoResult(event:ResultEvent):void
+			{
+                trace("[onEchoResult]", event);
+                result_txt.text = event.result as String;
+            }
+		]]>
+	</fx:Script>
+
+    <fx:Declarations>
+        <!-- <mx:RemoteObject id="service" fault="onFault(event)"
+                         endpoint="http://localhost:8080/messagebroker/websocket-amf"
+                         destination="exampleService">
+            <mx:method name="echo">
+                <mx:arguments>
+                    <symbol>{name_txt.text}</symbol>
+                </mx:arguments>
+            </mx:method>
+            <mx:method name="getObjectArray1">
+            </mx:method>
+            <mx:method name="getSomeProduct">
+            </mx:method>
+        </mx:RemoteObject> -->
+        <mx:RemoteObject id="serviceResp" fault="onFault(event)"
+                         endpoint="http://localhost:8080/messagebroker/websocket-amf"
+                         destination="exampleService"/>
+    </fx:Declarations>
+    
+    <j:beads>
+        <js:ClassAliasBead />
+    </j:beads>
+
+    <j:valuesImpl>
+		<js:SimpleCSSValuesImpl />
+	</j:valuesImpl>
+
+    <j:initialView>
+	    <j:ApplicationResponsiveView>
+
+    <!-- <mx:VBox width="400">
+        <mx:HBox>
+            <mx:VBox>
+                <mx:Label text="Name to send via AMF"/>
+                <mx:TextInput id="name_txt"/>                
+            </mx:VBox>
+            <mx:Button label="Send to Name" click="service.echo.send()"/>        
+        </mx:HBox>        
+        <mx:Label text="{(service.echo as Operation).lastResult}"/>
+    </mx:VBox> -->
+
+        <j:VGroup width="400">
+            <j:HGroup>
+                <j:VGroup>
+                    <j:Label text="Name to send via AMF (With Responder)"/>
+                    <j:TextInput id="nameResp_txt"/>                
+                </j:VGroup>
+                <j:Button text="Send to Name (With Responder)" click="sendEcho(event)"/>        
+            </j:HGroup>        
+            <j:Label id="result_txt"/>
+        </j:VGroup>
+        </j:ApplicationResponsiveView>
+    </j:initialView>
+    <!-- <mx:VBox width="400">
+        <mx:Button label="Get Array Of Objects" click="service.getObjectArray1.send()"/>
+        <mx:List id="list" labelField="id" width="100%" height="200" 
+                 dataProvider="{(service.getObjectArray1 as Operation).lastResult}" />
+        <mx:Label text="{list.selectedItem}"/>
+    </mx:VBox>
+    <mx:VBox width="400">
+        <mx:Button label="Get Some Product" click="service.getSomeProduct.send()"/>
+        <mx:Label text="{((service.getSomeProduct as Operation).lastResult as Product).name}"/>
+    </mx:VBox> -->
+</j:Application>
+