You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2017/02/20 15:32:59 UTC
[6/9] git commit: [flex-asjs] [refs/heads/feature/amf] -
RemoteObjectAMFTest project initial commit
RemoteObjectAMFTest project initial commit
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5b3bb539
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5b3bb539
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5b3bb539
Branch: refs/heads/feature/amf
Commit: 5b3bb539cb37d1bd90feafd98618a8cc2f5c0ba9
Parents: eebedf8
Author: Carlos Rovira <ca...@apache.org>
Authored: Sat Feb 18 17:30:26 2017 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Mon Feb 20 16:32:33 2017 +0100
----------------------------------------------------------------------
.../RemoteObjectAMFTest/.vscode/tasks.json | 9 ++
.../flexjs/RemoteObjectAMFTest/asconfig.json | 14 +++
examples/flexjs/RemoteObjectAMFTest/build.xml | 61 ++++++++++++
examples/flexjs/RemoteObjectAMFTest/pom.xml | 98 ++++++++++++++++++++
.../RemoteObjectAMFTest/src/main/flex/App.mxml | 75 +++++++++++++++
.../main/resources/mdl-js-index-template.html | 33 +++++++
.../src/main/resources/mdl-styles.css | 24 +++++
7 files changed, 314 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/.vscode/tasks.json
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/.vscode/tasks.json b/examples/flexjs/RemoteObjectAMFTest/.vscode/tasks.json
new file mode 100644
index 0000000..e562c32
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/.vscode/tasks.json
@@ -0,0 +1,9 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "0.1.0",
+ "command": "mvn",
+ "args": ["clean", "install", "-DskipTests"],
+ "isShellCommand": true,
+ "showOutput": "always"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/asconfig.json
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/asconfig.json b/examples/flexjs/RemoteObjectAMFTest/asconfig.json
new file mode 100644
index 0000000..76a3278
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/asconfig.json
@@ -0,0 +1,14 @@
+{
+ "config": "flex",
+ "compilerOptions": {
+ "debug": true,
+ "source-map": true,
+ "js-output-type": "flexjs",
+ "output": "./target/javascript"
+ },
+ "additionalOptions": "-html-template=src/main/resources/mdl-js-index-template.html -compiler.exclude-defaults-css-files=HTML.swc:defaults.css",
+ "files":
+ [
+ "src/main/flex/App.mxml"
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/build.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/build.xml b/examples/flexjs/RemoteObjectAMFTest/build.xml
new file mode 100644
index 0000000..8c8b891
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/build.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+
+
+<project name="RemoteObjectAMFTest" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../../.."/>
+ <property name="example" value="App" />
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+ <property name="opt1_arg" value="-compiler.exclude-defaults-css-files=HTML.swc:defaults.css" />
+ <property name="opt2_arg" value="-html-template=${basedir}/src/main/resources/mdl-js-index-template.html" />
+
+ <include file="${basedir}/../../build_example.xml" />
+
+ <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}">
+ <mkdir dir="${basedir}/bin/js-debug/assets" />
+ <copy todir="${basedir}/bin/js-debug/assets" >
+ <fileset dir="${basedir}/src/main/resources/assets">
+ <include name="**" />
+ </fileset>
+ </copy>
+ <mkdir dir="${basedir}/bin/js-release/assets" />
+ <copy todir="${basedir}/bin/js-release/assets" >
+ <fileset dir="${basedir}/src/main/resources/assets">
+ <include name="**" />
+ </fileset>
+ </copy>
+ <replace file="${basedir}/bin/js-debug/index.html" token="${primary}" value="indigo" />
+ <replace file="${basedir}/bin/js-debug/index.html" token="${accent}" value="pink" />
+ <replace file="${basedir}/bin/js-release/index.html" token="${primary}" value="indigo" />
+ <replace file="${basedir}/bin/js-release/index.html" token="${accent}" value="pink" />
+ </target>
+
+ <target name="clean">
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ <delete dir="${basedir}/target" failonerror="false" />
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/pom.xml b/examples/flexjs/RemoteObjectAMFTest/pom.xml
new file mode 100644
index 0000000..36bbda6
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/pom.xml
@@ -0,0 +1,98 @@
+<?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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.flex.flexjs.examples</groupId>
+ <artifactId>examples-flexjs</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>RemoteObjectAMFTest</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <packaging>swf</packaging>
+
+ <name>Apache Flex - FlexJS: Examples: FlexJS: RemoteObjectAMFTest</name>
+
+ <properties>
+ <!-- Customize MDL colors using this the tool at : https://getmdl.io/customize/index.html -->
+ <primary>indigo</primary>
+ <accent>pink</accent>
+ </properties>
+
+ <build>
+ <sourceDirectory>src/main/flex</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.flex.flexjs.compiler</groupId>
+ <artifactId>flexjs-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <mainClass>App.mxml</mainClass>
+ <htmlTemplate>${basedir}/target/javascript/bin/js-debug/mdl-js-index-template.html</htmlTemplate>
+ <additionalCompilerOptions>-compiler.exclude-defaults-css-files=HTML-0.8.0-SNAPSHOT.swc:defaults.css</additionalCompilerOptions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>MaterialDesignLite</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>Network</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+
+ <!-- Needed for Flash compilation -->
+ <dependency>
+ <groupId>com.adobe.flash.framework</groupId>
+ <artifactId>playerglobal</artifactId>
+ <version>20.0</version>
+ <type>swc</type>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml b/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
new file mode 100644
index 0000000..eca7f52
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/src/main/flex/App.mxml
@@ -0,0 +1,75 @@
+<?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.
+
+-->
+<mdl:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ xmlns:mdl="library://ns.apache.org/flexjs/mdl"
+ xmlns:local="*">
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.net.events.FaultEvent;
+ import org.apache.flex.net.events.ResultEvent;
+
+ protected function sendName():void
+ {
+ service.send("echo", [name_txt.text]);
+ }
+
+ private function onResult(evt:ResultEvent):void
+ {
+ trace("Result=" + evt.data);
+ }
+
+ private function onFault(evt:FaultEvent):void
+ {
+ trace("Fault=" + evt.message);
+ }
+ ]]>
+ </fx:Script>
+
+ <js:beads>
+ <js:RemoteObject id="service"
+ endPoint = "http://localhost:8080/messagebroker/websocket-amf"
+ destination = "exampleService"
+ source = "exampleService"/>
+ </js:beads>
+
+ <js:initialView>
+ <mdl:Grid>
+
+ <mdl:TextField id="name_txt">
+ <mdl:beads>
+ <mdl:TextPrompt prompt="Text to be sent via AMF RemoteObject..."/>
+ <mdl:Tooltip text="This sample requires an AMF Backend"/>
+ </mdl:beads>
+ </mdl:TextField>
+
+ <mdl:Button text="Send Name to AMF" raised="true" accent="true"
+ click="sendName()"/>
+ </mdl:Grid>
+ </js:initialView>
+
+ <js:valuesImpl>
+ <js:SimpleCSSValuesImpl />
+ </js:valuesImpl>
+
+ <fx:Style source="../../main/resources/mdl-styles.css"/>
+
+</mdl:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-js-index-template.html
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-js-index-template.html b/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-js-index-template.html
new file mode 100644
index 0000000..308fddf
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-js-index-template.html
@@ -0,0 +1,33 @@
+<!--
+ 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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="Custom Template for injecting custom style CSS">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"">
+ <link rel="stylesheet" type="text/css" href="${application}.css">
+ <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+ <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.min.css">
+ <script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
+${head}
+</head>
+<body>
+${body}
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b3bb539/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-styles.css
----------------------------------------------------------------------
diff --git a/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-styles.css b/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-styles.css
new file mode 100644
index 0000000..00cac2b
--- /dev/null
+++ b/examples/flexjs/RemoteObjectAMFTest/src/main/resources/mdl-styles.css
@@ -0,0 +1,24 @@
+/*
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+*/
+
+@namespace "http://www.w3.org/1999/xhtml";
+@namespace js "library://ns.apache.org/flexjs/basic";
+@namespace mdl "library://ns.apache.org/flexjs/mdl";