From 98a6c203285b86758f333b8dcff69f78e53e7f74 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 18 Jan 2011 09:07:34 +0000 Subject: Fix XML serialization issues with XHTML docs and add ability to save widgets. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1060250 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/edit/apps.py | 6 +- sca-cpp/trunk/modules/edit/apps/store/app.html | 2 +- sca-cpp/trunk/modules/edit/apps/store2/app.html | 2 +- sca-cpp/trunk/modules/edit/apps/store3/app.html | 2 +- .../trunk/modules/edit/htdocs/dash/dashboard.html | 43 ++++++++++---- sca-cpp/trunk/modules/edit/htdocs/graph/graph.html | 4 +- sca-cpp/trunk/modules/edit/htdocs/page/page.html | 62 ++++++++++++++++---- sca-cpp/trunk/modules/edit/pages.py | 7 ++- sca-cpp/trunk/modules/edit/start | 2 +- sca-cpp/trunk/modules/js/htdocs/ui.css | 2 +- sca-cpp/trunk/modules/js/htdocs/xmlutil.js | 66 ++++++++++++++++------ 11 files changed, 148 insertions(+), 50 deletions(-) (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/modules/edit/apps.py b/sca-cpp/trunk/modules/edit/apps.py index 61cdfe07ef..fa3307bfca 100644 --- a/sca-cpp/trunk/modules/edit/apps.py +++ b/sca-cpp/trunk/modules/edit/apps.py @@ -27,12 +27,14 @@ def appid(id): # Post a new app to the apps db def post(collection, app, cache): id = appid((str(uuid.uuid1()),)) - cache.put((id,), app) + comp = caddr(app) + cache.put((id,), comp) return id # Put an app into the apps db def put(id, app, cache): - cache.put(appid(id), app) + comp = caddr(app) + cache.put(appid(id), comp) return True # Get an app from the apps db diff --git a/sca-cpp/trunk/modules/edit/apps/store/app.html b/sca-cpp/trunk/modules/edit/apps/store/app.html index 542023613a..ba64d84958 100644 --- a/sca-cpp/trunk/modules/edit/apps/store/app.html +++ b/sca-cpp/trunk/modules/edit/apps/store/app.html @@ -27,6 +27,6 @@ -(feed) +(feed) diff --git a/sca-cpp/trunk/modules/edit/apps/store2/app.html b/sca-cpp/trunk/modules/edit/apps/store2/app.html index 542023613a..ba64d84958 100644 --- a/sca-cpp/trunk/modules/edit/apps/store2/app.html +++ b/sca-cpp/trunk/modules/edit/apps/store2/app.html @@ -27,6 +27,6 @@ -(feed) +(feed) diff --git a/sca-cpp/trunk/modules/edit/apps/store3/app.html b/sca-cpp/trunk/modules/edit/apps/store3/app.html index 542023613a..ba64d84958 100644 --- a/sca-cpp/trunk/modules/edit/apps/store3/app.html +++ b/sca-cpp/trunk/modules/edit/apps/store3/app.html @@ -27,6 +27,6 @@ -(feed) +(feed) diff --git a/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html b/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html index b45c0ffe24..71f9c61c41 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html +++ b/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html @@ -33,22 +33,25 @@

->Add Delete +
@@ -100,31 +103,46 @@ function getapps(sync) { } /** - * Toggle new app form link event. + * Display create app form. */ -$('addAppLink').onclick = function() { +$('createAppButton').onclick = function() { var div = $('newApp'); - div.style.visibility = div.style.visibility == 'hidden'? 'visible' : 'hidden'; + div.style.visibility = 'visible'; $('appName').focus(); return false; }; /** - * Add a new app button event. + * Create an app. */ -$('addAppButton').onclick = function() { +$('createAppOKButton').onclick = function() { var name = $('appName').value; var title = $('appTitle').value; var app = mklist(title, name, mklist()); var entry = atom.writeATOMEntry(app); dashboard.put(name, car(entry)); + $('appName').value = ''; + $('appTitle').title = ''; getapps(); + div.style.visibility = 'visible'; return false; }; /** - * Delete apps event. + * Cancel creating an app. */ +$('createAppCancelButton').onclick = function() { + var div = $('newApp'); + div.style.visibility = 'hidden'; + $('appName').value = ''; + $('appTitle').title = ''; + return false; +}; + +/** + * Delete an app. + */ +/* $('deleteAppLink').onclick = function() { var apps = $('appsForm').apps; if (isNil(apps)) @@ -140,6 +158,7 @@ $('deleteAppLink').onclick = function() { getapps(); return false; }; +*/ // Get and display the list of apps getapps(true); diff --git a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html index fd9ae694a7..5eb8c6cc1e 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html +++ b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html @@ -31,7 +31,7 @@ - +
PaletteApp
PaletteApp
diff --git a/sca-cpp/trunk/modules/edit/pages.py b/sca-cpp/trunk/modules/edit/pages.py index 1e81a67332..e96e503730 100644 --- a/sca-cpp/trunk/modules/edit/pages.py +++ b/sca-cpp/trunk/modules/edit/pages.py @@ -18,6 +18,7 @@ # App pages collection implementation import uuid import sys +from sys import stderr from util import * # Convert an id to an app id @@ -27,12 +28,14 @@ def appid(id): # Post a new app page to the apps db def post(collection, app, cache): id = appid((str(uuid.uuid1()),)) - cache.put((id,), app) + xhtml = caddr(app); + cache.put((id,), xhtml) return id # Put an app page into the apps db def put(id, app, cache): - cache.put(appid(id), app) + xhtml = caddr(app); + cache.put(appid(id), xhtml) return True # Get an app page from the apps db diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/modules/edit/start index fe5d039a4b..7750571423 100755 --- a/sca-cpp/trunk/modules/edit/start +++ b/sca-cpp/trunk/modules/edit/start @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -../http/httpd-conf tmp 10.1.1.62 8090 htdocs +../http/httpd-conf tmp localhost 8090 htdocs ../server/server-conf tmp ../python/python-conf tmp cat >>tmp/conf/httpd.conf <