summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-06-18 12:17:58 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-06-19 11:20:39 +0200
commite7b9be722d4d02499020449b7d72aa24c6c38931 (patch)
tree6c1b4550c3afe81a38e8c137e47bd992f1c94571
parent50d59d45d5b5af18ee1dfb28764b4eec79e94bf6 (diff)
[login] add new demo
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac22
-rwxr-xr-xservices/python/hello-world.py10
-rw-r--r--web-gui/Makefile.am6
-rwxr-xr-xweb-gui/index.sh1
-rw-r--r--web-gui/login/Makefile.am28
-rw-r--r--web-gui/login/Manifest.json34
-rw-r--r--web-gui/login/config.json.in78
-rw-r--r--web-gui/login/dbus-session.conf.in86
-rwxr-xr-xweb-gui/login/generate.py.in72
-rw-r--r--web-gui/login/lighttpd.conf.in67
-rw-r--r--web-gui/login/passwd.admin1
-rw-r--r--web-gui/login/passwd.user1
-rwxr-xr-xweb-gui/login/run.sh.in73
-rw-r--r--web-gui/login/source/class/login/Application.js147
-rw-r--r--web-gui/login/source/class/login/test/DemoTest.js55
-rw-r--r--web-gui/login/source/class/login/theme/Appearance.js18
-rw-r--r--web-gui/login/source/class/login/theme/Color.js18
-rw-r--r--web-gui/login/source/class/login/theme/Decoration.js18
-rw-r--r--web-gui/login/source/class/login/theme/Font.js18
-rw-r--r--web-gui/login/source/class/login/theme/Theme.js21
-rw-r--r--web-gui/login/source/index.html9
-rw-r--r--web-gui/login/source/resource/login/back.pngbin0 -> 98107 bytes
-rw-r--r--web-gui/login/source/script/login.js20
-rw-r--r--web-gui/login/source/translation/readme.txt3
25 files changed, 806 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index fd8f9d9..91cfabf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-DISTCHECK_CONFIGURE_FLAGS = --with-qooxdoo-sdk=@QOOXDOO_SDK@
+DISTCHECK_CONFIGURE_FLAGS = --with-qooxdoo-sdk=@QOOXDOO_SDK@ --with-admin-role=@ADMIN_ROLE@
SUBDIRS = \
web-gui \
diff --git a/configure.ac b/configure.ac
index 5461f87..fe17e6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,22 @@ AC_ARG_WITH([qooxdoo-sdk],AS_HELP_STRING([--with-qooxdoo-sdk=PATH], [Path to qoo
)
AC_SUBST(QOOXDOO_SDK)
+AC_ARG_WITH([admin-role],AS_HELP_STRING([--with-admin-role=NAME], [user name for admin role. Default: `whoami`.]),
+ ADMIN_ROLE="$withval", ADMIN_ROLE=`whoami`)
+AC_SUBST(ADMIN_ROLE)
+
+AC_ARG_WITH([user-role],AS_HELP_STRING([--with-user-role=NAME], [user name for admin role. Default: `whoami`.]),
+ USER_ROLE="$withval", USER_ROLE=`whoami`)
+AC_SUBST(USER_ROLE)
+
+LIGHTTPD_USER=`whoami`
+AC_SUBST(LIGHTTPD_USER)
+
+if test "x$USER_ROLE" = "x$ADMIN_ROLE"; then
+ AC_MSG_ERROR([The user names for admin and user roles are the same. \
+Use --with-admin-role=NAME and --with-user-role=NAME to provide different user names.])
+fi
+
AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
AC_CONFIG_FILES([
@@ -73,6 +89,10 @@ AC_CONFIG_FILES([
web-gui/logging/config.json
web-gui/plot/Makefile
web-gui/plot/config.json
+ web-gui/login/Makefile
+ web-gui/login/config.json
+ web-gui/login/lighttpd.conf
+ web-gui/login/dbus-session.conf
])
AC_CONFIG_FILES([run.sh],[chmod +x run.sh])
AC_CONFIG_FILES([web-gui/hello-world/generate.py],[chmod +x web-gui/hello-world/generate.py])
@@ -80,6 +100,8 @@ AC_CONFIG_FILES([web-gui/calculator/generate.py],[chmod +x web-gui/calculator/ge
AC_CONFIG_FILES([web-gui/live/generate.py],[chmod +x web-gui/live/generate.py])
AC_CONFIG_FILES([web-gui/logging/generate.py],[chmod +x web-gui/logging/generate.py])
AC_CONFIG_FILES([web-gui/plot/generate.py],[chmod +x web-gui/plot/generate.py])
+AC_CONFIG_FILES([web-gui/login/generate.py],[chmod +x web-gui/login/generate.py])
+AC_CONFIG_FILES([web-gui/login/run.sh],[chmod +x web-gui/login/run.sh])
AC_CONFIG_COMMANDS([services/qt4/dbus-info-service/Makefile], [(cd services/qt4/dbus-info-service && $QMAKE ../../../${srcdir}/services/qt4/dbus-info-service/dbus-info-service.pro)])
AC_OUTPUT
diff --git a/services/python/hello-world.py b/services/python/hello-world.py
index 92450ea..cbdc222 100755
--- a/services/python/hello-world.py
+++ b/services/python/hello-world.py
@@ -32,6 +32,16 @@ class Service(dbus.service.Object):
def Echo(self, text):
return text
+ @dbus.service.method("com.pengutronix.jdb.Hello",
+ in_signature='', out_signature='s')
+ def HelloUser(self):
+ return "Hello User!"
+
+ @dbus.service.method("com.pengutronix.jdb.Hello",
+ in_signature='', out_signature='s')
+ def HelloAdmin(self):
+ return "Hello Admin!"
+
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
object = Service()
diff --git a/web-gui/Makefile.am b/web-gui/Makefile.am
index 2f4009a..1e81a4a 100644
--- a/web-gui/Makefile.am
+++ b/web-gui/Makefile.am
@@ -1,5 +1,9 @@
SUBDIRS = \
+ $(DEMODIRS) \
+ login
+
+DEMODIRS = \
hello-world \
calculator \
live \
@@ -9,7 +13,7 @@ SUBDIRS = \
all: index.html
index.html: index.sh Makefile
- sh $< $(SUBDIRS) > $@
+ sh $< $(DEMODIRS) > $@
clean-local:
rm -rf qooxdoo-cache
diff --git a/web-gui/index.sh b/web-gui/index.sh
index 6a9622c..61efe3f 100755
--- a/web-gui/index.sh
+++ b/web-gui/index.sh
@@ -18,6 +18,7 @@ for example in "$@"; do
done
cat << EOF
+<li>Run the run.sh script in web-gui/login for the login demo</li>
</ul>
</body>
</html>
diff --git a/web-gui/login/Makefile.am b/web-gui/login/Makefile.am
new file mode 100644
index 0000000..f6344d8
--- /dev/null
+++ b/web-gui/login/Makefile.am
@@ -0,0 +1,28 @@
+
+QOOXDOO_SOURCE = \
+ Manifest.json \
+ generate.py \
+ source/resource/login/back.png \
+ source/index.html \
+ source/translation/readme.txt \
+ source/class/login/Application.js \
+ source/class/login/test/DemoTest.js \
+ source/class/login/theme/Color.js \
+ source/class/login/theme/Theme.js \
+ source/class/login/theme/Decoration.js \
+ source/class/login/theme/Font.js \
+ source/class/login/theme/Appearance.js
+
+all:
+ ./generate.py build
+
+clean-local:
+ rm -rf build
+
+EXTRA_DIST = \
+ config.json.in \
+ $(QOOXDOO_SOURCE)
+
+MAINTAINERCLEANFILES = \
+ Makefile.in
+
diff --git a/web-gui/login/Manifest.json b/web-gui/login/Manifest.json
new file mode 100644
index 0000000..247562e
--- /dev/null
+++ b/web-gui/login/Manifest.json
@@ -0,0 +1,34 @@
+{
+ "info" :
+ {
+ "name" : "login",
+
+ "summary" : "Custom Application",
+ "description" : "This is a skeleton for a custom application with qooxdoo.",
+
+ "homepage" : "http://some.homepage.url/",
+
+ "license" : "SomeLicense",
+ "authors" :
+ [
+ {
+ "name" : "First Author (uid)",
+ "email" : "first.author@some.domain"
+ }
+ ],
+
+ "version" : "trunk",
+ "qooxdoo-versions": ["1.1"]
+ },
+
+ "provides" :
+ {
+ "namespace" : "login",
+ "encoding" : "utf-8",
+ "class" : "source/class",
+ "resource" : "source/resource",
+ "translation" : "source/translation",
+ "type" : "application"
+ }
+}
+
diff --git a/web-gui/login/config.json.in b/web-gui/login/config.json.in
new file mode 100644
index 0000000..a581c70
--- /dev/null
+++ b/web-gui/login/config.json.in
@@ -0,0 +1,78 @@
+{
+ "name" : "login",
+
+ "include" :
+ [
+ {
+ "path" : "${QOOXDOO_PATH}/tool/data/config/application.json"
+ }
+ ],
+
+ "export" :
+ [
+ "api",
+ "build",
+ "clean",
+ "distclean",
+ "fix",
+ "info",
+ "inspector",
+ "lint",
+ "migration",
+ "pretty",
+ "profiling",
+ "source",
+ "source-all",
+ "test",
+ "test-source",
+ "translation"
+ ],
+
+ "let" :
+ {
+ "APPLICATION" : "login",
+ "QOOXDOO_PATH" : "@QOOXDOO_SDK@",
+ "QXTHEME" : "login.theme.Theme",
+ "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"],
+ "LOCALES" : [ "en" ],
+ "CACHE" : "@abs_builddir@/../qooxdoo-cache",
+ "BUILD_PATH" : "@abs_builddir@/build",
+ "ROOT" : "@abs_srcdir@"
+ }
+
+ // You only need to edit the remainder of this file, if you want to customize
+ // specific jobs, or add own job definitions.
+
+ /*
+ "jobs" :
+ {
+ // Uncomment the following entry to add a contrib or library to your
+ // project; make sure to adapt the path to the Manifest.json; if you are
+ // using a contrib: library, it will be downloaded into the path specified
+ // by the 'cache/downloads' config key
+ "libraries" :
+ {
+ "library" :
+ [
+ {
+ "manifest" : "contrib://SkeletonApplication/trunk/Manifest.json"
+ }
+ ]
+ },
+
+ // If you want to tweak a job setting, see the following sample where
+ // the "format" feature of the "build-script" job is overridden.
+ // To see a list of available jobs, invoke 'generate.py x'.
+ "build-script" :
+ {
+ "compile-options" :
+ {
+ "code" :
+ {
+ "format" : false
+ }
+ }
+ }
+ }
+ */
+}
diff --git a/web-gui/login/dbus-session.conf.in b/web-gui/login/dbus-session.conf.in
new file mode 100644
index 0000000..447378c
--- /dev/null
+++ b/web-gui/login/dbus-session.conf.in
@@ -0,0 +1,86 @@
+<!-- This configuration file controls the per-user-login-session message bus.
+ Add a session-local.conf and edit that rather than changing this
+ file directly. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <!-- Our well-known bus type, don't change this -->
+ <type>session</type>
+
+ <!-- If we fork, keep the user's original umask to avoid affecting
+ the behavior of child processes. -->
+ <keep_umask/>
+
+ <listen>unix:tmpdir=/tmp</listen>
+
+ <standard_session_servicedirs />
+
+ <policy context="default">
+ <!-- Deny everything then punch holes -->
+ <deny send_interface="*"/>
+ <deny receive_interface="*"/>
+ <deny own="*"/>
+ <allow user="@USER_ROLE@"/>
+ <allow user="@ADMIN_ROLE@"/>
+
+ <allow send_destination="org.freedesktop.DBus"/>
+ <allow receive_sender="org.freedesktop.DBus"/>
+ <!-- allow sending valid replies -->
+ <allow send_requested_reply="true" send_type="method_return"/>
+ <allow send_requested_reply="true" send_type="error"/>
+ <!-- allow receiving valid replies -->
+ <allow receive_requested_reply="true"/>
+ </policy>
+ <policy user="@LIGHTTPD_USER@">
+ <allow send_interface="*"/>
+ <allow receive_interface="*"/>
+ <!-- Allow everything to be sent -->
+ <allow send_destination="*" eavesdrop="true"/>
+ <!-- Allow everything to be received -->
+ <allow eavesdrop="true"/>
+ <!-- Allow anyone to own anything -->
+ <allow own="*"/>
+ </policy>
+
+ <policy user="@USER_ROLE@">
+ <allow send_interface="com.pengutronix.jdb.Hello" send_member="HelloUser" />
+ <deny send_interface="com.pengutronix.jdb.Hello" send_member="HelloAdmin" />
+ <allow send_interface="com.pengutronix.jdb.Hello" send_member="HelloWorld" />
+ </policy>
+ <policy user="@ADMIN_ROLE@">
+ <deny send_interface="com.pengutronix.jdb.Hello" send_member="HelloUser" />
+ <allow send_interface="com.pengutronix.jdb.Hello" send_member="HelloAdmin" />
+ <allow send_interface="com.pengutronix.jdb.Hello" send_member="HelloWorld" />
+ </policy>
+
+ <!-- This is included last so local configuration can override what's
+ in this standard file -->
+ <include ignore_missing="yes">session-local.conf</include>
+
+ <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
+
+ <!-- For the session bus, override the default relatively-low limits
+ with essentially infinite limits, since the bus is just running
+ as the user anyway, using up bus resources is not something we need
+ to worry about. In some cases, we do set the limits lower than
+ "all available memory" if exceeding the limit is almost certainly a bug,
+ having the bus enforce a limit is nicer than a huge memory leak. But the
+ intent is that these limits should never be hit. -->
+
+ <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
+ <limit name="max_incoming_bytes">1000000000</limit>
+ <limit name="max_outgoing_bytes">1000000000</limit>
+ <limit name="max_message_size">1000000000</limit>
+ <limit name="service_start_timeout">120000</limit>
+ <limit name="auth_timeout">240000</limit>
+ <limit name="max_completed_connections">100000</limit>
+ <limit name="max_incomplete_connections">10000</limit>
+ <limit name="max_connections_per_user">100000</limit>
+ <limit name="max_pending_service_starts">10000</limit>
+ <limit name="max_names_per_connection">50000</limit>
+ <limit name="max_match_rules_per_connection">50000</limit>
+ <limit name="max_replies_per_connection">50000</limit>
+ <limit name="reply_timeout">300000</limit>
+
+</busconfig>
diff --git a/web-gui/login/generate.py.in b/web-gui/login/generate.py.in
new file mode 100755
index 0000000..2e1f102
--- /dev/null
+++ b/web-gui/login/generate.py.in
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+################################################################################
+#
+# qooxdoo - the new era of web development
+#
+# http://qooxdoo.org
+#
+# Copyright:
+# 2008 - 2009 1&1 Internet AG, Germany, http://www.1und1.de
+#
+# License:
+# LGPL: http://www.gnu.org/licenses/lgpl.html
+# EPL: http://www.eclipse.org/org/documents/epl-v10.php
+# See the LICENSE file in the project's top-level directory for details.
+#
+# Authors:
+# * Thomas Herchenroeder (thron7)
+#
+################################################################################
+
+##
+# This is a stub proxy for the real generator.py
+##
+
+import sys, os, re, subprocess
+
+CMD_PYTHON = 'python'
+QOOXDOO_PATH = '@QOOXDOO_SDK@'
+
+def getQxPath():
+ path = QOOXDOO_PATH
+ # try updating from config file
+ if os.path.exists('config.json'):
+ # "using QOOXDOO_PATH from config.json"
+ qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?')
+ conffile = open('config.json')
+ aconffile = conffile.readlines()
+ for line in aconffile:
+ mo = qpathr.search(line)
+ if mo:
+ path = mo.group(1)
+ break # assume first occurrence is ok
+ path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path))
+
+ return path
+
+os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir
+qxpath = getQxPath()
+REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py')
+
+if not os.path.exists(REAL_GENERATOR):
+ print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR
+ sys.exit(1)
+
+argList = []
+argList.append(CMD_PYTHON)
+argList.append(REAL_GENERATOR)
+argList.extend(sys.argv[1:])
+if sys.platform == "win32":
+ argList1=[]
+ for arg in argList:
+ if arg.find(' ')>-1:
+ argList1.append('"%s"' % arg)
+ else:
+ argList1.append(arg)
+ argList = argList1
+else:
+ argList = ['"%s"' % x for x in argList] # quote argv elements
+
+cmd = " ".join(argList)
+retval = subprocess.call(cmd, shell=True)
+sys.exit(retval)
diff --git a/web-gui/login/lighttpd.conf.in b/web-gui/login/lighttpd.conf.in
new file mode 100644
index 0000000..6da14ec
--- /dev/null
+++ b/web-gui/login/lighttpd.conf.in
@@ -0,0 +1,67 @@
+server.document-root = "@abs_builddir@/build"
+
+server.port = 8080
+server.bind = "localhost"
+server.tag = "lighttpd"
+
+server.errorlog = "@abs_builddir@/error.log"
+
+server.modules = (
+ "mod_fastcgi",
+ "mod_auth"
+)
+
+# mimetype mapping
+mimetype.assign = (
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".xml" => "text/xml",
+)
+
+index-file.names = ( "index.html" )
+
+fastcgi.server = (
+ "/rpc/user" => ((
+ "socket" => "/tmp/json-dbus-bridge.user.socket",
+ "check-local" => "disable",
+ "mode" => "responder",
+ "max-procs" => 1,
+ )),
+ "/rpc/admin" => ((
+ "socket" => "/tmp/json-dbus-bridge.admin.socket",
+ "check-local" => "disable",
+ "mode" => "responder",
+ "max-procs" => 1,
+ )),
+)
+
+$HTTP["url"] =~ "^/rpc/user" {
+ auth.backend = "plain"
+ auth.backend.plain.userfile = "@abs_srcdir@/passwd.user"
+ auth.require = (
+ "/rpc/user" => (
+ "method" => "basic",
+ "realm" => "web-user",
+ "require" => "valid-user"
+ )
+ )
+}
+
+$HTTP["url"] =~ "^/rpc/admin" {
+ auth.backend = "plain"
+ auth.backend.plain.userfile = "@abs_srcdir@/passwd.admin"
+ auth.require = (
+ "/rpc/admin" => (
+ "method" => "basic",
+ "realm" => "web-admin",
+ "require" => "valid-user"
+ )
+ )
+}
+
diff --git a/web-gui/login/passwd.admin b/web-gui/login/passwd.admin
new file mode 100644
index 0000000..19fdd99
--- /dev/null
+++ b/web-gui/login/passwd.admin
@@ -0,0 +1 @@
+admin:geheim
diff --git a/web-gui/login/passwd.user b/web-gui/login/passwd.user
new file mode 100644
index 0000000..ac26a20
--- /dev/null
+++ b/web-gui/login/passwd.user
@@ -0,0 +1 @@
+tux:fisch
diff --git a/web-gui/login/run.sh.in b/web-gui/login/run.sh.in
new file mode 100755
index 0000000..9154591
--- /dev/null
+++ b/web-gui/login/run.sh.in
@@ -0,0 +1,73 @@
+#!/bin/bash
+#
+# json dbus bridge
+#
+# Copyright (c) 2010 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# To the extent possible under law, Pengutronix e.K. has waived all copyright
+# and related or neighboring rights to JSON-DBus-Bridge Demo Code.
+#
+
+if [ "`whoami`" != "root" ]; then
+ echo This script must be run by root.
+fi
+
+if [ ! -f "@abs_builddir@/build/index.html" ]; then
+ echo
+ echo 'You must run "make" before running this script'
+ echo
+ exit 1
+fi
+
+finish() {
+ kill $hello_pid
+ kill $lighttpd_pid
+ kill $jdb_user_pid
+ kill $jdb_admin_pid
+ kill $DBUS_SESSION_BUS_PID
+ exit
+}
+
+trap finish SIGINT
+
+eval `su -c "dbus-launch --config-file='@abs_builddir@/dbus-session.conf' --sh-syntax" @LIGHTTPD_USER@`
+
+su -c "@abs_top_srcdir@/services/python/hello-world.py" @LIGHTTPD_USER@ &
+hello_pid=$!
+
+su -c "'@JSON_DBUS_BRIDGE@' '/tmp/json-dbus-bridge.user.socket'" @USER_ROLE@ &
+jdb_user_pid=$!
+
+su -c "'@JSON_DBUS_BRIDGE@' '/tmp/json-dbus-bridge.admin.socket'" @ADMIN_ROLE@ &
+jdb_admin_pid=$!
+sleep 0.5
+chmod a+rw '/tmp/json-dbus-bridge.admin.socket'
+
+su -c "@LIGHTTPD@ -f '@abs_builddir@/lighttpd.conf' -D" @LIGHTTPD_USER@ &
+lighttpd_pid=$!
+
+echo -n "waiting for lighttpd "
+for i in `seq 10`; do
+ sleep 1
+ echo -n "."
+ wget -e no_proxy=localhost -O - -q http://localhost:8080/ > /dev/null && break
+done
+
+if [ $? -ne 0 ]; then
+ echo
+ echo
+ echo starting lighttpd failed!
+ finish
+ exit 1
+else
+ echo
+ echo
+ echo lighttpd sucessfully started.
+ echo
+ echo The demo page can be view at http://localhost:8080/
+fi
+
+while [ 1 ]; do
+ sleep 100
+done
+
diff --git a/web-gui/login/source/class/login/Application.js b/web-gui/login/source/class/login/Application.js
new file mode 100644
index 0000000..6d0e0e5
--- /dev/null
+++ b/web-gui/login/source/class/login/Application.js
@@ -0,0 +1,147 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#asset(login/*)
+
+************************************************************************ */
+
+/**
+ * This is the main application class of your custom application "login"
+ */
+qx.Class.define("login.Application",
+{
+extend : qx.application.Standalone,
+
+
+
+/*
+*****************************************************************************
+ MEMBERS
+*****************************************************************************
+*/
+
+members :
+{
+ __users: null,
+ __result: null,
+ __error: null,
+ __rpc: null,
+ /**
+ * This method contains the initial application code and gets called
+ * during startup of the application
+ *
+ * @lint ignoreDeprecated(alert)
+ */
+ main : function()
+ {
+ // Call super class
+ this.base(arguments);
+
+ // Enable logging in debug variant
+ if (qx.core.Variant.isSet("qx.debug", "on"))
+ {
+ // support native logging capabilities, e.g. Firebug for Firefox
+ qx.log.appender.Native;
+ // support additional cross-browser console. Press F7 to toggle visibility
+ qx.log.appender.Console;
+ }
+
+ /*
+ -------------------------------------------------------------------------
+ Below is your actual application code...
+ -------------------------------------------------------------------------
+ */
+
+ var doc = this.getRoot();
+ doc.setBackgroundColor("#ffffff");
+
+ var back = new qx.ui.basic.Image("login/back.png");
+ back.setScale(true);
+ doc.add(back, {left:0, top: 0});
+
+
+ var core = new qx.ui.container.Composite(new qx.ui.layout.Grid());
+ doc.add(core, {left: 120, top: 100});
+ core.getLayout().setSpacing(10);
+ core.getLayout().setColumnAlign(0, "left", "middle");
+ core.getLayout().setColumnFlex(3, 100);
+ core.setWidth(800);
+
+
+ core.add( new qx.ui.basic.Label("Login Data:"), {row: 0, column: 0, colSpan: 3});
+
+ var lUser = new qx.ui.form.RadioButton("User Role");
+ core.add(lUser, {row: 1, column: 0});
+ lUser.user = "tux";
+ lUser.passwd = "fisch";
+ lUser.url = "http://localhost:8080/rpc/user"
+ var lAdmin = new qx.ui.form.RadioButton("Admin Role");
+ core.add(lAdmin, {row: 1, column: 1});
+ lAdmin.user = "admin";
+ lAdmin.passwd = "geheim";
+ lAdmin.url = "http://localhost:8080/rpc/admin"
+ var lInvalid = new qx.ui.form.RadioButton("Invalid Login Data");
+ core.add(lInvalid, {row: 1, column: 2});
+ lInvalid.user = "tux";
+ lInvalid.passwd = "wrong";
+ lInvalid.url = "http://localhost:8080/rpc/user"
+
+ this.__users = new qx.ui.form.RadioGroup(lUser, lAdmin, lInvalid);
+
+ core.add( new qx.ui.basic.Label("Call:"), {row: 2, column: 0, colSpan: 3});
+ this.__users.setSelection([lUser]);
+
+ var helloWorld = new qx.ui.form.Button("Hello World");
+ core.add(helloWorld, {row: 3, column: 0});
+ helloWorld.addListener("execute", function() {
+ this.__call("HelloWorld");}, this);
+ var helloUser = new qx.ui.form.Button("Hello User");
+ core.add(helloUser, {row: 3, column: 1});
+ helloUser.addListener("execute", function() {
+ this.__call("HelloUser");}, this);
+ var helloAdmin = new qx.ui.form.Button("Hello Admin");
+ core.add(helloAdmin, {row: 3, column: 2});
+ helloAdmin.addListener("execute", function() {
+ this.__call("HelloAdmin");}, this);
+
+ core.add( new qx.ui.basic.Label("Result:"), {row: 4, column: 0});
+ this.__result = new qx.ui.basic.Label("<result>");
+ core.add(this.__result, {row: 4, column: 1, colSpan: 3});
+
+ core.add( new qx.ui.basic.Label("Error:"), {row: 5, column: 0});
+ this.__error = new qx.ui.basic.Label("<error>");
+ this.__error.setRich(true);
+ core.add(this.__error, {row: 5, column: 1, colSpan: 4});
+
+ this.__rpc = new qx.io.remote.Rpc("http://localhost:8080/rpc", "com.pengutronix.jdb.Hello|/");
+ this.__rpc.setUseBasicHttpAuth(true);
+ },
+ __call: function(func) {
+ var radio = this.__users.getSelection()[0];
+ this.__rpc.setUsername(radio.user);
+ this.__rpc.setPassword(radio.passwd);
+ this.__rpc.setUrl(radio.url);
+ this.__rpc.callAsync(qx.lang.Function.bind(this.__callback, this),
+ "com.pengutronix.jdb.Hello." + func);
+ },
+ __callback: function(result, error) {
+ if (error != null) {
+ this.__result.setValue("");
+ this.__error.setValue(error);
+ }
+ else {
+ this.__result.setValue(result);
+ this.__error.setValue("");
+ }
+ }
+}
+});
diff --git a/web-gui/login/source/class/login/test/DemoTest.js b/web-gui/login/source/class/login/test/DemoTest.js
new file mode 100644
index 0000000..3edeff0
--- /dev/null
+++ b/web-gui/login/source/class/login/test/DemoTest.js
@@ -0,0 +1,55 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/**
+ * This class demonstrates how to define unit tests for your application.
+ *
+ * Execute <code>generate.py test</code> to generate a testrunner application
+ * and open it from <tt>test/index.html</tt>
+ *
+ * The methods that contain the tests are instance methods with a
+ * <code>test</code> prefix. You can create an arbitrary number of test
+ * classes like this one. They can be organized in a regular class hierarchy,
+ * i.e. using deeper namespaces and a corresponding file structure within the
+ * <tt>test</tt> folder.
+ */
+qx.Class.define("login.test.DemoTest",
+{
+ extend : qx.dev.unit.TestCase,
+
+ members :
+ {
+ /*
+ ---------------------------------------------------------------------------
+ TESTS
+ ---------------------------------------------------------------------------
+ */
+
+ /**
+ * Here are some simple tests
+ */
+ testSimple : function()
+ {
+ this.assertEquals(4, 3+1, "This should never fail!");
+ this.assertFalse(false, "Can false be true?!");
+ },
+
+ /**
+ * Here are some more advanced tests
+ */
+ testAdvanced: function ()
+ {
+ var a = 3;
+ var b = a;
+ this.assertIdentical(a, b, "A rose by any other name is still a rose");
+ this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!");
+ }
+ }
+});
diff --git a/web-gui/login/source/class/login/theme/Appearance.js b/web-gui/login/source/class/login/theme/Appearance.js
new file mode 100644
index 0000000..4d4f9bf
--- /dev/null
+++ b/web-gui/login/source/class/login/theme/Appearance.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("login.theme.Appearance",
+{
+ extend : qx.theme.modern.Appearance,
+
+ appearances :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/login/source/class/login/theme/Color.js b/web-gui/login/source/class/login/theme/Color.js
new file mode 100644
index 0000000..916c1d5
--- /dev/null
+++ b/web-gui/login/source/class/login/theme/Color.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("login.theme.Color",
+{
+ extend : qx.theme.modern.Color,
+
+ colors :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/login/source/class/login/theme/Decoration.js b/web-gui/login/source/class/login/theme/Decoration.js
new file mode 100644
index 0000000..f55b36e
--- /dev/null
+++ b/web-gui/login/source/class/login/theme/Decoration.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("login.theme.Decoration",
+{
+ extend : qx.theme.modern.Decoration,
+
+ decorations :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/login/source/class/login/theme/Font.js b/web-gui/login/source/class/login/theme/Font.js
new file mode 100644
index 0000000..5768e84
--- /dev/null
+++ b/web-gui/login/source/class/login/theme/Font.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("login.theme.Font",
+{
+ extend : qx.theme.modern.Font,
+
+ fonts :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/login/source/class/login/theme/Theme.js b/web-gui/login/source/class/login/theme/Theme.js
new file mode 100644
index 0000000..6b5439f
--- /dev/null
+++ b/web-gui/login/source/class/login/theme/Theme.js
@@ -0,0 +1,21 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("login.theme.Theme",
+{
+ meta :
+ {
+ color : login.theme.Color,
+ decoration : login.theme.Decoration,
+ font : login.theme.Font,
+ icon : qx.theme.icon.Tango,
+ appearance : login.theme.Appearance
+ }
+}); \ No newline at end of file
diff --git a/web-gui/login/source/index.html b/web-gui/login/source/index.html
new file mode 100644
index 0000000..5a7c664
--- /dev/null
+++ b/web-gui/login/source/index.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>login</title>
+ <script type="text/javascript" src="script/login.js"></script>
+</head>
+<body></body>
+</html>
diff --git a/web-gui/login/source/resource/login/back.png b/web-gui/login/source/resource/login/back.png
new file mode 100644
index 0000000..fd06541
--- /dev/null
+++ b/web-gui/login/source/resource/login/back.png
Binary files differ
diff --git a/web-gui/login/source/script/login.js b/web-gui/login/source/script/login.js
new file mode 100644
index 0000000..999122f
--- /dev/null
+++ b/web-gui/login/source/script/login.js
@@ -0,0 +1,20 @@
+/*
+ * This is mock content and will be overwritten with the first 'generate.py source'.
+ */
+function inform(){
+ var message =
+ "<div style='font-family: Verdana'>" +
+ "<h2>Application not yet ready!</h2>" +
+ "<div>Please use the generator to build this application, i.e. run <i>'generate.py source'</i> in an OS shell; then reload this page.</div>" +
+ "</div>";
+
+ window.setTimeout(function() {
+ document.body.innerHTML = message;
+ }, 0);
+}
+
+if (window.attachEvent) {
+ window.attachEvent("onload", inform);
+} else {
+ window.addEventListener("load", inform, false);
+}
diff --git a/web-gui/login/source/translation/readme.txt b/web-gui/login/source/translation/readme.txt
new file mode 100644
index 0000000..66975e6
--- /dev/null
+++ b/web-gui/login/source/translation/readme.txt
@@ -0,0 +1,3 @@
+This directory will contain translation (.po) files once you run the
+'translation' job in your project.
+