Return-Path: Delivered-To: apmail-tuscany-commits-archive@www.apache.org Received: (qmail 75715 invoked from network); 30 Dec 2010 08:53:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Dec 2010 08:53:19 -0000 Received: (qmail 82313 invoked by uid 500); 30 Dec 2010 08:53:19 -0000 Delivered-To: apmail-tuscany-commits-archive@tuscany.apache.org Received: (qmail 82294 invoked by uid 500); 30 Dec 2010 08:53:19 -0000 Mailing-List: contact commits-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tuscany.apache.org Delivered-To: mailing list commits@tuscany.apache.org Received: (qmail 82287 invoked by uid 99); 30 Dec 2010 08:53:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Dec 2010 08:53:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Dec 2010 08:53:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 488732388BEF; Thu, 30 Dec 2010 08:52:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1053825 - in /tuscany/sca-cpp/trunk/modules/edit: dashboard.py htdocs/edit/edit.html htdocs/edit/index.html htdocs/index.html htdocs/main/dashboard.html htdocs/main/index.html workspaces/joe@localhost Date: Thu, 30 Dec 2010 08:52:57 -0000 To: commits@tuscany.apache.org From: jsdelfino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101230085257.488732388BEF@eris.apache.org> Author: jsdelfino Date: Thu Dec 30 08:52:56 2010 New Revision: 1053825 URL: http://svn.apache.org/viewvc?rev=1053825&view=rev Log: Add logic to list, add, remove apps and link to the edit page. Modified: tuscany/sca-cpp/trunk/modules/edit/dashboard.py tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/edit.html tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/index.html tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html tuscany/sca-cpp/trunk/modules/edit/htdocs/main/dashboard.html tuscany/sca-cpp/trunk/modules/edit/htdocs/main/index.html tuscany/sca-cpp/trunk/modules/edit/workspaces/joe@localhost Modified: tuscany/sca-cpp/trunk/modules/edit/dashboard.py URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/dashboard.py?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/dashboard.py (original) +++ tuscany/sca-cpp/trunk/modules/edit/dashboard.py Thu Dec 30 08:52:56 2010 @@ -34,7 +34,7 @@ def getworkspace(id, cache): # Post a new app to the user's workspace def post(collection, app, user, cache): id = (str(uuid.uuid1()),) - workspace = cons((car(app), id, caddr(app)), getworkspace(workspaceid(user), cache)) + workspace = cons((car(app), car(id), caddr(app)), getworkspace(workspaceid(user), cache)) cache.put(workspaceid(user), workspace) return id @@ -56,13 +56,13 @@ def get(id, user, cache): def findapp(id, workspace): if isNil(workspace): return None - if id == cadr(car(workspace)): + if car(id) == cadr(car(workspace)): return car(workspace) return findapp(id, cdr(workspace)) if isNil(id): return ("Your Apps", user.id()) + getworkspace(workspaceid(user), cache) - return findapp(car(id), getworkspace(workspaceid(user), cache)) + return findapp(id, getworkspace(workspaceid(user), cache)) # Delete apps from the user's workspace def delete(id, user, cache): @@ -72,7 +72,7 @@ def delete(id, user, cache): def deleteapp(id, workspace): if isNil(workspace): return () - if id == cadr(car(workspace)): + if car(id) == cadr(car(workspace)): return cdr(workspace) return cons(car(workspace), deleteapp(id, cdr(workspace))) Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/edit.html URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/edit.html?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/edit.html (original) +++ tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/edit.html Thu Dec 30 08:52:56 2010 @@ -35,34 +35,41 @@ var editWidget = sca.component("EditWidg var dashboard = sca.reference(editWidget, "dashboard"); var apps = sca.reference(editWidget, "apps"); -if (false) { -dashboard.get('', function(doc) { - var entries = cddr(atom.readATOMFeedDocument(doc)); - var entry = car(entries); - var item = caddr(entry); - var composite = cddr(item); - var comps = scdl.components(composite); - - var g = graph.mkgraph(); - var shapes = graph.composite(composite); - log(shapes); - for (var s in shapes) - g.appendChild(shapes[s]); -}); +/** + * Return the current app name. + */ +function appname() { + var qs = window.location.toString().split('?'); + if (isNil(cdr(qs))) + return null; + var p = cadr(qs).split('='); + if (isNil(p) || isNil(cdr(p))) + return null; + return cadr(p); } -apps.get('store', function(doc) { - var entry = atom.readATOMEntryDocument(doc); - var item = caddr(entry); - var composite = cddr(item); - var comps = scdl.components(composite); +/** + * Get an app and display it. + */ +function getapp(name) { + if (name == null) + return; + apps.get(name, function(doc) { + var entry = atom.readATOMEntryDocument(doc); + var item = caddr(entry); + var composite = cddr(item); + var comps = scdl.components(composite); + + var g = graph.mkgraph(); + var shapes = graph.composite(composite); + log(shapes); + for (var s in shapes) + g.appendChild(shapes[s]); + }); +} - var g = graph.mkgraph(); - var shapes = graph.composite(composite); - log(shapes); - for (var s in shapes) - g.appendChild(shapes[s]); -}); +// Display the current app +getapp(appname()); Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/index.html URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/index.html?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/index.html (original) +++ tuscany/sca-cpp/trunk/modules/edit/htdocs/edit/index.html Thu Dec 30 08:52:56 2010 @@ -24,9 +24,39 @@ - +

+
Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html (original) +++ tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html Thu Dec 30 08:52:56 2010 @@ -27,11 +27,11 @@

App Edit Tools

This module implements simple tools to help you create Tuscany apps.

-

App Dashboard

+

App Dashboard

Try the App Dashboard to manage your collection of apps.

-

App Editor

-

Try the App Editor to edit an app.

+

App Editor

+

Try the App Editor to edit an app.

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/main/dashboard.html URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/main/dashboard.html?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/htdocs/main/dashboard.html (original) +++ tuscany/sca-cpp/trunk/modules/edit/htdocs/main/dashboard.html Thu Dec 30 08:52:56 2010 @@ -45,8 +45,8 @@
- - + +
App name:e.g. mycoolapp
Title:e.g. My really cool app
App name:e.g. mycoolapp
Title:e.g. My really cool app
@@ -55,50 +55,94 @@ Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/main/index.html URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/main/index.html?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/htdocs/main/index.html (original) +++ tuscany/sca-cpp/trunk/modules/edit/htdocs/main/index.html Thu Dec 30 08:52:56 2010 @@ -29,6 +29,7 @@ Modified: tuscany/sca-cpp/trunk/modules/edit/workspaces/joe@localhost URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/workspaces/joe%40localhost?rev=1053825&r1=1053824&r2=1053825&view=diff ============================================================================== --- tuscany/sca-cpp/trunk/modules/edit/workspaces/joe@localhost (original) +++ tuscany/sca-cpp/trunk/modules/edit/workspaces/joe@localhost Thu Dec 30 08:52:56 2010 @@ -1 +1 @@ -(("Sample Store App" "store" ((composite (@xmlns "http://docs.oasis-open.org/ns/opencsa/sca/200912") (@xmlns:t "http://tuscany.apache.org/xmlns/sca/1.1") (@targetNamespace "http://store") (@name "store") (component (((@name "Store") (@color "yellow") (t:implementation.python (@script "store.py")) (service (@name "Widget") (t:binding.http (@uri "store"))) (reference (((@name "catalog") (@target "Catalog")) ((@name "shoppingCart") (@target "ShoppingCart/Cart")) ((@name "shoppingTotal") (@target "ShoppingCart/Total"))))) ((@name "Catalog") (@color "green") (t:implementation.python (@script "fruits-catalog.py")) (property "USD") (service (@name "Catalog") (t:binding.jsonrpc (@uri "catalog"))) (reference (@name "currencyConverter") (@target "CurrencyConverter"))) ((@name "ShoppingCart") (@color "pink") (t:implementation.python (@script "shopping-cart.py")) (service (((@name "ShoppingCart") (t:binding.atom (@uri "shoppingCart"))) ((@name "Total") (t:binding.jsonrpc (@uri "total")) ))) (reference (@name "cache") (@target "Cache") (@align "bottom"))) ((@name "CurrencyConverter") (@color "red") (t:implementation.python (@script "currency-converter.py")) (service (@name "CurrencyConverter") (t:binding.jsonrpc (@uri "currencyConverter")))) ((@name "Cache") (@color "blue") (implementation.cpp (@path "../../components/cache") (@library "libmemcache")) (service (@name "Cache") (@align "top") (t:binding.atom (@uri "cache"))) (property "localhost:11211")))))))("Another Store App" "store2" ((composite (@xmlns "http://docs.oasis-open.org/ns/opencsa/sca/200912") (@xmlns:t "http://tuscany.apache.org/xmlns/sca/1.1") (@targetNamespace "http://store") (@name "store") (component (((@name "Store") (@color "yellow") (t:implementation.python (@script "store.py")) (service (@name "Widget") (t:binding.http (@uri "store"))) (reference (((@name "catalog") (@target "Catalog")) ((@name "shoppingCart") (@target "ShoppingCart/Cart")) ((@name "shoppingTotal") (@target "ShoppingCar t/Total"))))) ((@name "Catalog") (@color "green") (t:implementation.python (@script "fruits-catalog.py")) (property "USD") (service (@name "Catalog") (t:binding.jsonrpc (@uri "catalog"))) (reference (@name "currencyConverter") (@target "CurrencyConverter"))) ((@name "ShoppingCart") (@color "pink") (t:implementation.python (@script "shopping-cart.py")) (service (((@name "ShoppingCart") (t:binding.atom (@uri "shoppingCart"))) ((@name "Total") (t:binding.jsonrpc (@uri "total"))))) (reference (@name "cache") (@target "Cache") (@align "bottom"))) ((@name "CurrencyConverter") (@color "red") (t:implementation.python (@script "currency-converter.py")) (service (@name "CurrencyConverter") (t:binding.jsonrpc (@uri "currencyConverter")))) ((@name "Cache") (@color "blue") (implementation.cpp (@path "../../components/cache") (@library "libmemcache")) (service (@name "Cache") (@align "top") (t:binding.atom (@uri "cache"))) (property "localhost:11211")))))))) +(("Sample Online Store App" "store" ()) ("Sample HTTP Relay App" "relay" ())) \ No newline at end of file