tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1088508 - in /tuscany/sca-cpp/trunk: kernel/ modules/edit/ modules/edit/htdocs/ modules/edit/htdocs/app/ modules/edit/htdocs/dash/ modules/edit/htdocs/data/ modules/edit/htdocs/graph/ modules/edit/htdocs/login/ modules/edit/htdocs/logout/ ...
Date Mon, 04 Apr 2011 08:46:09 GMT
Author: jsdelfino
Date: Mon Apr  4 08:46:08 2011
New Revision: 1088508

URL: http://svn.apache.org/viewvc?rev=1088508&view=rev
Log:
Fix performance and security issues reported by pagespeed and skipfish.

Modified:
    tuscany/sca-cpp/trunk/kernel/sstream.hpp
    tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png
    tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/props/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.png
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.png
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/store/store.html
    tuscany/sca-cpp/trunk/modules/edit/ssl-start
    tuscany/sca-cpp/trunk/modules/edit/start
    tuscany/sca-cpp/trunk/modules/http/httpd-conf
    tuscany/sca-cpp/trunk/modules/http/httpd.hpp
    tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp
    tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css
    tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
    tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp

Modified: tuscany/sca-cpp/trunk/kernel/sstream.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/sstream.hpp?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/sstream.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/sstream.hpp Mon Apr  4 08:46:08 2011
@@ -184,16 +184,16 @@ private:
  */
 const list<string> tokenize(const char* sep, const string& str) {
     struct nested {
-        static const list<string> tokenize(const char* sep, const string& str, const size_t start = 0) {
+        static const list<string> tokenize(const char* sep, const size_t slen, const string& str, const size_t start) {
             if (start >= length(str))
                 return list<string>();
             const size_t i = find(str, sep, start);
             if (i == length(str))
                 return mklist(string(substr(str, start)));
-            return cons(string(substr(str, start, i - start)), tokenize(sep, str, i + 1));
+            return cons(string(substr(str, start, i - start)), tokenize(sep, slen, str, i + slen));
         }
     };
-    return nested::tokenize(sep, str, 0);
+    return nested::tokenize(sep, strlen(sep), str, 0);
 }
 
 /**

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>App</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-translucent"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <script type="text/javascript">
 document.title = window.location.hostname.split('.')[0];
 </script>
@@ -63,8 +63,24 @@ function datavalue(l, id) {
     if (isNil(l))
         return null;
     var e = car(l);
-    if (id == elementName(e))
-        return e;
+
+    // Element matches id segment
+    if (car(id) == elementName(e)) {
+        log('match', car(id));
+
+        // Found element matching the whole id path
+        if (isNil(cdr(id)))
+            return e;
+
+        // Search for next id segments in child elements
+        if (!elementHasValue(e)) {
+            var v = datavalue(elementChildren(e), cdr(id));
+            if (v != null)
+                return v;
+        }
+    }
+
+    // Search for id through the whole element tree
     if (!elementHasValue(e)) {
         var v = datavalue(elementChildren(e), id);
         if (v != null)
@@ -161,7 +177,7 @@ function displaydata(l) {
 
     // Update the widgets values
     function updatewidget(e) {
-        var dv = datavalue(l, "'" + e.id);
+        var dv = datavalue(l, map(function(t) { return "'" + t; }, e.id.split('.')));
         if (dv == null || isNil(dv))
             return e;
         setwidgetvalue(e, dv);
@@ -221,6 +237,14 @@ function fixupwidget(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 == 'table') {
+        car(childElements(e)).style.width = '100%';
+        return e;
+    }
     return e;
 }
 
@@ -228,50 +252,61 @@ function fixupwidget(e) {
  * Get app data from the main app page component.
  */
 function getpagedata() {
+    try {
 
-    // Display component data on the page
-    function displaypage(doc) {
-        if (!isNil(doc))
-            displaydoc(doc);
+        // Display component data on the page
+        function displaypage(doc) {
+            if (!isNil(doc))
+                displaydoc(doc);
 
-        // Reveal the page
-        ui.showbody();
-        return true;
-    }
-
-    // Eval a component init script
-    function evalcompinit(doc) {
-        if (isNil(doc))
-            return true;
-        var js = car(json.readJSON(mklist(doc)));
-        if (!elementHasValue(js))
+            // Reveal the page
+            ui.showbody();
             return true;
-        eval(elementValue(js));
-        return true;
-    }
-
-    // Initial setup of a widget
-    function setupwidget(e) {
-        fixupwidget(e);
-        bindwidgethandler(e);
-    }
+        }
 
-    // Get the component app data
-    var doc = pagecomp.get(window.location.search, function(doc) {
-        $('app').innerHTML = $('appFrame').contentDocument.body.innerHTML;
-
-        // Initial setup of the widgets
-        map(setupwidget, filter(function(e) { return !isNil(e.id); }, nodeList(ui.elementByID($('app'), 'page').childNodes)));
+        // Eval a component init script
+        function evalcompinit(doc) {
+            log('comp init', doc);
+            if (isNil(doc))
+                return true;
+            var js = car(json.readJSON(mklist(doc)));
+            if (!elementHasValue(js))
+                return true;
+            eval(elementValue(js));
+            return true;
+        }
 
-        // Display data on the page
-        displaypage(doc);
-
-        // Get and eval the optional timer and location watch setup scripts
-        everycomp.get('setup', evalcompinit);
-        locationcomp.get('setup', evalcompinit);
-        return true;
-    });
+        // Initial setup of a widget
+        function setupwidget(e) {
+            fixupwidget(e);
+            bindwidgethandler(e);
+        }
+
+        // Get the component app data
+        var doc = pagecomp.get(window.location.search, function(doc) {
+            log('page return', doc);
+            try {
+                $('app').innerHTML = $('appFrame').contentDocument.body.innerHTML;
+
+                // Initial setup of the widgets
+                map(setupwidget, filter(function(e) { return !isNil(e.id); }, nodeList(ui.elementByID($('app'), 'page').childNodes)));
+
+                // Display data on the page
+                displaypage(doc);
+
+                // Get and eval the optional timer and location watch setup scripts
+                everycomp.get('setup', evalcompinit);
+                locationcomp.get('setup', evalcompinit);
+                return true;
+
+            } catch(e) {
+                log('exception on pagecomp.get()', e);
+            }
+        });
 
+    } catch(e) {
+        log('exception in getpagedata()', e);
+    }
     return true;
 }
 
@@ -280,6 +315,7 @@ function getpagedata() {
  */
 function getcompdata(comp, qs) {
     var doc = comp.get(qs, function(doc) {
+        log('comp data', doc);
         return displaydoc(doc);
     });
     return true;
@@ -310,21 +346,33 @@ function compquery() {
  * Handle a button click event.
  */
 function buttonClickHandler(id) {
-    return getcompdata(sca.component(id), compquery());
+    try {
+        return getcompdata(sca.component(id), compquery());
+    } catch(e) {
+        log('exception in buttonClickHandler()', e);
+    }
 }
 
 /**
  * Handle a timer interval event.
  */
 function intervalHandler() {
-    return getcompdata(everycomp, compquery());
+    try {
+        return getcompdata(everycomp, compquery());
+    } catch(e) {
+        log('exception in intervalHandler()', e);
+    }
 }
 
 /**
  * Setup an interval timer.
  */
 function setupIntervalHandler(sec) {
-    return setInterval(intervalHandler, sec);
+    try {
+        return setInterval(intervalHandler, sec);
+    } catch(e) {
+        log('exception in setupIntervalHandler()', e);
+    }
 }
 
 /**
@@ -333,11 +381,17 @@ function setupIntervalHandler(sec) {
 var geoposition;
 
 function locationHandler(pos) {
-    geoposition = pos;
-    return getcompdata(locationcomp, compquery());
+    log('location pos', pos);
+    try {
+        geoposition = pos;
+        return getcompdata(locationcomp, compquery());
+    } catch(e) {
+        log('exception in locationHandler()', e);
+    }
 }
 
 function locationErrorHandler(e) {
+    log('location error', e);
     return true;
 }
 
@@ -345,8 +399,13 @@ function locationErrorHandler(e) {
  * Setup a location watch handler.
  */
 function setupLocationHandler() {
-    navigator.geolocation.getCurrentPosition(locationHandler, locationErrorHandler);
-    navigator.geolocation.watchPosition(locationHandler, locationErrorHandler);
+    log('setup location');
+    try {
+        navigator.geolocation.getCurrentPosition(locationHandler, locationErrorHandler);
+        navigator.geolocation.watchPosition(locationHandler, locationErrorHandler);
+    } catch(e) {
+        log('exception in setupLocationHandler()', e);
+    }
     return true;
 }
 

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html Mon Apr  4 08:46:08 2011
@@ -104,13 +104,13 @@ function getapps(sync) {
             var title = cadr(assoc("'title", entry))
             var name = cadr(assoc("'id", entry))
             var editlink = '<a href=\"' + '/graph/?app=' + name + '\" target=\"_parent\">';
-            var domainlink = '<a href=\"' + applink(name) + '\" target=\"_' + name + '\">' + name + '.' + window.location.hostname + '</a>';
+            var domainlink = '<a href=\"' + applink(name) + '\" target=\"' + '_blank' + '\">' + name + '.' + window.location.hostname + '</a>';
             var category = 'coolapps';
             var updated = 'Feb 4, 2011';
             var sharing = 'Public';
 
             apps += '<tr class="trb"><td>';
-            apps += editlink + '<img src="/public/app.png" style="width: 50px; height: 50px; margin-right: 10px; vertical-align: middle;"></img>' + '</a>';
+            apps += editlink + '<img src="/public/app.png" width="50" height="50" style="width: 50px; height: 50px; margin-right: 10px; vertical-align: middle;"></img>' + '</a>';
             apps += '&nbsp;' + editlink + name + '</a></td>';
             apps += '<td>' + domainlink + '</td>';
             apps += '<td>' + category + '</td>';

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>App Dashboard</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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -46,7 +46,6 @@ $('h1').innerHTML = domaintitle(window.l
 $('dashboard').innerHTML =
     '<iframe id="dashboardFrame" style="height: 5000px; width: 100%; border: 0px;" scrolling="no" frameborder="0" src="dashboard.html"></iframe>';
 
-ui.showbody();
 </script>
 
 </body>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html Mon Apr  4 08:46:08 2011
@@ -25,7 +25,7 @@ document.title = 'View - ' + window.loca
 </script>
 <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-translucent"/>
+<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.css">
 <script type="text/javascript" src="/util.js"></script>
@@ -81,7 +81,9 @@ function mkdoctable(doc) {
  * Get and display the contents of the current component.
  */
 function getdata() {
+    log('comp', comp.uri);
     comp.get('', function(doc) {
+        log('doc', doc);
 
         if (json.isJSON(mklist(doc)))
             return display(datatable(json.readJSON(mklist(doc))));

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html Mon Apr  4 08:46:08 2011
@@ -161,6 +161,7 @@ $('saveButton').onclick = function(e) {
  * Save the current composite.
  */
 function save() {
+    log('saving');
     $('saveButton').value = 'Saving';
     savedcomposxml = car(writeXML(composite, false));
     var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
@@ -184,6 +185,8 @@ function oncomposchange() {
 
     // Autosave after 3 seconds
     setTimeout(function() {
+        log('savedcomposxml', savedcomposxml);
+        log('newddcomposxml', car(writeXML(composite, false)));
         if (savedcomposxml == car(writeXML(composite, false)))
             return false;
         return save();
@@ -307,6 +310,7 @@ installpalette('http', pos.rmove(0, 40),
 installpalette('talk', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('social', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('search', pos.rmove(0, 40), g, bg, spalette, gpalettes);
+installpalette('database', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('logic', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('math', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('python', pos.rmove(0, 40), g, bg, spalette, gpalettes);

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>Composition</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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -62,7 +62,6 @@ function editapp(name) {
 // Display the editor for the current app
 editapp(appname);
 
-ui.showbody();
 </script>
 
 </body>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
Files tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png (original) and tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png Mon Apr  4 08:46:08 2011 differ

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>Home</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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -48,7 +48,6 @@ $('h1').innerHTML = domaintitle(window.l
 // Load the main page
 ui.loadiframe('main', 'main.html');
 
-ui.showbody();
 </script>
 
 </body>

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html Mon Apr  4 08:46:08 2011
@@ -22,7 +22,7 @@
 <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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -32,7 +32,7 @@
 <h1>Sign in</h1>
 <br/>
 
-<form name="formSignin" method="POST" action="/login/dologin">
+<form name="formSignin" method="POST" action="/login/dologin/">
 <table border="0">
 <tr><td>Username:</td><td><input type="text" id="httpd_username" name="httpd_username" value=""/></td></tr>
 <tr><td>Password:</td><td><input type="password" name="httpd_password" value=""/></td></tr>
@@ -56,7 +56,7 @@ function queryParams() {
 function oauthReferrer() {
     r = queryParams()['openauth_referrer'];
     if (typeof(r) == 'undefined')
-        return r;
+        return '/';
     s = r.indexOf('//');
     if (s > 0)
         r = r.substring(s + 2);
@@ -66,10 +66,6 @@ function oauthReferrer() {
     return r;
 }
 
-if (typeof(oauthReferrer()) == 'undefined') {
-    document.location = '/';
-}
-
 function submitFormSignin() {
     var reset = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';domain=.' + domainname(window.location.hostname) + ';path=/;secure=TRUE';
     document.cookie = reset;

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html Mon Apr  4 08:46:08 2011
@@ -22,7 +22,7 @@
 <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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -32,7 +32,7 @@
 <h1>Sign out</h1>
 <br/>
 
-<form name="signout" action="/login" method="GET">
+<form name="signout" action="/" method="GET">
 <input type="submit" onclick="submitSignout()" id="signOut" value="Sign out"/>
 </form>
 

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html Mon Apr  4 08:46:08 2011
@@ -29,11 +29,11 @@
 <div style="margin-left: auto; margin-right: auto; text-align: center;">
 <br/><br/><br/>
 
-<a href="dash" target="_parent"><img src="home.png" style="width: 426px; height: 145px;"/></a>
+<a href="/dash/" target="_parent"><img src="home.png" width="426" height="145" style="width: 426px; height: 145px;"/></a>
 
 <br/><br/>
 
-<h1><a href="dash" target="_parent">Get Started</a></h1>
+<h1><a href="/dash/" target="_parent">Get Started</a></h1>
 
 <br/><br/><br/>
 <div>This module implements a simple App store to help you create and share Tuscany apps.</div>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html Mon Apr  4 08:46:08 2011
@@ -68,9 +68,9 @@ function applink(appname) {
 var mdiv = $('menu'); 
 var name = appname();
 mdiv.innerHTML = ui.menubar(
-    append(mklist(ui.menu('Home', '/'), ui.menu('Store', '/store'), ui.menu('Dashboard', '/dash')),
-            (isNil(name) || name == 'undefined')? mklist() : mklist(ui.menu('Composition', '/graph/?app=' + name), ui.menu('Page', '/page/?app=' + name), ui.menu('Settings', '/props/?app=' + name), ui.menu(name + '.' + window.location.hostname, applink(name), '_' + name))),
-    mklist(userMenu(), ui.menu('Account', '/account'), ui.menu('Sign out', '/logout')));
+    append(mklist(ui.menu('Home', '/'), ui.menu('Store', '/store/'), ui.menu('Dashboard', '/dash/')),
+            (isNil(name) || name == 'undefined')? mklist() : mklist(ui.menu('Composition', '/graph/?app=' + name), ui.menu('Page', '/page/?app=' + name), ui.menu('Settings', '/props/?app=' + name), ui.menu(name + '.' + window.location.hostname, applink(name), '_blank'))),
+    mklist(userMenu(), ui.menu('Account', '/account/'), ui.menu('Sign out', '/logout/')));
 
 </script>
 </body>

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -62,7 +62,6 @@ function editapp(name) {
 
 editapp(appname);
 
-ui.showbody();
 </script>
 </body>
 </html>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html Mon Apr  4 08:46:08 2011
@@ -53,18 +53,18 @@
 
 <span class="h1" id="palette:h1" style="position: absolute; left: 0px; top: 0px;"><h1>Header1</h1></span>
 <span class="h2" id="palette:h2" style="position: absolute; left: 0px; top: 35px;"><h2>Header2</h2></span>
-<span class="section" id="palette:section" style="position: absolute; left: 0px; top: 70px;"><span class="section">section</span></span>
+<span class="section" id="palette:section" style="position: absolute; left: 0px; top: 70px; width: 200px;"><span class="section">section</span></span>
 <span class="button" id="palette:button" style="position: absolute; left: 0px; top: 100px;"><input type="button" value="button"/></span>
-<span class="entry" id="palette:entry" style="position: absolute; left: 0px; top: 130px;"><input type="text" value="field" size="10"/></span>
-<span class="password" id="palette:password" style="position: absolute; left: 0px; top: 160px;"><input type="password" value="password" size="10"/></span>
+<span class="entry" id="palette:entry" style="position: absolute; left: 0px; top: 130px;"><input type="text" value="field" size="20"/></span>
+<span class="password" id="palette:password" style="position: absolute; left: 0px; top: 160px;"><input type="password" value="password" size="20"/></span>
 <span class="checkbox" id="palette:checkbox" style="position: absolute; left: 0px; top: 190px;"><input type="checkbox" value="checkbox"/><span>checkbox</span></span>
 <span class="list" id="palette:list" style="position: absolute; left: 0px; top: 220px;"><select><option value="list">list</option></select></span>
-<span class="table" id="palette:table" style="position: absolute; left: 0px; top: 250px;">
-<table class="datatable"><tr><td class="datatdl">table</td><td class="datatdr">...</td></tr><tr><td class="datatdl">...</td><td class="datatdr">...</td></tr></table>
+<span class="table" id="palette:table" style="position: absolute; left: 0px; top: 250px; width: 200px;">
+<table class="datatable" style="width: 200px;"><tr><td class="datatdl">table</td><td class="datatdr">...</td></tr><tr><td class="datatdl">...</td><td class="datatdr">...</td></tr></table>
 </span>
 <span class="link" id="palette:link" style="position: absolute; left: 0px; top: 300px;"><a href="/"><span>link</span></a></span>
 <span class="text" id="palette:text" style="position: absolute; left: 0px; top: 330px;"><span>text</span></span>
-<span class="iframe" id="palette:iframe" style="position: absolute; left: 0px; top: 360px;"><a href="/public/iframe.html"><span class="fakeframe"><span>frame ...</span></span></a></span>
+<span class="iframe fakeframe" id="palette:iframe" style="position: absolute; left: 0px; top: 360px; 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: 390px;"><img src="/public/img.png"/></span>
 
 </div>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/props/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/props/index.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/props/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/props/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>Settings</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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -59,7 +59,6 @@ function editapp(name) {
 // Display the editor for the current app
 editapp(appname);
 
-ui.showbody();
 </script>
 
 </body>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.png
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.png?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
Files tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.png (original) and tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.png Mon Apr  4 08:46:08 2011 differ

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <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-translucent"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
 </head>
 <body style="margin:3px; padding: 0px; background-color: #dcdcdc;">

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.png
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.png?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
Files tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.png (original) and tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.png Mon Apr  4 08:46:08 2011 differ

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>Sorry</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-translucent"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
@@ -45,7 +45,8 @@ if (!issubdomain(window.location.hostnam
 
 $('h1').innerHTML = domaintitle(window.location.hostname);
 
-ui.showbody();
+if (issubdomain(window.location.hostname))
+    ui.showbody();
 
 function submitSignout() {
     var reset = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';domain=.' + domainname(window.location.hostname) + ';path=/;secure=TRUE';

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>Page not found</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-translucent"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
@@ -43,7 +43,8 @@ if (!issubdomain(window.location.hostnam
 
 $('h1').innerHTML = domaintitle(window.location.hostname);
 
-ui.showbody();
+if (issubdomain(window.location.hostname))
+    ui.showbody();
 </script>
 
 </body>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>Oops</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-translucent"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
@@ -42,7 +42,8 @@ if (!issubdomain(window.location.hostnam
 
 $('h1').innerHTML = domaintitle(window.location.hostname);
 
-ui.showbody();
+if (issubdomain(window.location.hostname))
+   ui.showbody();
 </script>
 
 </body>

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html Mon Apr  4 08:46:08 2011
@@ -21,7 +21,7 @@
 <title>App 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-translucent"/>
+<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.css"/>
 <script type="text/javascript" src="/util.js"></script>
@@ -51,7 +51,6 @@ if (isNil(category))
 $('store').innerHTML =
     '<iframe id="storeFrame" style="height: 5000px; width: 100%; border: 0px;" scrolling="no" frameborder="0" src="store.html?category=' + category + '"></iframe>';
 
-ui.showbody();
 </script>
 
 </body>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/store/store.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/store/store.html?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/store/store.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/store/store.html Mon Apr  4 08:46:08 2011
@@ -101,12 +101,12 @@ function getapps(category, sync) {
             title = cadr(assoc("'title", entry))
             name = cadr(assoc("'id", entry))
             author = 'joe@localhost';
-            hreflink = '<a href=\"' + applink(name) + '\" target=\"' + name + '\">';
+            hreflink = '<a href=\"' + applink(name) + '\" target=\"' + '_blank' + '\">';
 
             apps += '<div class="box" style="width: 250px; display: inline-block; border: 1px; border-style: solid; border-color: #dcdcdc; border-collapse: collapse; margin: 5px; padding: 10px; vertical-align: top;">'
             apps += '<table><tr>';
             apps += '<td>';
-            apps += '<div>' + hreflink + '<img src="/public/app.png" style="height: 50px; width: 50px; vertical-align: top; margin-right: 10px; margin-bottom: 5px;"></img>' + '</a></div>';
+            apps += '<div>' + hreflink + '<img src="/public/app.png" width="50" height="50" style="height: 50px; width: 50px; vertical-align: top; margin-right: 10px; margin-bottom: 5px;"></img>' + '</a></div>';
             apps += '<div><input type="button" id="cloneApp" value="Clone" title="Clone this app"></div>';
             apps += '</td>';
             apps += '<td class="tdw">';

Modified: tuscany/sca-cpp/trunk/modules/edit/ssl-start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/ssl-start?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/ssl-start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/ssl-start Mon Apr  4 08:46:08 2011
@@ -54,19 +54,35 @@ EOF
 
 # Configure app home pages
 cat >>tmp/conf/dvhost-ssl.conf <<EOF
-# Redirect to app home page
-RewriteEngine On
-RewriteRule ^/$ /index.html [R]
-
-# Error pages
+# App error pages
 ErrorDocument 404 /public/notfound.html
 ErrorDocument 401 /public/notauth.html
 ErrorDocument 500 /public/oops.html
 
+# Redirect www to main home page
+RewriteEngine on
+RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC]
+RewriteCond %{SERVER_PORT} !^443$
+RewriteRule .* https://sca-store.com:%{SERVER_PORT}%{REQUEST_URI} [L,R]
+RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC]
+RewriteRule .* https://sca-store.com%{REQUEST_URI} [L,R]
+
+EOF
+
+cat >>tmp/conf/dvhost.conf <<EOF
+# Redirect www to main home page
+RewriteEngine on
+RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC]
+RewriteCond %{SERVER_PORT} !^80$
+RewriteRule .* http://sca-store.com:%{SERVER_PORT}%{REQUEST_URI} [L,R]
+RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC]
+RewriteRule .* http://sca-store.com%{REQUEST_URI} [L,R]
+
 EOF
 
 # Configure SCA contributions
 cat >>tmp/conf/httpd.conf <<EOF
+
 # Configure SCA Composite
 SCAContribution `pwd`/
 SCAComposite edit.composite
@@ -87,6 +103,9 @@ EOF
 # Create app links and sub-directories if needed
 ./mkapplinks
 
+# Create application database directories
+mkdir -p tmp/appdata/filedb
+
 # Start memcached
 ../../components/cache/memcached-start
 

Modified: tuscany/sca-cpp/trunk/modules/edit/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/start?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/start Mon Apr  4 08:46:08 2011
@@ -42,15 +42,19 @@ EOF
 
 # Configure app home pages
 cat >>tmp/conf/dvhost.conf <<EOF
-# Redirect to app home page
-RewriteEngine On
-RewriteRule ^/$ /index.html [R]
-
-# Error pages
+# App error pages
 ErrorDocument 404 /public/notfound.html
 ErrorDocument 401 /public/notauth.html
 ErrorDocument 500 /public/oops.html
 
+# Redirect www to main home page
+RewriteEngine on
+RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC]
+RewriteCond %{SERVER_PORT} !^80$
+RewriteRule .* http://sca-store.com:%{SERVER_PORT}%{REQUEST_URI} [L,R]
+RewriteCond %{HTTP_HOST} ^www\.sca-store\.com [NC]
+RewriteRule .* http://sca-store.com%{REQUEST_URI} [L,R]
+
 EOF
 
 # Configure SCA contributions
@@ -75,6 +79,9 @@ EOF
 # Create app links and sub-directories if needed
 ./mkapplinks
 
+# Create application database directories
+mkdir -p tmp/appdata/filedb
+
 # Start memcached
 ../../components/cache/memcached-start 11211
 

Modified: tuscany/sca-cpp/trunk/modules/http/httpd-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd-conf?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd-conf (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd-conf Mon Apr  4 08:46:08 2011
@@ -75,8 +75,16 @@ CustomLog $root/logs/access_log combined
 CookieTracking on
 CookieName TuscanyVisitorId
 
-# Configure Mime types
+# Configure Mime types and default charsets
 TypesConfig $here/conf/mime.types
+AddDefaultCharset utf-8
+AddCharset utf-8 .js .css
+
+# Configure cache control
+SetEnvIf Request_URI "^/app.html$" must-revalidate
+Header onsuccess merge Cache-Control public
+Header onsuccess merge Cache-Control max-age=31536000
+Header onsuccess merge Cache-Control must-revalidate env=must-revalidate
 
 # Set default document root
 DocumentRoot $htdocs
@@ -114,6 +122,16 @@ AuthType None
 Require all granted
 </Location>
 
+# Enable compression
+<Location />
+SetOutputFilter DEFLATE
+BrowserMatch ^Mozilla/4 gzip-only-text/html
+BrowserMatch ^Mozilla/4\.0[678] no-gzip
+BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+Header append Vary User-Agent env=!dont-vary
+</Location>
+
 # Listen on HTTP port
 Listen $listen
 
@@ -158,6 +176,7 @@ cat >$root/conf/modules.conf <<EOF
 # Load a minimal set of modules, the load order is important
 # (e.g. load mod_headers before mod_rewrite, so its hooks execute
 # after mod_rewrite's hooks)
+LoadModule headers_module ${modules_prefix}/modules/mod_headers.so
 LoadModule alias_module ${modules_prefix}/modules/mod_alias.so
 LoadModule authn_file_module ${modules_prefix}/modules/mod_authn_file.so
 LoadModule authn_core_module ${modules_prefix}/modules/mod_authn_core.so
@@ -176,7 +195,6 @@ LoadModule proxy_connect_module ${module
 LoadModule proxy_http_module ${modules_prefix}/modules/mod_proxy_http.so
 LoadModule proxy_balancer_module ${modules_prefix}/modules/mod_proxy_balancer.so
 LoadModule lbmethod_byrequests_module ${modules_prefix}/modules/mod_lbmethod_byrequests.so
-LoadModule headers_module ${modules_prefix}/modules/mod_headers.so
 LoadModule ssl_module ${modules_prefix}/modules/mod_ssl.so
 LoadModule socache_shmcb_module ${modules_prefix}/modules/mod_socache_shmcb.so
 LoadModule rewrite_module ${modules_prefix}/modules/mod_rewrite.so

Modified: tuscany/sca-cpp/trunk/modules/http/httpd.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd.hpp?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd.hpp Mon Apr  4 08:46:08 2011
@@ -326,10 +326,10 @@ const failable<int> writeResult(const fa
     ostringstream os;
     write(content(ls), os);
     const string ob(str(os));
-    debug(ob, "httpd::writeResult");
 
     // Make sure browsers come back and check for updated dynamic content
     apr_table_setn(r->headers_out, "Expires", "Tue, 01 Jan 1980 00:00:00 GMT");
+    apr_table_setn(r->headers_out, "Cache-Control", "must-revalidate");
 
     // Compute and return an Etag for the returned content
     const string etag(ap_md5(r->pool, (const unsigned char*)c_str(ob)));
@@ -339,10 +339,14 @@ const failable<int> writeResult(const fa
     const char* match = apr_table_get(r->headers_in, "If-None-Match");
     apr_table_setn(r->headers_out, "ETag", apr_pstrdup(r->pool, c_str(etag)));
     if (match != NULL  && etag == match) {
-
         r->status = HTTP_NOT_MODIFIED;
+        debug(r->status, "httpd::writeResult::status");
         return OK;
     }
+
+    debug(r->status, "httpd::writeResult::status");
+    debug(ct, "httpd::writeResult::contentType");
+    debug(ob, "httpd::writeResult::content");
     ap_set_content_type(r, apr_pstrdup(r->pool, c_str(ct)));
     ap_rwrite(c_str(ob), (int)length(ob), r);
     return OK;

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=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp Mon Apr  4 08:46:08 2011
@@ -285,6 +285,55 @@ static int checkAuthn(request_rec *r) {
 }
 
 /**
+ * Fixup cache control.
+ */
+bool filterCacheControl(const string& tok) {
+    return tok != "no-cache";
+}
+
+static apr_status_t outputFilter(ap_filter_t * f, apr_bucket_brigade * in) {
+    request_rec *r = f->r->main;
+    if (!r)
+        r = f->r;
+    for (; r != NULL; r = r->next) {
+        if (r->status != HTTP_OK && r->status != HTTP_NOT_MODIFIED) {
+
+            // Don't cache errors and redirects
+            debug("no-cache", "modopenauth::outputFilter::nokCacheControl");
+            apr_table_set(r->headers_out, "Cache-Control", "no-cache");
+            continue;
+        }
+
+        // Cache OK content
+        const char* cc = apr_table_get(r->headers_out, "Cache-Control");
+        if (cc == NULL) {
+            debug("modopenauth::outputFilter::noCacheControl");
+            continue;
+        }
+        debug(cc, "modopenauth::outputFilter::cacheControl");
+        const string ncc = join(", ", filter<string>(filterCacheControl, tokenize(", ", cc)));
+        if (length(ncc) == 0) {
+            debug("modopenauth::outputFilter::noCacheControl");
+            apr_table_unset(r->headers_out, "Cache-Control");
+            continue;
+        }
+
+        debug(ncc, "modopenauth::outputFilter::okCacheControl");
+        apr_table_set(r->headers_out, "Cache-Control", c_str(ncc));
+    }
+
+    ap_remove_output_filter(f);
+    return ap_pass_brigade(f->next, in);
+}
+
+/**
+ * Insert our cache control output filter.
+ */
+static void insertOutputFilter(request_rec * r) {
+    ap_add_output_filter("mod_openauth", NULL, r, r->connection);
+}
+
+/**
  * Process the module configuration.
  */
 int postConfigMerge(ServerConf& mainsc, server_rec* s) {
@@ -349,6 +398,8 @@ void registerHooks(unused apr_pool_t *p)
     ap_hook_post_config(postConfig, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_child_init(childInit, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_check_authn(checkAuthn, NULL, NULL, APR_HOOK_MIDDLE, AP_AUTH_INTERNAL_PER_CONF);
+    ap_register_output_filter("mod_openauth", outputFilter, NULL, AP_FTYPE_CONTENT_SET);
+    ap_hook_insert_filter(insertOutputFilter, NULL, NULL, APR_HOOK_LAST);
 }
 
 }

Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css Mon Apr  4 08:46:08 2011
@@ -218,8 +218,10 @@ padding-left: 2px; padding-top: 0px; pad
 background-color: #598edd; color: #e5ecf9;
 }
 
+/*
 v\: * {
 behavior:url(#default#VML);
 display:inline-block; 
 }
+*/
 

Modified: tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp Mon Apr  4 08:46:08 2011
@@ -120,7 +120,7 @@ const failable<int> get(request_rec* r, 
 
         // Return JSON result
         js::JSContext cx;
-        return httpd::writeResult(json::jsonResult(id, content(val), cx), "application/json-rpc", r);
+        return httpd::writeResult(json::jsonResult(id, content(val), cx), "application/json-rpc; charset=utf-8", r);
     }
 
     // Evaluate the GET expression
@@ -135,14 +135,14 @@ const failable<int> get(request_rec* r, 
     if (!isList(c)) {
         js::JSContext cx;
         if (isSymbol(c))
-            return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(mklist<value>("name", value(string(c))))), cx), "application/json", r);
-        return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(mklist<value>("value", c))), cx), "application/json", r);
+            return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(mklist<value>("name", value(string(c))))), cx), "application/json; charset=utf-8", r);
+        return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(mklist<value>("value", c))), cx), "application/json; charset=utf-8", r);
     }
 
     // Write an empty list as a JSON empty value
     if (isNil((list<value>)c)) {
         js::JSContext cx;
-        return httpd::writeResult(json::writeJSON(list<value>(), cx), "application/json", r);
+        return httpd::writeResult(json::writeJSON(list<value>(), cx), "application/json; charset=utf-8", r);
     }
 
     // Write content-type / content-list pair
@@ -152,7 +152,7 @@ const failable<int> get(request_rec* r, 
     // Write an assoc value as a JSON result
     if (isSymbol(car<value>(c)) && !isNil(cdr<value>(c))) {
         js::JSContext cx;
-        return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(c)), cx), "application/json", r);
+        return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(c)), cx), "application/json; charset=utf-8", r);
     }
 
     // Convert list of values to element values
@@ -164,15 +164,15 @@ const failable<int> get(request_rec* r, 
         const list<value> el = car<value>(e);
         if (isSymbol(car<value>(el)) && car<value>(el) == element && !isNil(cdr<value>(el)) && isSymbol(cadr<value>(el))) {
             if (cadr<value>(el) == atom::feed)
-                return httpd::writeResult(atom::writeATOMFeed(e), "application/atom+xml", r);
+                return httpd::writeResult(atom::writeATOMFeed(e), "application/atom+xml; charset=utf-8", r);
             if (cadr<value>(el) == atom::entry)
-                return httpd::writeResult(atom::writeATOMEntry(e), "application/atom+xml", r);
+                return httpd::writeResult(atom::writeATOMEntry(e), "application/atom+xml; charset=utf-8", r);
         }
     }
 
     // Write any other compound value as a JSON value
     js::JSContext cx;
-    return httpd::writeResult(json::writeJSON(e, cx), "application/json", r);
+    return httpd::writeResult(json::writeJSON(e, cx), "application/json; charset=utf-8", r);
 }
 
 /**
@@ -206,7 +206,7 @@ const failable<int> post(request_rec* r,
             return mkfailure<int>(reason(val));
 
         // Return JSON result
-        return httpd::writeResult(json::jsonResult(id, content(val), cx), "application/json-rpc", r);
+        return httpd::writeResult(json::jsonResult(id, content(val), cx), "application/json-rpc; charset=utf-8", r);
     }
 
     // Evaluate an ATOM POST request and return the location of the corresponding created resource
@@ -714,6 +714,8 @@ int handler(request_rec *r) {
 
     // Get the component implementation lambda
     const list<value> path(pathValues(r->uri));
+    if (isNil(cdr(path)))
+        return HTTP_NOT_FOUND;
     const list<value> impl(assoctree<value>(cadr(path), usevh? vhc.vsc.implTree : sc.implTree));
     if (isNil(impl)) {
         mkfailure<int>(string("Couldn't find component implementation: ") + cadr(path));

Modified: tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp?rev=1088508&r1=1088507&r2=1088508&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp Mon Apr  4 08:46:08 2011
@@ -90,6 +90,8 @@ int translateReference(const ServerConf&
 
     // Find the requested component
     const list<value> rpath(pathValues(r->uri));
+    if (isNil(cdr(rpath)))
+        return HTTP_NOT_FOUND;
     const list<value> comp(assoctree(cadr(rpath), sc.references));
     if (isNil(comp))
         return HTTP_NOT_FOUND;



Mime
View raw message