summaryrefslogtreecommitdiffstats
path: root/sca-cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-01-30 15:56:11 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-01-30 15:56:11 +0000
commitf4c4803ce0c14585e3c2af3641d94b651877e04c (patch)
tree9f10df32f2d34a3c697aaee897bad0b180922095 /sca-cpp
parent1b10f18fce6baeb721a725661ded630614831304 (diff)
Refactor server hosting module, rename it and move it under a hosting dir, and refactor its datastore components into a single component.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1237740 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp')
-rw-r--r--sca-cpp/trunk/.gitignore4
-rw-r--r--sca-cpp/trunk/Makefile.am2
-rwxr-xr-xsca-cpp/trunk/components/constdb/server-test2
-rw-r--r--sca-cpp/trunk/components/http/http.composite4
-rw-r--r--sca-cpp/trunk/components/http/url-test.scm2
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-conf2
-rw-r--r--sca-cpp/trunk/configure.ac3
-rw-r--r--sca-cpp/trunk/hosting/Makefile.am19
-rw-r--r--sca-cpp/trunk/hosting/server/Makefile.am (renamed from sca-cpp/trunk/modules/edit/Makefile.am)8
-rw-r--r--sca-cpp/trunk/hosting/server/accounts.py (renamed from sca-cpp/trunk/modules/edit/accounts.py)2
-rw-r--r--sca-cpp/trunk/hosting/server/apps.py (renamed from sca-cpp/trunk/modules/edit/apps.py)8
-rw-r--r--sca-cpp/trunk/hosting/server/composites.py (renamed from sca-cpp/trunk/modules/edit/composites.py)2
-rwxr-xr-xsca-cpp/trunk/hosting/server/config-backup (renamed from sca-cpp/trunk/modules/edit/config-backup)2
-rw-r--r--sca-cpp/trunk/hosting/server/dashboards.py (renamed from sca-cpp/trunk/modules/edit/dashboards.py)2
-rwxr-xr-xsca-cpp/trunk/hosting/server/data-backup (renamed from sca-cpp/trunk/modules/edit/data-backup)2
-rw-r--r--sca-cpp/trunk/hosting/server/data/accounts/jane@localhost/user.account (renamed from sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/accounts/jane@sca-store.com/user.account (renamed from sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/accounts/john@localhost/user.account (renamed from sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/accounts/john@sca-store.com/user.account (renamed from sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/me360/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/me360/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/me360/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/me360/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/me360/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/me360/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/nearme/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/nearme/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/nearme/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/nearme/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/nearme/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/nearme/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/nearme2/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/nearme2/app.composite)6
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/nearme2/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/nearme2/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/nearme2/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/nearme2/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/new/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/new/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/new/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/new/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/new/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/new/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/ourphotos/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/ourphotos/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/ourphotos/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/ourphotos/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/shoppingcart/app.composite)6
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/shoppingcart/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/shoppingcart/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/shoppingcart/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/slice/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/slice/app.composite)8
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/slice/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/slice/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/slice/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/slice/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/test/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/test/app.composite)18
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/test/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/test/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/test/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/test/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testanimation/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testanimation/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testanimation/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testanimation/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testanimation/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testanimation/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testdb/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testdb/app.composite)6
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testdb/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testdb/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testdb/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testdb/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testevents/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testevents/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testevents/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testevents/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testevents/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testhttp/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testhttp/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testhttp/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testhttp/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testhttp/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testlogic/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testlogic/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testlogic/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testlogic/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testlogic/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testlogic/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsearch/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testsearch/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsearch/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testsearch/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsearch/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testsearch/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsms/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testsms/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsms/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testsms/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsms/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testsms/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsocial/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testsocial/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsocial/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testsocial/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testsocial/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testsocial/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testtext/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testtext/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testtext/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testtext/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testtext/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testtext/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testurl/app.composite)26
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testurl/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testurl/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testurl/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testurl/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testvalues/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testvalues/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testvalues/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testvalues/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testvalues/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testvalues/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets2/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets2/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets2/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets2/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets3/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets3/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/testwidgets3/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/testwidgets3/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/twsms/app.composite (renamed from sca-cpp/trunk/modules/edit/apps/twsms/app.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/twsms/app.stats (renamed from sca-cpp/trunk/modules/edit/apps/twsms/app.stats)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/apps/twsms/htdocs/app.html (renamed from sca-cpp/trunk/modules/edit/apps/twsms/htdocs/app.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps (renamed from sca-cpp/trunk/modules/edit/dashboards/jane@localhost/user.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/dashboards/jane@sca-store.com/user.apps (renamed from sca-cpp/trunk/modules/edit/dashboards/jane@sca-store.com/user.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps (renamed from sca-cpp/trunk/modules/edit/dashboards/john@localhost/user.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/dashboards/john@sca-store.com/user.apps (renamed from sca-cpp/trunk/modules/edit/dashboards/john@sca-store.com/user.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/animation/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/animation/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/control/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/control/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/database/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/database/palette.composite)6
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/http/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/http/palette.composite)32
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/lists/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/lists/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/logic/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/logic/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/math/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/math/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/python/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/python/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/search/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/search/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/social/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/social/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/talk/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/talk/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/text/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/text/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/transform/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/transform/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/palettes/values/palette.composite (renamed from sca-cpp/trunk/modules/edit/palettes/values/palette.composite)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/store/all/store.apps (renamed from sca-cpp/trunk/modules/edit/store/all/store.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/store/featured/store.apps (renamed from sca-cpp/trunk/modules/edit/store/featured/store.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/store/new/store.apps (renamed from sca-cpp/trunk/modules/edit/store/new/store.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/data/store/top/store.apps (renamed from sca-cpp/trunk/modules/edit/store/top/store.apps)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/account/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/account/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf (renamed from sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/app/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/app/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf (renamed from sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/clone/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/clone/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/create/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/create/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/favicon.ico (renamed from sca-cpp/trunk/modules/edit/htdocs/favicon.ico)bin2238 -> 2238 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/graph/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/graph/index.html)2
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/home/home.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/home/home.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/home/home.png (renamed from sca-cpp/trunk/modules/edit/htdocs/home/home.png)bin9595 -> 9595 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/home/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/home/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/login/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/login/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/page/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/page/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/app.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/public/app.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/app.png (renamed from sca-cpp/trunk/modules/edit/htdocs/public/app.png)bin147 -> 147 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/app.xcf (renamed from sca-cpp/trunk/modules/edit/htdocs/public/app.xcf)bin1294 -> 1294 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/delete.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/public/delete.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/delete.png (renamed from sca-cpp/trunk/modules/edit/htdocs/public/delete.png)bin906 -> 906 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/delete.xcf (renamed from sca-cpp/trunk/modules/edit/htdocs/public/delete.xcf)bin2008 -> 2008 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/grid72.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/grid72.png (renamed from sca-cpp/trunk/modules/edit/htdocs/public/grid72.png)bin138 -> 138 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/iframe.html (renamed from sca-cpp/trunk/modules/edit/htdocs/public/iframe.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/img.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/public/img.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/img.png (renamed from sca-cpp/trunk/modules/edit/htdocs/public/img.png)bin357 -> 357 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/img.xcf (renamed from sca-cpp/trunk/modules/edit/htdocs/public/img.xcf)bin1639 -> 1639 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/public/notauth/index.html)2
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/public/notfound/index.html)2
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/public/notyet/index.html)2
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html)4
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/touchicon.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/touchicon.png (renamed from sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png)bin606 -> 606 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/touchicon.xcf (renamed from sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf)bin3400 -> 3400 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/user.b64 (renamed from sca-cpp/trunk/modules/edit/htdocs/public/user.b64)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/public/user.png (renamed from sca-cpp/trunk/modules/edit/htdocs/public/user.png)bin147 -> 147 bytes
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/robots.txt (renamed from sca-cpp/trunk/modules/edit/htdocs/robots.txt)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/stats/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/stats/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/htdocs/store/index.html (renamed from sca-cpp/trunk/modules/edit/htdocs/store/index.html)0
-rw-r--r--sca-cpp/trunk/hosting/server/log.py (renamed from sca-cpp/trunk/modules/edit/log.py)0
-rwxr-xr-xsca-cpp/trunk/hosting/server/mkapplinks (renamed from sca-cpp/trunk/modules/edit/mkapplinks)0
-rw-r--r--sca-cpp/trunk/hosting/server/pages.py (renamed from sca-cpp/trunk/modules/edit/pages.py)2
-rw-r--r--sca-cpp/trunk/hosting/server/palettes.py (renamed from sca-cpp/trunk/modules/edit/palettes.py)2
-rw-r--r--sca-cpp/trunk/hosting/server/selector.py28
-rw-r--r--sca-cpp/trunk/hosting/server/server.composite (renamed from sca-cpp/trunk/modules/edit/edit.composite)164
-rwxr-xr-xsca-cpp/trunk/hosting/server/ssl-start (renamed from sca-cpp/trunk/modules/edit/ssl-start)61
-rwxr-xr-xsca-cpp/trunk/hosting/server/start (renamed from sca-cpp/trunk/modules/edit/start)51
-rwxr-xr-xsca-cpp/trunk/hosting/server/stop (renamed from sca-cpp/trunk/modules/edit/stop)0
-rw-r--r--sca-cpp/trunk/hosting/server/store.py (renamed from sca-cpp/trunk/modules/edit/store.py)2
-rw-r--r--sca-cpp/trunk/hosting/server/user.py (renamed from sca-cpp/trunk/modules/edit/user.py)0
-rw-r--r--sca-cpp/trunk/hosting/server/util.py (renamed from sca-cpp/trunk/modules/edit/util.py)0
-rw-r--r--sca-cpp/trunk/modules/Makefile.am2
-rwxr-xr-xsca-cpp/trunk/modules/http/http-test2
-rw-r--r--sca-cpp/trunk/modules/http/httpd.hpp2
-rwxr-xr-xsca-cpp/trunk/modules/http/proxy-test2
-rw-r--r--sca-cpp/trunk/modules/server/Makefile.am9
-rw-r--r--sca-cpp/trunk/modules/server/client-test.cpp2
-rw-r--r--sca-cpp/trunk/modules/server/client-test.hpp2
-rw-r--r--sca-cpp/trunk/modules/server/domain-test.composite4
-rwxr-xr-xsca-cpp/trunk/modules/server/httpd-test12
-rw-r--r--sca-cpp/trunk/modules/server/mod-eval.hpp918
-rw-r--r--sca-cpp/trunk/modules/server/mod-wiring.cpp530
-rwxr-xr-xsca-cpp/trunk/modules/server/server-conf7
172 files changed, 825 insertions, 1161 deletions
diff --git a/sca-cpp/trunk/.gitignore b/sca-cpp/trunk/.gitignore
index d1d2818389..8d56a49c91 100644
--- a/sca-cpp/trunk/.gitignore
+++ b/sca-cpp/trunk/.gitignore
@@ -143,8 +143,8 @@ json-value
value-json
element-value
value-element
-modules/edit/apps/*/nuvem
-modules/edit/apps/*/lib
+hosting/server/data/apps/*/nuvem
+hosting/server/data/apps/*/lib
chat-send
opencl-shell
opencl-test
diff --git a/sca-cpp/trunk/Makefile.am b/sca-cpp/trunk/Makefile.am
index 154643af17..10d04d8c0c 100644
--- a/sca-cpp/trunk/Makefile.am
+++ b/sca-cpp/trunk/Makefile.am
@@ -17,7 +17,7 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = etc kernel modules components samples doc macos ubuntu
+SUBDIRS = etc kernel modules components hosting samples doc macos ubuntu
datadir=$(prefix)
dist_data_DATA = AUTHORS README LICENSE COPYING NOTICE NEWS
diff --git a/sca-cpp/trunk/components/constdb/server-test b/sca-cpp/trunk/components/constdb/server-test
index 6d53e641ae..7e98e42bbb 100755
--- a/sca-cpp/trunk/components/constdb/server-test
+++ b/sca-cpp/trunk/components/constdb/server-test
@@ -32,7 +32,7 @@ EOF
sleep 2
# Test
-./client-test #2>/dev/null
+./client-test 2>/dev/null
rc=$?
# Cleanup
diff --git a/sca-cpp/trunk/components/http/http.composite b/sca-cpp/trunk/components/http/http.composite
index 48fe1c3b55..ea0adedf51 100644
--- a/sca-cpp/trunk/components/http/http.composite
+++ b/sca-cpp/trunk/components/http/http.composite
@@ -80,8 +80,8 @@
<component name="scheme-test">
<implementation.scheme script="server-test.scm"/>
- <service name="test">
- <binding.http uri="test"/>
+ <service name="scheme">
+ <binding.http uri="scheme"/>
</service>
</component>
diff --git a/sca-cpp/trunk/components/http/url-test.scm b/sca-cpp/trunk/components/http/url-test.scm
index 37a5b345b2..dd92720c32 100644
--- a/sca-cpp/trunk/components/http/url-test.scm
+++ b/sca-cpp/trunk/components/http/url-test.scm
@@ -18,6 +18,6 @@
; URL test case
(define (get id)
- "http://localhost:8090/test"
+ "http://localhost:8090/scheme"
)
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-conf b/sca-cpp/trunk/components/sqldb/pgsql-conf
index 6aa705f139..4083160a02 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-conf
+++ b/sca-cpp/trunk/components/sqldb/pgsql-conf
@@ -98,7 +98,7 @@ host replication all samenet trust
EOF
# Create the db
-($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
+$pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
sti=0
while [ $sti -ne 30 ]; do
st=`$pgsql_prefix/bin/pg_ctl status -D $root/sqldb/data | grep 'server is running'`
diff --git a/sca-cpp/trunk/configure.ac b/sca-cpp/trunk/configure.ac
index 3413bc2678..cb85c3930e 100644
--- a/sca-cpp/trunk/configure.ac
+++ b/sca-cpp/trunk/configure.ac
@@ -1034,7 +1034,6 @@ AC_CONFIG_FILES([Makefile
modules/openid/Makefile
modules/oauth/Makefile
modules/wsgi/Makefile
- modules/edit/Makefile
components/Makefile
components/cache/Makefile
components/log/Makefile
@@ -1045,6 +1044,8 @@ AC_CONFIG_FILES([Makefile
components/queue/Makefile
components/sqldb/Makefile
components/webservice/Makefile
+ hosting/Makefile
+ hosting/server/Makefile
samples/Makefile
samples/store-scheme/Makefile
samples/store-cpp/Makefile
diff --git a/sca-cpp/trunk/hosting/Makefile.am b/sca-cpp/trunk/hosting/Makefile.am
new file mode 100644
index 0000000000..36d24d4ffa
--- /dev/null
+++ b/sca-cpp/trunk/hosting/Makefile.am
@@ -0,0 +1,19 @@
+# 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.
+
+SUBDIRS = server
+
diff --git a/sca-cpp/trunk/modules/edit/Makefile.am b/sca-cpp/trunk/hosting/server/Makefile.am
index 6bf47676d1..d7a808c5e4 100644
--- a/sca-cpp/trunk/modules/edit/Makefile.am
+++ b/sca-cpp/trunk/hosting/server/Makefile.am
@@ -17,7 +17,7 @@
if WANT_PYTHON
-moddir = $(prefix)/modules/edit
+moddir = $(prefix)/hosting/server
dist_mod_SCRIPTS = start stop ssl-start mkapplinks config-backup data-backup
BUILT_SOURCES = htdocs/config.js htdocs/public/config.js
@@ -31,17 +31,17 @@ not_minified = htdocs/public/iframe.html htdocs/create/index.html htdocs/page/in
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/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/stats/index-min.html htdocs/app/index-min.html htdocs/store/index-min.html htdocs/config-min.js htdocs/public/config-min.js
-resources = edit.composite *.py htdocs/*.cmf htdocs/*.ico htdocs/home/*.png htdocs/app/*.cmf htdocs/home/*.b64 htdocs/*.txt htdocs/public/*.png htdocs/public/*.b64 palettes/*/palette.composite accounts/*/*.account apps/*/app.composite apps/*/app.stats apps/*/htdocs/app.html dashboards/*/user.apps store/*/store.apps ${not_minified} ${minified}
+resources = server.composite *.py htdocs/*.cmf htdocs/*.ico htdocs/home/*.png htdocs/app/*.cmf htdocs/home/*.b64 htdocs/*.txt htdocs/public/*.png htdocs/public/*.b64 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 ${not_minified} ${minified}
nobase_dist_mod_DATA = ${resources}
EXTRA_DIST = ${resources}
SUFFIXES = -min.html -min.js
.html-min.html:
- ../http/minify-html $< $@
+ ../../modules/http/minify-html $< $@
.js-min.js:
- ../http/minify-js $< $@
+ ../../modules/http/minify-js $< $@
CLEANFILES = ${minified}
diff --git a/sca-cpp/trunk/modules/edit/accounts.py b/sca-cpp/trunk/hosting/server/accounts.py
index 4589f6c0cc..4a50b15981 100644
--- a/sca-cpp/trunk/modules/edit/accounts.py
+++ b/sca-cpp/trunk/hosting/server/accounts.py
@@ -20,7 +20,7 @@ from util import *
# Convert a particular user id to an account id
def accountid(user):
- return ("'" + user.id(), "'user.account")
+ return ("'accounts", "'" + user.id(), "'user.account")
# Get the current user's account
def get(id, user, cache):
diff --git a/sca-cpp/trunk/modules/edit/apps.py b/sca-cpp/trunk/hosting/server/apps.py
index 35a4c79e33..cc84544dd5 100644
--- a/sca-cpp/trunk/modules/edit/apps.py
+++ b/sca-cpp/trunk/hosting/server/apps.py
@@ -21,14 +21,14 @@ from util import *
# Convert an id to an app id
def appid(id):
- return ("'" + car(id), "'app.stats")
+ return ("'apps", "'" + car(id), "'app.stats")
# Link implementation resources into an app
def mkapplink(id):
try:
- os.symlink('../../../../../nuvem/nuvem-parallel/nuvem', 'apps/' + car(id) + '/nuvem')
- os.symlink('../../../../components', 'apps/' + car(id) + '/lib')
- os.mkdir('apps/' + car(id) + '/htdocs')
+ os.symlink('../../../../../../nuvem/nuvem-parallel/nuvem', 'data/apps/' + car(id) + '/nuvem')
+ os.symlink('../../../../../components', 'data/apps/' + car(id) + '/lib')
+ os.mkdir('data/apps/' + car(id) + '/htdocs')
except:
pass
return True
diff --git a/sca-cpp/trunk/modules/edit/composites.py b/sca-cpp/trunk/hosting/server/composites.py
index 87569a8700..d929716bd7 100644
--- a/sca-cpp/trunk/modules/edit/composites.py
+++ b/sca-cpp/trunk/hosting/server/composites.py
@@ -20,7 +20,7 @@ from util import *
# Convert an id to an app id
def appid(id):
- return ("'" + car(id), "'app.composite")
+ return ("'apps", "'" + car(id), "'app.composite")
# Put an app into the apps db
def put(id, app, cache):
diff --git a/sca-cpp/trunk/modules/edit/config-backup b/sca-cpp/trunk/hosting/server/config-backup
index 9951518863..5e09008fb0 100755
--- a/sca-cpp/trunk/modules/edit/config-backup
+++ b/sca-cpp/trunk/hosting/server/config-backup
@@ -18,5 +18,5 @@
# under the License.
cd ../../
-tar czf ../config-backup.tar.gz modules/edit/*start modules/edit/*stop modules/edit/htdocs/*.js modules/edit/htdocs/public/*.js modules/edit/htdocs/home/*.b64 modules/edit/htdocs/home/*.png
+tar czf ../config-backup.tar.gz hosting/server/*start hosting/server/*stop hosting/server/htdocs/*.js hosting/server/htdocs/public/*.js hosting/server/htdocs/home/*.b64 hosting/server/htdocs/home/*.png
diff --git a/sca-cpp/trunk/modules/edit/dashboards.py b/sca-cpp/trunk/hosting/server/dashboards.py
index f42106e0ec..22cf59f157 100644
--- a/sca-cpp/trunk/modules/edit/dashboards.py
+++ b/sca-cpp/trunk/hosting/server/dashboards.py
@@ -20,7 +20,7 @@ from util import *
# Convert a particular user id to a dashboard id
def dashboardid(user):
- return ("'" + user.id(), "'user.apps")
+ return ("'dashboards", "'" + user.id(), "'user.apps")
# Get a dashboard from the cache
def getdashboard(id, cache):
diff --git a/sca-cpp/trunk/modules/edit/data-backup b/sca-cpp/trunk/hosting/server/data-backup
index 18cba8fbbe..f66e947f84 100755
--- a/sca-cpp/trunk/modules/edit/data-backup
+++ b/sca-cpp/trunk/hosting/server/data-backup
@@ -18,5 +18,5 @@
# under the License.
cd ../../
-tar czf ../data-backup.tar.gz modules/edit/accounts modules/edit/apps modules/edit/dashboards modules/edit/store modules/edit/tmp/appdata
+tar czf ../data-backup.tar.gz hosting/server/data
diff --git a/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account b/sca-cpp/trunk/hosting/server/data/accounts/jane@localhost/user.account
index 5fca389f04..5fca389f04 100644
--- a/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account
+++ b/sca-cpp/trunk/hosting/server/data/accounts/jane@localhost/user.account
diff --git a/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account b/sca-cpp/trunk/hosting/server/data/accounts/jane@sca-store.com/user.account
index e0d25671b6..e0d25671b6 100644
--- a/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account
+++ b/sca-cpp/trunk/hosting/server/data/accounts/jane@sca-store.com/user.account
diff --git a/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account b/sca-cpp/trunk/hosting/server/data/accounts/john@localhost/user.account
index 35d6f30f0b..35d6f30f0b 100644
--- a/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account
+++ b/sca-cpp/trunk/hosting/server/data/accounts/john@localhost/user.account
diff --git a/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account b/sca-cpp/trunk/hosting/server/data/accounts/john@sca-store.com/user.account
index 273335e1c7..273335e1c7 100644
--- a/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account
+++ b/sca-cpp/trunk/hosting/server/data/accounts/john@sca-store.com/user.account
diff --git a/sca-cpp/trunk/modules/edit/apps/me360/app.composite b/sca-cpp/trunk/hosting/server/data/apps/me360/app.composite
index c0fb6a425c..c0fb6a425c 100644
--- a/sca-cpp/trunk/modules/edit/apps/me360/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/me360/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/me360/app.stats b/sca-cpp/trunk/hosting/server/data/apps/me360/app.stats
index a46c727280..a46c727280 100644
--- a/sca-cpp/trunk/modules/edit/apps/me360/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/me360/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/me360/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/me360/htdocs/app.html
index e57e246328..e57e246328 100644
--- a/sca-cpp/trunk/modules/edit/apps/me360/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/me360/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/nearme/app.composite b/sca-cpp/trunk/hosting/server/data/apps/nearme/app.composite
index 51fc2791fb..51fc2791fb 100644
--- a/sca-cpp/trunk/modules/edit/apps/nearme/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/nearme/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/nearme/app.stats b/sca-cpp/trunk/hosting/server/data/apps/nearme/app.stats
index a072636788..a072636788 100644
--- a/sca-cpp/trunk/modules/edit/apps/nearme/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/nearme/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/nearme/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/nearme/htdocs/app.html
index fba4b0464c..fba4b0464c 100644
--- a/sca-cpp/trunk/modules/edit/apps/nearme/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/nearme/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/nearme2/app.composite b/sca-cpp/trunk/hosting/server/data/apps/nearme2/app.composite
index d75af57321..8038387e4a 100644
--- a/sca-cpp/trunk/modules/edit/apps/nearme2/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/nearme2/app.composite
@@ -36,19 +36,19 @@
<component x="120" y="10" name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="410" y="260" name="filedb4" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="400" y="370" name="filedb5" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="270" y="260" name="get3" title="get" color="pink1">
diff --git a/sca-cpp/trunk/modules/edit/apps/nearme2/app.stats b/sca-cpp/trunk/hosting/server/data/apps/nearme2/app.stats
index 9eb239d22c..9eb239d22c 100644
--- a/sca-cpp/trunk/modules/edit/apps/nearme2/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/nearme2/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/nearme2/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/nearme2/htdocs/app.html
index a4c407a7a4..a4c407a7a4 100644
--- a/sca-cpp/trunk/modules/edit/apps/nearme2/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/nearme2/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/new/app.composite b/sca-cpp/trunk/hosting/server/data/apps/new/app.composite
index 4beacfdf77..4beacfdf77 100644
--- a/sca-cpp/trunk/modules/edit/apps/new/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/new/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/new/app.stats b/sca-cpp/trunk/hosting/server/data/apps/new/app.stats
index 513c902468..513c902468 100644
--- a/sca-cpp/trunk/modules/edit/apps/new/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/new/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/new/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/new/htdocs/app.html
index eeb7becae5..eeb7becae5 100644
--- a/sca-cpp/trunk/modules/edit/apps/new/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/new/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/ourphotos/app.composite b/sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.composite
index 2a7ce11f1f..2a7ce11f1f 100644
--- a/sca-cpp/trunk/modules/edit/apps/ourphotos/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/ourphotos/app.stats b/sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.stats
index e685d930dd..e685d930dd 100644
--- a/sca-cpp/trunk/modules/edit/apps/ourphotos/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/ourphotos/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/ourphotos/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/ourphotos/htdocs/app.html
index 1ddb89fa30..1ddb89fa30 100644
--- a/sca-cpp/trunk/modules/edit/apps/ourphotos/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/ourphotos/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/shoppingcart/app.composite b/sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.composite
index 15da95cdcc..230004315d 100644
--- a/sca-cpp/trunk/modules/edit/apps/shoppingcart/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.composite
@@ -169,19 +169,19 @@
<component name="filedb" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb3" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="130" y="420" name="format1" title="format" color="cyan1">
diff --git a/sca-cpp/trunk/modules/edit/apps/shoppingcart/app.stats b/sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.stats
index 4529005b54..4529005b54 100644
--- a/sca-cpp/trunk/modules/edit/apps/shoppingcart/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/shoppingcart/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/shoppingcart/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/shoppingcart/htdocs/app.html
index 0464f3e4c4..0464f3e4c4 100644
--- a/sca-cpp/trunk/modules/edit/apps/shoppingcart/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/shoppingcart/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/slice/app.composite b/sca-cpp/trunk/hosting/server/data/apps/slice/app.composite
index 9680b52008..714629767b 100644
--- a/sca-cpp/trunk/modules/edit/apps/slice/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/slice/app.composite
@@ -85,25 +85,25 @@
<component x="240" y="100" name="filedb1" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="270" y="150" name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="890" y="350" name="filedb3" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="1100" y="190" name="filedb4" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="710" y="160" name="frames1" title="frames" color="white1">
diff --git a/sca-cpp/trunk/modules/edit/apps/slice/app.stats b/sca-cpp/trunk/hosting/server/data/apps/slice/app.stats
index c7d1996716..c7d1996716 100644
--- a/sca-cpp/trunk/modules/edit/apps/slice/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/slice/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/slice/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/slice/htdocs/app.html
index b4bc5908f6..b4bc5908f6 100644
--- a/sca-cpp/trunk/modules/edit/apps/slice/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/slice/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/test/app.composite b/sca-cpp/trunk/hosting/server/data/apps/test/app.composite
index 83a9c51e80..8fd7505562 100644
--- a/sca-cpp/trunk/modules/edit/apps/test/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/test/app.composite
@@ -1,22 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="app" targetNamespace="http://app">
<service name="comment1" promote="comment1"/>
<service name="start1" promote="start1"/>
diff --git a/sca-cpp/trunk/modules/edit/apps/test/app.stats b/sca-cpp/trunk/hosting/server/data/apps/test/app.stats
index 9adad8c1a6..9adad8c1a6 100644
--- a/sca-cpp/trunk/modules/edit/apps/test/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/test/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/test/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/test/htdocs/app.html
index d33d4d6da7..d33d4d6da7 100644
--- a/sca-cpp/trunk/modules/edit/apps/test/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/test/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testanimation/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testanimation/app.composite
index 5c8ebd59f3..5c8ebd59f3 100644
--- a/sca-cpp/trunk/modules/edit/apps/testanimation/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testanimation/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testanimation/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testanimation/app.stats
index 493ef39d1a..493ef39d1a 100644
--- a/sca-cpp/trunk/modules/edit/apps/testanimation/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testanimation/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testanimation/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testanimation/htdocs/app.html
index c9f9420eb0..c9f9420eb0 100644
--- a/sca-cpp/trunk/modules/edit/apps/testanimation/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testanimation/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testdb/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testdb/app.composite
index 51535b124c..32a023f8a7 100644
--- a/sca-cpp/trunk/modules/edit/apps/testdb/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testdb/app.composite
@@ -30,19 +30,19 @@
<component name="filedb" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb3" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="20" y="120" name="get" title="get" color="pink1">
diff --git a/sca-cpp/trunk/modules/edit/apps/testdb/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testdb/app.stats
index 1128933dfd..1128933dfd 100644
--- a/sca-cpp/trunk/modules/edit/apps/testdb/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testdb/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testdb/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testdb/htdocs/app.html
index 856966ff50..856966ff50 100644
--- a/sca-cpp/trunk/modules/edit/apps/testdb/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testdb/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testevents/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite
index 61cd17ec81..61cd17ec81 100644
--- a/sca-cpp/trunk/modules/edit/apps/testevents/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testevents/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testevents/app.stats
index 51d6a0388e..51d6a0388e 100644
--- a/sca-cpp/trunk/modules/edit/apps/testevents/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testevents/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testevents/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testevents/htdocs/app.html
index 6698c6faa8..6698c6faa8 100644
--- a/sca-cpp/trunk/modules/edit/apps/testevents/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testevents/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testhttp/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite
index 6aabf6d4bb..6aabf6d4bb 100644
--- a/sca-cpp/trunk/modules/edit/apps/testhttp/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testhttp/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.stats
index be1fc6d254..be1fc6d254 100644
--- a/sca-cpp/trunk/modules/edit/apps/testhttp/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testhttp/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testhttp/htdocs/app.html
index b0c20ef5e6..b0c20ef5e6 100644
--- a/sca-cpp/trunk/modules/edit/apps/testhttp/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testhttp/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testlogic/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testlogic/app.composite
index 659fcbacba..659fcbacba 100644
--- a/sca-cpp/trunk/modules/edit/apps/testlogic/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testlogic/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testlogic/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testlogic/app.stats
index e557346327..e557346327 100644
--- a/sca-cpp/trunk/modules/edit/apps/testlogic/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testlogic/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testlogic/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testlogic/htdocs/app.html
index 4e9efdaa22..4e9efdaa22 100644
--- a/sca-cpp/trunk/modules/edit/apps/testlogic/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testlogic/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testsearch/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testsearch/app.composite
index 493e9a253a..493e9a253a 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsearch/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsearch/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testsearch/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testsearch/app.stats
index 691c43875d..691c43875d 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsearch/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsearch/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testsearch/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testsearch/htdocs/app.html
index ca5462f07a..ca5462f07a 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsearch/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsearch/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testsms/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testsms/app.composite
index d2abbaae28..d2abbaae28 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsms/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsms/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testsms/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testsms/app.stats
index be1fc6d254..be1fc6d254 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsms/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsms/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testsms/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testsms/htdocs/app.html
index dd8f5f9f26..dd8f5f9f26 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsms/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsms/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testsocial/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testsocial/app.composite
index 28ec9654d8..28ec9654d8 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsocial/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsocial/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testsocial/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testsocial/app.stats
index fa487f4d81..fa487f4d81 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsocial/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsocial/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testsocial/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testsocial/htdocs/app.html
index 5fe616ca16..5fe616ca16 100644
--- a/sca-cpp/trunk/modules/edit/apps/testsocial/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testsocial/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testtext/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testtext/app.composite
index 7021ddb2e9..7021ddb2e9 100644
--- a/sca-cpp/trunk/modules/edit/apps/testtext/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testtext/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testtext/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testtext/app.stats
index 35e43ff383..35e43ff383 100644
--- a/sca-cpp/trunk/modules/edit/apps/testtext/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testtext/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testtext/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testtext/htdocs/app.html
index 1c7612d0e0..1c7612d0e0 100644
--- a/sca-cpp/trunk/modules/edit/apps/testtext/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testtext/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testurl/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite
index f42ba5fa4b..7b97b7a957 100644
--- a/sca-cpp/trunk/modules/edit/apps/testurl/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite
@@ -1,23 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="app" targetNamespace="http://app">
+ <service name="app1" promote="app1"/>
<service name="email" promote="email"/>
<service name="host" promote="host"/>
<service name="keychain1" promote="keychain1"/>
@@ -27,6 +10,11 @@
<service name="realm" promote="realm"/>
<service name="url" promote="url"/>
<service name="user" promote="user"/>
+ <component x="260" y="100" name="app1" title="app" color="green1">
+ <implementation.python script="nuvem/app.py"/>
+ <service name="app"/>
+ <property name="app" visible="false"/>
+ </component>
<component x="17" y="223" name="email" title="email" color="green1">
<implementation.python script="nuvem/email.py"/>
<service name="email"/>
@@ -92,7 +80,7 @@
<service name="params"/>
<property name="params"/>
</component>
- <component x="17" y="48" name="path" title="path" color="green1">
+ <component x="20" y="50" name="path" title="path" color="green1">
<implementation.python script="nuvem/path.py"/>
<service name="path"/>
<property name="path"/>
diff --git a/sca-cpp/trunk/modules/edit/apps/testurl/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testurl/app.stats
index b4142f40cf..b4142f40cf 100644
--- a/sca-cpp/trunk/modules/edit/apps/testurl/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testurl/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testurl/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testurl/htdocs/app.html
index 8c47186044..8c47186044 100644
--- a/sca-cpp/trunk/modules/edit/apps/testurl/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testurl/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testvalues/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testvalues/app.composite
index 4ee8a0a619..4ee8a0a619 100644
--- a/sca-cpp/trunk/modules/edit/apps/testvalues/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testvalues/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testvalues/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testvalues/app.stats
index 4b7a09cd38..4b7a09cd38 100644
--- a/sca-cpp/trunk/modules/edit/apps/testvalues/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testvalues/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testvalues/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testvalues/htdocs/app.html
index 79bb081a97..79bb081a97 100644
--- a/sca-cpp/trunk/modules/edit/apps/testvalues/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testvalues/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.composite
index 1cb1aee017..1cb1aee017 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.stats
index 6a66748ab1..6a66748ab1 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testwidgets/htdocs/app.html
index d1422c10ac..d1422c10ac 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets2/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.composite
index f387e876ed..f387e876ed 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets2/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets2/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.stats
index 18f0cb50f8..18f0cb50f8 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets2/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets2/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets2/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testwidgets2/htdocs/app.html
index 7efb62d247..7efb62d247 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets2/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets2/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets3/app.composite b/sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.composite
index e367b69a9c..e367b69a9c 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets3/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets3/app.stats b/sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.stats
index 2e772401c9..2e772401c9 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets3/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets3/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/testwidgets3/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/testwidgets3/htdocs/app.html
index 393d63c2d1..393d63c2d1 100644
--- a/sca-cpp/trunk/modules/edit/apps/testwidgets3/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/testwidgets3/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/apps/twsms/app.composite b/sca-cpp/trunk/hosting/server/data/apps/twsms/app.composite
index 66523f4754..66523f4754 100644
--- a/sca-cpp/trunk/modules/edit/apps/twsms/app.composite
+++ b/sca-cpp/trunk/hosting/server/data/apps/twsms/app.composite
diff --git a/sca-cpp/trunk/modules/edit/apps/twsms/app.stats b/sca-cpp/trunk/hosting/server/data/apps/twsms/app.stats
index 85c97c2457..85c97c2457 100644
--- a/sca-cpp/trunk/modules/edit/apps/twsms/app.stats
+++ b/sca-cpp/trunk/hosting/server/data/apps/twsms/app.stats
diff --git a/sca-cpp/trunk/modules/edit/apps/twsms/htdocs/app.html b/sca-cpp/trunk/hosting/server/data/apps/twsms/htdocs/app.html
index d2eaebcdd0..d2eaebcdd0 100644
--- a/sca-cpp/trunk/modules/edit/apps/twsms/htdocs/app.html
+++ b/sca-cpp/trunk/hosting/server/data/apps/twsms/htdocs/app.html
diff --git a/sca-cpp/trunk/modules/edit/dashboards/jane@localhost/user.apps b/sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps
index 710de5f62e..710de5f62e 100644
--- a/sca-cpp/trunk/modules/edit/dashboards/jane@localhost/user.apps
+++ b/sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps
diff --git a/sca-cpp/trunk/modules/edit/dashboards/jane@sca-store.com/user.apps b/sca-cpp/trunk/hosting/server/data/dashboards/jane@sca-store.com/user.apps
index 710de5f62e..710de5f62e 100644
--- a/sca-cpp/trunk/modules/edit/dashboards/jane@sca-store.com/user.apps
+++ b/sca-cpp/trunk/hosting/server/data/dashboards/jane@sca-store.com/user.apps
diff --git a/sca-cpp/trunk/modules/edit/dashboards/john@localhost/user.apps b/sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps
index 710de5f62e..710de5f62e 100644
--- a/sca-cpp/trunk/modules/edit/dashboards/john@localhost/user.apps
+++ b/sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps
diff --git a/sca-cpp/trunk/modules/edit/dashboards/john@sca-store.com/user.apps b/sca-cpp/trunk/hosting/server/data/dashboards/john@sca-store.com/user.apps
index 710de5f62e..710de5f62e 100644
--- a/sca-cpp/trunk/modules/edit/dashboards/john@sca-store.com/user.apps
+++ b/sca-cpp/trunk/hosting/server/data/dashboards/john@sca-store.com/user.apps
diff --git a/sca-cpp/trunk/modules/edit/palettes/animation/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/animation/palette.composite
index 75cbf497b6..75cbf497b6 100644
--- a/sca-cpp/trunk/modules/edit/palettes/animation/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/animation/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/control/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/control/palette.composite
index f89cae2c5d..f89cae2c5d 100644
--- a/sca-cpp/trunk/modules/edit/palettes/control/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/control/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/database/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/database/palette.composite
index cca0b174b8..926fb3fa14 100644
--- a/sca-cpp/trunk/modules/edit/palettes/database/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/database/palette.composite
@@ -34,7 +34,7 @@
<component x="80" y="10" name="filedb" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
- <reference name="db" target="AppDataFileCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="80" y="60" name="get" title="get" color="pink1">
@@ -46,7 +46,7 @@
<component x="140" y="10" name="nosqldb" title="index **" color="pink1">
<implementation.python script="nuvem/nosqldb.py"/>
<service name="nosqldb"/>
- <reference name="db" target="AppDataNoSQLCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="200" y="60" name="post" title="post" color="pink1">
@@ -66,7 +66,7 @@
<component x="210" y="10" name="sqldb" title="sql **" color="pink1">
<implementation.python script="nuvem/sqldb.py"/>
<service name="sqldb"/>
- <reference name="db" target="AppDataSQLCache" visible="false"/>
+ <reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
</composite>
diff --git a/sca-cpp/trunk/modules/edit/palettes/http/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/http/palette.composite
index 6c8cbaa553..13f92e8954 100644
--- a/sca-cpp/trunk/modules/edit/palettes/http/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/http/palette.composite
@@ -18,6 +18,7 @@
* under the License.
-->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="palette" targetNamespace="http://palette">
+ <service name="app" promote="app"/>
<service name="delete" promote="delete"/>
<service name="email" promote="email"/>
<service name="get" promote="get"/>
@@ -31,73 +32,78 @@
<service name="put" promote="put"/>
<service name="url" promote="url"/>
<service name="user" promote="user"/>
- <component x="80" y="170" name="delete" title="delete" color="green1">
+ <component x="80" y="10" name="app" title="app" color="green1">
+ <implementation.python script="nuvem/app.py"/>
+ <service name="app"/>
+ <property name="app" visible="false"/>
+ </component>
+ <component x="80" y="220" name="delete" title="delete" color="green1">
<implementation.cpp path="lib/http" library="libhttpdelete"/>
<service name="delete"/>
<reference name="url"/>
</component>
- <component x="130" y="60" name="email" title="email" color="green1">
+ <component x="140" y="110" name="email" title="email" color="green1">
<implementation.python script="nuvem/email.py"/>
<service name="email"/>
<property name="email" visible="false"/>
</component>
- <component x="80" y="120" name="get" title="get" color="green1">
+ <component x="80" y="170" name="get" title="get" color="green1">
<implementation.cpp path="lib/http" library="libhttpget"/>
<service name="get"/>
<reference name="url"/>
</component>
- <component x="80" y="10" name="host" title="host" color="green1">
+ <component x="130" y="10" name="host" title="host" color="green1">
<implementation.python script="nuvem/host.py"/>
<service name="host"/>
<property name="host" visible="false"/>
</component>
- <component x="190" y="60" name="keychain" title="keychain" color="green1">
+ <component x="210" y="110" name="keychain" title="keychain" color="green1">
<implementation.python script="nuvem/keychain.py"/>
<service name="keychain"/>
<reference name="name"/>
<reference name="account" target="Accounts" visible="false"/>
</component>
- <component x="250" y="10" name="param" title="?param" color="green1">
+ <component x="150" y="60" name="param" title="?param" color="green1">
<implementation.python script="nuvem/param.py"/>
<service name="param"/>
<property>x</property>
<property name="query" visible="false"/>
</component>
- <component x="180" y="10" name="params" title="?params" color="green1">
+ <component x="80" y="60" name="params" title="?params" color="green1">
<implementation.python script="nuvem/params.py"/>
<service name="params"/>
<property name="query" visible="false"/>
</component>
- <component x="260" y="120" name="patch" title="patch" color="green1">
+ <component x="260" y="170" name="patch" title="patch" color="green1">
<implementation.cpp path="lib/http" library="libhttppatch"/>
<service name="patch"/>
<reference name="url"/>
<reference name="content"/>
</component>
- <component x="130" y="10" name="path" title="path" color="green1">
+ <component x="190" y="10" name="path" title="path" color="green1">
<implementation.python script="nuvem/path.py"/>
<service name="path"/>
<property name="path" visible="false"/>
</component>
- <component x="200" y="120" name="post" title="post" color="green1">
+ <component x="200" y="170" name="post" title="post" color="green1">
<implementation.cpp path="lib/http" library="libhttppost"/>
<service name="post"/>
<reference name="url"/>
<reference name="content"/>
</component>
- <component x="140" y="120" name="put" title="put" color="green1">
+ <component x="140" y="170" name="put" title="put" color="green1">
<implementation.cpp path="lib/http" library="libhttpput"/>
<service name="put"/>
<reference name="url"/>
<reference name="content"/>
</component>
- <component x="270" y="60" name="url" title="url" color="green1">
+ <component x="250" y="10" name="url" title="url" color="green1">
<implementation.python script="nuvem/url.py"/>
<service name="url"/>
<reference name="address"/>
<reference name="args"/>
</component>
- <component x="80" y="60" name="user" title="user" color="green1">
+ <component x="80" y="110" name="user" title="user" color="green1">
<implementation.python script="nuvem/user.py"/>
<service name="user"/>
<property name="user" visible="false"/>
diff --git a/sca-cpp/trunk/modules/edit/palettes/lists/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/lists/palette.composite
index 2f4051d7b9..2f4051d7b9 100644
--- a/sca-cpp/trunk/modules/edit/palettes/lists/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/lists/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/logic/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/logic/palette.composite
index 4d84272fd5..4d84272fd5 100644
--- a/sca-cpp/trunk/modules/edit/palettes/logic/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/logic/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/math/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/math/palette.composite
index 7dc4e88f2f..7dc4e88f2f 100644
--- a/sca-cpp/trunk/modules/edit/palettes/math/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/math/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/python/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/python/palette.composite
index 2cc03ae365..2cc03ae365 100644
--- a/sca-cpp/trunk/modules/edit/palettes/python/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/python/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/search/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/search/palette.composite
index db58cdcd08..db58cdcd08 100644
--- a/sca-cpp/trunk/modules/edit/palettes/search/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/search/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/social/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/social/palette.composite
index 5e02303857..5e02303857 100644
--- a/sca-cpp/trunk/modules/edit/palettes/social/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/social/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/talk/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/talk/palette.composite
index 90a48291ca..90a48291ca 100644
--- a/sca-cpp/trunk/modules/edit/palettes/talk/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/talk/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/text/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/text/palette.composite
index 6b9214f6e4..6b9214f6e4 100644
--- a/sca-cpp/trunk/modules/edit/palettes/text/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/text/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/transform/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/transform/palette.composite
index 566278c44b..566278c44b 100644
--- a/sca-cpp/trunk/modules/edit/palettes/transform/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/transform/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/palettes/values/palette.composite b/sca-cpp/trunk/hosting/server/data/palettes/values/palette.composite
index 4cd3a9d14e..4cd3a9d14e 100644
--- a/sca-cpp/trunk/modules/edit/palettes/values/palette.composite
+++ b/sca-cpp/trunk/hosting/server/data/palettes/values/palette.composite
diff --git a/sca-cpp/trunk/modules/edit/store/all/store.apps b/sca-cpp/trunk/hosting/server/data/store/all/store.apps
index caf7142403..caf7142403 100644
--- a/sca-cpp/trunk/modules/edit/store/all/store.apps
+++ b/sca-cpp/trunk/hosting/server/data/store/all/store.apps
diff --git a/sca-cpp/trunk/modules/edit/store/featured/store.apps b/sca-cpp/trunk/hosting/server/data/store/featured/store.apps
index 18bd47e8dd..18bd47e8dd 100644
--- a/sca-cpp/trunk/modules/edit/store/featured/store.apps
+++ b/sca-cpp/trunk/hosting/server/data/store/featured/store.apps
diff --git a/sca-cpp/trunk/modules/edit/store/new/store.apps b/sca-cpp/trunk/hosting/server/data/store/new/store.apps
index 18bd47e8dd..18bd47e8dd 100644
--- a/sca-cpp/trunk/modules/edit/store/new/store.apps
+++ b/sca-cpp/trunk/hosting/server/data/store/new/store.apps
diff --git a/sca-cpp/trunk/modules/edit/store/top/store.apps b/sca-cpp/trunk/hosting/server/data/store/top/store.apps
index 18bd47e8dd..18bd47e8dd 100644
--- a/sca-cpp/trunk/modules/edit/store/top/store.apps
+++ b/sca-cpp/trunk/hosting/server/data/store/top/store.apps
diff --git a/sca-cpp/trunk/modules/edit/htdocs/account/index.html b/sca-cpp/trunk/hosting/server/htdocs/account/index.html
index 291f6dea1c..291f6dea1c 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/account/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/account/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf b/sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf
index 6ea53970aa..6ea53970aa 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf
+++ b/sca-cpp/trunk/hosting/server/htdocs/app/cache-manifest.cmf
diff --git a/sca-cpp/trunk/modules/edit/htdocs/app/index.html b/sca-cpp/trunk/hosting/server/htdocs/app/index.html
index 0b01c1d3bd..0b01c1d3bd 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/app/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/app/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf b/sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf
index cb76f773a3..cb76f773a3 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf
+++ b/sca-cpp/trunk/hosting/server/htdocs/cache-manifest.cmf
diff --git a/sca-cpp/trunk/modules/edit/htdocs/clone/index.html b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html
index 3642634ed6..3642634ed6 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/clone/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/clone/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/create/index.html b/sca-cpp/trunk/hosting/server/htdocs/create/index.html
index 6097053cd6..6097053cd6 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/create/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/create/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/favicon.ico b/sca-cpp/trunk/hosting/server/htdocs/favicon.ico
index a7b502b9e1..a7b502b9e1 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/favicon.ico
+++ b/sca-cpp/trunk/hosting/server/htdocs/favicon.ico
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/graph/index.html b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html
index 1732590079..6b750026b4 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/graph/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html
@@ -61,7 +61,7 @@
var appname = ui.fragmentParams(location)['app'];
var ispalette = false;
if (isNil(appname)) {
- appname = ui.fragmentParams()['palette'];
+ appname = ui.fragmentParams(location)['palette'];
// Edit a palette instead of a regular app
if (!isNil(appname))
diff --git a/sca-cpp/trunk/modules/edit/htdocs/home/home.b64 b/sca-cpp/trunk/hosting/server/htdocs/home/home.b64
index 9131135881..9131135881 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/home/home.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/home/home.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/home/home.png b/sca-cpp/trunk/hosting/server/htdocs/home/home.png
index 8f5a0b0d86..8f5a0b0d86 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/home/home.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/home/home.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/home/index.html b/sca-cpp/trunk/hosting/server/htdocs/home/index.html
index 6fb9b558bf..6fb9b558bf 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/home/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/home/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/index.html b/sca-cpp/trunk/hosting/server/htdocs/index.html
index 3bc1529dbb..3bc1529dbb 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/login/index.html b/sca-cpp/trunk/hosting/server/htdocs/login/index.html
index 9052abe8d3..9052abe8d3 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/login/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/login/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/page/index.html b/sca-cpp/trunk/hosting/server/htdocs/page/index.html
index 9482cb4e32..9482cb4e32 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/page/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/page/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/app.b64 b/sca-cpp/trunk/hosting/server/htdocs/public/app.b64
index 7ed235aa14..7ed235aa14 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/app.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/app.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/app.png b/sca-cpp/trunk/hosting/server/htdocs/public/app.png
index 1f73274b76..1f73274b76 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/app.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/app.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/app.xcf b/sca-cpp/trunk/hosting/server/htdocs/public/app.xcf
index 741b7ff43f..741b7ff43f 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/app.xcf
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/app.xcf
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64 b/sca-cpp/trunk/hosting/server/htdocs/public/delete.b64
index c8137d7ab4..c8137d7ab4 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/delete.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/delete.png b/sca-cpp/trunk/hosting/server/htdocs/public/delete.png
index fb56bae030..fb56bae030 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/delete.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/delete.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/delete.xcf b/sca-cpp/trunk/hosting/server/htdocs/public/delete.xcf
index 7691f50cc5..7691f50cc5 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/delete.xcf
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/delete.xcf
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64 b/sca-cpp/trunk/hosting/server/htdocs/public/grid72.b64
index 34be13e5ca..34be13e5ca 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/grid72.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/grid72.png b/sca-cpp/trunk/hosting/server/htdocs/public/grid72.png
index cf6008171a..cf6008171a 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/grid72.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/grid72.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html b/sca-cpp/trunk/hosting/server/htdocs/public/iframe.html
index e2b862dbaa..e2b862dbaa 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/iframe.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/img.b64 b/sca-cpp/trunk/hosting/server/htdocs/public/img.b64
index 97dae687a0..97dae687a0 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/img.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/img.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/img.png b/sca-cpp/trunk/hosting/server/htdocs/public/img.png
index 2363b25e8e..2363b25e8e 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/img.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/img.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/img.xcf b/sca-cpp/trunk/hosting/server/htdocs/public/img.xcf
index ffcc124584..ffcc124584 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/img.xcf
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/img.xcf
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/notauth/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html
index f366533e17..21f70f8a65 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/notauth/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html
@@ -23,7 +23,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<base href="/notauth/"/>
+<base href="/public/notauth/"/>
<script type="text/javascript">
window.appcache = {};
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/notfound/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html
index 24efb159ea..839cc3395b 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/notfound/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/notfound/index.html
@@ -23,7 +23,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<base href="/notfound/"/>
+<base href="/public/notfound/"/>
<script type="text/javascript">
window.appcache = {};
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/notyet/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html
index b8457485fb..c014c7266e 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/notyet/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/notyet/index.html
@@ -23,7 +23,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<base href="/notyet/"/>
+<base href="/public/notyet/"/>
<script type="text/javascript">
window.appcache = {};
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html
index ca3e7706e3..2ef7754919 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/oops/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/oops/index.html
@@ -20,10 +20,10 @@
<html>
<head>
<title>Oops</title>
-<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0/>
+<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
-<base href="/oops/"/>
+<base href="/public/oops/"/>
<script type="text/javascript">
window.appcache = {};
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64 b/sca-cpp/trunk/hosting/server/htdocs/public/touchicon.b64
index 2239f6ae0f..2239f6ae0f 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/touchicon.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png b/sca-cpp/trunk/hosting/server/htdocs/public/touchicon.png
index f22c33d2a0..f22c33d2a0 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/touchicon.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf b/sca-cpp/trunk/hosting/server/htdocs/public/touchicon.xcf
index fc713b478b..fc713b478b 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/touchicon.xcf
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/user.b64 b/sca-cpp/trunk/hosting/server/htdocs/public/user.b64
index 7ed235aa14..7ed235aa14 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/user.b64
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/user.b64
diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/user.png b/sca-cpp/trunk/hosting/server/htdocs/public/user.png
index 1f73274b76..1f73274b76 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/public/user.png
+++ b/sca-cpp/trunk/hosting/server/htdocs/public/user.png
Binary files differ
diff --git a/sca-cpp/trunk/modules/edit/htdocs/robots.txt b/sca-cpp/trunk/hosting/server/htdocs/robots.txt
index 1f53798bb4..1f53798bb4 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/robots.txt
+++ b/sca-cpp/trunk/hosting/server/htdocs/robots.txt
diff --git a/sca-cpp/trunk/modules/edit/htdocs/stats/index.html b/sca-cpp/trunk/hosting/server/htdocs/stats/index.html
index 81f06c95e4..81f06c95e4 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/stats/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/stats/index.html
diff --git a/sca-cpp/trunk/modules/edit/htdocs/store/index.html b/sca-cpp/trunk/hosting/server/htdocs/store/index.html
index bcb3ba7c85..bcb3ba7c85 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/store/index.html
+++ b/sca-cpp/trunk/hosting/server/htdocs/store/index.html
diff --git a/sca-cpp/trunk/modules/edit/log.py b/sca-cpp/trunk/hosting/server/log.py
index 8aa3d3bd30..8aa3d3bd30 100644
--- a/sca-cpp/trunk/modules/edit/log.py
+++ b/sca-cpp/trunk/hosting/server/log.py
diff --git a/sca-cpp/trunk/modules/edit/mkapplinks b/sca-cpp/trunk/hosting/server/mkapplinks
index a68a2896ec..a68a2896ec 100755
--- a/sca-cpp/trunk/modules/edit/mkapplinks
+++ b/sca-cpp/trunk/hosting/server/mkapplinks
diff --git a/sca-cpp/trunk/modules/edit/pages.py b/sca-cpp/trunk/hosting/server/pages.py
index 99392aeeef..a1ec888a0f 100644
--- a/sca-cpp/trunk/modules/edit/pages.py
+++ b/sca-cpp/trunk/hosting/server/pages.py
@@ -20,7 +20,7 @@ from util import *
# Convert an id to an app id
def appid(id):
- return ("'" + car(id), "'htdocs", "'app.html")
+ return ("'apps", "'" + car(id), "'htdocs", "'app.html")
# Put an app page into the apps db
def put(id, app, cache):
diff --git a/sca-cpp/trunk/modules/edit/palettes.py b/sca-cpp/trunk/hosting/server/palettes.py
index 5cb303e053..378f4da18f 100644
--- a/sca-cpp/trunk/modules/edit/palettes.py
+++ b/sca-cpp/trunk/hosting/server/palettes.py
@@ -20,7 +20,7 @@ from util import *
# Convert an id to a palette id
def paletteid(id):
- return ("'" + car(id), "'palette.composite")
+ return ("'palettes", "'" + car(id), "'palette.composite")
# Put a palette into the palettes db
def put(id, palette, cache):
diff --git a/sca-cpp/trunk/hosting/server/selector.py b/sca-cpp/trunk/hosting/server/selector.py
new file mode 100644
index 0000000000..84ade136ba
--- /dev/null
+++ b/sca-cpp/trunk/hosting/server/selector.py
@@ -0,0 +1,28 @@
+# 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.
+
+# App composites collection implementation
+from util import *
+
+# Get the database to use for a particular key
+def get(id, db1, db2):
+ if isNil(id):
+ return db1
+ if cadr(id)[0:1].lower() < 'm':
+ return db1
+ return db2
+
diff --git a/sca-cpp/trunk/modules/edit/edit.composite b/sca-cpp/trunk/hosting/server/server.composite
index 0e348fd105..d79ec3b584 100644
--- a/sca-cpp/trunk/modules/edit/edit.composite
+++ b/sca-cpp/trunk/hosting/server/server.composite
@@ -18,8 +18,8 @@
* under the License.
-->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://edit"
- name="edit">
+ targetNamespace="http://server"
+ name="server">
<component name="User">
<implementation.python script="user.py"/>
@@ -61,7 +61,7 @@
<binding.http uri="accounts"/>
</service>
<reference name="user" target="User"/>
- <reference name="cache" target="AccountCache"/>
+ <reference name="cache" target="Cache"/>
</component>
<component name="Dashboards">
@@ -70,7 +70,7 @@
<binding.http uri="dashboards"/>
</service>
<reference name="user" target="User"/>
- <reference name="cache" target="DashboardCache"/>
+ <reference name="cache" target="Cache"/>
<reference name="apps" target="Apps"/>
</component>
@@ -79,7 +79,7 @@
<service name="AppStore">
<binding.http uri="appstore"/>
</service>
- <reference name="cache" target="StoreCache"/>
+ <reference name="cache" target="Cache"/>
</component>
<component name="Apps">
@@ -87,7 +87,7 @@
<service name="Apps">
<binding.http uri="apps"/>
</service>
- <reference name="cache" target="AppCache"/>
+ <reference name="cache" target="Cache"/>
<reference name="store" target="AppStore"/>
<reference name="composites" target="Composites"/>
<reference name="pages" target="Pages"/>
@@ -98,7 +98,7 @@
<service name="Composites">
<binding.http uri="composites"/>
</service>
- <reference name="cache" target="AppDocCache"/>
+ <reference name="cache" target="Doccache"/>
</component>
<component name="Pages">
@@ -106,7 +106,7 @@
<service name="Pages">
<binding.http uri="pages"/>
</service>
- <reference name="cache" target="AppDocCache"/>
+ <reference name="cache" target="Doccache"/>
</component>
<component name="Palettes">
@@ -114,157 +114,57 @@
<service name="Palettes">
<binding.http uri="palettes"/>
</service>
- <reference name="cache" target="PaletteDocCache"/>
+ <reference name="cache" target="Doccache"/>
</component>
- <component name="AccountCache">
+ <component name="Cache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="AccountCache">
- <binding.http uri="accountcache"/>
+ <service name="Cache">
+ <binding.http uri="cache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="AccountDB"/>
- <reference name="l2writer" target="AccountDB"/>
+ <reference name="l2reader" target="Database"/>
+ <reference name="l2writer" target="Database"/>
</component>
- <component name="AccountDB">
- <implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">accounts</property>
- <property name="format">scheme</property>
- <service name="AccountDB">
- <binding.http uri="accountdb"/>
- </service>
- </component>
-
- <component name="DashboardCache">
+ <component name="Doccache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="DashboardCache">
- <binding.http uri="dashboardcache"/>
+ <service name="Doccache">
+ <binding.http uri="doccache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="DashboardDB"/>
- <reference name="l2writer" target="DashboardDB"/>
+ <reference name="l2reader" target="Documents"/>
+ <reference name="l2writer" target="Documents"/>
</component>
- <component name="DashboardDB">
- <implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">dashboards</property>
- <property name="format">scheme</property>
- <service name="DashboardDB">
- <binding.http uri="dashboarddb"/>
- </service>
- </component>
-
- <component name="StoreCache">
- <implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="StoreCache">
- <binding.http uri="storecache"/>
+ <component name="Memcache">
+ <implementation.cpp path="../../components/cache" library="libmemcache"/>
+ <service name="Memcache">
+ <binding.http uri="memcache"/>
</service>
- <reference name="l1reader" target="Memcache"/>
- <reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="StoreDB"/>
- <reference name="l2writer" target="StoreDB"/>
+ <property name="servers">localhost:11211</property>
</component>
- <component name="StoreDB">
+ <component name="Database">
<implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">store</property>
+ <property name="dbname">data</property>
<property name="format">scheme</property>
- <service name="StoreDB">
- <binding.http uri="storedb"/>
- </service>
- </component>
-
- <component name="AppCache">
- <implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="AppCache">
- <binding.http uri="appcache"/>
+ <service name="Database">
+ <binding.http uri="database"/>
</service>
- <reference name="l1reader" target="Memcache"/>
- <reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="AppDB"/>
- <reference name="l2writer" target="AppDB"/>
</component>
- <component name="AppDB">
+ <component name="Documents">
<implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">apps</property>
- <property name="format">scheme</property>
- <service name="AppDB">
- <binding.http uri="appdb"/>
- </service>
- </component>
-
- <component name="AppDocCache">
- <implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="AppDocCache">
- <binding.http uri="appdoccache"/>
- </service>
- <reference name="l1reader" target="Memcache"/>
- <reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="AppDocDB"/>
- <reference name="l2writer" target="AppDocDB"/>
- </component>
-
- <component name="AppDocDB">
- <implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">apps</property>
- <property name="format">xml</property>
- <service name="AppDocDB">
- <binding.http uri="appdocdb"/>
- </service>
- </component>
-
- <component name="PaletteDocCache">
- <implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="PaletteDocCache">
- <binding.http uri="palettedoccache"/>
- </service>
- <reference name="l1reader" target="Memcache"/>
- <reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="PaletteDocDB"/>
- <reference name="l2writer" target="PaletteDocDB"/>
- </component>
-
- <component name="PaletteDocDB">
- <implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">palettes</property>
+ <property name="dbname">data</property>
<property name="format">xml</property>
- <service name="PaletteDocDB">
- <binding.http uri="palettedocdb"/>
- </service>
- </component>
-
- <component name="AppDataFileCache">
- <implementation.cpp path="../../components/cache" library="libdatacache"/>
- <service name="AppDataFileCache">
- <binding.http uri="appdatafilecache"/>
- </service>
- <reference name="l1reader" target="Memcache"/>
- <reference name="l1writer" target="Memcache"/>
- <reference name="l2reader" target="AppDataFileDB"/>
- <reference name="l2writer" target="AppDataFileDB"/>
- </component>
-
- <component name="AppDataFileDB">
- <implementation.cpp path="../../components/filedb" library="libfiledb"/>
- <property name="dbname">tmp/appdata/filedb</property>
- <property name="format">scheme</property>
- <service name="AppDataFileDB">
- <binding.http uri="appdatafiledb"/>
+ <service name="Documents">
+ <binding.http uri="documents"/>
</service>
</component>
- <component name="Memcache">
- <implementation.cpp path="../../components/cache" library="libmemcache"/>
- <service name="Memcache">
- <binding.http uri="memcache"/>
- </service>
- <property name="servers">localhost:11211</property>
- </component>
-
<component name="Log">
<implementation.python script="log.py"/>
<service name="Log">
diff --git a/sca-cpp/trunk/modules/edit/ssl-start b/sca-cpp/trunk/hosting/server/ssl-start
index fdc5a8b8dc..9be614fa8e 100755
--- a/sca-cpp/trunk/modules/edit/ssl-start
+++ b/sca-cpp/trunk/hosting/server/ssl-start
@@ -17,15 +17,15 @@
# specific language governing permissions and limitations
# under the License.
-# For this module to work, add the sca-store.com domain to your /etc/hosts as follows:
-# 127.0.0.1 sca-store.com
+# For this module to work, add the example.com domain to your /etc/hosts as follows:
+# 127.0.0.1 example.com
here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
-jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python`
+jsprefix=`echo "import os; print os.path.realpath('$here/../../modules/js')" | python`
# Create SSL certificates
-../../modules/http/ssl-ca-conf tmp sca-store.com
-../../modules/http/ssl-cert-conf tmp sca-store.com server
+../../modules/http/ssl-ca-conf tmp example.com
+../../modules/http/ssl-cert-conf tmp example.com server
# Configure and start logging
if [ -x ../../components/log/scribe-cat ]; then
@@ -40,7 +40,7 @@ fi
../../components/cache/memcached-start tmp 11212
# Configure server
-../../modules/http/httpd-conf tmp sca-store.com 8090 htdocs
+../../modules/http/httpd-conf tmp example.com 8090 htdocs
../../modules/http/httpd-event-conf tmp
../../modules/http/httpd-ssl-conf tmp 8453
@@ -66,8 +66,8 @@ fi
#../../modules/http/group-auth-conf tmp jane
#../../modules/http/group-auth-conf tmp admin
# Configure the email addresses associated with your OpenID and OAuth ids here
-../../modules/http/group-auth-conf tmp john@sca-store.com
-../../modules/http/group-auth-conf tmp jane@sca-store.com
+../../modules/http/group-auth-conf tmp john@example.com
+../../modules/http/group-auth-conf tmp jane@example.com
# Configure mod-security
../../modules/http/mod-security-conf tmp
@@ -80,6 +80,7 @@ fi
if [ -x ../../components/log/scribe-cat ]; then
cat >tmp/conf/log.conf <<EOF
# Generated by: ssl-start $*
+LogLevel notice
ErrorLog "|$here/../../components/log/scribe-cat server"
CustomLog "|$here/../../components/log/scribe-cat server" combined
@@ -97,6 +98,27 @@ SecAuditLog "|$here/../../components/log/scribe-cat secaudit"
EOF
+else
+ cat >tmp/conf/log.conf <<EOF
+# Generated by: ssl=start $*
+LogLevel debug
+ErrorLog $here/tmp/logs/error_log
+CustomLog $here/tmp/logs/access_log combined
+
+EOF
+
+ cat >tmp/conf/log-ssl.conf <<EOF
+# Generated by: ssl-start $*
+CustomLog $here/tmp/logs/ssl_access_log sslcombined
+
+EOF
+
+ cat >tmp/conf/mod-security-log.conf <<EOF
+# Generated by: ssl-start $*
+SecAuditLog $here/tmp/logs/secaudit_log secaudit
+
+EOF
+
fi
# Configure certificate mime type
@@ -124,11 +146,11 @@ EOF
cat >>tmp/conf/httpd.conf <<EOF
# Generated by: ssl-start $*
# Configure SCA Composite
-SCAContribution `pwd`/
-SCAComposite edit.composite
+SCAContribution $here/
+SCAComposite server.composite
# Configure SCA Composite for mass dynamic virtual Hosting
-SCAVirtualContribution `pwd`/apps/
+SCAVirtualContribution $here/apps/
SCAVirtualComposite app.composite
EOF
@@ -142,29 +164,16 @@ Alias /home/home.b64 $here/htdocs/home/home.b64
EOF
# Create app resource links
-./mkapplinks . ../../../.. ../../../../../nuvem
+./mkapplinks data ../../../../.. ../../../../../../nuvem
# Configure app resource aliases
cat >>tmp/conf/svhost-ssl.conf <<EOF
# Generated by: ssl-start $*
-<Location /v>
-RewriteEngine on
-
# Map /v/<app-name>/<path> to htdocs/app/<path>
-RewriteCond %{REQUEST_URI} ^/v/.+/.*$
-RewriteRule /v/(.+)/(.*)$ $here/htdocs/app/\$2 [L]
-
-# Redirect /v/<app-name> to /<app-name>/
-RewriteCond %{REQUEST_URI} ^/v/[^/]+$
-RewriteRule /v/([^/]+)$ /\$1/ [L,R]
-
-</Location>
+AliasMatch /v/([^/]+)(.*)$ $here/htdocs/app\$2
EOF
-# Create application database directories
-mkdir -p tmp/appdata/filedb
-
# Start server
../../modules/http/httpd-start tmp
diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/hosting/server/start
index a6c417bbb1..da0dcecf40 100755
--- a/sca-cpp/trunk/modules/edit/start
+++ b/sca-cpp/trunk/hosting/server/start
@@ -17,11 +17,11 @@
# specific language governing permissions and limitations
# under the License.
-# For this module to work, add the sca-store.com domain to your /etc/hosts as follows:
-# 127.0.0.1 sca-store.com
+# For this module to work, add the example.com domain to your /etc/hosts as follows:
+# 127.0.0.1 example.com
here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
-jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python`
+jsprefix=`echo "import os; print os.path.realpath('$here/../../modules/js')" | python`
# Configure and start logging
if [ -x ../../components/log/scribe-cat ]; then
@@ -36,17 +36,18 @@ fi
../../components/cache/memcached-start tmp 11212
# Configure server
-../../modules/http/httpd-conf tmp sca-store.com 8090 htdocs
+../../modules/http/httpd-conf tmp example.com 8090 htdocs
../../modules/http/httpd-event-conf tmp
# Configure Python component support
-../server/server-conf tmp
-../python/python-conf tmp
+../../modules/server/server-conf tmp
+../../modules/python/python-conf tmp
# Configure server log streaming
if [ -x ../../components/log/scribe-cat ]; then
cat >tmp/conf/log.conf <<EOF
# Generated by: start $*
+LogLevel notice
ErrorLog "|$here/../../components/log/scribe-cat server"
CustomLog "|$here/../../components/log/scribe-cat server" combined
@@ -58,6 +59,21 @@ CustomLog "|$here/../../components/log/scribe-cat server" sslcombined
EOF
+else
+ cat >tmp/conf/log.conf <<EOF
+# Generated by: start $*
+LogLevel debug
+ErrorLog $here/tmp/logs/error_log
+CustomLog $here/tmp/logs/access_log combined
+
+EOF
+
+ cat >tmp/conf/log-ssl.conf <<EOF
+# Generated by: start $*
+CustomLog $here/tmp/logs/ssl_access_log sslcombined
+
+EOF
+
fi
# Configure error pages
@@ -75,11 +91,11 @@ EOF
cat >>tmp/conf/httpd.conf <<EOF
# Generated by: start $*
# Configure SCA Composite
-SCAContribution `pwd`/
-SCAComposite edit.composite
+SCAContribution $here/
+SCAComposite server.composite
# Configure SCA Composite for mass dynamic virtual Hosting
-SCAVirtualContribution `pwd`/apps/
+SCAVirtualContribution $here/data/apps/
SCAVirtualComposite app.composite
EOF
@@ -93,29 +109,16 @@ Alias /home/home.b64 $here/htdocs/home/home.b64
EOF
# Create app resource links
-./mkapplinks . ../../../.. ../../../../../nuvem
+./mkapplinks data ../../../../.. ../../../../../../nuvem
# Configure app resource aliases
cat >>tmp/conf/svhost.conf <<EOF
# Generated by: start $*
-<Location /v>
-RewriteEngine on
-
# Map /v/<app-name>/<path> to htdocs/app/<path>
-RewriteCond %{REQUEST_URI} ^/v/.+/.*$
-RewriteRule /v/(.+)/(.*)$ $here/htdocs/app/\$2 [L]
-
-# Redirect /v/<app-name> to /<app-name>/
-RewriteCond %{REQUEST_URI} ^/v/[^/]+$
-RewriteRule /v/([^/]+)$ /\$1/ [L,R]
-
-</Location>
+AliasMatch /v/([^/]+)(.*)$ $here/htdocs/app\$2
EOF
-# Create application database directories
-mkdir -p tmp/appdata/filedb
-
# Start server
../../modules/http/httpd-start tmp
diff --git a/sca-cpp/trunk/modules/edit/stop b/sca-cpp/trunk/hosting/server/stop
index e1fd92705c..e1fd92705c 100755
--- a/sca-cpp/trunk/modules/edit/stop
+++ b/sca-cpp/trunk/hosting/server/stop
diff --git a/sca-cpp/trunk/modules/edit/store.py b/sca-cpp/trunk/hosting/server/store.py
index 79750975a5..014c07050e 100644
--- a/sca-cpp/trunk/modules/edit/store.py
+++ b/sca-cpp/trunk/hosting/server/store.py
@@ -20,7 +20,7 @@ from util import *
# Convert a particular store tag to a store id
def storeid(tag):
- return ("'" + tag, "'store.apps")
+ return ("'store", "'" + tag, "'store.apps")
# Get a store from the cache
def getstore(id, cache):
diff --git a/sca-cpp/trunk/modules/edit/user.py b/sca-cpp/trunk/hosting/server/user.py
index 227722ac48..227722ac48 100644
--- a/sca-cpp/trunk/modules/edit/user.py
+++ b/sca-cpp/trunk/hosting/server/user.py
diff --git a/sca-cpp/trunk/modules/edit/util.py b/sca-cpp/trunk/hosting/server/util.py
index 24467fd2cb..24467fd2cb 100644
--- a/sca-cpp/trunk/modules/edit/util.py
+++ b/sca-cpp/trunk/hosting/server/util.py
diff --git a/sca-cpp/trunk/modules/Makefile.am b/sca-cpp/trunk/modules/Makefile.am
index f4195dc7e8..16fe2791f7 100644
--- a/sca-cpp/trunk/modules/Makefile.am
+++ b/sca-cpp/trunk/modules/Makefile.am
@@ -15,5 +15,5 @@
# specific language governing permissions and limitations
# under the License.
-SUBDIRS = scheme atom rss js json scdl http server python opencl java openid oauth wsgi edit
+SUBDIRS = scheme atom rss js json scdl http server python opencl java openid oauth wsgi
diff --git a/sca-cpp/trunk/modules/http/http-test b/sca-cpp/trunk/modules/http/http-test
index 7874a1037f..73cfe700a6 100755
--- a/sca-cpp/trunk/modules/http/http-test
+++ b/sca-cpp/trunk/modules/http/http-test
@@ -24,7 +24,7 @@
sleep 2
# Test
-./curl-test
+./curl-test 2>/dev/null
rc=$?
# Cleanup
diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp
index f4e3767881..7c839c1306 100644
--- a/sca-cpp/trunk/modules/http/httpd.hpp
+++ b/sca-cpp/trunk/modules/http/httpd.hpp
@@ -205,7 +205,7 @@ const string serverName(request_rec* r, const string& def = "localhost") {
/**
* Return true if a request is targeting a virtual host.
*/
-const bool isVirtualHostRequest(const server_rec* s, const string& d, request_rec* r) {
+const bool isVhostRequest(const server_rec* s, const string& d, request_rec* r) {
const string rh = hostName(r);
return rh != hostName(s) && http::topDomain(rh) == d;
}
diff --git a/sca-cpp/trunk/modules/http/proxy-test b/sca-cpp/trunk/modules/http/proxy-test
index bf4e2bf460..9f3d248fdf 100755
--- a/sca-cpp/trunk/modules/http/proxy-test
+++ b/sca-cpp/trunk/modules/http/proxy-test
@@ -29,7 +29,7 @@
sleep 2
# Test
-./curl-test
+./curl-test 2>/dev/null
rc=$?
# Cleanup
diff --git a/sca-cpp/trunk/modules/server/Makefile.am b/sca-cpp/trunk/modules/server/Makefile.am
index edc0dfb251..e2fd67d9b8 100644
--- a/sca-cpp/trunk/modules/server/Makefile.am
+++ b/sca-cpp/trunk/modules/server/Makefile.am
@@ -25,19 +25,14 @@ moddir = $(prefix)/modules/server
EXTRA_DIST = domain-test.composite client-test.scm server-test.scm htdocs/*.html htdocs/test/*.xml htdocs/test/*.txt
-mod_LTLIBRARIES = libmod_tuscany_eval.la libmod_tuscany_wiring.la
-noinst_DATA = libmod_tuscany_eval${libsuffix} libmod_tuscany_wiring${libsuffix}
+mod_LTLIBRARIES = libmod_tuscany_eval.la
+noinst_DATA = libmod_tuscany_eval${libsuffix}
libmod_tuscany_eval_la_SOURCES = mod-eval.cpp
libmod_tuscany_eval_la_LDFLAGS = -lxml2 -lcurl -lmozjs
libmod_tuscany_eval${libsuffix}:
ln -s .libs/libmod_tuscany_eval${libsuffix}
-libmod_tuscany_wiring_la_SOURCES = mod-wiring.cpp
-libmod_tuscany_wiring_la_LDFLAGS = -lxml2 -lcurl -lmozjs
-libmod_tuscany_wiring${libsuffix}:
- ln -s .libs/libmod_tuscany_wiring${libsuffix}
-
noinst_test_LTLIBRARIES = libimpl-test.la
noinst_testdir = `pwd`/tmp
noinst_DATA += libimpl-test${libsuffix}
diff --git a/sca-cpp/trunk/modules/server/client-test.cpp b/sca-cpp/trunk/modules/server/client-test.cpp
index 5de7ab6e7b..3f5ff20c56 100644
--- a/sca-cpp/trunk/modules/server/client-test.cpp
+++ b/sca-cpp/trunk/modules/server/client-test.cpp
@@ -29,7 +29,7 @@
int main() {
tuscany::cout << "Testing..." << tuscany::endl;
- tuscany::server::testURI = "http://localhost:8090/test";
+ tuscany::server::testURI = "http://localhost:8090/scheme";
tuscany::server::testServer();
diff --git a/sca-cpp/trunk/modules/server/client-test.hpp b/sca-cpp/trunk/modules/server/client-test.hpp
index 50b246a073..2dab7b6dfd 100644
--- a/sca-cpp/trunk/modules/server/client-test.hpp
+++ b/sca-cpp/trunk/modules/server/client-test.hpp
@@ -36,7 +36,7 @@
namespace tuscany {
namespace server {
-string testURI = "http://localhost:8090/test";
+string testURI = "http://localhost:8090/scheme";
bool testBlobs = true;
ostream* curlWriter(const string& s, ostream* os) {
diff --git a/sca-cpp/trunk/modules/server/domain-test.composite b/sca-cpp/trunk/modules/server/domain-test.composite
index b003dd15cd..1819b3bf4c 100644
--- a/sca-cpp/trunk/modules/server/domain-test.composite
+++ b/sca-cpp/trunk/modules/server/domain-test.composite
@@ -23,8 +23,8 @@
<component name="scheme-test">
<implementation.scheme script="server-test.scm"/>
- <service name="test">
- <binding.http uri="test"/>
+ <service name="scheme">
+ <binding.http uri="scheme"/>
</service>
</component>
diff --git a/sca-cpp/trunk/modules/server/httpd-test b/sca-cpp/trunk/modules/server/httpd-test
index d541c145e9..63b268d7b3 100755
--- a/sca-cpp/trunk/modules/server/httpd-test
+++ b/sca-cpp/trunk/modules/server/httpd-test
@@ -41,31 +41,31 @@ rc=$?
# Test ATOMPub
if [ "$rc" = "0" ]; then
- $curl_prefix/bin/curl http://localhost:8090/test/ >tmp/feed.xml 2>/dev/null
+ $curl_prefix/bin/curl http://localhost:8090/scheme/ >tmp/feed.xml 2>/dev/null
diff tmp/feed.xml htdocs/test/feed.xml
rc=$?
fi
if [ "$rc" = "0" ]; then
- $curl_prefix/bin/curl http://localhost:8090/test/111 >tmp/entry.xml 2>/dev/null
+ $curl_prefix/bin/curl http://localhost:8090/scheme/111 >tmp/entry.xml 2>/dev/null
diff tmp/entry.xml htdocs/test/entry.xml
rc=$?
fi
if [ "$rc" = "0" ]; then
- $curl_prefix/bin/curl http://localhost:8090/test/ -X POST -H "Content-type: application/atom+xml" --data @htdocs/test/entry.xml 2>/dev/null
+ $curl_prefix/bin/curl http://localhost:8090/scheme/ -X POST -H "Content-type: application/atom+xml" --data @htdocs/test/entry.xml 2>/dev/null
rc=$?
fi
if [ "$rc" = "0" ]; then
- $curl_prefix/bin/curl http://localhost:8090/test/111 -X PUT -H "Content-type: application/atom+xml" --data @htdocs/test/entry.xml 2>/dev/null
+ $curl_prefix/bin/curl http://localhost:8090/scheme/111 -X PUT -H "Content-type: application/atom+xml" --data @htdocs/test/entry.xml 2>/dev/null
rc=$?
fi
if [ "$rc" = "0" ]; then
- $curl_prefix/bin/curl http://localhost:8090/test/111 -X DELETE 2>/dev/null
+ $curl_prefix/bin/curl http://localhost:8090/scheme/111 -X DELETE 2>/dev/null
rc=$?
fi
# Test JSON-RPC
if [ "$rc" = "0" ]; then
- $curl_prefix/bin/curl http://localhost:8090/test/ -X POST -H "Content-type: application/json-rpc" --data @htdocs/test/json-request.txt >tmp/json-result.txt 2>/dev/null
+ $curl_prefix/bin/curl http://localhost:8090/scheme/ -X POST -H "Content-type: application/json-rpc" --data @htdocs/test/json-request.txt >tmp/json-result.txt 2>/dev/null
diff tmp/json-result.txt htdocs/test/json-result.txt
rc=$?
fi
diff --git a/sca-cpp/trunk/modules/server/mod-eval.hpp b/sca-cpp/trunk/modules/server/mod-eval.hpp
index 62d91c6236..999a5793ad 100644
--- a/sca-cpp/trunk/modules/server/mod-eval.hpp
+++ b/sca-cpp/trunk/modules/server/mod-eval.hpp
@@ -52,50 +52,61 @@ namespace server {
namespace modeval {
/**
+ * Set to true to wire using mod_proxy, false to wire using HTTP client redirects.
+ */
+const bool useModProxy = true;
+
+/**
* Server configuration.
*/
class ServerConf {
public:
- ServerConf(apr_pool_t* p, server_rec* s) : p(p), server(s), contributionPath(""), compositeName(""), virtualHostDomain(""), virtualHostContributionPath(""), virtualHostCompositeName(""), ca(""), cert(""), key("") {
+ ServerConf(apr_pool_t* p, server_rec* s) : p(p), server(s) {
}
- ServerConf(apr_pool_t* p, const ServerConf& ssc, const string& name) : p(p), server(ssc.server), lifecycle(ssc.lifecycle), contributionPath(ssc.virtualHostContributionPath + name + "/"), compositeName(ssc.virtualHostCompositeName), virtualHostDomain(""), virtualHostContributionPath(""), virtualHostCompositeName(""), ca(ssc.ca), cert(ssc.cert), key(ssc.key) {
+ ServerConf(apr_pool_t* p, const ServerConf& ssc, const string& name) : p(p), server(ssc.server), lifecycle(ssc.lifecycle), vhostName(name), compositeName(ssc.vhostCompositeName), ca(ssc.ca), cert(ssc.cert), key(ssc.key), vhostContributor(ssc.vhostContributor) {
+ contributionPath = length(ssc.vhostContributionPath) != 0? ssc.vhostContributionPath + name + "/" : ssc.contributionPath;
}
const gc_pool p;
server_rec* server;
lambda<value(const list<value>&)> lifecycle;
+ string vhostName;
string contributionPath;
string compositeName;
- string virtualHostDomain;
- string virtualHostContributionPath;
- string virtualHostCompositeName;
+ string vhostDomain;
+ string vhostContributionPath;
+ string vhostCompositeName;
+ string vhostContributorName;
string ca;
string cert;
string key;
+ list<value> references;
+ list<value> services;
list<value> implementations;
list<value> implTree;
+ value vhostContributor;
};
/**
- * Return true if a server contains a composite configuration.
+ * Return true if a server contains a contribution configuration.
*/
-const bool hasCompositeConf(const ServerConf& sc) {
- return sc.contributionPath != "" && sc.compositeName != "";
+const bool hasContributionConf(const ServerConf& sc) {
+ return length(sc.contributionPath) != 0;
}
/**
* Return true if a server contains a virtual host domain configuration.
*/
-const bool hasVirtualDomainConf(const ServerConf& sc) {
- return sc.virtualHostDomain != "";
+const bool hasVhostDomainConf(const ServerConf& sc) {
+ return length(sc.vhostDomain) != 0;
}
/**
- * Return true if a server contains a virtual host composite configuration.
+ * Return true if a server contains a virtual host contribution configuration.
*/
-const bool hasVirtualCompositeConf(const ServerConf& sc) {
- return sc.virtualHostContributionPath != "" && sc.virtualHostCompositeName != "";
+const bool hasVhostContributionConf(const ServerConf& sc) {
+ return length(sc.vhostContributionPath) != 0 || length(sc.vhostContributorName) != 0;
}
/**
@@ -129,262 +140,6 @@ public:
};
/**
- * Handle an HTTP GET.
- */
-const failable<int> get(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
- debug(r->uri, "modeval::get::uri");
-
- // Inspect the query string
- const list<list<value> > args = httpd::queryArgs(r);
- const list<value> ia = assoc(value("id"), args);
- const list<value> ma = assoc(value("method"), args);
-
- // Evaluate a JSON-RPC request and return a JSON result
- if (!isNil(ia) && !isNil(ma)) {
-
- // Extract the request id, method and params
- const value id = cadr(ia);
- const value func = c_str(json::funcName(string(cadr(ma))));
-
- // Apply the requested function
- const failable<value> val = failableResult(impl(cons(func, json::queryParams(args))));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
-
- // Return JSON result
- js::JSContext cx;
- return httpd::writeResult(json::jsonResult(id, content(val), cx), "application/json-rpc; charset=utf-8", r);
- }
-
- // Evaluate the GET expression
- const list<value> params(append<value>(cddr(rpath), mkvalues(args)));
- const failable<value> val = failableResult(impl(cons<value>("get", mklist<value>(params))));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
- const value c = content(val);
- debug(c, "modeval::get::content");
-
- // Check if the client requested a specific format
- const list<value> fmt = assoc<value>("format", args);
-
- // Write as a scheme value if requested by the client
- if (!isNil(fmt) && cadr(fmt) == "scheme")
- return httpd::writeResult(mklist<string>(scheme::writeValue(c)), "text/plain; charset=utf-8", r);
-
- // Write a simple value as a JSON value
- if (!isList(c)) {
- js::JSContext cx;
- if (isSymbol(c)) {
- const list<value> lc = mklist<value>(mklist<value>("name", value(string(c))));
- debug(lc, "modeval::get::symbol");
- return httpd::writeResult(json::writeJSON(valuesToElements(lc), cx), "application/json; charset=utf-8", r);
- }
- const list<value> lc = mklist<value>(mklist<value>("value", c));
- debug(lc, "modeval::get::value");
- return httpd::writeResult(json::writeJSON(valuesToElements(lc), cx), "application/json; charset=utf-8", r);
- }
-
- // Write an empty list as a JSON empty value
- if (isNil((list<value>)c)) {
- js::JSContext cx;
- debug(list<value>(), "modeval::get::empty");
- return httpd::writeResult(json::writeJSON(list<value>(), cx), "application/json; charset=utf-8", r);
- }
-
- // Write content-type / content-list pair
- if (isString(car<value>(c)) && !isNil(cdr<value>(c)) && isList(cadr<value>(c)))
- return httpd::writeResult(convertValues<string>(cadr<value>(c)), car<value>(c), r);
-
- // Write an assoc value as a JSON result
- if (isSymbol(car<value>(c)) && !isNil(cdr<value>(c))) {
- js::JSContext cx;
- const list<value> lc = mklist<value>(c);
- debug(lc, "modeval::get::assoc");
- debug(valuesToElements(lc), "modeval::get::assoc::element");
- return httpd::writeResult(json::writeJSON(valuesToElements(lc), cx), "application/json; charset=utf-8", r);
- }
-
- // Write value as JSON if requested by the client
- if (!isNil(fmt) && cadr(fmt) == "json") {
- js::JSContext cx;
- return httpd::writeResult(json::writeJSON(valuesToElements(c), cx), "application/json; charset=utf-8", r);
- }
-
- // Convert list of values to element values
- const list<value> e = valuesToElements(c);
- debug(e, "modeval::get::elements");
-
- // Write an ATOM feed or entry
- if (isList(car<value>(e)) && !isNil(car<value>(e))) {
- const list<value> el = car<value>(e);
- if (isSymbol(car<value>(el)) && car<value>(el) == element && !isNil(cdr<value>(el)) && isSymbol(cadr<value>(el)) && elementHasChildren(el) && !elementHasValue(el)) {
- if (cadr<value>(el) == atom::feed)
- 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; 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; charset=utf-8", r);
-}
-
-/**
- * Handle an HTTP POST.
- */
-const failable<int> post(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
- debug(r->uri, "modeval::post::url");
-
- // Evaluate a JSON-RPC request and return a JSON result
- const string ct = httpd::contentType(r);
- if (contains(ct, "application/json-rpc") || contains(ct, "text/plain") || contains(ct, "application/x-www-form-urlencoded")) {
-
- // Read the JSON request
- const int rc = httpd::setupReadPolicy(r);
- if(rc != OK)
- return rc;
- const list<string> ls = httpd::read(r);
- debug(ls, "modeval::post::input");
- js::JSContext cx;
- const list<value> json = elementsToValues(content(json::readJSON(ls, cx)));
- const list<list<value> > args = httpd::postArgs(json);
-
- // Extract the request id, method and params
- const value id = cadr(assoc(value("id"), args));
- const value func = c_str(json::funcName(cadr(assoc(value("method"), args))));
- const list<value> params = (list<value>)cadr(assoc(value("params"), args));
-
- // Evaluate the request expression
- const failable<value> val = failableResult(impl(cons<value>(func, params)));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
-
- // Return JSON result
- 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
- if (contains(ct, "application/atom+xml")) {
-
- // Read the ATOM entry
- const int rc = httpd::setupReadPolicy(r);
- if(rc != OK)
- return rc;
- const list<string> ls = httpd::read(r);
- debug(ls, "modeval::post::input");
- const value entry = elementsToValues(content(atom::readATOMEntry(ls)));
-
- // Evaluate the POST expression
- const failable<value> val = failableResult(impl(cons<value>("post", mklist<value>(cddr(rpath), entry))));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
-
- // Return the created resource location
- debug(content(val), "modeval::post::location");
- apr_table_setn(r->headers_out, "Location", apr_pstrdup(r->pool, c_str(httpd::url(r->uri, content(val), r))));
- r->status = HTTP_CREATED;
- return OK;
- }
-
- // Unknown content type, wrap the HTTP request struct in a value and pass it to
- // the component implementation function
- const failable<value> val = failableResult(impl(cons<value>("handle", mklist<value>(httpd::requestValue(r)))));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
- return (int)content(val);
-}
-
-/**
- * Handle an HTTP PUT.
- */
-const failable<int> put(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
- debug(r->uri, "modeval::put::url");
-
- // Read the ATOM entry
- const int rc = httpd::setupReadPolicy(r);
- if(rc != OK)
- return rc;
- const list<string> ls = httpd::read(r);
- debug(ls, "modeval::put::input");
- const value entry = elementsToValues(content(atom::readATOMEntry(ls)));
-
- // Evaluate the PUT expression and update the corresponding resource
- const failable<value> val = failableResult(impl(cons<value>("put", mklist<value>(cddr(rpath), entry))));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
- if (val == value(false))
- return HTTP_NOT_FOUND;
- return OK;
-}
-
-/**
- * Handle an HTTP DELETE.
- */
-const failable<int> del(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
- debug(r->uri, "modeval::delete::url");
-
- // Evaluate an ATOM delete request
- const failable<value> val = failableResult(impl(cons<value>("delete", mklist<value>(cddr(rpath)))));
- if (!hasContent(val))
- return mkfailure<int>(reason(val));
- if (val == value(false))
- return HTTP_NOT_FOUND;
- return OK;
-}
-
-/**
- * Translate a component request.
- */
-const int translateRequest(const ServerConf& sc, const list<value>& rpath, request_rec *r) {
- debug(rpath, "modeval::translateRequest::path");
- if (isNil(rpath))
- return DECLINED;
-
- // Translate a component request
- const value c = car(rpath);
- if (c == string("components") || c == string("c")) {
- r->handler = "mod_tuscany_eval";
- return OK;
- }
-
- // Translate a request targeting a virtual host or virtual app
- if (hasVirtualCompositeConf(sc) && !isNil(cdr(rpath))) {
- const string cp = sc.virtualHostContributionPath + string(c) + "/" + sc.virtualHostCompositeName;
- struct stat st;
- const int s = stat(c_str(cp), &st);
- if (s != -1) {
- const value d = cadr(rpath);
- if (d == string("components") || d == string("c")) {
- r->handler = "mod_tuscany_eval";
- return OK;
- }
- }
- }
-
- return DECLINED;
-}
-
-/**
- * Translate a component request.
- */
-int translate(request_rec *r) {
- if(r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE)
- return DECLINED;
-
- // Create a scoped memory pool
- gc_scoped_pool pool(r->pool);
-
- httpdDebugRequest(r, "modeval::translate::input");
-
- // Get the server configuration
- const ServerConf& sc = httpd::serverConf<ServerConf>(r, &mod_tuscany_eval);
-
- // Translate the request
- return translateRequest(sc, pathValues(r->uri), r);
-}
-
-/**
* Make an HTTP proxy lambda to a component reference.
*/
const value mkhttpProxy(const ServerConf& sc, const string& ref, const string& base) {
@@ -573,7 +328,7 @@ struct appPropProxy {
appPropProxy(const value& v) : v(v) {
}
const value operator()(unused const list<value>& params) const {
- const char* n = apr_table_get(currentRequest->headers_in, "X-Request-AppName");
+ const char* n = apr_table_get(currentRequest->notes, "X-Request-AppName");
const value a = n != NULL? value(string(n)) : v;
debug(a, "modeval::appPropProxy::value");
return a;
@@ -584,7 +339,7 @@ struct pathPropProxy {
pathPropProxy(unused const value& v) {
}
const value operator()(unused const list<value>& params) const {
- const char* u = apr_table_get(currentRequest->headers_in, "X-Request-URI");
+ const char* u = apr_table_get(currentRequest->notes, "X-Request-URI");
const value v = u != NULL? pathValues(string(u)) : list<value>();
debug(v, "modeval::pathPropProxy::value");
return v;
@@ -743,21 +498,79 @@ const failable<list<value> > applyLifecycleExpr(const list<value>& impls, const
}
/**
+ * Return a list of component-name + references pairs. The references are
+ * arranged in trees of reference-name + reference-target pairs.
+ */
+const list<value> componentReferenceToTargetTree(const value& c) {
+ return mklist<value>(scdl::name(c), mkbtree(sort(scdl::referenceToTargetAssoc(scdl::references(c)))));
+}
+
+const list<value> componentReferenceToTargetAssoc(const list<value>& c) {
+ if (isNil(c))
+ return c;
+ return cons<value>(componentReferenceToTargetTree(car(c)), componentReferenceToTargetAssoc(cdr(c)));
+}
+
+/**
+ * Return a list of service-URI-path + component-name pairs. Service-URI-paths are
+ * represented as lists of URI path fragments.
+ */
+const list<value> defaultBindingURI(const string& cn, const string& sn) {
+ return mklist<value>(cn, sn);
+}
+
+const list<value> bindingToComponentAssoc(const string& cn, const string& sn, const list<value>& b) {
+ if (isNil(b))
+ return b;
+ const value uri(scdl::uri(car(b)));
+ if (isNil(uri))
+ return cons<value>(mklist<value>(defaultBindingURI(cn, sn), cn), bindingToComponentAssoc(cn, sn, cdr(b)));
+ return cons<value>(mklist<value>(pathValues(c_str(string(uri))), cn), bindingToComponentAssoc(cn, sn, cdr(b)));
+}
+
+const list<value> serviceToComponentAssoc(const string& cn, const list<value>& s) {
+ if (isNil(s))
+ return s;
+ const string sn(scdl::name(car(s)));
+ const list<value> btoc(bindingToComponentAssoc(cn, sn, scdl::bindings(car(s))));
+ if (isNil(btoc))
+ return cons<value>(mklist<value>(defaultBindingURI(cn, sn), cn), serviceToComponentAssoc(cn, cdr(s)));
+ return append<value>(btoc, serviceToComponentAssoc(cn, cdr(s)));
+}
+
+const list<value> uriToComponentAssoc(const list<value>& c) {
+ if (isNil(c))
+ return c;
+ return append<value>(serviceToComponentAssoc(scdl::name(car(c)), scdl::services(car(c))), uriToComponentAssoc(cdr(c)));
+}
+
+/**
* Configure the components declared in the deployed composite.
*/
const failable<bool> confComponents(ServerConf& sc) {
- if (!hasCompositeConf(sc))
+ if (!hasContributionConf(sc))
return false;
debug(sc.contributionPath, "modeval::confComponents::contributionPath");
+ debug(sc.contributionPath, "modeval::confComponents::contributorName");
debug(sc.compositeName, "modeval::confComponents::compositeName");
if (sc.ca != "") debug(sc.ca, "modeval::confComponents::sslCA");
if (sc.cert != "") debug(sc.cert, "modeval::confComponents::sslCert");
if (sc.key != "") debug(sc.key, "modeval::confComponents::sslKey");
- // Read the components and get their implementation lambda functions
+ // Read the components and get their services, references and implementation
+ // lambda functions
const failable<list<value> > comps = readComponents(scdl::resourcePath(sc.contributionPath, sc.compositeName));
if (!hasContent(comps))
return mkfailure<bool>(reason(comps));
+
+ const list<value> refs = componentReferenceToTargetAssoc(content(comps));
+ debug(refs, "modeval::confComponents::references");
+ sc.references = mkbtree(sort(refs));
+
+ const list<value> svcs = uriToComponentAssoc(content(comps));
+ debug(svcs, "modeval::confComponents::services");
+ sc.services = mkbtree(sort(svcs));
+
sc.implementations = componentToImplementationAssoc(sc, content(comps));
debug(sc.implementations, "modeval::confComponents::implementations");
return true;
@@ -781,21 +594,36 @@ const failable<bool> startComponents(ServerConf& sc) {
/**
* Configure and start the components deployed in a virtual host.
*/
-const failable<bool> virtualHostConfig(ServerConf& sc, const ServerConf& ssc, request_rec* r) {
- debug(httpd::serverName(ssc.server), "modeval::virtualHostConfig::serverName");
- debug(httpd::serverName(r), "modeval::virtualHostConfig::virtualHostName");
- debug(ssc.virtualHostContributionPath, "modwiring::virtualHostConfig::virtualHostContributionPath");
- debug(sc.contributionPath, "modeval::virtualHostConfig::contributionPath");
-
- // Chdir to the virtual host's contribution
- if (chdir(c_str(sc.contributionPath)) != 0)
- return mkfailure<bool>(string("Couldn't chdir to the deployed contribution: ") + sc.contributionPath);
+const failable<bool> vhostConfig(ServerConf& sc, const ServerConf& ssc, request_rec* r) {
+ debug(httpd::serverName(ssc.server), "modeval::vhostConfig::serverName");
+ debug(httpd::serverName(r), "modeval::vhostConfig::vhostName");
+ debug(ssc.vhostContributionPath, "modeval::vhostConfig::vhostContributionPath");
+ debug(sc.contributionPath, "modeval::vhostConfig::contributionPath");
// Configure the deployed components
const failable<bool> cr = confComponents(sc);
if (!hasContent(cr))
return cr;
+ // Store the virtual host configuration in the request config
+
+ return true;
+}
+
+/**
+ * Start the components deployed in a virtual host.
+ */
+const failable<bool> vhostStart(ServerConf& sc, const ServerConf& ssc, request_rec* r) {
+ debug(httpd::serverName(ssc.server), "modeval::vhostStart::serverName");
+ debug(httpd::serverName(r), "modeval::vhostStart::vhostName");
+ debug(ssc.vhostContributionPath, "modeval::vhostStart::vhostContributionPath");
+ debug(sc.contributionPath, "modeval::vhostStart::contributionPath");
+
+ // Configure the components deployed in a virtual host
+ const failable<bool> cr = vhostConfig(sc, ssc, r);
+ if (!hasContent(cr))
+ return cr;
+
// Start the configured components
const failable<bool> sr = startComponents(sc);
if (!hasContent(sr))
@@ -808,23 +636,441 @@ const failable<bool> virtualHostConfig(ServerConf& sc, const ServerConf& ssc, re
}
/**
- * Cleanup a virtual host.
+ * Stop a virtual host.
*/
-const failable<bool> virtualHostCleanup(const ServerConf& sc, const ServerConf& ssc) {
- if (!hasCompositeConf(sc))
+const failable<bool> vhostStop(const ServerConf& sc, unused const ServerConf& ssc) {
+ if (!hasContributionConf(sc))
return true;
- debug("modeval::virtualHostCleanup");
+ debug("modeval::vhostStop");
// Stop the component implementations
applyLifecycleExpr(sc.implementations, mklist<value>("stop"));
- // Chdir back to the main server's contribution
- if (chdir(c_str(ssc.contributionPath)) != 0)
- return mkfailure<bool>(string("Couldn't chdir to the deployed contribution: ") + ssc.contributionPath);
return true;
}
/**
+ * Handle an HTTP GET.
+ */
+const failable<int> get(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
+ debug(r->uri, "modeval::get::uri");
+
+ // Inspect the query string
+ const list<list<value> > args = httpd::queryArgs(r);
+ const list<value> ia = assoc(value("id"), args);
+ const list<value> ma = assoc(value("method"), args);
+
+ // Evaluate a JSON-RPC request and return a JSON result
+ if (!isNil(ia) && !isNil(ma)) {
+
+ // Extract the request id, method and params
+ const value id = cadr(ia);
+ const value func = c_str(json::funcName(string(cadr(ma))));
+
+ // Apply the requested function
+ const failable<value> val = failableResult(impl(cons(func, json::queryParams(args))));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+
+ // Return JSON result
+ js::JSContext cx;
+ return httpd::writeResult(json::jsonResult(id, content(val), cx), "application/json-rpc; charset=utf-8", r);
+ }
+
+ // Evaluate the GET expression
+ const list<value> params(append<value>(cddr(rpath), mkvalues(args)));
+ const failable<value> val = failableResult(impl(cons<value>("get", mklist<value>(params))));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+ const value c = content(val);
+ debug(c, "modeval::get::content");
+
+ // Check if the client requested a specific format
+ const list<value> fmt = assoc<value>("format", args);
+
+ // Write as a scheme value if requested by the client
+ if (!isNil(fmt) && cadr(fmt) == "scheme")
+ return httpd::writeResult(mklist<string>(scheme::writeValue(c)), "text/plain; charset=utf-8", r);
+
+ // Write a simple value as a JSON value
+ if (!isList(c)) {
+ js::JSContext cx;
+ if (isSymbol(c)) {
+ const list<value> lc = mklist<value>(mklist<value>("name", value(string(c))));
+ debug(lc, "modeval::get::symbol");
+ return httpd::writeResult(json::writeJSON(valuesToElements(lc), cx), "application/json; charset=utf-8", r);
+ }
+ const list<value> lc = mklist<value>(mklist<value>("value", c));
+ debug(lc, "modeval::get::value");
+ return httpd::writeResult(json::writeJSON(valuesToElements(lc), cx), "application/json; charset=utf-8", r);
+ }
+
+ // Write an empty list as a JSON empty value
+ if (isNil((list<value>)c)) {
+ js::JSContext cx;
+ debug(list<value>(), "modeval::get::empty");
+ return httpd::writeResult(json::writeJSON(list<value>(), cx), "application/json; charset=utf-8", r);
+ }
+
+ // Write content-type / content-list pair
+ if (isString(car<value>(c)) && !isNil(cdr<value>(c)) && isList(cadr<value>(c)))
+ return httpd::writeResult(convertValues<string>(cadr<value>(c)), car<value>(c), r);
+
+ // Write an assoc value as a JSON result
+ if (isSymbol(car<value>(c)) && !isNil(cdr<value>(c))) {
+ js::JSContext cx;
+ const list<value> lc = mklist<value>(c);
+ debug(lc, "modeval::get::assoc");
+ debug(valuesToElements(lc), "modeval::get::assoc::element");
+ return httpd::writeResult(json::writeJSON(valuesToElements(lc), cx), "application/json; charset=utf-8", r);
+ }
+
+ // Write value as JSON if requested by the client
+ if (!isNil(fmt) && cadr(fmt) == "json") {
+ js::JSContext cx;
+ return httpd::writeResult(json::writeJSON(valuesToElements(c), cx), "application/json; charset=utf-8", r);
+ }
+
+ // Convert list of values to element values
+ const list<value> e = valuesToElements(c);
+ debug(e, "modeval::get::elements");
+
+ // Write an ATOM feed or entry
+ if (isList(car<value>(e)) && !isNil(car<value>(e))) {
+ const list<value> el = car<value>(e);
+ if (isSymbol(car<value>(el)) && car<value>(el) == element && !isNil(cdr<value>(el)) && isSymbol(cadr<value>(el)) && elementHasChildren(el) && !elementHasValue(el)) {
+ if (cadr<value>(el) == atom::feed)
+ 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; 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; charset=utf-8", r);
+}
+
+/**
+ * Handle an HTTP POST.
+ */
+const failable<int> post(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
+ debug(r->uri, "modeval::post::uri");
+
+ // Evaluate a JSON-RPC request and return a JSON result
+ const string ct = httpd::contentType(r);
+ if (contains(ct, "application/json-rpc") || contains(ct, "text/plain") || contains(ct, "application/x-www-form-urlencoded")) {
+
+ // Read the JSON request
+ const int rc = httpd::setupReadPolicy(r);
+ if(rc != OK)
+ return rc;
+ const list<string> ls = httpd::read(r);
+ debug(ls, "modeval::post::input");
+ js::JSContext cx;
+ const list<value> json = elementsToValues(content(json::readJSON(ls, cx)));
+ const list<list<value> > args = httpd::postArgs(json);
+
+ // Extract the request id, method and params
+ const value id = cadr(assoc(value("id"), args));
+ const value func = c_str(json::funcName(cadr(assoc(value("method"), args))));
+ const list<value> params = (list<value>)cadr(assoc(value("params"), args));
+
+ // Evaluate the request expression
+ const failable<value> val = failableResult(impl(cons<value>(func, params)));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+
+ // Return JSON result
+ 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
+ if (contains(ct, "application/atom+xml")) {
+
+ // Read the ATOM entry
+ const int rc = httpd::setupReadPolicy(r);
+ if(rc != OK)
+ return rc;
+ const list<string> ls = httpd::read(r);
+ debug(ls, "modeval::post::input");
+ const value entry = elementsToValues(content(atom::readATOMEntry(ls)));
+
+ // Evaluate the POST expression
+ const failable<value> val = failableResult(impl(cons<value>("post", mklist<value>(cddr(rpath), entry))));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+
+ // Return the created resource location
+ debug(content(val), "modeval::post::location");
+ apr_table_setn(r->headers_out, "Location", apr_pstrdup(r->pool, c_str(httpd::url(r->uri, content(val), r))));
+ r->status = HTTP_CREATED;
+ return OK;
+ }
+
+ // Unknown content type, wrap the HTTP request struct in a value and pass it to
+ // the component implementation function
+ const failable<value> val = failableResult(impl(cons<value>("handle", mklist<value>(httpd::requestValue(r)))));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+ return (int)content(val);
+}
+
+/**
+ * Handle an HTTP PUT.
+ */
+const failable<int> put(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
+ debug(r->uri, "modeval::put::uri");
+
+ // Read the ATOM entry
+ const int rc = httpd::setupReadPolicy(r);
+ if(rc != OK)
+ return rc;
+ const list<string> ls = httpd::read(r);
+ debug(ls, "modeval::put::input");
+ const value entry = elementsToValues(content(atom::readATOMEntry(ls)));
+
+ // Evaluate the PUT expression and update the corresponding resource
+ const failable<value> val = failableResult(impl(cons<value>("put", mklist<value>(cddr(rpath), entry))));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+ if (val == value(false))
+ return HTTP_NOT_FOUND;
+ return OK;
+}
+
+/**
+ * Handle an HTTP DELETE.
+ */
+const failable<int> del(const list<value>& rpath, request_rec* r, const lambda<value(const list<value>&)>& impl) {
+ debug(r->uri, "modeval::delete::uri");
+
+ // Evaluate an ATOM delete request
+ const failable<value> val = failableResult(impl(cons<value>("delete", mklist<value>(cddr(rpath)))));
+ if (!hasContent(val))
+ return mkfailure<int>(reason(val));
+ if (val == value(false))
+ return HTTP_NOT_FOUND;
+ return OK;
+}
+
+/**
+ * Route a /references/component-name/reference-name request,
+ * to the target of the component reference.
+ */
+int translateReference(const ServerConf& sc, request_rec *r, const list<value>& rpath, const list<value>& apath) {
+ httpdDebugRequest(r, "modeval::translateReference::input");
+ debug(r->uri, "modeval::translateReference::uri");
+ debug(apath, "modeval::translateReference::apath");
+ debug(rpath, "modeval::translateReference::rpath");
+
+ // Find the requested component
+ if (isNil(cdr(rpath)))
+ return HTTP_NOT_FOUND;
+ const list<value> comp(assoctree(cadr(rpath), sc.references));
+ if (isNil(comp))
+ return HTTP_NOT_FOUND;
+
+ // Find the requested reference and target configuration
+ const list<value> ref(assoctree<value>(caddr(rpath), cadr(comp)));
+ if (isNil(ref))
+ return HTTP_NOT_FOUND;
+ const string target(cadr(ref));
+ debug(target, "modeval::translateReference::target");
+
+ // Route to an absolute target URI using mod_proxy or an HTTP client redirect
+ const list<value> pathInfo = cdddr(rpath);
+ if (http::isAbsolute(target)) {
+ if (useModProxy) {
+ // Build proxy URI
+ string turi = target + path(pathInfo) + (r->args != NULL? string("?") + r->args : string(""));
+ const string proxy(string("proxy:") + turi);
+ debug(proxy, "modeval::translateReference::proxy");
+ r->filename = apr_pstrdup(r->pool, c_str(proxy));
+ r->proxyreq = PROXYREQ_REVERSE;
+ r->handler = "proxy-server";
+ apr_table_setn(r->notes, "proxy-nocanon", "1");
+ return OK;
+ }
+
+ debug(target, "modeval::translateReference::location");
+ r->handler = "mod_tuscany_eval";
+ return httpd::externalRedirect(target, r);
+ }
+
+ // Route to a relative target URI using a local internal redirect
+ // /components/, target component name and request path info
+ const value tname = substr(target, 0, find(target, '/'));
+ const string redir = path(append(apath, cons<value>(string("c"), cons(tname, pathInfo))));
+ debug(redir, "modeval::translateReference::redirect");
+ r->uri = apr_pstrdup(r->pool, c_str(redir));
+ r->handler = "mod_tuscany_eval";
+ return OK;
+}
+
+/**
+ * Find a leaf matching a request path in a tree of URI paths.
+ */
+const int matchPath(const list<value>& k, const list<value>& p) {
+ if (isNil(p))
+ return true;
+ if (isNil(k))
+ return false;
+ if (car(k) != car(p))
+ return false;
+ return matchPath(cdr(k), cdr(p));
+}
+
+const list<value> assocPath(const value& k, const list<value>& tree) {
+ if (isNil(tree))
+ return tree;
+ if (matchPath(k, car<value>(car(tree))))
+ return car(tree);
+ if (k < car<value>(car(tree)))
+ return assocPath(k, cadr(tree));
+ return assocPath(k, caddr(tree));
+}
+
+/**
+ * Route a service request to the component providing the requested service.
+ */
+int translateService(const ServerConf& sc, request_rec *r, const list<value>& rpath, const list<value>& apath) {
+ httpdDebugRequest(r, "modeval::translateService::input");
+ debug(r->uri, "modeval::translateService::uri");
+
+ // Find the requested component
+ debug(sc.services, "modeval::translateService::services");
+ const list<value> svc(assocPath(rpath, sc.services));
+ if (isNil(svc))
+ return DECLINED;
+ debug(svc, "modeval::translateService::service");
+
+ // Build a component-name + path-info URI
+ const list<value> target(append(apath, cons<value>(string("c"), cons<value>(cadr(svc), httpd::pathInfo(rpath, car(svc))))));
+ debug(target, "modeval::translateService::target");
+
+ // Dispatch to the target component using a local internal redirect
+ const string redir(path(target));
+ debug(redir, "modeval::translateService::redirect");
+ r->uri = apr_pstrdup(r->pool, c_str(redir));
+ r->handler = "mod_tuscany_eval";
+ return OK;
+}
+
+/**
+ * Translate a request to the target app and component.
+ */
+const int translateRequest(const ServerConf& sc, request_rec* r, const list<value>& rpath, const list<value>& apath) {
+ debug(apath, "modeval::translateRequest::apath");
+ debug(rpath, "modeval::translateRequest::rpath");
+ if (isNil(apath) && isNil(rpath))
+ return DECLINED;
+
+ if (!isNil(rpath)) {
+
+ // If the request is targeting a virtual host, use the corresponding
+ // virtual host configuration
+ if (isNil(apath)) {
+ if (hasVhostDomainConf(sc) && hasVhostContributionConf(sc) && httpd::isVhostRequest(sc.server, sc.vhostDomain, r)) {
+ const string aname = httpd::hostName(r);
+ ServerConf vsc(r->pool, sc, aname);
+ if (!hasContent(vhostConfig(vsc, sc, r)))
+ return DECLINED;
+ return translateRequest(vsc, r, rpath, mklist<value>(aname));
+ }
+ }
+
+ // Let default handler handle a resource request
+ const value prefix = car(rpath);
+ if (prefix == string("vhosts") || prefix == string("v"))
+ return DECLINED;
+
+ // Let our handler handle a component request
+ if (prefix == string("components") || prefix == string("c")) {
+ r->handler = "mod_tuscany_eval";
+ return OK;
+ }
+
+ // Translate a component reference request
+ if (prefix == string("references") || prefix == string("r"))
+ return translateReference(sc, r, rpath, apath);
+
+ // Attempt to translate the request to a service request
+ if (translateService(sc, r, rpath, apath) == OK)
+ return OK;
+
+ // Attempt to map the request to an actual file
+ if (isNil(apath)) {
+ const failable<request_rec*, int> fnr = httpd::internalSubRequest(r->uri, r);
+ if (!hasContent(fnr))
+ return HTTP_INTERNAL_SERVER_ERROR;
+ request_rec* nr = content(fnr);
+ nr->uri = r->filename;
+ const int tr = ap_core_translate(nr);
+ if (tr != OK)
+ return tr;
+ if (ap_directory_walk(nr) == OK && ap_file_walk(nr) == OK && nr->finfo.filetype != APR_NOFILE) {
+ debug(nr->filename, "modeval::translateRequest::file");
+ return DECLINED;
+ }
+
+ // If the request is targeting a virtual app, use the corresponding
+ // virtual host configuration
+ if (hasVhostContributionConf(sc)) {
+ const string cp = sc.vhostContributionPath + string(prefix) + "/" + sc.vhostCompositeName;
+ ServerConf vsc(r->pool, sc, string(prefix));
+ if (!hasContent(vhostConfig(vsc, sc, r)))
+ return DECLINED;
+ return translateRequest(vsc, r, cdr(rpath), mklist<value>(car(rpath)));
+ }
+ }
+ }
+
+ // If we're in a virtual app and the request didn't match a service,
+ // reference or component, redirect it to /v/<uri>. This will allow
+ // mapping to the actual app resources using HTTPD aliases.
+ if (!isNil(apath)) {
+ if (isNil(rpath) && r->uri[strlen(r->uri) -1] != '/') {
+
+ // Make sure a document root request ends with a '/', using
+ // an external redirect
+ const string target = string(r->uri) + string("/") + (r->args != NULL? string("?") + r->args : string(""));;
+ debug(target, "modeval::translateRequest::location");
+ r->handler = "mod_tuscany_eval";
+ return httpd::externalRedirect(target, r);
+ }
+
+ // Do an internal redirect to /v/<uri>
+ const string redir = string("/redirect:") + string("/v") + string(r->uri);
+ debug(redir, "modeval::translateRequest::redirect");
+ r->filename = apr_pstrdup(r->pool, c_str(redir));
+ r->handler = "mod_tuscany_eval";
+ return OK;
+ }
+
+ return DECLINED;
+}
+
+/**
+ * Translate a request.
+ */
+int translate(request_rec *r) {
+ if(r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE)
+ return DECLINED;
+
+ // Create a scoped memory pool
+ gc_scoped_pool pool(r->pool);
+
+ httpdDebugRequest(r, "modeval::translate::input");
+
+ // Get the server configuration
+ const ServerConf& sc = httpd::serverConf<ServerConf>(r, &mod_tuscany_eval);
+
+ // Translate the request
+ return translateRequest(sc, r, pathValues(r->uri), list<value>());
+}
+
+/**
* Handle a component request.
*/
const int handleRequest(const ServerConf& sc, const list<value>& rpath, request_rec *r) {
@@ -832,45 +1078,44 @@ const int handleRequest(const ServerConf& sc, const list<value>& rpath, request_
if (isNil(cdr(rpath)))
return HTTP_NOT_FOUND;
- // Handle a request targeting a virtual host or virtual app
- if (hasVirtualCompositeConf(sc)) {
- if (hasVirtualDomainConf(sc) && httpd::isVirtualHostRequest(sc.server, sc.virtualHostDomain, r)) {
+ if (hasVhostContributionConf(sc)) {
+
+ // Handle a request targeting a component in a virtual host
+ if (hasVhostDomainConf(sc) && httpd::isVhostRequest(sc.server, sc.vhostDomain, r)) {
// Determine the app name from the host sub-domain name, and
- // store it in a header
+ // store it in a request note
const string app = http::subDomain(httpd::hostName(r));
- apr_table_setn(r->headers_in, "X-Request-AppName", apr_pstrdup(r->pool, c_str(app)));
+ apr_table_setn(r->notes, "X-Request-AppName", apr_pstrdup(r->pool, c_str(app)));
ServerConf vsc(r->pool, sc, app);
- if (!hasContent(virtualHostConfig(vsc, sc, r)))
+ if (!hasContent(vhostStart(vsc, sc, r)))
return HTTP_INTERNAL_SERVER_ERROR;
const int rc = handleRequest(vsc, rpath, r);
- virtualHostCleanup(vsc, sc);
+ vhostStop(vsc, sc);
return rc;
}
+ // Handle a request targeting a component in a virtual app
const value c = car(rpath);
if (c != string("components") && c != string("c")) {
- // Determine the app name from the request URI path
+ // Determine the app name from the request URI path and
+ // store it in a request note
const string app = string(c);
- const string cp = sc.virtualHostContributionPath + app + "/" + sc.virtualHostCompositeName;
- struct stat st;
- const int s = stat(c_str(cp), &st);
- if (s != -1) {
- // Store the app name in a header
- apr_table_setn(r->headers_in, "X-Request-AppName", apr_pstrdup(r->pool, c_str(app)));
- ServerConf vsc(r->pool, sc, app);
- if (!hasContent(virtualHostConfig(vsc, sc, r)))
- return HTTP_INTERNAL_SERVER_ERROR;
- const int rc = handleRequest(vsc, cdr(rpath), r);
- virtualHostCleanup(vsc, sc);
- return rc;
- }
+ const string cp = sc.vhostContributionPath + app + "/" + sc.vhostCompositeName;
+ apr_table_setn(r->notes, "X-Request-AppName", apr_pstrdup(r->pool, c_str(app)));
+
+ ServerConf vsc(r->pool, sc, app);
+ if (!hasContent(vhostStart(vsc, sc, r)))
+ return HTTP_INTERNAL_SERVER_ERROR;
+ const int rc = handleRequest(vsc, cdr(rpath), r);
+ vhostStop(vsc, sc);
+ return rc;
}
}
- // Store the request uri path in a header
- apr_table_setn(r->headers_in, "X-Request-URI", apr_pstrdup(r->pool, c_str(path(rpath))));
+ // Store the request uri path in a request note
+ apr_table_setn(r->notes, "X-Request-URI", apr_pstrdup(r->pool, c_str(path(rpath))));
// Get the component implementation lambda
const list<value> impl(assoctree<value>(cadr(rpath), sc.implTree));
@@ -903,11 +1148,20 @@ int handler(request_rec *r) {
if(strcmp(r->handler, "mod_tuscany_eval"))
return DECLINED;
- // Create a scoped memory pool
- gc_scoped_pool pool(r->pool);
+ // Nothing to do for an external redirect
+ if (r->status == HTTP_MOVED_TEMPORARILY)
+ return OK;
+ // Handle an internal redirect as directed by the translate hook
+ if (r->filename != NULL && !strncmp(r->filename, "/redirect:", 10)) {
+ if (r->args == NULL)
+ return httpd::internalRedirect(httpd::redirectURI(string(r->filename + 10), string(r->path_info)), r);
+ return httpd::internalRedirect(httpd::redirectURI(string(r->filename + 10), string(r->path_info), string(r->args)), r);
+ }
+
+
+ // Create a scope for the current request
ScopedRequest sr(r);
- httpdDebugRequest(r, "modeval::handler::input");
// Get the server configuration
const ServerConf& sc = httpd::serverConf<ServerConf>(r, &mod_tuscany_eval);
@@ -946,16 +1200,21 @@ const int postConfigMerge(const ServerConf& mainsc, server_rec* s) {
ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_eval);
debug(httpd::serverName(s), "modeval::postConfigMerge::serverName");
sc.lifecycle = mainsc.lifecycle;
+ sc.vhostName = mainsc.vhostName;
sc.contributionPath = mainsc.contributionPath;
sc.compositeName = mainsc.compositeName;
- sc.virtualHostDomain = mainsc.virtualHostDomain;
- sc.virtualHostContributionPath = mainsc.virtualHostContributionPath;
- sc.virtualHostCompositeName = mainsc.virtualHostCompositeName;
+ sc.vhostDomain = mainsc.vhostDomain;
+ sc.vhostContributionPath = mainsc.vhostContributionPath;
+ sc.vhostCompositeName = mainsc.vhostCompositeName;
+ sc.vhostContributorName = mainsc.vhostContributorName;
if (sc.ca == "") sc.ca = mainsc.ca;
if (sc.cert == "") sc.cert = mainsc.cert;
if (sc.key == "") sc.key = mainsc.key;
+ sc.references = mainsc.references;
+ sc.services = mainsc.services;
sc.implementations = mainsc.implementations;
sc.implTree = mainsc.implTree;
+ sc.vhostContributor = mainsc.vhostContributor;
return postConfigMerge(mainsc, s->next);
}
@@ -964,7 +1223,7 @@ int postConfig(apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp,
gc_scoped_pool pool(p);
- // Get the server configuration and determine the wiring server name
+ // Get the server configuration and determine the server name
ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_eval);
debug(httpd::serverName(s), "modeval::postConfig::serverName");
@@ -1037,6 +1296,10 @@ void childInit(apr_pool_t* p, server_rec* s) {
// Store the implementation lambda functions in a tree for fast retrieval
sc.implTree = mkbtree(sort(sc.implementations));
+ // Create a proxy for the vhost contributor if needed
+ if (length(sc.vhostContributorName) != 0)
+ sc.vhostContributor = mkimplProxy(sc, sc.vhostContributorName);
+
// Merge the updated configuration into the virtual hosts
postConfigMerge(sc, s->next);
@@ -1062,19 +1325,25 @@ const char* confComposite(cmd_parms *cmd, unused void *c, const char *arg) {
const char* confVirtualDomain(cmd_parms *cmd, unused void *c, const char *arg) {
gc_scoped_pool pool(cmd->pool);
ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_eval);
- sc.virtualHostDomain = arg;
+ sc.vhostDomain = arg;
return NULL;
}
const char* confVirtualContribution(cmd_parms *cmd, unused void *c, const char *arg) {
gc_scoped_pool pool(cmd->pool);
ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_eval);
- sc.virtualHostContributionPath = arg;
+ sc.vhostContributionPath = arg;
+ return NULL;
+}
+const char* confVirtualContributor(cmd_parms *cmd, unused void *c, const char *arg) {
+ gc_scoped_pool pool(cmd->pool);
+ ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_eval);
+ sc.vhostContributorName = arg;
return NULL;
}
const char* confVirtualComposite(cmd_parms *cmd, unused void *c, const char *arg) {
gc_scoped_pool pool(cmd->pool);
ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_eval);
- sc.virtualHostCompositeName = arg;
+ sc.vhostCompositeName = arg;
return NULL;
}
const char* confCAFile(cmd_parms *cmd, unused void *c, const char *arg) {
@@ -1108,7 +1377,8 @@ const command_rec commands[] = {
AP_INIT_TAKE1("SCAContribution", (const char*(*)())confContribution, NULL, RSRC_CONF, "SCA contribution location"),
AP_INIT_TAKE1("SCAComposite", (const char*(*)())confComposite, NULL, RSRC_CONF, "SCA composite location"),
AP_INIT_TAKE1("SCAVirtualDomain", (const char*(*)())confVirtualDomain, NULL, RSRC_CONF, "SCA virtual host domain"),
- AP_INIT_TAKE1("SCAVirtualContribution", (const char*(*)())confVirtualContribution, NULL, RSRC_CONF, "SCA virtual host contribution location"),
+ AP_INIT_TAKE1("SCAVirtualContribution", (const char*(*)())confVirtualContribution, NULL, RSRC_CONF, "SCA virtual host contribution path"),
+ AP_INIT_TAKE1("SCAVirtualContributor", (const char*(*)())confVirtualContributor, NULL, RSRC_CONF, "SCA virtual host contributor component"),
AP_INIT_TAKE1("SCAVirtualComposite", (const char*(*)())confVirtualComposite, NULL, RSRC_CONF, "SCA virtual composite location"),
AP_INIT_TAKE12("SCASetEnv", (const char*(*)())confEnv, NULL, OR_FILEINFO, "Environment variable name and optional value"),
AP_INIT_TAKE1("SCAWiringSSLCACertificateFile", (const char*(*)())confCAFile, NULL, RSRC_CONF, "SCA wiring SSL CA certificate file"),
@@ -1122,7 +1392,7 @@ 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_handler(handler, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_translate_name(translate, NULL, NULL, APR_HOOK_FIRST);
+ ap_hook_translate_name(translate, NULL, NULL, APR_HOOK_LAST);
}
}
diff --git a/sca-cpp/trunk/modules/server/mod-wiring.cpp b/sca-cpp/trunk/modules/server/mod-wiring.cpp
deleted file mode 100644
index 0dd0529a42..0000000000
--- a/sca-cpp/trunk/modules/server/mod-wiring.cpp
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-/**
- * HTTPD module used to wire component references and route requests to
- * target service components.
- */
-
-#include <sys/stat.h>
-
-#define WANT_HTTPD_LOG 1
-#include "string.hpp"
-#include "stream.hpp"
-#include "list.hpp"
-#include "tree.hpp"
-#include "value.hpp"
-#include "monad.hpp"
-#include "../scdl/scdl.hpp"
-#include "../http/http.hpp"
-#include "../http/httpd.hpp"
-
-extern "C" {
-extern module AP_MODULE_DECLARE_DATA mod_tuscany_wiring;
-}
-
-namespace tuscany {
-namespace server {
-namespace modwiring {
-
-/**
- * Set to true to wire using mod_proxy, false to wire using HTTP client redirects.
- */
-const bool useModProxy = true;
-
-/**
- * Server configuration.
- */
-class ServerConf {
-public:
- ServerConf(apr_pool_t* p, server_rec* s) : p(p), server(s), contributionPath(""), compositeName(""), virtualHostDomain(""), virtualHostContributionPath(""), virtualHostCompositeName("") {
- }
-
- ServerConf(apr_pool_t* p, const ServerConf& ssc, const string& name) : p(p), server(ssc.server), contributionPath(ssc.virtualHostContributionPath + name + "/"), compositeName(ssc.virtualHostCompositeName), virtualHostDomain(""), virtualHostContributionPath(""), virtualHostCompositeName("") {
- }
-
- const gc_pool p;
- server_rec* server;
- string contributionPath;
- string compositeName;
- string virtualHostDomain;
- string virtualHostContributionPath;
- string virtualHostCompositeName;
- list<value> references;
- list<value> services;
-};
-
-/**
- * Return true if a server contains a composite configuration.
- */
-const bool hasCompositeConf(const ServerConf& sc) {
- return sc.contributionPath != "" && sc.compositeName != "";
-}
-
-/**
- * Return true if a server contains a virtual host domain configuration.
- */
-const bool hasVirtualDomainConf(const ServerConf& sc) {
- return sc.virtualHostDomain != "";
-}
-
-/**
- * Return true if a server contains a virtual host composite configuration.
- */
-const bool hasVirtualCompositeConf(const ServerConf& sc) {
- return sc.virtualHostContributionPath != "" && sc.virtualHostCompositeName != "";
-}
-
-/**
- * Route a /references/component-name/reference-name request,
- * to the target of the component reference.
- */
-int translateReference(const ServerConf& sc, request_rec *r, const list<value>& rpath, const list<value>& apath) {
- httpdDebugRequest(r, "modwiring::translateReference::input");
- debug(r->uri, "modwiring::translateReference::uri");
- debug(apath, "modwiring::translateReference::apath");
- debug(rpath, "modwiring::translateReference::rpath");
-
- // Find the requested component
- if (isNil(cdr(rpath)))
- return HTTP_NOT_FOUND;
- const list<value> comp(assoctree(cadr(rpath), sc.references));
- if (isNil(comp))
- return HTTP_NOT_FOUND;
-
- // Find the requested reference and target configuration
- const list<value> ref(assoctree<value>(caddr(rpath), cadr(comp)));
- if (isNil(ref))
- return HTTP_NOT_FOUND;
- const string target(cadr(ref));
- debug(target, "modwiring::translateReference::target");
-
- // Route to an absolute target URI using mod_proxy or an HTTP client redirect
- const list<value> pathInfo = cdddr(rpath);
- if (http::isAbsolute(target)) {
- if (useModProxy) {
- // Build proxy URI
- string turi = target + path(pathInfo) + (r->args != NULL? string("?") + r->args : string(""));
- const string proxy(string("proxy:") + turi);
- debug(proxy, "modwiring::translateReference::proxy");
- r->filename = apr_pstrdup(r->pool, c_str(proxy));
- r->proxyreq = PROXYREQ_REVERSE;
- r->handler = "proxy-server";
- apr_table_setn(r->notes, "proxy-nocanon", "1");
- return OK;
- }
-
- debug(target, "modwiring::translateReference::location");
- r->handler = "mod_tuscany_wiring";
- return httpd::externalRedirect(target, r);
- }
-
- // Route to a relative target URI using a local internal redirect
- // /components/, target component name and request path info
- const value tname = substr(target, 0, find(target, '/'));
- const string tp = path(append(apath, cons<value>(string("c"), cons(tname, pathInfo)))) + (r->args != NULL? string("?") + r->args : string(""));
- const string redir(string("/redirect:") + tp);
- debug(redir, "modwiring::translateReference::redirect");
- r->filename = apr_pstrdup(r->pool, c_str(redir));
- r->handler = "mod_tuscany_wiring";
- return OK;
-}
-
-/**
- * Find a leaf matching a request path in a tree of URI paths.
- */
-const int matchPath(const list<value>& k, const list<value>& p) {
- if (isNil(p))
- return true;
- if (isNil(k))
- return false;
- if (car(k) != car(p))
- return false;
- return matchPath(cdr(k), cdr(p));
-}
-
-const list<value> assocPath(const value& k, const list<value>& tree) {
- if (isNil(tree))
- return tree;
- if (matchPath(k, car<value>(car(tree))))
- return car(tree);
- if (k < car<value>(car(tree)))
- return assocPath(k, cadr(tree));
- return assocPath(k, caddr(tree));
-}
-
-/**
- * Route a service request to the component providing the requested service.
- */
-int translateService(const ServerConf& sc, request_rec *r, const list<value>& rpath, const list<value>& apath) {
- httpdDebugRequest(r, "modwiring::translateService::input");
- debug(r->uri, "modwiring::translateService::uri");
-
- // Find the requested component
- debug(sc.services, "modwiring::translateService::services");
- const list<value> svc(assocPath(rpath, sc.services));
- if (isNil(svc))
- return DECLINED;
- debug(svc, "modwiring::translateService::service");
-
- // Build a component-name + path-info URI
- const list<value> target(append(apath, cons<value>(string("c"), cons<value>(cadr(svc), httpd::pathInfo(rpath, car(svc))))));
- debug(target, "modwiring::translateService::target");
-
- // Dispatch to the target component using a local internal redirect
- const string tp(path(target) + (r->args != NULL? string("?") + r->args : string("")));
- const string redir(string("/redirect:") + tp);
- debug(redir, "modwiring::translateService::redirect");
- r->filename = apr_pstrdup(r->pool, c_str(redir));
- r->handler = "mod_tuscany_wiring";
- return OK;
-}
-
-/**
- * Read the components declared in a composite.
- */
-const failable<list<value> > readComponents(const string& path) {
- ifstream is(path);
- if (fail(is))
- return mkfailure<list<value> >(string("Could not read composite: ") + path);
- return scdl::components(readXML(streamList(is)));
-}
-
-/**
- * Return a list of component-name + references pairs. The references are
- * arranged in trees of reference-name + reference-target pairs.
- */
-const list<value> componentReferenceToTargetTree(const value& c) {
- return mklist<value>(scdl::name(c), mkbtree(sort(scdl::referenceToTargetAssoc(scdl::references(c)))));
-}
-
-const list<value> componentReferenceToTargetAssoc(const list<value>& c) {
- if (isNil(c))
- return c;
- return cons<value>(componentReferenceToTargetTree(car(c)), componentReferenceToTargetAssoc(cdr(c)));
-}
-
-/**
- * Return a list of service-URI-path + component-name pairs. Service-URI-paths are
- * represented as lists of URI path fragments.
- */
-const list<value> defaultBindingURI(const string& cn, const string& sn) {
- return mklist<value>(cn, sn);
-}
-
-const list<value> bindingToComponentAssoc(const string& cn, const string& sn, const list<value>& b) {
- if (isNil(b))
- return b;
- const value uri(scdl::uri(car(b)));
- if (isNil(uri))
- return cons<value>(mklist<value>(defaultBindingURI(cn, sn), cn), bindingToComponentAssoc(cn, sn, cdr(b)));
- return cons<value>(mklist<value>(pathValues(c_str(string(uri))), cn), bindingToComponentAssoc(cn, sn, cdr(b)));
-}
-
-const list<value> serviceToComponentAssoc(const string& cn, const list<value>& s) {
- if (isNil(s))
- return s;
- const string sn(scdl::name(car(s)));
- const list<value> btoc(bindingToComponentAssoc(cn, sn, scdl::bindings(car(s))));
- if (isNil(btoc))
- return cons<value>(mklist<value>(defaultBindingURI(cn, sn), cn), serviceToComponentAssoc(cn, cdr(s)));
- return append<value>(btoc, serviceToComponentAssoc(cn, cdr(s)));
-}
-
-const list<value> uriToComponentAssoc(const list<value>& c) {
- if (isNil(c))
- return c;
- return append<value>(serviceToComponentAssoc(scdl::name(car(c)), scdl::services(car(c))), uriToComponentAssoc(cdr(c)));
-}
-
-/**
- * Configure the components declared in the server's deployment composite.
- */
-const bool confComponents(ServerConf& sc) {
- if (!hasCompositeConf(sc))
- return true;
- debug(sc.contributionPath, "modwiring::confComponents::contributionPath");
- debug(sc.compositeName, "modwiring::confComponents::compositeName");
-
- // Read the component configuration and store the references and service URIs
- // in trees for fast retrieval later
- const failable<list<value> > comps = readComponents(scdl::resourcePath(sc.contributionPath, sc.compositeName));
- if (!hasContent(comps))
- return true;
- const list<value> refs = componentReferenceToTargetAssoc(content(comps));
- debug(refs, "modwiring::confComponents::references");
- sc.references = mkbtree(sort(refs));
-
- const list<value> svcs = uriToComponentAssoc(content(comps));
- debug(svcs, "modwiring::confComponents::services");
- sc.services = mkbtree(sort(svcs));
- return true;
-}
-
-/**
- * Configure and start the components deployed in a virtual host.
- */
-const failable<ServerConf> virtualHostConfig(ServerConf& sc, const ServerConf& ssc, request_rec* r) {
- debug(httpd::serverName(ssc.server), "modwiring::virtualHostConfig::serverName");
- debug(httpd::serverName(r), "modwiring::virtualHostConfig::virtualHostName");
- debug(ssc.virtualHostContributionPath, "modwiring::virtualHostConfig::virtualHostContributionPath");
- debug(sc.contributionPath, "modwiring::virtualHostConfig::contributionPath");
-
- // Configure the wiring for the deployed components
- confComponents(sc);
-
- return sc;
-}
-
-/**
- * Translate an HTTP service or reference request and route it
- * to the target component.
- */
-const int translateRequest(const ServerConf& sc, request_rec *r, const list<value>& rpath, const list<value>& apath) {
- debug(apath, "modwiring::translateRequest::apath");
- debug(rpath, "modwiring::translateRequest::rpath");
- if (isNil(apath) && isNil(rpath))
- return DECLINED;
-
- if (!isNil(rpath)) {
-
- // No translation needed for a component or resource request
- const value c = car(rpath);
- if (c == string("components") || c == string("c") || c == string("vhosts") || c == string("v"))
- return DECLINED;
-
- // If the request is targeting a virtual host, use the corresponding
- // virtual host configuration
- const bool vdc = hasVirtualDomainConf(sc);
- const bool vcc = hasVirtualCompositeConf(sc);
- if (vdc && vcc && httpd::isVirtualHostRequest(sc.server, sc.virtualHostDomain, r)) {
- ServerConf vsc(r->pool, sc, http::subDomain(httpd::hostName(r)));
- if (!hasContent(virtualHostConfig(vsc, sc, r)))
- return HTTP_INTERNAL_SERVER_ERROR;
- return translateRequest(vsc, r, rpath, list<value>());
- }
-
- // Translate a component reference request
- if (c == string("references") || c == string("r"))
- return translateReference(sc, r, rpath, apath);
-
- // Attempt to translate the request to a service request
- if (translateService(sc, r, rpath, apath) == OK)
- return OK;
-
- // If the request is targeting a virtual app, use the corresponding
- // virtual host configuration
- if (vcc) {
- const string cp = sc.virtualHostContributionPath + string(c) + "/" + sc.virtualHostCompositeName;
- struct stat st;
- const int s = stat(c_str(cp), &st);
- if (s == -1)
- return DECLINED;
- ServerConf vsc(r->pool, sc, string(c));
- if (!hasContent(virtualHostConfig(vsc, sc, r)))
- return HTTP_INTERNAL_SERVER_ERROR;
- return translateRequest(vsc, r, cdr(rpath), mklist<value>(car(rpath)));
- }
- }
-
- // If we're in a virtual app and the request is targeting a regular
- // resource, redirect it to /v/<uri>. This will allow mapping to the
- // actual resources using HTTPD aliases.
- if (!isNil(apath)) {
- const string tp = string("/v") + string(r->uri) + (r->args != NULL? string("?") + r->args : string(""));
- const string redir = string("/redirect:") + tp;
- debug(redir, "modwiring::translateRequest::redirect");
- r->filename = apr_pstrdup(r->pool, c_str(redir));
- r->handler = "mod_tuscany_wiring";
- return OK;
- }
-
- return DECLINED;
-}
-
-/**
- * Translate an HTTP service or reference request and route it
- * to the target component.
- */
-int translate(request_rec *r) {
- if(r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE)
- return DECLINED;
-
- // Create a scoped memory pool
- gc_scoped_pool pool(r->pool);
- httpdDebugRequest(r, "modwiring::translate::input");
-
- // Get the server configuration
- const ServerConf& sc = httpd::serverConf<ServerConf>(r, &mod_tuscany_wiring);
-
- // Translate the request
- return translateRequest(sc, r, pathValues(r->uri), list<value>());
-}
-
-/**
- * HTTP request handler, redirect to a target component.
- */
-int handler(request_rec *r) {
- if(r->method_number != M_GET && r->method_number != M_POST && r->method_number != M_PUT && r->method_number != M_DELETE)
- return DECLINED;
- if(strcmp(r->handler, "mod_tuscany_wiring"))
- return DECLINED;
- if (r->filename == NULL || strncmp(r->filename, "/redirect:", 10) != 0)
- return DECLINED;
-
- // Nothing to do for an external redirect
- if (r->status == HTTP_MOVED_TEMPORARILY)
- return OK;
-
- // Create a scoped memory pool
- gc_scoped_pool pool(r->pool);
-
- httpdDebugRequest(r, "modwiring::handler::input");
- debug(r->uri, "modwiring::handler::uri");
- debug(r->filename, "modwiring::handler::filename");
- debug(r->path_info, "modwiring::handler::path info");
-
- // Do an internal redirect
- if (r->args == NULL)
- return httpd::internalRedirect(httpd::redirectURI(string(r->filename + 10), string(r->path_info)), r);
- return httpd::internalRedirect(httpd::redirectURI(string(r->filename + 10), string(r->path_info), string(r->args)), r);
-}
-
-/**
- * Called after all the configuration commands have been run.
- * Process the server configuration and configure the wiring for the deployed components.
- */
-const int postConfigMerge(const ServerConf& mainsc, server_rec* s) {
- if (s == NULL)
- return OK;
- debug(httpd::serverName(s), "modwiring::postConfigMerge::serverName");
- ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_wiring);
- sc.contributionPath = mainsc.contributionPath;
- sc.compositeName = mainsc.compositeName;
- sc.virtualHostDomain = mainsc.virtualHostDomain;
- sc.virtualHostContributionPath = mainsc.virtualHostContributionPath;
- sc.virtualHostCompositeName = mainsc.virtualHostCompositeName;
- sc.references = mainsc.references;
- sc.services = mainsc.services;
- return postConfigMerge(mainsc, s->next);
-}
-
-int postConfig(apr_pool_t *p, unused apr_pool_t *plog, unused apr_pool_t *ptemp, server_rec *s) {
- gc_scoped_pool pool(p);
-
- // Count the calls to post config, skip the first one as
- // postConfig is always called twice
- const string k("tuscany::modwiring::postConfig");
- const long int count = (long int)httpd::userData(k, s);
- httpd::putUserData(k, (void*)(count + 1), s);
- if (count == 0)
- return OK;
-
- // Configure the wiring for the deployed components
- debug(httpd::serverName(s), "modwiring::postConfig::serverName");
- ServerConf& sc = httpd::serverConf<ServerConf>(s, &mod_tuscany_wiring);
- confComponents(sc);
-
- // Merge the config into any virtual hosts
- return postConfigMerge(sc, s->next);
-}
-
-/**
- * Child process initialization.
- */
-void childInit(apr_pool_t* p, server_rec* s) {
- gc_scoped_pool pool(p);
- if(ap_get_module_config(s->module_config, &mod_tuscany_wiring) == NULL) {
- cfailure << "[Tuscany] Due to one or more errors mod_tuscany_wiring loading failed. Causing apache to stop loading." << endl;
- exit(APEXIT_CHILDFATAL);
- }
-}
-
-/**
- * Configuration commands.
- */
-const char *confContribution(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.contributionPath = arg;
- return NULL;
-}
-const char *confComposite(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.compositeName = arg;
- return NULL;
-}
-const char *confVirtualDomain(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.virtualHostDomain = arg;
- return NULL;
-}
-const char *confVirtualContribution(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.virtualHostContributionPath = arg;
- return NULL;
-}
-const char *confVirtualComposite(cmd_parms *cmd, unused void *c, const char *arg) {
- gc_scoped_pool pool(cmd->pool);
- ServerConf& sc = httpd::serverConf<ServerConf>(cmd, &mod_tuscany_wiring);
- sc.virtualHostCompositeName = arg;
- return NULL;
-}
-
-/**
- * HTTP server module declaration.
- */
-const command_rec commands[] = {
- AP_INIT_TAKE1("SCAContribution", (const char*(*)())confContribution, NULL, RSRC_CONF, "SCA contribution location"),
- AP_INIT_TAKE1("SCAComposite", (const char*(*)())confComposite, NULL, RSRC_CONF, "SCA composite location"),
- AP_INIT_TAKE1("SCAVirtualDomain", (const char*(*)())confVirtualDomain, NULL, RSRC_CONF, "SCA virtual host domain"),
- AP_INIT_TAKE1("SCAVirtualContribution", (const char*(*)())confVirtualContribution, NULL, RSRC_CONF, "SCA virtual host contribution location"),
- AP_INIT_TAKE1("SCAVirtualComposite", (const char*(*)())confVirtualComposite, NULL, RSRC_CONF, "SCA virtual host composite location"),
- {NULL, NULL, NULL, 0, NO_ARGS, NULL}
-};
-
-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_handler(handler, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_translate_name(translate, NULL, NULL, APR_HOOK_FIRST);
-}
-
-}
-}
-}
-
-extern "C" {
-
-module AP_MODULE_DECLARE_DATA mod_tuscany_wiring = {
- STANDARD20_MODULE_STUFF,
- // dir config and merger
- NULL, NULL,
- // server config and merger
- tuscany::httpd::makeServerConf<tuscany::server::modwiring::ServerConf>, NULL,
- // commands and hooks
- tuscany::server::modwiring::commands, tuscany::server::modwiring::registerHooks
-};
-
-}
diff --git a/sca-cpp/trunk/modules/server/server-conf b/sca-cpp/trunk/modules/server/server-conf
index 47934f973e..83eea0cc6c 100755
--- a/sca-cpp/trunk/modules/server/server-conf
+++ b/sca-cpp/trunk/modules/server/server-conf
@@ -31,13 +31,6 @@ else
libsuffix=".so"
fi
-cat >>$root/conf/modules.conf <<EOF
-# Generated by: server-conf $*
-# Support for SCA component wiring
-LoadModule mod_tuscany_wiring $here/libmod_tuscany_wiring$libsuffix
-
-EOF
-
cat >>$root/conf/httpd.conf <<EOF
# Generated by: server-conf $*
# Serve JavaScript client scripts