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/09/23 22:02:29 UTC

[royale-asjs] branch develop updated: refactor names in latest blog example about HTTPService

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 87d3f4d  refactor names in latest blog example about HTTPService
87d3f4d is described below

commit 87d3f4d1d406f04ba61dc7f98faa9d0d89f31bd9
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Sep 24 00:02:22 2018 +0200

    refactor names in latest blog example about HTTPService
---
 ..._Loading_external_data_through_HTTPService.as3proj} |  4 ++--
 .../README.txt                                         |  2 +-
 .../asconfig.json                                      |  2 +-
 .../build.xml                                          |  0
 .../pom.xml                                            |  6 +++---
 .../main/resources/jewel-example-index-template.html   |  0
 ...011_Loading_external_data_through_HTTPService.mxml} |  8 ++++----
 .../src/main/royale/services/GitHubService.as          | 18 +++++++++---------
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/BE0011_Loading_Github_external_data_through_HTTPService.as3proj b/examples/blog/BE0011_Loading_external_data_through_HTTPService/BE0011_Loading_external_data_through_HTTPService.as3proj
similarity index 94%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/BE0011_Loading_Github_external_data_through_HTTPService.as3proj
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/BE0011_Loading_external_data_through_HTTPService.as3proj
index c1f771c..dd1f9b6 100644
--- a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/BE0011_Loading_Github_external_data_through_HTTPService.as3proj
+++ b/examples/blog/BE0011_Loading_external_data_through_HTTPService/BE0011_Loading_external_data_through_HTTPService.as3proj
@@ -20,7 +20,7 @@
 <project>
   <output>
     <movie disabled="False"/>
-    <movie path="bin-debug/BE0011_Loading_Github_external_data_through_HTTPService.swf"/>
+    <movie path="bin-debug/BE0011_Loading_external_data_through_HTTPService.swf"/>
     <movie version="11"/>
     <movie input=""/>
     <movie width="800"/>
@@ -69,7 +69,7 @@
   </intrinsics>
   <library></library>
   <compileTargets>
-    <compile path="src/main/royale/BE0011_Loading_Github_external_data_through_HTTPService.mxml"/>
+    <compile path="src/main/royale/BE0011_Loading_external_data_through_HTTPService.mxml"/>
   </compileTargets>
   <hiddenPaths></hiddenPaths>
   <preBuildCommand>null</preBuildCommand>
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/README.txt b/examples/blog/BE0011_Loading_external_data_through_HTTPService/README.txt
similarity index 96%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/README.txt
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/README.txt
index c3450c0..559a47e 100644
--- a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/README.txt
+++ b/examples/blog/BE0011_Loading_external_data_through_HTTPService/README.txt
@@ -19,7 +19,7 @@
 
 DESCRIPTION
 
-Loading Github external data through HTTPService
+Loading external data through HTTPService
 
 Learn how to use the HTTPService to load external data from a server. In this case we load the source code of
 this example using the Github API in a Royale panel to browse it.
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/asconfig.json b/examples/blog/BE0011_Loading_external_data_through_HTTPService/asconfig.json
similarity index 94%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/asconfig.json
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/asconfig.json
index 11e01f3..5eaca27 100644
--- a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/asconfig.json
+++ b/examples/blog/BE0011_Loading_external_data_through_HTTPService/asconfig.json
@@ -29,6 +29,6 @@
     "additionalOptions": "-remove-circulars -js-output-optimization=skipAsCoercions",
     "files":
     [
-        "src/main/royale/BE0011_Loading_Github_external_data_through_HTTPService.mxml"
+        "src/main/royale/BE0011_Loading_external_data_through_HTTPService.mxml"
     ]
 }
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/build.xml b/examples/blog/BE0011_Loading_external_data_through_HTTPService/build.xml
similarity index 100%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/build.xml
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/build.xml
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/pom.xml b/examples/blog/BE0011_Loading_external_data_through_HTTPService/pom.xml
similarity index 89%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/pom.xml
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/pom.xml
index 9656ac4..fec46bb 100644
--- a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/pom.xml
+++ b/examples/blog/BE0011_Loading_external_data_through_HTTPService/pom.xml
@@ -26,11 +26,11 @@
     <version>0.9.4-SNAPSHOT</version>
   </parent>
 
-  <artifactId>BE0011_Loading_Github_external_data_through_HTTPService</artifactId>
+  <artifactId>BE0011_Loading_external_data_through_HTTPService</artifactId>
   <version>0.9.4-SNAPSHOT</version>
   <packaging>swf</packaging>
 
-  <name>Apache Royale: Examples: Blog: 0011: Loading Github external data through HTTPService</name>
+  <name>Apache Royale: Examples: Blog: 0011: Loading external data through HTTPService</name>
 
   <build>
     <sourceDirectory>src/main/royale</sourceDirectory>
@@ -40,7 +40,7 @@
         <artifactId>royale-maven-plugin</artifactId>
         <extensions>true</extensions>
         <configuration>
-          <mainClass>BE0011_Loading_Github_external_data_through_HTTPService.mxml</mainClass>
+          <mainClass>BE0011_Loading_external_data_through_HTTPService.mxml</mainClass>
           <targets>SWF, JSRoyale</targets>
           <debug>false</debug>
           <htmlTemplate>${basedir}/target/javascript/bin/js-debug/jewel-example-index-template.html</htmlTemplate>
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/resources/jewel-example-index-template.html b/examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/resources/jewel-example-index-template.html
similarity index 100%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/resources/jewel-example-index-template.html
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/resources/jewel-example-index-template.html
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/BE0011_Loading_Github_external_data_through_HTTPService.mxml b/examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/BE0011_Loading_external_data_through_HTTPService.mxml
similarity index 90%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/BE0011_Loading_Github_external_data_through_HTTPService.mxml
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/BE0011_Loading_external_data_through_HTTPService.mxml
index 172e447..2905a2a 100644
--- a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/BE0011_Loading_Github_external_data_through_HTTPService.mxml
+++ b/examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/BE0011_Loading_external_data_through_HTTPService.mxml
@@ -46,7 +46,7 @@
 	</fx:Script>
     
     <services:GitHubService id="service" 
-                            sourceCodeUrl="https://api.github.com/repos/apache/royale-asjs/contents/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/BE0011_Loading_Github_external_data_through_HTTPService.mxml"
+                            sourceCodeUrl="https://api.github.com/repos/apache/royale-asjs/contents/examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/BE0011_Loading_external_data_through_HTTPService.mxml"
                             dataReady="dataReadyHandler(event)"/>
 
     <j:initialView>
@@ -56,7 +56,7 @@
             </js:beads>
 
             <j:Card percentWidth="90">
-                <html:H3 text="Loading Github external data through HTTPService"/>
+                <html:H3 text="Loading external data through HTTPService"/>
                 
                 <j:Label text="This example loads its source code in the text code panel:"/>
 
@@ -67,9 +67,9 @@
                     <html:Code id="sourceCodeMXMLText"/>
                 </html:Pre>
                 
-                <j:Label id="jsonData" multiline="true" html="This label show JSON data when loaded."/>
+                <j:Label id="jsonData" multiline="true" html="This label shows JSON data when loaded."/>
 
-                <j:Button text="Retrieve source code from github" emphasis="primary" click="getGithubContent(event)"/>
+                <j:Button text="Retrieve source code from Github" emphasis="primary" click="getGithubContent(event)"/>
              </j:Card>
         </j:View>
     </j:initialView>
diff --git a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/services/GitHubService.as b/examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/services/GitHubService.as
similarity index 90%
rename from examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/services/GitHubService.as
rename to examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/services/GitHubService.as
index d8e2970..a07b17a 100644
--- a/examples/blog/BE0011_Loading_Github_external_data_through_HTTPService/src/main/royale/services/GitHubService.as
+++ b/examples/blog/BE0011_Loading_external_data_through_HTTPService/src/main/royale/services/GitHubService.as
@@ -18,11 +18,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 package services
 {
-	import org.apache.royale.net.HTTPService;
-	import org.apache.royale.net.HTTPHeader;
-	import org.apache.royale.events.EventDispatcher;
 	import org.apache.royale.events.Event;
-    import org.apache.royale.utils.string.Base64;
+	import org.apache.royale.events.EventDispatcher;
+	import org.apache.royale.net.HTTPConstants;
+	import org.apache.royale.net.HTTPService;
+	import org.apache.royale.utils.string.Base64;
 
     [Event(name="dataReady", type="org.apache.royale.events.Event")]
     /**
@@ -37,7 +37,7 @@ package services
         public function GitHubService():void
         {    
             service = new HTTPService();
-            service.addEventListener("complete", completeHandler);
+            service.addEventListener(HTTPConstants.COMPLETE, completeHandler);
         }
 
         /**
@@ -46,7 +46,7 @@ package services
 		private var service:HTTPService;
 
         /**
-         * we dispatch an event once we have the source code from gihub
+         * we dispatch an event once we have the source code from github
          */
         private function completeHandler(event:Event):void
         {
@@ -66,9 +66,9 @@ package services
             _sourceCodeUrl = value;
             service.url = sourceCodeUrl;
         }
-
+        
         /**
-         * json return the retrieved GitHub JSON Object
+         * json returns the retrieved GitHub JSON Object
          */
         public function get json():Object
         {
@@ -76,7 +76,7 @@ package services
         }
 
         /**
-         * jsonToString return the retrieved GitHub JSON Object as String
+         * jsonToString returns the retrieved GitHub JSON Object as String
          */
         public function get jsonToString():String
         {