Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first shot for allociner instance and contributer interaction

  • Loading branch information...
commit be5aceec09351817d7902156640e174d69693cc3 1 parent 0850827
@mhausenblas authored
View
37 allociner/cloudisus.server.js
@@ -20,18 +20,31 @@ http.createServer(function(req, res) {
// Cloud Is Us API URI space - routing of paths to function calls
console.log("CLOUDISUS handling " + req.url);
- switch (furl) {
- case "/":
- allociner.serve("index.html", "text/html", req, res);
- break;
- case "/ingest":
- allociner.ingest(SERVER_HOSTNAME, req, res, req.url);
- break;
- case "/query":
- allociner.query(SERVER_HOSTNAME, req, res, req.url);
- break;
- default:
- allociner.dunno(res);
+ if(furl.indexOf("style") >= 0) { // serve files from library directory
+ allociner.serve('../' + furl, "text/css", req, res);
+ }
+ else{
+ if(furl.indexOf("lib") >= 0) { // serve files from the contributor's library directory
+ allociner.serve("../contributor/" + furl, "application/json", req, res);
+ }
+ else {
+ switch (furl) { // static and/or API calls
+ case "/":
+ allociner.serve("index.html", "text/html", req, res);
+ break;
+ case "/contribute":
+ allociner.serve("../contributor/index.html", "text/html", req, res);
+ break;
+ case "/ingest":
+ allociner.ingest(SERVER_HOSTNAME, req, res, req.url);
+ break;
+ case "/query":
+ allociner.query(SERVER_HOSTNAME, req, res, req.url);
+ break;
+ default:
+ allociner.dunno(res);
+ }
+ }
}
}).listen(SERVER_PORT, SERVER_HOSTNAME);
View
77 allociner/index.html
@@ -1,75 +1,18 @@
-<!doctype html>
-<html lang="en">
+<!doctype html>
+<html>
<head>
- <meta charset="utf-8">
+ <meta charset="utf-8"/>
<title>cloudisus.com</title>
-
- <style type="text/css">
- body {
- margin: 2em;
- padding: 0px;
- background: #f0f0f0;
- font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
- }
-
- h1 {
- margin: 1em;
- }
-
- img {
- border: 0px solid white;
- }
-
- a {
- color: #44A;
- text-decoration: none;
- }
-
- a:hover {
- text-decoration: underline;
- }
-
- a.home {
- color: #000;
- text-decoration: none;
- }
-
- a.home:hover {
- text-decoration: underline;
- }
-
- #main {
- background: #fff;
- margin: 1em 2em 1em 2em;
- padding: 20px;
- -moz-border-radius: 2px 2px 2px 2px;
- -webkit-border-radius: 2px 2px 2px 2px;
- border-bottom: 1px solid #e0e0e0;
- -moz-box-shadow: 3px 3px 4px #000;
- -webkit-box-shadow: 3px 3px 4px #000;
- box-shadow: 3px 3px 4px #000;
- -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
- filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
- }
-
- #cmd, #result {
- padding: 1em;
- }
-
- footer {
- margin: 2em 1em 0 1em;
- font-size: 70%;
- text-align: center;
- }
-</style>
+ <link href="style/base.css" rel="stylesheet" type="text/css">
</head>
<body>
- <h1>cloudisus.com</h1>
- <div id="main">welcome!</div>
+ <header>Cloud Is Us</header>
+
+ <div id="main">
+ Welcome to <em>Cloud Is Us</em>, the platform for processing large graph datasets in a social cloud computing setting. Start <a href="contribute">contributing now</a> or <a href="https://github.com/mhausenblas/cloudisus/blob/master/README.md">learn more</a>, first ...
+ </div>
- <footer>
- <a href="http://sw-app.org/mic.xhtml#i">Michael Hausenblas</a>, 2012.
- </footer>
+ <footer>- cloudisus.com (c) 2012 -</footer>
</body>
</html>
View
15 contributor/index.html
@@ -1,19 +1,20 @@
<!doctype html>
<html>
<head>
- <meta charset="utf-8"/>
- <title>cloudisus.contributor</title>
+ <meta charset="utf-8"/>
+ <title>cloudisus.contributor</title>
+ <link href="style/base.css" rel="stylesheet" type="text/css">
</head>
<body>
- <header style="text-align: center; font-size: 120%">cloudisus.contributor</header>
+ <header>cloudisus.contributor</header>
- <div>
- <span id="list">list ...</span>
- <div id="debug"></div>
+ <div id="main">
+ <span id="contribute">contribute</span> or go <a href="..">home</a>
+ <div><code id="debug"></code></div>
</div>
- <footer style="text-align: center; margin-top: 10px">- cloudisus.com (c) 2012 -</footer>
+ <footer>- cloudisus.com (c) 2012 -</footer>
<script src="lib/jquery-1.7.1.min.js"></script>
<script src="lib/rdf_store_min.js"></script>
<script src="lib/cloudisus.contributor.js"></script>
View
27 contributor/lib/cloudisus.contributor.js
@@ -1,15 +1,20 @@
$(document).ready(function(){
- $('#list').click(function(event){
- new rdfstore.Store({name:'sandbox', overwrite:true}, function(store){
- store.execute('INSERT DATA { <http://example/person1> <http://xmlns.com/foaf/0.1/name> "Celia" }', function(result, msg){
- store.registerDefaultProfileNamespaces();
- $('#debug').append("<p>loaded data:</p><code>");
- store.execute('SELECT * { ?s ?p ?o }', function(success,results) {
- $('#debug').append(results[0].s.value + " " + results[0].p.value + " " + results[0].o.value);
- });
- $('#debug').append("</code>");
- });
+ $('#contribute').click(function(event){
+ $.get('query?q=select%20%2A%20where%20%7B%3Fs%20%3Fp%20%3Fo%7D%20limit%202', function(data){
+ $('#debug').append(data);
});
});
-});
+});
+
+
+// new rdfstore.Store({name:'sandbox', overwrite:true}, function(store){
+// store.execute('INSERT DATA { <http://example/person1> <http://xmlns.com/foaf/0.1/name> "Celia" }', function(result, msg){
+// store.registerDefaultProfileNamespaces();
+// $('#debug').append("<p>loaded data:</p><code>");
+// store.execute('SELECT * { ?s ?p ?o }', function(success,results) {
+// $('#debug').append(results[0].s.value + " " + results[0].p.value + " " + results[0].o.value);
+// });
+// $('#debug').append("</code>");
+// });
+// });
View
71 style/base.css
@@ -0,0 +1,71 @@
+body {
+ margin: 2em;
+ padding: 0px;
+ background: #f0f0f0;
+ font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
+}
+
+header {
+ text-align: center;
+ font-size: 150%;
+ font-weight: bold;
+}
+
+footer {
+ text-align: center;
+ margin-top: 10px;
+}
+
+h1 {
+ margin: 1em;
+}
+
+img {
+ border: 0px solid white;
+}
+
+a {
+ color: #44A;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.home {
+ color: #000;
+ text-decoration: none;
+}
+
+a.home:hover {
+ text-decoration: underline;
+}
+
+#main {
+ background: #fff;
+ margin: 1em 2em 1em 2em;
+ padding: 20px;
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ border-bottom: 1px solid #e0e0e0;
+ -moz-box-shadow: 3px 3px 4px #000;
+ -webkit-box-shadow: 3px 3px 4px #000;
+ box-shadow: 3px 3px 4px #000;
+ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
+ filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
+}
+
+#contribute {
+ border: 1px solid #c0c0c0;
+ padding: 3px 5px 3px 5px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ cursor: pointer;
+}
+
+footer {
+ margin: 2em 1em 0 1em;
+ font-size: 70%;
+ text-align: center;
+}
View
1  test/cli-tests.txt
@@ -0,0 +1 @@
+curl http://127.0.0.1:8086/query?q=select%20%2A%20where%20%7B%3Fs%20%3Fp%20%3Fo%7D%20limit%202
Please sign in to comment.
Something went wrong with that request. Please try again.