Refactor server hosting module, rename it and move it under a hosting dir, and refactor its datastore components into a single component.

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1237740 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jsdelfino 2012-01-30 15:56:11 +00:00
commit f4c4803ce0
172 changed files with 841 additions and 1177 deletions

View file

@ -143,8 +143,8 @@ json-value
value-json
element-value
value-element
modules/edit/apps/*/nuvem
modules/edit/apps/*/lib
hosting/server/data/apps/*/nuvem
hosting/server/data/apps/*/lib
chat-send
opencl-shell
opencl-test

View file

@ -17,7 +17,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = etc kernel modules components samples doc macos ubuntu
SUBDIRS = etc kernel modules components hosting samples doc macos ubuntu
datadir=$(prefix)
dist_data_DATA = AUTHORS README LICENSE COPYING NOTICE NEWS

View file

@ -32,7 +32,7 @@ EOF
sleep 2
# Test
./client-test #2>/dev/null
./client-test 2>/dev/null
rc=$?
# Cleanup

View file

@ -80,8 +80,8 @@
<component name="scheme-test">
<implementation.scheme script="server-test.scm"/>
<service name="test">
<binding.http uri="test"/>
<service name="scheme">
<binding.http uri="scheme"/>
</service>
</component>

View file

@ -18,6 +18,6 @@
; URL test case
(define (get id)
"http://localhost:8090/test"
"http://localhost:8090/scheme"
)

View file

@ -98,7 +98,7 @@ host replication all samenet trust
EOF
# Create the db
($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
$pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
sti=0
while [ $sti -ne 30 ]; do
st=`$pgsql_prefix/bin/pg_ctl status -D $root/sqldb/data | grep 'server is running'`

View file

@ -1034,7 +1034,6 @@ AC_CONFIG_FILES([Makefile
modules/openid/Makefile
modules/oauth/Makefile
modules/wsgi/Makefile
modules/edit/Makefile
components/Makefile
components/cache/Makefile
components/log/Makefile
@ -1045,6 +1044,8 @@ AC_CONFIG_FILES([Makefile
components/queue/Makefile
components/sqldb/Makefile
components/webservice/Makefile
hosting/Makefile
hosting/server/Makefile
samples/Makefile
samples/store-scheme/Makefile
samples/store-cpp/Makefile

View file

@ -0,0 +1,19 @@
# 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.
SUBDIRS = server

View file

@ -17,7 +17,7 @@
if WANT_PYTHON
moddir = $(prefix)/modules/edit
moddir = $(prefix)/hosting/server
dist_mod_SCRIPTS = start stop ssl-start mkapplinks config-backup data-backup
BUILT_SOURCES = htdocs/config.js htdocs/public/config.js
@ -31,17 +31,17 @@ not_minified = htdocs/public/iframe.html htdocs/create/index.html htdocs/page/in
minified = htdocs/public/iframe-min.html htdocs/create/index-min.html htdocs/page/index-min.html htdocs/login/index-min.html htdocs/public/notfound/index-min.html htdocs/public/oops/index-min.html htdocs/graph/index-min.html htdocs/public/notauth/index-min.html htdocs/account/index-min.html htdocs/home/index-min.html htdocs/index-min.html htdocs/public/notyet/index-min.html htdocs/clone/index-min.html htdocs/stats/index-min.html htdocs/app/index-min.html htdocs/store/index-min.html htdocs/config-min.js htdocs/public/config-min.js
resources = edit.composite *.py htdocs/*.cmf htdocs/*.ico htdocs/home/*.png htdocs/app/*.cmf htdocs/home/*.b64 htdocs/*.txt htdocs/public/*.png htdocs/public/*.b64 palettes/*/palette.composite accounts/*/*.account apps/*/app.composite apps/*/app.stats apps/*/htdocs/app.html dashboards/*/user.apps store/*/store.apps ${not_minified} ${minified}
resources = server.composite *.py htdocs/*.cmf htdocs/*.ico htdocs/home/*.png htdocs/app/*.cmf htdocs/home/*.b64 htdocs/*.txt htdocs/public/*.png htdocs/public/*.b64 data/palettes/*/palette.composite data/accounts/*/*.account data/apps/*/app.composite data/apps/*/app.stats data/apps/*/htdocs/app.html data/dashboards/*/user.apps data/store/*/store.apps ${not_minified} ${minified}
nobase_dist_mod_DATA = ${resources}
EXTRA_DIST = ${resources}
SUFFIXES = -min.html -min.js
.html-min.html:
../http/minify-html $< $@
../../modules/http/minify-html $< $@
.js-min.js:
../http/minify-js $< $@
../../modules/http/minify-js $< $@
CLEANFILES = ${minified}

View file

@ -20,7 +20,7 @@ from util import *
# Convert a particular user id to an account id
def accountid(user):
return ("'" + user.id(), "'user.account")
return ("'accounts", "'" + user.id(), "'user.account")
# Get the current user's account
def get(id, user, cache):

View file

@ -21,14 +21,14 @@ from util import *
# Convert an id to an app id
def appid(id):
return ("'" + car(id), "'app.stats")
return ("'apps", "'" + car(id), "'app.stats")
# Link implementation resources into an app
def mkapplink(id):
try:
os.symlink('../../../../../nuvem/nuvem-parallel/nuvem', 'apps/' + car(id) + '/nuvem')
os.symlink('../../../../components', 'apps/' + car(id) + '/lib')
os.mkdir('apps/' + car(id) + '/htdocs')
os.symlink('../../../../../../nuvem/nuvem-parallel/nuvem', 'data/apps/' + car(id) + '/nuvem')
os.symlink('../../../../../components', 'data/apps/' + car(id) + '/lib')
os.mkdir('data/apps/' + car(id) + '/htdocs')
except:
pass
return True

View file

@ -20,7 +20,7 @@ from util import *
# Convert an id to an app id
def appid(id):
return ("'" + car(id), "'app.composite")
return ("'apps", "'" + car(id), "'app.composite")
# Put an app into the apps db
def put(id, app, cache):

View file

@ -18,5 +18,5 @@
# under the License.
cd ../../
tar czf ../config-backup.tar.gz modules/edit/*start modules/edit/*stop modules/edit/htdocs/*.js modules/edit/htdocs/public/*.js modules/edit/htdocs/home/*.b64 modules/edit/htdocs/home/*.png
tar czf ../config-backup.tar.gz hosting/server/*start hosting/server/*stop hosting/server/htdocs/*.js hosting/server/htdocs/public/*.js hosting/server/htdocs/home/*.b64 hosting/server/htdocs/home/*.png

View file

@ -20,7 +20,7 @@ from util import *
# Convert a particular user id to a dashboard id
def dashboardid(user):
return ("'" + user.id(), "'user.apps")
return ("'dashboards", "'" + user.id(), "'user.apps")
# Get a dashboard from the cache
def getdashboard(id, cache):

View file

@ -18,5 +18,5 @@
# under the License.
cd ../../
tar czf ../data-backup.tar.gz modules/edit/accounts modules/edit/apps modules/edit/dashboards modules/edit/store modules/edit/tmp/appdata
tar czf ../data-backup.tar.gz hosting/server/data

View file

@ -36,19 +36,19 @@
<component x="120" y="10" name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="410" y="260" name="filedb4" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="400" y="370" name="filedb5" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="270" y="260" name="get3" title="get" color="pink1">

View file

@ -169,19 +169,19 @@
<component name="filedb" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb3" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="130" y="420" name="format1" title="format" color="cyan1">

View file

@ -85,25 +85,25 @@
<component x="240" y="100" name="filedb1" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="270" y="150" name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="890" y="350" name="filedb3" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="1100" y="190" name="filedb4" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="710" y="160" name="frames1" title="frames" color="white1">

View file

@ -1,22 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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.
-->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="app" targetNamespace="http://app">
<service name="comment1" promote="comment1"/>
<service name="start1" promote="start1"/>

View file

@ -30,19 +30,19 @@
<component name="filedb" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb2" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component name="filedb3" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="20" y="120" name="get" title="get" color="pink1">

View file

@ -1,23 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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.
-->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="app" targetNamespace="http://app">
<service name="app1" promote="app1"/>
<service name="email" promote="email"/>
<service name="host" promote="host"/>
<service name="keychain1" promote="keychain1"/>
@ -27,6 +10,11 @@
<service name="realm" promote="realm"/>
<service name="url" promote="url"/>
<service name="user" promote="user"/>
<component x="260" y="100" name="app1" title="app" color="green1">
<implementation.python script="nuvem/app.py"/>
<service name="app"/>
<property name="app" visible="false"/>
</component>
<component x="17" y="223" name="email" title="email" color="green1">
<implementation.python script="nuvem/email.py"/>
<service name="email"/>
@ -92,7 +80,7 @@
<service name="params"/>
<property name="params"/>
</component>
<component x="17" y="48" name="path" title="path" color="green1">
<component x="20" y="50" name="path" title="path" color="green1">
<implementation.python script="nuvem/path.py"/>
<service name="path"/>
<property name="path"/>

View file

@ -34,7 +34,7 @@
<component x="80" y="10" name="filedb" title="file" color="pink1">
<implementation.python script="nuvem/filedb.py"/>
<service name="filedb"/>
<reference name="db" target="AppDataFileCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="80" y="60" name="get" title="get" color="pink1">
@ -46,7 +46,7 @@
<component x="140" y="10" name="nosqldb" title="index **" color="pink1">
<implementation.python script="nuvem/nosqldb.py"/>
<service name="nosqldb"/>
<reference name="db" target="AppDataNoSQLCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
<component x="200" y="60" name="post" title="post" color="pink1">
@ -66,7 +66,7 @@
<component x="210" y="10" name="sqldb" title="sql **" color="pink1">
<implementation.python script="nuvem/sqldb.py"/>
<service name="sqldb"/>
<reference name="db" target="AppDataSQLCache" visible="false"/>
<reference name="db" target="Cache" visible="false"/>
<property name="host" visible="false"/>
</component>
</composite>

View file

@ -18,6 +18,7 @@
* under the License.
-->
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="palette" targetNamespace="http://palette">
<service name="app" promote="app"/>
<service name="delete" promote="delete"/>
<service name="email" promote="email"/>
<service name="get" promote="get"/>
@ -31,73 +32,78 @@
<service name="put" promote="put"/>
<service name="url" promote="url"/>
<service name="user" promote="user"/>
<component x="80" y="170" name="delete" title="delete" color="green1">
<component x="80" y="10" name="app" title="app" color="green1">
<implementation.python script="nuvem/app.py"/>
<service name="app"/>
<property name="app" visible="false"/>
</component>
<component x="80" y="220" name="delete" title="delete" color="green1">
<implementation.cpp path="lib/http" library="libhttpdelete"/>
<service name="delete"/>
<reference name="url"/>
</component>
<component x="130" y="60" name="email" title="email" color="green1">
<component x="140" y="110" name="email" title="email" color="green1">
<implementation.python script="nuvem/email.py"/>
<service name="email"/>
<property name="email" visible="false"/>
</component>
<component x="80" y="120" name="get" title="get" color="green1">
<component x="80" y="170" name="get" title="get" color="green1">
<implementation.cpp path="lib/http" library="libhttpget"/>
<service name="get"/>
<reference name="url"/>
</component>
<component x="80" y="10" name="host" title="host" color="green1">
<component x="130" y="10" name="host" title="host" color="green1">
<implementation.python script="nuvem/host.py"/>
<service name="host"/>
<property name="host" visible="false"/>
</component>
<component x="190" y="60" name="keychain" title="keychain" color="green1">
<component x="210" y="110" name="keychain" title="keychain" color="green1">
<implementation.python script="nuvem/keychain.py"/>
<service name="keychain"/>
<reference name="name"/>
<reference name="account" target="Accounts" visible="false"/>
</component>
<component x="250" y="10" name="param" title="?param" color="green1">
<component x="150" y="60" name="param" title="?param" color="green1">
<implementation.python script="nuvem/param.py"/>
<service name="param"/>
<property>x</property>
<property name="query" visible="false"/>
</component>
<component x="180" y="10" name="params" title="?params" color="green1">
<component x="80" y="60" name="params" title="?params" color="green1">
<implementation.python script="nuvem/params.py"/>
<service name="params"/>
<property name="query" visible="false"/>
</component>
<component x="260" y="120" name="patch" title="patch" color="green1">
<component x="260" y="170" name="patch" title="patch" color="green1">
<implementation.cpp path="lib/http" library="libhttppatch"/>
<service name="patch"/>
<reference name="url"/>
<reference name="content"/>
</component>
<component x="130" y="10" name="path" title="path" color="green1">
<component x="190" y="10" name="path" title="path" color="green1">
<implementation.python script="nuvem/path.py"/>
<service name="path"/>
<property name="path" visible="false"/>
</component>
<component x="200" y="120" name="post" title="post" color="green1">
<component x="200" y="170" name="post" title="post" color="green1">
<implementation.cpp path="lib/http" library="libhttppost"/>
<service name="post"/>
<reference name="url"/>
<reference name="content"/>
</component>
<component x="140" y="120" name="put" title="put" color="green1">
<component x="140" y="170" name="put" title="put" color="green1">
<implementation.cpp path="lib/http" library="libhttpput"/>
<service name="put"/>
<reference name="url"/>
<reference name="content"/>
</component>
<component x="270" y="60" name="url" title="url" color="green1">
<component x="250" y="10" name="url" title="url" color="green1">
<implementation.python script="nuvem/url.py"/>
<service name="url"/>
<reference name="address"/>
<reference name="args"/>
</component>
<component x="80" y="60" name="user" title="user" color="green1">
<component x="80" y="110" name="user" title="user" color="green1">
<implementation.python script="nuvem/user.py"/>
<service name="user"/>
<property name="user" visible="false"/>

Some files were not shown because too many files have changed in this diff Show more