You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2011/05/23 08:42:23 UTC
svn commit: r1126333 - in /tuscany/sca-cpp/trunk/modules: edit/
edit/accounts/ edit/accounts/jane@localhost/
edit/accounts/jane@sca-store.com/ edit/accounts/john@localhost/
edit/accounts/john@sca-store.com/ edit/dashboards/ edit/htdocs/
edit/htdocs/acc...
Author: jsdelfino
Date: Mon May 23 06:42:22 2011
New Revision: 1126333
URL: http://svn.apache.org/viewvc?rev=1126333&view=rev
Log:
Refactor app data model part 1, add a template for new apps and support for saving account info.
Added:
tuscany/sca-cpp/trunk/modules/edit/accounts/
tuscany/sca-cpp/trunk/modules/edit/accounts.py
- copied, changed from r1126329, tuscany/sca-cpp/trunk/modules/edit/palettes.py
tuscany/sca-cpp/trunk/modules/edit/accounts/jane@localhost/
tuscany/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account
tuscany/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/
tuscany/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account
tuscany/sca-cpp/trunk/modules/edit/accounts/john@localhost/
tuscany/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account
tuscany/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/
tuscany/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account
tuscany/sca-cpp/trunk/modules/edit/dashboards.py
- copied, changed from r1126329, tuscany/sca-cpp/trunk/modules/edit/dashboard.py
tuscany/sca-cpp/trunk/modules/edit/htdocs/account/
tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html
Removed:
tuscany/sca-cpp/trunk/modules/edit/dashboard.py
tuscany/sca-cpp/trunk/modules/edit/dashboards/
tuscany/sca-cpp/trunk/modules/edit/store/
Modified:
tuscany/sca-cpp/trunk/modules/edit/edit.composite
tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.js
tuscany/sca-cpp/trunk/modules/edit/palettes.py
tuscany/sca-cpp/trunk/modules/edit/ssl-start
tuscany/sca-cpp/trunk/modules/edit/start
tuscany/sca-cpp/trunk/modules/edit/store.py
tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js
Copied: tuscany/sca-cpp/trunk/modules/edit/accounts.py (from r1126329, tuscany/sca-cpp/trunk/modules/edit/palettes.py)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/accounts.py?p2=tuscany/sca-cpp/trunk/modules/edit/accounts.py&p1=tuscany/sca-cpp/trunk/modules/edit/palettes.py&r1=1126329&r2=1126333&rev=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/palettes.py (original)
+++ tuscany/sca-cpp/trunk/modules/edit/accounts.py Mon May 23 06:42:22 2011
@@ -15,16 +15,21 @@
# specific language governing permissions and limitations
# under the License.
-# Palettes collection implementation
+# Accounts collection implementation
from util import *
-# Convert an id to a palette id
-def paletteid(id):
- return ("'" + car(id), "'palette.composite")
+# Convert a particular user id to an account id
+def accountid(user):
+ return ("'" + user.id(), "'user.account")
-# Get a palette from the palettes db
-def get(id, cache):
- if isNil(id):
- return (("'feed", ("'title", "Palettes"), ("'id", "palettes")),)
- return (("'entry", ("'title", car(id)), ("'id", car(id)), ("'content", car(cache.get(paletteid(id))))),)
+# Get the user's account
+def get(id, user, cache):
+ account = cache.get(accountid(user))
+ if isNil(account):
+ return ()
+ return account
+
+# Update the user's account
+def put(id, account, user, cache):
+ return cache.put(accountid(user), account)
Added: tuscany/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/accounts/jane%40localhost/user.account?rev=1126333&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account (added)
+++ tuscany/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account Mon May 23 06:42:22 2011
@@ -0,0 +1 @@
+((entry (title "Jane Doe") (id "jane@localhost")))
Added: tuscany/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/accounts/jane%40sca-store.com/user.account?rev=1126333&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account (added)
+++ tuscany/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account Mon May 23 06:42:22 2011
@@ -0,0 +1 @@
+((entry (title "Jane Doe") (id "jane@sca-store.com") (content (account (description "This is Jane") (keys (key (((@name "key1") (@value "value1")) ((@name "key2") (@value "value2")) ((@name "key3") (@value "value3")) ((@name "") (@value "")) ((@name "") (@value "")))))))))
\ No newline at end of file
Added: tuscany/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/accounts/john%40localhost/user.account?rev=1126333&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account (added)
+++ tuscany/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account Mon May 23 06:42:22 2011
@@ -0,0 +1 @@
+((entry (title "John Doe") (id "john@localhost")))
Added: tuscany/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/accounts/john%40sca-store.com/user.account?rev=1126333&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account (added)
+++ tuscany/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account Mon May 23 06:42:22 2011
@@ -0,0 +1 @@
+((entry (title "John Doe") (id "john@sca-store.com") (content (account (description "This is John") (keys (key (((@name "key1") (@value "value1")) ((@name "key2") (@value "value2")) ((@name "key3") (@value "value3")) ((@name "key4") (@value "value4")) ((@name "key5") (@value "value5")))))))))
\ No newline at end of file
Copied: tuscany/sca-cpp/trunk/modules/edit/dashboards.py (from r1126329, tuscany/sca-cpp/trunk/modules/edit/dashboard.py)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/dashboards.py?p2=tuscany/sca-cpp/trunk/modules/edit/dashboards.py&p1=tuscany/sca-cpp/trunk/modules/edit/dashboard.py&r1=1126329&r2=1126333&rev=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/dashboard.py (original)
+++ tuscany/sca-cpp/trunk/modules/edit/dashboards.py Mon May 23 06:42:22 2011
@@ -18,9 +18,9 @@
# Dashboards collection implementation
from util import *
-# Convert a particular user email to a dashboard id
+# Convert a particular user id to a dashboard id
def dashboardid(user):
- return ("'" + user.id(),)
+ return ("'" + user.id(), "'user.apps")
# Get a dashboard from the cache
def getdashboard(id, cache):
Modified: tuscany/sca-cpp/trunk/modules/edit/edit.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/edit.composite?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/edit.composite (original)
+++ tuscany/sca-cpp/trunk/modules/edit/edit.composite Mon May 23 06:42:22 2011
@@ -18,12 +18,11 @@
* under the License.
-->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace="http://edit"
name="edit">
<component name="User">
- <t:implementation.python script="user.py"/>
+ <implementation.python script="user.py"/>
<property name="user">?</property>
<property name="email">?</property>
<property name="nickname">?</property>
@@ -32,18 +31,15 @@
<property name="lastname">?</property>
<property name="realm">?</property>
<service name="User">
- <t:binding.http uri="user"/>
+ <binding.http uri="user"/>
</service>
</component>
- <component name="MenuWidget">
- <t:implementation.widget location="/menu.html"/>
- <reference name="user" target="User"/>
- </component>
-
<component name="EditWidget">
- <t:implementation.widget location="/index.html"/>
- <reference name="dashboard" target="Dashboard"/>
+ <implementation.widget location="/index.html"/>
+ <reference name="user" target="User"/>
+ <reference name="accounts" target="Accounts"/>
+ <reference name="dashboards" target="Dashboards"/>
<reference name="apps" target="Apps"/>
<reference name="store" target="AppStore"/>
<reference name="palettes" target="Palettes"/>
@@ -52,10 +48,19 @@
<reference name="log" target="Log"/>
</component>
- <component name="Dashboard">
- <t:implementation.python script="dashboard.py"/>
- <service name="Dashboard">
- <t:binding.http uri="dashboard"/>
+ <component name="Accounts">
+ <implementation.python script="accounts.py"/>
+ <service name="Accounts">
+ <binding.http uri="accounts"/>
+ </service>
+ <reference name="user" target="User"/>
+ <reference name="cache" target="AccountCache"/>
+ </component>
+
+ <component name="Dashboards">
+ <implementation.python script="dashboards.py"/>
+ <service name="Dashboards">
+ <binding.http uri="dashboards"/>
</service>
<reference name="user" target="User"/>
<reference name="cache" target="DashboardCache"/>
@@ -63,17 +68,17 @@
</component>
<component name="AppStore">
- <t:implementation.python script="store.py"/>
+ <implementation.python script="store.py"/>
<service name="AppStore">
- <t:binding.http uri="appstore"/>
+ <binding.http uri="appstore"/>
</service>
<reference name="cache" target="StoreCache"/>
</component>
<component name="Apps">
- <t:implementation.python script="apps.py"/>
+ <implementation.python script="apps.py"/>
<service name="Apps">
- <t:binding.http uri="apps"/>
+ <binding.http uri="apps"/>
</service>
<reference name="cache" target="AppCache"/>
<reference name="store" target="AppStore"/>
@@ -82,33 +87,53 @@
</component>
<component name="Composites">
- <t:implementation.python script="composites.py"/>
+ <implementation.python script="composites.py"/>
<service name="Composites">
- <t:binding.http uri="composites"/>
+ <binding.http uri="composites"/>
</service>
<reference name="cache" target="AppDocCache"/>
</component>
<component name="Pages">
- <t:implementation.python script="pages.py"/>
+ <implementation.python script="pages.py"/>
<service name="Pages">
- <t:binding.http uri="pages"/>
+ <binding.http uri="pages"/>
</service>
<reference name="cache" target="AppDocCache"/>
</component>
<component name="Palettes">
- <t:implementation.python script="palettes.py"/>
+ <implementation.python script="palettes.py"/>
<service name="Palettes">
- <t:binding.http uri="palettes"/>
+ <binding.http uri="palettes"/>
</service>
<reference name="cache" target="PaletteDocCache"/>
</component>
+ <component name="AccountCache">
+ <implementation.cpp path="../../components/cache" library="libdatacache"/>
+ <service name="AccountCache">
+ <binding.http uri="accountcache"/>
+ </service>
+ <reference name="l1reader" target="Memcache"/>
+ <reference name="l1writer" target="Memcache"/>
+ <reference name="l2reader" target="AccountDB"/>
+ <reference name="l2writer" target="AccountDB"/>
+ </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">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
<service name="DashboardCache">
- <t:binding.http uri="dashboardcache"/>
+ <binding.http uri="dashboardcache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
@@ -121,14 +146,14 @@
<property name="dbname">dashboards</property>
<property name="format">scheme</property>
<service name="DashboardDB">
- <t:binding.http uri="dashboarddb"/>
+ <binding.http uri="dashboarddb"/>
</service>
</component>
<component name="StoreCache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
<service name="StoreCache">
- <t:binding.http uri="storecache"/>
+ <binding.http uri="storecache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
@@ -141,14 +166,14 @@
<property name="dbname">store</property>
<property name="format">scheme</property>
<service name="StoreDB">
- <t:binding.http uri="storedb"/>
+ <binding.http uri="storedb"/>
</service>
</component>
<component name="AppCache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
<service name="AppCache">
- <t:binding.http uri="appcache"/>
+ <binding.http uri="appcache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
@@ -161,14 +186,14 @@
<property name="dbname">apps</property>
<property name="format">scheme</property>
<service name="AppDB">
- <t:binding.http uri="appdb"/>
+ <binding.http uri="appdb"/>
</service>
</component>
<component name="AppDocCache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
<service name="AppDocCache">
- <t:binding.http uri="appdoccache"/>
+ <binding.http uri="appdoccache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
@@ -181,14 +206,14 @@
<property name="dbname">apps</property>
<property name="format">xml</property>
<service name="AppDocDB">
- <t:binding.http uri="appdocdb"/>
+ <binding.http uri="appdocdb"/>
</service>
</component>
<component name="PaletteDocCache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
<service name="PaletteDocCache">
- <t:binding.http uri="palettedoccache"/>
+ <binding.http uri="palettedoccache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
@@ -201,14 +226,14 @@
<property name="dbname">palettes</property>
<property name="format">xml</property>
<service name="PaletteDocDB">
- <t:binding.http uri="palettedocdb"/>
+ <binding.http uri="palettedocdb"/>
</service>
</component>
<component name="AppDataFileCache">
<implementation.cpp path="../../components/cache" library="libdatacache"/>
<service name="AppDataFileCache">
- <t:binding.http uri="appdatafilecache"/>
+ <binding.http uri="appdatafilecache"/>
</service>
<reference name="l1reader" target="Memcache"/>
<reference name="l1writer" target="Memcache"/>
@@ -221,22 +246,22 @@
<property name="dbname">tmp/appdata/filedb</property>
<property name="format">scheme</property>
<service name="AppDataFileDB">
- <t:binding.http uri="appdatafiledb"/>
+ <binding.http uri="appdatafiledb"/>
</service>
</component>
<component name="Memcache">
<implementation.cpp path="../../components/cache" library="libmemcache"/>
<service name="Memcache">
- <t:binding.http uri="memcache"/>
+ <binding.http uri="memcache"/>
</service>
<property name="servers">localhost:11211</property>
</component>
<component name="Log">
- <t:implementation.python script="log.py"/>
+ <implementation.python script="log.py"/>
<service name="Log">
- <t:binding.http uri="log"/>
+ <binding.http uri="log"/>
</service>
</component>
Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html?rev=1126333&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html Mon May 23 06:42:22 2011
@@ -0,0 +1,188 @@
+<!DOCTYPE html>
+<!--
+ * 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.
+-->
+<html>
+<head>
+<title>Account</title>
+<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
+<meta name="apple-mobile-web-app-capable" content="yes"/>
+<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
+<link rel="apple-touch-icon" href="/public/touchicon.png"/>
+<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
+<script type="text/javascript" src="/config.js"></script>
+<script type="text/javascript" src="/all-min.js"></script>
+<script type="text/javascript" src="/menu.js"></script>
+</head>
+<body class="delayed" onorientationchange="ui.reload();">
+<div id="bodydiv" class="devicewidth">
+
+<div id="menu"></div>
+
+<table style="width: 100%;">
+<tr>
+<td><h2><span id="h1"></span><span id="userNameHeader"></span></h2></td>
+<td style="vertical-align: middle; text-align: right;"><span id="saveStatus" style="font-weight: bold; color: #808080;">Saved</span></td>
+</tr>
+</table>
+
+<table style="width: 100%;">
+<tr>
+<th class="thl thr" style="padding-top: 4px; padding-bottom: 4px; padding-left: 2px; padding-right: 2px; ">Account</th>
+</tr>
+</table>
+
+<form id="userForm" style="position: absolute; top: 90px; left: 0px; width: 100%">
+<table style="width: 100%;">
+<tr><tr><td><b>Photo:</b></td></tr>
+<tr><td><img src="/public/app.png" style="width: 50px; height: 50px; vertical-align: top;"></td></tr>
+<tr><tr><td style="padding-top: 6px;"><b>Name:</b></td></tr>
+<tr><td><input type="text" id="userTitle" size="30" placeholder="Enter your name" style="width: 300px;"/></td></tr>
+<tr><tr><td style="padding-top: 6px;"><b>Description:</b></td></tr>
+<tr><td><textarea id="userDescription" cols="40" rows="3" placeholder="Enter a short description of yourself" style="width: 300px;"></textarea></td></tr>
+</table>
+
+<br/>
+<table style="width: 100%;">
+<tr>
+<th class="thl thr" style="padding-top: 4px; padding-bottom: 4px; padding-left: 2px; padding-right: 2px; ">Key chain</th>
+</tr>
+</table>
+
+<table>
+<tr><td style="padding-right: 2px;"><input type="text" id="name1" size="10" placeholder="Key name" style="width: 80px;"/></td><td><input type="text" id="value1" size="2048" placeholder="Key value" style="width: 200px;"/></td></tr>
+<tr><td style="padding-right: 2px;"><input type="text" id="name2" size="10" placeholder="Key name" style="width: 80px;"/></td><td><input type="text" id="value2" size="2048" placeholder="Key value" style="width: 200px;"/></td></tr>
+<tr><td style="padding-right: 2px;"><input type="text" id="name3" size="10" placeholder="Key name" style="width: 80px;"/></td><td><input type="text" id="value3" size="2048" placeholder="Key value" style="width: 200px;"/></td></tr>
+<tr><td style="padding-right: 2px;"><input type="text" id="name4" size="10" placeholder="Key name" style="width: 80px;"/></td><td><input type="text" id="value4" size="2048" placeholder="Key value" style="width: 200px;"/></td></tr>
+<tr><td style="padding-right: 2px;"><input type="text" id="name5" size="10" placeholder="Key name" style="width: 80px;"/></td><td><input type="text" id="value5" size="2048" placeholder="Key value" style="width: 200px;"/></td></tr>
+</table>
+</form>
+
+</div>
+
+<script type="text/javascript">
+// Init service references
+var editWidget = sca.component("EditWidget");
+var user= sca.defun(sca.reference(editWidget, "user"), "id");
+var accounts = sca.reference(editWidget, "accounts");
+
+// Get the user name
+var username = user.id()
+
+// Set page titles
+document.title = windowtitle(window.location.hostname) + ' - Account - ' + username;
+$('userNameHeader').innerHTML = username;
+
+// Load the menu bar
+displaymenu();
+
+// Show the page
+ui.showbody();
+
+/**
+ * The current account entry and corresponding saved XML content.
+ */
+var accountentry;
+var savedaccountentryxml = '';
+
+/**
+ * Get and display the user's account.
+ */
+function getaccount(name) {
+ return accounts.get(name, function(doc) {
+ accountentry = doc != null? car(elementsToValues(atom.readATOMEntry(mklist(doc)))) : mklist("'entry", mklist("'title", ''), mklist("'id", name));
+ var title = cadr(assoc("'title", cdr(accountentry)));
+ $('userTitle').value = title;
+
+ var content = cadr(assoc("'content", cdr(accountentry)));
+ var acct = isNil(content)? mklist() : cdr(content);
+
+ var desc = assoc("'description", acct);
+ $('userDescription').innerHTML = isNil(desc) || isNil(cdr(desc))? '' : cadr(desc);
+
+ var keys = assoc("'keys", acct);
+ reduce(function(i, key) {
+ var kn = assoc("'@name", key);
+ var kv = assoc("'@value", key);
+ $('name' + i).value = isNil(kn)? '' : cadr(kn);
+ $('value' + i).value = isNil(kv)? '' : cadr(kv);
+ return i + 1;
+ }, 1, isNil(keys)? mklist() : cadr(cadr(keys)));
+
+ savedaccountentryxml = car(atom.writeATOMEntry(valuesToElements(mklist(accountentry))));
+ return true;
+ });
+}
+
+/**
+ * Save the user's account.
+ */
+function save(entryxml) {
+ $('saveStatus').innerHTML = 'Saving';
+ savedaccountentryxml = entryxml;
+ accounts.put(username, savedaccountentryxml);
+ $('saveStatus').innerHTML = 'Saved';
+ return true;
+}
+
+/**
+ * Handle a change event
+ */
+function onaccountchange() {
+ var title = $('userTitle').value;
+ var desc = $('userDescription').value;
+ var keys = map(function(i) {
+ var kn = $('name' + i).value;
+ var kv = $('value' + i).value;
+ return mklist("'key", mklist("'@name", kn), mklist("'@value", kv));
+ }, range(1, 6));
+
+ var accountentry = mklist("'entry", mklist("'title", title != ''? title : username), mklist("'id", username),
+ mklist("'content", mklist("'account", mklist("'description", desc), cons("'keys", keys))));
+ var entryxml = car(atom.writeATOMEntry(valuesToElements(mklist(accountentry))));
+ if (savedaccountentryxml == entryxml)
+ return false;
+
+ $('saveStatus').innerHTML = 'Modified';
+ return save(entryxml);
+}
+
+$('userTitle').onchange = onaccountchange;
+$('userDescription').onchange = onaccountchange;
+map(function(i) {
+ $('name' + i).onchange = onaccountchange;
+ $('value' + i).onchange = onaccountchange;
+ return true;
+}, range(1, 6));
+
+/**
+ * Handle a form submit event.
+ */
+$('userForm').onsubmit = function() {
+ onaccountchange();
+ return false;
+};
+
+// Get the user's account
+getaccount(username);
+
+</script>
+
+</body>
+</html>
+
Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.js?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.js (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.js Mon May 23 06:42:22 2011
@@ -17,8 +17,8 @@
* under the License.
*/
-var menuWidget = sca.component("MenuWidget");
-var userService = sca.defun(sca.reference(menuWidget, "user"), "id");
+var editWidget = sca.component("EditWidget");
+var user= sca.defun(sca.reference(editWidget, "user"), "id");
/**
* Display the current signed in user.
@@ -26,7 +26,7 @@ var userService = sca.defun(sca.referenc
function userMenu() {
function UserMenu() {
this.content = function() {
- u = userService.id()
+ var u = user.id()
return '<span>' + u + '</span>';
};
}
@@ -44,9 +44,10 @@ function displaymenu() {
append(mklist(ui.menu('Home', '/'), ui.menu('Store', '/store/')),
(isNil(name) || name == 'undefined')?
mklist() :
- mklist(ui.menu('Page', '/page/?app=' + name),
- ui.menu(isNil(config.compose)? 'Composition' : config.compose, '/graph/?app=' + name),
- ui.menu('Stats', '/stats/?app=' + name))),
- mklist(ui.menu('Account', '/public/notyet.html'), ui.menu('Sign out', '/logout/')));
+ mklist(
+ ui.menu('Stats', '/stats/?app=' + name),
+ ui.menu('Page', '/page/?app=' + name),
+ ui.menu(isNil(config.compose)? 'Composition' : config.compose, '/graph/?app=' + name))),
+ mklist(ui.menu('Account', '/account/'), ui.menu('Sign out', '/logout/')));
}
Modified: tuscany/sca-cpp/trunk/modules/edit/palettes.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/palettes.py?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/palettes.py (original)
+++ tuscany/sca-cpp/trunk/modules/edit/palettes.py Mon May 23 06:42:22 2011
@@ -22,6 +22,12 @@ from util import *
def paletteid(id):
return ("'" + car(id), "'palette.composite")
+# Put a palette into the palettes db
+def put(id, palette, cache):
+ comp = cdr(cadddr(car(palette)))
+ cache.put(paletteid(id), comp)
+ return True
+
# Get a palette from the palettes db
def get(id, cache):
if isNil(id):
Modified: tuscany/sca-cpp/trunk/modules/edit/ssl-start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/ssl-start?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/ssl-start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/ssl-start Mon May 23 06:42:22 2011
@@ -18,7 +18,7 @@
# under the License.
# For this module to work, add the app domains to your /etc/hosts as follows:
-# 127.0.0.1 sca-store.com joe.sca-store.com jane.sca-store.com myprofile.sca-store.com myprofile2.sca-store.com nearme.sca-store.com nearme2.sca-store.com testvalues.sca-store.com testurl.sca-store.com testsocial.sca-store.com testlogic.sca-store.com testtext.sca-store.com
+# 127.0.0.1 sca-store.com abc.sca-store.com xyz.sca-store.com ...
here=`readlink -f $0`; here=`dirname $here`
jsprefix=`readlink -f $here/../js`
@@ -36,7 +36,7 @@ jsprefix=`readlink -f $here/../js`
# Configure authentication
../../modules/http/open-auth-conf tmp
-../../modules/http/passwd-auth-conf tmp joe joe
+../../modules/http/passwd-auth-conf tmp john john
../../modules/http/passwd-auth-conf tmp jane jane
# Configure Python component support
@@ -93,6 +93,13 @@ SCAVirtualComposite app.composite
EOF
+# Configure main aliases
+cat >>tmp/conf/httpd.conf <<EOF
+
+Alias /home.png $here/htdocs/home.png
+
+EOF
+
# Create app links and sub-directories if needed
./mkapplinks
Modified: tuscany/sca-cpp/trunk/modules/edit/start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/start?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/start (original)
+++ tuscany/sca-cpp/trunk/modules/edit/start Mon May 23 06:42:22 2011
@@ -18,7 +18,7 @@
# under the License.
# For this module to work, add the app domains to your /etc/hosts as follows:
-# 127.0.0.1 sca-store.com joe.sca-store.com jane.sca-store.com myprofile.sca-store.com myprofile2.sca-store.com nearme.sca-store.com nearme2.sca-store.com testvalues.sca-store.com testurl.sca-store.com testsocial.sca-store.com testlogic.sca-store.com testtext.sca-store.com
+# 127.0.0.1 sca-store.com abc.sca-store.com xyz.sca-store.com ...
here=`readlink -f $0`; here=`dirname $here`
jsprefix=`readlink -f $here/../js`
Modified: tuscany/sca-cpp/trunk/modules/edit/store.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/store.py?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/store.py (original)
+++ tuscany/sca-cpp/trunk/modules/edit/store.py Mon May 23 06:42:22 2011
@@ -20,7 +20,7 @@ from util import *
# Convert a particular store tag to a store id
def storeid(tag):
- return ("'" + tag,)
+ return ("'" + tag, "'store.apps")
# Get a store from the cache
def getstore(id, cache):
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js?rev=1126333&r1=1126332&r2=1126333&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js Mon May 23 06:42:22 2011
@@ -111,10 +111,11 @@ atom.entryElement = function(l) {
var text = isNil(content)? false : elementHasValue(content);
return append(append(
mklist(element, "'entry", mklist(attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
- mklist(element, "'title", mklist(attribute, "'type", "text"), title), mklist(element, "'id", id)),
- isNil(content)? mklist() :
- append(mklist(element, "'content", mklist(attribute, "'type", text? "text" : "application/xml")), text? mklist(elementValue(content)) : elementChildren(content))),
- mklist(element, "'link", mklist(attribute, "'href", id)));
+ mklist(element, "'title", mklist(attribute, "'type", "text"), title), mklist(element, "'id", id)),
+ isNil(content)? mklist() :
+ mklist(append(mklist(element, "'content", mklist(attribute, "'type", text? "text" : "application/xml")),
+ text? mklist(elementValue(content)) : elementChildren(content)))),
+ mklist(mklist(element, "'link", mklist(attribute, "'href", id))));
};
/**