From d7069b5a2e7859ab14c5a909d5e5fc6bc84b80cb Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 3 Jan 2013 07:41:53 +0000 Subject: Improve app hosting management app, restructure UI and refactor REST services and data model to use an SQL database. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1428193 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/hosting/server/Makefile.am | 40 +- sca-cpp/trunk/hosting/server/accounts.py | 14 +- sca-cpp/trunk/hosting/server/apps.py | 67 +- sca-cpp/trunk/hosting/server/atomutil.py | 68 + sca-cpp/trunk/hosting/server/authn.py | 3 +- sca-cpp/trunk/hosting/server/clean-tables | 37 + sca-cpp/trunk/hosting/server/composites.py | 37 +- sca-cpp/trunk/hosting/server/config-backup | 2 +- sca-cpp/trunk/hosting/server/create-tables | 38 + sca-cpp/trunk/hosting/server/dashboards.py | 40 +- .../trunk/hosting/server/data/apps/me360/app.info | 1 + .../trunk/hosting/server/data/apps/me360/app.stats | 1 - .../trunk/hosting/server/data/apps/nearme/app.info | 1 + .../hosting/server/data/apps/nearme/app.stats | 1 - .../hosting/server/data/apps/nearme2/app.info | 1 + .../hosting/server/data/apps/nearme2/app.stats | 1 - .../trunk/hosting/server/data/apps/new/app.info | 1 + .../trunk/hosting/server/data/apps/new/app.stats | 1 - .../hosting/server/data/apps/ourphotos/app.info | 1 + .../hosting/server/data/apps/ourphotos/app.stats | 1 - .../hosting/server/data/apps/shoppingcart/app.info | 1 + .../server/data/apps/shoppingcart/app.stats | 1 - .../trunk/hosting/server/data/apps/slice/app.info | 1 + .../trunk/hosting/server/data/apps/slice/app.stats | 1 - .../trunk/hosting/server/data/apps/test/app.info | 1 + .../trunk/hosting/server/data/apps/test/app.stats | 1 - .../server/data/apps/testanimation/app.info | 1 + .../server/data/apps/testanimation/app.stats | 1 - .../trunk/hosting/server/data/apps/testdb/app.info | 1 + .../hosting/server/data/apps/testdb/app.stats | 1 - .../hosting/server/data/apps/testevents/app.info | 1 + .../hosting/server/data/apps/testevents/app.stats | 1 - .../hosting/server/data/apps/testhttp/app.info | 1 + .../hosting/server/data/apps/testhttp/app.stats | 1 - .../hosting/server/data/apps/testlogic/app.info | 1 + .../hosting/server/data/apps/testlogic/app.stats | 1 - .../hosting/server/data/apps/testsearch/app.info | 1 + .../hosting/server/data/apps/testsearch/app.stats | 1 - .../hosting/server/data/apps/testsms/app.info | 1 + .../hosting/server/data/apps/testsms/app.stats | 1 - .../hosting/server/data/apps/testsocial/app.info | 1 + .../hosting/server/data/apps/testsocial/app.stats | 1 - .../hosting/server/data/apps/testtext/app.info | 1 + .../hosting/server/data/apps/testtext/app.stats | 1 - .../hosting/server/data/apps/testurl/app.info | 1 + .../hosting/server/data/apps/testurl/app.stats | 1 - .../hosting/server/data/apps/testvalues/app.info | 1 + .../hosting/server/data/apps/testvalues/app.stats | 1 - .../hosting/server/data/apps/testwidgets/app.info | 1 + .../hosting/server/data/apps/testwidgets/app.stats | 1 - .../hosting/server/data/apps/testwidgets2/app.info | 1 + .../server/data/apps/testwidgets2/app.stats | 1 - .../hosting/server/data/apps/testwidgets3/app.info | 1 + .../server/data/apps/testwidgets3/app.stats | 1 - .../trunk/hosting/server/data/apps/twsms/app.info | 1 + .../trunk/hosting/server/data/apps/twsms/app.stats | 1 - sca-cpp/trunk/hosting/server/drop-tables | 38 + .../trunk/hosting/server/htdocs/account/index.html | 335 ++++- .../hosting/server/htdocs/app/cache-template.cmf | 17 - .../server/htdocs/app/cache/cache-template.cmf | 17 + sca-cpp/trunk/hosting/server/htdocs/app/index.html | 102 +- .../trunk/hosting/server/htdocs/cache-template.cmf | 18 - .../hosting/server/htdocs/cache/cache-template.cmf | 18 + .../trunk/hosting/server/htdocs/cache/index.html | 51 + .../trunk/hosting/server/htdocs/clone/index.html | 135 +- sca-cpp/trunk/hosting/server/htdocs/config.js | 2 +- .../trunk/hosting/server/htdocs/create/index.html | 97 +- .../trunk/hosting/server/htdocs/delete/index.html | 91 +- sca-cpp/trunk/hosting/server/htdocs/favicon-16.xcf | Bin 0 -> 1134 bytes sca-cpp/trunk/hosting/server/htdocs/favicon-32.xcf | Bin 0 -> 1456 bytes sca-cpp/trunk/hosting/server/htdocs/favicon.ico | Bin 2238 -> 153 bytes .../trunk/hosting/server/htdocs/graph/index.html | 195 +-- sca-cpp/trunk/hosting/server/htdocs/home/home.b64 | 1 - sca-cpp/trunk/hosting/server/htdocs/home/home.png | Bin 9595 -> 0 bytes .../trunk/hosting/server/htdocs/home/index.html | 47 +- sca-cpp/trunk/hosting/server/htdocs/index.html | 503 ++++--- .../trunk/hosting/server/htdocs/info/index.html | 494 ++++++ .../trunk/hosting/server/htdocs/login/index.html | 409 +++-- .../trunk/hosting/server/htdocs/page/index.html | 1581 +++++++++++--------- .../htdocs/proxy/public/cache/cache-template.cmf | 11 + .../server/htdocs/proxy/public/cache/index.html | 51 + .../server/htdocs/proxy/public/oops/index.html | 327 +++- sca-cpp/trunk/hosting/server/htdocs/public/app.b64 | 2 +- sca-cpp/trunk/hosting/server/htdocs/public/app.png | Bin 147 -> 222 bytes sca-cpp/trunk/hosting/server/htdocs/public/app.xcf | Bin 1294 -> 1906 bytes .../server/htdocs/public/cache/cache-template.cmf | 17 + .../hosting/server/htdocs/public/cache/index.html | 51 + .../trunk/hosting/server/htdocs/public/config.js | 4 + .../trunk/hosting/server/htdocs/public/delete.b64 | 1 - .../trunk/hosting/server/htdocs/public/delete.png | Bin 906 -> 0 bytes .../trunk/hosting/server/htdocs/public/delete.xcf | Bin 2008 -> 0 bytes .../trunk/hosting/server/htdocs/public/grid72.b64 | 1 - .../trunk/hosting/server/htdocs/public/grid72.png | Bin 138 -> 0 bytes .../trunk/hosting/server/htdocs/public/iframe.html | 28 - sca-cpp/trunk/hosting/server/htdocs/public/img.b64 | 2 +- sca-cpp/trunk/hosting/server/htdocs/public/img.png | Bin 357 -> 191 bytes sca-cpp/trunk/hosting/server/htdocs/public/img.xcf | Bin 1639 -> 1456 bytes .../server/htdocs/public/notauth/index.html | 328 +++- .../server/htdocs/public/notfound/index.html | 328 +++- .../hosting/server/htdocs/public/notyet/index.html | 328 +++- .../hosting/server/htdocs/public/oops/index.html | 326 +++- .../trunk/hosting/server/htdocs/public/rate.png | Bin 0 -> 1690 bytes .../trunk/hosting/server/htdocs/public/rate.xcf | Bin 0 -> 3754 bytes .../trunk/hosting/server/htdocs/public/ratings.png | Bin 0 -> 726 bytes .../trunk/hosting/server/htdocs/public/ratings.xcf | Bin 0 -> 6344 bytes .../trunk/hosting/server/htdocs/public/search.png | Bin 0 -> 351 bytes .../trunk/hosting/server/htdocs/public/search.xcf | Bin 0 -> 1263 bytes .../hosting/server/htdocs/public/touchicon-50.xcf | Bin 0 -> 1742 bytes .../hosting/server/htdocs/public/touchicon-53.xcf | Bin 0 -> 1748 bytes .../hosting/server/htdocs/public/touchicon-57.xcf | Bin 0 -> 1988 bytes .../hosting/server/htdocs/public/touchicon.b64 | 1 - .../hosting/server/htdocs/public/touchicon.png | Bin 606 -> 243 bytes .../hosting/server/htdocs/public/touchicon.xcf | Bin 3400 -> 0 bytes .../trunk/hosting/server/htdocs/public/user.b64 | 2 +- .../trunk/hosting/server/htdocs/public/user.png | Bin 147 -> 891 bytes .../trunk/hosting/server/htdocs/public/user.xcf | Bin 0 -> 2706 bytes .../trunk/hosting/server/htdocs/rate/index.html | 190 +++ .../trunk/hosting/server/htdocs/search/index.html | 196 +++ .../trunk/hosting/server/htdocs/stats/index.html | 179 --- .../trunk/hosting/server/htdocs/store/index.html | 152 +- sca-cpp/trunk/hosting/server/icons.py | 175 +++ sca-cpp/trunk/hosting/server/imapd-start | 71 + sca-cpp/trunk/hosting/server/imapd-stop | 56 + sca-cpp/trunk/hosting/server/imapd.py | 233 +++ sca-cpp/trunk/hosting/server/load-authn | 58 + sca-cpp/trunk/hosting/server/load-tables | 73 + sca-cpp/trunk/hosting/server/pages.py | 36 +- sca-cpp/trunk/hosting/server/palettes.py | 2 +- sca-cpp/trunk/hosting/server/pgsql | 32 + sca-cpp/trunk/hosting/server/pictures.py | 141 ++ sca-cpp/trunk/hosting/server/proxy-start | 11 + sca-cpp/trunk/hosting/server/ratings.py | 158 ++ sca-cpp/trunk/hosting/server/reviews.py | 156 ++ sca-cpp/trunk/hosting/server/search.py | 57 + sca-cpp/trunk/hosting/server/selector.py | 8 +- sca-cpp/trunk/hosting/server/server.composite | 71 +- sca-cpp/trunk/hosting/server/ssl-proxy-start | 13 +- sca-cpp/trunk/hosting/server/ssl-start | 20 +- sca-cpp/trunk/hosting/server/start | 16 +- sca-cpp/trunk/hosting/server/stop | 2 + sca-cpp/trunk/hosting/server/store.py | 53 +- sca-cpp/trunk/hosting/server/test.py | 437 ++++-- sca-cpp/trunk/hosting/server/test/cache.py | 4 + sca-cpp/trunk/hosting/server/test/reference.py | 2 +- sca-cpp/trunk/hosting/server/util.py | 19 +- 145 files changed, 6644 insertions(+), 2328 deletions(-) create mode 100644 sca-cpp/trunk/hosting/server/atomutil.py create mode 100755 sca-cpp/trunk/hosting/server/clean-tables create mode 100755 sca-cpp/trunk/hosting/server/create-tables create mode 100644 sca-cpp/trunk/hosting/server/data/apps/me360/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/me360/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/nearme/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/nearme/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/nearme2/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/nearme2/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/new/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/new/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/slice/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/slice/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/test/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/test/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testanimation/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testanimation/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testdb/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testdb/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testevents/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testevents/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testhttp/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testhttp/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testlogic/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testlogic/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testsearch/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testsearch/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testsms/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testsms/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testsocial/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testsocial/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testtext/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testtext/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testurl/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testurl/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testvalues/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testvalues/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.stats create mode 100644 sca-cpp/trunk/hosting/server/data/apps/twsms/app.info delete mode 100644 sca-cpp/trunk/hosting/server/data/apps/twsms/app.stats create mode 100755 sca-cpp/trunk/hosting/server/drop-tables delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/app/cache/cache-template.cmf delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/cache/cache-template.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/cache/index.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/favicon-16.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/favicon-32.xcf delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/home/home.b64 delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/home/home.png create mode 100644 sca-cpp/trunk/hosting/server/htdocs/info/index.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/proxy/public/cache/cache-template.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/proxy/public/cache/index.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/cache/cache-template.cmf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/cache/index.html delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/delete.b64 delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/delete.png delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/delete.xcf delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/grid72.b64 delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/grid72.png delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/iframe.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/rate.png create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/rate.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/ratings.png create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/ratings.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/search.png create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/search.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/touchicon-50.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/touchicon-53.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/touchicon-57.xcf delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/touchicon.b64 delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/touchicon.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/user.xcf create mode 100644 sca-cpp/trunk/hosting/server/htdocs/rate/index.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/search/index.html delete mode 100644 sca-cpp/trunk/hosting/server/htdocs/stats/index.html create mode 100644 sca-cpp/trunk/hosting/server/icons.py create mode 100755 sca-cpp/trunk/hosting/server/imapd-start create mode 100755 sca-cpp/trunk/hosting/server/imapd-stop create mode 100644 sca-cpp/trunk/hosting/server/imapd.py create mode 100755 sca-cpp/trunk/hosting/server/load-authn create mode 100755 sca-cpp/trunk/hosting/server/load-tables create mode 100755 sca-cpp/trunk/hosting/server/pgsql create mode 100644 sca-cpp/trunk/hosting/server/pictures.py create mode 100644 sca-cpp/trunk/hosting/server/ratings.py create mode 100644 sca-cpp/trunk/hosting/server/reviews.py create mode 100644 sca-cpp/trunk/hosting/server/search.py (limited to 'sca-cpp/trunk/hosting/server') diff --git a/sca-cpp/trunk/hosting/server/Makefile.am b/sca-cpp/trunk/hosting/server/Makefile.am index d6e15f819b..226c69b75a 100644 --- a/sca-cpp/trunk/hosting/server/Makefile.am +++ b/sca-cpp/trunk/hosting/server/Makefile.am @@ -18,31 +18,42 @@ if WANT_PYTHON moddir = $(prefix)/hosting/server -dist_mod_SCRIPTS = start stop ssl-start mkapplinks config-backup data-backup put-auth get-auth delete-auth +dist_mod_SCRIPTS = start stop ssl-start mkapplinks config-backup data-backup put-auth get-auth delete-auth create-tables drop-tables load-tables clean-tables load-authn pgsql imapd-start imapd-stop -not_minified = htdocs/public/iframe.html htdocs/create/index.html htdocs/page/index.html htdocs/login/index.html htdocs/public/notfound/index.html htdocs/public/oops/index.html htdocs/proxy/public/oops/index.html htdocs/graph/index.html htdocs/public/notauth/index.html htdocs/account/index.html htdocs/home/index.html htdocs/index.html htdocs/public/notyet/index.html htdocs/clone/index.html htdocs/delete/index.html htdocs/stats/index.html htdocs/app/index.html htdocs/store/index.html htdocs/config.js htdocs/public/config.js htdocs/cache-template.cmf htdocs/app/cache-template.cmf htdocs/cache-template.cmf htdocs/app/cache-template.cmf +not_minified = htdocs/create/index.html htdocs/page/index.html htdocs/login/index.html htdocs/public/cache/index.html htdocs/public/notfound/index.html htdocs/public/oops/index.html htdocs/proxy/public/oops/index.html htdocs/proxy/public/cache/index.html htdocs/graph/index.html htdocs/public/notauth/index.html htdocs/account/index.html htdocs/home/index.html htdocs/index.html htdocs/cache/index.html htdocs/public/notyet/index.html htdocs/clone/index.html htdocs/delete/index.html htdocs/rate/index.html htdocs/search/index.html htdocs/info/index.html htdocs/app/index.html htdocs/store/index.html htdocs/config.js htdocs/public/config.js htdocs/cache/cache-template.cmf htdocs/app/cache/cache-template.cmf htdocs/public/cache/cache-template.cmf htdocs/proxy/public/cache/cache-template.cmf -minified = htdocs/public/iframe-min.html htdocs/create/index-min.html htdocs/page/index-min.html htdocs/login/index-min.html htdocs/public/notfound/index-min.html htdocs/public/oops/index-min.html htdocs/proxy/public/oops/index-min.html htdocs/graph/index-min.html htdocs/public/notauth/index-min.html htdocs/account/index-min.html htdocs/home/index-min.html htdocs/index-min.html htdocs/public/notyet/index-min.html htdocs/clone/index-min.html htdocs/delete/index-min.html htdocs/stats/index-min.html htdocs/app/index-min.html htdocs/store/index-min.html htdocs/config-min.js htdocs/public/config-min.js +minified = htdocs/create/index-min.html htdocs/page/index-min.html htdocs/login/index-min.html htdocs/public/cache/index-min.html htdocs/public/notfound/index-min.html htdocs/public/oops/index-min.html htdocs/proxy/public/oops/index-min.html htdocs/proxy/public/cache/index-min.html htdocs/graph/index-min.html htdocs/public/notauth/index-min.html htdocs/account/index-min.html htdocs/home/index-min.html htdocs/index-min.html htdocs/cache/index-min.html htdocs/public/notyet/index-min.html htdocs/clone/index-min.html htdocs/delete/index-min.html htdocs/rate/index-min.html htdocs/search/index-min.html htdocs/info/index-min.html htdocs/app/index-min.html htdocs/store/index-min.html htdocs/config-min.js htdocs/public/config-min.js js_minified = ../../modules/js/htdocs/all-min.js ../../modules/js/htdocs/ui-min.css -resources = server.composite *.py data/palettes/*/palette.composite data/accounts/*/*.account data/apps/*/app.composite data/apps/*/app.stats data/apps/*/htdocs/app.html data/dashboards/*/user.apps data/store/*/store.apps htdocs/cache-manifest.cmf htdocs/app/cache-manifest.cmf htdocs/*.ico htdocs/home/*.png htdocs/home/*.b64 htdocs/*.txt htdocs/public/*.png htdocs/public/*.b64 ${minified} +b64images = htdocs/public/app.b64 htdocs/public/img.b64 htdocs/public/rate.b64 htdocs/public/ratings.b64 htdocs/public/search.b64 htdocs/public/user.b64 + +resources = server.composite *.py data/palettes/*/palette.composite data/accounts/*/*.account data/apps/*/app.composite data/apps/*/app.info data/apps/*/htdocs/app.html data/dashboards/*/user.apps data/store/*/store.apps htdocs/cache/cache-manifest.cmf htdocs/app/cache/cache-manifest.cmf htdocs/public/cache/cache-manifest.cmf htdocs/proxy/public/cache/cache-manifest.cmf htdocs/*.ico htdocs/*.txt htdocs/public/*.png ${b64images} ${minified} nobase_dist_mod_DATA = ${resources} EXTRA_DIST = ${resources} ${not_minified} -SUFFIXES = -min.html -min.js +SUFFIXES = -min.html -min.js b64 .html-min.html: ../../modules/http/minify-html $< $@ .js-min.js: ../../modules/http/minify-js $< $@ -htdocs/cache-manifest.cmf: htdocs/cache-template.cmf ${minified} ${js_minified} - ../../modules/http/cache-manifest htdocs $^ +.png.b64: + ../../modules/http/base64-encode $< $@ + +htdocs/cache/cache-manifest.cmf: htdocs/cache/cache-template.cmf ${minified} ${js_minified} ${b64images} + ../../modules/http/cache-manifest htdocs/cache $^ + +htdocs/app/cache/cache-manifest.cmf: htdocs/app/cache/cache-template.cmf ${minified} ${js_minified} ${b64images} + ../../modules/http/cache-manifest htdocs/app/cache $^ -htdocs/app/cache-manifest.cmf: htdocs/app/cache-template.cmf ${minified} ${js_minified} - ../../modules/http/cache-manifest htdocs/app $^ +htdocs/public/cache/cache-manifest.cmf: htdocs/public/cache/cache-template.cmf ${minified} ${js_minified} ${b64images} + ../../modules/http/cache-manifest htdocs/public/cache $^ + +htdocs/proxy/public/cache/cache-manifest.cmf: htdocs/proxy/public/cache/cache-template.cmf ${minified} ${js_minified} ${b64images} + ../../modules/http/cache-manifest htdocs/proxy/public/cache $^ nuvem: ln -s "../../../nuvem/nuvem-parallel/nuvem" "nuvem" @@ -54,13 +65,16 @@ install-data-hook: cd $(moddir); rm -f nuvem; ln -s "../../../nuvem/nuvem-parallel/nuvem" "nuvem" cd $(moddir); rm -f lib; ln -s "../../components" "lib" -CLEANFILES = ${minified} nuvem lib htdocs/cache-manifest.cmf htdocs/app/cache-manifest.cmf +CLEANFILES = ${minified} nuvem lib htdocs/cache/cache-manifest.cmf htdocs/app/cache/cache-manifest.cmf htdocs/public/cache/cache-manifest.cmf htdocs/proxy/public/cache/cache-manifest.cmf client_test_SOURCES = client-test.cpp -client_test_LDFLAGS = -lxml2 -lcurl -lmozjs +client_test_LDFLAGS = -lxml2 -lcurl -ljansson + +patch_test_SOURCES = patch-test.cpp +patch_test_LDFLAGS = -lxml2 -lcurl -ljansson dist_noinst_SCRIPTS = logic-test server-test test.py -noinst_PROGRAMS = client-test -TESTS = logic-test +noinst_PROGRAMS = client-test patch-test +TESTS = logic-test patch-test endif diff --git a/sca-cpp/trunk/hosting/server/accounts.py b/sca-cpp/trunk/hosting/server/accounts.py index 3587f5fb65..99655620f1 100644 --- a/sca-cpp/trunk/hosting/server/accounts.py +++ b/sca-cpp/trunk/hosting/server/accounts.py @@ -16,8 +16,9 @@ # under the License. # Accounts collection implementation -from time import strftime from util import * +from atomutil import * +from sys import debug # Convert a particular user id to an account id def accountid(user): @@ -25,12 +26,17 @@ def accountid(user): # Get the current user's account def get(id, user, cache): + debug('accounts.py::get::id', id) account = cache.get(accountid(user)) - if isNil(account) or account is None: - return (("'entry", ("'title", user.get(())), ("'id", user.get(())), ("'updated", strftime('%b %d, %Y'))),) + if isNil(account): + return mkentry(user.get(()), user.get(()), user.get(()), now(), ()) return account # Update the user's account def put(id, account, user, cache): - return cache.put(accountid(user), account) + debug('accounts.py::put::id', id) + debug('accounts.py::put::account', account) + + accountentry = mkentry(title(account), user.get(()), user.get(()), now(), content(account)) + return cache.put(accountid(user), accountentry) diff --git a/sca-cpp/trunk/hosting/server/apps.py b/sca-cpp/trunk/hosting/server/apps.py index 064701a7df..5b0c1b8831 100644 --- a/sca-cpp/trunk/hosting/server/apps.py +++ b/sca-cpp/trunk/hosting/server/apps.py @@ -16,96 +16,103 @@ # under the License. # App collection implementation -from time import strftime from util import * +from atomutil import * from sys import debug # Convert an id to an app id def appid(id): - return ("apps", car(id), "app.stats") + return ("apps", car(id), "app.info") # Put an app into the apps db -def put(id, app, user, cache, dashboard, store, composites, pages): +def put(id, app, user, cache, dashboard, store, composites, pages, icons): debug('apps.py::put::id', id) debug('apps.py::put::app', app) # Update an app - eid = cadr(assoc("'id", car(app))) + eid = entryid(app) if car(id) == eid: # Check app author - eapp = cache.get(appid(id)); - if (not (isNil(eapp) or eapp is None)) and (cadr(assoc("'author", car(eapp))) != user.get(())): - debug('apps.py::put', 'different author', cadr(assoc("'author", car(eapp)))) + eapp = cache.get(appid(id)) + if (not isNil(eapp)) and (author(eapp) != user.get(())): + debug('apps.py::put', 'different author', author(eapp)) return False # Update the app in the apps db - appentry = (("'entry", assoc("'title", car(app)), ("'id", car(id)), ("'author", user.get(())), ("'updated", strftime('%b %d, %Y')), assoc("'content", car(app))),) + appentry = mkentry(title(app), car(id), user.get(()), now(), content(app)) debug('apps.py::put::appentry', appentry) cache.put(appid(id), appentry) dashboard.put(id, appentry) # Create new page and composite if necessary - if isNil(eapp) or eapp is None: - comp = (("'entry", ("'title", car(id)), ("'id", car(id))),) - composites.put(id, comp); - page = (("'entry", ("'title", car(id)), ("'id", car(id))),) - pages.put(id, comp); + if isNil(eapp): + comp = mkentry(car(id), car(id), user.get(()), now(), ()) + composites.put(id, comp) + page = mkentry(car(id), car(id), user.get(()), now(), ()) + pages.put(id, page) + icon = mkentry(car(id), car(id), user.get(()), now(), ()) + icons.put(id, icon) return True return True # Check app author - eapp = cache.get(appid(id)); - if (not (isNil(eapp) or eapp is None)) and (cadr(assoc("'author", car(eapp))) != user.get(())): - debug('apps.py::put', 'different author', cadr(assoc("'author", car(eapp)))) + eapp = cache.get(appid(id)) + if (not isNil(eapp)) and (author(eapp) != user.get(())): + debug('apps.py::put', 'different author', author(eapp)) return False - # Clone an app - appentry = (("'entry", assoc("'title", car(app)), ("'id", car(id)), ("'author", user.get(())), ("'updated", strftime('%b %d, %Y')), assoc("'content", car(app))),) + # Get app to clone + capp = cache.get(appid((eid,))) + if isNil(capp): + debug('apps.py::put', 'cloned app not found', (eid,)) + return False + + # Clone app + appentry = mkentry(title(app), car(id), user.get(()), now(), content(app)) debug('apps.py::put::appentry', appentry) cache.put(appid(id), appentry) composites.put(id, composites.get((eid,))) pages.put(id, pages.get((eid,))) + icons.put(id, icons.get((eid,))) dashboard.put(id, appentry) return True # Get an app from the apps db -def get(id, user, cache, dashboard, store, composites, pages): +def get(id, user, cache, dashboard, store, composites, pages, icons): debug('apps.py::get::id', id) if isNil(id): return (("'feed", ("'title", "Apps"), ("'id", "apps")),) # Get the requested app - app = cache.get(appid(id)); - if isNil(app) or app is None: + app = cache.get(appid(id)) + if isNil(app): debug('apps.py::get', 'app not found', id) - - # Return a default new app - return (("'entry", ("'title", car(id)), ("'id", car(id)), ("'author", user.get(())), ("'updated", strftime('%b %d, %Y')), ("'content", ("'stats", ("'description", '')))),) + return None # Return the app debug('apps.py::get::app', app) return app # Delete an app from the apps db -def delete(id, user, cache, dashboard, store, composites, pages): +def delete(id, user, cache, dashboard, store, composites, pages, icons): debug('apps.py::delete::id', id) # Get the requested app - app = cache.get(appid(id)); - if isNil(app) or app is None: + app = cache.get(appid(id)) + if isNil(app): debug('apps.py::delete', 'app not found', id) return False # Check app author - author = cadr(assoc("'author", car(app))) - if author != user.get(()): - debug('apps.py::delete', 'different author', author) + if author(app) != user.get(()): + debug('apps.py::delete', 'different author', author(app)) return False # Delete the app, its composite and page dashboard.delete(id) composites.delete(id) pages.delete(id) + icons.delete(id) cache.delete(appid(id)) return True diff --git a/sca-cpp/trunk/hosting/server/atomutil.py b/sca-cpp/trunk/hosting/server/atomutil.py new file mode 100644 index 0000000000..8f01f81d3a --- /dev/null +++ b/sca-cpp/trunk/hosting/server/atomutil.py @@ -0,0 +1,68 @@ +# 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. + +# Simple ATOM handling functions +from util import * +from time import strftime, gmtime + +# Make an ATOM entry +def mkentry(title, id, author, updated, content): + return (("'entry", ("'title", title), ("'id", id), ("'author", author), ("'updated", updated), ("'content",) if isNil(content) else ("'content", content)),) + +# Make an ATOM feed +def mkfeed(title, id, author, updated, entries): + return (("'entry", ("'title", title), ("'id", id), ("'author", author), ("'updated", updated), ("'content",) if isNil(content) else ("'content", content)),) + +# Return ATOM attributes +def title(e): + if isNil(e): + return () + t = assoc("'title", car(e)) + return None if isNil(t) else cadr(t) + +def entryid(e): + if isNil(e): + return () + id = assoc("'id", car(e)) + return None if isNil(id) else cadr(id) + +def author(e): + if isNil(e): + return () + a = assoc("'author", car(e)) + return None if isNil(a) else cadr(a) + +def updated(e): + if isNil(e): + return () + u = assoc("'updated", car(e)) + return None if isNil(u) else cadr(u) + +def content(e): + if isNil(e): + return () + c = assoc("'content", car(e)) + return () if isNil(c) or isNil(cdr(c)) else c[len(c) - 1] + +# Return the current time +def now(): + return strftime('%Y-%m-%dT%H:%M:%S+00:00', gmtime()) + +# Return an (updated now) assoc +def updatedNow(): + return ("'updated", strftime('%Y-%m-%dT%H:%M:%S+00:00', gmtime())) + diff --git a/sca-cpp/trunk/hosting/server/authn.py b/sca-cpp/trunk/hosting/server/authn.py index 4d4f34b9fb..02c24a2852 100644 --- a/sca-cpp/trunk/hosting/server/authn.py +++ b/sca-cpp/trunk/hosting/server/authn.py @@ -16,7 +16,6 @@ # under the License. # User authenticator implementation -from time import strftime from util import * # Convert a particular user id to an authentication id @@ -26,7 +25,7 @@ def authnid(id): # Get a user's authentication def get(id, cache): authn = cache.get(authnid(id)) - if isNil(authn) or authn is None: + if isNil(authn): return None return authn diff --git a/sca-cpp/trunk/hosting/server/clean-tables b/sca-cpp/trunk/hosting/server/clean-tables new file mode 100755 index 0000000000..76a59921f3 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/clean-tables @@ -0,0 +1,37 @@ +#!/bin/sh + +# 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. + +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` + +tmp=$1 +if [ "$tmp" = "" ]; then + tmp="$here/tmp" +fi +host=$2 +if [ "$host" = "" ]; then + host="localhost" +fi + +# Cleanup tables +cat >$tmp/sqldb/clean-tables.sql <$tmp/sqldb/create-tables.sql <$tmp/sqldb/drop-tables.sql <
-
+
- - - - - - + + + + + + + + + +
Photo:
Name:
About Me:
Username:
Email:
Picture:
Name:
Bio:
-
+ +
diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf b/sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf deleted file mode 100644 index 5881cf83dd..0000000000 --- a/sca-cpp/trunk/hosting/server/htdocs/app/cache-template.cmf +++ /dev/null @@ -1,17 +0,0 @@ -CACHE MANIFEST - -# Version SHA1 - -# App resources -/favicon.ico -/public/iframe-min.html -/public/img.png -/public/notauth/ -/public/notfound/ -/public/notyet/ -/public/oops/ -/public/touchicon.png - -NETWORK: -* - diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/cache/cache-template.cmf b/sca-cpp/trunk/hosting/server/htdocs/app/cache/cache-template.cmf new file mode 100644 index 0000000000..40da327179 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/app/cache/cache-template.cmf @@ -0,0 +1,17 @@ +CACHE MANIFEST + +# Version SHA1 + +# App resources +/favicon.ico +/login/ +/public/img.png +/public/notauth/ +/public/notfound/ +/public/notyet/ +/public/oops/ +/public/touchicon.png + +NETWORK: +* + diff --git a/sca-cpp/trunk/hosting/server/htdocs/app/index.html b/sca-cpp/trunk/hosting/server/htdocs/app/index.html index cddf4fb477..cd033118a3 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/app/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/app/index.html @@ -17,37 +17,51 @@ * specific language governing permissions and limitations * under the License. --> - + + + + + + + -
- -
- -
-
-
+} catch(e) { + debug(e.stack); + throw e; +} + -
diff --git a/sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf b/sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf deleted file mode 100644 index 8d9aa26f7d..0000000000 --- a/sca-cpp/trunk/hosting/server/htdocs/cache-template.cmf +++ /dev/null @@ -1,18 +0,0 @@ -CACHE MANIFEST - -# Version SHA1 - -# App resources -/ -/favicon.ico -/public/iframe-min.html -/public/img.png -/public/notauth/ -/public/notfound/ -/public/notyet/ -/public/oops/ -/public/touchicon.png - -NETWORK: -* - diff --git a/sca-cpp/trunk/hosting/server/htdocs/cache/cache-template.cmf b/sca-cpp/trunk/hosting/server/htdocs/cache/cache-template.cmf new file mode 100644 index 0000000000..8347c5553a --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/cache/cache-template.cmf @@ -0,0 +1,18 @@ +CACHE MANIFEST + +# Version SHA1 + +# App resources +/ +/favicon.ico +/login/ +/public/img.png +/public/notauth/ +/public/notfound/ +/public/notyet/ +/public/oops/ +/public/touchicon.png + +NETWORK: +* + diff --git a/sca-cpp/trunk/hosting/server/htdocs/cache/index.html b/sca-cpp/trunk/hosting/server/htdocs/cache/index.html new file mode 100644 index 0000000000..f5c81791f2 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/cache/index.html @@ -0,0 +1,51 @@ + + + + + + + + + diff --git a/sca-cpp/trunk/hosting/server/htdocs/clone/index.html b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html index 0a2f7733bc..c6a9658ce0 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/clone/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html @@ -19,29 +19,24 @@ -->
-
+
- - - - - - - - - + +
New App Name:
Icon:
Title:
Description:
- +
New URL:
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/config.js b/sca-cpp/trunk/hosting/server/htdocs/config.js index 70d3ea1195..355174e6f7 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/config.js +++ b/sca-cpp/trunk/hosting/server/htdocs/config.js @@ -32,7 +32,7 @@ config.pagetitle = function() { }; config.hometitle = function() { - return '
Create SCA Composite Apps

'; + return '
Create SCA Apps

'; }; config.clone = function() { diff --git a/sca-cpp/trunk/hosting/server/htdocs/create/index.html b/sca-cpp/trunk/hosting/server/htdocs/create/index.html index d8d2b30f3c..a11c0958f5 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/create/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/create/index.html @@ -19,43 +19,38 @@ -->
-
+
- - - - - - - - - + +
App Name:
App Icon:
App Title:
Description:
- +
URL:
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/delete/index.html b/sca-cpp/trunk/hosting/server/htdocs/delete/index.html index 5a668af401..81cfa0b625 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/delete/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/delete/index.html @@ -19,31 +19,32 @@ -->
-
+
- - - - - - - - - - + + + + + + + + + +
App Icon:
App Title:
Author:
Updated:
Description:
URL:
Icon:
Author:
Updated:
Description:
- +
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/favicon-16.xcf b/sca-cpp/trunk/hosting/server/htdocs/favicon-16.xcf new file mode 100644 index 0000000000..e43dcba033 Binary files /dev/null and b/sca-cpp/trunk/hosting/server/htdocs/favicon-16.xcf differ diff --git a/sca-cpp/trunk/hosting/server/htdocs/favicon-32.xcf b/sca-cpp/trunk/hosting/server/htdocs/favicon-32.xcf new file mode 100644 index 0000000000..c1736338ec Binary files /dev/null and b/sca-cpp/trunk/hosting/server/htdocs/favicon-32.xcf differ diff --git a/sca-cpp/trunk/hosting/server/htdocs/favicon.ico b/sca-cpp/trunk/hosting/server/htdocs/favicon.ico index a7b502b9e1..bd60462963 100644 Binary files a/sca-cpp/trunk/hosting/server/htdocs/favicon.ico and b/sca-cpp/trunk/hosting/server/htdocs/favicon.ico differ diff --git a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html index d360336375..d01bfa1c02 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html @@ -19,13 +19,13 @@ -->
-
-
- +
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/index.html b/sca-cpp/trunk/hosting/server/htdocs/index.html index e3e046136d..6ea6f80939 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/index.html @@ -17,50 +17,69 @@ * specific language governing permissions and limitations * under the License. --> - + + + + + + + -
- -
- + - - +
+
+
-
-
+
-
-
- +
+
+
+
+ +
-
-
+} catch(e) { + debug(e.stack); + throw e; +} + -
diff --git a/sca-cpp/trunk/hosting/server/htdocs/info/index.html b/sca-cpp/trunk/hosting/server/htdocs/info/index.html new file mode 100644 index 0000000000..0d72062719 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/info/index.html @@ -0,0 +1,494 @@ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
URL:
Icon:
Author:
Rating:
 
Updated:
Description:
+
+
+ +
+ + + +
diff --git a/sca-cpp/trunk/hosting/server/htdocs/login/index.html b/sca-cpp/trunk/hosting/server/htdocs/login/index.html index bf09339927..efc3feaeaa 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/login/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/login/index.html @@ -19,87 +19,113 @@ --> + + + + Sign in + + - -
- -
- + - - - -
-
+
+
Sign in
+
+ +
@@ -109,9 +135,9 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
- + - +
@@ -120,7 +146,7 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
- +
Sign in with your Facebook account

@@ -128,7 +154,7 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
- +
Sign in with your Google account

@@ -147,78 +173,110 @@ $('headdiv').appendChild(ui.declareScript(appcache.get('/public/config-min.js'))
-
-
- +
+
+
+
+ +
-
diff --git a/sca-cpp/trunk/hosting/server/htdocs/page/index.html b/sca-cpp/trunk/hosting/server/htdocs/page/index.html index 6a6e042c74..c6e1108ce5 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/page/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/page/index.html @@ -19,59 +19,69 @@ -->
-
-
+
+
+
+
-

Header Level 1

-

Header Level 2

-Section -Some text -Link - - - - - -Checkbox +
+ + + +
+ +
+