Author: jsdelfino
Date: Mon Feb 20 07:20:38 2012
New Revision: 1291136
URL: http://svn.apache.org/viewvc?rev=1291136&view=rev
Log:
Fixes to the hosting module to correctly store ATOM feeds instead of raw
collections and work with the sqldb component.
Added:
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
Removed:
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/
Modified:
tuscany/sca-cpp/trunk/components/cache/memcache.hpp
tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf
tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp
tuscany/sca-cpp/trunk/hosting/server/accounts.py
tuscany/sca-cpp/trunk/hosting/server/apps.py
tuscany/sca-cpp/trunk/hosting/server/composites.py
tuscany/sca-cpp/trunk/hosting/server/dashboards.py
tuscany/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite
tuscany/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite
tuscany/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps
tuscany/sca-cpp/trunk/hosting/server/data/store/all/store.apps
tuscany/sca-cpp/trunk/hosting/server/data/store/featured/store.apps
tuscany/sca-cpp/trunk/hosting/server/data/store/new/store.apps
tuscany/sca-cpp/trunk/hosting/server/data/store/top/store.apps
tuscany/sca-cpp/trunk/hosting/server/htdocs/graph/index.html
tuscany/sca-cpp/trunk/hosting/server/htdocs/page/index.html
tuscany/sca-cpp/trunk/hosting/server/pages.py
tuscany/sca-cpp/trunk/hosting/server/palettes.py
tuscany/sca-cpp/trunk/hosting/server/selector.py
tuscany/sca-cpp/trunk/hosting/server/store.py
tuscany/sca-cpp/trunk/modules/http/Makefile.am
tuscany/sca-cpp/trunk/modules/http/http.hpp
Modified: tuscany/sca-cpp/trunk/components/cache/memcache.hpp
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/memcache.hpp?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/memcache.hpp (original)
+++ tuscany/sca-cpp/trunk/components/cache/memcache.hpp Mon Feb 20 07:20:38 2012
@@ -63,7 +63,7 @@ public:
MemCached(const list<string>& servers) : owner(true) {
debug(servers, "memcache::memcached::servers");
apr_pool_create(&pool, NULL);
- apr_memcache_create(pool, 1, 0, &mc);
+ apr_memcache_create(pool, (apr_uint16_t)length(servers), 0, &mc);
addServers(servers);
}
Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf Mon Feb 20 07:20:38 2012
@@ -98,7 +98,7 @@ host replication all
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'`
Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf Mon Feb 20
07:20:38 2012
@@ -63,7 +63,7 @@ mkdir -p $root/sqldb/archive
# Initialize from a backup of the master
if [ ! -f $root/sqldb/data/postgresql.conf ]; then
- (wget http://$mhost:$mhttpport/pgsql-backup -O - | tar -C $root/sqldb -xz)
2>&1 | sh $root/sqldb/logger
+ (curl -L http://$mhost:$mhttpport/pgsql-backup | tar -C $root/sqldb -xz)
2>&1 | sh $root/sqldb/logger
rm -rf $root/sqldb/data/postmaster.pid $root/sqldb/data/pg_xlog
mkdir -p $root/sqldb/data/pg_xlog/archive_status
chmod 700 $root/sqldb/data/pg_xlog/archive_status
@@ -104,7 +104,7 @@ primary_conninfo = 'host=$mhost port=$mp
# Failover
trigger_file = '$root/sqldb/failover'
-restore_command = 'wget http://$mhost:$mhttpport/pgsql-archive/%f -O "%p"'
+restore_command = 'curl http://$mhost:$mhttpport/pgsql-archive/%f -o "%p"'
EOF
Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp Mon Feb 20 07:20:38 2012
@@ -231,7 +231,9 @@ const failable<value> get(const value& k
return mkfailure<value>(string("Couldn't execute select postgresql SQL
statement: ") + pgfailure(r, pgsql.conn));
if (PQntuples(r) < 1) {
PQclear(r);
- return mkfailure<value>(string("Couldn't get postgresql entry: ") +
PQerrorMessage(pgsql.conn));
+ ostringstream os;
+ os << "Couldn't get postgresql entry: " << key;
+ return mkfailure<value>(str(os));
}
const char* data = PQgetvalue(r, 0, 1);
const value val(scheme::readValue(string(data)));
Modified: tuscany/sca-cpp/trunk/hosting/server/accounts.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/accounts.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/accounts.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/accounts.py Mon Feb 20 07:20:38 2012
@@ -20,7 +20,7 @@ from util import *
# Convert a particular user id to an account id
def accountid(user):
- return ("'accounts", "'" + user.id(), "'user.account")
+ return ("accounts", user.id(), "user.account")
# Get the current user's account
def get(id, user, cache):
Modified: tuscany/sca-cpp/trunk/hosting/server/apps.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/apps.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/apps.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/apps.py Mon Feb 20 07:20:38 2012
@@ -21,17 +21,7 @@ from util import *
# Convert an id to an app id
def appid(id):
- return ("'apps", "'" + car(id), "'app.stats")
-
-# Link implementation resources into an app
-def mkapplink(id):
- try:
- 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
+ return ("apps", car(id), "app.stats")
# Put an app into the apps db
def put(id, app, cache, store, composites, pages):
@@ -41,12 +31,10 @@ def put(id, app, cache, store, composite
# Update app in apps db
if car(id) == eid:
cache.put(appid(id), appentry)
- mkapplink(id)
return True
# Clone an app's composite and page
cache.put(appid(id), appentry)
- mkapplink(id)
composites.put(id, composites.get((eid,)))
pages.put(id, pages.get((eid,)))
return True
Modified: tuscany/sca-cpp/trunk/hosting/server/composites.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/composites.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/composites.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/composites.py Mon Feb 20 07:20:38 2012
@@ -20,7 +20,7 @@ from util import *
# Convert an id to an app id
def appid(id):
- return ("'apps", "'" + car(id), "'app.composite")
+ return ("apps", car(id), "app.composite")
# Put an app into the apps db
def put(id, app, cache):
Modified: tuscany/sca-cpp/trunk/hosting/server/dashboards.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/dashboards.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/dashboards.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/dashboards.py Mon Feb 20 07:20:38 2012
@@ -20,14 +20,18 @@ from util import *
# Convert a particular user id to a dashboard id
def dashboardid(user):
- return ("'dashboards", "'" + user.id(), "'user.apps")
+ return ("dashboards", user.id(), "user.apps")
# Get a dashboard from the cache
def getdashboard(id, cache):
- dashboard = cache.get(id)
- if isNil(dashboard) or dashboard is None:
+ val = cache.get(id)
+ if isNil(val) or val is None:
return ()
- return dashboard
+ return cdddr(car(val))
+
+# Put a dashboard into the cache
+def putdashboard(id, dashboard, cache):
+ val = ((("'feed", ("'title", "Your Apps"), ("'id", cadr(id))) +
dashboard),)
# Put an app into the user's dashboard
def put(id, app, user, cache, apps):
@@ -40,7 +44,7 @@ def put(id, app, user, cache, apps):
appentry = (("'entry", cadr(car(app)), ("'id", car(id))),)
dashboard = putapp(appentry, getdashboard(dashboardid(user), cache))
- cache.put(dashboardid(user), dashboard)
+ putdashboard(dashboardid(user), dashboard, cache)
# Update app in app repository
apps.put(id, app);
@@ -72,7 +76,7 @@ def delete(id, user, cache, apps):
return cons(car(dashboard), deleteapp(id, cdr(dashboard)))
dashboard = deleteapp(id, getdashboard(dashboardid(user), cache))
- cache.put(dashboardid(user), dashboard)
+ putdashboard(dashboardid(user), dashboard, cache)
# Delete app from app repository
apps.delete(id);
Modified:
tuscany/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite
(original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/apps/testevents/app.composite Mon
Feb 20 07:20:38 2012
@@ -123,7 +123,7 @@
<component name="name2" title="" color="orange1">
<implementation.python script="nuvem/name.py"/>
<service name="name"/>
- <property>https://testhttp.sca-store.com:8453/components/property</property>
+ <property>https://testhttp.example.com:8453/components/property</property>
</component>
<component name="number" title="#" color="orange1">
<implementation.python script="nuvem/number.py"/>
@@ -182,7 +182,7 @@
<component name="text5" title=" '{propval}'" color="orange1">
<implementation.python script="nuvem/text.py"/>
<service name="text"/>
- <property>https://testhttp.sca-store.com:8453/components/property</property>
+ <property>https://testhttp.example.com:8453/components/property</property>
</component>
<component x="13" y="58" name="timer3" title="timer" color="green1">
<implementation.python script="nuvem/timer.py"/>
Modified: tuscany/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite
(original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/apps/testhttp/app.composite Mon
Feb 20 07:20:38 2012
@@ -146,7 +146,7 @@
<component name="name" title="" color="orange1">
<implementation.python script="nuvem/name.py"/>
<service name="name"/>
- <property>https://testhttp.sca-store.com:8453/components/property</property>
+ <property>https://testhttp.example.com:8453/components/property</property>
</component>
<component x="630" y="350" name="name1" title="" color="orange1">
<implementation.python script="nuvem/name.py"/>
Modified: tuscany/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite
(original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/apps/testurl/app.composite Mon
Feb 20 07:20:38 2012
@@ -93,7 +93,7 @@
<component name="text" title=" '{propval}'" color="orange1">
<implementation.python script="nuvem/text.py"/>
<service name="text"/>
- <property>http://sca-store.com/</property>
+ <property>http://example.com/</property>
</component>
<component x="400" y="10" name="text1" title=" '{propval}'" color="orange1">
<implementation.python script="nuvem/text.py"/>
Added:
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/dashboards/jane%40example.com/user.apps?rev=1291136&view=auto
==============================================================================
---
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
(added)
+++
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
Mon Feb 20 07:20:38 2012
@@ -0,0 +1 @@
+((feed (title "Your Apps") (id "[email protected]") (entry (title "An empty
test app") (id "test"))))
Modified:
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/dashboards/jane%40localhost/user.apps?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
---
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps
(original)
+++
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/jane@localhost/user.apps
Mon Feb 20 07:20:38 2012
@@ -1 +1 @@
-((entry (title "An empty test app") (id "test")))
+((feed (title "Your Apps") (id "jane@localhost") (entry (title "An empty test
app") (id "test"))))
Added:
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/dashboards/john%40example.com/user.apps?rev=1291136&view=auto
==============================================================================
---
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
(added)
+++
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/[email protected]/user.apps
Mon Feb 20 07:20:38 2012
@@ -0,0 +1 @@
+((feed (title "Your Apps") (id "[email protected]") (entry (title "An empty
test app") (id "test"))))
Modified:
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/dashboards/john%40localhost/user.apps?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
---
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps
(original)
+++
tuscany/sca-cpp/trunk/hosting/server/data/dashboards/john@localhost/user.apps
Mon Feb 20 07:20:38 2012
@@ -1 +1 @@
-((entry (title "An empty test app") (id "test")))
+((feed (title "Your Apps") (id "john@localhost") (entry (title "An empty test
app") (id "test"))))
Modified: tuscany/sca-cpp/trunk/hosting/server/data/store/all/store.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/store/all/store.apps?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/store/all/store.apps (original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/store/all/store.apps Mon Feb 20
07:20:38 2012
@@ -1 +1 @@
-((entry (title "Check my public social data") (id "me360")) (entry (title
"Where are my friends") (id "nearme")) (entry (title "Where are my friends")
(id "nearme2")) (entry (title "Our photos of an event") (id "ourphotos"))
(entry (title "Slice") (id "slice")) (entry (title "My online store") (id
"shoppingcart")) (entry (title "SMS send service") (id "twsms")) (entry (title
"An empty test app") (id "test")) (entry (title "Test values and lists") (id
"testvalues")) (entry (title "Test social components") (id "testsocial"))
(entry (title "Test URL components") (id "testurl")) (entry (title "Test logic
components") (id "testlogic")) (entry (title "Test text processing components")
(id "testtext")) (entry (title "Test HTTP components") (id "testhttp")) (entry
(title "Test SMS API") (id "testsms")) (entry (title "Test widgets") (id
"testwidgets")) (entry (title "Test more widgets") (id "testwidgets2")) (entry
(title "Test event components") (id "testevents")) (entry (title "Test
search components") (id "testsearch")) (entry (title "Test database
components") (id "testdb")) (entry (title "Test HTML generator components") (id
"testwidgets3")) (entry (title "Test animation components") (id
"testanimation")))
+((feed (title "App Store") (id "all") (entry (title "Check my public social
data") (id "me360")) (entry (title "Where are my friends") (id "nearme"))
(entry (title "Where are my friends") (id "nearme2")) (entry (title "Our photos
of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry
(title "My online store") (id "shoppingcart")) (entry (title "SMS send
service") (id "twsms")) (entry (title "An empty test app") (id "test")) (entry
(title "Test values and lists") (id "testvalues")) (entry (title "Test social
components") (id "testsocial")) (entry (title "Test URL components") (id
"testurl")) (entry (title "Test logic components") (id "testlogic")) (entry
(title "Test text processing components") (id "testtext")) (entry (title "Test
HTTP components") (id "testhttp")) (entry (title "Test SMS API") (id
"testsms")) (entry (title "Test widgets") (id "testwidgets")) (entry (title
"Test more widgets") (id "testwidgets2")) (entry (title "Test event
components") (
id "testevents")) (entry (title "Test search components") (id "testsearch"))
(entry (title "Test database components") (id "testdb")) (entry (title "Test
HTML generator components") (id "testwidgets3")) (entry (title "Test animation
components") (id "testanimation"))))
Modified: tuscany/sca-cpp/trunk/hosting/server/data/store/featured/store.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/store/featured/store.apps?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/store/featured/store.apps
(original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/store/featured/store.apps Mon Feb
20 07:20:38 2012
@@ -1 +1 @@
-((entry (title "Check my public social data") (id "me360")) (entry (title
"Where are my friends") (id "nearme")) (entry (title "Where are my friends")
(id "nearme2")) (entry (title "Our photos of an event") (id "ourphotos"))
(entry (title "Slice") (id "slice")) (entry (title "My online store") (id
"shoppingcart")) (entry (title "SMS send service") (id "twsms")))
+((feed (title "App Store") (id "featured") (entry (title "Check my public
social data") (id "me360")) (entry (title "Where are my friends") (id
"nearme")) (entry (title "Where are my friends") (id "nearme2")) (entry (title
"Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id
"slice")) (entry (title "My online store") (id "shoppingcart")) (entry (title
"SMS send service") (id "twsms"))))
Modified: tuscany/sca-cpp/trunk/hosting/server/data/store/new/store.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/store/new/store.apps?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/store/new/store.apps (original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/store/new/store.apps Mon Feb 20
07:20:38 2012
@@ -1 +1 @@
-((entry (title "Check my public social data") (id "me360")) (entry (title
"Where are my friends") (id "nearme")) (entry (title "Where are my friends")
(id "nearme2")) (entry (title "Our photos of an event") (id "ourphotos"))
(entry (title "Slice") (id "slice")) (entry (title "My online store") (id
"shoppingcart")) (entry (title "SMS send service") (id "twsms")))
+((feed (title "App Store") (id "new") (entry (title "Check my public social
data") (id "me360")) (entry (title "Where are my friends") (id "nearme"))
(entry (title "Where are my friends") (id "nearme2")) (entry (title "Our photos
of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry
(title "My online store") (id "shoppingcart")) (entry (title "SMS send
service") (id "twsms"))))
Modified: tuscany/sca-cpp/trunk/hosting/server/data/store/top/store.apps
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/data/store/top/store.apps?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/data/store/top/store.apps (original)
+++ tuscany/sca-cpp/trunk/hosting/server/data/store/top/store.apps Mon Feb 20
07:20:38 2012
@@ -1 +1 @@
-((entry (title "Check my public social data") (id "me360")) (entry (title
"Where are my friends") (id "nearme")) (entry (title "Where are my friends")
(id "nearme2")) (entry (title "Our photos of an event") (id "ourphotos"))
(entry (title "Slice") (id "slice")) (entry (title "My online store") (id
"shoppingcart")) (entry (title "SMS send service") (id "twsms")))
+((feed (title "App Store") (id "top") (entry (title "Check my public social
data") (id "me360")) (entry (title "Where are my friends") (id "nearme"))
(entry (title "Where are my friends") (id "nearme2")) (entry (title "Our photos
of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry
(title "My online store") (id "shoppingcart")) (entry (title "SMS send
service") (id "twsms"))))
Modified: tuscany/sca-cpp/trunk/hosting/server/htdocs/graph/index.html
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/htdocs/graph/index.html?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/htdocs/graph/index.html (original)
+++ tuscany/sca-cpp/trunk/hosting/server/htdocs/graph/index.html Mon Feb 20
07:20:38 2012
@@ -1997,7 +1997,7 @@ function installpalette(name, pos, g, bg
function save(savexml) {
showStatus('Saving');
savedcomposxml = savexml;
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
+ var entry = '<?xml version="1.0" encoding="UTF-8"?>\n' + '<entry
xmlns="http://www.w3.org/2005/Atom">' +
'<title type="text">' + appname + '</title><id>' + appname +
'</id><content type="application/xml">' +
savedcomposxml + '</content></entry>';
composites.put(appname, entry, function(e) {
Modified: tuscany/sca-cpp/trunk/hosting/server/htdocs/page/index.html
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/htdocs/page/index.html?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/htdocs/page/index.html (original)
+++ tuscany/sca-cpp/trunk/hosting/server/htdocs/page/index.html Mon Feb 20
07:20:38 2012
@@ -872,7 +872,7 @@ function save(newxml) {
savedpagexhtml = newxml;
// Update the page ATOM entry
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
+ var entry = '<?xml version="1.0" encoding="UTF-8"?>\n' + '<entry
xmlns="http://www.w3.org/2005/Atom">' +
'<title type="text">' + appname + '</title><id>' + appname +
'</id><content type="application/xml">' +
newxml + '</content></entry>';
Modified: tuscany/sca-cpp/trunk/hosting/server/pages.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/pages.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/pages.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/pages.py Mon Feb 20 07:20:38 2012
@@ -20,7 +20,7 @@ from util import *
# Convert an id to an app id
def appid(id):
- return ("'apps", "'" + 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):
Modified: tuscany/sca-cpp/trunk/hosting/server/palettes.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/palettes.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/palettes.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/palettes.py Mon Feb 20 07:20:38 2012
@@ -20,7 +20,7 @@ from util import *
# Convert an id to a palette id
def paletteid(id):
- return ("'palettes", "'" + car(id), "'palette.composite")
+ return ("palettes", car(id), "palette.composite")
# Put a palette into the palettes db
def put(id, palette, cache):
Modified: tuscany/sca-cpp/trunk/hosting/server/selector.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/selector.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/selector.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/selector.py Mon Feb 20 07:20:38 2012
@@ -19,10 +19,10 @@
from util import *
# Get the database to use for a particular key
-def get(id, db1, db2):
+def get(id, db):
if isNil(id):
- return db1
+ return db[0]
if cadr(id)[0:1].lower() < 'm':
- return db1
- return db2
+ return db[0]
+ return db[1]
Modified: tuscany/sca-cpp/trunk/hosting/server/store.py
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/hosting/server/store.py?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/hosting/server/store.py (original)
+++ tuscany/sca-cpp/trunk/hosting/server/store.py Mon Feb 20 07:20:38 2012
@@ -20,14 +20,18 @@ from util import *
# Convert a particular store tag to a store id
def storeid(tag):
- return ("'store", "'" + tag, "'store.apps")
+ return ("store", tag, "store.apps")
# Get a store from the cache
def getstore(id, cache):
- store = cache.get(id)
- if isNil(store) or store is None:
+ val = cache.get(id)
+ if isNil(val) or val is None:
return ()
- return store
+ return cdddr(car(val))
+
+# Put a store into the cache
+def putstore(id, store, cache):
+ val = ((("'feed", ("'title", "App Store"), ("'id", cadr(id))) + store),)
# Put an app into a store
def put(key, app, cache):
@@ -40,7 +44,7 @@ def put(key, app, cache):
tag = car(key)
store = putapp(app, getstore(storeid(tag), cache))
- cache.put(storeid(tag), store)
+ putstore(storeid(tag), store, cache)
return True
# Get apps from a store
@@ -75,6 +79,6 @@ def delete(key, cache):
return cons(car(store), deleteapp(id, cdr(store)))
store = deleteapp(id, getstore(storeid(tag), cache))
- cache.put(storeid(tag), store)
+ putstore(storeid(tag), store, cache)
return True
Modified: tuscany/sca-cpp/trunk/modules/http/Makefile.am
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/Makefile.am?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/http/Makefile.am Mon Feb 20 07:20:38 2012
@@ -20,7 +20,7 @@ INCLUDES = -I${HTTPD_INCLUDE}
incl_HEADERS = *.hpp
incldir = $(prefix)/include/modules/http
-dist_mod_SCRIPTS = httpd-conf httpd-addr httpd-start httpd-stop httpd-restart
ssl-ca-conf ssl-cert-conf ssl-cert-find httpd-ssl-conf basic-auth-conf
cert-auth-conf form-auth-conf open-auth-conf passwd-auth-conf group-auth-conf
proxy-conf proxy-ssl-conf proxy-member-conf proxy-ssl-member-conf
proxy-ssl-nossl-member-conf vhost-conf vhost-ssl-conf tunnel-ssl-conf
httpd-worker-conf httpd-event-conf minify-html minify-js minify-css
+dist_mod_SCRIPTS = httpd-conf httpd-addr httpd-start httpd-stop httpd-restart
ssl-ca-conf ssl-cert-conf ssl-cert-find httpd-ssl-conf basic-auth-conf
cert-auth-conf form-auth-conf open-auth-conf passwd-auth-conf group-auth-conf
proxy-conf proxy-ssl-conf proxy-member-conf proxy-ssl-member-conf
proxy-ssl-nossl-member-conf vhost-conf vhost-ssl-conf tunnel-ssl-conf
httpd-worker-conf httpd-event-conf httpd-loglevel-conf minify-html minify-js
minify-css
moddir = $(prefix)/modules/http
curl_test_SOURCES = curl-test.cpp
Modified: tuscany/sca-cpp/trunk/modules/http/http.hpp
URL:
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/http.hpp?rev=1291136&r1=1291135&r2=1291136&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/http.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/http.hpp Mon Feb 20 07:20:38 2012
@@ -634,7 +634,7 @@ const failable<list<list<string> > > con
if (isString(car<value>(c)) && !isNil(cdr<value>(c)) &&
isList(cadr<value>(c)))
return writeRequest(convertValues<string>(cadr<value>(c)),
car<value>(c));
- // Write an assoc value as a JSON result
+ // Write an assoc value as JSON
if (isSymbol(car<value>(c)) && !isNil(cdr<value>(c))) {
js::JSContext cx;
const list<value> lc = mklist<value>(c);
@@ -888,7 +888,7 @@ const string queryString(const list<list
* Filter path segment in a list of arguments.
*/
const bool filterPath(const value& arg) {
- return isString(arg);
+ return isString(arg) || isSymbol(arg);
}
/**
@@ -914,11 +914,13 @@ struct proxy {
}
const value operator()(const list<value>& args) const {
+ debug(args, "http::proxy::args");
const value fun = car(args);
if (fun == "get") {
const list<value> lp = filter<value>(filterPath, cadr(args));
- debug(lp, "http::queryString::arg");
+ debug(lp, "http::proxy::path");
const list<value> lq = map<value, value>(escapeQuery,
filter<value>(filterQuery, cadr(args)));
+ debug(lp, "http::proxy::query");
const value p = path(lp);
const value q = queryString(lq);
const failable<value> val = get(uri + p + (q != ""? string("?") +
q : string("")), cs);