diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
22 files changed, 323 insertions, 64 deletions
diff --git a/sca-cpp/trunk/modules/edit/accounts.py b/sca-cpp/trunk/modules/edit/accounts.py new file mode 100644 index 0000000000..6c37fc5d32 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/accounts.py @@ -0,0 +1,35 @@ +# 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. + +# Accounts collection implementation +from util import * + +# Convert a particular user id to an account id +def accountid(user): + return ("'" + user.id(), "'user.account") + +# 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) + diff --git a/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account b/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account new file mode 100644 index 0000000000..5fca389f04 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/accounts/jane@localhost/user.account @@ -0,0 +1 @@ +((entry (title "Jane Doe") (id "jane@localhost"))) diff --git a/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account b/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account new file mode 100644 index 0000000000..e0d25671b6 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/accounts/jane@sca-store.com/user.account @@ -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 diff --git a/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account b/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account new file mode 100644 index 0000000000..35d6f30f0b --- /dev/null +++ b/sca-cpp/trunk/modules/edit/accounts/john@localhost/user.account @@ -0,0 +1 @@ +((entry (title "John Doe") (id "john@localhost"))) diff --git a/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account b/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account new file mode 100644 index 0000000000..273335e1c7 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/accounts/john@sca-store.com/user.account @@ -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 diff --git a/sca-cpp/trunk/modules/edit/dashboard.py b/sca-cpp/trunk/modules/edit/dashboards.py index 81ec447d10..5e98c9cb59 100644 --- a/sca-cpp/trunk/modules/edit/dashboard.py +++ b/sca-cpp/trunk/modules/edit/dashboards.py @@ -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): diff --git a/sca-cpp/trunk/modules/edit/dashboards/jane@localhost b/sca-cpp/trunk/modules/edit/dashboards/jane@localhost deleted file mode 100644 index 402b4260e4..0000000000 --- a/sca-cpp/trunk/modules/edit/dashboards/jane@localhost +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry (title "My online store") (id "shoppingcart")) (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 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"))) diff --git a/sca-cpp/trunk/modules/edit/dashboards/jane@sca-store.com b/sca-cpp/trunk/modules/edit/dashboards/jane@sca-store.com deleted file mode 100644 index 402b4260e4..0000000000 --- a/sca-cpp/trunk/modules/edit/dashboards/jane@sca-store.com +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry (title "My online store") (id "shoppingcart")) (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 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"))) diff --git a/sca-cpp/trunk/modules/edit/dashboards/joe@localhost b/sca-cpp/trunk/modules/edit/dashboards/joe@localhost deleted file mode 100644 index 402b4260e4..0000000000 --- a/sca-cpp/trunk/modules/edit/dashboards/joe@localhost +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry (title "My online store") (id "shoppingcart")) (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 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"))) diff --git a/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com b/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com deleted file mode 100644 index 402b4260e4..0000000000 --- a/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry (title "My online store") (id "shoppingcart")) (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 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"))) diff --git a/sca-cpp/trunk/modules/edit/edit.composite b/sca-cpp/trunk/modules/edit/edit.composite index c13c2ccc32..85ae67d8b4 100644 --- a/sca-cpp/trunk/modules/edit/edit.composite +++ b/sca-cpp/trunk/modules/edit/edit.composite @@ -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> diff --git a/sca-cpp/trunk/modules/edit/htdocs/account/index.html b/sca-cpp/trunk/modules/edit/htdocs/account/index.html new file mode 100644 index 0000000000..3a3ddad383 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/htdocs/account/index.html @@ -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> + diff --git a/sca-cpp/trunk/modules/edit/htdocs/menu.js b/sca-cpp/trunk/modules/edit/htdocs/menu.js index 2b30a6f6b8..efddeec1dc 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/menu.js +++ b/sca-cpp/trunk/modules/edit/htdocs/menu.js @@ -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.reference(menuWidget, "user"), "id"); 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/'))); } diff --git a/sca-cpp/trunk/modules/edit/palettes.py b/sca-cpp/trunk/modules/edit/palettes.py index abe28a3364..5cb303e053 100644 --- a/sca-cpp/trunk/modules/edit/palettes.py +++ b/sca-cpp/trunk/modules/edit/palettes.py @@ -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): diff --git a/sca-cpp/trunk/modules/edit/ssl-start b/sca-cpp/trunk/modules/edit/ssl-start index be465261dd..1c85c74b5b 100755 --- a/sca-cpp/trunk/modules/edit/ssl-start +++ b/sca-cpp/trunk/modules/edit/ssl-start @@ -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 diff --git a/sca-cpp/trunk/modules/edit/start b/sca-cpp/trunk/modules/edit/start index 051e591aec..048a24387b 100755 --- a/sca-cpp/trunk/modules/edit/start +++ b/sca-cpp/trunk/modules/edit/start @@ -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` diff --git a/sca-cpp/trunk/modules/edit/store.py b/sca-cpp/trunk/modules/edit/store.py index 9598cdf7fa..eaa68b1d23 100644 --- a/sca-cpp/trunk/modules/edit/store.py +++ b/sca-cpp/trunk/modules/edit/store.py @@ -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): diff --git a/sca-cpp/trunk/modules/edit/store/all b/sca-cpp/trunk/modules/edit/store/all deleted file mode 100644 index 402b4260e4..0000000000 --- a/sca-cpp/trunk/modules/edit/store/all +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry (title "My online store") (id "shoppingcart")) (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 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"))) diff --git a/sca-cpp/trunk/modules/edit/store/featured b/sca-cpp/trunk/modules/edit/store/featured deleted file mode 100644 index 7fd59364cf..0000000000 --- a/sca-cpp/trunk/modules/edit/store/featured +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "My online store") (id "shoppingcart")) (entry (title "Slice") (id "slice"))) diff --git a/sca-cpp/trunk/modules/edit/store/new b/sca-cpp/trunk/modules/edit/store/new deleted file mode 100644 index 402b4260e4..0000000000 --- a/sca-cpp/trunk/modules/edit/store/new +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "Slice") (id "slice")) (entry (title "My online store") (id "shoppingcart")) (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 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"))) diff --git a/sca-cpp/trunk/modules/edit/store/top b/sca-cpp/trunk/modules/edit/store/top deleted file mode 100644 index 7fd59364cf..0000000000 --- a/sca-cpp/trunk/modules/edit/store/top +++ /dev/null @@ -1 +0,0 @@ -((entry (title "Check my public social data") (id "me360")) (entry (title "Where are my friends") (id "nearme")) (entry (title "Our photos of an event") (id "ourphotos")) (entry (title "My online store") (id "shoppingcart")) (entry (title "Slice") (id "slice"))) diff --git a/sca-cpp/trunk/modules/js/htdocs/atomutil.js b/sca-cpp/trunk/modules/js/htdocs/atomutil.js index 182b698596..62f390d37e 100644 --- a/sca-cpp/trunk/modules/js/htdocs/atomutil.js +++ b/sca-cpp/trunk/modules/js/htdocs/atomutil.js @@ -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)))); }; /** |