From: <tob...@us...> - 2014-03-04 19:50:12
|
Revision: 7908 http://sourceforge.net/p/bigdata/code/7908 Author: tobycraig Date: 2014-03-04 19:50:06 +0000 (Tue, 04 Mar 2014) Log Message: ----------- #836 - Added simple create namespace form Modified Paths: -------------- branches/RDR/bigdata-war/src/html/new.html branches/RDR/bigdata-war/src/html/workbench.js Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-04 19:12:18 UTC (rev 7907) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-04 19:50:06 UTC (rev 7908) @@ -151,6 +151,8 @@ <ul id="namespaces-list"> </ul> + + <form id="namespace-create"><input type="text"> <input type="submit" value="Create namespace"></form> </div> </div> Modified: branches/RDR/bigdata-war/src/html/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:12:18 UTC (rev 7907) +++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:50:06 UTC (rev 7908) @@ -88,6 +88,26 @@ } } +function createNamespace(e) { + e.preventDefault(); + var namespace = $(this).find('input').val(); + if(!namespace) { + return; + } + // TODO: validate namespace + // TODO: allow for other options to be specified + var data = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\n<properties>\n<entry key="com.bigdata.rdf.sail.namespace">' + namespace + '</entry>\n</properties>'; + var settings = { + type: 'POST', + data: data, + contentType: 'application/xml', + success: getNamespaces, + error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } + }; + $.ajax('/namespace', settings); +} +$('#namespace-create').submit(createNamespace); + function getDefaultNamespace() { $.get('/sparql', function(data) { // Chrome does not work with rdf\:Description, so look for Description too This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |