blob: 65ae361a02cc7ac864c1a739f3ab9f305c34beaf [file] [log] [blame]
<!--
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>
<!--###BEGIN_HEAD###-->
<title>Prefix mappings management</title>
<!--###END_HEAD###-->
</head>
<body>
<div id="main">
<div id="contents">
<!--###BEGIN_CONTENT###-->
<h1>Prefixes</h1>
<h2>Management</h2>
<p>
Here you can configure the prefix mappings for the RDF namespaces used in Marmotta:
</p>
<table id="prefixes" class="simple_table">
<tr>
<th>Prefix</th>
<th>Namespace</th>
</tr>
</table>
<h2 style="margin-top: 5em:">New prefix</h2>
<table id="add-new-prefix" style="margin: 2em auto 0 auto; background-color:#eeeeee; padding:20px; border:1px solid gray;-webkit-border-radius: 3px; border-radius: 3px;">
<tr>
<td>Prefix:</td>
<td><input type="text" size="10" name="prefix" id="new-prefix" /></td>
</tr>
<tr>
<td>Namespace:</td>
<td><input type="text" size="50" name="prefix" id="new-namespace" /></td>
</tr>
</table>
<p style="width:100%; text-align:center; padding-top:10px; margin-bottom:30px;">
<input type="submit" id="add-new-prefix-button" value="Add new prefix" />
</p>
<script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
function appendPrefix(prefix, namespace) {
$("table#prefixes > tbody:last").append("<tr><td>" + prefix + "</td><td><a href=\"" + namespace + "\">" + namespace + "</a></td></tr>");
}
$.getJSON("../../prefix", function(data) {
$.each(data, function(prefix, namespace) {
appendPrefix(prefix, namespace);
});
});
$("#add-new-prefix-button").click(function() {
var prefix = $("#new-prefix").val();
var namespace = $("#new-namespace").val();
var url = "../../prefix/" + prefix + "?uri=" + namespace;
$.ajax({
type: "POST",
url: url,
statusCode: {
201: function() {
appendPrefix($("#new-prefix").val(), $("#new-namespace").val());
$("#new-prefix").val("");
$("#new-namespace").val("");
},
406: function() {
alert("Invalid namespace URI!");
},
409: function() {
alert("Invalid prefix mapping!");
}
},
dataType: "application/json"
});
});
});
</script>
<!--###END_CONTENT###-->
</div>
</div>
</body>
</html>