You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2015/04/14 15:13:14 UTC

[39/87] [abbrv] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java
new file mode 100644
index 0000000..dfeccd3
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.clerezza.platform.content.webdav;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.ws.rs.HttpMethod;
+
+/**
+ * Indicates that the annotated method responds to HTTP MKCOL requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("MKCOL")
+public @interface MKCOL {
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MOVE.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MOVE.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MOVE.java
new file mode 100644
index 0000000..34fa8e9
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/MOVE.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.clerezza.platform.content.webdav;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.ws.rs.HttpMethod;
+
+/**
+ * Indicates that the annotated method responds to HTTP MOVE requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("MOVE")
+public @interface MOVE {
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPFIND.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPFIND.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPFIND.java
new file mode 100644
index 0000000..c819fb6
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPFIND.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.clerezza.platform.content.webdav;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.ws.rs.HttpMethod;
+
+/**
+ * Indicates that the annotated method responds to HTTP PROPFIND requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("PROPFIND")
+public @interface PROPFIND {
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPPATCH.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPPATCH.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPPATCH.java
new file mode 100644
index 0000000..6799e22
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/PROPPATCH.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.clerezza.platform.content.webdav;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.ws.rs.HttpMethod;
+
+/**
+ * Indicates that the annotated method responds to HTTP PROPPATCH requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("PROPPATCH")
+public @interface PROPPATCH {
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/UNLOCK.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/UNLOCK.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/UNLOCK.java
new file mode 100644
index 0000000..ff52904
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/UNLOCK.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.clerezza.platform.content.webdav;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.ws.rs.HttpMethod;
+
+/**
+ * Indicates that the annotated method responds to HTTP UNLOCK requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("UNLOCK")
+public @interface UNLOCK {
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/META-INF/documentation.nt
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/META-INF/documentation.nt b/platform/content/src/main/resources/META-INF/documentation.nt
new file mode 100644
index 0000000..07d24f4
--- /dev/null
+++ b/platform/content/src/main/resources/META-INF/documentation.nt
@@ -0,0 +1,59 @@
+<bundle:///discobits-editor-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+<bundle:///discobits-editor-content> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78eb .
+_:A7186a206X3aX12390722930X3aXX2dX78ea <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+_:A7186a206X3aX12390722930X3aXX2dX78ea <http://discobits.org/ontology#pos> "1" .
+_:A7186a206X3aX12390722930X3aXX2dX78ea <http://discobits.org/ontology#holds> <bundle:///platform-content-content-el/1> .
+_:A7186a206X3aX12390722930X3aXX2dX78eb <http://discobits.org/ontology#holds> <bundle:///discobits-editor-content-el/0> .
+_:A7186a206X3aX12390722930X3aXX2dX78eb <http://discobits.org/ontology#pos> "0" .
+_:A7186a206X3aX12390722930X3aXX2dX78eb <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+<bundle:///discobits-editor-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///discobits-editor-content-el/0> <http://discobits.org/ontology#infoBit> "The discobits editor allow editing stuctured content. The overall structure is stored in RDF the actual bits of rich text are stored in the XHTML format. The editor refects this by providing widgets for editing the structure and an XHTML editor (mozile) for editing bits of XHTML."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///platform-content-content> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78ea .
+<bundle:///platform-content-content> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e9 .
+<bundle:///platform-content-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+_:A7186a206X3aX12390722930X3aXX2dX78e8 <http://discobits.org/ontology#holds> <bundle:///discobits-editor-title> .
+_:A7186a206X3aX12390722930X3aXX2dX78e8 <http://discobits.org/ontology#pos> "0" .
+_:A7186a206X3aX12390722930X3aXX2dX78e8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+<bundle:///platform-content-content-el/1-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+<bundle:///platform-content-content-el/1-content> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e7 .
+<bundle:///platform-content-content-el/1-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///platform-content-content-el/1-content-el/0> <http://discobits.org/ontology#infoBit> "The attribute \"binary\" may sound a bit confusing when referring to content as all content stored on a computer is binary. We use the term here for arbitrary content which can be stored on the platform and retrieved as binary identical copy. For example if an RDF/XML file is uploaded as binary content one will be able to retrieve a copy that is identical to the original file, i.e. including comments and possible syntax error, would the same file be uploaded as graph (rather than binary content) the file would be parsed on upload (producing an exception in the case of syntax error) and one will be able to access a serialization of that graph in any supported RDF format, the downloaded documents will describe the same graph but not (necessarily) be binary identical to the uploaded document."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+_:A7186a206X3aX12390722930X3aXX2dX78e7 <http://discobits.org/ontology#holds> <bundle:///platform-content-content-el/1-content-el/0> .
+_:A7186a206X3aX12390722930X3aXX2dX78e7 <http://discobits.org/ontology#pos> "0" .
+_:A7186a206X3aX12390722930X3aXX2dX78e7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+<bundle:///platform-content-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///platform-content-content-el/0> <http://discobits.org/ontology#infoBit> "The Platform Content Module (Bundle-ID: org.apache.clerezza.platform.content) provides tools to upload, view and edit structured and binary content. It provides basic templates for displaying content as well as an editor (<a xmlns=\"http://www.w3.org/1999/xhtml\" bitly=\"BITLY_PROCESSED\" href=\"bundle:///discobits-editor\">the Discobits Editor</a>) to edit content. It also allows putting binary content using tools that support HTTP PUT (such as curl)."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+_:A7186a206X3aX12390722930X3aXX2dX78e6 <http://discobits.org/ontology#holds> <bundle:///platform-content-content-el/1-content> .
+_:A7186a206X3aX12390722930X3aXX2dX78e6 <http://discobits.org/ontology#pos> "1" .
+_:A7186a206X3aX12390722930X3aXX2dX78e6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+<bundle:///platform-content-content-el/1> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e6 .
+<bundle:///platform-content-content-el/1> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e5 .
+<bundle:///platform-content-content-el/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+<bundle:///discobits-editor-title> <http://discobits.org/ontology#infoBit> "The Discobits Editor"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///discobits-editor-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///platform-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+<bundle:///platform-content> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e4 .
+<bundle:///platform-content> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e3 .
+<bundle:///platform-content-content-el/1-title> <http://discobits.org/ontology#infoBit> "Uploading Binary Content"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///platform-content-content-el/1-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+_:A7186a206X3aX12390722930X3aXX2dX78e9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+_:A7186a206X3aX12390722930X3aXX2dX78e9 <http://discobits.org/ontology#pos> "0" .
+_:A7186a206X3aX12390722930X3aXX2dX78e9 <http://discobits.org/ontology#holds> <bundle:///platform-content-content-el/0> .
+_:A7186a206X3aX12390722930X3aXX2dX78e2 <http://discobits.org/ontology#holds> <bundle:///discobits-editor-content> .
+_:A7186a206X3aX12390722930X3aXX2dX78e2 <http://discobits.org/ontology#pos> "1" .
+_:A7186a206X3aX12390722930X3aXX2dX78e2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+_:A7186a206X3aX12390722930X3aXX2dX78e4 <http://discobits.org/ontology#pos> "0" .
+_:A7186a206X3aX12390722930X3aXX2dX78e4 <http://discobits.org/ontology#holds> <bundle:///platform-content-title> .
+_:A7186a206X3aX12390722930X3aXX2dX78e5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+_:A7186a206X3aX12390722930X3aXX2dX78e5 <http://discobits.org/ontology#pos> "0" .
+_:A7186a206X3aX12390722930X3aXX2dX78e5 <http://discobits.org/ontology#holds> <bundle:///platform-content-content-el/1-title> .
+_:A7186a206X3aX12390722930X3aXX2dX78e4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+<bundle:///discobits-editor> <http://clerezza.org/2009/08/documentation#after> <bundle:///platform-content> .
+<bundle:///discobits-editor> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e2 .
+<bundle:///discobits-editor> <http://discobits.org/ontology#contains> _:A7186a206X3aX12390722930X3aXX2dX78e8 .
+<bundle:///discobits-editor> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+_:A7186a206X3aX12390722930X3aXX2dX78e3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> .
+_:A7186a206X3aX12390722930X3aXX2dX78e3 <http://discobits.org/ontology#holds> <bundle:///platform-content-content> .
+_:A7186a206X3aX12390722930X3aXX2dX78e3 <http://discobits.org/ontology#pos> "1" .
+<bundle:///platform-content-title> <http://discobits.org/ontology#infoBit> "Platform Content Module"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///platform-content-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/OrderedContent_naked.xhtml
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/OrderedContent_naked.xhtml b/platform/content/src/main/resources/org/apache/clerezza/platform/content/OrderedContent_naked.xhtml
new file mode 100644
index 0000000..7751b6b
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/OrderedContent_naked.xhtml
@@ -0,0 +1,4 @@
+${ns:discobits=http://discobits.org/ontology#}
+${loop sort asc discobits:contains/discobits:pos}
+	<div>${render(discobits:contains/discobits:holds, "naked")}</div>
+${/loop}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource.xhtml
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource.xhtml b/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource.xhtml
new file mode 100644
index 0000000..2d891b6
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+	<head>
+		<link type="text/css" href="/style/style.css" rel="stylesheet" />
+		<meta content="noindex, nofollow" name="robots"/>
+		<title>Untitled Content</title>
+	</head>
+	<body>
+			${render(., "naked")}
+	</body>
+</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource_naked.xhtml
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource_naked.xhtml b/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource_naked.xhtml
new file mode 100644
index 0000000..ed10718
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/Resource_naked.xhtml
@@ -0,0 +1 @@
+${.}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/TitledContent.xhtml
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/TitledContent.xhtml b/platform/content/src/main/resources/org/apache/clerezza/platform/content/TitledContent.xhtml
new file mode 100644
index 0000000..1da56e0
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/TitledContent.xhtml
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+${ns:discobits=http://discobits.org/ontology#}
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+	${loop sort asc discobits:contains/discobits:pos}
+		${if lexicalForm(discobits:contains/discobits:pos) = "0"}
+			<head>
+				<link type="text/css" href="/style/style.css" rel="stylesheet" />
+				<title>${render(discobits:contains/discobits:holds, "naked")}</title>
+			</head>
+		${/if}
+	${/loop}
+	<body>
+		${render(., "naked")}
+	</body>
+</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/XHTML_InfoDiscoBit_naked.xhtml
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/XHTML_InfoDiscoBit_naked.xhtml b/platform/content/src/main/resources/org/apache/clerezza/platform/content/XHTML_InfoDiscoBit_naked.xhtml
new file mode 100644
index 0000000..2b3cfa3
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/XHTML_InfoDiscoBit_naked.xhtml
@@ -0,0 +1 @@
+${ns:discobits=http://discobits.org/ontology#}${discobits:infoBit}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/XmlLiteral.ssp
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/XmlLiteral.ssp b/platform/content/src/main/resources/org/apache/clerezza/platform/content/XmlLiteral.ssp
new file mode 100644
index 0000000..51872c7
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/XmlLiteral.ssp
@@ -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.
+ *
+*/
+
+import _root_.scala.xml._
+
+{
+	var elem:Elem = null
+	val lexicalForm:String = res*;
+	try {		
+		elem = XML.loadString(lexicalForm)
+		elem
+	} catch {
+	  case e: Exception =>
+		val elem:Elem = XML.loadString("<span>" + lexicalForm + "</span>")
+		elem
+	}
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/collection.ssp
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/collection.ssp b/platform/content/src/main/resources/org/apache/clerezza/platform/content/collection.ssp
new file mode 100644
index 0000000..bca6d6f
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/collection.ssp
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+def hierarchy(s: Any) = new UriRef("http://clerezza.org/2009/09/hierarchy#" + s)
+<div id="tx-content">
+	<h3>{res*}</h3>
+	{ifx ((res/hierarchy("parent")).length != 0){
+	<h4>Parent: <a href={res/hierarchy("parent")*}>{res/hierarchy("parent")*}</a></h4>
+	}
+	}
+	{if ((res/-hierarchy("parent")).length != 0){
+	<ul>
+		{for (member <- (res/-hierarchy("parent"))) yield
+			{
+			<li><a href={member*}>{member*}</a></li>
+			}
+		}
+	</ul>} else {}
+	}
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/disco.xhtml
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/disco.xhtml b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/disco.xhtml
new file mode 100644
index 0000000..a1cca0b
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/disco.xhtml
@@ -0,0 +1,171 @@
+<?xml version='1.0'?>
+<!--
+
+ 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.
+
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Discobits Editor</title>
+    <link type="text/css" href="style/discostyle.css" rel="stylesheet" />
+	<link type="text/css" href="/style/style.css" rel="stylesheet" />
+    <script type="text/javascript" src="discoscripts/mozile/mozile.js"></script>
+    <script src="discoscripts/util.js" type="text/javascript"></script>
+    <script src="discoscripts/uri.js" type="text/javascript"></script>
+    <script src="discoscripts/term.js" type="text/javascript"></script>
+    <script src="discoscripts/match.js" type="text/javascript"></script>
+    <script src="discoscripts/rdfparser.js" type="text/javascript"></script>
+    <script src="discoscripts/identity.js" type="text/javascript"></script>
+
+    <script src="discoscripts/log.js" type="text/javascript"></script>
+
+    <script src="discoscripts/widget-factory.js" type="text/javascript"></script>
+    <script src="discoscripts/rdfxmlserializer.js" type="text/javascript"></script>
+    <script type="text/javascript" src="discoscripts/parameters.js" />
+    <script type="text/javascript" src="scripts/tria-disco.js" />
+    <script type="text/javascript">
+        /* here some custom methods could be inserted:
+                        WidgetFactory.createURIderefURL =;
+                        WidgetFactory.putData = ;
+         */
+
+
+        var init = function() {
+            WidgetFactory.root = "discoscripts/"
+            var parameters = new Parameters();
+            var uriParam = parameters.getField("uri");
+            var uri;
+            if (!uriParam) {
+                uri = document.location.toString().substring(
+				0, document.location.toString().indexOf('/', 9)+1);
+            } else {
+                uri = uriParam;
+            }
+            var discobitURIElem = document.getElementById('discobitURI');
+            discobitURIElem.value = uri;
+            discobitURIElem.disabled = false;
+            var changeLink = document.getElementById('changeLink');
+            changeLink.style.display = "none";
+
+            var loadParam = parameters.getField("load");
+            if (loadParam == "auto") {
+                setURI();
+            }
+			initGraphSelection();
+        }
+
+		var initGraphSelection = function() {
+			var graphUriField = document.getElementById('graphUri');
+            graphUriField.disabled = true;
+			var graphTypeCustomRadio = document.getElementById('graphTypeCustom');
+			var enableDisableFunction = function() {
+				graphUriField.disabled = !graphTypeCustomRadio.checked
+			}
+			graphTypeCustomRadio.onchange = enableDisableFunction
+			document.getElementById('graphTypeDefault').onchange = enableDisableFunction
+
+		}
+
+        var unload = function() {
+            var beforeunload = window.onbeforeunload();
+            if (beforeunload) {
+                if (!confirm(beforeunload)) {
+                    return;
+                }
+            }
+            WidgetFactory.openWidgets = new Array();
+            var place = document.getElementById('place');
+            while (place.firstChild) {
+                place.removeChild(place.firstChild);
+            }
+            var discobitURIElem = document.getElementById('discobitURI');
+            var loadButton = document.getElementById('loadButton');
+            var changeLink = document.getElementById('changeLink');
+            loadButton.disabled = false;
+            discobitURIElem.disabled = false;
+            changeLink.style.display = "none";
+        }
+
+        var setURI = function() {
+            var place = document.getElementById('place');
+            while (place.firstChild) {
+                place.removeChild(place.firstChild);
+            }
+            var discobitURIElem = document.getElementById('discobitURI');
+            var body = document.getElementsByTagNameNS(xhtmlNS,"body")[0];
+            var origCursor = body.style.cursor;
+            body.style.cursor = 'progress';
+			var graphUriField = document.getElementById('graphUri');
+			var graphTypeCustomRadio = document.getElementById('graphTypeCustom');
+			if (graphTypeCustomRadio.checked) {
+				TriaDisco.graphUri = graphUriField.value
+			} else {
+				TriaDisco.graphUri = null
+			}
+            WidgetFactory.createBackground(
+            function() {
+                body.style.cursor = origCursor;
+            },
+            new RDFSymbol(discobitURIElem.value),
+            place);
+            var loadButton = document.getElementById('loadButton');
+            loadButton.disabled = true;
+
+            discobitURIElem.disabled = true;
+            var changeLink = document.getElementById('changeLink');
+            changeLink.style.display = "";
+        }
+
+        var origSerializer = RDFXMLSerializer.serialize;
+
+        RDFXMLSerializer.serialize = function(store, uri) {
+            return origSerializer(store, "");
+        }
+
+        WidgetFactory.putData = TriaDisco.putData;
+
+    </script>
+
+  </head>
+  <body onload="init()">
+    <h1><a href="http://discobits.org/"><img src="style/disco-icon.png" width="63" height="53" alt="DiscoBits icon"  /></a>
+    Discobits Editor</h1>
+    <p>Edit discobits resources.</p>
+    <h2>Deprecation note</h2>
+    <p>This editor does not work with more recent browsers. A replacement is provided by 
+        the platform.editor bundle. If this bundle is installed you can edit
+        resources in the content-graph by adding "?mode=edit" to the URI of the resource
+        you want to edit.
+    </p>
+    <div>
+	  Graph: <input type="radio" name="graphType" value="default" id="graphTypeDefault" checked="checked"/> default
+			 <input type="radio" name="graphType" value="custom" id="graphTypeCustom" />
+			 <input type="text" size="80" name="graphUri" id="graphUri"/><br />
+      Resource: <input type="text" id="discobitURI" size="80"/>
+      <button id="loadButton" onclick="setURI()">Load</button>
+      <a href="#" onclick="unload()" id="changeLink" >change</a>
+    </div>
+    <div id="place" />
+
+
+    <div id="copyright" class="small"> &copy; 2007 Reto Bachmann-Gmür and Danny Ayers </div>
+  </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/identity.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/identity.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/identity.js
new file mode 100644
index 0000000..96f026f
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/identity.js
@@ -0,0 +1,399 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+//  Identity management for RDF
+//
+// This file sees that things which are identical 
+// according to owl:sameAs or an owl:InverseFunctionalProperty
+// or an owl:FunctionalProperty
+//
+// Missing: Equating predicates will not propagate these actions
+//
+
+// String for hashing. The literal one maybe is slow?
+
+/*jsl:option explicit*/ // Turn on JavaScriptLint variable declaration checking
+
+owl_ns = "http://www.w3.org/2002/07/owl#";
+link_ns = "http://www.w3.org/2006/link#";
+
+/* hashString functions are used as array indeces. This
+** is done to avoid conflict with existing properties of arrays such as length and map.
+** See issue 139.
+*/
+RDFLiteral.prototype.hashString = RDFLiteral.prototype.toNT;
+RDFSymbol.prototype.hashString = RDFSymbol.prototype.toNT;
+RDFBlankNode.prototype.hashString = RDFBlankNode.prototype.toNT;
+RDFCollection.prototype.hashString = RDFCollection.prototype.toNT;
+
+RDFIndexedFormula.prototype = new RDFFormula();
+RDFIndexedFormula.prototype.constructor = RDFIndexedFormula;
+// RDFIndexedFormula.superclass = RDFFormula.prototype;
+
+RDFArrayRemove = function(a, x) {  //removes all elements equal to x from a
+    var i;
+    for(i=0; i<a.length; i++) {
+	if (a[i] == x) {
+            a.splice(i,1);
+            return;
+	}
+    }
+    alert("RDFArrayRemove: Array did not contain "+x);
+};
+
+//Stores an associative array that maps URIs to functions
+function RDFIndexedFormula() {
+    this.statements = [];    // As in RDFFormula
+    this.propertyAction = []; // What to do when getting statement with {s X o}
+    //maps <uri> to f(F,s,p,o)
+    this.classAction = [];   // What to do when adding { s type X }
+    this.redirection = [];   // redirect to lexically smaller equivalent symbol
+    this.subjectIndex = [];  // Array of statements with this X as subject
+    this.predicateIndex = [];  // Array of statements with this X as subject
+    this.objectIndex = [];  // Array of statements with this X as object
+    this.namespaces = {} // Dictionary of namespace prefixes
+
+    // Callbackify?
+    
+    function handleRDFType(formula, subj, pred, obj, why) {
+        if (typeof formula.typeCallback != 'undefined')
+            formula.typeCallback(formula, obj, why);
+
+        var x = formula.classAction[obj.hashString()];
+        if (x) return x(formula, subj, pred, obj);
+        return false; // statement given is needed
+    } //handleRDFType
+
+    //If the predicate is #type, use handleRDFType to create a typeCallback on the object
+    this.propertyAction[
+	'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'] = handleRDFType;
+
+    // Assumption: these terms are not redirected @@fixme
+    this.propertyAction['<http://www.w3.org/2002/07/owl#sameAs>'] =
+	function(formula, subj, pred, obj, why) {
+            formula.equate(subj,obj);
+            return false; // statement given is needed e.g. when dereferencing
+	}; //sameAs -> equate & don't add to index
+    
+    this.propertyAction['<http://www.w3.org/2006/link#obsoletes>'] =
+	function(formula, subj, pred, obj, why) {
+            formula.replaceWith(obj, subj);
+            return false; // statement given IS needed
+	}; //sameAs -> equate & don't add to index
+    
+    function newPropertyAction(formula, pred, action) {
+	fyi("newPropertyAction:  "+pred);
+        formula.propertyAction[pred] = action;
+	var fixEndA = formula.statementsMatching(undefined, pred, undefined);
+	var i;
+	for (i=0; i<fixEndA.length; i++) { // NOT optimized - sort fixEndA etc
+//	    fyi("nePropertyAction: retrospective action for "+st)
+	    if (action(formula, fixEndA[i].subject, pred, fixEndA[i].object)) {
+//@@		kb.remove(st); /// messing up the list we are iterating over?? @@
+		fyi("newPropertyAction: NOT removing "+fixEndA[i]);
+	    }
+	}
+	return false;
+    }
+
+    this.classAction["<"+owl_ns+"InverseFunctionalProperty>"] =
+	function(formula, subj, pred, obj, addFn) {
+	    return newPropertyAction(formula, subj, handle_IFP); // yes subj not pred!
+	}; //IFP -> handle_IFP, do add to index
+
+    this.classAction["<"+owl_ns+"FunctionalProperty>"] =
+	function(formula, subj, proj, obj, addFn) {
+	    return newPropertyAction(formula, subj, handle_FP);
+	}; //FP => handleFP, do add to index
+
+    function handle_IFP(formula, subj, pred, obj)  {
+        var s1 = formula.any(undefined, pred, obj);
+        if (typeof s1 == 'undefined') return false; // First time with this value
+        formula.equate(s1, subj);
+        return true;
+    } //handle_IFP
+
+    function handle_FP(formula, subj, pred, obj)  {
+        var o1 = formula.any(subj, pred, undefined);
+        if (typeof o1 == 'undefined') return false; // First time with this value
+        formula.equate(o1, obj);
+        return true ;
+    } //handle_FP
+    
+} /* end RDFIndexedFormula */
+
+
+RDFIndexedFormula.prototype.register = function(prefix, nsuri) {
+    this.namespaces[prefix] = nsuri
+}
+
+
+/** simplify graph in store when we realize two identifiers are equal
+
+We replace the bigger with the smaller.
+
+*/
+RDFIndexedFormula.prototype.equate = function(u1, u2) {
+    // fyi("Equating "+s+" and "+o)
+    var d = u1.compareTerm(u2);
+    if (!d) return true; // No information in {a = a}
+    var big, small;
+    if (d < 0)  {  // u1 less than u2
+	return this.replaceWith(u2, u1);
+    } else {
+	return this.replaceWith(u1, u2);
+    }
+}
+
+// Replace big with small, obsoleted with obsoleting.
+//
+RDFIndexedFormula.prototype.replaceWith = function(big, small) {
+
+    var i, matches, fixEndA, hash;
+    fixEndA = this.statementsMatching(big, undefined, undefined);
+    matches = fixEndA.length;
+
+    for (i=0; i<matches; i++) {
+        fixEndA[i].subject = small;
+	hash = small.hashString();
+        if (typeof this.subjectIndex[hash] == 'undefined')
+                this.subjectIndex[hash] = [];
+        this.subjectIndex[hash].push(fixEndA[i]);
+    }
+    delete this.subjectIndex[big.hashString()];
+
+    // If we allow equating predicates we must index them.
+    fixEndA = this.statementsMatching(undefined, big, undefined);
+    matches = fixEndA.length;
+    
+    for (i=0; i<matches; i++) {
+	fixEndA[i].predicate = small;
+	hash = small.hashString();
+	if (typeof this.predicateIndex[hash] == 'undefined')
+	    this.predicateIndex[hash] = [];
+	this.predicateIndex[hash].push(fixEndA[i]);
+    }
+    delete this.predicateIndex[big.hashString()];
+    
+    fixEndA = this.statementsMatching(undefined, undefined, big);
+    matches = fixEndA.length;
+
+    for (i=0; i<matches; i++) {
+        //  RDFArrayRemove(this.objectIndex[big], st)
+        fixEndA[i].object = small;
+	hash = small.hashString()
+        if (typeof this.objectIndex[hash] == 'undefined')
+                this.objectIndex[hash] = [];
+        this.objectIndex[hash].push(fixEndA[i]);
+    }
+    delete this.objectIndex[big.hashString()];
+    
+    this.redirection[big.hashString()] = small;
+
+    /* merge actions @@ assumes never > 1 action*/
+    var action = this.classAction[big.hashString()];
+    if ((typeof action != 'undefined') &&
+	(typeof this.classAction[small.hashString()] == 'undefined')) {
+	    this.classAction[small.hashString()] = action;
+    }
+    
+    action = this.propertyAction[big.hashString()];
+    if ((typeof action != 'undefined') &&
+	(typeof this.propertyAction[small.hashString()] == 'undefined')) {
+	    this.propertyAction[small.hashString()] = action;
+	    alert("copying action on "+big+" to "+small)
+    }
+    
+    fyi("Equate done. "+big+" to be known as "+small)    
+    return false;
+};
+
+
+// On input parameters, do redirection and convert constants to terms
+// We do not redirect literals
+function RDFMakeTerm(formula,val) {
+    if (typeof val != 'object') {   
+	if (typeof val == 'string') {
+	    return new RDFLiteral(val);
+	} else if (typeof val == 'undefined') {
+	    return undefined;
+	} else {   // @@ add converting of dates and numbers
+	    alert("Can't make term from " + val + " of type " + typeof val); 
+	}
+    }
+    if (typeof formula.redirection == 'undefined') 
+	alert('formula: '+ formula+', term: '+val);
+    var y = formula.redirection[val.hashString()];
+    if (typeof y == 'undefined') return val;
+//    fyi(" redirecting "+val+" to "+y)
+    return y;
+}
+
+// add a triple to the store
+RDFIndexedFormula.prototype.add = function(subj, pred, obj, why) {
+    var action, st, hashS, hashP, hashO;
+    subj = RDFMakeTerm(this, subj);
+    pred = RDFMakeTerm(this, pred);
+    obj = RDFMakeTerm(this, obj);
+    why = RDFMakeTerm(this, why);
+    
+    var hashS = subj.hashString();
+    var hashP = pred.hashString();
+    var hashO = obj.hashString();
+    
+    // Check we don't already know it -- esp when working with dbview
+    st = this.anyStatementMatching(subj,pred,obj) // @@@@@@@ temp fix <====WATCH OUT!
+    if (typeof st != 'undefined') return; // already in store
+    //    fyi("\nActions for "+s+" "+p+" "+o+". size="+this.statements.length)
+    if (typeof this.predicateCallback != 'undefined')
+	this.predicateCallback(this, pred, why);
+	
+    // Action return true if the statement does not need to be added
+    action = this.propertyAction[hashP];
+    if (action && action(this, subj, pred, obj, why)) return;
+    
+    st = new RDFStatement(subj, pred, obj, why);
+    if (typeof this.subjectIndex[hashS] =='undefined') this.subjectIndex[hashS] = [];
+    this.subjectIndex[hashS].push(st); // Set of things with this as subject
+    
+    if (typeof this.predicateIndex[hashP] =='undefined') this.predicateIndex[hashP] = [];
+    this.predicateIndex[hashP].push(st); // Set of things with this as subject
+    
+    if (typeof this.objectIndex[hashO] == 'undefined') this.objectIndex[hashO] = [];
+    this.objectIndex[hashO].push(st); // Set of things with this as object
+    
+    this.statements.push(st);
+}; //add
+
+
+RDFIndexedFormula.prototype.anyStatementMatching = function(subj,pred,obj,why) {
+    var x = this.statementsMatching(subj,pred,obj,why,true);
+    if (!x || x == []) return undefined;
+    return x[0];
+};
+
+// return statements matching a pattern
+// ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!
+RDFIndexedFormula.prototype.statementsMatching = function(subj,pred,obj,why,justOne) {
+    var results = [];
+    var candidates;
+    fyi("\nMatching {"+subj+" "+pred+" "+obj+"}");
+    subj = RDFMakeTerm(this, subj);
+    pred = RDFMakeTerm(this, pred);
+    obj = RDFMakeTerm(this, obj);
+    why = RDFMakeTerm(this, why);
+
+    if (typeof(pred) != 'undefined' && this.redirection[pred.hashString()])
+	pred = this.redirection[pred.hashString()];
+
+    if (typeof(obj) != 'undefined' && this.redirection[obj.hashString()])
+	obj = this.redirection[obj.hashString()];
+
+	//looks for candidate statements matching a given s/p/o
+    if (typeof(subj) =='undefined') {
+        if (typeof(obj) =='undefined') {
+	    if (typeof(pred) == 'undefined') { 
+		candidates = this.statements; //all wildcards
+	    } else {
+		candidates = this.predicateIndex[pred.hashString()];
+//		fyi("@@Trying predciate "+p+" length "+candidates.length)
+
+		if (typeof candidates == 'undefined') return [];
+		fyi("Trying predicate "+pred+" index of: "+candidates.length +
+			    " for {"+subj+" "+pred+" "+obj+" @ "+why+"}");
+	    }
+    //      fyi("Trying all "+candidates.length+" statements")
+        } else { // subj undefined, obj defined
+            candidates = this.objectIndex[obj.hashString()];
+            if (typeof candidates == 'undefined') return [];
+            if ((typeof pred == 'undefined') &&
+		(typeof why == 'undefined')) {
+                // fyi("Returning all statements for object")
+                return candidates ;
+            }
+            // fyi("Trying only "+candidates.length+" object statements")
+        }
+    } else {  // s defined
+        if (this.redirection[subj.hashString()])
+            subj = this.redirection[subj.hashString()];
+        candidates = this.subjectIndex[subj.hashString()];
+        if (typeof candidates == 'undefined') return [];
+        if (typeof(obj) =='undefined') {
+	    if ((typeof pred == 'undefined') && (typeof why == 'undefined')) {
+		// fyi("Trying all "+candidates.length+" subject statements")
+		return candidates;
+	    }
+	} else { // s and o defined ... unusual in practice?
+            var oix = this.objectIndex[obj.hashString()];
+            if (typeof oix == 'undefined') return [];
+	    if (oix.length < candidates.length) {
+		candidates = oix;
+//		fyi("Wow!  actually used object index instead of subj");
+	    }
+	
+        }
+        // fyi("Trying only "+candidates.length+" subject statements")
+    }
+    
+    if (typeof candidates == 'undefined') return [];
+//    fyi("Matching {"+s+" "+p+" "+o+"} against "+n+" stmts")
+    var i;
+    var st;
+    for(i=0; i<candidates.length; i++) {
+        st = candidates[i]; //for each candidate, match terms of candidate with input, then return all
+        // fyi("  Matching against st=" + st +" why="+st.why);
+        if (RDFTermMatch(pred, st.predicate) &&  // first as simplest
+            RDFTermMatch(subj, st.subject) &&
+            RDFTermMatch(obj, st.object) &&
+            RDFTermMatch(why, st.why)) {
+            // fyi("   Found: "+st)
+            if (justOne) return [st];
+            results.push(st);
+        }
+    }
+    return results;
+}; // statementsMatching
+
+
+/** remove a particular statement from the bank **/
+RDFIndexedFormula.prototype.remove = function (st) {
+  fyi("entering remove w/ st=" + st);
+  var subj = st.subject, pred = st.predicate, obj = st.object;
+  if (typeof this.subjectIndex[subj.hashString()] == 'undefined') twarn ("statement not in sbj index: "+st);
+  if (typeof this.predicateIndex[pred.hashString()] == 'undefined') twarn ("statement not in pred index: "+st);
+  if (typeof this.objectIndex[obj.hashString()] == 'undefined') twarn ("statement not in obj index: " +st);
+
+  RDFArrayRemove(this.subjectIndex[subj.hashString()], st);
+  RDFArrayRemove(this.predicateIndex[pred.hashString()], st);
+  RDFArrayRemove(this.objectIndex[obj.hashString()], st);
+  RDFArrayRemove(this.statements, st);
+}; //remove
+
+/** remove all statements matching args (within limit) **/
+RDFIndexedFormula.prototype.removeMany = function (subj, pred, obj, why, limit) {
+  fyi("entering removeMany w/ subj,pred,obj,why,limit = " + subj +", "+ pred+", " + obj+", " + why+", " + limit);
+  var statements = this.statementsMatching (subj, pred, obj, why, false);
+  if (limit) statements = statements.slice(0, limit);
+  for (var st in statements) this.remove(statements[st]);
+}; //removeMany
+
+// ends
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/log.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/log.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/log.js
new file mode 100644
index 0000000..8dfa038
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/log.js
@@ -0,0 +1,104 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/////////////////////////  Logging
+//
+//bitmask levels
+TNONE = 0; 
+TERROR = 1;
+TWARN = 2;
+TMESG = 4;
+TSUCCESS = 8;
+TINFO = 16;
+TDEBUG = 32;
+TALL = 63;
+logging = {
+    ascending : false, 
+    level : TERROR | TWARN //default
+};
+
+function escapeForXML(str) {
+    return str.replace(/&/g, '&amp;').replace(/</g, '&lt;')
+}
+
+// t is for tabulator
+//log a message where type is mesg|warning|error|debug|info|good
+function tmsg(msg)  { tlog(msg, TMESG, 'mesg') };
+function tinfo(msg)  { tlog(msg, TINFO, 'info') };
+function twarn(msg) { tlog(msg, TWARN, 'warn') };
+function terror(msg) { tlog(msg, TERROR, 'eror') };
+function tdebug(msg) { tlog(msg, TDEBUG, 'dbug') };
+function tsuccess(msg) { tlog(msg, TSUCCESS, 'good') };
+function tlog(str, type, typestr)
+{
+    if (!type) { type = TMESG; typestr = 'mesg'};
+    if (!(logging.level & type)) return; //bitmask
+    var log_area = document.getElementById('status');
+    
+    var addendum = document.createElement("span");
+    addendum.setAttribute('class', typestr);
+    var now = new Date();
+    addendum.innerHTML = now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds()
+            + " [" + typestr + "] "+ escapeForXML(str) + "<br/>";
+    if (logging.ascending)
+        log_area.appendChild(addendum);
+    else
+        log_area.insertBefore(addendum, log_area.firstChild);
+} //tlog
+fyi = tdebug;
+log = {}
+log.msg = tmsg
+log.warn = twarn
+log.debug = tdebug
+log.info = tinfo
+log.error = terror
+log.success = tsuccess
+
+/** clear the log window **/
+function clearStatus(str) {
+    var x = document.getElementById('status');
+    if (!x) return;
+    //x.innerHTML = "";
+    emptyNode(x);
+} //clearStatus
+
+/** set the logging level **/
+function setLogging(x) {
+    logging.level = TALL;
+    fyi("Logging "+x);
+    logging.level = x;
+}
+
+function dumpStore() {
+    var l = logging.level;
+    logging.level = TALL;
+    fyi("\nStore:\n" + kb + "__________________\n");
+    tdebug("subject index: " + kb.subjectIndex[0] + kb.subjectIndex[1]);
+    tdebug("object index: " + kb.objectIndex[0] + kb.objectIndex[1]);
+    logging.level = l;
+}
+
+function dumpHTML() {
+    var l = logging.level;
+    logging.level = TALL;
+    fyi(document.innerHTML);
+    logging.level = l
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/match.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/match.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/match.js
new file mode 100644
index 0000000..16c57b4
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/match.js
@@ -0,0 +1,192 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+// Matching a statement against a formula
+//
+//
+// W3C open source licence 2005.
+//
+// We retpresent a set as an associative array whose value for
+// each member is set to true.
+
+/* Not used, bogus. See identity.js for the ones really used.
+RDFFormula.prototype.statementsMatching = function(s,p,o,w) {
+    var results = []
+    var i
+    var ls = this.statements.length
+    for (i=0; i<ls; i++) {
+	var st = this.statements[i]
+	if (RDFTermMatch(p, st.predicate) &&  // first as simplest
+	    RDFTermMatch(s, st.subject) &&
+	    RDFTermMatch(o, st.object) &&
+	    RDFTermMatch(w, st.why)) {
+		results[st] = true          @@@@ sould use numeric indexed array
+	}
+	    
+    }
+    return results
+}
+
+RDFFormula.prototype.anyStatementMatching = function(s,p,o,w) {
+    var ls = this.statements.length
+    var i
+    for (i=0; i<ls; i++) {
+	var st = this.statements[i]
+	if (RDFTermMatch(p, st.predicate) &&  // first as simplest
+	    RDFTermMatch(s, st.subject) &&
+	    RDFTermMatch(o, st.object) &&
+	    RDFTermMatch(w, st.why)) {
+		return st
+	}
+	    
+    }
+    return undefined
+}
+
+*/
+
+function RDFTermMatch(pattern, term) {
+    if (typeof pattern == 'undefined') return true;
+    return pattern.sameTerm(term)
+}
+
+RDFSymbol.prototype.sameTerm = function(other) {
+    if (!other) { return false }
+    return ((this.termType == other.termType) && (this.uri == other.uri))
+}
+
+RDFBlankNode.prototype.sameTerm = function(other) {
+    if (!other) { return false }
+    return ((this.termType == other.termType) && (this.id == other.id))
+}
+
+RDFLiteral.prototype.sameTerm = function(other) {
+    if (!other) { return false }
+    return ((this.termType == other.termType)
+	    && (this.value == other.value)
+	    && (this.lang == other.lang) &&
+	    ((!this.datatype && !other.datatype)
+	     || this.datatype.sameTerm(other.datatype)))
+}
+
+RDFVariable.prototype.sameTerm = function (other) {
+    if (!other) { return false }
+    return((this.termType == other.termType) && (this.uri == other.uri))
+}
+
+RDFCollection.prototype.sameTerm = RDFBlankNode.prototype.sameTerm
+
+//  Comparison for ordering
+//
+// These compare with ANY term
+//
+//
+// When we smush nodes we take the lowest value. This is not
+// arbitrary: we want the value actually used to be the literal
+// (or list or formula). 
+
+RDFLiteral.prototype.classOrder = 1
+// RDFList.prototype.classOrder = 2
+// RDFSet.prototype.classOrder = 3
+RDFCollection.prototype.classOrder = 3
+RDFFormula.prototype.classOrder = 4
+RDFSymbol.prototype.classOrder = 5
+RDFBlankNode.prototype.classOrder = 6
+
+//  Compaisons return  sign(self - other)
+//  Literals must come out before terms for smushing
+
+RDFLiteral.prototype.compareTerm = function(other) {
+    if (this.classOrder < other.classOrder) return -1
+    if (this.classOrder > other.classOrder) return +1
+    if (this.value < other.value) return -1
+    if (this.value > other.value) return +1
+    return 0
+} 
+
+RDFSymbol.prototype.compareTerm = function(other) {
+    if (this.classOrder < other.classOrder) return -1
+    if (this.classOrder > other.classOrder) return +1
+    if (this.uri < other.uri) return -1
+    if (this.uri > other.uri) return +1
+    return 0
+} 
+
+RDFBlankNode.prototype.compareTerm = function(other) {
+    if (this.classOrder < other.classOrder) return -1
+    if (this.classOrder > other.classOrder) return +1
+    if (this.id < other.id) return -1
+    if (this.id > other.id) return +1
+    return 0
+} 
+
+RDFCollection.prototype.compareTerm = RDFBlankNode.prototype.compareTerm
+
+//  Convenience routines
+
+// Only one of s p o can be undefined, and w is optional.
+RDFFormula.prototype.each = function(s,p,o,w) {
+    var results = []
+    var st, sts = this.statementsMatching(s,p,o,w)
+    var i, n=sts.length
+    if (typeof s == 'undefined') {
+	for (i=0; i<n; i++) {st=sts[i]; results.push(st.subject)}
+    } else if (typeof p == 'undefined') {
+	for (i=0; i<n; i++) {st=sts[i]; results.push(st.predicate)}
+    } else if (typeof o == 'undefined') {
+	for (i=0; i<n; i++) {st=sts[i]; results.push(st.object)}
+    } else if (typeof w == 'undefined') {
+	for (i=0; i<n; i++) {st=sts[i]; results.push(st.why)}
+    }
+    return results
+}
+
+RDFFormula.prototype.any = function(s,p,o,w) {
+    var st = this.anyStatementMatching(s,p,o,w)
+    if (typeof st == 'undefined') return undefined
+    
+    if (typeof s == 'undefined') return st.subject;
+    if (typeof p == 'undefined') return st.predicate;
+    if (typeof o == 'undefined') return st.object;
+
+    return undefined
+}
+
+RDFFormula.prototype.the = function(s,p,o,w) {
+    // the() should contain a check there is only one
+    var x = this.any(s,p,o,w)
+    if (typeof x == 'undefined')
+	terror("No value found for the(){" + s + " " + p + " " + o + "}.")
+    return x
+}
+ 
+// Not a method. For use in sorts
+function RDFComparePredicateObject(self, other) {
+    var x = self.predicate.compareTerm(other.predicate)
+    if (x !=0) return x
+    return self.object.compareTerm(other.object)
+}
+function RDFComparePredicateSubject(self, other) {
+    var x = self.predicate.compareTerm(other.predicate)
+    if (x !=0) return x
+    return self.subject.compareTerm(other.subject)
+}
+// ends