summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/edit/dashboard.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-03-08 08:18:07 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-03-08 08:18:07 +0000
commit49b878b1b0f2e52bbd5282c22ac32a68e1e8736c (patch)
tree1eb26926f9d703c61b329a0f07178090b57cd55d /sca-cpp/trunk/modules/edit/dashboard.py
parent5b33dc5c5a87fff146951ca0543bf558454c331d (diff)
Change ATOM and RSS feed representations to use name value pairs instead of just strings, to allow support for all ATOM and RSS attributes and avoid confusion with non-feed string results.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1079292 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/edit/dashboard.py')
-rw-r--r--sca-cpp/trunk/modules/edit/dashboard.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/sca-cpp/trunk/modules/edit/dashboard.py b/sca-cpp/trunk/modules/edit/dashboard.py
index 825bf8b405..4dd48ccc17 100644
--- a/sca-cpp/trunk/modules/edit/dashboard.py
+++ b/sca-cpp/trunk/modules/edit/dashboard.py
@@ -34,7 +34,8 @@ def getdashboard(id, cache):
# Post a new app to the user's dashboard
def post(collection, app, user, cache):
id = (str(uuid.uuid1()),)
- dashboard = cons((car(app), car(id), caddr(app)), getdashboard(dashboardid(user), cache))
+ newapp = list("'entry", cadr(car(app)), list("'id", id), cadddr(car(app)))
+ dashboard = cons(newapp, getdashboard(dashboardid(user), cache))
cache.put(dashboardid(user), dashboard)
return id
@@ -42,9 +43,9 @@ def post(collection, app, user, cache):
def put(id, app, user, cache):
def putapp(app, dashboard):
if isNil(dashboard):
- return (app,)
- if cadr(app) == cadr(car(dashboard)):
- return cons(app, cdr(dashboard))
+ return app
+ if cadr(caddr(car(app))) == cadr(caddr(car(dashboard))):
+ return cons(car(app), cdr(dashboard))
return cons(car(dashboard), putapp(app, cdr(dashboard)))
dashboard = putapp(app, getdashboard(dashboardid(user), cache))
@@ -56,12 +57,12 @@ def get(id, user, cache):
def findapp(id, dashboard):
if isNil(dashboard):
return None
- if car(id) == cadr(car(dashboard)):
- return car(dashboard)
+ if car(id) == cadr(caddr(car(dashboard))):
+ return (car(dashboard),)
return findapp(id, cdr(dashboard))
if isNil(id):
- return ("Your Apps", user.id()) + getdashboard(dashboardid(user), cache)
+ return ((("'feed", ("'title", "Your Apps"), ("'id", user.id())) + getdashboard(dashboardid(user), cache)),)
return findapp(id, getdashboard(dashboardid(user), cache))
# Delete apps from the user's dashboard
@@ -72,7 +73,7 @@ def delete(id, user, cache):
def deleteapp(id, dashboard):
if isNil(dashboard):
return ()
- if car(id) == cadr(car(dashboard)):
+ if car(id) == cadr(caddr(car(dashboard))):
return cdr(dashboard)
return cons(car(dashboard), deleteapp(id, cdr(dashboard)))