tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1188045 [3/4] - in /tuscany/sca-cpp/trunk: ./ modules/edit/ modules/edit/htdocs/ modules/edit/htdocs/account/ modules/edit/htdocs/app/ modules/edit/htdocs/clone/ modules/edit/htdocs/create/ modules/edit/htdocs/data/ modules/edit/htdocs/gra...
Date Mon, 24 Oct 2011 08:45:56 GMT
Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html Mon Oct 24 08:45:54 2011
@@ -19,78 +19,417 @@
 -->
 <html manifest="/cache-manifest.cmf">
 <head>
-<title>Home</title>
+<title></title>
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
 <meta name="apple-mobile-web-app-capable" content="yes"/>
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
-<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
+<base href="/"/>
+<script type="text/javascript">
+
+window.appcache = {};
+
+/**
+ * Get and cache a resource.
+ */
+appcache.get = function(uri) {
+    var h = uri.indexOf('#');
+    var u = h == -1? uri : uri.substring(0, h);
+
+    // Get resource from local storage first
+    var item = localStorage.getItem(u);
+    if (item != null && item != '')
+        return item;
+
+    // Get resource from network
+    var http = new XMLHttpRequest();
+    http.open("GET", u, false);
+    http.send(null);
+    if (http.status == 200) {
+        if (http.getResponseHeader("X-Login") != null) {
+            if (log) log('http err', u, 'X-Login');
+            return null;
+        } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) {
+            if (log) log('http err', u, 'No-Content');
+            return null;
+        }
+        localStorage.setItem(u, http.responseText);
+        return http.responseText;
+    }
+    if (log) log('http err', u, http.status, http.statusText);
+    return null;
+};
+
+// Load Javascript and CSS
+(function() {
+    var bootjs = document.createElement('script');
+    bootjs.type = 'text/javascript';
+    bootjs.text = appcache.get('/all-min.js');
+    document.head.appendChild(bootjs);
+    document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css')));
+})();
+
+</script>
 </head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
-<div id="bodydiv" class="bodydiv">
+<body class="delayed" onload="onload();">
+<div id="mainbodydiv" class="mainbodydiv" style="overflow: visible;">
 
 <div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
+<script type="text/javascript">
+(function() {
+$('headdiv').appendChild(ui.declareScript(appcache.get('/headconfig.js')));
+})();
+</script>
 </div>
 
-<div id="menu"></div>
-
-<table style="width: 100%;">
-<tr><td><h2><span id="h1"></span></h2></td></tr>
-</table>
+<div id="menubackground" style="position: absolute; top: 0px; left: 0px; z-index: -1; width: 100%; visibility: hidden;">
+<table cellpadding="0" cellspacing="0" width="100%" class="tbar"><tr><td class="dtbar">
+<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ltbar"><span class="tbarsmenu">>&nbsp</span></td></tr></table>
+</td></tr></table>
+</div>
 
-<div style="margin-left: auto; margin-right: auto; text-align: center;">
+<div id="menu"></div>
 
-<div id="maintitle" style="font-size: 150%;"></div>
+<div id="content" class="bodydiv" style="overflow: visible;">
+<div id="viewcontainer"></div>
+</div>
 
-<div id="maindiagram"><div id="diagram" style="width: 320px; height: 280px; background: url(home.png); padding: 0px; margin: 0px auto;"></div></div>
+<script type="text/javascript">
 
-<input type="button" class="greenbutton" style="font-size: 150%; font-weight: bold; font-style: italic; padding: 10px;" id="getstarted" title="Get Started" value="Get Started"/>
+// Set page titles
+document.title = ui.windowtitle(location.hostname);
 
-<br/><br/>
-<div>Requires Safari 5+, Chrome 11+, Firefox 4+, IE 9+</div>
+// Init div variables
+var bdiv = $('mainbodydiv');
+var mdiv = $('menu'); 
+var cdiv = $('content'); 
+var mbgdiv = $('menubackground'); 
+mbgdiv.style.top = ui.pixpos(mdiv.offsetTop);
+var vcontainer = $('viewcontainer');
+vcontainer.className = ui.isMobile()? 'viewcontainer3dm' : 'viewcontainer3d';
+
+/**
+ * Pre-fetch app resources.
+ */
+var appresources = [
+    ['/all-min.js'],
+    ['/ui-min.css'],
+    ['/account/', 'flip'],
+    ['/clone/', 'flip'],
+    ['/create/', 'flip'],
+    ['/footconfig.js'],
+    ['/graph/', 'flip'],
+    ['/headconfig.js'],
+    ['/home/', 'right'],
+    ['/home/home.b64'],
+    ['/page/', 'flip'],
+    ['/public/app.b64'],
+    ['/public/grid72.b64'],
+    ['/public/iframe.html'],
+    ['/public/img.b64'],
+    ['/public/user.b64'],
+    ['/stats/', 'flip'],
+    ['/store/', 'left']
+];
+
+/**
+ * Handle application cache events.
+ */
+applicationCache.addEventListener('checking', function(e) {
+    //log('appcache checking', e);
+}, false);
+applicationCache.addEventListener('error', function(e) {
+    //log('appcache error', e);
+}, false);
+applicationCache.addEventListener('noupdate', function(e) {
+    //log('appcache noupdate', e);
+}, false);
+applicationCache.addEventListener('downloading', function(e) {
+    //log('appcache downloading', e);
+}, false);
+applicationCache.addEventListener('progress', function(e) {
+    //log('appcache progress', e);
+}, false);
+applicationCache.addEventListener('updateready', function(e) {
+    //log('appcache updateready', e);
+    applicationCache.swapCache();
+    //log('appcache swapped', e);
+}, false);
+applicationCache.addEventListener('cached', function(e) {
+    //log('appcache cached', e);
+    map(function(res) {
+        appcache.get(res[0]);
+    }, appresources);
+}, false);
+
+/**
+ * Handle network offline/online events.
+ */
+window.addEventListener('offline', function(e) {
+      //log('going offline');
+}, false);
+window.addEventListener('online', function(e) {
+      //log('going online');
+}, false);
+
+//log(navigator.onLine? 'online' : 'offline');
+
+/**
+ * Handle view transitions.
+ */
+
+// Keep track of the current view url and uri
+var viewurl = '';
+var viewuri = '';
+var viewidx = '';
+var viewdiv;
+
+/**
+ * Record which transitions should be applied to each resource.
+ */
+var apptransitions = {};
+map(function(res) {
+    if (res.length > 1)
+        apptransitions[res[0]] = res[1];
+}, appresources);
+
+/**
+ * Return the transition that should be applied to a resource.
+ */
+function viewtransition(uri) {
+    var t = apptransitions[uri];
+    return isNil(t)? 'left' : t;
+}
 
-</div>
+/**
+ * Create a new view div.
+ */
+function mkviewdiv(cname) {
+    var vdiv = document.createElement('div');
+    vdiv.className = cname;
+    if (!ui.isMobile())
+        return vdiv;
+
+    // Handle view transition end
+    function viewdivtransitionend(e) {
+        if (e.target.className == 'leftviewunloaded3dm' || e.target.className == 'rightviewunloaded3dm' || e.target.className == 'flipviewunloaded3dm')
+            e.target.parentNode.removeChild(e.target);
+    }
+    vdiv.addEventListener('webkitTransitionEnd', viewdivtransitionend, false);
+    vdiv.addEventListener('transitionend', viewdivtransitionend, false);
+    return vdiv;
+}
 
-<script type="text/javascript">
+/**
+ * Return the last visited location.
+ */
+function lastvisited() {
+    var loc = localStorage.getItem('ui.lastvisited')
+    if (!isNil(loc))
+        return loc;
+    return '' + location;
+}
 
-// On mobile devices, redirect to the last visited page
-if (ui.isMobile() && (document.referrer == null || document.referrer == '')) {
-    var last = ui.lastvisited();
-    if (!isNil(last) && last != document.location)
-        window.open(last, '_self');
+/**
+ * Build and show the menu bar.
+ */
+function showmenu(mdiv, view, appname) {
+    mdiv.innerHTML = ui.menubar(
+        append(mklist(ui.menu('Home', '/', '_view', view == 'home'), ui.menu('Store', '/#view=store', '_view', view === 'store')),
+                (isNil(appname) || appname == 'undefined')?
+                    mklist() :
+                    mklist(
+                        ui.menu('Stats', '/#view=stats&app=' + appname, '_view', view == 'stats'),
+                        ui.menu('Page', '/#view=page&app=' + appname, '_view', view == 'page'),
+                        ui.menu(isNil(config.compose)? 'Composition' : config.compose, '/#view=graph&app=' + appname, '_view', view == 'graph'))),
+        mklist(ui.menu('Account', '/#view=account', '_view', view == 'account'), ui.menu('Sign out', '/logout/', '_self', false)));
 }
 
-// Init and display this page
-ui.initbody();
+/**
+ * Show a view.
+ */
+function showview(url) {
+    //log('showview', url);
+
+    // Save last visited location
+    localStorage.setItem('ui.lastvisited', url);
+
+    // Determine the view to show
+    var params = ui.fragmentParams(url);
+    var view = isNil(params['view'])? 'home' : params['view'];;
+    var uri = '/' + view + '/';
+    var idx = isNil(params['idx'])? '1' : params['idx'];
+
+    // Determine the transition to use
+    var vt = viewtransition(uri);
+    var ovt = viewtransition(viewuri);
+    var vtransition;
+    if (ovt == 'flip')
+        vtransition = 'flip';
+    else if (uri == viewuri && (vt == 'left' || vt == 'right'))
+        vtransition = idx >= viewidx? 'left' : 'right';
+    else
+        vtransition = vt;
+
+    // Track current view url and uri
+    viewurl = url;
+    viewuri = uri;
+    viewidx = idx;
+
+    // Show the menu bar
+    var appname = params['app'];
+    showmenu(mdiv, view, appname);
+    cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight);
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 0);
+
+    // Compute the viewport size
+    var iswide = view == 'graph' || view == 'page';
+    var vwidth = iswide? '2500px' : '100%';
+    mbgdiv.style.visibility = iswide? 'visible' : 'hidden';
+    mbgdiv.style.width = vwidth;
+
+    // Start to unload the front view and create a new view
+    if (ui.isMobile()) {
+        // Prepare current view for transition out
+        var ovdiv = viewdiv;
+        if (!isNil(ovdiv)) {
+            ovdiv.skipNode = true;
+            ovdiv.className = 'viewunloading3dm';
+        }
+
+        // Load the requested doc into a new view
+        var vdiv = mkviewdiv(vtransition + 'viewloading3dm');
+        vcontainer.appendChild(vdiv);
+        var vdoc = appcache.get(uri);
+        vdiv.innerHTML = vdoc;
+        map(ui.evalScript, ui.innerScripts(vdiv));
+
+        // Show the document
+        if (document.body.style.visibility != 'visible')
+            document.body.style.visibility = 'visible';
+
+        setTimeout(function() {
+            // Transition the old view out
+            if (!isNil(ovdiv))
+                ovdiv.className = vtransition + 'viewunloaded3dm';
+
+            // Transition the new view in
+            vdiv.className = 'viewloaded3dm';
+        }, 0);
+    } else {
+        // Prepare current view for transition out
+        var ovdiv = viewdiv;
+        if (!isNil(ovdiv))
+            ovdiv.skipNode = true;
+
+        // Load the requested doc into the view
+        var vdiv = mkviewdiv('viewloading3d');
+        vcontainer.appendChild(vdiv);
+        var vdoc = appcache.get(uri);
+        vdiv.innerHTML = vdoc;
+        map(ui.evalScript, ui.innerScripts(vdiv));
+
+        // Show the document
+        if (document.body.style.visibility != 'visible')
+            document.body.style.visibility = 'visible';
+
+        setTimeout(function() {
+            // Transition the new view in
+            vdiv.className = 'viewloaded3d';
+
+            // Transition the old view out
+            if (!isNil(ovdiv))
+                ovdiv.parentNode.removeChild(ovdiv);
+        }, 0);
+    }
 
-// Set page titles
-document.title = windowtitle(window.location.hostname);
-$('h1').innerHTML = hometitle(window.location.hostname);
+    // Track the current visible view
+    viewdiv = vdiv;
 
-// Display the menu bar
-displaymenu();
+    return true;
+}
 
-$('maintitle').innerHTML = isNil(config.maintitle)? 'Simple App Builder' : config.maintitle;
-$('getstarted').onclick = function() {
-    return ui.navigate('/store/', '_self');
+/**
+ * Handle navigations.
+ */
+window.onnavigate = function(url) {
+    //log('onnavigate', url);
+
+    // Add url to the history
+    if (url != ui.pathandparams(location)) {
+        history.pushState(null, null, url);
+        var f = ui.fragment(url);
+        if (f != '' && f != location.hash) {
+            location.hash = f;
+            //log('hash', f);
+        }
+        //log('pushstate', history.length);
+    }
+
+    // Show the specified view
+    if (url == viewurl)
+        return true;
+    return showview(url);
 };
 
-// Display the main diagram
-var diagram = $('diagram');
-var bgpos = 0;
-setInterval(function() {
-    bgpos = bgpos -280;
-    if (bgpos == -2800)
-        bgpos = 0;
-    diagram.style.backgroundPosition = '0px ' + ui.pixpos(bgpos);
-}, 2000);
+/**
+ * Handle history.
+ */
+window.addEventListener('popstate', function(e) {
+    //log('popstate', history.length);
+    var furl = ui.fragment(location);
+    var url = location.pathname + (furl == ''? '' : '#' + furl);
+
+    // Show the current view
+    if (url == viewurl)
+        return true;
+    return showview(url);
+
+}, false);
+
+window.addEventListener('hashchange', function(e) {
+    //log('onhashchange');
+    var furl = ui.fragment(location);
+    var url = location.pathname + (furl == ''? '' : '#' + furl);
+
+    // Show the current view
+    if (url == viewurl)
+        return true;
+    return showview(url);
+
+}, false);
+
+/**
+ * Document load post processing.
+ */
+function onload() {
+    //log('onload', history.length);
+    var furl = ui.fragment(location);
+    url = location.pathname + (furl == ''? '' : '#' + furl);
+
+    // Show the current view
+    if (url == viewurl)
+        return true;
+    return showview(url);
+}
+
+// Show the last visited view
+//if (ui.isMobile() && (document.referrer == null || document.referrer == '')) {
+    //log('show lastvisited');
+    //showview(lastvisited());
+//} else
+    //showview('/');
+
 </script>
 
 <div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
+<script type="text/javascript">
+(function() {
+$('footdiv').appendChild(ui.declareScript(appcache.get('/footconfig.js')));
+})();
+</script>
 </div>
 
 </div>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html Mon Oct 24 08:45:54 2011
@@ -17,17 +17,17 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
+<html>
 <head>
 <title>Sign in</title>
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
 <meta name="apple-mobile-web-app-capable" content="yes"/>
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<link rel="apple-touch-icon" href="/public/touchicon.png"/>
+<base href="/login/"/>
 <link rel="stylesheet" type="text/css" href="/ui-min.css"/>
 <script type="text/javascript" src="/all-min.js"></script>
 </head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
+<body class="delayed" onload="onload();">
 <div id="bodydiv" class="bodydiv">
 
 <h1>Sign in</h1>
@@ -44,8 +44,6 @@
 </form>
 
 <script type="text/javascript">
-ui.initbody();
-
 function queryParams() {
     qp = new Array();
     qs = window.location.search.substring(1).split('&');
@@ -71,11 +69,22 @@ function oauthReferrer() {
 }
 
 function submitSignin() {
-    var reset = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';domain=.' + domainname(window.location.hostname) + ';path=/;secure=TRUE';
+    var reset = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';domain=.' + domainname(window.location.hostname) + ';path=/';
     document.cookie = reset;
     document.formSignin.httpd_location.value = oauthReferrer();
     document.formSignin.submit();
 }
+
+function onload() {
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 1);
+    window.scrollTo(0, 0);
+    return true;
+}
+
 </script>
 
 </div>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html Mon Oct 24 08:45:54 2011
@@ -17,17 +17,17 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
+<html>
 <head>
 <title>Sign out</title>
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
 <meta name="apple-mobile-web-app-capable" content="yes"/>
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<link rel="apple-touch-icon" href="/public/touchicon.png"/>
+<base href="/logout/"/>
 <link rel="stylesheet" type="text/css" href="/ui-min.css"/>
 <script type="text/javascript" src="/all-min.js"></script>
 </head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
+<body class="delayed" onload="onload();">
 <div id="bodydiv" class="bodydiv">
 
 <h1>Sign out</h1>
@@ -37,16 +37,25 @@
 </form>
 
 <script type="text/javascript">
-ui.initbody();
-
 function submitSignout() {
     // Clear session cookie and local storage
-    var reset = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/; secure; version=1';
+    var reset = 'TuscanyOpenAuth=; expires=' + new Date(1970,01,01).toGMTString() + '; domain=.' + domainname(window.location.hostname) + '; path=/';
     document.cookie = reset;
     localStorage.clear();
     document.signout.submit();
     return true;
 }
+
+function onload() {
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 1);
+    window.scrollTo(0, 0);
+    return true;
+}
+
 </script>
 
 </div>

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html Mon Oct 24 08:45:54 2011
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!--
+ * 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.    
+-->
+<html>
+<head>
+<title>Sorry</title>
+<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, target-densitydpi=devicedpi"/> 
+<meta name="apple-mobile-web-app-capable" content="yes"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
+<base href="/notauth/"/>
+<script type="text/javascript">
+
+window.appcache = {};
+
+/**
+ * Get and cache a resource.
+ */
+appcache.get = function(uri) {
+    var h = uri.indexOf('#');
+    var u = h == -1? uri : uri.substring(0, h);
+
+    // Get resource from local storage first
+    var item = localStorage.getItem(u);
+    if (item != null && item != '')
+        return item;
+
+    // Get resource from network
+    var http = new XMLHttpRequest();
+    http.open("GET", u, false);
+    http.send(null);
+    if (http.status == 200) {
+        if (http.getResponseHeader("X-Login") != null) {
+            if (log) log('http err', u, 'X-Login');
+            return null;
+        } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) {
+            if (log) log('http err', u, 'No-Content');
+            return null;
+        }
+        localStorage.setItem(u, http.responseText);
+        return http.responseText;
+    }
+    if (log) log('http err', u, http.status, http.statusText);
+    return null;
+};
+
+// Load Javascript and CSS
+(function() {
+    var bootjs = document.createElement('script');
+    bootjs.type = 'text/javascript';
+    bootjs.text = appcache.get('/all-min.js');
+    document.head.appendChild(bootjs);
+    document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css')));
+})();
+
+</script>
+</head>
+<body class="delayed" onload="onload();">
+<div id="bodydiv" class="mainbodydiv">
+
+<div id="headdiv" class="hsection">
+<script type="text/javascript">
+(function() {
+$('headdiv').appendChild(ui.declareScript(appcache.get('/headconfig.js')));
+})();
+</script>
+</div>
+
+<div id="menu"></div>
+
+<div id="content" class="viewloaded3d">
+
+<table style="width: 100%;">
+<tr><td><h2><span id="h1"></span></h2></td></tr>
+</table>
+
+<div style="margin-left: auto; margin-right: auto; text-align: center;">
+<div class="hd2">Sorry, you're not authorized to view this page.</div>
+</div>
+
+</div>
+
+<script type="text/javascript">
+
+// Set page title
+$('h1').innerHTML = ui.hometitle(location.hostname);
+
+// Init div variables
+var mdiv = $('menu'); 
+var cdiv = $('content'); 
+
+/**
+ * Build and show the menu bar.
+ */
+function showmenu(mdiv) {
+    mdiv.innerHTML = ui.menubar(
+        mklist(ui.menu('Home', '/', '_view', false), ui.menu('Store', '/#view=store', '_view', false)),
+            mklist(ui.menu('Account', '/#view=account', '_view', false), ui.menu('Sign out', '/logout/', '_self', false)));
+}
+
+showmenu($('menu'));
+cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight);
+
+/**
+ * Load post processing.
+ */
+function onload() {
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 0);
+    return true;
+}
+
+</script>
+
+<div id="footdiv" class="fsection">
+<script type="text/javascript">
+(function() {
+$('footdiv').appendChild(ui.declareScript(appcache.get('/footconfig.js')));
+})();
+</script>
+</div>
+
+</div>
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html Mon Oct 24 08:45:54 2011
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<!--
+ * 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.    
+-->
+<html>
+<head>
+<title>Page not found</title>
+<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, target-densitydpi=devicedpi"/> 
+<meta name="apple-mobile-web-app-capable" content="yes"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
+<base href="/notfound/"/>
+<script type="text/javascript">
+
+window.appcache = {};
+
+/**
+ * Get and cache a resource.
+ */
+appcache.get = function(uri) {
+    var h = uri.indexOf('#');
+    var u = h == -1? uri : uri.substring(0, h);
+
+    // Get resource from local storage first
+    var item = localStorage.getItem(u);
+    if (item != null && item != '')
+        return item;
+
+    // Get resource from network
+    var http = new XMLHttpRequest();
+    http.open("GET", u, false);
+    http.send(null);
+    if (http.status == 200) {
+        if (http.getResponseHeader("X-Login") != null) {
+            if (log) log('http err', u, 'X-Login');
+            return null;
+        } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) {
+            if (log) log('http err', u, 'No-Content');
+            return null;
+        }
+        localStorage.setItem(u, http.responseText);
+        return http.responseText;
+    }
+    if (log) log('http err', u, http.status, http.statusText);
+    return null;
+};
+
+// Load Javascript and CSS
+(function() {
+    var bootjs = document.createElement('script');
+    bootjs.type = 'text/javascript';
+    bootjs.text = appcache.get('/all-min.js');
+    document.head.appendChild(bootjs);
+    document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css')));
+})();
+
+</script>
+</head>
+<body class="delayed" onload="onload();">
+<div id="bodydiv" class="mainbodydiv">
+
+<div id="headdiv" class="hsection">
+<script type="text/javascript">
+(function() {
+$('headdiv').appendChild(ui.declareScript(appcache.get('/headconfig.js')));
+})();
+</script>
+</div>
+
+<div id="menu"></div>
+
+<div id="content" class="viewloaded3d">
+
+<table style="width: 100%;">
+<tr><td><h2><span id="h1"></span></h2></td></tr>
+</table>
+
+<div style="margin-left: auto; margin-right: auto; text-align: center;">
+<div class="hd2">Sorry, that page was not found.</div>
+<div>You may have clicked an expired link or mistyped the address.</div>
+</div>
+
+</div>
+
+<script type="text/javascript">
+
+// Set page title
+$('h1').innerHTML = ui.hometitle(location.hostname);
+
+// Init div variables
+var mdiv = $('menu'); 
+var cdiv = $('content'); 
+
+/**
+ * Build and show the menu bar.
+ */
+function showmenu(mdiv) {
+    mdiv.innerHTML = ui.menubar(
+        mklist(ui.menu('Home', '/', '_view', false), ui.menu('Store', '/#view=store', '_view', false)),
+            mklist(ui.menu('Account', '/#view=account', '_view', false), ui.menu('Sign out', '/logout/', '_self', false)));
+}
+
+showmenu(mdiv);
+div.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight);
+
+/**
+ * Load post processing.
+ */
+function onload() {
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 0);
+    return true;
+}
+
+</script>
+
+<div id="footdiv" class="fsection">
+<script type="text/javascript">
+(function() {
+$('footdiv').appendChild(ui.declareScript(appcache.get('/footconfig.js')));
+})();
+</script>
+</div>
+
+</div>
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html Mon Oct 24 08:45:54 2011
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<!--
+ * 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.    
+-->
+<html>
+<head>
+<title>Page not found</title>
+<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, target-densitydpi=devicedpi"/> 
+<meta name="apple-mobile-web-app-capable" content="yes"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
+<base href="/notyet/"/>
+<script type="text/javascript">
+
+window.appcache = {};
+
+/**
+ * Get and cache a resource.
+ */
+appcache.get = function(uri) {
+    var h = uri.indexOf('#');
+    var u = h == -1? uri : uri.substring(0, h);
+
+    // Get resource from local storage first
+    var item = localStorage.getItem(u);
+    if (item != null && item != '')
+        return item;
+
+    // Get resource from network
+    var http = new XMLHttpRequest();
+    http.open("GET", u, false);
+    http.send(null);
+    if (http.status == 200) {
+        if (http.getResponseHeader("X-Login") != null) {
+            if (log) log('http err', u, 'X-Login');
+            return null;
+        } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) {
+            if (log) log('http err', u, 'No-Content');
+            return null;
+        }
+        localStorage.setItem(u, http.responseText);
+        return http.responseText;
+    }
+    if (log) log('http err', u, http.status, http.statusText);
+    return null;
+};
+
+// Load Javascript and CSS
+(function() {
+    var bootjs = document.createElement('script');
+    bootjs.type = 'text/javascript';
+    bootjs.text = appcache.get('/all-min.js');
+    document.head.appendChild(bootjs);
+    document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css')));
+})();
+
+</script>
+</head>
+<body class="delayed" onload="onload();">
+<div id="bodydiv" class="mainbodydiv">
+
+<div id="headdiv" class="hsection">
+<script type="text/javascript">
+(function() {
+$('headdiv').appendChild(ui.declareScript(appcache.get('/headconfig.js')));
+})();
+</script>
+</div>
+
+<div id="menu"></div>
+
+<div id="content" class="viewloaded3d">
+
+<table style="width: 100%;">
+<tr><td><h2><span id="h1"></span></h2></td></tr>
+</table>
+
+<div style="margin-left: auto; margin-right: auto; text-align: center;">
+<div class="hd2">Sorry, that page is still under construction.</div>
+<div>Please check back later.</div>
+</div>
+
+</div>
+
+<script type="text/javascript">
+
+// Set page title
+$('h1').innerHTML = ui.hometitle(location.hostname);
+
+// Init div variables
+var mdiv = $('menu'); 
+var cdiv = $('content'); 
+
+/**
+ * Build and show the menu bar.
+ */
+function showmenu(mdiv) {
+    mdiv.innerHTML = ui.menubar(
+        mklist(ui.menu('Home', '/', '_view', false), ui.menu('Store', '/#view=store', '_view', false)),
+            mklist(ui.menu('Account', '/#view=account', '_view', false), ui.menu('Sign out', '/logout/', '_self', false)));
+}
+
+showmenu($('menu'));
+cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight);
+
+/**
+ * Load post processing.
+ */
+function onload() {
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 0);
+    return true;
+}
+
+</script>
+
+<div id="footdiv" class="fsection">
+<script type="text/javascript">
+(function() {
+$('footdiv').appendChild(ui.declareScript(appcache.get('/footconfig.js')));
+})();
+</script>
+</div>
+
+</div>
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/oops/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/oops/index.html?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/oops/index.html (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/oops/index.html Mon Oct 24 08:45:54 2011
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!--
+ * 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.    
+-->
+<html>
+<head>
+<title>Oops</title>
+<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, target-densitydpi=devicedpi"/> 
+<meta name="apple-mobile-web-app-capable" content="yes"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
+<base href="/oops/"/>
+<script type="text/javascript">
+
+window.appcache = {};
+
+/**
+ * Get and cache a resource.
+ */
+appcache.get = function(uri) {
+    var h = uri.indexOf('#');
+    var u = h == -1? uri : uri.substring(0, h);
+
+    // Get resource from local storage first
+    var item = localStorage.getItem(u);
+    if (item != null && item != '')
+        return item;
+
+    // Get resource from network
+    var http = new XMLHttpRequest();
+    http.open("GET", u, false);
+    http.send(null);
+    if (http.status == 200) {
+        if (http.getResponseHeader("X-Login") != null) {
+            if (log) log('http err', u, 'X-Login');
+            return null;
+        } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) {
+            if (log) log('http err', u, 'No-Content');
+            return null;
+        }
+        localStorage.setItem(u, http.responseText);
+        return http.responseText;
+    }
+    if (log) log('http err', u, http.status, http.statusText);
+    return null;
+};
+
+// Load Javascript and CSS
+(function() {
+    var bootjs = document.createElement('script');
+    bootjs.type = 'text/javascript';
+    bootjs.text = appcache.get('/all-min.js');
+    document.head.appendChild(bootjs);
+    document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css')));
+})();
+
+</script>
+</head>
+<body class="delayed" onload="onload();">
+<div id="bodydiv" class="mainbodydiv">
+
+<div id="headdiv" class="hsection">
+<script type="text/javascript">
+(function() {
+$('headdiv').appendChild(ui.declareScript(appcache.get('/headconfig.js')));
+})();
+</script>
+</div>
+
+<div id="menu"></div>
+
+<div id="content" class="viewloaded3d">
+
+<table style="width: 100%;">
+<tr><td><h2><span id="h1"></span></h2></td></tr>
+</table>
+
+<div style="margin-left: auto; margin-right: auto; text-align: center;">
+<div class="hd2">Oops, something went wrong...</div>
+</div>
+
+</div>
+
+<script type="text/javascript">
+
+// Set page title
+$('h1').innerHTML = ui.hometitle(location.hostname);
+
+// Init div variables
+var mdiv = $('menu'); 
+var cdiv = $('content'); 
+
+/**
+ * Build and show the menu bar.
+ */
+function showmenu(mdiv) {
+    mdiv.innerHTML = ui.menubar(
+        mklist(ui.menu('Home', '/', '_view', false), ui.menu('Store', '/#view=store', '_view', false)),
+            mklist(ui.menu('Account', '/#view=account', '_view', false), ui.menu('Sign out', '/logout/', '_self', false)));
+}
+
+showmenu($('menu'));
+cdiv.style.top = ui.pixpos(mdiv.offsetTop + mdiv.offsetHeight);
+
+/**
+ * Load post processing.
+ */
+function onload() {
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 0);
+    return true;
+}
+
+</script>
+
+<div id="footdiv" class="fsection">
+<script type="text/javascript">
+(function() {
+$('footdiv').appendChild(ui.declareScript(appcache.get('/footconfig.js')));
+})();
+</script>
+</div>
+
+</div>
+</body>
+</html>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html Mon Oct 24 08:45:54 2011
@@ -17,33 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
-<head>
-<title>Page</title>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<link rel="apple-touch-icon" href="/public/touchicon.png"/>
-<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
-<script type="text/javascript" src="page.js"></script>
-</head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
 <div id="bodydiv" class="bodydiv" style="overflow: visible;">
 
-<div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="menubackground" style="position: absolute; top: 0px; left: 0px; z-index: -1; width: 2500px;">
-<table cellpadding="0" cellspacing="0" width="100%" class="tbar"><tr><td class="dtbar">
-<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ltbar"><span class="tbarsmenu">&nbsp</span></td></tr></table>
-</td></tr></table>
-</div>
-
-<div id="menu"></div>
-
 <table style="width: 100%;">
 <tr>
 <td><h2><span id="appNameHeader"></span></h2></td>
@@ -59,10 +34,6 @@
 
 <table id="widgetValueTable" style="width: 100%;">
 <tr>
-<td class="thr thl" style="padding-left: 2px; padding-right: 2px; vertical-align: top; width: 100%;">
-<input id="widgetValue" type="text" value="" title="Widget value" autocapitalize="off" placeholder="Value" style="position: relative; width: 100%;"/>
-</td>
-
 <td class="thl thr" style="text-align: right; padding-right: 2px; vertical-align: top;">
 <span id="deleteWidgetButton" title="Delete a Widget" class="graybutton" style="font-weight: bold; font-size: 16px; color: #808080; display: inline-block; width: 24px; height: 20px; padding-top: 0px; padding-bottom: 0px; text-align: center; margin-left: 0px; margin-right: 0px;">-</span>
 
@@ -72,13 +43,17 @@
 
 <span id="playPageButton" title="View page" class="graybutton" style="font-weight: bold; font-size: 16px; display: inline-block; width: 24px; height: 20px; padding-top: 0px; padding-bottom: 0px; middle; text-align: center; margin-left: 0px; margin-right: 0px;">&gt;</span>
 </td>
+
+<td class="thl thr" style="padding-left: 2px; padding-right: 2px; vertical-align: top; width: 100%;">
+<input id="widgetValue" type="text" value="" title="Widget value" autocapitalize="off" placeholder="Value" style="position: relative; visibility: hidden; width: 100%;"/>
+</td>
 </tr>
 </table>
 
-<div id="contentdiv" style="margin-top: 4px; width: 2500px">
+<div id="contentdiv" style="margin-top: 4px; width: 2500px;">
 <div id="editdiv" style="visibility: visible; position: relative; top: 0px; left: -2500px; width: 2500px; height: 5000px;">
 
-<div style="position: relative; left: 2500px; top: 0px; right: 0px; height: 5000px; border:1px; border-style: solid; border-color: #a2bae7; background: url(/public/grid72.png);"></div>
+<div style="position: relative; left: 2500px; top: 0px; right: 0px; height: 5000px; border:1px; border-style: solid; border-color: #a2bae7;"><span id="editgrid"></span></div>
 <div class="guide" style="position: absolute; left: 2500px; top: 0px; width: 320px; height: 460px;"></div>
 <div class="guide" style="position: absolute; left: 2500px; top: 0px; width: 480px; height: 300px;"></div>
 <div class="guide" style="position: absolute; left: 2500px; top: 0px; width: 768px; height: 911px;"></div>
@@ -101,7 +76,7 @@
 <span class="link" id="palette:link" style="position: absolute; left: 0px; top: 340px;"><a href="/"><span>link</span></a></span>
 <span class="text" id="palette:text" style="position: absolute; left: 0px; top: 370px;"><span>text</span></span>
 <span class="iframe fakeframe" id="palette:iframe" style="position: absolute; left: 0px; top: 400px; width: 200px;"><a href="/public/iframe.html"><span class="fakeframe"><span>frame ...</span></span></a></span>
-<span class="img" id="palette:img" style="position: absolute; left: 0px; top: 430px;"><img src="/public/img.png"/></span>
+<span class="img" id="palette:img" style="position: absolute; left: 0px; top: 430px;"><img id="imgimg"/></span>
 </div>
 
 <div id="playdiv" style="visibility: hidden; position: absolute; top: 0px; left: 0px; width: 2500px; height: 5000px;">
@@ -112,20 +87,17 @@
 <div id="buffer" style="visibility: hidden; width: 0px; height: 0px"></div>
 
 <script type="text/javascript">
-ui.initbody();
 
 // Get the app name
-var appname = ui.fragmentParams()['app'];
-if (isNil(appname))
-    window.open('/', '_self');
+var appname = ui.fragmentParams(location)['app'];
 
 /**
  * Return the link to an app.
  */
 function applink(appname) {
-    var protocol = window.location.protocol;
-    var host = window.location.hostname;
-    var port = ':' + window.location.port;
+    var protocol = location.protocol;
+    var host = location.hostname;
+    var port = ':' + location.port;
     if (port == ':80' || port == ':443' || port == ':')
         port = '';
     var link = protocol + '//' + appname + '.' + host + port + '/';
@@ -133,12 +105,9 @@ function applink(appname) {
 }
 
 // Set page titles
-document.title = windowtitle(window.location.hostname) + ' - Page - ' + appname;
+document.title = ui.windowtitle(location.hostname) + ' - Page - ' + appname;
 $('appNameHeader').innerHTML = '<a href=\"' + applink(appname) + '\" target=\"' + '_blank' + '\">' + appname + '</a>';
 
-// Load the menu bar
-displaymenu();
-
 /**
  * Page editor area, widget value field, add, delete and play page buttons.
  */
@@ -152,6 +121,10 @@ var wdelete = $('deleteWidgetButton');
 var wcopy = $('copyWidgetButton');
 var pplay = $('playPageButton');
 
+// Set images
+$('editgrid').parentNode.style.background = 'url(\'' + ui.b64img(appcache.get('/public/grid72.b64')) + '\')';
+$('imgimg').src = ui.b64img(appcache.get('/public/img.b64'));
+
 // Position edit and play divs inside the content div
 ediv.style.position = 'absolute';
 ediv.style.top = cdiv.offsetTop + 'px';
@@ -159,10 +132,6 @@ pdiv.style.position = 'absolute';
 pdiv.style.top = cdiv.offsetTop + 'px';
 
 // Position background divs
-var mbackground = $('menubackground');
-var menudiv = $('menu');
-mbackground.style.top = ui.pixpos(menudiv.offsetTop);
-
 var wvbackground = $('widgetValueBackground');
 var wvtable = $('widgetValueTable');
 wvbackground.style.top = ui.pixpos(wvtable.offsetTop);
@@ -184,6 +153,569 @@ var editWidget = sca.component("EditWidg
 var pages = sca.reference(editWidget, "pages");
 
 /**
+ * Page editing functions.
+ */
+var page = {};
+
+/**
+ * Default positions and sizes.
+ */
+page.palcx = 2500;
+
+/**
+ * Init a page editor. Works with all browsers except IE.
+ */
+page.edit = function(elem, wvalue, wadd, wcopy, wdelete, onchange, onselect) {
+
+    // Track element dragging and selection
+    page.dragging = null;
+    page.selected = null;
+    wvalue.disabled = true;
+    wvalue.style.visibility = 'hidden';
+    wcopy.disabled = true;
+    wdelete.disabled = true;
+
+    // Trigger widget select and page change events
+    page.onpagechange = onchange;
+    page.onwidgetselect = onselect;
+
+    /**
+     * Handle a mouse down event.
+     */
+    elem.onmousedown = function(e) {
+
+        // On mouse controlled devices, engage the click component selection
+        // logic right away
+        if (typeof e.touches == 'undefined')
+            elem.onclick(e);
+
+        // Find a draggable element
+        var dragging = page.draggable(e.target, elem);
+        if (dragging == null || dragging != page.selected)
+            return true;
+        page.dragging = dragging;
+
+        // Remember mouse position
+        var pos = typeof e.touches != "undefined"? e.touches[0] : e;
+        page.dragX = pos.screenX;
+        page.dragY = pos.screenY;
+
+        if (e.preventDefault)
+            e.preventDefault();
+        else
+            e.returnValue = false;
+        return true;
+    };
+
+    // Support touch devices
+    elem.ontouchstart = elem.onmousedown;
+
+    /**
+     * Handle a mouse up event.
+     */
+    elem.onmouseup = function(e) {
+        if (page.dragging == null)
+            return true;
+
+        // Snap to grid
+        var newX = page.gridsnap(ui.numpos(page.dragging.style.left));
+        var newY = page.gridsnap(ui.numpos(page.dragging.style.top));
+        page.dragging.style.left = ui.pixpos(newX);
+        page.dragging.style.top = ui.pixpos(newY);
+        page.dragging.cover.style.left = ui.pixpos(newX);
+        page.dragging.cover.style.top = ui.pixpos(newY);
+
+        // Fixup widget style
+        page.fixupwidget(page.dragging);
+
+        // Forget dragged element
+        page.dragging = null;
+
+        // Trigger page change event
+        page.onpagechange(false);
+        return true;
+    };
+
+    // Support touch devices
+    elem.ontouchend = elem.onmouseup;
+
+    /**
+     * Handle a mouse move event.
+     */
+    window.onmousemove = function(e) {
+        if (page.dragging == null)
+            return true;
+
+        // Get the mouse position
+        var pos = typeof e.touches != "undefined"? e.touches[0] : e;
+        if (pos.screenX == page.dragX && pos.screenY == page.dragY)
+            return true;
+
+        // Compute position of dragged element
+        var curX = ui.numpos(page.dragging.style.left);
+        var curY = ui.numpos(page.dragging.style.top);
+        var newX = curX + (pos.screenX - page.dragX);
+        var newY = curY + (pos.screenY - page.dragY);
+        if (newX >= page.palcx)
+            page.dragX = pos.screenX;
+        else
+            newX = page.palcx;
+        if (newY >= 0)
+            page.dragY = pos.screenY;
+        else
+            newY = 0;
+
+        // Move the dragged element
+        page.dragging.style.left = ui.pixpos(newX);
+        page.dragging.style.top = ui.pixpos(newY);
+        page.dragging.cover.style.left = ui.pixpos(newX);
+        page.dragging.cover.style.top = ui.pixpos(newY);
+        return true;
+    };
+
+    // Support touch devices
+    elem.ontouchmove = window.onmousemove;
+
+    /**
+     * Handle a mouse click event.
+     */
+    elem.onclick = function(e) {
+
+        // Find selected element
+        var selected = page.draggable(e.target, elem);
+        if (selected == null) {
+            if (page.selected != null) {
+
+                // Reset current selection
+                page.widgetselect(page.selected, false, wvalue, wcopy, wdelete);
+                page.selected = null;
+
+                // Trigger widget select event
+                page.onwidgetselect(null);
+            }
+
+            // Dismiss the palette
+            if (ui.numpos(elem.style.left) != (page.palcx * -1))
+                elem.style.left = ui.pixpos(page.palcx * -1);
+
+            return true;
+        }
+
+        // Deselect the previously selected element
+        page.widgetselect(page.selected, false, wvalue, wcopy, wdelete);
+
+        // Clone element dragged from palette
+        if (selected.id.substring(0, 8) == 'palette:') {
+            page.selected = page.clone(selected);
+
+            // Move into the editing area and hide the palette
+            page.selected.style.left = ui.pixpos(ui.numpos(page.selected.style.left) + page.palcx);
+            page.selected.cover.style.left = ui.pixpos(ui.numpos(page.selected.cover.style.left) + page.palcx);
+            elem.style.left = ui.pixpos(page.palcx * -1);
+        
+            // Bring it to the top
+            page.bringtotop(page.selected);
+
+            // Trigger page change event
+            page.onpagechange(true);
+
+        } else {
+
+            // Bring selected element to the top
+            page.selected = selected;
+            page.bringtotop(page.selected);
+        }
+
+        // Select the element
+        page.widgetselect(page.selected, true, wvalue, wcopy, wdelete);
+
+        // Trigger widget select event
+        page.onwidgetselect(page.selected);
+
+        return true;
+    };
+
+    /**
+     * Handle field on change events.
+     */
+    wvalue.onchange = wvalue.onblur = function() {
+        if (page.selected == null)
+            return false;
+        page.settext(page.selected, wvalue.value);
+        page.selected.cover.style.width = ui.pixpos(page.selected.clientWidth + 4);
+        page.selected.cover.style.height = ui.pixpos(page.selected.clientHeight + 4);
+
+        // Trigger page change event
+        page.onpagechange(true);
+        return false;
+    };
+
+    // Handle add widget event.
+    wadd.onclick = function() {
+
+        // Show the palette
+        elem.style.left = ui.pixpos(0);
+        return false;
+    };
+
+    // Handle delete event.
+    wdelete.onclick = function() {
+        if (page.selected == null)
+            return false;
+
+        // Reset current selection
+        page.widgetselect(page.selected, false, wvalue, wcopy, wdelete);
+
+        // Remove selected widget
+        page.selected.parentNode.removeChild(page.selected);
+        page.selected.cover.parentNode.removeChild(page.selected.cover);
+        page.selected = null;
+
+        // Trigger widget select event
+        page.onwidgetselect(null);
+
+        // Trigger page change event
+        page.onpagechange(true);
+        return false;
+    };
+
+    // Handle copy event.
+    wcopy.onclick = function() {
+        if (page.selected == null)
+            return false;
+        if (page.selected.id.substring(0, 8) == 'palette:')
+            return false;
+
+        // Reset current selection
+        page.widgetselect(page.selected, false, wvalue, wcopy, wdelete);
+
+        // Clone selected widget
+        page.selected = page.clone(page.selected);
+
+        // Move 10 pixels down right
+        page.selected.style.left = ui.pixpos(ui.numpos(page.selected.style.left) + 10);
+        page.selected.style.top = ui.pixpos(ui.numpos(page.selected.style.top) + 10);
+        page.selected.cover.style.left = ui.pixpos(ui.numpos(page.selected.cover.style.left) + 10);
+        page.selected.cover.style.top = ui.pixpos(ui.numpos(page.selected.cover.style.top) + 10);
+    
+        // Bring it to the top
+        page.bringtotop(page.selected);
+
+        // Select the element
+        page.widgetselect(page.selected, true, wvalue, wcopy, wdelete);
+
+        // Trigger widget select event
+        page.onwidgetselect(page.selected);
+
+        // Trigger page change event
+        page.onpagechange(true);
+        return false;
+    };
+
+    // Cover child elements with span elements to prevent
+    // any input events to reach them
+    map(page.cover, nodeList(elem.childNodes));
+
+    return elem;
+};
+
+/**
+ * Return the text of a widget.
+ */
+page.text = function(e) {
+    function formula(e) {
+        var f = e.id;
+        if (f.substring(0, 5) != 'page:')
+            return '=' + f;
+        return '';
+    }
+
+    function constant(e, f) {
+        if (e.className == 'h1' || e.className == 'h2' || e.className == 'text' || e.className == 'section') {
+            var t = car(childElements(e)).innerHTML;
+            return t == f? '' : t;
+        }
+        if (e.className == 'button' || e.className == 'checkbox') {
+            var t = car(childElements(e)).value;
+            return t == f? '' : t;
+        }
+        if (e.className == 'entry' || e.className == 'password') {
+            var t = car(childElements(e)).defaultValue;
+            return t == f? '' : t;
+        }
+        if (e.className == 'select') {
+            var t = car(childElements(car(childElements(e)))).value;
+            return t == f? '' : t;
+        }
+        if (e.className == 'link') {
+            var lhr = car(childElements(e)).href;
+            var hr = lhr.substring(0, 5) == 'link:'? lhr.substring(5) : '';
+            var t = car(childElements(car(childElements(e)))).innerHTML;
+            return t == f? hr : (t == hr? hr : (t == ''? hr : hr + ',' + t));
+        }
+        if (e.className == 'img') {
+            var src = car(childElements(e)).src;
+            return src == location.href? '' : src;
+        }
+        if (e.className == 'iframe') {
+            var hr = car(childElements(e)).href;
+            return hr == location.href? '' : hr;
+        }
+        if (e.className == 'list')
+            return '';
+        if (e.className == 'table')
+            return '';
+        return '';
+    }
+
+    var f = formula(e);
+    var c = constant(e, f);
+    return f == ''? c : (c == ''? f : f + ',' + c);
+};
+
+/**
+ * Return true if a widget has editable text.
+ */
+page.hastext = function(e) {
+    if (e.className == 'h1' || e.className == 'h2' || e.className == 'text' || e.className == 'section')
+        return true;
+    if (e.className == 'button' || e.className == 'checkbox')
+        return true;
+    if (e.className == 'entry' || e.className == 'password')
+        return true;
+    if (e.className == 'select')
+        return false;
+    if (e.className == 'link')
+        return true;
+    if (e.className == 'img')
+        return true;
+    if (e.className == 'iframe')
+        return true;
+    if (e.className == 'list')
+        return false;
+    if (e.className == 'table')
+        return false;
+    return false;
+};
+
+/**
+ * Set the text of a widget.
+ */
+page.settext = function(e, t) {
+    function formula(t) {
+        if (t.length > 1 && t.substring(0, 1) == '=')
+            return car(t.split(','));
+        return '';
+    }
+
+    function constant(t) {
+        return t.length > 1 && t.substring(0, 1) == '='? cdr(t.split(',')) : t.split(',');
+    }
+
+    var f = formula(t);
+    var c = constant(t);
+
+    e.id = f != ''? f.substring(1) : ('page:' + e.className);
+
+    if (e.className == 'h1' || e.className == 'h2' || e.className == 'text' || e.className == 'section') {
+        car(childElements(e)).innerHTML = isNil(c)? f : car(c);
+        return t;
+    }
+    if (e.className == 'button' || e.className == 'entry' || e.className == 'password') {
+        car(childElements(e)).defaultValue = isNil(c)? f : car(c);
+        return t;
+    }
+    if (e.className == 'checkbox') {
+        car(childElements(e)).value = isNil(c)? f : car(c);
+        map(function(n) { if (n.nodeName == "SPAN") n.innerHTML = isNil(c)? f : car(c); return n; }, nodeList(e.childNodes));
+        return t;
+    }
+    if (e.className == 'select') {
+        var ce = car(childElements(car(childElements(e))));
+        ce.value = isNil(c)? f : car(c);
+        ce.innerHTML = isNil(c)? f : car(c);
+        return t;
+    }
+    if (e.className == 'list') {
+        e.innerHTML = '<table class="datatable" style="width: 100%;;"><tr><td class="datatd">' + (isNil(c)? f : car(c)) + '</td></tr><tr><td class="datatd">...</td></tr></table>';
+        return t;
+    }
+    if (e.className == 'table') {
+        e.innerHTML = '<table class="datatable" style="width: 100%;"><tr><td class="datatdl">' + (isNil(c)? f : car(c)) + '</td><td class="datatdr">...</td></tr><tr><td class="datatdl">...</td><td class="datatdr">...</td></tr></table>';
+        return t;
+    }
+    if (e.className == 'link') {
+        var ce = car(childElements(e));
+        ce.href = isNil(c)? 'link:/index.html' : ('link:' + car(c));
+        car(childElements(ce)).innerHTML = isNil(c)? (f != ''? f : '/index.html') : isNil(cdr(c))? (f != ''? f : car(c)) : cadr(c);
+        return t;
+    }
+    if (e.className == 'img') {
+        car(childElements(e)).src = isNil(c)? '/public/img.png' : car(c);
+        return t;
+    }
+    if (e.className == 'iframe') {
+        car(childElements(e)).href = isNil(c)? '/public/iframe.html' : car(c);
+        return t;
+    }
+    return '';
+};
+
+/**
+ * Initial fixup of a widget.
+ */
+page.fixupwidget = function(e) {
+    if (e.className == 'iframe') {
+        var f = car(childElements(e));
+        //e.innerHTML = '<iframe src="' + f.href + '" frameborder="no" scrolling="no"></iframe>';
+        return e;
+    }
+    if (e.className == 'section') {
+        e.style.width = '100%';
+        return e;
+    }
+    if (e.className == 'list') {
+        e.style.width = '100%';
+        car(childElements(e)).style.width = '100%';
+        return e;
+    }
+    if (e.className == 'table') {
+        e.style.width = '100%';
+        car(childElements(e)).style.width = '100%';
+        return e;
+    }
+    if (e.className == 'img') {
+        var i = car(childElements(e));
+        if (i.src != '' && i.src.substring(0, 5) == 'data:')
+            i.src = '/public/img.png';
+        return e;
+    }
+    return e;
+}
+
+/**
+ * Find a draggable element in a hierarchy of elements.
+ */
+page.draggable = function(n, e) {
+    if (n == e)
+        return null;
+    if (n.id != '')
+        return n;
+    if (n.covered)
+        return n.covered;
+    return page.draggable(n.parentNode, e);
+}
+
+/**
+ * Align a pos along a 9pixel grid.
+ */
+page.gridsnap = function(x) {
+    return Math.round(x / 9) * 9;
+}
+
+/**
+ * Bring an element and its parent to the top.
+ */
+page.bringtotop = function(n) {
+    n.parentNode.appendChild(n);
+    n.cover.parentNode.appendChild(n.cover);
+}
+
+/**
+ * Draw widget selection.
+ */
+page.widgetselect = function(n, s, wvalue, wcopy, wdelete) {
+    if (isNil(n) || !s) {
+        // Clear the widget value field
+        wvalue.value = '';
+        wvalue.disabled = true;
+        wvalue.style.visibility = 'hidden';
+        wcopy.disabled = true;
+        wdelete.disabled = true;
+
+        // Clear the widget outline
+        if (!isNil(n))
+            n.cover.style.borderWidth = '0px';
+        return true;
+    }
+
+    // Update the widget value field
+    wvalue.value = page.text(n);
+    wvalue.disabled = false;
+    wvalue.style.visibility = 'visible';
+    wcopy.disabled = false;
+    wdelete.disabled = false;
+
+    // Outline the widget
+    n.cover.style.borderWidth = '2px';
+    return true;
+};
+
+/**
+ * Cover a page element with a <span> element to prevent
+ * any input events to reach it.
+ */
+page.cover = function(e) {
+    if (e.id == '' || isNil(e.style))
+        return e;
+    var cover = document.createElement('div');
+    cover.style.position = 'absolute';
+    cover.style.left = ui.pixpos(ui.numpos(e.style.left) - 2);
+    cover.style.top = ui.pixpos(ui.numpos(e.style.top) - 2);
+    cover.style.width = ui.pixpos(e.clientWidth + 4);
+    cover.style.height = ui.pixpos(e.clientHeight + 4);
+    cover.style.visibility = 'inherit';
+    cover.style.borderStyle = 'solid';
+    cover.style.borderWidth = '0px';
+    cover.style.borderColor = '#598edd';
+    cover.style.padding = '0px';
+    cover.style.margin = '0px';
+    cover.covered = e;
+    e.cover = cover;
+    e.parentNode.appendChild(cover);
+    return e;
+}
+
+/**
+ * Clone a palette element.
+ */
+page.clone = function(e) {
+
+    /**
+     * Clone an element's HTML.
+     */
+    function mkclone(e) {
+        var ne = document.createElement('span');
+
+        // Skip the palette: prefix
+        ne.id = 'page:' + e.id.substr(8);
+
+        // Copy the class and HTML content
+        ne.className = e.className;
+        ne.innerHTML = e.innerHTML;
+
+        // Fixup the widget style
+        page.fixupwidget(ne);
+
+        return ne;
+    }
+
+    /**
+     * Clone an element's position.
+     */
+    function posclone(ne, e) {
+        ne.style.position = 'absolute';
+        ne.style.left = ui.pixpos(ui.numpos(e.style.left));
+        ne.style.top = ui.pixpos(ui.numpos(e.style.top));
+        e.parentNode.appendChild(ne);
+        page.cover(ne);
+        return ne;
+    }
+
+    return posclone(mkclone(e), e);
+};
+
+/**
  * Return the page in an ATOM entry.
  */
 function atompage(doc) {
@@ -373,35 +905,19 @@ function onpagechange(prop) {
 }
 
 /**
- * Return the link to a component value.
- */
-function compvaluelink(appname, cname) {
-    if (cname == '' || isNil(cname))
-        return '';
-    var protocol = window.location.protocol;
-    var host = window.location.hostname;
-    var port = ':' + window.location.port;
-    if (port == ':80' || port == ':443' || port == ':')
-        port = '';
-    var link = protocol + '//' + appname + '.' + host + port + '/data/#component=' + cname;
-    return link;
-}
-
-/**
  * Handle a widget select event.
  */
 function onwidgetselect(w) {
     if (w == widget)
         return true;
     widget = w;
-    var link = compvaluelink(appname, isNil(w)? '' : w.id);
 
     function updateButton(b, v) {
         b.style.color = v? '#000000' : '#808080';
     }
 
-    updateButton(wdelete, link != '');
-    updateButton(wcopy, link != '');
+    updateButton(wdelete, !isNil(w));
+    updateButton(wcopy, !isNil(w));
     return true;
 }
 
@@ -415,12 +931,14 @@ function playpage() {
     page.selected = null;
     wvalue.value = applink(appname);
     pplay.innerHTML = '&lt;';
-    ediv.style.visibility = 'hidden'
     evisible = false;
     pdiv.style.visibility = 'visible';
     pdiv.innerHTML = '';
     pdiv.innerHTML = '<iframe id="playappframe" style="position: relative; height: 5000px; width: 2500px; border: 0px;" scrolling="no" frameborder="0" src="' +
                         applink(appname) + '"></iframe>';
+    setTimeout(function() {
+        ediv.style.visibility = 'hidden'
+    }, 0);
     return true;
 }
 
@@ -431,12 +949,14 @@ function showedit() {
     if (evisible)
         return true;
     pplay.innerHTML = '&gt;';
-    pdiv.style.visibility = 'hidden';
-    pdiv.innerHTML = '';
     ediv.style.visibility = 'visible'
     evisible = true;
     page.widgetselect(widget, true, wvalue, wcopy, wdelete);
     page.selected = widget;
+    setTimeout(function() {
+        pdiv.style.visibility = 'hidden';
+        pdiv.innerHTML = '';
+    }, 0);
     return true;
 }
 
@@ -454,13 +974,7 @@ page.edit(ediv, wvalue, wadd, wcopy, wde
 
 // Get and display the current app page
 getpage(appname, ediv);
-</script>
 
-<div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
-</div>
+</script>
 
 </div>
-</body>
-</html>
-

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.b64
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.b64?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.b64 (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.b64 Mon Oct 24 08:45:54 2011
@@ -0,0 +1 @@
+iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAABGdBTUEAALGPC/xhBQAAAAxQTFRFyN+N+dR1/PCI////6HjE5gAAADJJREFUKM9j+I8EPjBQifeBAQSY6coLBYN6inhaq0Bg6SDn/f//akB466ExTS6P2ukMAKumzarJO/66AAAAAElFTkSuQmCC
\ No newline at end of file

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64 (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64 Mon Oct 24 08:45:54 2011
@@ -0,0 +1 @@
+iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAAXNSR0IArs4c6QAAAAZiS0dEANAAPwBBXloXjQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sEFhQaKzNh4PgAAAMKSURBVEjHxZZPTBNBFMa/maVbWjcUi0YiIHIoNBADTUgsqCWgUUFjwkk5CXLUBKIc9KIXjx64oMSDoiggGC8koImCGDWYkADRIiQQgikWCq0WoXW33R0PpYjSLeWP8btN3sv85s17894QrKNeIBng8gFmJSDZgGIAqJeBjQCkH5AHioGZaHsQNUMP+ByKYB0ByVjvIAxsUkHcrRJI9pggXYBWB1pLQUqxQSlg3X4o9WWAqArpAhL04JoIYMQmxQCPD3JlGbCwBtIFaPXgWrcC+AtUEY6Ihg060NrtACyf3KgDrQ2v6e8kbzwH0URBSnvA56xAKIJ1kRzNbS2ZNhYssjodVj41VbPaxqemaqxOh9XGgkXmtpbMyKDQvqQXSKbg2iKGzfPE0v8uV7BYDIuDg95B66FhJkmM8DyxfHifK+TlGRaHhryDBwuHmSSxyBUnn6Ohh6aSQElin86U26XZWVGwWAxZD5tMAGBufmAS8vIMkssl2s+Uj6gBQuLySS/oTQpyONr9GmxHhAMvnltovJZ+73vjTiyyJSmipHw8WTrkfd33Y52385arAr1EAF00R3HqixRwu38mnT61O35/uh4AJq7Ujc0/affEUGsCDfWi9TXX3uEOeDwBABCnp/3OO42uGPuAgQLUG4urueVRlsZo1ACANiVFZ7rTkBFjMXtpqJtGV9q1q3uNJ47vlpd88kTt5VEWCLLk6gtpeyrP74qheY5wlaB6AhSqOSUUFOzIun8vh8RxZKKmZvRrw20X0WjkxCKbceexo0Z3Z+d8wDUXVIeQdgrIA6rFl5DAmVsfZ1MtT+faO5zOxrtzADB1/Ybj28tX85wgx
 OU8e5pN9XqqHos8QIuBGQY2GTEPD5tM8en79P7x8aWxqurx1bbPZytGRYfDrzOZBHPzA5PanCkGZki4d3GQG7DNksFdLIFkpwBQAsmugHVvJ0AB6w5PypW79EOpZ4BnOwAM8Pih1P/R6gGgDBB9kCu3Clo1GcU1kGXQgg9yxWavTgHrXp6IC///t/Iv/l2/AGa0Qa2X0eC0AAAAAElFTkSuQmCC
\ No newline at end of file

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64 (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64 Mon Oct 24 08:45:54 2011
@@ -0,0 +1 @@
+iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAgMAAAAog1vUAAAABGdBTUEAALGPC/xhBQAAAAlQTFRFwuD84/T+////fj9v9QAAACxJREFUOMtjWLUqa9WsVctWrYQxVjAMCqFQdBDCMOrUUaeOOnXUqYPPqZgAABmg/C7pJC7lAAAAAElFTkSuQmCC
\ No newline at end of file

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html Mon Oct 24 08:45:54 2011
@@ -17,13 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
+<html>
 <head>
-<title>frame</title>
-<meta name="viewport" content="width=device-width user-scalable=no initial-scale=1.0"/>
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
 </head>
 <body style="margin:3px; padding: 0px; background-color: #dcdcdc;">
 

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.b64
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.b64?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.b64 (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.b64 Mon Oct 24 08:45:54 2011
@@ -0,0 +1 @@
+iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAIRQTFRFwdt/w9yEw9+MxN2GxN6NxN+Oxd2Mxd6Nxt6Lx96Lx96Nx9+NyN6MyN+MyN+N8u2I8+2I+NBq+NFr+NFt+NFu+NJz+NN0+dR1+dR3+dZw+dh4+9Fy+9Nz++5++++B+++F/NNz/PCH/PCI/PGW/PKc/fKd/vzp/vzq/v7+/v/z/9Jx////nQZfHwAAAIxJREFUOMtj0CYAGKiiQANdUAPdBAZmFMCIYQUzHwrgpKECblYwYEJ2LYoCHi0FMBCEAmF0E3hkxFGABJICXnYWFhY2aVE4EENTwCWgCARKCCCFoUAJFQw9BYycnBz8eBSA04cqPhNAQIX+CiSFhIRE8CiQ10ROMNgUqKNnHGU5FCCrhqZAg7Z5Ey8AALiBh6brcmloAAAAAElFTkSuQmCC
\ No newline at end of file

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64 (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64 Mon Oct 24 08:45:54 2011
@@ -0,0 +1 @@
+iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAIAAAADehTSAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sDGxMkCJXGmL8AAAHwSURBVGje7ZpNbhNBEIXf625sCzA/QUhkg8SGiGxZcpDcgRux5hLkEjkE7BAS9gIyk+muxyZIsSeOG09bsXHX0p4pfVNdP8/loSTsiTnsj1XWyrrMutVSG+ic/ftNqe1mIMtSjsPUu9EQJ6H/UdvNLr59cgwFWaM1p8dnLx6dFGYF6RhIXzLVGIChB3VX8Fg0DWrPqqyHxTq4MUnKKEEBoNvIN4uxiqTkofUXpgZKsqtMx3Djpb45lNWAxxbfXf6wtdH9+vkKBLLGrFLz4M1HTk+K5gAIgBCVcaTI1gOK/acazqqbw2PdYzE7tdyh9AFJTL0zNDIJMInAZpKPzBzmIZuUnjoa9QQkOBHAyWbigYDaTslybg/59f7Q4+003pqwhqcbqjLH9H2OXw0Ksl6XsWB/a39lhf1rz8vOnKoHKmtlrayVtbLuuc6SFK1Z2hEZkBwAv1us4zA9PT7rDX3v9dPiOeBxT/uY0A+qd6Pbl2Sax/kXDN9LlcrXO3Rk9k/QWluVtbIe2O5toBGwFum3bLH/pEso7RarrPNHH/D8JbBIpsjJqx2Lq3Xu2Xv61yvXJzf6/b3nK2Htyu8WB9P/XltF/wfVllgFxet9azGL+bjMD5IUYbPSMktwT8hRSdalkizcufKcs77vUlkr61bsD5lbwtgOKPT2AAAAAElFTkSuQmCC
\ No newline at end of file

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.b64
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.b64?rev=1188045&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.b64 (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.b64 Mon Oct 24 08:45:54 2011
@@ -0,0 +1 @@
+iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAABGdBTUEAALGPC/xhBQAAAAxQTFRFyN+N+dR1/PCI////6HjE5gAAADJJREFUKM9j+I8EPjBQifeBAQSY6coLBYN6inhaq0Bg6SDn/f//akB466ExTS6P2ukMAKumzarJO/66AAAAAElFTkSuQmCC
\ No newline at end of file

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.png
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.png?rev=1188045&view=auto
==============================================================================
Files tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.png (added) and tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.png Mon Oct 24 08:45:54 2011 differ

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/stats/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/stats/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/stats/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/stats/index.html Mon Oct 24 08:45:54 2011
@@ -17,26 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
-<head>
-<title>Stats</title>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<link rel="apple-touch-icon" href="/public/touchicon.png"/>
-<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
-</head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
 <div id="bodydiv" class="bodydiv">
 
-<div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="menu"></div>
-
 <table style="width: 100%;">
 <tr>
 <td><h2><span id="h1"></span><span id="appNameHeader"></span></h2></td>
@@ -57,7 +39,7 @@
 <form id="appForm">
 <table style="width: 100%;">
 <tr><tr><td><b>App Icon:</b></td></tr>
-<tr><td><img src="/public/app.png" style="width: 50px; height: 50px; vertical-align: top;"></td></tr>
+<tr><td><img id="appimg" style="width: 50px; height: 50px; vertical-align: top;"></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>Sharing:</b></td></tr>
 <tr><td><input type="checkbox" value="shared"/><span>Shared</span></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>App Title:</b></td></tr>
@@ -70,20 +52,17 @@
 </form>
 
 <script type="text/javascript">
-ui.initbody();
 
 // Get the app name
-var appname = ui.fragmentParams()['app'];
-if (isNil(appname))
-    window.open('/', '_self');
+var appname = ui.fragmentParams(location)['app'];
 
 /**
  * Return the link to an app.
  */
 function applink(appname) {
-    var protocol = window.location.protocol;
-    var host = window.location.hostname;
-    var port = ':' + window.location.port;
+    var protocol = location.protocol;
+    var host = location.hostname;
+    var port = ':' + location.port;
     if (port == ':80' || port == ':443' || port == ':')
         port = '';
     var link = protocol + '//' + appname + '.' + host + port + '/';
@@ -91,14 +70,14 @@ function applink(appname) {
 }
 
 // Set page titles
-document.title = windowtitle(window.location.hostname) + ' - Stats - ' + appname;
+document.title = ui.windowtitle(location.hostname) + ' - Stats - ' + appname;
 $('appNameHeader').innerHTML = '<a href=\"' + applink(appname) + '\" target=\"' + '_blank' + '\">' + appname + '</a>';
 var tclone = isNil(config.clone)? 'Clone' : config.clone;
 $('cloneApp').value = tclone;
 $('cloneApp').title = tclone + ' this app';
 
-// Load the menu bar
-displaymenu();
+// Set images
+$('appimg').src = ui.b64img(appcache.get('/public/app.b64'));
 
 // Init service references
 var editWidget = sca.component("EditWidget");
@@ -176,18 +155,12 @@ $('appForm').onsubmit = function() {
  * Handle Clone button event.
  */
 $('cloneApp').onclick = function() {
-    return ui.navigate('/clone/#app=' + appname, '_self');
+    return ui.navigate('/#view=clone&app=' + appname, '_view');
 }
 
 // Get the current app
 getapp(appname);
-</script>
 
-<div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
-</div>
+</script>
 
 </div>
-</body>
-</html>
-

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html Mon Oct 24 08:45:54 2011
@@ -17,26 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
-<head>
-<title>Store</title>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
-<meta name="apple-mobile-web-app-capable" content="yes"/>
-<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<link rel="apple-touch-icon" href="/public/touchicon.png"/>
-<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
-</head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
 <div id="bodydiv" class="bodydiv">
 
-<div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="menu"></div>
-
 <table style="width: 100%;">
 <tr><td><h2><span id="h1"></span></h2></td></tr>
 </table>
@@ -46,17 +28,13 @@
 <div id="apps"></div>
 
 <script type="text/javascript">
-ui.initbody();
 
 // Set page titles
-document.title = windowtitle(window.location.hostname) + ' - Store';
-$('h1').innerHTML = hometitle(window.location.hostname);
-
-// Display the menu bar
-displaymenu();
+document.title = ui.windowtitle(location.hostname) + ' - Store';
+$('h1').innerHTML = ui.hometitle(location.hostname);
 
 // Get the store category
-var category = ui.fragmentParams()['category'];
+var category = ui.fragmentParams(location)['category'];
 if (isNil(category))
     category = 'myapps';
 
@@ -64,18 +42,18 @@ if (isNil(category))
  * Build store menu bar
  */
 function catmenu() {
-    function catmenuitem(name, cat) {
+    function catmenuitem(name, cat, idx) {
         var c = cat == category? 'smenu' : 'amenu';
         return '<th class="thl thr" style="width: 10px; padding-top: 4px; padding-bottom: 4px; padding-right: 6px;">'
-                + ui.ahref('/store/#category=' + cat, '_reload', '<span class="' + c + '">' + name + '</span>') + '</th>';
+                + ui.ahref('/#view=store&category=' + cat + '&idx=' + idx, '_view', '<span class="' + c + '">' + name + '</span>') + '</th>';
     }
 
     var m = '<table style="width: 100%; margin-bottom: 2px;"><tr>';
-    m += catmenuitem('My Apps', 'myapps');
-    m += catmenuitem('New', 'new');
-    m += catmenuitem('Top', 'top');
-    m += catmenuitem('Featured', 'featured');
-    m += catmenuitem('All', 'all');
+    m += catmenuitem('My Apps', 'myapps', '1');
+    m += catmenuitem('New', 'new', '2');
+    m += catmenuitem('Top', 'top', '3');
+    m += catmenuitem('Featured', 'featured', '4');
+    m += catmenuitem('All', 'all', '5');
     if (category == 'myapps') {
         m += '<th class="thl thr" style="width: 100%; padding-top: 0px; padding-bottom: 0px; padding-right: 0px; text-align: right;">';
         m += '<input type="button" class="graybutton" id="createApp" title="Create a new app" style="font-weight: bold; margin-top: 0px; margin-bottom: 0px; height: 24px;" Value="New App"/>';
@@ -100,9 +78,9 @@ var dashboards = sca.reference(editWidge
  * Return the link to an app.
  */
 function applink(appname) {
-    var protocol = window.location.protocol;
-    var host = window.location.hostname;
-    var port = ':' + window.location.port;
+    var protocol = location.protocol;
+    var host = location.hostname;
+    var port = ':' + location.port;
     if (port == ':80' || port == ':443' || port == ':')
         port = '';
     var link = protocol + '//' + appname + '.' + host + port + '/';
@@ -113,14 +91,14 @@ function applink(appname) {
  * Edit an app.
  */
 function editApp(appname) {
-    return ui.navigate('/page/#app=' + appname, '_self');
+    return ui.navigate('/#view=page&app=' + appname, '_view');
 }
 
 /**
  * View an app.
  */
 function viewApp(appname) {
-    return ui.navigate('/stats/#app=' + appname, '_self');
+    return ui.navigate('/#view=stats&app=' + appname, '_view');
 }
 
 /**
@@ -128,7 +106,7 @@ function viewApp(appname) {
  */
 if (category == 'myapps') {
     $('createApp').onclick = function() {
-        return ui.navigate('/create/', '_self');
+        return ui.navigate('/#view=create', '_view');
     }
 }
 
@@ -136,6 +114,7 @@ if (category == 'myapps') {
  * Get and display list of apps.
  */
 function getapps(category) {
+    //log('category', category);
     function display(doc) {
 
         // Stop now if we didn't get the apps
@@ -147,6 +126,8 @@ function getapps(category) {
         var aentries = assoc("'entry", cdr(feed));
         var entries = isNil(aentries)? mklist() : isList(car(cadr(aentries)))? cadr(aentries) : mklist(cdr(aentries));
 
+        var appimg = ui.b64img(appcache.get('/public/app.b64'));
+
         function displayentries(entries) {
             if (isNil(entries))
                 return apps;
@@ -159,7 +140,7 @@ function getapps(category) {
             apps += '<div class="box" style="width: 150px; display: inline-block; border: 1px; border-style: solid; border-color: #dcdcdc; border-collapse: collapse; margin: 2px; padding: 2px; vertical-align: top;">'
             apps += '<table><tr>';
             apps += '<td>';
-            apps += '<div>' + ui.ahref('/stats/#app=' + name, '_self', '<img src="/public/app.png" width="50" height="50" style="height: 50px; width: 50px; vertical-align: top; margin: 0px; padding: 0px;"></img>') + '</div>';
+            apps += '<div>' + ui.ahref('/#view=stats&app=' + name, '_view', '<img src="' + appimg + '" width="50" height="50" style="height: 50px; width: 50px; vertical-align: top; margin: 0px; padding: 0px;"></img>') + '</div>';
             apps += '</td>';
             apps += '<td class="tdw">';
             apps += '<div style="font-weight: bold">' + ui.ahref(applink(name), '_blank', name) + '</div>';
@@ -186,13 +167,7 @@ function getapps(category) {
 
 // Get and display the list of apps
 getapps(category);
-</script>
 
-<div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
-</div>
+</script>
 
 </div>
-</body>
-</html>
-

Modified: tuscany/sca-cpp/trunk/modules/edit/ssl-start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/ssl-start?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/ssl-start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/ssl-start Mon Oct 24 08:45:54 2011
@@ -51,18 +51,18 @@ jsprefix=`echo "import os; print os.path
 # Configure error pages
 cat >>tmp/conf/svhost-ssl.conf <<EOF
 # Error pages
-ErrorDocument 404 /public/notfound.html
-ErrorDocument 401 /public/notauth.html
-ErrorDocument 500 /public/oops.html
+ErrorDocument 404 /notfound/
+ErrorDocument 401 /notauth/
+ErrorDocument 500 /oops/
 
 EOF
 
 # Configure app home pages
 cat >>tmp/conf/dvhost-ssl.conf <<EOF
 # App error pages
-ErrorDocument 404 /public/notfound.html
-ErrorDocument 401 /public/notauth.html
-ErrorDocument 500 /public/oops.html
+ErrorDocument 404 /notfound/
+ErrorDocument 401 /notauth/
+ErrorDocument 500 /oops/
 
 # Redirect www to main home page
 RewriteEngine on
@@ -101,7 +101,8 @@ EOF
 # Configure main aliases
 cat >>tmp/conf/httpd.conf <<EOF
 
-Alias /home.png $here/htdocs/home.png
+Alias /home/home.png $here/htdocs/home/home.png
+Alias /home/home.b64 $here/htdocs/home/home.b64
 
 EOF
 
@@ -120,7 +121,10 @@ Alias /headconfig.js $here/htdocs/headco
 Alias /index.html $here/htdocs/app/index.html
 Alias /login $here/htdocs/login
 Alias /logout $here/htdocs/logout
-Alias /menu.js $here/htdocs/menu.js
+Alias /notauth $here/htdocs/notauth
+Alias /notfound $here/htdocs/notfound
+Alias /notyet $here/htdocs/notyet
+Alias /oops $here/htdocs/oops
 Alias /public $here/htdocs/public
 Alias /robots.txt $here/htdocs/robots.txt
 

Modified: tuscany/sca-cpp/trunk/modules/edit/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/start?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/start Mon Oct 24 08:45:54 2011
@@ -35,18 +35,18 @@ jsprefix=`echo "import os; print os.path
 # Configure error pages
 cat >>tmp/conf/svhost.conf <<EOF
 # Error pages
-ErrorDocument 404 /public/notfound.html
-ErrorDocument 401 /public/notauth.html
-ErrorDocument 500 /public/oops.html
+ErrorDocument 404 /notfound/
+ErrorDocument 401 /notauth/
+ErrorDocument 500 /oops/
 
 EOF
 
 # Configure app home pages
 cat >>tmp/conf/dvhost.conf <<EOF
 # App error pages
-ErrorDocument 404 /public/notfound.html
-ErrorDocument 401 /public/notauth.html
-ErrorDocument 500 /public/oops.html
+ErrorDocument 404 /notfound/
+ErrorDocument 401 /notauth/
+ErrorDocument 500 /oops/
 
 # Redirect www to main home page
 RewriteEngine on
@@ -70,6 +70,14 @@ SCAVirtualComposite app.composite
 
 EOF
 
+# Configure main aliases
+cat >>tmp/conf/httpd.conf <<EOF
+
+Alias /home/home.png $here/htdocs/home/home.png
+Alias /home/home.b64 $here/htdocs/home/home.b64
+
+EOF
+
 # Create app links and sub-directories if needed
 ./mkapplinks
 
@@ -85,7 +93,10 @@ Alias /headconfig.js $here/htdocs/headco
 Alias /index.html $here/htdocs/app/index.html
 Alias /login $here/htdocs/login
 Alias /logout $here/htdocs/logout
-Alias /menu.js $here/htdocs/menu.js
+Alias /notauth $here/htdocs/notauth
+Alias /notfound $here/htdocs/notfound
+Alias /notyet $here/htdocs/notyet
+Alias /oops $here/htdocs/oops
 Alias /public $here/htdocs/public
 Alias /robots.txt $here/htdocs/robots.txt
 

Modified: tuscany/sca-cpp/trunk/modules/http/conf/mime.types
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/conf/mime.types?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/conf/mime.types (original)
+++ tuscany/sca-cpp/trunk/modules/http/conf/mime.types Mon Oct 24 08:45:54 2011
@@ -546,7 +546,7 @@ text/directory
 text/enriched
 text/html			html htm
 text/parityfec
-text/plain			asc txt
+text/plain			asc txt b64
 text/prs.lines.tag
 text/rfc822-headers
 text/richtext			rtx

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-conf?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-conf Mon Oct 24 08:45:54 2011
@@ -284,6 +284,11 @@ cat >$root/conf/vhost.conf <<EOF
 # Virtual host configuration
 UseCanonicalName Off
 
+# Enable HTTP reverse proxy
+ProxyRequests Off
+ProxyPreserveHost Off
+ProxyStatus On
+
 EOF
 
 cat >$root/conf/svhost.conf <<EOF

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf Mon Oct 24 08:45:54 2011
@@ -129,6 +129,18 @@ SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 1
 LogFormat "[%{%a %b %d %H:%M:%S %Y}t] [sslaccess] %h %l %u %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{SSL_CLIENT_I_DN}x\" \"%{SSL_CLIENT_S_DN}x\" \"%{cookie}n\" %A %V %D %I %O" sslcombined
 CustomLog $root/logs/ssl_access_log sslcombined
 
+# Enable HTTPS reverse proxy
+ProxyRequests Off
+ProxyPreserveHost Off
+ProxyStatus On
+SSLProxyEngine on
+SSLProxyCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
+
+# Verify server certificates
+SSLProxyVerify require
+SSLProxyVerifyDepth 1
+SSLProxyCheckPeerCN Off
+
 EOF
 
 proxycert="server"
@@ -144,8 +156,12 @@ Include conf/vhost-ssl.conf
 # Declare SSL certificates used in this virtual host
 SSLCACertificateFile "$root/cert/ca.crt"
 SSLCertificateChainFile "$root/cert/ca.crt"
-SSLCertificateFile "$root/cert/server.crt"
-SSLCertificateKeyFile "$root/cert/server.key"
+SSLCertificateFile "$root/cert/vhost.crt"
+SSLCertificateKeyFile "$root/cert/vhost.key"
+
+# Declare proxy SSL client certificates
+SSLProxyCACertificateFile "$root/cert/ca.crt"
+SSLProxyMachineCertificateFile "$root/cert/$proxycert.pem"
 
 EOF
 

Modified: tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp Mon Oct 24 08:45:54 2011
@@ -199,6 +199,7 @@ static int checkAuthn(request_rec *r) {
     if (!dc.enabled)
         return DECLINED;
     const char* atype = ap_auth_type(r);
+    debug(atype, "modopenauth::checkAuthn::auth_type");
     if (atype == NULL || strcasecmp(atype, "Open"))
         return DECLINED;
 

Modified: tuscany/sca-cpp/trunk/modules/http/proxy-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/proxy-conf?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/proxy-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/proxy-conf Mon Oct 24 08:45:54 2011
@@ -24,11 +24,6 @@ root=`echo "import os; print os.path.rea
 
 cat >>$root/conf/vhost.conf <<EOF
 # Generated by: proxy-conf $*
-# Enable HTTP reverse proxy
-ProxyRequests Off
-ProxyPreserveHost On
-ProxyStatus On
-
 # Enable load balancing
 ProxyPass / balancer://cluster/
 



Mime
View raw message