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/03/23 18:02:59 UTC

[01/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Repository: clerezza
Updated Branches:
  refs/heads/rdf-commons 4d35191bb -> 70220239f


http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java
deleted file mode 100644
index dfeccd3..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/MKCOL.java
+++ /dev/null
@@ -1,37 +0,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.
- */
-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 {
-}


[34/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js
new file mode 100644
index 0000000..fa5bf1c
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/mozile.js
@@ -0,0 +1,1368 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/* ***** BEGIN LICENSE BLOCK *****
+ * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ * Full Terms at http://mozile.mozdev.org/0.8/LICENSE
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is James A. Overton's code (james@overton.ca).
+ *
+ * The Initial Developer of the Original Code is James A. Overton.
+ * Portions created by the Initial Developer are Copyright (C) 2005-2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *	James A. Overton <ja...@overton.ca>
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * Comments and white space have been removed from this file to reduce its size.
+ * For full source code see http://mozile.mozdev.org
+ */
+
+/*
+ * This file includes the following Mozile modules: 
+ * core.js, dom.js, xml.js, xpath.js, util.js, dom/TreeWalker.js, dom/InternetExplorerRange.js, dom/InternetExplorerSelection.js, rng.js, edit.js, edit/InsertionPoint.js, edit/rich.js, event.js, save.js, save/tidy.js, save/extract.js, gui.js, gui/htmlToolbar.js
+ */
+
+var mozile={window:window,document:document,filesep:"/",linesep:"\n",root:""}
+mozile.version={major:"0",minor:"8",micro:"0",flag:"a1",toString:function(){return this.major+"."+this.minor+"."+this.micro+this.flag;}}
+mozile.about="Mozile is a WYSIWYG inline edtior for XHTML and XML+CSS files.";mozile.copyright="Copyright 2006, The Mozile Team";mozile.license="MPL 1.1/GPL 2.0/LGPL 2.1, http://mozile.mozdev.org/0.8/LICENSE";mozile.homepage="http://mozile.mozdev.org";mozile.credits="James A. Overton, Conor Dowling, Max d'Ayala, Christian Stocker, Paul Everitt, David Palm, Richard Prescott, Lars Kiilerich, Kingsley Kerse, Tobias Minich, Andreas Schamberger, and others...";mozile.acknowledgements="Icons created by Mark James <http://www.famfamfam.com/lab/icons/silk/>";mozile.precompiled=true;mozile.deferRequirements=true;mozile.help=["doc","html","index.html"].join(mozile.filesep);mozile.useDesignMode=false;mozile.defaultNS=null;mozile.emptyToken="\u00A0";mozile.alternateSpace=null;mozile.updateInterval=500;mozile.load=function(uri){var XHR;try{if(window.XMLHttpRequest){XHR=new XMLHttpRequest();XHR.open("GET",uri,false);XHR.send(null);}
+else if(window.ActiveXObject){XHR=new ActiveXObject('Microsoft.XMLHTTP');XHR.open("GET",uri,false);XHR.send();}}catch(e){if(mozile.debug)mozile.debug.inform("mozile.load","File load failed loading '"+uri+"' with error message:\n"+e);return null;}
+if(XHR){if(XHR.status==0||XHR.status==200)return XHR.responseText;else{if(mozile.debug)mozile.debug.inform("mozile.load","File load failed with status '"+XHR.status+"' and message:\n"+XHR.responseText);return null;}}
+if(mozile.debug)mozile.debug.inform("mozile.load","No XMLHttpRequest available when trying to load '"+uri+"'.");return null;}
+mozile.findRoot=function(){var scripts=document.getElementsByTagName("script");var matches=["mozile.js","mozile-src.js"];var src,index,i,j;for(i=0;i<scripts.length;i++){src=scripts[i].getAttribute("src");if(!src)continue;for(j=0;j<matches.length;j++){index=src.indexOf(matches[j]);if(index>-1)return src.substring(0,index);}}
+return"";}
+mozile.root=mozile.findRoot();mozile.findModule=function(moduleName){var levels=moduleName.split(".");var current=mozile.window;for(var i=0;i<levels.length;i++){if(!current[levels[i]])return null;current=current[levels[i]];}
+return current;}
+mozile.loadModule=function(moduleName){if(!moduleName)return false;var filename=mozile.root+mozile.filesep;var levels=moduleName.split(".");for(var i=0;i<levels.length;i++){if(levels[i]=="*")levels=levels.splice(i,1);}
+if(levels[0]&&levels[0]=="mozile"){levels.shift();if(levels[0]&&levels[0]=="test"){levels.shift();filename+="tests"+mozile.filesep;}
+else filename+="src"+mozile.filesep;}
+else return false;if(levels.length==0)return false;while(levels.length>1){filename+=levels.shift()+mozile.filesep;}
+filename+=levels.pop()+".js";var file=mozile.load(filename);if(!file&&mozile.test&&mozile.test.root){filename=filename.replace(mozile.root,mozile.test.root);file=mozile.load(filename);}
+if(!file){var parent=moduleName.substring(0,moduleName.lastIndexOf("."));return mozile.loadModule(parent);}
+try{eval(file);return true;}catch(e){mozile.debug.inform("mozile.loadModule","Error evaluating module '"+moduleName+"' in file '"+filename+"'.\n"+mozile.dumpError(e));return false;}}
+mozile.deferrals=new Array();mozile.require=function(moduleName){if(!mozile.findModule(moduleName)){if(mozile.deferRequirements){mozile.deferrals.push(moduleName);return false;}
+return mozile.loadModule(moduleName);}
+else return false;}
+mozile.loadDeferred=function(){while(mozile.deferrals.length){mozile.require(mozile.deferrals.shift());}}
+mozile.provide=function(){}
+mozile.Module=function(){};mozile.isPathAbsolute=function(path){if(!path)return false;path=path.toString();if(path.indexOf(":")==-1)return false;var protocol=path.substring(0,path.indexOf(":"));switch(protocol){case"http":case"https":case"file":return true;}
+return false;}
+mozile.getPath=function(url){if(!url)return"";url=url.toString();if(url.indexOf("?")>-1)url=url.substring(0,url.indexOf("?"));return url;}
+mozile.getDirectory=function(path){if(!path)return"";path=path.toString();path=mozile.getPath(path);var partial;if(path.indexOf(mozile.filesep)>-1){if(path.indexOf(":///")>-1){partial=path.substring(path.indexOf(":///")+4);if(partial.indexOf(mozile.filesep)==-1)return path;}
+else if(path.indexOf("://")>-1){partial=path.substring(path.indexOf("://")+3);if(partial.indexOf(mozile.filesep)==-1)return path;}
+return path.substring(0,path.lastIndexOf(mozile.filesep)+1);}
+return path;}
+mozile.getAbsolutePath=function(path,root){if(!path)return"";path=path.toString();if(mozile.isPathAbsolute(path))return path;if(!root)root=location;root=mozile.getDirectory(root);root=mozile.getAbsolutePath(root);return mozile.joinPaths(root,path);}
+mozile.joinPaths=function(){var path="";var part;for(var i=0;i<arguments.length;i++){part=arguments[i];if(typeof(part)!="string")continue;if(path){if(path.charAt(path.length-1)==mozile.filesep){if(part.charAt(0)==mozile.filesep)
+part=part.substring(1);}
+else{if(part.charAt(0)!=mozile.filesep)
+part=mozile.filesep+part;}}
+path+=part;}
+return path;}
+mozile.debug=new Object();mozile.debug.prototype=new mozile.Module;mozile.debug.alertLevel="suppress";mozile.debug.logLevel="inform";mozile.debug.messages=new Array();mozile.debug.window=null;mozile.debug.isSelected=function(type,level){if(typeof(type)!="string")return false;type=type.toLowerCase();var checkLevel;if(type=="alert")checkLevel=mozile.debug.alertLevel;else if(type=="log")checkLevel=mozile.debug.logLevel;else return false;checkLevel=checkLevel.toLowerCase();if(typeof(level)!="string")return false;level=level.toLowerCase();if(checkLevel=="suppress")return false;if(checkLevel=="warn"){if(level=="warn")return true;else return false;}
+if(checkLevel=="inform"){if(level=="warn"||level=="inform")return true;else return false;}
+if(checkLevel=="debug")return true;return false;}
+mozile.debug.warn=function(caller,message){var level="warn";var msg="Mozile Warning ["+caller+"] "+message;if(mozile.debug.isSelected("alert",level)){if(window.warn)warn(msg);else mozile.alert(msg);}
+if(mozile.debug.isSelected("log",level)){mozile.debug.log(caller,level,message);}}
+mozile.debug.inform=function(caller,message){var level="inform";var msg="Mozile Information ["+caller+"] "+message;if(mozile.debug.isSelected("alert",level)){if(window.inform)inform(msg);else mozile.alert(msg);}
+if(mozile.debug.isSelected("log",level)){mozile.debug.log(caller,level,message);}}
+mozile.debug.debug=function(caller,message){var level="debug";var msg="Mozile Debugging ["+caller+"] "+message;if(mozile.debug.isSelected("alert",level)){if(window.debug)debug(msg);else mozile.alert(msg);}
+if(mozile.debug.isSelected("log",level)){mozile.debug.log(caller,level,message);}}
+mozile.debug.log=function(caller,level,message){var date=new Date();var msg={caller:caller,level:level,message:message,date:date.toLocaleString(),toString:function(){return this.level.toUpperCase()+" ("+this.date+") ["+this.caller+"] "+this.message;}};mozile.debug.messages.push(msg);if(mozile.debug.window&&mozile.debug.window.document){mozile.debug.window.document.write(msg+"<br/>\n");mozile.debug.window.scroll(0,document.body.clientHeight);}}
+mozile.debug.show=function(){if(!mozile.debug.window||!mozile.debug.window.document){mozile.debug.window=window.open("","MozileDebugging","");mozile.debug.window.document.write("<h3>Mozile Debugging Messages</h3>");mozile.debug.window.document.write(mozile.debug.messages.join("<br/>\n")+"<br/>\n");}
+else mozile.debug.window=window.open("","MozileDebugging","");}
+mozile.alert=function(message){alert(message);}
+mozile.dumpError=function(object){if(typeof(object)=="string")return object;if(!mozile.browser.isIE)return object.toString();var fields;if(object&&object.description){fields=["Name: "+object.name,"Number: "+object.number,"Message: "+object.message,"Description: "+object.description,];return fields.join("\n");}
+if(!object)object=document;if(!object.parseError)object=document;if(!object.parseError)object=window;if(!object.parseError)return"[No error to parse]";fields=["Error Code: "+object.parseError.errorCode,"File Position: "+object.parseError.filepos,"Line: "+object.parseError.line,"Line Position: "+object.parseError.linepos,"Reason: "+object.parseError.reason,"Source Text: "+object.parseError.srcText,"Url: "+object.parseError.url];return fields.join("\n");}
+mozile.editElement=function(elementOrId){var element;if(typeof(elementOrId)=="string"){if(document.documentElement.nodeName.toLowerCase()=="html"){element=document.getElementById(elementOrId);}
+else{mozile.require("mozile.dom");var results=mozile.dom.getElements("id",elementOrId,null,true);if(results.length)element=results[0];else return false;}}
+else if(elementOrId.nodeType&&elementOrId.nodeType==mozile.dom.ELEMENT_NODE){element=elementOrId;}
+if(element)return mozile._markEditable(element,true);return false;}
+mozile.editElements=function(listOrValue,name){var list;if(typeof(listOrValue)=="string"){mozile.require("mozile.dom");list=mozile.dom.getElements(name,listOrValue);}
+else if(listOrValue.length){list=listOrValue;}
+if(list.length){for(var i=0;i<list.length;i++){if(list[i]&&list[i].nodeType&&list[i].nodeType==mozile.dom.ELEMENT_NODE){mozile.editElement(list[i]);}}}
+return undefined;}
+mozile.editDocument=function(doc){if(!doc)doc=document;mozile.editElement(doc.documentElement);}
+mozile.protectElement=function(elementOrId){var element;if(typeof(elementOrId)=="string"){if(document.documentElement.nodeName.toLowerCase()=="html"){element=document.getElementById(elementOrId);}
+else{mozile.require("mozile.dom");var results=mozile.dom.getElements("id",elementOrId,null,true);if(results.length)element=results[0];else return false;}}
+else if(elementOrId.nodeType&&elementOrId.nodeType==mozile.dom.ELEMENT_NODE){element=elementOrId;}
+if(element)return mozile._markEditable(element,false);return false;}
+mozile.protectElements=function(listOrValue,name){var list;if(typeof(listOrValue)=="string"){mozile.require("mozile.dom");list=mozile.dom.getElements(name,listOrValue);}
+else if(listOrValue.length){list=listOrValue;}
+if(list.length){for(var i=0;i<list.length;i++){if(list[i]&&list[i].nodeType&&list[i].nodeType==mozile.dom.ELEMENT_NODE){mozile.protectElement(list[i]);}}}
+return undefined;}
+mozile._markEditable=function(element,value){if(!element)return null;mozile.require("mozile.edit");if(value===true&&mozile.edit.setMark(element,"editable")===false&&mozile.edit.getContainer(element.parentNode)){mozile.edit.setMark(element,"editable",undefined);if(mozile.edit.getMark(element,"contentEditable")==undefined){element.removeAttribute("contentEditable");}
+return value;}
+mozile.edit.setMark(element,"editable",value);if(mozile.edit.getMark(element,"contentEditable")==undefined){switch(element.getAttribute("contentEditable")){case"true":mozile.edit.setMark(element,"contentEditable",true);break;case"false":mozile.edit.setMark(element,"contentEditable",false);break;}}
+element.setAttribute("contentEditable",String(value));return value;}
+mozile.enableEditing=function(rich){mozile.require("mozile.edit");mozile.edit.defaults.addCommand(mozile.edit.navigateLeftRight);mozile.edit.defaults.addCommand(mozile.edit.insertText);mozile.edit.defaults.addCommand(mozile.edit.removeText);if(rich){mozile.require("mozile.edit.rich");mozile.edit.defaults.addCommand(mozile.edit.remove);var splitBlocks=new mozile.edit.Split("splitBlocks");splitBlocks.accel="Return Enter";mozile.edit.defaults.addCommand(splitBlocks);}}
+mozile.useSchema=function(target){try{mozile.require("mozile.rng");mozile.require("mozile.edit");mozile.require("mozile.edit.rich");mozile.edit.extendRNG();mozile.schema=new mozile.rng.Schema();var validation=mozile.schema.parse(target);if(validation.isValid){mozile.edit.generateCommands(mozile.schema);return true;}
+else{mozile.debug.inform("mozile.useSchema","Schema validation failed.\n"+validation.report(true));return false;}}catch(e){mozile.debug.inform("mozile.useSchema","Could not create schema for target '"+target+"' because of an error:\n"+mozile.dumpError(e));return false;}}
+mozile.os=new Object();mozile.os.prototype=new mozile.Module;mozile.os.isMac=false;if(navigator.userAgent.match(/Macintosh/))mozile.os.isMac=true;mozile.browser=new Object();mozile.browser.prototype=new mozile.Module;mozile.browser.isMozilla=false;mozile.browser.mozillaVersion=0;mozile.browser.mozillaVersion=navigator.userAgent.match(/rv\:(\d+\.\d+)/);if(mozile.browser.mozillaVersion&&Number(mozile.browser.mozillaVersion[1])){mozile.browser.isMozilla=true;mozile.browser.mozillaVersion=Number(mozile.browser.mozillaVersion[1]);}
+mozile.browser.isIE=false;if(navigator.userAgent.match(/MSIE/))mozile.browser.isIE=true;mozile.browser.isSafari=false;if(navigator.userAgent.match(/Safari/))mozile.browser.isSafari=true;mozile.browser.safariVersion=0;mozile.browser.safariVersion=navigator.userAgent.match(/AppleWebKit\/(\d+)/);if(mozile.browser.safariVersion&&Number(mozile.browser.safariVersion[1])){mozile.browser.safariVersion=Number(mozile.browser.safariVersion[1]);}
+mozile.browser.isOpera=false;if(navigator.userAgent.match(/Opera/))mozile.browser.isOpera=true;if(mozile.browser.isMozilla){if(document.contentType&&document.contentType=="text/html"){mozile.defaultNS=null;}
+else{mozile.defaultNS="http://www.w3.org/1999/xhtml";}}
+mozile.dom=new Object();mozile.dom.prototype=new mozile.Module;mozile.dom.ELEMENT_NODE=1;mozile.dom.ATTRIBUTE_NODE=2;mozile.dom.TEXT_NODE=3;mozile.dom.CDATA_SECTION_NODE=4;mozile.dom.ENTITY_REFERENCE_NODE=5;mozile.dom.ENTITY_NODE=6;mozile.dom.PROCESSING_INSTRUCTION_NODE=7;mozile.dom.COMMENT_NODE=8;mozile.dom.DOCUMENT_NODE=9;mozile.dom.DOCUMENT_TYPE_NODE=10;mozile.dom.DOCUMENT_FRAGMENT_NODE=11;mozile.dom.NOTATION_NODE=12;mozile.dom.links=new Array();mozile.dom.getBody=function(node){var doc=document;if(node)doc=node.ownerDocument;var elements=doc.getElementsByTagName("body");if(elements&&elements[0])return elements[0];else return doc.documentElement;}
+mozile.dom.getHead=function(node){var doc=document;if(node)doc=node.ownerDocument;var elements=doc.getElementsByTagName("head");if(elements&&elements[0])return elements[0];else return doc.documentElement;}
+mozile.dom.getFirstChildElement=function(parent){for(var i=0;i<parent.childNodes.length;i++){if(parent.childNodes[i].nodeType==mozile.dom.ELEMENT_NODE)
+return parent.childNodes[i];}
+return null;}
+mozile.dom.getChildElements=function(parent){var children=new Array();for(var i=0;i<parent.childNodes.length;i++){if(parent.childNodes[i].nodeType==mozile.dom.ELEMENT_NODE)
+children.push(parent.childNodes[i]);}
+return children;}
+mozile.dom.getNextSiblingElement=function(node){var sibling=node.nextSibling;while(sibling){if(sibling.nodeType==mozile.dom.ELEMENT_NODE)return sibling;sibling=sibling.nextSibling;}
+return null;}
+mozile.dom.getElements=function(attr,value,root,single){var list=new Array();if(!attr)attr="class";if(!root)root=document.documentElement;if(document.createTreeWalker){var treeWalker=document.createTreeWalker(root,mozile.dom.NodeFilter.SHOW_ELEMENT,null,false);var node=treeWalker.currentNode;while(node){if(attr=="class"&&mozile.dom.hasClass(node,value))
+list.push(node);else if(attr!="local name"&&node.getAttribute(attr)){if(!value)list.push(node);else if(node.getAttribute(attr)==value)list.push(node);}
+else if(attr=="local name"&&mozile.dom&&mozile.dom.getLocalName(node).toLowerCase()==value){list.push(node);}
+if(single&&list.length>0)break;node=treeWalker.nextNode();}}
+return list;}
+mozile.dom.getText=function(node){if(!node)return"";if(node.nodeType==mozile.dom.TEXT_NODE&&!mozile.dom.isWhitespace(node)){return node.data;}
+else if(node.nodeType==mozile.dom.ATTRIBUTE_NODE){return node.nodeValue;}
+else if(node.nodeType==mozile.dom.ELEMENT_NODE){var text="";for(var i=0;i<node.childNodes.length;i++){text+=mozile.dom.getText(node.childNodes[i]);}
+return text;}
+return"";}
+mozile.dom.insertAfter=function(newNode,refNode){if(!newNode)throw("Error [mozile.dom.insertAfter]: No newNode. newNode: "+newNode+" refNode: "+refNode);if(!refNode)throw("Error [mozile.dom.insertAfter]: No refNode. newNode: "+newNode+" refNode: "+refNode);var parentNode=refNode.parentNode;if(!parentNode)return null;if(refNode.nextSibling)return parentNode.insertBefore(newNode,refNode.nextSibling);else return parentNode.appendChild(newNode);}
+mozile.dom.prependChild=function(newNode,parentNode){if(parentNode.firstChild)return parentNode.insertBefore(newNode,parentNode.firstChild);else return parentNode.appendChild(newNode);}
+mozile.dom.isAncestorOf=function(ancestorNode,descendantNode,limitNode){var checkNode=descendantNode;while(checkNode){if(checkNode==ancestorNode)return true;else if(checkNode==limitNode)return false;else checkNode=checkNode.parentNode;}
+return false;}
+mozile.dom.getCommonAncestor=function(firstNode,secondNode){var ancestor=firstNode;while(ancestor){if(mozile.dom.isAncestorOf(ancestor,secondNode))return ancestor;else ancestor=ancestor.parentNode;}
+return null;}
+mozile.dom._matchNonWhitespace=/\S/m;mozile.dom.isWhitespace=function(node){if(!node||!node.nodeValue)return false;if(node.nodeValue.match(mozile.dom._matchNonWhitespace))return false;return true;}
+mozile.dom.isVisible=function(node){var visibility;while(node){if(node==document)return true;if(node.nodeType==mozile.dom.ELEMENT_NODE){if(mozile.dom.getStyle(node,"display")=="none")return false;visibility=mozile.dom.getStyle(node,"visibility");if(visibility=="hidden"||visibility=="collapse")return false;}
+node=node.parentNode;}
+return false;}
+mozile.dom.isHTML=function(node){if(!node)node=document;var doc=node;if(node.ownerDocument)doc=node.ownerDocument;if(!doc.documentElement)return false;var name=doc.documentElement.nodeName;if(doc.documentElement.nodeName)name=doc.documentElement.nodeName;if(name.toLowerCase()=="html")return true;else return false;}
+mozile.dom.isIgnored=function(node){if(node.nodeType==mozile.dom.ATTRIBUTE_NODE){if(node.nodeName.indexOf("xmlns")==0)return true;if(mozile.browser.isOpera&&node.nodeName.toLowerCase()=="shape")return true;}
+return false;}
+mozile.dom.getLocalName=function(node){if(!node)return null;if(node.localName)return node.localName;else if(node.nodeName&&node.nodeName.indexOf(":")>-1)
+return node.nodeName.substring(node.nodeName.indexOf(":")+1);else return node.nodeName;}
+mozile.dom.getPrefix=function(node){if(!node)return null;if(node.prefix)return node.prefix;else if(node.nodeName.indexOf(":")>-1)
+return node.nodeName.substring(0,node.nodeName.indexOf(":"));else return null;}
+mozile.dom.getIndex=function(node){if(!node.parentNode)return null;for(var c=0;c<node.parentNode.childNodes.length;c++){if(node.parentNode.childNodes[c]==node)return c;}
+return c;}
+mozile.dom.getPosition=function(node){if(!node.parentNode)return null;var s=1;for(var c=0;c<node.parentNode.childNodes.length;c++){if(node.parentNode.childNodes[c]==node)break;else if(node.nodeType==mozile.dom.ELEMENT_NODE){if(node.parentNode.childNodes[c].nodeName==node.nodeName)s++;}
+else if(node.parentNode.childNodes[c].nodeType==node.nodeType)s++;}
+return s;}
+mozile.dom.removeChildNodes=function(node){if(node.childNodes.length==0)return;while(node.firstChild){node.removeChild(node.firstChild);}}
+mozile.dom.getNamespaceURI=function(node){if(!node)return null;if(node.namespaceURI)return node.namespaceURI;else if(node.nodeName.indexOf(":")>-1){var prefix=node.nodeName.substring(0,node.nodeName.indexOf(":"));return mozile.dom.lookupNamespaceURI(node,prefix);}
+return mozile.dom.getDefaultNamespaceURI(node);}
+mozile.dom.getDefaultNamespaceURI=function(node){var namespaceURI=null;while(node){if(node.nodeType==mozile.dom.ELEMENT_NODE&&node.getAttribute("xmlns"))
+return node.getAttribute("xmlns");node=node.parentNode;}
+return namespaceURI;}
+mozile.dom.lookupNamespaceURI=function(node,prefix){if(!prefix)prefix=mozile.dom.getPrefix(node);var attr="xmlns";if(prefix&&node.lookupNamespaceURI){while(node){var ns=node.lookupNamespaceURI(prefix);if(ns)return ns;else node=node.parentNode;}
+return null;}
+if(prefix&&mozile.browser.isSafari){while(node&&node.getAttributeNS){if(node.getAttributeNS(attr,prefix))return node.getAttributeNS(attr,prefix);else node=node.parentNode;}
+return null;}
+if(prefix)attr="xmlns:"+prefix;while(node){if(node.getAttribute(attr))return node.getAttribute(attr);else node=node.parentNode;}
+return null;}
+mozile.dom.lookupPrefix=function(node,namespaceURI){if(!namespaceURI)namespaceURI=node.namespaceURI;if(!namespaceURI)return null;while(node&&node.attributes){for(var i=0;i<node.attributes.length;i++){if(node.attributes[i].nodeName.indexOf("xmlns:")==0&&node.attributes[i].nodeValue==namespaceURI){return node.attributes[i].nodeName.substring(6);}}
+node=node.parentNode;}
+return null;}
+mozile.dom.convertStyleName=function(styleName){if(!styleName||typeof(styleName)!="string")return null;return styleName.replace(/\-(\w)/g,function(strMatch,p1){return p1.toUpperCase();});}
+mozile.dom.getStyle=function(node,cssRule){var value="";if(!node)return value;if(node.nodeType!=mozile.dom.ELEMENT_NODE)node=node.parentNode;if(!node||node.nodeType!=mozile.dom.ELEMENT_NODE)return value;if(document.defaultView&&document.defaultView.getComputedStyle){value=document.defaultView.getComputedStyle(node,"").getPropertyValue(cssRule);}
+else if(node.currentStyle){cssRule=mozile.dom.convertStyleName(cssRule);value=node.currentStyle[cssRule];}
+return value;}
+mozile.dom.setStyle=function(element,rule,value){if(!element)return;if(!rule||typeof(rule)!="string")return;rule=mozile.dom.convertStyleName(rule);if(element.style)element.style[rule]=value;else mozile.debug.debug("mozile.dom.setStyle","Element does not have a 'style' attribute.");}
+mozile.dom.addStyleSheet=function(href,type){var link;if(mozile.defaultNS!=null){mozile.require("mozile.xml");link=mozile.dom.createElementNS(mozile.xml.ns.xhtml,"link");}
+else link=mozile.dom.createElement("link");link.setAttribute("class","mozileLink");link.setAttribute("href",href);link.setAttribute("rel","stylesheet");if(!type)type="text/css";link.setAttribute("type",type);mozile.dom.getHead().appendChild(link);mozile.dom.links.push(link);return link;}
+mozile.dom.getStyleSheet=function(element){if(!element)return null;if(element.styleSheet!=undefined)return element.styleSheet;else if(element.sheet!=undefined)return element.sheet;return null;}
+mozile.dom.getClass=function(element){if(!element||element.nodeType!=mozile.dom.ELEMENT_NODE)return"";var value;if(element.className!=undefined)value=element.className;else value=element.getAttribute("class");if(value)return value;else return"";}
+mozile.dom.setClass=function(element,value){if(!element||element.nodeType!=mozile.dom.ELEMENT_NODE)return null;if(!value||typeof(value)!="string")return null;if(element.className!=undefined)element.className=value;else element.setAttribute("class",value);return value;}
+mozile.dom.hasClass=function(element,className){if(!element)return false;var attr=mozile.dom.getClass(element);if(!attr)return false;if(!className)return true;attr=attr.split(/\s+/);for(var i=0;i<attr.length;i++){if(attr[i]==className)return true;}
+return false;}
+mozile.dom.getX=function(node,container){if(!node)return 0;if(node.nodeType!=mozile.dom.ELEMENT_NODE)node=node.parentNode;if(!node)return 0;var x=0;if(node.offsetParent){while(node.offsetParent){x+=node.offsetLeft;node=node.offsetParent;if(node==container)break;}}
+else if(node.x)x+=node.x;return x;}
+mozile.dom.getY=function(node,container){if(!node)return 0;if(node.nodeType!=mozile.dom.ELEMENT_NODE)node=node.parentNode;if(!node)return 0;var y=0;if(node.offsetParent){while(node.offsetParent){y+=node.offsetTop;node=node.offsetParent;if(node==container)break;}}
+else if(node.y)y+=node.y;return y;}
+mozile.dom.getAttributeNS=function(element,namespaceURI,name){if(!element)return null;if(element.getAttributeNS)return element.getAttributeNS(namespaceURI,name);else{prefix=mozile.dom.lookupPrefix(element,namespaceURI);if(prefix)return element.getAttribute(prefix+":"+name);}
+return null;}
+mozile.dom.createElement=function(name){if(mozile.defaultNS){return mozile.dom.createElementNS(mozile.defaultNS,name);}else{return document.createElement(name);}}
+mozile.dom.createElementNS=function(namespaceURI,name){if(document.createElementNS&&!mozile.browser.isSafari)return document.createElementNS(namespaceURI,name);else{mozile.require("mozile.xml");return mozile.xml.parseElement('<'+name+' xmlns="'+namespaceURI+'"/>');}
+return null;}
+mozile.dom.importNode=function(node,deep){if(!node||!node.nodeType)return null;var clone;var i=0;switch(node.nodeType){case mozile.dom.ELEMENT_NODE:clone=mozile.dom.createElement(node.nodeName);for(i=node.attributes.length-1;i>=0;i--){clone.setAttribute(node.attributes[i].nodeName,node.attributes[i].nodeValue);}
+break;case mozile.dom.TEXT_NODE:clone=document.createTextNode(node.data);break;case mozile.dom.COMMENT_NODE:clone=document.createComment(node.data);break;default:return null;}
+if(deep){var child;for(i=0;i<node.childNodes.length;i++){child=mozile.dom.importNode(node.childNodes[i],true);if(child)clone.appendChild(child);}}
+return clone;}
+mozile.dom.Range=function(selectRange){var range;if(document.createRange){if(selectRange)range=selectRange.cloneRange();else range=document.createRange();for(var field in mozile.dom.Range.prototype)
+range[field]=mozile.dom.Range.prototype[field];return range;}else{if(selectRange&&selectRange._range){range=new mozile.dom.InternetExplorerRange(selectRange._range.duplicate());range._init();return range;}
+else return new mozile.dom.InternetExplorerRange();}}
+mozile.dom.Range.prototype.store=function(){var state=new Object();if(false&&this._range){state.format="IE";state.bookmark=this._range.getBookmark();}
+else{mozile.require("mozile.xpath");state.type="Range";state.format="W3C";state.startContainer=mozile.xpath.getXPath(this.startContainer);state.startOffset=this.startOffset;if(this.startContainer==this.endContainer)
+state.endContainer=state.startContainer;else state.endContainer=mozile.xpath.getXPath(this.endContainer);state.endContainer=mozile.xpath.getXPath(this.endContainer);state.endOffset=this.endOffset;}
+return state;}
+mozile.dom.Range.prototype.restore=function(state){try{if(false&&this._range){this._range.moveToBookmark(state.bookmark);this._init();}
+else{mozile.require("mozile.xpath");var startContainer,endContainer;startContainer=mozile.xpath.getNode(state.startContainer);this.setStart(startContainer,state.startOffset);if(state.endContainer==state.startContainer)
+endContainer=startContainer;else endContainer=mozile.xpath.getNode(state.endContainer);this.setEnd(endContainer,state.endOffset);}}catch(e){alert("Error [mozile.dom.Range.restore]:\n"+mozile.dumpError(e))}}
+mozile.dom.selection=new Object();mozile.dom.selection.prototype=new mozile.Module;mozile.dom.selection.xPadding=50;mozile.dom.selection.yPadding=100;mozile.dom.selection.get=function(){if(!mozile.dom._selection)mozile.dom._selection=new mozile.dom.Selection();else if(mozile.browser.isIE)mozile.dom._selection._init();return mozile.dom._selection;}
+mozile.dom.Selection=function(){if(window.getSelection){var selection=window.getSelection();for(var field in mozile.dom.Selection.prototype)
+selection[field]=mozile.dom.Selection.prototype[field];return selection;}else{return new mozile.dom.InternetExplorerSelection();}}
+mozile.dom.Selection.prototype.store=function(oldState,newOffset){var state=new Object();if(oldState){for(var i in oldState)state[i]=oldState[i];state.anchorOffset=newOffset;state.focusOffset=newOffset;return state;}
+else if(this.rangeCount>0){mozile.require("mozile.xpath");state.type="Selection";state.format="W3C";state.anchorNode=mozile.xpath.getXPath(this.anchorNode);state.anchorOffset=this.anchorOffset;if(this.focusNode==this.anchorNode)state.focusNode=state.anchorNode;else state.focusNode=mozile.xpath.getXPath(this.focusNode);state.focusOffset=this.focusOffset;state.isCollapsed=this.isCollapsed;return state;}
+return null;}
+mozile.dom.Selection.prototype.restore=function(state){if(state){if(state.type=="Selection"){mozile.require("mozile.xpath");var anchorNode,focusNode;anchorNode=mozile.xpath.getNode(state.anchorNode);this.collapse(anchorNode,state.anchorOffset);if(state.focusNode!=state.anchorNode||state.focusOffset!=state.anchorOffset){if(state.focusNode==state.anchorNode)focusNode=anchorNode;else focusNode=mozile.xpath.getNode(state.focusNode);try{this.extend(focusNode,state.focusOffset);}catch(e){mozile.debug.debug("mozile.dom.Selection.restore","Error extending selection to '"+state.focusNode+" "+state.focusOffset+"'.\n"+mozile.dumpError(e));}}}
+else if(state.type=="Range"){var range=new mozile.dom.Range();range.restore(state);this.removeAllRanges();this.addRange(range);}}
+else if(mozile.dom.selection.last){this.collapse(mozile.dom.selection.last.anchorNode,mozile.dom.selection.last.anchorOffset);if(!mozile.dom.selection.last.isCollapsed){this.extend(mozile.dom.selection.last.focusNode,mozile.dom.selection.last.focusOffset);}}}
+mozile.dom.Selection.prototype.scroll=function(){if(!this.focusNode);var x=mozile.dom.getX(this.focusNode);var y=mozile.dom.getY(this.focusNode);var pX=window.pageXOffset;var pY=window.pageYOffset;if(x<pX||x>(pX+window.innerWidth)||y<pY||y>(pY+window.innerHeight)){window.scroll(x-mozile.dom.selection.xPadding,y-mozile.dom.selection.yPadding);}}
+mozile.dom.Selection.getSelection=function(){if(window.getSelection){return window.getSelection();}else if(document.getSelection){return document.getSelection();}else if(document.selection){return new mozile.dom.Selection();}
+return null;}
+if(mozile.browser.isIE){mozile.require("mozile.dom.TreeWalker");mozile.require("mozile.dom.InternetExplorerRange");mozile.require("mozile.dom.InternetExplorerSelection");}
+else{mozile.dom.NodeFilter=NodeFilter;mozile.dom.TreeWalker=TreeWalker;}
+mozile.xml=new Object();mozile.xml.prototype=new mozile.Module;mozile.xml.ns={AdobeExtensions:"http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/",atom:"http://www.w3.org/2005/Atom",cml:"http://www.xml-cml.org",dc:"http://purl.org/dc/elements/1.1/",dcq:"http://purl.org/dc/qualifiers/1.0",dt:"http://www.w3.org/2001/XMLSchema-datatypes",fo:"http://www.w3.org/1999/XSL/Format",mes:"http://mozile.mozdev.org/ns/mes/1.0",mml:"http://www.w3.org/1998/Math/MathML",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rng:"http://relaxng.org/ns/structure/1.0",saxon:"http://icl.com/saxon","soap-env":"http://schemas.xmlsoap.org/soap/envelope/",smil:"http://www.w3.org/2001/SMIL20/",svg:"http://www.w3.org/2000/svg",wsdl:"http://schemas.xmlsoap.org/wsdl/",xalan:"http://xml.apache.org/xslt",xbl:"http://www.mozilla.org/xbl",xforms:"http://www.w3.org/2002/01/xforms",xhtml:"http://www.w3.org/1999/xhtml",xi:"http://www.w3.org/2001/XInclude",xlink:"http://www.w3.or
 g/1999/xlink",xsd:"http://www.w3.org/2001/XMLSchema",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsl:"http://www.w3.org/1999/XSL/Transform",xslt:"http://www.w3.org/1999/XSL/Transform",xul:"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"};mozile.xml._IE_DOM=null;mozile.xml._IE_THREADEDDOM=null;mozile.xml._IE_XSLTEMPLATE=null;mozile.xml._IE_XMLWRITER=null;mozile.xml.lookupPrefix=function(namespaceURI){for(var prefix in mozile.xml.ns){if(mozile.xml.ns[prefix]==namespaceURI)return prefix;}
+return null;}
+mozile.xml.load=function(filepath){if(typeof(filepath)!="string")return null;var uri;if(filepath.indexOf(":")>0)uri=filepath;else{var loc=location.toString();loc=loc.substring(0,loc.lastIndexOf("?"));loc=loc.substring(0,loc.lastIndexOf("/")+1);uri=loc+filepath;}
+if(mozile.browser.isSafari)uri=uri.replace("file://","file:///");try{var XHR=new XMLHttpRequest();XHR.overrideMimeType("text/xml");XHR.open("GET",uri,false);try{XHR.send(null);return XHR.responseXML;}catch(e){mozile.debug.inform("mozile.xml.load","Error loading document: "+e);return null;}}
+catch(e){try{mozile.xml._getDomProgID();var xmlDoc=new ActiveXObject(mozile.xml._IE_DOM);xmlDoc.async=false;try{var loaded=xmlDoc.load(uri);if(loaded)return xmlDoc;else{mozile.debug.inform("mozile.xml.load","Failed to load document.");}}catch(e){mozile.debug.inform("mozile.xml.load","Error loading document: "+mozile.dumpError(e));}}
+catch(e){mozile.debug.inform("mozile.xml.load","No XML loading technique avaliable in this browser.");}}
+return null;}
+mozile.xml.parse=function(string){if(window.ActiveXObject){mozile.xml._getDomProgID();var xmlDoc=new ActiveXObject(mozile.xml._IE_DOM);xmlDoc.async="false";xmlDoc.loadXML(string);return xmlDoc;}
+else if(window.DOMParser){var parser=new DOMParser();return parser.parseFromString(string,"text/xml");}
+else{mozile.debug.inform("mozile.xml.serialize","No XML parsing technique avaliable in this browser.");return null;}}
+mozile.xml.parseElement=function(string){var doc=mozile.xml.parse(string);if(doc&&doc.documentElement)return doc.documentElement;else return null;}
+mozile.xml.serialize=function(node){if(!node)return null;if(node.xml)return node.xml;else if(window.XMLSerializer){var serializer=new XMLSerializer()
+return serializer.serializeToString(node);}
+else if(node.outerHTML)return node.outerHTML;else if(node.innerHTML){var container=document.createElement("container");container.appendChild(node.cloneNode(true));return container.innerHTML;}
+else{mozile.debug.inform("mozile.xml.serialize","No XML serialization technique avaliable in this browser.");return null;}}
+mozile.xml.transformToDocument=function(target,stylesheet,parameters){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;if(window.ActiveXObject){var method=mozile.xml._getMethod(stylesheet);var result=mozile.xml._IETransform(target,stylesheet,parameters);if(method=="text")result="<result>"+result+"</result>";return mozile.xml.parse(result);}
+if(window.XSLTProcessor!=undefined){var processor=new XSLTProcessor();processor.importStylesheet(stylesheet);mozile.xml._setParameters(processor,parameters);return processor.transformToDocument(target);}
+else{mozile.debug.inform("mozile.xml.transformToDocument","No XSLT technique avaliable in this browser.");return null;}}
+mozile.xml.transformToFragment=function(target,stylesheet,parameters,ownerDoc){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;if(!ownerDoc)ownerDoc=document;if(window.ActiveXObject){var method=mozile.xml._getMethod(stylesheet);var result=mozile.xml._IETransform(target,stylesheet,parameters);var fragment=ownerDoc.createDocumentFragment();if(method=="text")fragment.appendChild(ownerDoc.createTextNode(result));else if(method=="html"&&ownerDoc.body&&ownerDoc.body.innerHTML){var container=ownerDoc.createElement("div");container.innerHTML=result;while(container.childNodes.length)
+fragment.appendChild(container.firstChild);}
+else{fragment.appendChild(mozile.xml.parseElement(result));}
+return fragment;}
+if(window.XSLTProcessor!=undefined){var processor=new XSLTProcessor();processor.importStylesheet(stylesheet);mozile.xml._setParameters(processor,parameters);return processor.transformToFragment(target,ownerDoc);}
+else{mozile.debug.inform("mozile.xml.transformToFragment","No XSLT technique avaliable in this browser.");return null;}}
+mozile.xml.transformToString=function(target,stylesheet,parameters){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;if(window.ActiveXObject){return mozile.xml._IETransform(target,stylesheet,parameters);}
+if(window.XSLTProcessor!=undefined){var processor=new XSLTProcessor();processor.importStylesheet(stylesheet);mozile.xml._setParameters(processor,parameters);var result=processor.transformToDocument(target);var source=mozile.xml.serialize(result.documentElement);if(result.documentElement.nodeName=="transformiix:result")
+source=source.substring(78,source.length-22);return source;}
+else{mozile.debug.inform("mozile.xml.transformToString","No XSLT technique avaliable in this browser.");return null;}}
+mozile.xml._getMethod=function(stylesheet){var method="html";if(!stylesheet)return method;var result;if(window.ActiveXObject){stylesheet.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");result=stylesheet.selectSingleNode("//xsl:output");}
+else if(window.XSLTProcessor!=undefined){mozile.require("mozile.xpath");var results=mozile.xpath.evaluate("//xsl:output",stylesheet);if(results[0])result=results[0];}
+else return method;if(result)method=result.getAttribute("method");return method;}
+mozile.xml._setParameters=function(processor,parameters){if(!processor)return;if(!parameters)return;var param;for(var i=0;i<parameters.length;i++){param=parameters[i];if(!param.name||!param.value)continue;if(processor.setParameter){processor.setParameter(param.namespace,param.name,param.value);}
+else{if(param.namespace)
+processor.addParameter(param.name,param.value,param.namespace);else processor.addParameter(param.name,param.value);}}}
+mozile.xml._nodeToDocument=function(node){if(target.nodeType==mozile.dom.DOCUMENT_NODE)return node;var doc;if(window.ActiveXObject){var source=mozile.xml.serialize(node);return mozile.xml.parse(source);}
+else if(document.implementation){doc=document.implementation.createDocument("","",null);var clone=doc.importNode(target,true);doc.appendChild(clone);return doc;}
+else return null;}
+mozile.xml._IETransform=function(target,stylesheet,parameters){if(!target)return null;if(!stylesheet||stylesheet.nodeType!=9)return null;var method,processor,result;try{mozile.xml._getDomProgID();mozile.xml._getXMLProgIDs();var newStyle=new ActiveXObject(mozile.xml._IE_THREADEDDOM);newStyle.loadXML(stylesheet.xml);var xslt=new ActiveXObject(mozile.xml._IE_XSLTEMPLATE);xslt.stylesheet=newStyle;processor=xslt.createProcessor();processor.input=target;mozile.xml._setParameters(processor,parameters);processor.transform();return processor.output;}catch(e){return"XSLT ERROR "+mozile.dumpError(e);}}
+mozile.xml._pickRecentProgID=function(idList){var bFound=false;for(var i=0;i<idList.length&&!bFound;i++){try{var oDoc=new ActiveXObject(idList[i]);o2Store=idList[i];bFound=true;}catch(objException){};};if(!bFound){throw"Could not retreive a valid progID of Class: "+idList[idList.length-1]+". (original exception: "+e+")";};idList=null;return o2Store;}
+mozile.xml._getDomProgID=function(){if(!mozile.xml._IE_DOM){mozile.xml._IE_DOM=mozile.xml._pickRecentProgID(["Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]);}}
+mozile.xml._getXMLProgIDs=function(){if(!mozile.xml._IE_XSLTEMPLATE){mozile.xml._IE_XSLTEMPLATE=mozile.xml._pickRecentProgID(["Msxml2.XSLTemplate.5.0","Msxml2.XSLTemplate.4.0","MSXML2.XSLTemplate.3.0"]);mozile.xml._IE_THREADEDDOM=mozile.xml._pickRecentProgID(["Msxml2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.4.0","MSXML2.FreeThreadedDOMDocument.3.0"]);mozile.xml._IE_XMLWRITER=mozile.xml._pickRecentProgID(["Msxml2.MXXMLWriter.5.0","Msxml2.MXXMLWriter.4.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"]);}}
+mozile.xpath=new Object();mozile.xpath.prototype=new mozile.Module;mozile.xpath.getXPath=function(node,root){if(!node||node.nodeType==undefined||!node.nodeType)return"";if(node==root)return"";var parent=node.parentNode;switch(node.nodeType){case mozile.dom.ELEMENT_NODE:var nodeName;if(node.prefix)nodeName=node.nodeName;else nodeName=node.nodeName;if(!nodeName)nodeName=node.nodeName;if(mozile.dom.isHTML(node))nodeName=nodeName.toLowerCase();if(node.ownerDocument&&node.ownerDocument.documentElement==node)
+return"/"+nodeName+"[1]";else return mozile.xpath.getXPath(parent,root)
++"/"+nodeName+"["+mozile.dom.getPosition(node)+"]";case mozile.dom.ATTRIBUTE_NODE:if(!parent)parent=node.ownerElement;return mozile.xpath.getXPath(parent,root)+"/@"+node.nodeName;case mozile.dom.TEXT_NODE:if(node==this._lastNode&&root==this._lastRoot)
+return this._lastXPath;var xpath=mozile.xpath.getXPath(parent,root)
++"/text()["+mozile.dom.getPosition(node)+"]";this._lastNode=node;this._lastRoot=root;this._lastXPath=xpath;return xpath;case mozile.dom.COMMENT_NODE:return mozile.xpath.getXPath(parent,root)
++"/comment()["+mozile.dom.getPosition(node)+"]";default:if(parent)return mozile.xpath.getXPath(parent,root);else return"";}}
+mozile.xpath.getComponents=function(expression){if(typeof(expression)!="string")return[];var components=expression.split("/");for(var c=0;c<components.length;c++){if(!components[c])components.splice(c,1);}
+return components;}
+mozile.xpath.getComponent=function(expression){var result=new Object();var components=mozile.xpath.getComponents(expression);if(components.length==0)return result;var component=components[components.length-1];var match=component.match(/(\S+:)?(\S+)\[(\d+)\]|(\S+:)?(\S+)/);if(match){if(match[1]&&match[2]){result.name=match[1]+match[2];result.localName=match[2];}
+else if(match[2]){result.name=match[2];result.localName=match[2];}
+else if(match[4]&&match[5]){result.name=match[4]+match[5];result.localName=match[5];}
+else if(match[5]){result.name=match[5];result.localName=match[5];}
+if(match[3])result.position=match[3];else result.position=null;}
+return result;}
+mozile.xpath.getNode=function(expression,root){if(!root)root=document;if(!expression)return root;if(expression==this._lastXPath&&root==this._lastRoot)return this._lastNode;var node;if(!node){var components=mozile.xpath.getComponents(expression);node=root;for(var i=0;i<components.length;i++){var component=mozile.xpath.getComponent(components[i]);node=mozile.xpath._getNthChild(node,component.name,component.position);if(!node)return null;}}
+if(node){this._lastNode=node;this._lastRoot=root;this._lastXPath=expression;return node;}
+else return null;}
+mozile.xpath._getNthChild=function(parent,name,position){var c=0;var p=1;if(parent.nodeType==mozile.dom.DOCUMENT_NODE)
+return parent.documentElement;if(name=="text()"){for(c=0;c<parent.childNodes.length;c++){if(parent.childNodes[c].nodeType==mozile.dom.TEXT_NODE){if(p==position)return parent.childNodes[c];p++;}}}
+else if(name=="comment()"){for(c=0;c<parent.childNodes.length;c++){if(parent.childNodes[c].nodeType==mozile.dom.COMMENT_NODE){if(p==position)return parent.childNodes[c];p++;}}}
+if(name.indexOf("@")==0){name=name.substring(1);return parent.getAttributeNode(name);}
+else{if(name.indexOf("xmlns:")>-1)name=name.substring(6);for(c=0;c<parent.childNodes.length;c++){var childName=parent.childNodes[c].nodeName;if(childName==name||childName==name.toUpperCase()){if(p==position)return parent.childNodes[c];p++;}}}
+return null;}
+mozile.xpath.evaluate=function(expression,root){if(!root)root=document;var doc;if(root.ownerDocument)doc=root.ownerDocument;else{doc=root;root=root.documentElement;}
+var nodes=new Array();var results,result;if(window.XPathEvaluator){var XPE=new XPathEvaluator;var NSR=function(prefix){var namespaceURI=mozile.dom.lookupNamespaceURI(root,prefix);if(namespaceURI)return namespaceURI;else if(mozile.xml.ns[prefix])return mozile.xml.ns[prefix];return mozile.defaultNS;}
+try{results=XPE.evaluate(expression,root,NSR,0,null);if(results){result=results.iterateNext();while(result){nodes.push(result);result=results.iterateNext();}}}catch(e){alert(doc.documentElement.getAttribute("xmlns")+"\n"+e);}}
+else if(root.selectNodes){results=root.selectNodes(expression);result=results.nextNode();while(result){nodes.push(result);result=results.nextNode();}}
+return nodes;}
+mozile.util=new Object();mozile.util.prototype=new mozile.Module;mozile.util.dumpKeys=function(obj){var keys=new Array();for(var key in obj)keys.push(key);keys.sort();return keys.join(", ");}
+mozile.util.dumpValues=function(obj){var result=new Array();for(var key in obj){result.push(key+" = "+obj[key]);}
+result.sort();return result.join("\n");}
+mozile.util.capitalize=function(string){if(!string)return string;return string.replace(/\w+/g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();});}
+mozile.util.pad=function(string,length,left){if(!string)string=" ";else string=String(string);if(!this._memory)this._memory=new Object();var id=string+":"+length+":"+left;if(this._memory[id])return this._memory[id];var space="";if(string.length<length){for(var s=0;s<length-string.length;s++)space+=" ";}
+var result;if(left)result=space+string;else result=string+space;this._memory[id]=result;return result;}
+mozile.util.debug=function(details,level,message){if(level>=mozile.getDebugLevel()||details["Status Message"]){var date=new Date();mozile.util.messages.push([date.toLocaleString(),details,level,message]);}
+return true;}
+mozile.util.messages=new Array();mozile.dom.NodeFilter={FILTER_ACCEPT:1,FILTER_REJECT:2,FILTER_SKIP:3,SHOW_ALL:-1,SHOW_ELEMENT:1,SHOW_ATTRIBUTE:2,SHOW_TEXT:4,SHOW_CDATA_SECTION:8,SHOW_ENTITY_REFERENCE:16,SHOW_ENTITY:32,SHOW_PROCESSING_INSTRUCTIONS:64,SHOW_COMMENT:128,SHOW_DOCUMENT:256,SHOW_DOCUMENT_TYPE:512,SHOW_DOCUMENT_FRAGMENT:1024,SHOW_NOTATION:2048}
+mozile.dom.TreeWalker=function(root,whatToShow,filter,expandEntityReferences){this.root=root;this.whatToShow=whatToShow;this.filter=filter;this.expandEntityReferences=expandEntityReferences;this.currentNode=root;}
+mozile.dom.TreeWalker.prototype.parentNode=function(){var testNode=this.currentNode;do{if(testNode!=this.root&&testNode.parentNode!=this.root&&testNode.parentNode!=null){testNode=testNode.parentNode;}
+else return null;}while(this._getFilteredStatus(testNode)!=mozile.dom.NodeFilter.FILTER_ACCEPT);if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype.firstChild=function(){var testNode=this.currentNode.firstChild;while(testNode!=null){if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}
+testNode=testNode.nextSibling;}
+if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype.lastChild=function(){var testNode=this.currentNode.lastChild;while(testNode!=null){if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}
+testNode=testNode.previousSibling;}
+if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype.nextNode=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.childNodes.length!=0)testNode=testNode.firstChild;else if(testNode.nextSibling!=null)testNode=testNode.nextSibling;else{while(testNode!=null){if(testNode.parentNode!=this.root&&testNode.parentNode!=null){if(testNode.parentNode.nextSibling!=null){testNode=testNode.parentNode.nextSibling;break;}
+else testNode=testNode.parentNode;}
+else return null;}}
+if(testNode!=null&&this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
+if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype.previousNode=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.previousSibling!=null){testNode=testNode.previousSibling;while(testNode.lastChild!=null){testNode=testNode.lastChild;}}
+else{if(testNode.parentNode!=this.root&&testNode.parentNode!=null){testNode=testNode.parentNode;}
+else testNode=null;}
+if(testNode!=null&&this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
+if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype.nextSibling=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.nextSibling!=null)testNode=testNode.nextSibling;if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
+if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype.previousSibling=function(){var testNode=this.currentNode;while(testNode!=null){if(testNode.previousSibling!=null)testNode=testNode.previousSibling;if(this._getFilteredStatus(testNode)==mozile.dom.NodeFilter.FILTER_ACCEPT){break;}}
+if(testNode!=null)this.currentNode=testNode;return testNode;}
+mozile.dom.TreeWalker.prototype._getFilteredStatus=function(node){var mask=null;switch(node.nodeType){case mozile.dom.ELEMENT_NODE:mask=mozile.dom.NodeFilter.SHOW_ELEMENT;break;case mozile.dom.ATTRIBUTE_NODE:mask=mozile.dom.NodeFilter.SHOW_ATTRIBUTE;break;case mozile.dom.TEXT_NODE:mask=mozile.dom.NodeFilter.SHOW_TEXT;break;case mozile.dom.CDATA_SECTION_NODE:mask=mozile.dom.NodeFilter.SHOW_CDATA_SECTION;break;case mozile.dom.ENTITY_REFERENCE_NODE:mask=mozile.dom.NodeFilter.SHOW_ENTITY_REFERENCE;break;case mozile.dom.ENTITY_NODE:mask=mozile.dom.NodeFilter.SHOW_PROCESSING_INSTRUCTION;break;case mozile.dom.PROCESSING_INSTRUCTION_NODE:mask=mozile.dom.NodeFilter.SHOW_PROCESSING_INSTRUCTION;break;case mozile.dom.COMMENT_NODE:mask=mozile.dom.NodeFilter.SHOW_COMMENT;break;case mozile.dom.DOCUMENT_NODE:mask=mozile.dom.NodeFilter.SHOW_DOCUMENT;break;case mozile.dom.DOCUMENT_TYPE_NODE:mask=mozile.dom.NodeFilter.SHOW_DOCUMENT_TYPE;break;case mozile.dom.DOCUMENT_FRAGMENT_NODE:mask=mozile.dom.Node
 Filter.SHOW_DOCUMENT_FRAGMENT;break;case mozile.dom.NOTATION_NODE:mask=mozile.dom.NodeFilter.SHOW_NOTATION;break;}
+if(mask!=null&&(this.whatToShow&mask)==0){return mozile.dom.NodeFilter.FILTER_REJECT;}
+if(this.filter!=null&&this.filter.acceptNode!=null){return this.filter.acceptNode(node);}
+return mozile.dom.NodeFilter.FILTER_ACCEPT;}
+if(mozile.browser.isIE){document.createTreeWalker=function(root,whatToShow,filter,expandEntityReferences){return new mozile.dom.TreeWalker(root,whatToShow,filter,expandEntityReferences);};mozile.dom.NodeFilter=mozile.dom.NodeFilter;mozile.dom.TreeWalker=mozile.dom.TreeWalker;}
+else{mozile.dom.NodeFilter=NodeFilter;mozile.dom.TreeWalker=TreeWalker;}
+mozile.dom.InternetExplorerRange=function(range){this._range=null;if(range)
+this._range=range;else{this._range=document.body.createTextRange();}
+this.collapsed=null;this.commonAncestorContainer=null;this.startContainer=null;this.startOffset=null;this.endContainer=null;this.endOffset=null;}
+mozile.dom.InternetExplorerRange.prototype._init=function(){var beginRange=this._range.duplicate();beginRange.collapse(true);var position=this._getPosition(beginRange);this.startContainer=position.node;this.startOffset=position.offset;var endRange=this._range.duplicate();endRange.collapse(false);position=this._getPosition(endRange);this.endContainer=position.node;this.endOffset=position.offset;this._commonAncestorContainer();this._collapsed();}
+mozile.dom.InternetExplorerRange.prototype._getPosition=function(textRange){var element=textRange.parentElement();var range=document.body.createTextRange();range.moveToElementText(element);range.setEndPoint("EndToStart",textRange);var rangeLength=range.text.length;if(rangeLength<element.innerText.length/2){var direction=1;var node=element.firstChild;}
+else{direction=-1;node=element.lastChild;range.moveToElementText(element);range.setEndPoint("StartToStart",textRange);rangeLength=range.text.length;}
+while(node){switch(node.nodeType){case mozile.dom.TEXT_NODE:nodeLength=node.data.length;if(nodeLength<rangeLength){var difference=rangeLength-nodeLength;if(direction==1)range.moveStart("character",difference);else range.moveEnd("character",-difference);rangeLength=difference;}
+else{if(direction==1)return{node:node,offset:rangeLength};else return{node:node,offset:nodeLength-rangeLength};}
+break;case mozile.dom.ELEMENT_NODE:nodeLength=node.innerText.length;if(direction==1)range.moveStart("character",nodeLength);else range.moveEnd("character",-nodeLength);rangeLength=rangeLength-nodeLength;break;}
+if(direction==1)node=node.nextSibling;else node=node.previousSibling;}
+return{node:element,offset:0};}
+mozile.dom.InternetExplorerRange.prototype._getOffset=function(startNode,startOffset){var node,moveCharacters;if(startNode.nodeType==mozile.dom.TEXT_NODE){moveCharacters=startOffset;node=startNode.previousSibling;}
+else if(startNode.nodeType==mozile.dom.ELEMENT_NODE){moveCharacters=0;if(startOffset>0)node=startNode.childNodes[startOffset-1];else return 0;}
+else{mozile.debug.inform("mozile.dom.InternetExplorerRange.prototype._getOffset","Bad node given: "+mozile.xpath.getXPath(startNode));return 0;}
+while(node){var nodeLength=0;if(node.nodeType==mozile.dom.ELEMENT_NODE){nodeLength=node.innerText.length;if(this._isChildless(node))nodeLength=1;if(this._isBlock(node))nodeLength++;}
+else if(node.nodeType==mozile.dom.TEXT_NODE){nodeLength=node.data.length;}
+moveCharacters+=nodeLength;node=node.previousSibling;}
+return moveCharacters;}
+mozile.dom.InternetExplorerRange.prototype._isBlock=function(node){switch(node.nodeName.toLowerCase()){case'p':case'div':case'h1':case'h2':case'h3':case'h4':case'h5':case'h6':case'pre':return true;}
+return false;}
+mozile.dom.InternetExplorerRange.prototype._isChildless=function(node){switch(node.nodeName.toLowerCase()){case'img':case'br':case'hr':return true;}
+return false;}
+mozile.dom.InternetExplorerRange.prototype.setStart=function(startNode,startOffset){var container=startNode;if(startNode.nodeType==mozile.dom.TEXT_NODE||startNode.nodeType==mozile.dom.COMMENT_NODE||startNode.nodeType==mozile.dom.CDATA_SECTION_NODE){container=container.parentNode;}
+var copyRange=this._range.duplicate();copyRange.moveToElementText(container);copyRange.collapse(true);copyRange.move('Character',this._getOffset(startNode,startOffset));this._range.setEndPoint('StartToStart',copyRange);this.startContainer=startNode;this.startOffset=startOffset;if(this.endContainer==null&&this.endOffset==null){this.endContainer=startNode;this.endOffset=startOffset;}
+this._commonAncestorContainer();this._collapsed();}
+mozile.dom.InternetExplorerRange.prototype.setEnd=function(endNode,endOffset){var copyRange=this._range.duplicate();copyRange.collapse(true);var container=endNode;if(endNode.nodeType==mozile.dom.TEXT_NODE||endNode.nodeType==mozile.dom.COMMENT_NODE||endNode.nodeType==mozile.dom.CDATA_SECTION_NODE){container=container.parentNode;}
+copyRange=this._range.duplicate();copyRange.moveToElementText(container);copyRange.collapse(true);copyRange.move('Character',this._getOffset(endNode,endOffset));this._range.setEndPoint('EndToEnd',copyRange);this.endContainer=endNode;this.endOffset=endOffset;if(this.startContainer==null&&this.startOffset==null){this.startContainer=endNode;this.startOffset=endOffset;}
+this._commonAncestorContainer();this._collapsed();}
+mozile.dom.InternetExplorerRange.prototype.setStartBefore=function(referenceNode){this.setStart(referenceNode.parentNode,mozile.dom.getIndex(referenceNode));};mozile.dom.InternetExplorerRange.prototype.setStartAfter=function(referenceNode){this.setStart(referenceNode.parentNode,mozile.dom.getIndex(referenceNode)+1);};mozile.dom.InternetExplorerRange.prototype.setEndBefore=function(referenceNode){this.setEnd(referenceNode.parentNode,mozile.dom.getIndex(referenceNode));};mozile.dom.InternetExplorerRange.prototype.setEndAfter=function(referenceNode){this.setEnd(referenceNode.parentNode,mozile.dom.getIndex(referenceNode)+1);};mozile.dom.InternetExplorerRange.prototype.selectNode=function(referenceNode){this.setStartBefore(referenceNode);this.setEndAfter(referenceNode);};mozile.dom.InternetExplorerRange.prototype.selectNodeContents=function(referenceNode){this.setStart(referenceNode,0);if(referenceNode.nodeType==mozile.dom.TEXT_NODE)
+this.setEnd(referenceNode,referenceNode.data.length);else
+this.setEnd(referenceNode,referenceNode.childNodes.length);};mozile.dom.InternetExplorerRange.prototype.collapse=function(toStart){this._range.collapse(toStart);if(toStart){this.endContainer=this.startContainer;this.endOffset=this.startOffset;}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset;}
+this._commonAncestorContainer();this._collapsed();};mozile.dom.InternetExplorerRange.prototype.cloneContents=function(){var df=document.createDocumentFragment();var container=this.commonAncestorContainer;if(container.nodeType==mozile.dom.TEXT_NODE){df.appendChild(document.createTextNode(this._range.text));return df;}
+var startNode=this.startContainer;if(this.startContainer.nodeType!=mozile.dom.TEXT_NODE)
+startNode=this.startContainer.childNodes[this.startOffset];var endNode=this.endContainer;if(this.endContainer.nodeType!=mozile.dom.TEXT_NODE)
+endNode=this.endContainer.childNodes[this.endOffset-1];if(startNode==endNode){df.appendChild(startNode.cloneNode(true));return df;}
+var current=container.firstChild;var parent=null;var clone;while(current){if(!parent){if(mozile.dom.isAncestorOf(current,startNode,container)){parent=df;}
+else{current=current.nextSibling;continue;}}
+if(current==startNode&&this.startContainer.nodeType==mozile.dom.TEXT_NODE){content=this.startContainer.data.substring(this.startOffset);parent.appendChild(document.createTextNode(content));}
+else if(current==endNode){if(this.endContainer.nodeType==mozile.dom.TEXT_NODE){content=this.endContainer.data.substring(0,this.endOffset);parent.appendChild(document.createTextNode(content));}
+else parent.appendChild(endNode.cloneNode(false));break;}
+else{clone=current.cloneNode(false);parent.appendChild(clone);}
+if(current.firstChild){parent=clone;current=current.firstChild;}
+else if(current.nextSibling){current=current.nextSibling;}
+else while(current){if(current.parentNode){parent=parent.parentNode;current=current.parentNode;if(current.nextSibling){current=current.nextSibling;break;}}
+else current=null;}}
+return df;};mozile.dom.InternetExplorerRange.prototype.deleteContents=function(){this._range.pasteHTML('');this.endContainer=this.startContainer;this.endOffset=this.startOffset;this._commonAncestorContainer();this._collapsed();};mozile.dom.InternetExplorerRange.prototype.extractContents=function(){var fragment=this.cloneContents();this.deleteContents();return fragment;};mozile.dom.InternetExplorerRange.prototype.insertNode=function(newNode){if(this.startContainer.nodeType==mozile.dom.TEXT_NODE){this.startContainer.splitText(this.startOffset);this.startContainer.parentNode.insertBefore(newNode,this.startContainer.nextSibling);this.setStart(this.startContainer,this.startOffset);return;}else{var parentNode=this.startContainer.parentNode;if(this.startContainer.childNodes.length==this.startOffset){parentNode.appendChild(newNode);}else{this.startContainer.insertBefore(newNode,this.startContainer.childNodes.item(this.startOffset));this.setStart(this.startContainer,this.startOffset+1);retur
 n;}}};mozile.dom.InternetExplorerRange.prototype.surroundContents=function(newNode){newNode.appendChild(this.extractContents());this.insertNode(newNode);};mozile.dom.InternetExplorerRange.prototype.compareBoundaryPoints=function(how,sourceRange){alert('mozile.dom.InternetExplorerRange.compareBoundaryPoints() is not implemented yet');};mozile.dom.InternetExplorerRange.prototype.cloneRange=function(){var r=new mozile.dom.InternetExplorerRange(this._range.duplicate());var properties=["startContainer","startOffset","endContainer","endOffset","commonAncestorContainer","collapsed"];for(var i=0;i<properties.length;i++){r[properties[i]]=this[properties[i]];}
+return r;};mozile.dom.InternetExplorerRange.prototype.detach=function(){};mozile.dom.InternetExplorerRange.prototype.toString=function(){return this._range.text;};mozile.dom.InternetExplorerRange.prototype._commonAncestorContainer=function(){if(this.startContainer==null||this.endContainer==null){this.commonAncestorContainer=null;return;}
+if(this.startContainer==this.endContainer){this.commonAncestorContainer=this.startContainer;}
+else{this.commonAncestorContainer=mozile.dom.getCommonAncestor(this.startContainer,this.endContainer);}}
+mozile.dom.InternetExplorerRange.prototype._collapsed=function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);}
+mozile.dom.InternetExplorerRange.prototype.store=mozile.dom.Range.prototype.store;mozile.dom.InternetExplorerRange.prototype.restore=mozile.dom.Range.prototype.restore;mozile.dom.InternetExplorerSelection=function(){this._selection=document.selection;this.anchorNode=null;this.anchorOffset=null;this.focusNode=null;this.focusOffset=null;this.isCollapsed=null;this.rangeCount=0;this._direction=this._LTR;this._init();}
+mozile.dom.InternetExplorerSelection.prototype._LTR=1;mozile.dom.InternetExplorerSelection.prototype._RTL=-1;mozile.dom.InternetExplorerSelection.prototype._init=function(range){if(!range)range=this.getRangeAt(0);if(!this._direction)this._direction=this._LTR;if(range&&range.startContainer){if(this._direction==this._LTR){this.anchorNode=range.startContainer;this.anchorOffset=range.startOffset;this.focusNode=range.endContainer;this.focusOffset=range.endOffset;}
+else{this.anchorNode=range.endContainer;this.anchorOffset=range.endOffset;this.focusNode=range.startContainer;this.focusOffset=range.startOffset;}
+this.isCollapsed=range.collapsed;}
+else{this.anchorNode=null;this.anchorOffset=null;this.focusNode=null;this.focusOffset=null;this.isCollapsed=true;}
+this.rangeCount=this._selection.createRangeCollection().length;}
+mozile.dom.InternetExplorerSelection.prototype.getRangeAt=function(index){var textRange=this._selection.createRangeCollection().item(index).duplicate();var range;if(this._lastTextRange&&this._lastTextRange.isEqual(textRange)){range=this._lastRange;}
+else{range=new mozile.dom.InternetExplorerRange(textRange);range._init();this._lastTextRange=textRange.duplicate();this._lastRange=range;this._direction=this._LTR;}
+return range.cloneRange();}
+mozile.dom.InternetExplorerSelection.prototype.collapse=function(parentNode,offset){try{var range=this.getRangeAt(0);range.setStart(parentNode,offset);range.setEnd(parentNode,offset);range.collapse(false);this._direction=this._LTR;this._init(range);this._lastTextRange=range._range.duplicate();this._lastRange=range;range._range.select();}catch(e){mozile.debug.debug("mozile.dom.InternetExplorerSelection.collapse","Error: "+mozile.dumpError(e));}}
+mozile.dom.InternetExplorerSelection.prototype.extend=function(parentNode,offset){var range=this.getRangeAt(0);var direction;if(parentNode==range.startContainer&&range.startOffset<=offset){direction=this._LTR;}
+else if(parentNode==range.endContainer&&range.endOffset>=offset){direction=this._RTL;}
+else if(parentNode==range.startContainer.parentNode&&range.startContainer.nodeType==mozile.dom.TEXT_NODE&&mozile.dom.getIndex(range.startContainer)<=offset){direction=this._LTR;}
+else if(parentNode==range.endContainer.parentNode&&range.endContainer.nodeType==mozile.dom.TEXT_NODE&&mozile.dom.getIndex(range.endContainer)>=offset){direction=this._RTL;}
+else{var ancestor=mozile.dom.getCommonAncestor(parentNode,range.commonAncestorContainer)
+var treeWalker=document.createTreeWalker(ancestor,mozile.dom.NodeFilter.SHOW_ALL,null,false);treeWalker.currentNode=this.anchorNode;while(treeWalker.previousNode()){if(treeWalker.currentNode==parentNode){direction=this._RTL;break;}}
+if(!direction)direction=this._LTR;}
+if(direction==this._LTR)range.setEnd(parentNode,offset);else if(direction==this._RTL)range.setStart(parentNode,offset);else return;this._direction=direction;this._init(range);this._lastTextRange=range._range.duplicate();this._lastRange=range;range._range.select();}
+mozile.dom.InternetExplorerSelection.prototype.collapseToStart=function(){var range=this.getRangeAt(0);range.collapse(true);this._init(range);range._range.select();}
+mozile.dom.InternetExplorerSelection.prototype.collapseToEnd=function(){var range=this.getRangeAt(0);range.collapse();this._init(range);range._range.select();}
+mozile.dom.InternetExplorerSelection.prototype.selectAllChildren=function(parentNode){var range=this.getRangeAt(0);range.selectNodeContents(parentNode);this._init(range);range._range.select();}
+mozile.dom.InternetExplorerSelection.prototype.addRange=function(range){this._direction=this._LTR;this._init(range);range._range.select();}
+mozile.dom.InternetExplorerSelection.prototype.removeRange=function(range){range.collapse();this._init(range);}
+mozile.dom.InternetExplorerSelection.prototype.removeAllRanges=function(){this._selection.empty();this._init();}
+mozile.dom.InternetExplorerSelection.prototype.deleteFromDocument=function(){this._selection.clear();this._init();}
+mozile.dom.InternetExplorerSelection.prototype.selectionLanguageChange=function(){}
+mozile.dom.InternetExplorerSelection.prototype.toString=function(){var range=this.getRangeAt(0);return range.toString();}
+mozile.dom.InternetExplorerSelection.prototype.containsNode=function(aNode,aPartlyContained){alert('mozile.dom.InternetExplorerSelection.containsNode() is not implemented yet');}
+mozile.dom.InternetExplorerSelection.prototype.store=mozile.dom.Selection.prototype.store;mozile.dom.InternetExplorerSelection.prototype.restore=mozile.dom.Selection.prototype.restore;mozile.dom.InternetExplorerSelection.prototype.scroll=mozile.dom.Selection.prototype.scroll;mozile.dom.Selection.restoreSelection=function(r){var range=new mozile.Range();try{range.setStart(r.startContainer,r.startOffset);range.setEnd(r.endContainer,r.endOffset);}catch(e){}
+var s=new mozile.dom.Selection();s.removeAllRanges();s.addRange(range);}
+mozile.rng=new Object();mozile.rng.prototype=new mozile.Module;mozile.rng.debug=false;mozile.rng.getName=function(){if(this._name)return this._name;if(this._element.getAttribute("name")){var match=this._element.getAttribute("name").match(/^\s*(.+?)\s*$/);if(match&&match.length==2){this._name=match[1];return this._name;}}
+throw Error("This RNG '"+this.getType()+"' element must have a 'name' attribute.");}
+mozile.rng.getLocalName=function(){if(this._localName)return this._localName;var name=this.getName();if(name.indexOf(":"))this._localName=name.substring(name.indexOf(":")+1,name.length);else this._localName=name;return this._localName;}
+mozile.rng.getPrefix=function(){if(this._prefix)return this._prefix;var name=this.getName();if(name.indexOf(":"))this._prefix=name.substring(0,name.indexOf(":"));else this._prefix=null;return this._prefix;}
+mozile.rng.checkType=function(types,type){if(typeof(types)=="string"&&types==type)return true;if(types.length){for(var i=0;i<types.length;i++){if(types[i]==type)return true;}}
+return false;}
+mozile.rng.validateSequence=function(node,validation){if(!node)throw Error("mozile.rng.validateSequence() requires a node.");if(!validation)throw Error("mozile.rng.validateSequence() requires an mozile.rng.Validation object.");var RNGChildren=this.getChildNodes();if(RNGChildren.length==0)return validation;for(var r=0;r<RNGChildren.length;r++){if(!validation.isValid)break;validation=RNGChildren[r].validate(node,validation);if(node.nodeType==mozile.dom.ELEMENT_NODE&&validation.isEmpty)
+validation.logError(this,node,"The parent element should be empty, but it contains child elements.");if(validation.getCurrentElement()){node=validation.getCurrentElement();if(mozile.dom.getNextSiblingElement(node))node=mozile.dom.getNextSiblingElement(node);}}
+return validation;}
+mozile.rng.validateMany=function(node,validation){if(!node)throw Error("mozile.rng.validateMany() requires a node.");if(!validation)throw Error("mozile.rng.validateMany() requires an mozile.rng.Validation object.");var result;validation.count=0;while(true){result=validation.branch();result=this._validateSequence(node,result);if(result.isValid){validation.count++;validation.merge(result);if(result.getCurrentElement()&&mozile.dom.getNextSiblingElement(result.getCurrentElement())){node=mozile.dom.getNextSiblingElement(result.getCurrentElement());continue;}}
+if(mozile.rng.debug)validation.append(result,true);break;}
+return validation;}
+mozile.rng.validateInterleave=function(node,validation){if(!node)throw Error("mozile.rng.validateInterleave() requires a node.");if(!validation)throw Error("mozile.rng.validateInterleave() requires an mozile.rng.Validation object.");validation.logMessage(this,node,"Validating interleave...");var RNGChildren=new Array();for(var c=0;c<this.getChildNodes().length;c++){RNGChildren.push(this.getChildNodes()[c]);}
+var type;var length=RNGChildren.length;for(var i=0;i<length;i++){for(var r=0;r<RNGChildren.length;r++){var result=validation.branch();result=RNGChildren[r].validate(node,result);if(result.isValid){type=RNGChildren[r].getType();if((RNGChildren[r].getType()=="optional"||RNGChildren[r].getType()=="zeroOrMore")&&!result.count)
+continue;validation.merge(result);if(result.getCurrentElement()&&mozile.dom.getNextSiblingElement(result.getCurrentElement())){node=mozile.dom.getNextSiblingElement(result.getCurrentElement());}
+RNGChildren.splice(r,1);break;}}}
+if(RNGChildren.length>0){for(r=0;r<RNGChildren.length;r++){if(!validation.isValid)break;type=RNGChildren[r].getType();if(type!="optional"&&type!="zeroOrMore")
+validation.logError(this,node,"There were non-optional RNG children which did not match any elements.");}}
+if(validation.isValid)validation.logMessage(this,node,"Interleave is valid.");return validation;}
+mozile.rng.combine=function(target){var combineType;var combineA=this._element.getAttribute("combine");var combineB=target._element.getAttribute("combine");if(combineA&&combineB){if(combineA==combineB)combineType=combineA;else throw Error("In order to combine RNG elements, their 'combine' attributes muct match. '"+combineA+"' != '"+combineB+"'");}
+else{if(combineA)combineType=combineA;else if(combineB)combineType=combineB;else throw Error("In order to combine RNG elements, at least one must have a 'combine' attribute.");}
+if(combineType!="choice"&&combineType!="interleave")
+throw Error("RNG 'define' or 'start' elements can only have 'combine' attribute values of 'choice' or 'interleave', not '"+combineType+"'.");this._element.setAttribute("combine",combineType);var combineObject;if(this.getChildNodes().length==1&&this.getChildNode(0).getType()==combineType){combineObject=this.getChildNode(0);}
+else{var validation=new mozile.rng.Validation();combineObject=this.getSchema().parseElement(mozile.dom.createElementNS(mozile.xml.ns.rng,combineType),validation,true);this.appendChild(combineObject);while(this.getChildNodes().length>1){combineObject.appendChild(this.removeChild(this.getChildNode(0)));}}
+var targetObject=target;if(target.getChildNodes().length==1&&target.getChildNode(0).getType()==combineType){targetObject=target.getChildNode(0);}
+while(targetObject.getChildNodes().length){combineObject.appendChild(targetObject.removeChild(targetObject.getChildNode(0)));}
+return this;}
+mozile.rng.Schema=function(target){this._documents=new Object();this._types=new Object();this._names=new Object();this._root=null;if(target)this.parse(target);}
+mozile.rng.Schema.prototype.constructor=mozile.rng.Schema;mozile.rng.Schema.prototype.toString=function(){return"[object mozile.rng.Schema]"};mozile.rng.Schema.prototype.getType=function(){return"schema";}
+mozile.rng.Schema.prototype.parse=function(target){var element;var filepath;if(typeof(target)=="string"){if(target.indexOf("<")>-1){element=mozile.xml.parse(target).documentElement;filepath=location.toString();}
+else{var doc=this.load(target);if(!doc)throw Error("Could not load schema '"+target+"'.");element=doc.documentElement;filepath=target;}}
+else if(target.nodeType){element=target;filepath=location.toString();}
+else throw Error("Unknown target given in mozile.rng.Schema.parse().");if(!this.filepath)this.filepath=filepath;var validation=new mozile.rng.Validation();validation.logMessage(this,null,"Starting to parse schema");var result=this.parseElement(element,validation);if(!result){validation.logError(this,null,"An invalid result was returned from the parsing operation: "+result);return validation;}
+var root=result;if(root.getType()=="element"||root.getType()=="grammar"){this._root=root;}
+else{validation.logError(this,null,"Schema has no root element.");return validation;}
+var includes=this.getNodes("include");if(!includes)return validation;for(var i=0;i<includes.length;i++){validation=includes[i].include(validation);}
+return validation;}
+mozile.rng.Schema.prototype.parseElement=function(element,validation,omitValidation){var rngNode=this._createRNGNode(element,validation);if(!rngNode){return null;}
+else validation.logMessage(rngNode,element,"Adding RNG '"+rngNode.getType()+"' node.");if(omitValidation!=true){validation=rngNode.selfValidate(validation);if(!validation.isValid)return{node:null,validation:validation};}
+if(element.hasChildNodes()){var child;for(var c=0;c<element.childNodes.length;c++){child=this.parseElement(element.childNodes[c],validation);if(child)rngNode.appendChild(child);}}
+return rngNode;}
+mozile.rng.Schema.prototype._createRNGNode=function(element,validation){if(!element.nodeType||element.nodeType!=mozile.dom.ELEMENT_NODE)return null;if(element.namespaceURI!=mozile.xml.ns.rng)return null;var result;var type=mozile.dom.getLocalName(element);switch(type){case"grammar":result=new mozile.rng.Grammar(element,this);break;case"start":result=new mozile.rng.Start(element,this);break;case"element":result=new mozile.rng.Element(element,this);break;case"attribute":result=new mozile.rng.Attribute(element,this);break;case"empty":result=new mozile.rng.Empty(element,this);break;case"text":result=new mozile.rng.Text(element,this);break;case"group":result=new mozile.rng.Group(element,this);break;case"optional":result=new mozile.rng.Optional(element,this);break;case"oneOrMore":result=new mozile.rng.OneOrMore(element,this);break;case"zeroOrMore":result=new mozile.rng.ZeroOrMore(element,this);break;case"choice":result=new mozile.rng.Choice(element,this);break;case"define":result=new mozi
 le.rng.Define(element,this);break;case"ref":result=new mozile.rng.Ref(element,this);break;case"include":result=new mozile.rng.Include(element,this);break;case"data":result=new mozile.rng.Data(element,this);break;case"param":result=new mozile.rng.Param(element,this);break;case"value":result=new mozile.rng.Value(element,this);break;case"interleave":result=new mozile.rng.Interleave(element,this);break;case"div":result=new mozile.rng.Div(element,this);break;default:validation.logError(this,null,"Method mozile.rng.Schema._createRNGNode() found an unknown element '"+element.nodeName+"' with the RNG namespace.");return null;}
+if(result){this._indexNode(result);return result;}
+else return null;}
+mozile.rng.Schema.prototype._indexNode=function(node){var type=node.getType();if(!this._types[type])this._types[type]=new Array();this._types[type].push(node);if(node.getName){var name=node.getName();if(!this._names[type])this._names[type]=new Object();if(!this._names[type][name])this._names[type][name]=new Array();this._names[type][name].push(node);}}
+mozile.rng.Schema.prototype.getNodes=function(type,name){if(name){if(this._names[type]&&this._names[type][name])
+return this._names[type][name];else return new Array();}
+else{if(this._types[type])return this._types[type];else return new Array();}}
+mozile.rng.Schema.prototype.load=function(filepath,forceLoad){if(!forceLoad&&this._documents[filepath])return this._documents[filepath];var uri=mozile.getPath(filepath);uri=mozile.getAbsolutePath(uri,mozile.root);var xmlDoc=mozile.xml.load(uri);if(xmlDoc)this._documents[filepath]=xmlDoc;return xmlDoc;}
+mozile.rng.Schema.prototype.validate=function(element){if(!element)element=document.documentElement;if(!this._root)return false;var validation=new mozile.rng.Validation();this._root.resetAll();this._root.validate(element,validation);return validation;}
+mozile.rng.Validation=function(){this.isValid=true;this.isEmpty=false;this.allowText=false;this._currentElement=null;this._currentParent=null;this._lastValidElement=null;this._validAttributes=new Array();this._messages=new Array();}
+mozile.rng.Validation.prototype.toString=function(){return"[object mozile.rng.Validation]"};mozile.rng.Validation.prototype.getType=function(){return"validation";}
+mozile.rng.Validation.prototype.getCurrentElement=function(){return this._currentElement;}
+mozile.rng.Validation.prototype.setCurrentElement=function(element){if(element.nodeType==mozile.dom.ELEMENT_NODE){if(element==this._lastValidElement){this.logError(this,element,"An element has been marked as valid twice, which indicated an error");}
+else{this._lastValidElement=this._currentElement;this._currentElement=element;}}
+return element;}
+mozile.rng.Validation.prototype.getCurrentParent=function(){return this._currentParent;}
+mozile.rng.Validation.prototype.setCurrentParent=function(element){this._currentParent=element;return element;}
+mozile.rng.Validation.prototype.addAttribute=function(attr){this._validAttributes.push(attr);return attr;}
+mozile.rng.Validation.prototype.isAttributeValid=function(attr){for(var a=0;a<this._validAttributes.length;a++){if(mozile.browser.isMozilla&&mozile.browser.mozillaVersion<1.8){if(this._validAttributes[a].nodeName==attr.nodeName)return true;}
+if(this._validAttributes[a]==attr)return true;}
+return false;}
+mozile.rng.Validation.prototype.logMessage=function(rngNode,node,message,type){if(!type)type="Message";this._messages.push({"type":type,"rngNode":rngNode,"node":node,"message":message});}
+mozile.rng.Validation.prototype.logError=function(rngNode,node,message){this.logMessage(rngNode,node,message,"Error");this.isValid=false;}
+mozile.rng.Validation.prototype.getFirstError=function(){for(var m=0;m<this._messages.length;m++){if(this._messages[m].type!="Message")return this._messages[m];}
+return null;}
+mozile.rng.Validation.prototype.branch=function(){var validation=new mozile.rng.Validation();validation._currentParent=this._currentParent;return validation;}
+mozile.rng.Validation.prototype.append=function(validation,status){this._messages=this._messages.concat(validation._messages);if(status)this.isValid=status;else if(!validation.isValid)this.isValid=false;}
+mozile.rng.Validation.prototype.merge=function(validation){this.append(validation);this._validAttributes=this._validAttributes.concat(validation._validAttributes);if(validation.isEmpty)this.isEmpty=true;if(validation.allowText)this.allowText=true;if(validation._currentElement)this._currentElement=validation._currentElement;if(validation._lastValidElement)this._lastValidElement=validation._lastValidElement;}
+mozile.rng.Validation.prototype.report=function(errorsOnly){mozile.require("mozile.util");mozile.require("mozile.xpath");var messages=new Array();var maxType=8;var maxName=0;var maxLocation=0;var msg;var location;var rngName
+var lastNode;var lastLocation;for(var m=0;m<this._messages.length;m++){msg=this._messages[m];if(errorsOnly&&msg.type=="Message")continue;rngName="validation";if(msg.rngNode){if(msg.rngNode.getType())rngName=mozile.util.pad(msg.rngNode.getType(),11,true);if(msg.rngNode.getName)rngName=rngName+" "+msg.rngNode.getName();}
+location="";if(msg.node){if(msg.node==lastNode)location=lastLocation;else{location=mozile.xpath.getXPath(msg.node);location=location.replace(/xmlns:/g,"");lastNode=msg.node;lastLocation=location;if(location.length>maxLocation)maxLocation=location.length;}}
+if(rngName.length>maxName)maxName=rngName.length;messages.push([msg.type,rngName,location,msg.message]);}
+var output=new Array();var maxNum=Math.ceil(Math.log(messages.length+1)/Math.log(10))+1;for(m=0;m<messages.length;m++){msg=messages[m];output.push(mozile.util.pad((m+1)+".",maxNum)+" "+mozile.util.pad(msg[0],maxType)+" "+mozile.util.pad(msg[1],maxName)+"  "+mozile.util.pad(msg[2],maxLocation)+"  "+msg[3]);}
+return output.join(mozile.linesep);}
+mozile.rng.Node=function(element,schema){this._element=element;this._schema=schema;}
+mozile.rng.Node.prototype._cached=[this._mustHaveCache,this._mayHaveCache,this._descendantElementsCache,this._type];mozile.rng.Node.prototype.toString=function(){var type=this.getType();type=type.charAt(0).toUpperCase()+type.substring(1);var name="";if(this.getName)name=" '"+this.getName()+"'";return"[object mozile.rng."+type+name+"]";}
+mozile.rng.Node.prototype.getType=function(){if(!this._type)this._type=mozile.dom.getLocalName(this._element);return this._type;}
+mozile.rng.Node.prototype.getSchema=function(){return this._schema;}
+mozile.rng.Node.prototype.getGrammar=function(){var node=this;while(node){if(node.getType()=="grammar")return node;node=node.getParentNode();}
+return null;}
+mozile.rng.Node.prototype.getParentNode=function(){if(this._parentNode)return this._parentNode;return null;}
+mozile.rng.Node.prototype.getParentElement=function(){var parent=this.getParentNode();while(parent){if(parent.getType()=="element")return parent;parent=parent.getParentNode();}
+return null;}
+mozile.rng.Node.prototype.getNextSibling=function(){var parent=this.getParentNode();if(!parent)return null;var siblings=parent.getChildNodes();for(var r=0;r<siblings.length;r++){if(siblings[r]==this){if(siblings[r+1])return siblings[r+1];}}
+return null;}
+mozile.rng.Node.prototype.getChildNodes=function(){if(!this._childNodes)this._childNodes=new Array();return this._childNodes;}
+mozile.rng.Node.prototype.getChildNode=function(index){var children=this.getChildNodes();if(children&&children.length&&children.length>0&&index<children.length)
+return children[index];else return null;}
+mozile.rng.Node.prototype.appendChild=function(child){if(child){this.getChildNodes().push(child);child._parentNode=this;}
+return child;}
+mozile.rng.Node.prototype.removeChild=function(child){var children=new Array();for(var c=0;c<this.getChildNodes().length;c++){if(this.getChildNodes()[c]==child)continue;children.push(this.getChildNodes()[c]);}
+if(children.length==this.getChildNodes().length)
+throw Error("mozile.rng.Node.removeChild(): The given node is not child of this node.");else this._childNodes=children;child._parentNode=null;return child;}
+mozile.rng.Node.prototype.getDescendants=function(types,deep){if(deep!==false)deep=true;var descendants=new Array();if(!deep&&mozile.rng.checkType(types,this.getType())){descendants.push(this);}
+else{var result;for(var c=0;c<this.getChildNodes().length;c++){result=this.getChildNode(c).getDescendants(types,false);descendants=descendants.concat(result);}}
+return descendants;}
+mozile.rng.Node.prototype.mustContain=function(type){if(!this._mustHaveCache)this._mustHaveCache=new Object();if(this._mustHaveCache[type])return this._mustHaveCache[type];var result=false;for(var c=0;c<this.getChildNodes().length;c++){if(this.getChildNodes()[c].mustHave(type)){result=true;break;}}
+this._mustHaveCache[type]=result;return result;}
+mozile.rng.Node.prototype.mayContain=function(type){if(!this._mayHaveCache)this._mayHaveCache=new Object();if(this._mayHaveCache[type])return this._mayHaveCache[type];var result=false;for(var c=0;c<this.getChildNodes().length;c++){if(this.getChildNodes()[c].mayHave(type)){result=true;break;}}
+this._mayHaveCache[type]=result;return result;}
+mozile.rng.Node.prototype.mustHave=function(type){if(this.getType()==type)return true;else return this.mustContain(type);}
+mozile.rng.Node.prototype.mayHave=function(type){if(this.getType()==type)return true;else return this.mayContain(type);}
+mozile.rng.Node.prototype.reset=function(){for(var i=0;i<this._cached.length;i++){this._cached[i]=undefined;}}
+mozile.rng.Node.prototype.resetAll=function(){this.reset();for(var c=0;c<this.getChildNodes().length;c++){this.getChildNodes()[c].reset;}}
+mozile.rng.Node.prototype.selfValidate=function(validation){if(!mozile.dom.getFirstChildElement(this._element))
+validation.logError(this,this._element,"This RNG element must have at least one child element.");return validation;}
+mozile.rng.Node.prototype.selfValidateAll=function(validation){validation=this.selfValidate(validation);validation.logMessage(this,null,"Self validated.");for(var r=0;r<this.getChildNodes().length;r++){if(!validation.isValid)break;validation=this.getChildNodes()[r].selfValidateAll(validation);}
+return validation;}
+mozile.rng.Node.prototype.validate=function(node,validation){validation.logError(this,node,"The validate() method is not defined yet for "+this+".");return validation;}
+mozile.rng.Grammar=function(element,schema){this._element=element;this._schema=schema;this._start=null;this._definitions=new Object;}
+mozile.rng.Grammar.prototype=new mozile.rng.Node;mozile.rng.Grammar.prototype.constructor=mozile.rng.Grammar;mozile.rng.Grammar.prototype.getParentGrammar=function(){var parent=this.getParentNode();while(parent){if(parent.getType()=="grammar")return parent;parent=parent.getParentNode();}
+return null;}
+mozile.rng.Grammar.prototype.appendChild=function(child){if(child&&child.getType){switch(child.getType()){case"start":return this.setStart(child);break;case"define":return this.addDefinition(child);break;case"include":case"div":break;default:throw Error("RNG grammar element cannot have a child of type '"+child.getType()+"'.");break;}
+this.getChildNodes().push(child);child._parentNode=this;}
+return child;}
+mozile.rng.Grammar.prototype.getStart=function(){if(this._start)return this._start;else return null;}
+mozile.rng.Grammar.prototype.setStart=function(start){if(start.getType&&start.getType()=="start"){if(this._start)this._start.combine(start);else{this._start=start;this.getChildNodes().push(start);start._parentNode=this;}
+return start;}
+else return null;}
+mozile.rng.Grammar.prototype.getDefinition=function(name){if(this._definitions[name])return this._definitions[name];else return null;}
+mozile.rng.Grammar.prototype.addDefinition=function(definition){if(this._definitions[definition.getName()]){definition=this._definitions[definition.getName()].combine(definition);}
+else{this._definitions[definition.getName()]=definition;this.getChildNodes().push(definition);definition._parentNode=this;}
+return definition;}
+mozile.rng.Grammar.prototype.mustHave=function(type){if(this.getType()==type)return true;var result=false;var start=this.getStart();if(start)result=start.mustHave(type);else throw Error("mozile.rng.Grammar.mustHave() requires getStart() to return a mozile.rng.Start object.");return result;}
+mozile.rng.Grammar.prototype.mayHave=function(type){if(this.getType()==type)return true;var result=false;var start=this.getStart();if(start)result=start.mayHave(type);else throw Error("mozile.rng.Grammar.mayHave() requires getStart() to return a mozile.rng.Start object.");return result;}
+mozile.rng.Grammar.prototype.validate=function(node,validation){var start=this.getStart();if(start)validation=start.validate(node,validation);else validation.logError(this,node,"RNG grammar element must have a start element in order to validate a node, but it does not.");return validation;}
+mozile.rng.Start=func

<TRUNCATED>

[19/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/lingvoj.rdf
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/lingvoj.rdf b/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/lingvoj.rdf
new file mode 100644
index 0000000..4f35482
--- /dev/null
+++ b/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/lingvoj.rdf
@@ -0,0 +1,20946 @@
+<?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.
+
+-->
+
+
+<rdf:RDF
+  xml:base="http://www.lingvoj.org/ontology"
+  xmlns:lingvoj="http://www.lingvoj.org/ontology#"
+  xmlns:owl="http://www.w3.org/2002/07/owl#"
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+
+<lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/aa" 
+lingvoj:iso1="aa" 
+lingvoj:iso2b="aar" 
+lingvoj:iso2t="aar" 
+lingvoj:iso3="aar">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/aa.rdf"/>
+    <rdfs:label xml:lang="de">Afar (Sprache)</rdfs:label>
+    <rdfs:label xml:lang="fr">Afar (langue)</rdfs:label>
+    <rdfs:label xml:lang="no">Afar (språk)</rdfs:label>
+    <rdfs:label xml:lang="nl">Afar (taal)</rdfs:label>
+    <rdfs:label xml:lang="en">Afar language</rdfs:label>
+    <rdfs:label xml:lang="eo">Afara lingvo</rdfs:label>
+    <rdfs:label xml:lang="br">Afareg</rdfs:label>
+    <rdfs:label xml:lang="eu">Afariko</rdfs:label>
+    <rdfs:label xml:lang="fi">Afarin kieli</rdfs:label>
+    <rdfs:label xml:lang="hr">Afarski jezik</rdfs:label>
+    <rdfs:label xml:lang="cs">Afarština</rdfs:label>
+    <rdfs:label xml:lang="hsb">Afaršćina</rdfs:label>
+    <rdfs:label xml:lang="lt">Afarų kalba</rdfs:label>
+    <rdfs:label xml:lang="lv">Afāru valoda</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Afar</rdfs:label>
+    <rdfs:label xml:lang="sq">Gjuha afare</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma afar</rdfs:label>
+    <rdfs:label xml:lang="pl">Język afar</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua afar</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua afar</rdfs:label>
+    <rdfs:label xml:lang="ca">Llengua àfar</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua afar</rdfs:label>
+    <rdfs:label xml:lang="bg">Афарски език</rdfs:label>
+    <rdfs:label xml:lang="ru">Афарский язык</rdfs:label>
+    <rdfs:label xml:lang="am">አፋርኛ</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Afar_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#aa"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#aar"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/aaa"
+                   lingvoj:iso2b="aaa">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/aaa.rdf"/>
+    <rdfs:label xml:lang="en">Ghotuo language</rdfs:label>
+    <rdfs:label xml:lang="de">Ghotuo</rdfs:label>
+    <rdfs:label xml:lang="fi">Ghotuo</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Ghotuo"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/aac"
+                   lingvoj:iso2b="aac">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/aac.rdf"/>
+    <rdfs:label xml:lang="en">Ari language</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Ari_language"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f80000000056dc59f"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ab"
+                   lingvoj:iso1="ab"
+                   lingvoj:iso2b="abk"
+                   lingvoj:iso2t="abk"
+                   lingvoj:iso3="abk">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ab.rdf"/>
+    <rdfs:label xml:lang="br">Abc'hazeg</rdfs:label>
+    <rdfs:label xml:lang="br">Abc'hazeg</rdfs:label>
+    <rdfs:label xml:lang="cy">Abchaseg</rdfs:label>
+    <rdfs:label xml:lang="de">Abchasische Sprache</rdfs:label>
+    <rdfs:label xml:lang="nl">Abchazisch</rdfs:label>
+    <rdfs:label xml:lang="sv">Abchaziska</rdfs:label>
+    <rdfs:label xml:lang="lt">Abchazų kalba</rdfs:label>
+    <rdfs:label xml:lang="cs">Abcházština</rdfs:label>
+    <rdfs:label xml:lang="sk">Abcházština</rdfs:label>
+    <rdfs:label xml:lang="ga">Abcáisis</rdfs:label>
+    <rdfs:label xml:lang="fi">Abhaasin kieli</rdfs:label>
+    <rdfs:label xml:lang="hr">Abhaski jezik</rdfs:label>
+    <rdfs:label xml:lang="tk">Abhaz dili</rdfs:label>
+    <rdfs:label xml:lang="tr">Abhazca</rdfs:label>
+    <rdfs:label xml:lang="hu">Abház nyelv</rdfs:label>
+    <rdfs:label xml:lang="lv">Abhāzu valoda</rdfs:label>
+    <rdfs:label xml:lang="is">Abkasíska</rdfs:label>
+    <rdfs:label xml:lang="nn">Abkhasisk språk</rdfs:label>
+    <rdfs:label xml:lang="no">Abkhasisk</rdfs:label>
+    <rdfs:label xml:lang="en">Abkhaz language</rdfs:label>
+    <rdfs:label xml:lang="ca">Abkhaz</rdfs:label>
+    <rdfs:label xml:lang="fr">Abkhaze</rdfs:label>
+    <rdfs:label xml:lang="eu">Abkhazera</rdfs:label>
+    <rdfs:label xml:lang="eo">Abĥaza lingvo</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Abkhaz</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma abjasio</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma abjasio</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma abjaso</rdfs:label>
+    <rdfs:label xml:lang="pl">Język abchaski</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba abhază</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua abcasa</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua abkhaza</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua abecásia</rdfs:label>
+    <rdfs:label xml:lang="ceb">Pinulongang Abhaso</rdfs:label>
+    <rdfs:label xml:lang="cv">Абхаз чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="os">Абхазаг æвзаг</rdfs:label>
+    <rdfs:label xml:lang="bg">Абхазки език</rdfs:label>
+    <rdfs:label xml:lang="ru">Абхазский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Абхазька мова</rdfs:label>
+    <rdfs:label xml:lang="mk">Абхаски јазик</rdfs:label>
+    <rdfs:label xml:lang="ab">Аҧсуа бызшәа</rdfs:label>
+    <rdfs:label xml:lang="he">אבחזית</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان آبخازی</rdfs:label>
+    <rdfs:label xml:lang="bn">আবখাজ ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ka">აფხაზური ენა</rdfs:label>
+    <rdfs:label xml:lang="ja">アブハズ語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿布哈兹语</rdfs:label>
+    <rdfs:label xml:lang="ko">압하스어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Abkhazian_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#ab"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#abk"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ace"
+                   lingvoj:iso2b="ace"
+                   lingvoj:iso2t="ace"
+                   lingvoj:iso3="ace">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ace.rdf"/>
+    <rdfs:label xml:lang="de">Acholi (Sprache)</rdfs:label>
+    <rdfs:label xml:lang="fr">Acholi (langue)</rdfs:label>
+    <rdfs:label xml:lang="en">Acholi language</rdfs:label>
+    <rdfs:label xml:lang="br">Atcholeg</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Acholi</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua acholi</rdfs:label>
+    <rdfs:label xml:lang="ru">Ачоли (язык)</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Acoli_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ace"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ach"
+                   lingvoj:iso2b="ach"
+                   lingvoj:iso2t="ach"
+                   lingvoj:iso3="ach">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ach.rdf"/>
+    <rdfs:label xml:lang="fr">Aceh (langue)</rdfs:label>
+    <rdfs:label xml:lang="fi">Aceh'n kieli</rdfs:label>
+    <rdfs:label xml:lang="en">Acehnese language</rdfs:label>
+    <rdfs:label xml:lang="sv">Acehnesiska</rdfs:label>
+    <rdfs:label xml:lang="fi">Aceh’n kieli</rdfs:label>
+    <rdfs:label xml:lang="nl">Atjehs</rdfs:label>
+    <rdfs:label xml:lang="eo">Aĉea lingvo</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Aceh</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Aceh</rdfs:label>
+    <rdfs:label xml:lang="jv">Basa Aceh</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma achenés</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua achinesa</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua achém</rdfs:label>
+    <rdfs:label xml:lang="ru">Ачехский язык</rdfs:label>
+    <rdfs:label xml:lang="bn">আচে ভাষা</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอาเจะห์</rdfs:label>
+    <rdfs:label xml:lang="ja">アチェ語</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Achinese_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ach"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ada"
+                   lingvoj:iso2b="ada"
+                   lingvoj:iso2t="ada"
+                   lingvoj:iso3="ada">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ada.rdf"/>
+    <rdfs:label xml:lang="fr">Adangme (langue)</rdfs:label>
+    <rdfs:label xml:lang="en">Adangme language</rdfs:label>
+    <rdfs:label xml:lang="pt">Adangme</rdfs:label>
+    <rdfs:label xml:lang="br">Adangmeg</rdfs:label>
+    <rdfs:label xml:lang="de">Dangme (Sprache)</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Adangme_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ada"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f800000000053a030"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ady"
+                   lingvoj:iso2b="ady"
+                   lingvoj:iso2t="ady"
+                   lingvoj:iso3="ady">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ady.rdf"/>
+    <rdfs:label xml:lang="eo">Adigea lingvo</rdfs:label>
+    <rdfs:label xml:lang="tr">Adigece</rdfs:label>
+    <rdfs:label xml:lang="br">Adigeg</rdfs:label>
+    <rdfs:label xml:lang="hr">Adigejski jezik</rdfs:label>
+    <rdfs:label xml:lang="ca">Adigué</rdfs:label>
+    <rdfs:label xml:lang="de">Adygeische Sprache</rdfs:label>
+    <rdfs:label xml:lang="sv">Adygeiska</rdfs:label>
+    <rdfs:label xml:lang="cs">Adygejština</rdfs:label>
+    <rdfs:label xml:lang="fi">Adygen kieli</rdfs:label>
+    <rdfs:label xml:lang="is">Adygeyska</rdfs:label>
+    <rdfs:label xml:lang="nl">Adyghe (taal)</rdfs:label>
+    <rdfs:label xml:lang="en">Adyghe language</rdfs:label>
+    <rdfs:label xml:lang="ga">Adyghe</rdfs:label>
+    <rdfs:label xml:lang="fr">Adyguéen (langue)</rdfs:label>
+    <rdfs:label xml:lang="lt">Adygų kalba</rdfs:label>
+    <rdfs:label xml:lang="ku">Adîgeyî</rdfs:label>
+    <rdfs:label xml:lang="pl">Język adygejski</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua adigue</rdfs:label>
+    <rdfs:label xml:lang="mk">Адиге јазик</rdfs:label>
+    <rdfs:label xml:lang="uk">Адигейська мова</rdfs:label>
+    <rdfs:label xml:lang="ru">Адыгейский язык</rdfs:label>
+    <rdfs:label xml:lang="he">אדיגית</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أديغية</rdfs:label>
+    <rdfs:label xml:lang="bn">আদিগে ভাষা</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอะดืยเก</rdfs:label>
+    <rdfs:label xml:lang="ja">アディゲ語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿迪格語</rdfs:label>
+    <rdfs:label xml:lang="ko">아디게어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Adyghe_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ady"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ae"
+                   lingvoj:iso1="ae"
+                   lingvoj:iso2b="ave"
+                   lingvoj:iso2t="ave"
+                   lingvoj:iso3="ave">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ae.rdf"/>
+    <rdfs:label xml:lang="ga">Aivéistis</rdfs:label>
+    <rdfs:label xml:lang="lv">Avesta</rdfs:label>
+    <rdfs:label xml:lang="en">Avestan language</rdfs:label>
+    <rdfs:label xml:lang="br">Avesteg</rdfs:label>
+    <rdfs:label xml:lang="af">Avesties</rdfs:label>
+    <rdfs:label xml:lang="fr">Avestique</rdfs:label>
+    <rdfs:label xml:lang="nl">Avestisch</rdfs:label>
+    <rdfs:label xml:lang="de">Avestische Sprache</rdfs:label>
+    <rdfs:label xml:lang="da">Avestisk</rdfs:label>
+    <rdfs:label xml:lang="no">Avestisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Avestiska</rdfs:label>
+    <rdfs:label xml:lang="cs">Avestánština</rdfs:label>
+    <rdfs:label xml:lang="ca">Avèstic</rdfs:label>
+    <rdfs:label xml:lang="pt">Avéstico</rdfs:label>
+    <rdfs:label xml:lang="tk">Awesta dili</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Avesta</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma abestico</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma avéstico</rdfs:label>
+    <rdfs:label xml:lang="pl">Język awestyjski</rdfs:label>
+    <rdfs:label xml:lang="ceb">Pinulongang Abestiko</rdfs:label>
+    <rdfs:label xml:lang="ku">Zimanê avestayî</rdfs:label>
+    <rdfs:label xml:lang="el">Αβεστική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="sr">Авестански језик</rdfs:label>
+    <rdfs:label xml:lang="cv">Авести чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="ru">Авестийский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Авестійська мова</rdfs:label>
+    <rdfs:label xml:lang="tg">Забони авестоӣ</rdfs:label>
+    <rdfs:label xml:lang="fa">اوستایی (زبان)</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان اوستایی</rdfs:label>
+    <rdfs:label xml:lang="bn">অবেস্তা ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ta">அவெஸ்தான் மொழி</rdfs:label>
+    <rdfs:label xml:lang="kn">ಅವೇಶ್ಟಿ</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอเวสตะ</rdfs:label>
+    <rdfs:label xml:lang="ja">アヴェスター語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿維斯陀語</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Avestan_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#ae"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ave"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f800000000013b355"/>
+    <owl:sameAs rdf:resource="http://sw.opencyc.org/2008/06/10/concept/Mx4rvVjMaZwpEbGdrcN5Y29ycA"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/af"
+                   lingvoj:iso1="af"
+                   lingvoj:iso2b="afr"
+                   lingvoj:iso2t="afr"
+                   lingvoj:iso3="afr">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/af.rdf"/>
+    <rdfs:label xml:lang="ga">Afracáinis</rdfs:label>
+    <rdfs:label xml:lang="tr">Afrikaanca</rdfs:label>
+    <rdfs:label xml:lang="et">Afrikaani keel</rdfs:label>
+    <rdfs:label xml:lang="sco">Afrikaans leid</rdfs:label>
+    <rdfs:label xml:lang="fo">Afrikaans mál</rdfs:label>
+    <rdfs:label xml:lang="hu">Afrikaans nyelv</rdfs:label>
+    <rdfs:label xml:lang="af">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="an">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="ast">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="ca">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="cy">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="da">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="de">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="en">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="eu">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="fi">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="fr">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="gd">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="hr">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="kw">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="li">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="nds">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="nds-nl">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="nl">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="nn">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="no">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="scn">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="sv">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="tr">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="vi">Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="fy">Afrikaansk</rdfs:label>
+    <rdfs:label xml:lang="nah">Afrikaantlahtōlli</rdfs:label>
+    <rdfs:label xml:lang="lv">Afrikandu valoda</rdfs:label>
+    <rdfs:label xml:lang="br">Afrikaneg</rdfs:label>
+    <rdfs:label xml:lang="eo">Afrikansa lingvo</rdfs:label>
+    <rdfs:label xml:lang="sl">Afrikanščina</rdfs:label>
+    <rdfs:label xml:lang="lt">Afrikanų kalba</rdfs:label>
+    <rdfs:label xml:lang="es">Afrikáans</rdfs:label>
+    <rdfs:label xml:lang="se">Afrikánsagiella</rdfs:label>
+    <rdfs:label xml:lang="sk">Afrikánčina</rdfs:label>
+    <rdfs:label xml:lang="cs">Afrikánština</rdfs:label>
+    <rdfs:label xml:lang="is">Afríkanska</rdfs:label>
+    <rdfs:label xml:lang="bat-smg">Afrėkanu kalba</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Afrikaans</rdfs:label>
+    <rdfs:label xml:lang="sq">Gjuha afrikane</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma afrikáans</rdfs:label>
+    <rdfs:label xml:lang="xh">IsiBhulu</rdfs:label>
+    <rdfs:label xml:lang="zu">IsiBhunu</rdfs:label>
+    <rdfs:label xml:lang="pl">Język afrikaans</rdfs:label>
+    <rdfs:label xml:lang="sw">Kiafrikaans</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba afrikaans</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Africana</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua afrikaans</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua afrikaans</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua africâner</rdfs:label>
+    <rdfs:label xml:lang="el">Αφρικάανς γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="bg">Африкаанс</rdfs:label>
+    <rdfs:label xml:lang="ru">Африкаанс</rdfs:label>
+    <rdfs:label xml:lang="uk">Африкаанс</rdfs:label>
+    <rdfs:label xml:lang="mk">Африканс</rdfs:label>
+    <rdfs:label xml:lang="sr">Африканс</rdfs:label>
+    <rdfs:label xml:lang="be">Афрыкаанс</rdfs:label>
+    <rdfs:label xml:lang="hy">Աֆրիկանս</rdfs:label>
+    <rdfs:label xml:lang="he">אפריקאנס</rdfs:label>
+    <rdfs:label xml:lang="fa">آفریکانس</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان آفریکانس</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أفريكانية</rdfs:label>
+    <rdfs:label xml:lang="bn">আফ্রিকান্স ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ta">ஆபிரிக்கான மொழி</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาแอฟริคานส์</rdfs:label>
+    <rdfs:label xml:lang="ka">აფრიკაანსი</rdfs:label>
+    <rdfs:label xml:lang="ja">アフリカーンス語</rdfs:label>
+    <rdfs:label xml:lang="zh">南非語</rdfs:label>
+    <rdfs:label xml:lang="ko">아프리칸스어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Afrikaans_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#af"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#afr"/>
+    
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/afh"
+                   lingvoj:iso2b="afh"
+                   lingvoj:iso2t="afh"
+                   lingvoj:iso3="afh">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/afh.rdf"/>
+    <rdfs:label xml:lang="de">Afrihili</rdfs:label>
+    <rdfs:label xml:lang="en">Afrihili</rdfs:label>
+    <rdfs:label xml:lang="fi">Afrihili</rdfs:label>
+    <rdfs:label xml:lang="fr">Afrihili</rdfs:label>
+    <rdfs:label xml:lang="nl">Afrihili</rdfs:label>
+    <rdfs:label xml:lang="no">Afrihili</rdfs:label>
+    <rdfs:label xml:lang="eo">Afrihilio</rdfs:label>
+    <rdfs:label xml:lang="uk">Афрігілі</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Afrihili_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#afh"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ain"
+                   lingvoj:iso2b="ain"
+                   lingvoj:iso2t="ain"
+                   lingvoj:iso3="ain">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ain.rdf"/>
+    <rdfs:label xml:lang="nl">Aino (taal)</rdfs:label>
+    <rdfs:label xml:lang="oc">Aino</rdfs:label>
+    <rdfs:label xml:lang="br">Ainoueg</rdfs:label>
+    <rdfs:label xml:lang="nds">Ainu (Spraak)</rdfs:label>
+    <rdfs:label xml:lang="de">Ainu (Sprache)</rdfs:label>
+    <rdfs:label xml:lang="no">Ainu (språk)</rdfs:label>
+    <rdfs:label xml:lang="sv">Ainu (språk)</rdfs:label>
+    <rdfs:label xml:lang="en">Ainu language</rdfs:label>
+    <rdfs:label xml:lang="zh-min-nan">Ainu-gú</rdfs:label>
+    <rdfs:label xml:lang="ca">Ainu</rdfs:label>
+    <rdfs:label xml:lang="eu">Ainuiko</rdfs:label>
+    <rdfs:label xml:lang="fi">Ainun kieli</rdfs:label>
+    <rdfs:label xml:lang="cs">Ainština</rdfs:label>
+    <rdfs:label xml:lang="lt">Ainų kalba</rdfs:label>
+    <rdfs:label xml:lang="eo">Ajnua lingvo</rdfs:label>
+    <rdfs:label xml:lang="is">Aínúmál</rdfs:label>
+    <rdfs:label xml:lang="fr">Aïnou (langue de l'ethnie du Japon)</rdfs:label>
+    <rdfs:label xml:lang="fr">Aïnu</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Ainu</rdfs:label>
+    <rdfs:label xml:lang="en">Hokkaidō Ainu language</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma ainu</rdfs:label>
+    <rdfs:label xml:lang="pl">Język ajnoski</rdfs:label>
+    <rdfs:label xml:lang="pl">Język ajnuski</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba ainu</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Ainuana</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua ainu</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua ainu</rdfs:label>
+    <rdfs:label xml:lang="scn">Lingua ainu</rdfs:label>
+    <rdfs:label xml:lang="ast">Llingua ainu</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua ainu</rdfs:label>
+    <rdfs:label xml:lang="vi">Tiếng Ainu</rdfs:label>
+    <rdfs:label xml:lang="mk">Аину јазик</rdfs:label>
+    <rdfs:label xml:lang="sr">Аину језик</rdfs:label>
+    <rdfs:label xml:lang="mk">Аину</rdfs:label>
+    <rdfs:label xml:lang="os">Айнаг æвзаг</rdfs:label>
+    <rdfs:label xml:lang="ru">Айнский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Айнська мова</rdfs:label>
+    <rdfs:label xml:lang="cv">Айну чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="he">שפת איינו</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان آینو</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة آينوية</rdfs:label>
+    <rdfs:label xml:lang="bn">আইনু ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ta">ஐனு மொழி</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาไอนุ</rdfs:label>
+    <rdfs:label xml:lang="ka">აინუს ენა</rdfs:label>
+    <rdfs:label xml:lang="ka">აინუური ენა</rdfs:label>
+    <rdfs:label xml:lang="ja">アイヌ語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿伊努語</rdfs:label>
+    <rdfs:label xml:lang="ko">아이누어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Ainu_language"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ak"
+                   lingvoj:iso1="ak"
+                   lingvoj:iso2b="aka"
+                   lingvoj:iso2t="aka"
+                   lingvoj:iso3="aka">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ak.rdf"/>
+    <rdfs:label xml:lang="de">Akan (Sprachen)</rdfs:label>
+    <rdfs:label xml:lang="no">Akan (språk)</rdfs:label>
+    <rdfs:label xml:lang="en">Akan language</rdfs:label>
+    <rdfs:label xml:lang="ak">Akan</rdfs:label>
+    <rdfs:label xml:lang="sv">Akan</rdfs:label>
+    <rdfs:label xml:lang="tw">Akan</rdfs:label>
+    <rdfs:label xml:lang="br">Akaneg</rdfs:label>
+    <rdfs:label xml:lang="fi">Akanin kieli</rdfs:label>
+    <rdfs:label xml:lang="is">Akanmál</rdfs:label>
+    <rdfs:label xml:lang="lv">Akanu valodas</rdfs:label>
+    <rdfs:label xml:lang="cs">Akanština</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma acano</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues akan</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua akán</rdfs:label>
+    <rdfs:label xml:lang="ast">Llingua Akán</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua akan</rdfs:label>
+    <rdfs:label xml:lang="ru">Акан</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أكانية</rdfs:label>
+    <rdfs:label xml:lang="zh">阿坎语</rdfs:label>
+    <rdfs:label xml:lang="ko">아칸어군</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Akan_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#ak"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#aka"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/akk"
+                   lingvoj:iso2b="akk"
+                   lingvoj:iso2t="akk"
+                   lingvoj:iso3="akk">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/akk.rdf"/>
+    <rdfs:label xml:lang="cy">Acadeg</rdfs:label>
+    <rdfs:label xml:lang="ca">Accadi</rdfs:label>
+    <rdfs:label xml:lang="eo">Akada lingvo</rdfs:label>
+    <rdfs:label xml:lang="eu">Akadiko</rdfs:label>
+    <rdfs:label xml:lang="hr">Akadski jezik</rdfs:label>
+    <rdfs:label xml:lang="lt">Akadų kalba</rdfs:label>
+    <rdfs:label xml:lang="tr">Akatça</rdfs:label>
+    <rdfs:label xml:lang="br">Akkadeg</rdfs:label>
+    <rdfs:label xml:lang="en">Akkadian language</rdfs:label>
+    <rdfs:label xml:lang="fr">Akkadien</rdfs:label>
+    <rdfs:label xml:lang="eu">Akkadiko</rdfs:label>
+    <rdfs:label xml:lang="fi">Akkadin kieli</rdfs:label>
+    <rdfs:label xml:lang="li">Akkadisch</rdfs:label>
+    <rdfs:label xml:lang="nl">Akkadisch</rdfs:label>
+    <rdfs:label xml:lang="de">Akkadische Sprache</rdfs:label>
+    <rdfs:label xml:lang="nn">Akkadisk språk</rdfs:label>
+    <rdfs:label xml:lang="da">Akkadisk</rdfs:label>
+    <rdfs:label xml:lang="no">Akkadisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Akkadiska</rdfs:label>
+    <rdfs:label xml:lang="fy">Akkadysk</rdfs:label>
+    <rdfs:label xml:lang="is">Akkadíska</rdfs:label>
+    <rdfs:label xml:lang="sk">Akkadčina</rdfs:label>
+    <rdfs:label xml:lang="cs">Akkadština</rdfs:label>
+    <rdfs:label xml:lang="hu">Akkád nyelv</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Akkadia</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Akkadia</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma acadio</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma acadio</rdfs:label>
+    <rdfs:label xml:lang="pl">Język akadyjski</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba akkadiană</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua acadia</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua accadica</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua acádia</rdfs:label>
+    <rdfs:label xml:lang="el">Ακκαδική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="bg">Акадски език</rdfs:label>
+    <rdfs:label xml:lang="mk">Акадски јазик</rdfs:label>
+    <rdfs:label xml:lang="cv">Аккад чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="ru">Аккадский язык</rdfs:label>
+    <rdfs:label xml:lang="he">אכדית</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان اکدی</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أكادية</rdfs:label>
+    <rdfs:label xml:lang="arc">ܠܫܢܐ ܐܟܕܝܐ</rdfs:label>
+    <rdfs:label xml:lang="bn">আক্কাদীয় ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ta">அக்காத் மொழி</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอัคคาเดีย</rdfs:label>
+    <rdfs:label xml:lang="ka">აქადური ენა</rdfs:label>
+    <rdfs:label xml:lang="ja">アッカド語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿卡德語</rdfs:label>
+    <rdfs:label xml:lang="ko">아카드어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Akkadian_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#akk"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f8000000000062c0c"/>
+    <owl:sameAs rdf:resource="http://sw.opencyc.org/2008/06/10/concept/Mx4rvVjNHpwpEbGdrcN5Y29ycA"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ale"
+                   lingvoj:iso2b="ale"
+                   lingvoj:iso2t="ale"
+                   lingvoj:iso3="ale">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ale.rdf"/>
+    <rdfs:label xml:lang="ga">Ailiúitis</rdfs:label>
+    <rdfs:label xml:lang="en">Aleut language</rdfs:label>
+    <rdfs:label xml:lang="de">Aleutische Sprache</rdfs:label>
+    <rdfs:label xml:lang="nn">Aleutisk språk</rdfs:label>
+    <rdfs:label xml:lang="no">Aleutisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Aleutiska</rdfs:label>
+    <rdfs:label xml:lang="ca">Aleutià</rdfs:label>
+    <rdfs:label xml:lang="fi">Aleutti</rdfs:label>
+    <rdfs:label xml:lang="is">Aleutíska</rdfs:label>
+    <rdfs:label xml:lang="sk">Aleutčina</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma aleutiano</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma aleutiano</rdfs:label>
+    <rdfs:label xml:lang="pl">Język aleucki</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua aleutiana</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua aleúte</rdfs:label>
+    <rdfs:label xml:lang="ru">Алеутский язык</rdfs:label>
+    <rdfs:label xml:lang="ka">ალეუტური ენა</rdfs:label>
+    <rdfs:label xml:lang="zh">阿留申语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Aleut_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ale"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/alg"
+                   lingvoj:iso2b="alg"
+                   lingvoj:iso2t="alg">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/alg.rdf"/>
+    <rdfs:label xml:lang="eo">Algonkena lingvaro</rdfs:label>
+    <rdfs:label xml:lang="hr">Algonkijski narodi i jezici</rdfs:label>
+    <rdfs:label xml:lang="hu">Algonkin nyelvcsalád</rdfs:label>
+    <rdfs:label xml:lang="de">Algonkin-Sprachen</rdfs:label>
+    <rdfs:label xml:lang="fi">Algonkin-kielet</rdfs:label>
+    <rdfs:label xml:lang="eo">Algonkina lingvaro</rdfs:label>
+    <rdfs:label xml:lang="is">Algonkinsk tungumál</rdfs:label>
+    <rdfs:label xml:lang="no">Algonkinske språk</rdfs:label>
+    <rdfs:label xml:lang="sv">Algonkinspråk</rdfs:label>
+    <rdfs:label xml:lang="nl">Algonkische talen</rdfs:label>
+    <rdfs:label xml:lang="en">Algonquian languages</rdfs:label>
+    <rdfs:label xml:lang="pl">Języki algonkińskie</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues algonquiennes</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas algonquinas</rdfs:label>
+    <rdfs:label xml:lang="pt">Línguas algonquinas</rdfs:label>
+    <rdfs:label xml:lang="ga">Teangacha Algóinciacha</rdfs:label>
+    <rdfs:label xml:lang="mg">Teny Algônkiana</rdfs:label>
+    <rdfs:label xml:lang="br">Yezhoù algonkek</rdfs:label>
+    <rdfs:label xml:lang="ru">Алгонкинские языки</rdfs:label>
+    <rdfs:label xml:lang="ja">アルゴンキン語族</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Algonquian_languages"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#alg"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/als"
+                   lingvoj:iso2b="gsw"
+                   lingvoj:iso2t="gsw"
+                   lingvoj:iso3="gsw">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/als.rdf"/>
+    <rdfs:label xml:lang="ca">Alamànic</rdfs:label>
+    <rdfs:label xml:lang="eo">Alemana lingvo</rdfs:label>
+    <rdfs:label xml:lang="hu">Alemann nyelvjárás</rdfs:label>
+    <rdfs:label xml:lang="cy">Alemanneg</rdfs:label>
+    <rdfs:label xml:lang="en">Alemannic German</rdfs:label>
+    <rdfs:label xml:lang="af">Alemanniese Duits</rdfs:label>
+    <rdfs:label xml:lang="fi">Alemannimurteet</rdfs:label>
+    <rdfs:label xml:lang="nl">Alemannisch</rdfs:label>
+    <rdfs:label xml:lang="de">Alemannische Dialekte</rdfs:label>
+    <rdfs:label xml:lang="no">Alemannisk</rdfs:label>
+    <rdfs:label xml:lang="is">Alemanníska</rdfs:label>
+    <rdfs:label xml:lang="hr">Alemanski jezik</rdfs:label>
+    <rdfs:label xml:lang="es">Alemánico</rdfs:label>
+    <rdfs:label xml:lang="gl">Alemánico</rdfs:label>
+    <rdfs:label xml:lang="cs">Alemánština</rdfs:label>
+    <rdfs:label xml:lang="pt">Alemão alemânico</rdfs:label>
+    <rdfs:label xml:lang="fr">Alémanique</rdfs:label>
+    <rdfs:label xml:lang="pl">Dialekt alemański</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Alemannica</rdfs:label>
+    <rdfs:label xml:lang="rm">Lingua alemana</rdfs:label>
+    <rdfs:label xml:lang="it">Tedesco alemanno</rdfs:label>
+    <rdfs:label xml:lang="br">Yezhoù alemanek</rdfs:label>
+    <rdfs:label xml:lang="el">Αλεμαννική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="ru">Алеманнское наречие</rdfs:label>
+    <rdfs:label xml:lang="he">אלמאנית</rdfs:label>
+    <rdfs:label xml:lang="am">አለማንኛ</rdfs:label>
+    <rdfs:label xml:lang="ja">アレマン語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿勒曼尼语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Alemannic_language"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/am"
+                   lingvoj:iso1="am"
+                   lingvoj:iso2b="amh"
+                   lingvoj:iso2t="amh"
+                   lingvoj:iso3="amh">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/am.rdf"/>
+    <rdfs:label xml:lang="ga">Amairis</rdfs:label>
+    <rdfs:label xml:lang="nl">Amhaars</rdfs:label>
+    <rdfs:label xml:lang="nds">Amhaarsch</rdfs:label>
+    <rdfs:label xml:lang="io">Amhara linguo</rdfs:label>
+    <rdfs:label xml:lang="eo">Amhara lingvo</rdfs:label>
+    <rdfs:label xml:lang="fi">Amharan kieli</rdfs:label>
+    <rdfs:label xml:lang="tr">Amharca</rdfs:label>
+    <rdfs:label xml:lang="br">Amhareg</rdfs:label>
+    <rdfs:label xml:lang="cy">Amhareg</rdfs:label>
+    <rdfs:label xml:lang="eu">Amharera</rdfs:label>
+    <rdfs:label xml:lang="et">Amhari keel</rdfs:label>
+    <rdfs:label xml:lang="en">Amharic</rdfs:label>
+    <rdfs:label xml:lang="yo">Amharic</rdfs:label>
+    <rdfs:label xml:lang="af">Amharies</rdfs:label>
+    <rdfs:label xml:lang="fr">Amharique</rdfs:label>
+    <rdfs:label xml:lang="de">Amharische Sprache</rdfs:label>
+    <rdfs:label xml:lang="da">Amharisk</rdfs:label>
+    <rdfs:label xml:lang="nn">Amharisk</rdfs:label>
+    <rdfs:label xml:lang="no">Amharisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Amhariska</rdfs:label>
+    <rdfs:label xml:lang="bs">Amharski jezik</rdfs:label>
+    <rdfs:label xml:lang="lv">Amharu valoda</rdfs:label>
+    <rdfs:label xml:lang="is">Amharíska</rdfs:label>
+    <rdfs:label xml:lang="sk">Amharčina</rdfs:label>
+    <rdfs:label xml:lang="cs">Amharština</rdfs:label>
+    <rdfs:label xml:lang="hsb">Amharšćina</rdfs:label>
+    <rdfs:label xml:lang="sl">Amharščina</rdfs:label>
+    <rdfs:label xml:lang="lt">Amharų kalba</rdfs:label>
+    <rdfs:label xml:lang="ca">Amhàric</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Amhar</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Amhara</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma amhárico</rdfs:label>
+    <rdfs:label xml:lang="pl">Język amharski</rdfs:label>
+    <rdfs:label xml:lang="sc">Limba amarica</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua amarica</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua amárica</rdfs:label>
+    <rdfs:label xml:lang="el">Αμχαρική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="cu">Амха́рьскъ ѩꙁꙑ́къ</rdfs:label>
+    <rdfs:label xml:lang="bg">Амхарски език</rdfs:label>
+    <rdfs:label xml:lang="mk">Амхарски јазик</rdfs:label>
+    <rdfs:label xml:lang="ru">Амхарский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Амхарська мова</rdfs:label>
+    <rdfs:label xml:lang="cu">Амхарьскъ ѩзыкъ</rdfs:label>
+    <rdfs:label xml:lang="he">אמהרית</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان امهاری</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أمهرية</rdfs:label>
+    <rdfs:label xml:lang="new">आम्हारिक भाषा</rdfs:label>
+    <rdfs:label xml:lang="bn">আমহারীয় ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ta">அம்ஹாரிய மொழி</rdfs:label>
+    <rdfs:label xml:lang="ka">ამჰარული ენა</rdfs:label>
+    <rdfs:label xml:lang="am">አማርኛ</rdfs:label>
+    <rdfs:label xml:lang="ti">ኣምሓረኛ ፊደል</rdfs:label>
+    <rdfs:label xml:lang="ja">アムハラ語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿姆哈拉语</rdfs:label>
+    <rdfs:label xml:lang="ko">암하라어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Amharic_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#am"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#amh"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/an"
+                   lingvoj:iso1="an"
+                   lingvoj:iso2b="arg"
+                   lingvoj:iso2t="arg"
+                   lingvoj:iso3="arg">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/an.rdf"/>
+    <rdfs:label xml:lang="eu">Aragoiera</rdfs:label>
+    <rdfs:label xml:lang="eo">Aragona lingvo</rdfs:label>
+    <rdfs:label xml:lang="fr">Aragonais</rdfs:label>
+    <rdfs:label xml:lang="tr">Aragonca</rdfs:label>
+    <rdfs:label xml:lang="li">Aragonees</rdfs:label>
+    <rdfs:label xml:lang="nl">Aragonees</rdfs:label>
+    <rdfs:label xml:lang="kw">Aragonek</rdfs:label>
+    <rdfs:label xml:lang="en">Aragonese language</rdfs:label>
+    <rdfs:label xml:lang="de">Aragonesische Sprache</rdfs:label>
+    <rdfs:label xml:lang="no">Aragonesisk</rdfs:label>
+    <rdfs:label xml:lang="se">Aragoniagiella</rdfs:label>
+    <rdfs:label xml:lang="fi">Aragonian kieli</rdfs:label>
+    <rdfs:label xml:lang="lv">Aragoniešu valoda</rdfs:label>
+    <rdfs:label xml:lang="gv">Aragonish</rdfs:label>
+    <rdfs:label xml:lang="da">Aragonisk (sprog)</rdfs:label>
+    <rdfs:label xml:lang="sv">Aragonska</rdfs:label>
+    <rdfs:label xml:lang="hr">Aragonski jezik</rdfs:label>
+    <rdfs:label xml:lang="ca">Aragonès</rdfs:label>
+    <rdfs:label xml:lang="ast">Aragonés</rdfs:label>
+    <rdfs:label xml:lang="oc">Aragonés</rdfs:label>
+    <rdfs:label xml:lang="cs">Aragonština</rdfs:label>
+    <rdfs:label xml:lang="nds">Aragoonsche Spraak</rdfs:label>
+    <rdfs:label xml:lang="ga">Aragóinis</rdfs:label>
+    <rdfs:label xml:lang="hu">Aragóniai nyelv</rdfs:label>
+    <rdfs:label xml:lang="is">Aragónska</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Aragon</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Aragones</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma aragonés</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma aragonés</rdfs:label>
+    <rdfs:label xml:lang="pl">Język aragoński</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba aragoneză</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Aragonica</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua aragonesa</rdfs:label>
+    <rdfs:label xml:lang="ia">Lingua aragonese</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua aragonese</rdfs:label>
+    <rdfs:label xml:lang="co">Lingua aragunesa</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua aragonesa</rdfs:label>
+    <rdfs:label xml:lang="mi">Reo Aragon</rdfs:label>
+    <rdfs:label xml:lang="ku">Zimanê aragonî</rdfs:label>
+    <rdfs:label xml:lang="cv">Арагон чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="bg">Арагонски език</rdfs:label>
+    <rdfs:label xml:lang="sr">Арагонски језик</rdfs:label>
+    <rdfs:label xml:lang="ru">Арагонский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Арагонська мова</rdfs:label>
+    <rdfs:label xml:lang="hy">Առագոներեն</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أراغونية</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอารากอน</rdfs:label>
+    <rdfs:label xml:lang="ja">アラゴン語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿拉贡语</rdfs:label>
+    <rdfs:label xml:lang="ko">아라곤어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Aragonese_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#an"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#arg"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f8000000000008588"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ang"
+                   lingvoj:iso2b="ang"
+                   lingvoj:iso2t="ang"
+                   lingvoj:iso3="ang">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ang.rdf"/>
+    <rdfs:label xml:lang="de">Altenglische Sprache</rdfs:label>
+    <rdfs:label xml:lang="da">Angelsaksisk</rdfs:label>
+    <rdfs:label xml:lang="nds">Angelsassische Sprake</rdfs:label>
+    <rdfs:label xml:lang="fr">Anglo-saxon (langue)</rdfs:label>
+    <rdfs:label xml:lang="eo">Anglosaksa lingvo</rdfs:label>
+    <rdfs:label xml:lang="oc">Anglosaxon</rdfs:label>
+    <rdfs:label xml:lang="ca">Anglès antic</rdfs:label>
+    <rdfs:label xml:lang="it">Antico inglese</rdfs:label>
+    <rdfs:label xml:lang="sco">Auld Inglis leid</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Inggris Kuna</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Inggris Kuno</rdfs:label>
+    <rdfs:label xml:lang="ang">Englisc sprǣc</rdfs:label>
+    <rdfs:label xml:lang="tr">Eski İngilizce</rdfs:label>
+    <rdfs:label xml:lang="sv">Fornengelska</rdfs:label>
+    <rdfs:label xml:lang="is">Fornenska</rdfs:label>
+    <rdfs:label xml:lang="no">Gammelengelsk</rdfs:label>
+    <rdfs:label xml:lang="nah">Huehcāuh Inglatlahtōlli</rdfs:label>
+    <rdfs:label xml:lang="nah">Huēhcāuh Inglatlahtōlli</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma anglosajón</rdfs:label>
+    <rdfs:label xml:lang="gl">Inglés antigo</rdfs:label>
+    <rdfs:label xml:lang="ast">Inglés antiguu</rdfs:label>
+    <rdfs:label xml:lang="pl">Język staroangielski</rdfs:label>
+    <rdfs:label xml:lang="sw">Kiingereza cha Kale</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba engleză veche</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Anglica Antiqua</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua inglesa antiga</rdfs:label>
+    <rdfs:label xml:lang="fi">Muinaisenglanti</rdfs:label>
+    <rdfs:label xml:lang="en">Old English language</rdfs:label>
+    <rdfs:label xml:lang="en">Old English</rdfs:label>
+    <rdfs:label xml:lang="nl">Oudengels</rdfs:label>
+    <rdfs:label xml:lang="lt">Senoji anglų kalba</rdfs:label>
+    <rdfs:label xml:lang="sl">Stara angleščina</rdfs:label>
+    <rdfs:label xml:lang="cs">Stará angličtina</rdfs:label>
+    <rdfs:label xml:lang="et">Vanainglise keel</rdfs:label>
+    <rdfs:label xml:lang="hu">Óangol nyelv</rdfs:label>
+    <rdfs:label xml:lang="el">Αρχαία αγγλική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="ru">Древнеанглийский язык</rdfs:label>
+    <rdfs:label xml:lang="os">Рагон англисаг æвзаг</rdfs:label>
+    <rdfs:label xml:lang="bg">Староанглийски език</rdfs:label>
+    <rdfs:label xml:lang="mk">Староанглиски јазик</rdfs:label>
+    <rdfs:label xml:lang="he">אנגלית עתיקה</rdfs:label>
+    <rdfs:label xml:lang="ar">إنجليزية عتيقة</rdfs:label>
+    <rdfs:label xml:lang="fa">انگلیسی قدیم</rdfs:label>
+    <rdfs:label xml:lang="bn">প্রাচীন ইংরেজি</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอังกฤษโบราณ</rdfs:label>
+    <rdfs:label xml:lang="am">ጥንታዊ እንግሊዝኛ</rdfs:label>
+    <rdfs:label xml:lang="ja">古英語</rdfs:label>
+    <rdfs:label xml:lang="zh">古英语</rdfs:label>
+    <rdfs:label xml:lang="ko">고대 영어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Anglo-Saxon_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ang"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/anp"
+                   lingvoj:iso2b="anp"
+                   lingvoj:iso2t="anp"
+                   lingvoj:iso3="anp">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/anp.rdf"/>
+    <rdfs:label xml:lang="en">Angika language</rdfs:label>
+    <rdfs:label xml:lang="es">Angika</rdfs:label>
+    <rdfs:label xml:lang="cs">Angičtina</rdfs:label>
+    <rdfs:label xml:lang="hi">अंगिका</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอังคิกา</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Angika"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/apa"
+                   lingvoj:iso2t="apa"
+                   lingvoj:iso3="apa">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/apa.rdf"/>
+    <rdfs:label xml:lang="da">Apache (sprog)</rdfs:label>
+    <rdfs:label xml:lang="de">Apache-Sprachen</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma apache</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues apaches</rdfs:label>
+    <rdfs:label xml:lang="it">Lingue apache</rdfs:label>
+    <rdfs:label xml:lang="lt">Pietų atapaskų kalbos</rdfs:label>
+    <rdfs:label xml:lang="en">Southern Athabaskan languages</rdfs:label>
+    <rdfs:label xml:lang="ga">Teangacha Atapascacha Deisceartacha</rdfs:label>
+    <rdfs:label xml:lang="br">Yezhoù atabaskek ar su</rdfs:label>
+    <rdfs:label xml:lang="zh">阿帕切语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Apachean_languages"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#apa"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ar"
+                   lingvoj:iso1="ar"
+                   lingvoj:iso2b="ara"
+                   lingvoj:iso2t="ara"
+                   lingvoj:iso3="ara">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ar.rdf"/>
+    <rdfs:label xml:lang="zh-min-nan">A-la-pek-gí</rdfs:label>
+    <rdfs:label xml:lang="et">Araabia keel</rdfs:label>
+    <rdfs:label xml:lang="nds">Araabsche Spraak</rdfs:label>
+    <rdfs:label xml:lang="hu">Arab nyelv</rdfs:label>
+    <rdfs:label xml:lang="kaa">Arab tili</rdfs:label>
+    <rdfs:label xml:lang="eo">Araba lingvo</rdfs:label>
+    <rdfs:label xml:lang="fr">Arabe (langue)</rdfs:label>
+    <rdfs:label xml:lang="fr">Arabe</rdfs:label>
+    <rdfs:label xml:lang="wa">Arabe</rdfs:label>
+    <rdfs:label xml:lang="cy">Arabeg</rdfs:label>
+    <rdfs:label xml:lang="kw">Arabek</rdfs:label>
+    <rdfs:label xml:lang="oc">Arabi</rdfs:label>
+    <rdfs:label xml:lang="fi">Arabian kieli</rdfs:label>
+    <rdfs:label xml:lang="io">Arabiana linguo</rdfs:label>
+    <rdfs:label xml:lang="en">Arabic language</rdfs:label>
+    <rdfs:label xml:lang="sco">Arabic</rdfs:label>
+    <rdfs:label xml:lang="eu">Arabiera</rdfs:label>
+    <rdfs:label xml:lang="af">Arabies</rdfs:label>
+    <rdfs:label xml:lang="ceb">Arabiko</rdfs:label>
+    <rdfs:label xml:lang="ang">Arabisc sprǣc</rdfs:label>
+    <rdfs:label xml:lang="li">Arabisch</rdfs:label>
+    <rdfs:label xml:lang="nl">Arabisch</rdfs:label>
+    <rdfs:label xml:lang="de">Arabische Sprache</rdfs:label>
+    <rdfs:label xml:lang="da">Arabisk (sprog)</rdfs:label>
+    <rdfs:label xml:lang="nn">Arabisk språk</rdfs:label>
+    <rdfs:label xml:lang="no">Arabisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Arabiska</rdfs:label>
+    <rdfs:label xml:lang="fo">Arabiskt (mál)</rdfs:label>
+    <rdfs:label xml:lang="nah">Arabitlahtōlli</rdfs:label>
+    <rdfs:label xml:lang="dsb">Arabska rěc</rdfs:label>
+    <rdfs:label xml:lang="bat-smg">Arabu kalba</rdfs:label>
+    <rdfs:label xml:lang="qu">Arabya simi</rdfs:label>
+    <rdfs:label xml:lang="fy">Arabysk</rdfs:label>
+    <rdfs:label xml:lang="is">Arabíska</rdfs:label>
+    <rdfs:label xml:lang="sk">Arabčina</rdfs:label>
+    <rdfs:label xml:lang="cs">Arabština</rdfs:label>
+    <rdfs:label xml:lang="hsb">Arabšćina</rdfs:label>
+    <rdfs:label xml:lang="sl">Arabščina</rdfs:label>
+    <rdfs:label xml:lang="lt">Arabų kalba</rdfs:label>
+    <rdfs:label xml:lang="ga">Araibis</rdfs:label>
+    <rdfs:label xml:lang="crh">Arap tili</rdfs:label>
+    <rdfs:label xml:lang="bs">Arapski jezik</rdfs:label>
+    <rdfs:label xml:lang="hr">Arapski jezik</rdfs:label>
+    <rdfs:label xml:lang="tr">Arapça</rdfs:label>
+    <rdfs:label xml:lang="se">Arábagiella</rdfs:label>
+    <rdfs:label xml:lang="lv">Arābu valoda</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Arab</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Arab</rdfs:label>
+    <rdfs:label xml:lang="jv">Basa Arab</rdfs:label>
+    <rdfs:label xml:lang="map-bms">Basa Arab</rdfs:label>
+    <rdfs:label xml:lang="su">Basa Arab</rdfs:label>
+    <rdfs:label xml:lang="sq">Gjuha arabe</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma arabe</rdfs:label>
+    <rdfs:label xml:lang="lad">Idioma arabo</rdfs:label>
+    <rdfs:label xml:lang="ast">Idioma Árabe</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma árabe</rdfs:label>
+    <rdfs:label xml:lang="pl">Język arabski</rdfs:label>
+    <rdfs:label xml:lang="sw">Kiarabu</rdfs:label>
+    <rdfs:label xml:lang="kg">Kilabu</rdfs:label>
+    <rdfs:label xml:lang="ln">Liarabi</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba arabă</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Arabica</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua araba</rdfs:label>
+    <rdfs:label xml:lang="ia">Lingua arabe</rdfs:label>
+    <rdfs:label xml:lang="lad">Lingua arábiga</rdfs:label>
+    <rdfs:label xml:lang="scn">Lingua àrabba</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua árabe</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua árabe</rdfs:label>
+    <rdfs:label xml:lang="kab">Taɛrabt</rdfs:label>
+    <rdfs:label xml:lang="vi">Tiếng Ả Rập</rdfs:label>
+    <rdfs:label xml:lang="tl">Wikang Arabe</rdfs:label>
+    <rdfs:label xml:lang="ku">Zimanê erebî</rdfs:label>
+    <rdfs:label xml:lang="ca">Àrab</rdfs:label>
+    <rdfs:label xml:lang="tt">Ğäräp tele</rdfs:label>
+    <rdfs:label xml:lang="az">Ərəb dili</rdfs:label>
+    <rdfs:label xml:lang="el">Αραβική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="ce">Іаьрбийн мотт</rdfs:label>
+    <rdfs:label xml:lang="cu">Ара́вьскъ ѩꙁꙑ́къ</rdfs:label>
+    <rdfs:label xml:lang="kv">Араб кыв</rdfs:label>
+    <rdfs:label xml:lang="sah">Араб тыла</rdfs:label>
+    <rdfs:label xml:lang="kk">Араб тілі</rdfs:label>
+    <rdfs:label xml:lang="os">Араббаг æвзаг</rdfs:label>
+    <rdfs:label xml:lang="mdf">Арабонь кяль</rdfs:label>
+    <rdfs:label xml:lang="bg">Арабски език</rdfs:label>
+    <rdfs:label xml:lang="ru">Арабский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Арабська мова</rdfs:label>
+    <rdfs:label xml:lang="cu">Аравьскъ ѩзыкъ</rdfs:label>
+    <rdfs:label xml:lang="cv">Арап чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="mk">Арапски јазик</rdfs:label>
+    <rdfs:label xml:lang="sr">Арапски језик</rdfs:label>
+    <rdfs:label xml:lang="tt">Гәрәп теле</rdfs:label>
+    <rdfs:label xml:lang="tg">Забони арабӣ</rdfs:label>
+    <rdfs:label xml:lang="hy">Արաբերեն</rdfs:label>
+    <rdfs:label xml:lang="he">ערבית</rdfs:label>
+    <rdfs:label xml:lang="ug">ئەرەب تىلى</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان عربی</rdfs:label>
+    <rdfs:label xml:lang="ps">عربي</rdfs:label>
+    <rdfs:label xml:lang="ur">عربی زبان</rdfs:label>
+    <rdfs:label xml:lang="fa">عربی</rdfs:label>
+    <rdfs:label xml:lang="ur">عربی</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة عربية</rdfs:label>
+    <rdfs:label xml:lang="arc">ܠܫܢܐ ܥܪܒܝܐ</rdfs:label>
+    <rdfs:label xml:lang="dv">ޢަރަބި</rdfs:label>
+    <rdfs:label xml:lang="hi">अरबी भाषा</rdfs:label>
+    <rdfs:label xml:lang="mr">अरबी भाषा</rdfs:label>
+    <rdfs:label xml:lang="new">अरबी भाषा</rdfs:label>
+    <rdfs:label xml:lang="bn">আরবি ভাষা</rdfs:label>
+    <rdfs:label xml:lang="pa">ਅਰਬੀ</rdfs:label>
+    <rdfs:label xml:lang="ta">அரபு மொழி</rdfs:label>
+    <rdfs:label xml:lang="te">అరబ్బీ భాష</rdfs:label>
+    <rdfs:label xml:lang="kn">ಅರಬ್ಬೀ ಭಾಷೆ</rdfs:label>
+    <rdfs:label xml:lang="ml">അറബി ഭാഷ</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอาหรับ</rdfs:label>
+    <rdfs:label xml:lang="lo">ພາສາອາຣັບ</rdfs:label>
+    <rdfs:label xml:lang="ka">არაბული ენა</rdfs:label>
+    <rdfs:label xml:lang="am">ዓረብኛ</rdfs:label>
+    <rdfs:label xml:lang="iu">ᐊᕋᕕ/aravi</rdfs:label>
+    <rdfs:label xml:lang="haw">‘Ōlelo ‘Alapia</rdfs:label>
+    <rdfs:label xml:lang="ja">アラビア語</rdfs:label>
+    <rdfs:label xml:lang="zh-yue">阿剌伯話</rdfs:label>
+    <rdfs:label xml:lang="zh">阿拉伯语</rdfs:label>
+    <rdfs:label xml:lang="ko">아랍어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Arabic_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#ar"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ara"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f80000000000043cb"/>
+    <owl:sameAs rdf:resource="http://sw.opencyc.org/2008/06/10/concept/Mx4rvVj5VZwpEbGdrcN5Y29ycA"/>
+    
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/arc"
+                   lingvoj:iso2b="arc"
+                   lingvoj:iso2t="arc"
+                   lingvoj:iso3="arc">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/arc.rdf"/>
+    <rdfs:label xml:lang="en">Assyrian Neo-Aramaic</rdfs:label>
+    <rdfs:label xml:lang="is">Assyríska</rdfs:label>
+    <rdfs:label xml:lang="br">Aturayeg</rdfs:label>
+    <rdfs:label xml:lang="es">Neoarameo asirio</rdfs:label>
+    <rdfs:label xml:lang="sv">Nyöstsyriska</rdfs:label>
+    <rdfs:label xml:lang="mk">Асириски неоарамејски јазик</rdfs:label>
+    <rdfs:label xml:lang="arc">ܠܫܢܐ ܣܘܪܝܝܐ</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอราเมอิกใหม่อัสซีเรีย</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Assyrian_Neo-Aramaic_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#arc"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/arp"
+                   lingvoj:iso2b="arp"
+                   lingvoj:iso2t="arp"
+                   lingvoj:iso3="arp">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/arp.rdf"/>
+    <rdfs:label xml:lang="fr">Arapaho (langue)</rdfs:label>
+    <rdfs:label xml:lang="en">Arapaho language</rdfs:label>
+    <rdfs:label xml:lang="fi">Arapaho</rdfs:label>
+    <rdfs:label xml:lang="br">Arapahoeg</rdfs:label>
+    <rdfs:label xml:lang="cs">Arapažština</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Arapaho_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#arp"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/arw"
+                   lingvoj:iso2b="arw"
+                   lingvoj:iso2t="arw"
+                   lingvoj:iso3="arw">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/arw.rdf"/>
+    <rdfs:label xml:lang="eo">Aravakeca lingvaro</rdfs:label>
+    <rdfs:label xml:lang="is">Aravakíska</rdfs:label>
+    <rdfs:label xml:lang="hr">Aravački narodi i jezici</rdfs:label>
+    <rdfs:label xml:lang="de">Arawak-Sprachen</rdfs:label>
+    <rdfs:label xml:lang="no">Arawak-språk</rdfs:label>
+    <rdfs:label xml:lang="nn">Arawak</rdfs:label>
+    <rdfs:label xml:lang="en">Arawakan languages</rdfs:label>
+    <rdfs:label xml:lang="no">Arawakspråk</rdfs:label>
+    <rdfs:label xml:lang="nl">Arawaktalen</rdfs:label>
+    <rdfs:label xml:lang="eo">Araŭakaj lingvoj</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Arawak</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues arawakiennes</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas arahuacas</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas arawakanas</rdfs:label>
+    <rdfs:label xml:lang="an">Luengas arawakanas</rdfs:label>
+    <rdfs:label xml:lang="pt">Línguas aruaques</rdfs:label>
+    <rdfs:label xml:lang="ru">Аравакские языки</rdfs:label>
+    <rdfs:label xml:lang="zh">阿拉瓦克语系</rdfs:label>
+    <rdfs:label xml:lang="zh">阿拉瓦语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Arawak_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#arw"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/as"
+                   lingvoj:iso1="as"
+                   lingvoj:iso2b="asm"
+                   lingvoj:iso2t="asm"
+                   lingvoj:iso3="asm">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/as.rdf"/>
+    <rdfs:label xml:lang="eo">Asama lingvo</rdfs:label>
+    <rdfs:label xml:lang="br">Asameg</rdfs:label>
+    <rdfs:label xml:lang="lv">Asamiešu valoda</rdfs:label>
+    <rdfs:label xml:lang="ast">Asamés</rdfs:label>
+    <rdfs:label xml:lang="lt">Asamų kalba</rdfs:label>
+    <rdfs:label xml:lang="fr">Assamais</rdfs:label>
+    <rdfs:label xml:lang="nl">Assamees</rdfs:label>
+    <rdfs:label xml:lang="en">Assamese language</rdfs:label>
+    <rdfs:label xml:lang="de">Assamesische Sprache</rdfs:label>
+    <rdfs:label xml:lang="da">Assamesisk</rdfs:label>
+    <rdfs:label xml:lang="no">Assamesisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Assamesiska</rdfs:label>
+    <rdfs:label xml:lang="is">Assameíska</rdfs:label>
+    <rdfs:label xml:lang="fi">Assami</rdfs:label>
+    <rdfs:label xml:lang="ca">Assamès</rdfs:label>
+    <rdfs:label xml:lang="hu">Asszámi nyelv</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Assam</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Assam</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma asamés</rdfs:label>
+    <rdfs:label xml:lang="pl">Język assamski</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua assamese</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua assamesa</rdfs:label>
+    <rdfs:label xml:lang="cs">Ásámština</rdfs:label>
+    <rdfs:label xml:lang="sr">Асамски језик</rdfs:label>
+    <rdfs:label xml:lang="ru">Ассамский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Ассамська мова</rdfs:label>
+    <rdfs:label xml:lang="he">אסאמית</rdfs:label>
+    <rdfs:label xml:lang="ur">آسامی زبان</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان آسامی</rdfs:label>
+    <rdfs:label xml:lang="hi">असमिया</rdfs:label>
+    <rdfs:label xml:lang="sa">असमिया</rdfs:label>
+    <rdfs:label xml:lang="mr">आसामी भाषा</rdfs:label>
+    <rdfs:label xml:lang="new">आसामी भाषा</rdfs:label>
+    <rdfs:label xml:lang="as">অসমীয়া ভাষা আৰু লিপি</rdfs:label>
+    <rdfs:label xml:lang="bn">অসমীয়া ভাষা</rdfs:label>
+    <rdfs:label xml:lang="gu">આસામીઝ ભાષા</rdfs:label>
+    <rdfs:label xml:lang="ta">அசாமிய மொழி</rdfs:label>
+    <rdfs:label xml:lang="te">అస్సామీ భాష</rdfs:label>
+    <rdfs:label xml:lang="kn">ಅಸ್ಸಾಮಿ</rdfs:label>
+    <rdfs:label xml:lang="ml">ആസ്സാമീസ്</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอัสสัม</rdfs:label>
+    <rdfs:label xml:lang="ka">ასამური ენა</rdfs:label>
+    <rdfs:label xml:lang="ja">アッサム語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿萨姆语</rdfs:label>
+    <rdfs:label xml:lang="ko">아삼어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Assamese_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#as"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#asm"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f800000000014ebd9"/>
+    <owl:sameAs rdf:resource="http://sw.opencyc.org/2008/06/10/concept/Mx4rvVjPOpwpEbGdrcN5Y29ycA"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ast"
+                   lingvoj:iso2b="ast"
+                   lingvoj:iso2t="ast"
+                   lingvoj:iso3="ast">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ast.rdf"/>
+    <rdfs:label xml:lang="br">Astureg</rdfs:label>
+    <rdfs:label xml:lang="eo">Asturia lingvo</rdfs:label>
+    <rdfs:label xml:lang="li">Asturiaans</rdfs:label>
+    <rdfs:label xml:lang="se">Asturiagiella</rdfs:label>
+    <rdfs:label xml:lang="fi">Asturian kieli</rdfs:label>
+    <rdfs:label xml:lang="en">Asturian language</rdfs:label>
+    <rdfs:label xml:lang="oc">Asturian</rdfs:label>
+    <rdfs:label xml:lang="no">Asturiansk</rdfs:label>
+    <rdfs:label xml:lang="ast">Asturianu</rdfs:label>
+    <rdfs:label xml:lang="fr">Asturien</rdfs:label>
+    <rdfs:label xml:lang="eu">Asturiera</rdfs:label>
+    <rdfs:label xml:lang="af">Asturies</rdfs:label>
+    <rdfs:label xml:lang="nl">Asturisch</rdfs:label>
+    <rdfs:label xml:lang="de">Asturische Sprache</rdfs:label>
+    <rdfs:label xml:lang="sv">Asturiska</rdfs:label>
+    <rdfs:label xml:lang="hr">Asturleonski jezik</rdfs:label>
+    <rdfs:label xml:lang="hr">Asturski jezik</rdfs:label>
+    <rdfs:label xml:lang="tr">Asturyasça</rdfs:label>
+    <rdfs:label xml:lang="kw">Asturyek</rdfs:label>
+    <rdfs:label xml:lang="cs">Asturština</rdfs:label>
+    <rdfs:label xml:lang="nds">Astuursche Spraak</rdfs:label>
+    <rdfs:label xml:lang="cy">Astwrieg</rdfs:label>
+    <rdfs:label xml:lang="is">Astúríska</rdfs:label>
+    <rdfs:label xml:lang="sk">Astúrčina</rdfs:label>
+    <rdfs:label xml:lang="lv">Astūriešu valoda</rdfs:label>
+    <rdfs:label xml:lang="hu">Asztúriai nyelv</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Asturia</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Asturia</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma asturiano</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma asturiano</rdfs:label>
+    <rdfs:label xml:lang="pl">Język asturyjski</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba asturiană</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Asturiana</rdfs:label>
+    <rdfs:label xml:lang="co">Lingua asturiana</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua asturiana</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua asturiana</rdfs:label>
+    <rdfs:label xml:lang="scn">Lingua asturiana</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua asturiana</rdfs:label>
+    <rdfs:label xml:lang="el">Αστουριανή γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="ru">Астурийский язык</rdfs:label>
+    <rdfs:label xml:lang="sr">Астуријски језик</rdfs:label>
+    <rdfs:label xml:lang="hy">Աստուրիերեն</rdfs:label>
+    <rdfs:label xml:lang="he">אסטורית</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أستورية</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอัสตูเรียส</rdfs:label>
+    <rdfs:label xml:lang="ja">アストゥリア語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿斯图里亚斯语</rdfs:label>
+    <rdfs:label xml:lang="ko">아스투리아스어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Asturian_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ast"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ath"
+                   lingvoj:iso2t="ath"
+                   lingvoj:iso3="ath">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ath.rdf"/>
+    <rdfs:label xml:lang="eo">Atabaska lingvaro</rdfs:label>
+    <rdfs:label xml:lang="tr">Atabaşkan Dilleri</rdfs:label>
+    <rdfs:label xml:lang="lt">Atapaskų kalbos</rdfs:label>
+    <rdfs:label xml:lang="fi">Athabasca-kielet</rdfs:label>
+    <rdfs:label xml:lang="en">Athabaskan languages</rdfs:label>
+    <rdfs:label xml:lang="hr">Athabaskanski narodi i jezici</rdfs:label>
+    <rdfs:label xml:lang="nl">Athabaskische talen</rdfs:label>
+    <rdfs:label xml:lang="sv">Athabaskiska språk</rdfs:label>
+    <rdfs:label xml:lang="de">Athapaskische Sprachen</rdfs:label>
+    <rdfs:label xml:lang="pl">Języki atapaskańskie</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues athapascanes</rdfs:label>
+    <rdfs:label xml:lang="oc">Lengas atabascanas</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas atabascanas</rdfs:label>
+    <rdfs:label xml:lang="gl">Linguas atapascanas</rdfs:label>
+    <rdfs:label xml:lang="it">Lingue athabaska</rdfs:label>
+    <rdfs:label xml:lang="an">Luengas atapascas</rdfs:label>
+    <rdfs:label xml:lang="pt">Línguas atabascanas</rdfs:label>
+    <rdfs:label xml:lang="ga">Teangacha Atapascacha</rdfs:label>
+    <rdfs:label xml:lang="mk">Атабаскански јазици</rdfs:label>
+    <rdfs:label xml:lang="ru">Атабаскские языки</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان\u200cهای آتاباسکی</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Athapascan_languages"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ath"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/aus"
+                   lingvoj:iso2t="aus"
+                   lingvoj:iso3="aus">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/aus.rdf"/>
+    <rdfs:label xml:lang="lt">Australijos aborigenų kalbos</rdfs:label>
+    <rdfs:label xml:lang="de">Australische Sprachen</rdfs:label>
+    <rdfs:label xml:lang="nl">Australische talen</rdfs:label>
+    <rdfs:label xml:lang="sv">Australiska språk</rdfs:label>
+    <rdfs:label xml:lang="nn">Australske språk</rdfs:label>
+    <rdfs:label xml:lang="no">Australske språk</rdfs:label>
+    <rdfs:label xml:lang="hu">Ausztráliai nyelvek</rdfs:label>
+    <rdfs:label xml:lang="eo">Aŭstralia lingvaro</rdfs:label>
+    <rdfs:label xml:lang="en">Indigenous Australian languages</rdfs:label>
+    <rdfs:label xml:lang="pl">Języki australijskie</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues aborigènes d'Australie</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues aborigènes d'Australie</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas aborígenes australianas</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas aborígenes de Australia</rdfs:label>
+    <rdfs:label xml:lang="la">Linguae Australianae</rdfs:label>
+    <rdfs:label xml:lang="it">Lingue aborigene australiane</rdfs:label>
+    <rdfs:label xml:lang="it">Lingue australiane aborigene</rdfs:label>
+    <rdfs:label xml:lang="ca">Llengües australianes</rdfs:label>
+    <rdfs:label xml:lang="an">Luengas australianas</rdfs:label>
+    <rdfs:label xml:lang="ru">Австралийские языки</rdfs:label>
+    <rdfs:label xml:lang="uk">Австралійські мови</rdfs:label>
+    <rdfs:label xml:lang="bn">অস্ট্রেলীয় আদিবাসী ভাষাসমূহ</rdfs:label>
+    <rdfs:label xml:lang="ja">オーストラリア・アボリジニ諸語</rdfs:label>
+    <rdfs:label xml:lang="ko">오스트레일리아 원주민 언어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Australian_languages"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#aus"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/av"
+                   lingvoj:iso1="av"
+                   lingvoj:iso2b="ava"
+                   lingvoj:iso2t="ava"
+                   lingvoj:iso3="ava">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/av.rdf"/>
+    <rdfs:label xml:lang="en">Avaric language</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Avaric_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#av"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ava"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/awa"
+                   lingvoj:iso2b="awa"
+                   lingvoj:iso2t="awa"
+                   lingvoj:iso3="awa">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/awa.rdf"/>
+    <rdfs:label xml:lang="nn">Avadhi</rdfs:label>
+    <rdfs:label xml:lang="br">Awadeg</rdfs:label>
+    <rdfs:label xml:lang="en">Awadhi language</rdfs:label>
+    <rdfs:label xml:lang="fr">Awadhi</rdfs:label>
+    <rdfs:label xml:lang="hi">अवधी</rdfs:label>
+    <rdfs:label xml:lang="ta">அவதி மொழி</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอวธี</rdfs:label>
+    <rdfs:label xml:lang="ja">アワディー語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿瓦德语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Awadhi_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#awa"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ay"
+                   lingvoj:iso1="ay"
+                   lingvoj:iso2b="aym"
+                   lingvoj:iso2t="aym"
+                   lingvoj:iso3="aym">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ay.rdf"/>
+    <rdfs:label xml:lang="ca">Aimara</rdfs:label>
+    <rdfs:label xml:lang="eu">Aimara</rdfs:label>
+    <rdfs:label xml:lang="fr">Aimara</rdfs:label>
+    <rdfs:label xml:lang="fi">Aimaran kieli</rdfs:label>
+    <rdfs:label xml:lang="nah">Aimaratlahtōlli</rdfs:label>
+    <rdfs:label xml:lang="gn">Aimarañe'ẽ</rdfs:label>
+    <rdfs:label xml:lang="gn">Aimarañe'ẽ</rdfs:label>
+    <rdfs:label xml:lang="bat-smg">Aimaru kalba</rdfs:label>
+    <rdfs:label xml:lang="lv">Aimaru valoda</rdfs:label>
+    <rdfs:label xml:lang="lt">Aimarų kalba</rdfs:label>
+    <rdfs:label xml:lang="eo">Ajmara lingvo</rdfs:label>
+    <rdfs:label xml:lang="hr">Ajmarski jezik</rdfs:label>
+    <rdfs:label xml:lang="cs">Ajmarština</rdfs:label>
+    <rdfs:label xml:lang="sl">Ajmarščina</rdfs:label>
+    <rdfs:label xml:lang="ay">Aymar aru</rdfs:label>
+    <rdfs:label xml:lang="nds">Aymara (Spraak)</rdfs:label>
+    <rdfs:label xml:lang="de">Aymara (Sprache)</rdfs:label>
+    <rdfs:label xml:lang="da">Aymara (sprog)</rdfs:label>
+    <rdfs:label xml:lang="no">Aymara (språk)</rdfs:label>
+    <rdfs:label xml:lang="sv">Aymara (språk)</rdfs:label>
+    <rdfs:label xml:lang="nl">Aymara (taal)</rdfs:label>
+    <rdfs:label xml:lang="nv">Aymara bizaad</rdfs:label>
+    <rdfs:label xml:lang="en">Aymara language</rdfs:label>
+    <rdfs:label xml:lang="qu">Aymara simi</rdfs:label>
+    <rdfs:label xml:lang="fr">Aymara</rdfs:label>
+    <rdfs:label xml:lang="nn">Aymara</rdfs:label>
+    <rdfs:label xml:lang="wa">Aymara</rdfs:label>
+    <rdfs:label xml:lang="io">Aymarana linguo</rdfs:label>
+    <rdfs:label xml:lang="br">Aymareg</rdfs:label>
+    <rdfs:label xml:lang="is">Aímaríska</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Aymara</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Aymara</rdfs:label>
+    <rdfs:label xml:lang="sq">Gjuha aymara</rdfs:label>
+    <rdfs:label xml:lang="an">Idioma aimara</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma aimara</rdfs:label>
+    <rdfs:label xml:lang="pl">Język ajmara</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua aimara</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua aimará</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua aymara</rdfs:label>
+    <rdfs:label xml:lang="ast">Llingua aymara</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua aimará</rdfs:label>
+    <rdfs:label xml:lang="uk">Аймара (мова)</rdfs:label>
+    <rdfs:label xml:lang="ru">Аймара (язык)</rdfs:label>
+    <rdfs:label xml:lang="bg">Аймара</rdfs:label>
+    <rdfs:label xml:lang="os">Аймараг æвзаг</rdfs:label>
+    <rdfs:label xml:lang="sr">Ајмара (језик)</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أيمارا</rdfs:label>
+    <rdfs:label xml:lang="mr">आयमारा भाषा</rdfs:label>
+    <rdfs:label xml:lang="bn">আইমারা ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ja">アイマラ語</rdfs:label>
+    <rdfs:label xml:lang="zh">艾馬拉語</rdfs:label>
+    <rdfs:label xml:lang="ko">아이마라어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Aymara_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#ay"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#aym"/>
+    <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/guid.9202a8c04000641f80000000001e9736"/>
+    <owl:sameAs rdf:resource="http://sw.opencyc.org/2008/06/10/concept/Mx4rvVi_u5wpEbGdrcN5Y29ycA"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/az"
+                   lingvoj:iso1="az"
+                   lingvoj:iso2b="aze"
+                   lingvoj:iso2t="aze"
+                   lingvoj:iso3="aze">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/az.rdf"/>
+    <rdfs:label xml:lang="ga">Asarbaiseáinis</rdfs:label>
+    <rdfs:label xml:lang="nds">Aserbaidschaansche Spraak</rdfs:label>
+    <rdfs:label xml:lang="de">Aserbaidschanische Sprache</rdfs:label>
+    <rdfs:label xml:lang="et">Aserbaidžaani keel</rdfs:label>
+    <rdfs:label xml:lang="cy">Aserbaijaneg</rdfs:label>
+    <rdfs:label xml:lang="no">Aserbajdsjansk</rdfs:label>
+    <rdfs:label xml:lang="is">Aserbaídsjanska</rdfs:label>
+    <rdfs:label xml:lang="li">Azerbaidzjaans</rdfs:label>
+    <rdfs:label xml:lang="lt">Azerbaidžaniečių kalba</rdfs:label>
+    <rdfs:label xml:lang="lv">Azerbaidžāņu valoda</rdfs:label>
+    <rdfs:label xml:lang="en">Azerbaijani language</rdfs:label>
+    <rdfs:label xml:lang="sco">Azerbaijani leid</rdfs:label>
+    <rdfs:label xml:lang="sv">Azerbajdzjanska</rdfs:label>
+    <rdfs:label xml:lang="eo">Azerbajĝana lingvo</rdfs:label>
+    <rdfs:label xml:lang="crh">Azerbaycan tili</rdfs:label>
+    <rdfs:label xml:lang="br">Azereg (yezh)</rdfs:label>
+    <rdfs:label xml:lang="nl">Azeri (taal)</rdfs:label>
+    <rdfs:label xml:lang="hu">Azeri nyelv</rdfs:label>
+    <rdfs:label xml:lang="da">Azeri</rdfs:label>
+    <rdfs:label xml:lang="nl">Azeri</rdfs:label>
+    <rdfs:label xml:lang="tr">Azerice</rdfs:label>
+    <rdfs:label xml:lang="fi">Azerin kieli</rdfs:label>
+    <rdfs:label xml:lang="ast">Azerí</rdfs:label>
+    <rdfs:label xml:lang="fr">Azéri</rdfs:label>
+    <rdfs:label xml:lang="az">Azərbaycan dili</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Azeri</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Azeri</rdfs:label>
+    <rdfs:label xml:lang="sq">Gjuha azerbajxhane</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma azerí</rdfs:label>
+    <rdfs:label xml:lang="pl">Język azerski</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba azeră</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Atropatenica</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua azera</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua azerí</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua azeri</rdfs:label>
+    <rdfs:label xml:lang="ca">Àzeri</rdfs:label>
+    <rdfs:label xml:lang="cs">Ázerbájdžánština</rdfs:label>
+    <rdfs:label xml:lang="el">Αζερική γλώσσα</rdfs:label>
+    <rdfs:label xml:lang="os">Азербайджайнаг æвзаг</rdfs:label>
+    <rdfs:label xml:lang="cv">Азербайджан чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="bg">Азербайджански език</rdfs:label>
+    <rdfs:label xml:lang="ru">Азербайджанский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Азербайджанська мова</rdfs:label>
+    <rdfs:label xml:lang="ky">Азербайжан тили</rdfs:label>
+    <rdfs:label xml:lang="mk">Азербејџански јазик</rdfs:label>
+    <rdfs:label xml:lang="tg">Забони озарбойҷонӣ</rdfs:label>
+    <rdfs:label xml:lang="he">אזרית</rdfs:label>
+    <rdfs:label xml:lang="fa">ترکی آذربایجانی</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان ترکی آذربایجانی</rdfs:label>
+    <rdfs:label xml:lang="ar">لغة أذرية</rdfs:label>
+    <rdfs:label xml:lang="bn">আজারবাইজানি ভাষা</rdfs:label>
+    <rdfs:label xml:lang="ta">அசர்பைஜான் மொழி</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาอาเซอร์ไบจาน</rdfs:label>
+    <rdfs:label xml:lang="ka">აზერბაიჯანული ენა</rdfs:label>
+    <rdfs:label xml:lang="ja">アゼルバイジャン語</rdfs:label>
+    <rdfs:label xml:lang="zh">阿塞拜疆语</rdfs:label>
+    <rdfs:label xml:lang="ko">아제르바이잔어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Azerbaijani_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#az"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#aze"/>
+    
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ba"
+                   lingvoj:iso1="ba"
+                   lingvoj:iso2b="bak"
+                   lingvoj:iso2t="bak"
+                   lingvoj:iso3="bak">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ba.rdf"/>
+    <rdfs:label xml:lang="fr">Bachkir</rdfs:label>
+    <rdfs:label xml:lang="br">Bachkireg</rdfs:label>
+    <rdfs:label xml:lang="id">Bahasa Bashkir</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Bashkir</rdfs:label>
+    <rdfs:label xml:lang="ca">Baixkir</rdfs:label>
+    <rdfs:label xml:lang="de">Baschkirische Sprache</rdfs:label>
+    <rdfs:label xml:lang="en">Bashkir language</rdfs:label>
+    <rdfs:label xml:lang="nl">Basjkiers</rdfs:label>
+    <rdfs:label xml:lang="sv">Basjkiriska</rdfs:label>
+    <rdfs:label xml:lang="da">Basjkirsk (sprog)</rdfs:label>
+    <rdfs:label xml:lang="nn">Basjkirsk språk</rdfs:label>
+    <rdfs:label xml:lang="no">Basjkirsk</rdfs:label>
+    <rdfs:label xml:lang="gl">Baskir</rdfs:label>
+    <rdfs:label xml:lang="hu">Baskír nyelv</rdfs:label>
+    <rdfs:label xml:lang="eo">Baŝkira lingvo</rdfs:label>
+    <rdfs:label xml:lang="tr">Başkurtça</rdfs:label>
+    <rdfs:label xml:lang="crh">Başqurt tili</rdfs:label>
+    <rdfs:label xml:lang="az">Başqırd dili</rdfs:label>
+    <rdfs:label xml:lang="fi">Baškiirin kieli</rdfs:label>
+    <rdfs:label xml:lang="cs">Baškirština</rdfs:label>
+    <rdfs:label xml:lang="sl">Baškirščina</rdfs:label>
+    <rdfs:label xml:lang="lt">Baškirų kalba</rdfs:label>
+    <rdfs:label xml:lang="lv">Baškīru valoda</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma baskir</rdfs:label>
+    <rdfs:label xml:lang="pl">Język baszkirski</rdfs:label>
+    <rdfs:label xml:lang="ro">Limba başchiră</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua baskir</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua baškira</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua bashkir</rdfs:label>
+    <rdfs:label xml:lang="bg">Башкирски език</rdfs:label>
+    <rdfs:label xml:lang="mk">Башкирски јазик</rdfs:label>
+    <rdfs:label xml:lang="ru">Башкирский язык</rdfs:label>
+    <rdfs:label xml:lang="uk">Башкирська мова</rdfs:label>
+    <rdfs:label xml:lang="myv">Башкирэнь кель</rdfs:label>
+    <rdfs:label xml:lang="cu">Башко́ртьскъ ѩꙁꙑ́къ</rdfs:label>
+    <rdfs:label xml:lang="tt">Башкорт теле</rdfs:label>
+    <rdfs:label xml:lang="cu">Башкортьскъ ѩзыкъ</rdfs:label>
+    <rdfs:label xml:lang="kk">Башқұрт тілі</rdfs:label>
+    <rdfs:label xml:lang="ba">Башҡорт теле</rdfs:label>
+    <rdfs:label xml:lang="cv">Пушкăрт чĕлхи</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان باشقیر</rdfs:label>
+    <rdfs:label xml:lang="hi">बाश्किर भाषा</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาบัชคีร์</rdfs:label>
+    <rdfs:label xml:lang="ja">バシキール語</rdfs:label>
+    <rdfs:label xml:lang="zh">巴什基尔语</rdfs:label>
+    <rdfs:label xml:lang="ko">바시키르어</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Bashkir_language"/>
+    <owl:sameAs rdf:resource="http://downlode.org/rdf/iso-639/languages#ba"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#bak"/>
+    
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/bad"
+                   lingvoj:iso2t="bad"
+                   lingvoj:iso3="bad">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/bad.rdf"/>
+    <rdfs:label xml:lang="en">Banda languages</rdfs:label>
+    <rdfs:label xml:lang="de">Banda-Sprachen</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Banda_languages"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#bad"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/bai"
+                   lingvoj:iso2t="bai"
+                   lingvoj:iso3="bai">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/bai.rdf"/>
+    <rdfs:label xml:lang="en">Bamileke languages</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues bamilékées</rdfs:label>
+    <rdfs:label xml:lang="pt">Línguas Bamileke</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Bamileke_languages"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#bai"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/bal"
+                   lingvoj:iso2b="bal"
+                   lingvoj:iso2t="bal"
+                   lingvoj:iso3="bal">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/bal.rdf"/>
+    <rdfs:label xml:lang="id">Bahasa Baluchi</rdfs:label>
+    <rdfs:label xml:lang="en">Balochi language</rdfs:label>
+    <rdfs:label xml:lang="br">Balotcheg</rdfs:label>
+    <rdfs:label xml:lang="fr">Baloutche</rdfs:label>
+    <rdfs:label xml:lang="ast">Baluchi</rdfs:label>
+    <rdfs:label xml:lang="sv">Baluchiska</rdfs:label>
+    <rdfs:label xml:lang="no">Balutsji (språk)</rdfs:label>
+    <rdfs:label xml:lang="eo">Baluĉa lingvo</rdfs:label>
+    <rdfs:label xml:lang="cs">Balúčština</rdfs:label>
+    <rdfs:label xml:lang="nl">Beloetsji (taal)</rdfs:label>
+    <rdfs:label xml:lang="hu">Beludzs nyelv</rdfs:label>
+    <rdfs:label xml:lang="de">Belutschische Sprache</rdfs:label>
+    <rdfs:label xml:lang="fi">Belutšin kieli</rdfs:label>
+    <rdfs:label xml:lang="ku">Belûçî</rdfs:label>
+    <rdfs:label xml:lang="pl">Język beludżi</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua baluchi</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua balúchi</rdfs:label>
+    <rdfs:label xml:lang="bg">Белуджки език</rdfs:label>
+    <rdfs:label xml:lang="ru">Белуджский язык</rdfs:label>
+    <rdfs:label xml:lang="tg">Забони балучӣ</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان بلوچی</rdfs:label>
+    <rdfs:label xml:lang="hi">बलूची भाषा</rdfs:label>
+    <rdfs:label xml:lang="ta">பலூச்சி மொழி</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาบาลูจิ</rdfs:label>
+    <rdfs:label xml:lang="ja">バローチー語</rdfs:label>
+    <rdfs:label xml:lang="zh">俾路支语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Baluchi_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#bal"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/ban"
+                   lingvoj:iso2b="ban"
+                   lingvoj:iso2t="ban"
+                   lingvoj:iso3="ban">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/ban.rdf"/>
+    <rdfs:label xml:lang="id">Bahasa Bali</rdfs:label>
+    <rdfs:label xml:lang="ms">Bahasa Bali</rdfs:label>
+    <rdfs:label xml:lang="eo">Balia lingvo</rdfs:label>
+    <rdfs:label xml:lang="fi">Balin kieli</rdfs:label>
+    <rdfs:label xml:lang="fr">Balinais (langue)</rdfs:label>
+    <rdfs:label xml:lang="nl">Balinees (taal)</rdfs:label>
+    <rdfs:label xml:lang="en">Balinese language</rdfs:label>
+    <rdfs:label xml:lang="yo">Balinese</rdfs:label>
+    <rdfs:label xml:lang="de">Balinesische Sprache</rdfs:label>
+    <rdfs:label xml:lang="no">Balinesisk</rdfs:label>
+    <rdfs:label xml:lang="sv">Balinesiska</rdfs:label>
+    <rdfs:label xml:lang="ca">Balinès</rdfs:label>
+    <rdfs:label xml:lang="jv">Basa Bali</rdfs:label>
+    <rdfs:label xml:lang="pl">Język balijski</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua balinese</rdfs:label>
+    <rdfs:label xml:lang="pt">Língua balinesa</rdfs:label>
+    <rdfs:label xml:lang="hi">बहासा बाली</rdfs:label>
+    <rdfs:label xml:lang="th">ภาษาบาหลี</rdfs:label>
+    <rdfs:label xml:lang="ja">バリ語</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Balinese_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#ban"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/bar"
+                   lingvoj:iso2b="bar">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/bar.rdf"/>
+    <rdfs:label xml:lang="en">Austro-Bavarian</rdfs:label>
+    <rdfs:label xml:lang="nds">Baiersch</rdfs:label>
+    <rdfs:label xml:lang="de">Bairische Dialekte</rdfs:label>
+    <rdfs:label xml:lang="nn">Bairisk</rdfs:label>
+    <rdfs:label xml:lang="no">Bairisk</rdfs:label>
+    <rdfs:label xml:lang="eo">Bavara lingvo</rdfs:label>
+    <rdfs:label xml:lang="it">Bavarese</rdfs:label>
+    <rdfs:label xml:lang="fr">Bavarois</rdfs:label>
+    <rdfs:label xml:lang="ca">Bavarès</rdfs:label>
+    <rdfs:label xml:lang="sv">Bayerska</rdfs:label>
+    <rdfs:label xml:lang="li">Beiers-Oosterieks</rdfs:label>
+    <rdfs:label xml:lang="nl">Beiers</rdfs:label>
+    <rdfs:label xml:lang="af">Beierse taal</rdfs:label>
+    <rdfs:label xml:lang="gl">Bávaro</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma bávaro</rdfs:label>
+    <rdfs:label xml:lang="pl">Język bawarski</rdfs:label>
+    <rdfs:label xml:lang="la">Lingua Bavarica</rdfs:label>
+    <rdfs:label xml:lang="it">Lingua bavarese</rdfs:label>
+    <rdfs:label xml:lang="gl">Lingua bávara</rdfs:label>
+    <rdfs:label xml:lang="br">Yezhoù aostriek-bavarek</rdfs:label>
+    <rdfs:label xml:lang="ja">バイエルン・オーストリア語</rdfs:label>
+    <rdfs:label xml:lang="zh">奥地利-巴伐利亚语</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Bavarian_language"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/bas"
+                   lingvoj:iso2b="bas"
+                   lingvoj:iso2t="bas"
+                   lingvoj:iso3="bas">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/bas.rdf"/>
+    <rdfs:label xml:lang="en">Basaa language</rdfs:label>
+    <rdfs:label xml:lang="br">Basaeg</rdfs:label>
+    <rdfs:label xml:lang="es">Idioma basaa</rdfs:label>
+    <rdfs:label xml:lang="pl">Język basaa</rdfs:label>
+    <owl:sameAs rdf:resource="http://dbpedia.org/resource/Basa_language"/>
+    <owl:sameAs rdf:resource="http://psi.oasis-open.org/iso/639/#bas"/>
+  </lingvoj:Lingvo>
+
+  <lingvoj:Lingvo rdf:about="http://www.lingvoj.org/lang/bat"
+                   lingvoj:iso2t="bat"
+                   lingvoj:iso3="bat">
+    <rdfs:isDefinedBy rdf:resource="http://www.lingvoj.org/lingvo/bat.rdf"/>
+    <rdfs:label xml:lang="id">Bahasa Baltik</rdfs:label>
+    <rdfs:label xml:lang="eo">Balta lingvaro</rdfs:label>
+    <rdfs:label xml:lang="et">Balti keeled</rdfs:label>
+    <rdfs:label xml:lang="en">Baltic languages</rdfs:label>
+    <rdfs:label xml:lang="af">Baltiese tale</rdfs:label>
+    <rdfs:label xml:lang="se">Baltijalaš gielat</rdfs:label>
+    <rdfs:label xml:lang="az">Baltik qrupu</rdfs:label>
+    <rdfs:label xml:lang="de">Baltische Sprachen</rdfs:label>
+    <rdfs:label xml:lang="nl">Baltische talen</rdfs:label>
+    <rdfs:label xml:lang="li">Baltische taole</rdfs:label>
+    <rdfs:label xml:lang="sv">Baltiska språk</rdfs:label>
+    <rdfs:label xml:lang="hsb">Baltiske rěče</rdfs:label>
+    <rdfs:label xml:lang="nn">Baltiske språk</rdfs:label>
+    <rdfs:label xml:lang="no">Baltiske språk</rdfs:label>
+    <rdfs:label xml:lang="hr">Baltički jezici</rdfs:label>
+    <rdfs:label xml:lang="is">Baltnesk tungumál</rdfs:label>
+    <rdfs:label xml:lang="sl">Baltski jeziki</rdfs:label>
+    <rdfs:label xml:lang="cs">Baltské jazyky</rdfs:label>
+    <rdfs:label xml:lang="sk">Baltské jazyky</rdfs:label>
+    <rdfs:label xml:lang="fi">Balttilaiset kielet</rdfs:label>
+    <rdfs:label xml:lang="bat-smg">Baltu kalbas</rdfs:label>
+    <rdfs:label xml:lang="lv">Baltu valodas</rdfs:label>
+    <rdfs:label xml:lang="lt">Baltų kalbos</rdfs:label>
+    <rdfs:label xml:lang="pl">Języki bałtyckie</rdfs:label>
+    <rdfs:label xml:lang="fr">Langues baltes</rdfs:label>
+    <rdfs:label xml:lang="es">Lenguas bálticas</rdfs:label>
+    <rdfs:label xml:lang="ro">Limbile baltice</rdfs:label>
+    <rdfs:label xml:lang="la">Linguae Balticae</rdfs:label>
+    <rdfs:label xml:lang="gl">Linguas bálticas</rdfs:label>
+    <rdfs:label xml:lang="it">Lingue baltiche</rdfs:label>
+    <rdfs:label xml:lang="ca">Llengües bàltiques</rdfs:label>
+    <rdfs:label xml:lang="an">Luengas balticas</rdfs:label>
+    <rdfs:label xml:lang="pt">Línguas bálticas</rdfs:label>
+    <rdfs:label xml:lang="vi">Nhóm ngôn ngữ gốc Balt</rdfs:label>
+    <rdfs:label xml:lang="ku">Zimanên baltî</rdfs:label>
+    <rdfs:label xml:lang="el">Βαλτικές γλώσσες</rdfs:label>
+    <rdfs:label xml:lang="bg">Балтийски езици</rdfs:label>
+    <rdfs:label xml:lang="ru">Балтийские языки</rdfs:label>
+    <rdfs:label xml:lang="mk">Балтички јазици</rdfs:label>
+    <rdfs:label xml:lang="be">Балтыйскія мовы</rdfs:label>
+    <rdfs:label xml:lang="uk">Балтійські мови</rdfs:label>
+    <rdfs:label xml:lang="tg">Забонҳои балтикӣ</rdfs:label>
+    <rdfs:label xml:lang="he">שפות בלטיות</rdfs:label>
+    <rdfs:label xml:lang="fa">زبان\u200cهای بالتیک</rdfs:label>
+    <rdfs:label xml:lang="ka">ბალტიკური ენები</rdfs:label>
+    <rdfs:label xml:lang="ja"

<TRUNCATED>

[50/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/LICENSE
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/LICENSE b/platform/accountcontrolpanel/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/accountcontrolpanel/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml
new file mode 100644
index 0000000..7a7b7f9
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.accountcontrolpanel</artifactId>
+        <version>0.10</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.accountcontrolpanel.core</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Account Control Panel Core</name>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.scala-tools</groupId>
+                <artifactId>maven-scala-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>testCompile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                                        <!-- <scalaVersion>${scala.version}</scalaVersion> -->
+                                        <!-- <args>
+                                                <arg>-target:jvm-1.5</arg>
+                                        </args> -->
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
+                        <Export-Package>org.apache.clerezza.platform.accountcontrolpanel.*</Export-Package>
+                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.xsite</groupId>
+                <artifactId>xsite-maven-plugin</artifactId>
+                <configuration>
+                    <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                    <sitemapPath>content/sitemap.xml</sitemapPath>
+                    <skinPath>templates/skin.html</skinPath>
+                    <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>pre-site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>                 
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.scala.utils</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.seedsnipe</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.users.core</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+          <groupId>org.scala-lang</groupId>
+          <artifactId>scala-library</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scala</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.accountcontrolpanel.ontologies</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.usermanager</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>ssl.keygen.base</artifactId>
+            <version>0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security.foafssl.ontologies</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.clerezza.ext</groupId>
+          <artifactId>slf4j-scala-api</artifactId>
+            <version>1.6.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stanbol</groupId>
+            <artifactId>org.apache.stanbol.commons.security.core</artifactId>
+            <version>0.11.0</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js
new file mode 100644
index 0000000..6d0803d
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js
@@ -0,0 +1,287 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/**
+ *
+ * Copyright (c) 2008-2010, The University of Manchester, United Kingdom. All
+ * rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. Neither the name of the The University of Manchester
+ * nor the names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Author........: Bruno Harbulot
+ *
+ */
+
+
+
+function createCsrCertEnroll(enrollFactObj, keylength) {
+	/*
+	 * Creates a CX509EnrollmentWebClassFactory (used to create all the other
+	 * objects).
+	 */
+	if (enrollFactObj == null) {
+		enrollFactObj = new ActiveXObject(
+			"X509Enrollment.CX509EnrollmentWebClassFactory");
+	}
+
+	/*
+	 * Load the information about the providers.
+	 */
+	var providerInfosObj = enrollFactObj
+	.CreateObject("X509Enrollment.CCspInformations");
+	providerInfosObj.AddAvailableCsps();
+
+	/*
+	 * Find the provider of RSA type (sufficient for this example). The type
+	 * numbers for this are 1, 2 and 24.
+	 * http://msdn.microsoft.com/en-us/library/aa379427%28VS.85%29.aspx
+	 */
+	var providerType = -1;
+	var providerName = null;
+	for ( var i = 0; i < providerInfosObj.Count; i++) {
+		var providerInfoObj = providerInfosObj.ItemByIndex(i);
+		switch (providerInfoObj.Type) {
+			case 1:
+			case 2:
+			case 24:
+				providerType = providerInfoObj.Type;
+				providerName = providerInfoObj.Name;
+				break;
+			default:
+		}
+	}
+
+	/*
+	 * Creates a 2048-bit key with this provider.
+	 */
+	var privKeyObj = enrollFactObj
+	.CreateObject("X509Enrollment.CX509PrivateKey");
+	privKeyObj.ProviderType = providerInfoObj.Type;
+	privKeyObj.KeySpec = 1;
+	privKeyObj.Length = keylength;
+	// http://msdn.microsoft.com/en-us/library/aa379024%28VS.85%29.aspx
+	privKeyObj.MachineContext = false;
+	// http://msdn.microsoft.com/en-us/library/aa379414%28VS.85%29.aspx
+	privKeyObj.KeyProtection = 2;
+	// http://msdn.microsoft.com/en-us/library/aa379002%28VS.85%29.aspx
+	privKeyObj.ExportPolicy = 1;
+
+	/*
+	 * Creates the PKCS#10 object and initialise as a user context.
+	 */
+	var pkcs10CsrObj = enrollFactObj
+	.CreateObject("X509Enrollment.CX509CertificateRequestPkcs10");
+	pkcs10CsrObj.InitializeFromPrivateKey(1, privKeyObj, "");
+
+	/*
+	 * Creates the enrolment object and exports the CSR.
+	 */
+	var enrollObj = enrollFactObj
+	.CreateObject("X509Enrollment.CX509Enrollment");
+	enrollObj.InitializeFromRequest(pkcs10CsrObj);
+	var csr = enrollObj.CreateRequest(1);
+	csr = "-----BEGIN CERTIFICATE REQUEST-----\r\n" + csr
+	+ "-----END CERTIFICATE REQUEST-----";
+
+	/*
+	 * Makes the request to the server.
+	 */
+    xmlHttpRequest = createRequest(csr);
+
+    /**
+	 * What to do on response
+	 */
+    xmlHttpRequest.onreadystatechange = function() {
+		if (xmlHttpRequest.readyState == 4) {
+			if (xmlHttpRequest.status == 200) {
+				/*
+				 * Installs the certificate.
+				 */
+				try {
+					enrollObj.InstallResponse(4, xmlHttpRequest.responseText,
+						0, "");
+					window.alert("A certificate has been installed.");
+				} catch (e1) {
+					try {
+						enrollObj.InstallResponse(0,
+							xmlHttpRequest.responseText, 0, "");
+						window.alert("A certificate has been installed.");
+					} catch (e2) {
+						window
+						.alert("You're probably using Vista without SP1 or above, in which case you need to add the certificate of this authority as a trusted root certificate (not recommended in general).");
+					}
+				}
+			} else {
+				window.alert("The server returned an error status: "
+					+ xmlHttpRequest.status);
+			}
+		}
+	}
+}
+
+
+function createRequest(csrString) {
+	var xmlHttpRequest = new XMLHttpRequest();
+
+	xmlHttpRequest.open("POST", kgnFloctn, true);
+
+	var params = "webId=" + encodeURIComponent(document.getElementById("webId").value);
+	params += "&cn=" + encodeURIComponent(document.getElementById("cn").value);
+	params += "&csr=" + encodeURIComponent(csrString);
+	params += "&days="+encodeURIComponent(document.getElementById("days").value);
+	params += "&hours="+encodeURIComponent(document.getElementById("hours").value);
+
+	xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+	xmlHttpRequest.setRequestHeader("Content-length", params.length);
+	xmlHttpRequest.setRequestHeader("Connection", "close");
+
+	xmlHttpRequest.send(params);
+
+	return xmlHttpRequest;
+
+}
+
+
+function createCsrXenroll(enrollObj, keylength) {
+	if (enrollObj == null) {
+		enrollObj = new ActiveXObject("CEnroll.CEnroll");
+	}
+
+	// http://msdn.microsoft.com/en-us/library/aa379941%28VS.85%29.aspx
+	// CRYPT_EXPORTABLE: 1?
+	enrollObj.GenKeyFlags = (keylength * 256 * 256) + 1;
+	enrollObj.KeySpec = 2;
+
+	var csr = enrollObj.createPKCS10("", "");
+	csr = "-----BEGIN CERTIFICATE REQUEST-----\r\n" + csr
+	+ "-----END CERTIFICATE REQUEST-----";
+
+	xmlHttpRequest = createRequest(csr);
+
+	xmlHttpRequest.onreadystatechange = function() {
+		if (xmlHttpRequest.readyState == 4) {
+			if (xmlHttpRequest.status == 200) {
+				enrollObj.acceptPKCS7(xmlHttpRequest.responseText);
+				window.alert("A certificate has been installed.");
+			} else {
+				window.alert("The server returned an error status: "
+					+ xmlHttpRequest.status);
+			}
+		}
+	}
+}
+
+function createCsr() {
+	var keystrengthSelectElem = document.getElementById("keylength");
+	var keylength = keystrengthSelectElem.value;
+
+	var enrollFactObj = null;
+	try {
+		enrollFactObj = new ActiveXObject(
+			"X509Enrollment.CX509EnrollmentWebClassFactory");
+	} catch (e) {
+	}
+
+	if (enrollFactObj != null) {
+		createCsrCertEnroll(enrollFactObj, keylength);
+	} else {
+		var enrollObj = null;
+		try {
+			enrollObj = new ActiveXObject("CEnroll.CEnroll");
+		} catch (e) {
+		}
+		if (enrollObj != null) {
+			createCsrXenroll(enrollObj, keylength);
+		} else {
+			window.alert("ActiveX certificate creation not supported or not enabled.");
+		}
+	}
+}
+// kgnFloctn needs to be calculated first
+var kgnFloctn = "errorKeyGenLoctn";
+function configurePage() {
+	kgnFloctn = document.getElementById("keygenform").getAttribute("action");
+
+	var keygenElem = document.getElementById("spkac");
+
+	if (navigator.appName == "Microsoft Internet Explorer") {
+		var keygenFormElem = document.getElementById("keygenform");
+		keygenFormElem.removeAttribute("action");
+		keygenFormElem.removeAttribute("method");
+
+		/*
+		 * Try the ActiveX approach, assume Internet Explorer.
+		 */
+
+		var iehelptextElem = document.getElementById("iehelptext");
+		iehelptextElem.style.display = "block";
+
+		var submitButtonElem = document.getElementById("keygensubmit");
+		var newSumbitButtonElem = document.createElement("input");
+		newSumbitButtonElem.setAttribute("type", "button");
+		newSumbitButtonElem.setAttribute("value", "Submit");
+		submitButtonElem.parentNode.replaceChild(newSumbitButtonElem,
+			submitButtonElem);
+		submitButtonElem = newSumbitButtonElem;
+
+		if (submitButtonElem.attachEvent) {
+			submitButtonElem.attachEvent("onclick", createCsr);
+		} else {
+			submitButtonElem.setAttribute("onclick", "createCsr()");
+		}
+
+		var keystrengthSelectElem = document.createElement("select");
+		keystrengthSelectElem.setAttribute("id", "keylength");
+		keystrengthSelectElem.setAttribute("name", "keylength");
+		var optionElem;
+		optionElem = document.createElement("option");
+		optionElem.setAttribute("value", "1024");
+		optionElem.appendChild(document.createTextNode("1024"));
+		keystrengthSelectElem.appendChild(optionElem);
+		optionElem = document.createElement("option");
+		optionElem.setAttribute("value", "2048");
+		optionElem.appendChild(document.createTextNode("2048"));
+		keystrengthSelectElem.appendChild(optionElem);
+		var keystrengthTdElem = document.getElementById("keystrenghtd");
+		keystrengthTdElem.appendChild(keystrengthSelectElem);
+	}
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js
new file mode 100644
index 0000000..6ad1db2
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+$(document).ready(function() {
+	$('#newWebIdButton').click(function() {
+		$("#newOrExistingSelection").css({display: "none"})
+		$("#createNewWebId").css({display: "block"})
+	});
+	$("#existingWebIdButton").click(function() {
+		$("#newOrExistingSelection").css({display: "none"})
+		$("#setExistingWebId").css({display: "block"})
+	});
+	$("#keygenform").submit(function() {
+		return spkacFix();
+	});
+});
+
+var crmfObject;
+function setCRMFRequest() {
+	var hiddenField = $("<input type=\"hidden\" name=\"crmf\" id=\"crmf\" \/>");
+	$("#keygenform").append(hiddenField)
+	//var formContents = $("#keygenform").serialize();
+	//var newContents = jQuery.extend({}, formContents);
+	hiddenField.val(crmfObject.request)
+	$("#keygenform").submit()
+}
+
+function spkacFix() {
+
+	if ($("#spkac").val()) {
+		return true;
+	} else {
+		if ($("#crmf").val()) {
+			return true;
+		}
+		//alert("fix needed by firefox in xhtml mode")
+		crmfObject = crypto.generateCRMFRequest(
+		'CN=Ignored',
+		"regToken", "authenticator", // not sure
+		null, // base-64 cert for key
+		// escrow. set this to null
+		"setCRMFRequest();", // callback
+		2048, null, "rsa-dual-use"); // key parameters
+		return false;
+	}
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css
new file mode 100644
index 0000000..64e52c4
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+#associateSelection {
+	width: 80%
+}
+#createNewWebId {
+	display: none
+}
+#setExistingWebId {
+	display: none
+}
+/* we need to override a table td:first-child in /style/table.css */
+td.propvalue:first-child { 
+	text-align: right;
+}
+
+td.formlabel:first-child { 
+	width: 10em;
+	text-align: right;
+}
+
+td.multiline:first-child {
+    vertical-align: text-top;
+}
+
+img.mugshot {
+    width: 80px;
+}
+
+td.personInABox {
+    width: 100px;
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
new file mode 100644
index 0000000..8e50481
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
@@ -0,0 +1,101 @@
+<?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.
+
+-->
+
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider"/>
+        </service>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider"/>
+    </scr:component>
+
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.platform.dashboard.GlobalMenuItemsProvider"/>
+        </service>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider"/>
+    </scr:component>
+
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel"/>
+        <service servicefactory="false">
+            <provide interface="java.lang.Object"/>
+        </service>
+        <property name="javax.ws.rs" type="Boolean" value="true"/>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel"/>
+        <reference name="configurationAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" cardinality="0..1" policy="dynamic" bind="bindConfigurationAdmin" unbind="unbindConfigurationAdmin"/>
+        <reference name="systemGraph" interface="org.apache.clerezza.rdf.core.MGraph" cardinality="1..1" policy="static" target="(name=urn:x-localinstance:/system.graph)" bind="bindSystemGraph" unbind="unbindSystemGraph"/>
+        <reference name="cgProvider" interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider" cardinality="1..1" policy="static" bind="bindCgProvider" unbind="unbindCgProvider"/>
+    </scr:component>
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.SettingsPanel">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.SettingsPanel"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
+        </service>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.SettingsPanel"/>
+    </scr:component>
+
+
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel"/>
+        <service servicefactory="false">
+            <provide interface="java.lang.Object"/>
+        </service>
+        <property name="javax.ws.rs" type="Boolean" value="true"/>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel"/>
+        <reference name="userManager" interface="org.apache.clerezza.platform.usermanager.UserManager"
+                   cardinality="1..1" policy="static" bind="bindUserManager" unbind="unbindUserManager"/>
+        <reference name="graphNodeProvider" interface="org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider"
+                   cardinality="1..1" policy="static" bind="bindGraphNodeProvider" unbind="unbindGraphNodeProvider"/>
+        <reference name="keygenSrvc" interface="org.apache.clerezza.ssl.keygen.KeygenService"
+                   cardinality="1..1" policy="static" bind="bindKeygenSrvc" unbind="unbindKeygenSrvc"/>
+        <reference name="webIdGraphsService" interface="org.apache.clerezza.platform.users.WebIdGraphsService"
+                   cardinality="1..1" policy="static" bind="bindWebIdGraphsService" unbind="unbindWebIdGraphsService"/>
+        <reference name="platformConfig" interface="org.apache.clerezza.platform.config.PlatformConfig"
+                   cardinality="1..1" policy="static" bind="bindPlatformConfig" unbind="unbindPlatformConfig"/>
+        <reference name="tcManager" interface="org.apache.clerezza.rdf.core.access.TcManager"
+                   cardinality="1..1" policy="static" bind="bindTcManager" unbind="unbindTcManager"/>
+    </scr:component>
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.ProfilePanel">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.ProfilePanel"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
+        </service>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.ProfilePanel"/>
+    </scr:component>
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.ContactConfirmRenderlet">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.ContactConfirmRenderlet"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
+        </service>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.ContactConfirmRenderlet"/>
+    </scr:component>
+    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.PersonBox">
+        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.PersonBox"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
+        </service>
+        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.PersonBox"/>
+    </scr:component>
+</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala
new file mode 100644
index 0000000..5d41410
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala
@@ -0,0 +1,75 @@
+/*
+ * 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.accountcontrolpanel
+
+import java.util.HashSet
+import java.util.Set
+import org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider
+import org.apache.clerezza.permissiondescriptions.PermissionDescripton
+import org.apache.felix.scr.annotations.Component
+import org.apache.felix.scr.annotations.Service
+
+/**
+ * <code>PermissionDescriptionsProvider</code> implementation that provides
+ * <code>PermissionDescripton</code>s of Account Control Panel permissions.
+ * The following permissions are described:
+ * <ul>
+ *   <li>org.apache.clerezza.platform.accountcontrolpanel.AccountControlPanelAppPermission</li>
+ *   <li>org.apache.clerezza.platform.accountcontrolpanel.ChangePasswordPermission</li>
+ *   <li>org.apache.clerezza.platform.accountcontrolpanel.UserBundlePermission</li>
+ * </ul>
+ *
+ * @author mir
+ */
+object AcpPermissionDescriptionsProvider {
+  private  val ACP_PERMISSION_DESCRIPTIONS: Set[PermissionDescripton] = new HashSet[PermissionDescripton]
+  ACP_PERMISSION_DESCRIPTIONS.add(
+    new PermissionDescripton("Change Own Password Permission",
+      "Grants permission to the user to change its own password",
+      null, classOf[ChangePasswordPermission],
+      "(org.apache.clerezza.platform.accountcontrolpanel.ChangePasswordPermission \"{username}\" \"\")"
+    )
+  )
+
+  ACP_PERMISSION_DESCRIPTIONS.add(
+    new PermissionDescripton("Access Own Account Control Panel Permission",
+      "Grants permission to the user to access its own Account Control Panel",
+      null, classOf[AccountControlPanelAppPermission],
+      "(org.apache.clerezza.platform.accountcontrolpanel.AccountControlPanelAppPermission \"{username}\" \"\")"
+    )
+  )
+
+  ACP_PERMISSION_DESCRIPTIONS.add(
+    new PermissionDescripton("Bundle Upload Permission",
+      "Grants permission to the user to upload a bundle",
+      null, classOf[AccountControlPanelAppPermission],
+      "(org.apache.clerezza.platform.accountcontrolpanel.UserBundlePermission \"{username}\" \"\")"
+    )
+  )
+
+}
+
+class AcpPermissionDescriptionsProvider extends PermissionDescriptionsProvider {
+
+  import AcpPermissionDescriptionsProvider._
+
+  def getPermissionDescriptors: Set[PermissionDescripton] = {
+    return ACP_PERMISSION_DESCRIPTIONS
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala
new file mode 100644
index 0000000..ce09780
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala
@@ -0,0 +1,71 @@
+/*
+ * 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.accountcontrolpanel
+
+import java.io.UnsupportedEncodingException
+import java.net.URLEncoder
+import java.security.AccessControlContext
+import java.security.AccessControlException
+import java.security.AccessController
+import java.security.Principal
+import java.security.PrivilegedActionException
+import java.security.PrivilegedExceptionAction
+import java.util.HashSet
+import java.util.Iterator
+import java.util.Set
+import javax.security.auth.Subject
+import org.apache.felix.scr.annotations.Component
+import org.apache.felix.scr.annotations.Service
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItem
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider
+import org.apache.stanbol.commons.security.UserUtil
+
+/**
+ *
+ * Provides menu-item to profile or settings-panel or none depending on user
+ * permissions.
+ *
+ * @author reto
+ */
+class MenuItemProvider extends GlobalMenuItemsProvider {
+  def getMenuItems: Set[GlobalMenuItem] = {
+    var items: Set[GlobalMenuItem] = new HashSet[GlobalMenuItem]
+    var userName: String = UserUtil.getCurrentUserName
+    if (userName != null) {
+      try {
+        AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
+      }
+      catch {
+        case e: AccessControlException => {
+          return items
+        }
+      }
+      try {
+        var path: String = "/user/" + URLEncoder.encode(userName, "utf-8") + "/control-panel"
+        items.add(new GlobalMenuItem(path, "ACP", "Account Control Panel", 5, "Administration"))
+      }
+      catch {
+        case e: UnsupportedEncodingException => {
+          throw new RuntimeException(e)
+        }
+      }
+    }
+    return items
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala
new file mode 100644
index 0000000..d46f9f1
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala
@@ -0,0 +1,466 @@
+/*
+ * 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.accountcontrolpanel
+
+import java.util.List
+import java.util.Arrays
+import java.util.Collections
+import java.util.Iterator
+import ontologies.CONTROLPANEL
+import org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider
+import org.apache.clerezza.ssl.keygen.CertSerialisation
+import org.apache.clerezza.ssl.keygen.Certificate
+import org.apache.clerezza.foafssl.ontologies.CERT
+import org.apache.clerezza.foafssl.ontologies.RSA
+import org.apache.clerezza.jaxrs.utils.RedirectUtil
+import org.apache.clerezza.jaxrs.utils.TrailingSlash
+import org.apache.clerezza.platform.config.PlatformConfig
+import org.apache.clerezza.platform.usermanager.UserManager
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.platform.Constants
+import access.TcManager
+import impl.{SimpleMGraph, TripleImpl}
+import org.apache.clerezza.rdf.utils.GraphNode
+import org.apache.clerezza.rdf.utils.UnionMGraph
+import org.osgi.service.component.ComponentContext
+import javax.ws.rs._
+import javax.ws.rs.core.Context
+import javax.ws.rs.core.MediaType
+import javax.ws.rs.core.Response
+import javax.ws.rs.core.UriInfo
+import java.math.BigInteger
+import java.security.AccessController
+import java.security.PrivilegedAction
+import java.security.interfaces.RSAPublicKey
+import org.apache.clerezza.ssl.keygen.KeygenService
+import java.net.URI
+import org.apache.clerezza.rdf.core.access.security.TcPermission
+import org.apache.clerezza.rdf.ontologies._
+import org.slf4j.scala.Logging
+import org.apache.clerezza.platform.users.{WebIdInfo, WebIdGraphsService}
+import org.apache.clerezza.rdf.scala.utils._
+
+/**
+ * Presents a panel where the user can create a webid and edit her profile.
+ *
+ * @author reto
+ */
+
+@Path("/user/{id}/profile")
+class ProfilePanel extends Logging {
+
+  import collection.JavaConversions._
+  import Preamble._
+
+  /**
+   * Returns a GraphNode describing a ProfilePage for the user identified by
+   * the specified UserName. A ProfilePage resourcve is retuned for any user
+   * disregarding if they have a WebId and if this is local. The renderlet
+   * may provide instrcutions on how a WebId is created for users that do
+   * not have a WebId and redirect them to their WebId provider if they have
+   * a remote WebId.
+   */
+  @GET
+  def getPersonalProfilePage(@Context uriInfo: UriInfo,
+                             @PathParam(value = "id") userName: String): GraphNode = {
+    TrailingSlash.enforceNotPresent(uriInfo)
+    //not checking as public profile must be public, more selective access control TBD
+    //AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
+    val resultNode= getPersonalProfile(userName, uriInfo)
+    return resultNode
+  }
+
+  private def getPersonalProfile(userName: String, info: UriInfo): GraphNode = {
+    lazy val suggestedPPDUri = getSuggestedPPDUri(userName)
+
+    val profile = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
+      def run: GraphNode = {
+        val userInSysGraph = userManager.getUserInSystemGraph(userName)
+        val userResource = userInSysGraph.getNode
+        val profile: GraphNode = userResource match {
+          case blank: BNode => {
+            //user does not have a webId yet
+            val g = new EzMGraph()
+            import g._
+            val profile = bnode
+            (profile -- CONTROLPANEL.isLocalProfile --> bool2lit(true)
+            -- CONTROLPANEL.suggestedPPDUri --> suggestedPPDUri
+            -- FOAF.primaryTopic --> (bnode -- PLATFORM.userName --> userName))
+            profile
+          }
+          case webid: UriRef => {
+            var webIDInfo = webIdGraphsService.getWebIdInfo(webid)
+            var res = new GraphNode(suggestedPPDUri, new UnionMGraph(new SimpleMGraph, webIDInfo.localPublicUserData))
+            (res -- CONTROLPANEL.isLocalProfile --> bool2lit(webIDInfo.isLocal)
+              -- FOAF.primaryTopic --> webid)
+            res
+          }
+        }
+        /*val friendInfo:Iterator[TripleCollection] = for (kn: Triple <- profile.getGraph.filter(userResource.asInstanceOf[NonLiteral], FOAF.knows, null)
+                              if kn.getObject.isInstanceOf[UriRef];
+                              friend = kn.getObject.asInstanceOf[UriRef]
+                              if (friend != suggestedPPDUri)
+        ) yield {
+          try {
+            val friendGraph = tcManager.getGraph(FoafBrowser.removeHash(friend))
+            new RichGraphNode(friend, friendGraph).getNodeContext
+          } catch {
+            case e => {
+              logger.warn("cought exception trying to fetch graph - these graphs should already be in store " + friend, e)
+              new EzMGraph() {
+                friend -- SKOS.note --> ("problem with fetching this node: " + e)
+              }
+            }
+          }
+        }
+        //vera bad: mixing data from different sources
+        for (g <- friendInfo) profile.getGraph.addAll(g) */
+        profile
+      }
+    })
+
+
+    (profile a   PLATFORM.HeadedPage
+             a  CONTROLPANEL.ProfilePage)
+  }
+
+  /**
+   * @param userName
+   * @return the suggested Personal Profile Document URI
+   */
+  def getSuggestedPPDUri(userName: String): UriRef = {
+    return new UriRef(platformConfig.getDefaultBaseUri.getUnicodeString + "user/" + userName + "/profile")
+  }
+
+  @POST
+  @Path("set-existing-webid")
+  def setExistingWebId(@Context uriInfo: UriInfo,
+                       @FormParam("webid") webId: UriRef,
+                       @PathParam(value = "id") userName: String): Response = {
+    AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
+    return AccessController.doPrivileged(new PrivilegedAction[Response] {
+      def run: Response = {
+        var userInSystemGraph: GraphNode = userManager.getUserInSystemGraph(userName)
+        userInSystemGraph.replaceWith(webId)
+        return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
+      }
+    })
+  }
+
+  @POST
+  @Path("create-new-web-id")
+  def createNewWebId(@Context uriInfo: UriInfo,
+                     @PathParam(value = "id") userName: String): Response = {
+    val ppd: UriRef = getSuggestedPPDUri(userName)
+    val webId: UriRef = new UriRef(ppd.getUnicodeString + "#me")
+    AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
+    return AccessController.doPrivileged(new PrivilegedAction[Response] {
+      def run: Response = {
+        userManager.assignPermissionsToUser(userName, java.util.Collections.singletonList(new TcPermission(
+            webId.getUnicodeString, TcPermission.READWRITE).toString))
+        tcManager.getTcAccessController.setRequiredReadPermissionStrings(
+          ppd, Collections.singleton(new TcPermission(
+              Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ).toString))
+        tcManager.createMGraph(ppd)
+        val webIDInfo = webIdGraphsService.getWebIdInfo(webId)
+        webIDInfo.localPublicUserData.addAll(
+          Arrays.asList(
+            new TripleImpl(ppd, RDF.`type`, FOAF.PersonalProfileDocument),
+            new TripleImpl(ppd, FOAF.primaryTopic, webId))
+        )
+        var userInSystemGraph: GraphNode = userManager.getUserInSystemGraph(userName)
+        userInSystemGraph.replaceWith(webId)
+        return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
+      }
+    })
+  }
+
+  /**
+   * Presents a confirmation form for adding a contact
+   */
+  @GET
+  @Path("addContact")
+  def addContactConfirm(@PathParam(value = "id") userName: String,
+    @QueryParam("contactWebId") contactWebId: UriRef): GraphNode = {
+    AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
+    val contactNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
+      def run = {
+        graphNodeProvider.get(contactWebId);
+      }
+    })
+    val resultGraph = new EzMGraph(new UnionMGraph(new SimpleMGraph, contactNode.getGraph))
+    import resultGraph._
+    val result: GraphNode = bnode
+    result a CONTROLPANEL.ContactConfirmPage
+    result -- FOAF.primaryTopic --> contactNode
+  }
+
+  @POST
+  @Path("addContact")
+  def addContact(@PathParam(value = "id") userName: String, @Context uriInfo: UriInfo,
+                 @FormParam("webId") newContacts: java.util.List[UriRef]): Response = {
+    import collection.JavaConversions._
+    if (newContacts.size > 0) {
+      var me: GraphNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
+        def run: GraphNode = {
+          return userManager.getUserGraphNode(userName)
+        }
+      })
+      for (contactWebID <- newContacts) {
+        val webIdGraphs = webIdGraphsService.getWebIdInfo(me.getNode.asInstanceOf[UriRef])
+        var meGrph: GraphNode = new GraphNode(me.getNode, webIdGraphs.localPublicUserData)
+        meGrph.addProperty(FOAF.knows, contactWebID)
+      } //todo: one should catch errors here (bad uris sent for ex
+    }
+    return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
+  }
+
+  /**
+   * Removes a contact
+   */
+  @POST
+  @Path("deleteContact")
+  def deleteContact(@PathParam(value = "id") userName: String, @Context uriInfo: UriInfo,
+                 @FormParam("contactWebId") contactWebId: UriRef): Response = {
+    import collection.JavaConversions._
+    var me: GraphNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
+      def run: GraphNode = {
+        return userManager.getUserGraphNode(userName)
+      }
+    })
+    val webIdGraphs = webIdGraphsService.getWebIdInfo(me.getNode.asInstanceOf[UriRef])
+    var meGrph: GraphNode = new GraphNode(me.getNode, webIdGraphs.localPublicUserData)
+    meGrph.deleteProperty(FOAF.knows, contactWebId)
+    return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
+  }
+
+  /**
+   * @parm webId: A list of WebIDs to be added as Subject Alternative Names
+   * @param cn Common Name, the name that usually appears in the certificate selection box
+   * @param spkac key request in format generated by  Netscape, Safari, Opera
+   * @param crmf hey request in format generated by M$ Explorer
+   * @param csr key request as generated by Javascript of Netscape
+   * @param hours the certificate should last  (hours and days add up)
+   * @param days the certificate should last
+   * @param comment a comment to be attached to the public key in the database
+   */
+  @POST
+  @Path("keygen")
+  def createCert(@FormParam("webId") webIds: java.util.List[URI],
+                 @FormParam("cn") commonName: String,
+                 @FormParam("spkac") spkac: String,
+                 @FormParam("crmf") crmf: String,
+                 @FormParam("csr") csr: String,
+                 @FormParam("hours") hours: String,
+                 @FormParam("days") days: String,
+                 @FormParam("comment") comment: String): Response = {
+    import scala.collection.JavaConversions._
+    var cert: Certificate = null
+    if (spkac != null && spkac.length > 0) {
+      cert = keygenSrvc.createFromSpkac(spkac)
+      if (cert == null) {
+        logger.warn("unable to create certificate from spkac request")
+      }
+    }
+    if (cert == null && crmf != null && crmf.length > 0) {
+      cert = keygenSrvc.createFromCRMF(crmf)
+      if (cert == null) {
+        logger.warn("unable to create certificate from crmf requrest :" + crmf)
+      }
+    }
+    if (cert == null && csr != null && csr.length > 0) {
+      cert = keygenSrvc.createFromPEM(csr)
+      if (cert == null) {
+        logger.warn("unable to create certificate from csr request :" + csr)
+      }
+    }
+    if (cert == null) {
+      throw new RuntimeException("The server was unable to create a certificate")
+    }
+    cert.setSubjectCommonName(commonName)
+    cert.addDurationInHours(hours)
+    cert.addDurationInDays(days)
+    cert.startEarlier("2")
+    for(san: URI<-webIds) {
+      cert.addSubjectAlternativeName(san.toString)
+    }
+    var ser: CertSerialisation = null
+    try {
+      ser = cert.getSerialisation
+    }
+    catch {
+      case ex: Exception => {
+        throw new RuntimeException(ex)
+      }
+    }
+    var pubKey: RSAPublicKey = cert.getSubjectPublicKey.getPublicKey.asInstanceOf[RSAPublicKey]
+    var publicExponent: BigInteger = pubKey.getPublicExponent
+    var modulus: BigInteger = pubKey.getModulus
+
+    for (webid: URI<-webIds
+         if (webid.getScheme=="https"||webid.getScheme=="http");
+          val webidRef = new UriRef(webid.toString);
+         val webIdInfo = webIdGraphsService.getWebIdInfo(webidRef);
+         if (webIdInfo.isLocal)
+    ) {
+      val certGraph = new EzMGraph(webIdInfo.localPublicUserData)
+      import certGraph._
+      val certNode = certGraph.bnode
+      ( (certNode a  RSA.RSAPublicKey)
+         -- CERT.identity -->  webidRef
+         -- RSA.modulus -->  modulus
+         -- RSA.public_exponent -->  publicExponent
+         -- DC.date -->  cert.getStartDate )
+      if (comment != null && comment.length > 0) {
+        certNode --  RDFS.comment -->  comment
+      }
+    }
+    var resBuild: Response.ResponseBuilder = Response.ok(ser.getContent, MediaType.valueOf(ser.getMimeType))
+    return resBuild.build
+  }
+
+  @POST
+  @Path("deletekey")
+  def deleteKey(@Context uriInfo: UriInfo,
+                @FormParam("webId") webId: UriRef,
+                @FormParam("keyhash") keys: List[String]): Response = {
+    val webIDInfo = webIdGraphsService.getWebIdInfo(webId)
+    val agent: GraphNode = new GraphNode(webId, webIDInfo.localPublicUserData)
+    var subjects: Iterator[GraphNode] = agent.getSubjectNodes(CERT.identity)
+    import scala.util.control.Breaks._
+    breakable {
+      import scala.collection.JavaConversions._
+      //to for loop through iterators
+      for (nl <- subjects) {
+        var modulusIt: Iterator[Resource] = nl.getObjects(RSA.modulus)
+        if (!modulusIt.hasNext) break
+        var modLit: Resource = modulusIt.next
+        if (modulusIt.hasNext) logger.warn("data error, a modulus too many in cert for " + webId)
+        if (!(modLit.isInstanceOf[TypedLiteral])) {
+          logger.warn("a public key has a modulus that is not a literal for " + webId)
+          break
+        }
+        var modulus: BigInteger = LiteralFactory.getInstance.createObject(classOf[BigInteger], modLit.asInstanceOf[TypedLiteral])
+        for (key <- keys) {
+          if (modulus.hashCode == Integer.decode(key)) {
+            nl.deleteNodeContext
+            break
+          }
+        }
+      }
+    }
+    return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
+  }
+
+  @POST
+  @Path("modify")
+  def modifyProfile(@Context uriInfo: UriInfo,
+                    @PathParam("id") userName: String,
+                    @FormParam("webId") webId: UriRef,
+                    @FormParam("name") name: String,
+                    @FormParam("description") description: String): Response = {
+    val webIDInfo = AccessController.doPrivileged(new PrivilegedAction[WebIdInfo] {
+      def run = {
+        webIdGraphsService.getWebIdInfo(webId)
+      }
+    })
+    val agent: GraphNode = new GraphNode(webId, webIDInfo.localPublicUserData)
+    agent.deleteProperties(FOAF.name)
+    agent.addPropertyValue(FOAF.name, name)
+    agent.deleteProperties(DC.description)
+    agent.addPropertyValue(DC.description, description)
+    logger.debug("local graph (uri: {}) is now of size {}".format(webIDInfo.webId, webIDInfo.localPublicUserData.size))
+    RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
+  }
+
+  protected def bindUserManager(usermanager: UserManager): Unit = {
+    userManager = usermanager
+  }
+
+  protected def unbindUserManager(usermanager: UserManager): Unit = {
+    if (userManager == usermanager) {
+      userManager = null
+    }
+  }
+
+  protected def bindGraphNodeProvider(graphNodeProvider: GraphNodeProvider): Unit = {
+    this.graphNodeProvider = graphNodeProvider
+  }
+
+  protected def unbindGraphNodeProvider(graphNodeProvider: GraphNodeProvider): Unit = {
+    this.graphNodeProvider = null
+  }
+
+  protected def bindKeygenSrvc(keygenservice: KeygenService): Unit = {
+    keygenSrvc = keygenservice
+  }
+
+  protected def unbindKeygenSrvc(keygenservice: KeygenService): Unit = {
+    if (keygenSrvc == keygenservice) {
+      keygenSrvc = null
+    }
+  }
+
+
+  protected def bindWebIdGraphsService(webidgraphsservice: WebIdGraphsService): Unit = {
+    webIdGraphsService = webidgraphsservice
+  }
+
+  protected def unbindWebIdGraphsService(webidgraphsservice: WebIdGraphsService): Unit = {
+    webIdGraphsService = null
+  }
+
+  protected def bindPlatformConfig(platformconfig: PlatformConfig): Unit = {
+    platformConfig = platformconfig
+  }
+
+  protected def unbindPlatformConfig(platformconfig: PlatformConfig): Unit = {
+    if (platformConfig == platformconfig) {
+      platformConfig = null
+    }
+  }
+
+  protected def bindTcManager(tcManager: TcManager) = {
+    this.tcManager = tcManager
+  }
+
+  protected def unbindTcManager(tcManager: TcManager) = {
+    this.tcManager = null
+  }
+
+  protected def activate(componentContext: ComponentContext): Unit = {
+    this.componentContext = componentContext
+  }
+
+
+  private var userManager: UserManager = null
+
+  private var graphNodeProvider: GraphNodeProvider = null
+
+  private var webIdGraphsService: WebIdGraphsService = null
+
+  private var keygenSrvc: KeygenService = null
+  private var platformConfig: PlatformConfig = null
+
+
+  private var componentContext: ComponentContext = null
+
+  private var tcManager: TcManager = null;
+
+}
\ No newline at end of file


[02/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java
deleted file mode 100644
index a92ff01..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java
+++ /dev/null
@@ -1,556 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider;
-import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.Status;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import org.apache.clerezza.jaxrs.utils.RedirectUtil;
-import org.apache.clerezza.platform.Constants;
-import org.apache.clerezza.platform.content.WebDavUtils.PropertyMap;
-import org.apache.clerezza.platform.content.collections.CollectionCreator;
-import org.apache.clerezza.platform.content.webdav.MKCOL;
-import org.apache.clerezza.platform.content.webdav.MOVE;
-import org.apache.clerezza.platform.content.webdav.PROPFIND;
-import org.apache.clerezza.platform.content.webdav.PROPPATCH;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.felix.scr.annotations.Services;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typehandlerspace.OPTIONS;
-import org.apache.clerezza.platform.typehandlerspace.SupportedTypes;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TripleCollection;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.HIERARCHY;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.utils.UnionMGraph;
-import org.apache.clerezza.rdf.utils.UriMutatingTripleCollection;
-import org.apache.clerezza.web.fileserver.util.MediaTypeGuesser;
-import org.osgi.service.component.ComponentContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This Class allows getting and putting content structured using the
- * Discobits ontology.
- *
- * Is an implementation of DiscobitsHandler and additionally registers as
- * TypeHanlder to allow HTTP GET and PUT.
- *
- * @author reto, tho, agron, mir
- */
-@Component(metatype=true)
-@Service({
-    Object.class,
-    DiscobitsHandler.class
-})
-@Property(name="org.apache.clerezza.platform.typehandler", boolValue=true)
-@Reference(name="metaDataGenerator",
-    policy=ReferencePolicy.DYNAMIC,
-    cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
-    referenceInterface=MetaDataGenerator.class
-)
-@SupportedTypes(types = { "http://www.w3.org/2000/01/rdf-schema#Resource" }, prioritize = false)
-public class DiscobitsTypeHandler extends AbstractDiscobitsHandler
-        implements DiscobitsHandler {
-@Property(value="600", label="Max-Age", description="Specifies the value of the max-age field"
-        + "set in the cache-control header of InfoDiscoBit-Responses, as per RFC 2616 this is a number of "
-        + "seconds")
-    public static final String MAX_AGE = "max-age";
-
-    @Reference
-    protected ContentGraphProvider cgProvider;
-
-    @Reference
-    PageNotFoundService notFoundPageService;
-
-    @Reference
-    GraphNodeProvider graphNodeProvider;
-
-    private static final Logger logger = LoggerFactory.getLogger(DiscobitsTypeHandler.class);
-
-    private final Set<MetaDataGenerator> metaDataGenerators =
-            Collections.synchronizedSet(new HashSet<MetaDataGenerator>());
-
-    private String cacheControlHeaderValue;
-
-    protected void activate(ComponentContext context) {
-        cacheControlHeaderValue = "max-age="+(String) context.getProperties().get(MAX_AGE);
-    }
-
-    /**
-     * TypeHandle method for rdf types "TitledContext", "InfoDiscoBit",
-     * "OrderedContent" and "XHTMLInfoDiscoBit".
-     * 
-     * @param uriInfo
-     * @return
-     */
-    @GET
-    @Produces({"*/*"})
-    public Object getResource(@Context UriInfo uriInfo) {
-        final UriRef uri = new UriRef(uriInfo.getAbsolutePath().toString());
-            final GraphNode graphNode = getResourceAsGraphNode(uriInfo);
-        if (graphNode == null) {
-            return resourceUnavailable(uri, uriInfo);
-        }
-        InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(graphNode);
-        if (infoDiscobit != null) {
-            Response response = Response.ok().
-                    header(HttpHeaders.CACHE_CONTROL, cacheControlHeaderValue).
-                    entity(infoDiscobit).
-                    build();
-            return response;
-        } else {
-            return graphNode;
-        }
-    }
-
-    private GraphNode getResourceAsGraphNode(UriInfo uriInfo) {
-        final UriRef uri = new UriRef(uriInfo.getAbsolutePath().toString());
-        GraphNode result = graphNodeProvider.getLocal(uri);
-        //could chck if nodeContext > 0, but this would be less efficient
-        TripleCollection tc = result.getGraph();
-        if (tc.filter(uri, null, null).hasNext()) {
-            return result;
-        }
-        if (tc.filter(null, null, uri).hasNext()) {
-            return result;
-        }
-        return null;
-    }
-
-
-    
-    /**
-     * Creates an <code>InfoDiscoBit</code> at the specified location
-     *
-     * @param uriInfo the uri of the InforDiscoBit to be created
-     * @param data the content of the upload
-     */
-    @PUT
-    public Response putInfoDiscobit(@Context UriInfo uriInfo, @Context HttpHeaders headers, byte[] data) {
-        final String contentType;
-        {
-            final List<String> contentTypeHeaders = headers.getRequestHeader(HttpHeaders.CONTENT_TYPE);
-            if (contentTypeHeaders == null) {
-                logger.warn("Content-Type not specified");
-                final MediaType guessTypeForName = MediaTypeGuesser.getInstance().
-                        guessTypeForName(uriInfo.getAbsolutePath().toString());
-                contentType = guessTypeForName == null ?
-                    MediaType.APPLICATION_OCTET_STREAM : guessTypeForName.toString();
-            } else {
-                contentType = contentTypeHeaders.get(0);
-            }
-            
-        }    
-        final UriRef infoDiscoBitUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        put(infoDiscoBitUri, MediaType.valueOf(contentType), data);
-        return Response.status(Status.CREATED).build();
-    }
-
-    /**
-     * Creates a new collection at the specified uri
-     *
-     * @param uriInfo
-     * @return
-     * <ul>
-     *    <li>201 "Created" response if method succeeded
-     *    <li>405 "Method Not Allowed" response if collection already exists
-     * </ul>
-     */
-    @MKCOL
-    public Object mkcol(@Context UriInfo uriInfo) {
-        String uriString = uriInfo.getAbsolutePath().toString();
-        if (uriString.charAt(uriString.length()-1) != '/') {
-            uriString += '/';
-        }
-        UriRef nodeUri = new UriRef(uriString);
-        final MGraph mGraph = cgProvider.getContentGraph();
-        Triple typeTriple = new TripleImpl(nodeUri, RDF.type, HIERARCHY.Collection);
-        if (mGraph.contains(typeTriple)) {
-            return Response.status(405) // Method Not Allowed
-                    .entity("Collection \"" + nodeUri.getUnicodeString()
-                    + "\" already exists.").build();
-        }
-        new CollectionCreator(mGraph).createContainingCollections(nodeUri);
-        return Response.created(uriInfo.getAbsolutePath()).build();
-    }
-
-    /**
-     * Finds all properties of a hierarchy node and returns them in a
-     * {@link DOMSource}
-     *
-     * @param uriInfo
-     * @param headers {@link HttpHeaders}
-     * @param body {@link DOMSource} containing the requested properties, can be null
-     * @return
-     * <ul>
-     *    <li>207 "Multistatus" response if method succeeded
-     *    <li>404 "Not Found" response if the hierarchy node was not found
-     *    <li>400 "Bad Request" response if the body is malformed
-     * </ul>
-     */
-    @PROPFIND
-    @Consumes({"application/xml", "text/xml", "*/*"})
-    @Produces({"application/xml", "text/xml", "*/*"})
-    public Response propfind(@Context UriInfo uriInfo,
-            @Context HttpHeaders headers, DOMSource body) {
-        final UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        if (!nodeAtUriExists(nodeUri)) {
-            return resourceUnavailable(nodeUri, uriInfo);
-        }
-            Map<UriRef, PropertyMap> result;
-        try {
-            String depthHeader = WebDavUtils.getHeaderAsString(headers, "Depth");
-            if (depthHeader == null) {
-                depthHeader = WebDavUtils.infinite;
-            }
-            final MGraph mGraph = cgProvider.getContentGraph();
-            GraphNode node = new GraphNode(nodeUri, mGraph);
-            if (body != null) {
-                Document requestDoc = WebDavUtils.sourceToDocument(body);
-                Node propfindNode = WebDavUtils.getNode(requestDoc, WebDavUtils.propfind);
-                Node requestNode = WebDavUtils.getFirstChild(propfindNode);
-                String requestType = requestNode.getLocalName();
-                if (requestType.equalsIgnoreCase(WebDavUtils.allprop)) {
-                    result = getAllProps(node, depthHeader);
-                } else if (requestType.equalsIgnoreCase(WebDavUtils.prop)) {
-                    result = getPropsByName(requestNode, node, depthHeader);
-                } else if (requestType.equalsIgnoreCase(WebDavUtils.propname)) {
-                    result = getPropNames(node, depthHeader);
-                } else {
-                    return Response.status(Status.BAD_REQUEST).build();
-                }
-            } else {
-                // returns all properties
-                result = getAllProps(node, depthHeader);
-            }
-            Document responseDoc = WebDavUtils.createResponseDoc(result);
-            return Response.status(207).entity(new DOMSource(responseDoc)).type(
-                    MediaType.APPLICATION_XML_TYPE).build();
-        } catch (TransformerFactoryConfigurationError e) {
-            return Response.status(Status.BAD_REQUEST).build();
-        } catch (TransformerException e) {
-            return Response.status(Status.BAD_REQUEST).build();
-        } catch (ParserConfigurationException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    Map<UriRef, PropertyMap> getPropNames(GraphNode node, String depthHeader) {
-        Map<UriRef, PropertyMap> result = new HashMap<UriRef, PropertyMap>();
-        WebDavUtils.addNodeProperties(result, null, null, node, false);
-        return result;
-    }
-
-    Map<UriRef, PropertyMap> getPropsByName(Node requestNode, GraphNode node,
-            String depthHeader) {
-        Map<UriRef, PropertyMap> result;
-        NodeList children = requestNode.getChildNodes();
-        result = WebDavUtils.getPropsByName(children, node, "0", true);
-        return result;
-    }
-
-    Map<UriRef, PropertyMap> getAllProps(GraphNode node, String depthHeader) {
-        HashMap<UriRef, PropertyMap> result = new HashMap<UriRef, PropertyMap>();
-        WebDavUtils.addNodeProperties(result, null, null, node, true);
-        return result;
-    }
-
-    /**
-     * @param uriInfo
-     * @param body {@link DOMSource} containing properties which should be set
-     * or deleted
-     * @return
-     * <ul>
-     *    <li>207 "Multistatus" response if method succeeded
-     *    <li>404 "Not Found" response if the hierarchy node was not found
-     *    <li>400 "Bad Request" response if the body is malformed
-     * </ul>
-     */
-    @PROPPATCH
-    @Consumes({"application/xml", "text/xml", "*/*"})
-    @Produces({"application/xml", "text/xml", "*/*"})
-    public Response proppatch(@Context UriInfo uriInfo, DOMSource body) {
-        UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        if (!nodeAtUriExists(nodeUri)) {
-            return resourceUnavailable(nodeUri, uriInfo);
-        }
-        try {
-            Document requestDoc = WebDavUtils.sourceToDocument(body);
-            final MGraph mGraph = cgProvider.getContentGraph();
-            GraphNode node = new GraphNode(nodeUri, mGraph);
-            NodeList propsToSet = null;
-            NodeList propsToRemove = null;
-            Node proppatchNode = WebDavUtils.getNode(requestDoc, WebDavUtils.proppatch);
-            NodeList childNodes = proppatchNode.getChildNodes();
-            for (int i = 0; i < childNodes.getLength(); i++) {
-                Node child = childNodes.item(i);
-                String localName = child.getLocalName();
-                if (localName != null) {
-                    if (localName.equals(WebDavUtils.set)) {
-                        propsToSet = child.getFirstChild().getChildNodes();
-                    } else if (localName.equals(WebDavUtils.remove)) {
-                        propsToRemove = child.getFirstChild().getChildNodes();
-                    }
-                }
-            }
-            Document responseDoc = WebDavUtils.modifyProperties(node, propsToSet, propsToRemove);
-            return Response.status(207).entity(new DOMSource(responseDoc)).type(
-                    MediaType.APPLICATION_XML_TYPE).build();
-        } catch (ParserConfigurationException ex) {
-            throw new RuntimeException(ex);
-        } catch (TransformerFactoryConfigurationError ex) {
-            return Response.status(Status.BAD_REQUEST).build();
-        } catch (TransformerException ex) {
-            return Response.status(Status.BAD_REQUEST).build();
-        } 
-    }
-
-    /**
-     * Moves or renames a hierarchy node
-     *
-     * @param uriInfo
-     * @param headers
-     * @return
-     * <ul>
-     *  <li>201 "Created" response if method succeeded
-     *  <li>412 "Precondition Failed" response if the destination URL is already
-     *    mapped to a resource
-     *  <li>404 "Not Found" response if the hierarchy node was not found
-     *  <li>403 "Forbidden" response if the source and destination resources are the same
-     *  <li>400 "Bad Request" if no "Destination" header was found
-     * </ul>
-     */
-    @MOVE
-    public Response move(@Context UriInfo uriInfo, @Context HttpHeaders headers) {
-        UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        final LockableMGraph mGraph = cgProvider.getContentGraph();
-        GraphNode node = new GraphNode(nodeUri, mGraph);
-        String targetString = WebDavUtils.getHeaderAsString(headers,
-                    "Destination");
-        UriRef targetUri = new UriRef(targetString);
-        String overwriteHeader = WebDavUtils.getHeaderAsString(headers, "Overwrite");
-        boolean overwriteTarget = "T".equalsIgnoreCase(overwriteHeader);
-        if (nodeAtUriExists(targetUri)) {
-            if (overwriteTarget) {
-                new GraphNode(targetUri, mGraph).deleteNodeContext();
-            } else {
-                return Response.status(Status.PRECONDITION_FAILED).build();
-            }
-        }
-        Lock l = mGraph.getLock().writeLock();
-        l.lock();
-        try {
-            Iterator<Triple> oldParentTripleIter
-                    = mGraph.filter(nodeUri, HIERARCHY.parent, null);
-            if (oldParentTripleIter.hasNext()) {
-                oldParentTripleIter.next();
-                oldParentTripleIter.remove();
-            }
-            while (oldParentTripleIter.hasNext()) {
-                logger.error("more than one parent statement: "+oldParentTripleIter.next());
-                oldParentTripleIter.remove();
-            }
-            Lock writeLock = node.writeLock();
-            writeLock.lock();
-            try {
-                node.replaceWith(targetUri);
-            } finally {
-                writeLock.unlock();
-            }
-            new CollectionCreator(mGraph).createContainingCollections(targetUri);
-            try {
-                return Response.created(new java.net.URI(targetUri.getUnicodeString())).build();
-            } catch (URISyntaxException ex) {
-                throw new IllegalArgumentException(ex);
-            }
-        } finally {
-            l.unlock();
-        }
-    }
-
-    /**
-     * Deletes a hierarchy node
-     *
-     * @param uriInfo
-     * @return
-     * <ul>
-     *    <li>200 "OK" response if method succeeded
-     *    <li>404 "Not Found" response if the hierarchy node was not found
-     * </ul>
-     */
-    @DELETE
-    public Response delete(@Context UriInfo uriInfo) {
-        UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        if (!nodeAtUriExists(nodeUri)) {
-            return Response.status(Status.NOT_FOUND).entity(
-                    uriInfo.getAbsolutePath()).type(MediaType.TEXT_PLAIN).build();
-        }
-        final LockableMGraph mGraph = cgProvider.getContentGraph();
-        GraphNode node = new GraphNode(nodeUri, mGraph);
-        node.deleteNodeContext();
-        return Response.ok().build();
-    }
-
-    /**
-     * @param uriInfo
-     * @return
-     * <ul>
-     *    <li>200 "OK" response with an "Allow" and a "DAV" header. The "Allow"
-     * header contains all the possible HTTP methods that can be executed on the
-     * resource and the "DAV" header shows if the resource is WebDAV enabled
-     *    <li>404 "Not Found" response if the resource was not found
-     * </ul>
-     */
-    @OPTIONS
-    public Response options(@Context UriInfo uriInfo) {
-        final UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        if (!nodeAtUriExists(nodeUri)) {
-            return resourceUnavailable(nodeUri, uriInfo);
-        }
-            Response.ResponseBuilder builder = Response.ok();
-            builder.header("Dav", "1");
-            Set<String> allow = new HashSet<String>();
-            Method[] methods = this.getClass().getMethods();
-            for (Method method : methods) {
-                for (Annotation annotation : method.getAnnotations()) {
-                    HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
-                    if (httpMethod != null) {
-                        allow.add(httpMethod.value());
-                    }
-                }
-            }
-            if (allow.isEmpty()) {
-                builder.header("Allow", "");
-            } else {
-                final Iterator<String> iterator = allow.iterator();
-                final StringBuffer buffer = new StringBuffer(iterator.next());
-                while (iterator.hasNext()) {
-                    buffer.append(", ");
-                    buffer.append(iterator.next());
-                }
-                builder.header("Allow", buffer.toString());
-            }
-        return builder.build();
-    }
-
-    protected void bindMetaDataGenerator(MetaDataGenerator generator) {
-        metaDataGenerators.add(generator);
-    }
-
-    protected void unbindMetaDataGenerator(MetaDataGenerator generator) {
-        metaDataGenerators.remove(generator);
-    }
-
-    @Override
-    protected MGraph getMGraph() {
-        return cgProvider.getContentGraph();
-    }
-
-    @Override
-    protected Set<MetaDataGenerator> getMetaDataGenerators() {
-        return metaDataGenerators;
-    }
-
-    
-
-    private boolean nodeAtUriExists(UriRef nodeUri) {
-        LockableMGraph mGraph = (LockableMGraph) getMGraph();
-        Lock readLock = mGraph.getLock().readLock();
-        readLock.lock();
-        try {
-            return mGraph.filter(nodeUri, null, null).hasNext()
-                    || mGraph.filter(null, null, nodeUri).hasNext();
-        } finally {
-            readLock.unlock();
-        }
-    }
-
-    private Response resourceUnavailable(UriRef nodeUri,
-            UriInfo uriInfo) {
-        UriRef oppositUri = makeOppositeUriRef(nodeUri);
-        if (nodeAtUriExists(oppositUri)) {
-            return RedirectUtil.createSeeOtherResponse(
-                    oppositUri.getUnicodeString(), uriInfo);
-        } else {
-            return notFoundPageService.createResponse(uriInfo);
-        }
-        //return Response.status(Status.NOT_FOUND).build();
-    }
-    /**
-     * add trailing slash if none present, remove otherwise
-     *
-     * @param uri
-     * @return
-     */
-    private static UriRef makeOppositeUriRef(UriRef uri) {
-        String uriString = uri.getUnicodeString();
-        if (uriString.endsWith("/")) {
-            return new UriRef(uriString.substring(0, uriString.length() - 1));
-        } else {
-            return new UriRef(uriString + "/");
-        }
-    }
-
-    private UriRef createAnyHostUri(UriInfo uriInfo) {
-        return new UriRef(Constants.ALL_HOSTS_URI_PREFIX+uriInfo.getPath());
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java
deleted file mode 100644
index 5e7940d..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java
+++ /dev/null
@@ -1,177 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.net.URL;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Providers;
-import org.apache.clerezza.rdf.utils.MGraphUtils.NoSuchSubGraphException;
-
-import org.osgi.framework.Bundle;
-import org.osgi.service.component.ComponentContext;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.clerezza.jaxrs.utils.TrailingSlash;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.serializedform.Serializer;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.utils.MGraphUtils;
-import org.apache.clerezza.web.fileserver.BundlePathNode;
-import org.apache.clerezza.web.fileserver.FileServer;
-import org.wymiwyg.commons.util.dirbrowser.PathNode;
-
-/**
- * This Jax-rs root resource provides an ajax edito ro edit content structured
- * using the Discobits ontology
- *
- * @author rbn
- *
- */
-@Component
-@Service(Object.class)
-@Property(name="javax.ws.rs", boolValue=true)
-@Path("tools/editor")
-public class Editor extends FileServer {
-
-    @Reference
-    private ContentGraphProvider cgProvider;
-
-    @Reference
-    private TcManager tcManager;
-    
-    @Reference
-    private Serializer serializer;
-
-    
-    private static final Logger logger = LoggerFactory.getLogger(Editor.class);
-
-    private Providers providers;
-    private final String rdfXml = "application/rdf+xml";
-    
-    
-    
-    /**
-     * On activation the {@link FileServer} is prepared
-     *
-     * @param context
-     */
-    protected void activate(ComponentContext context) {
-        configure(context.getBundleContext());
-    }
-
-    
-    /**
-     * The providers are injected by the Jax-rs implementation and used to
-     * locate readers for the RDF content of the body
-     *
-     * @param providers
-     */
-    @Context
-    public void setProviders(Providers providers) {
-        this.providers = providers;
-    }
-
-
-    @GET
-    @Path("get")
-    public GraphNode getDiscobit(@QueryParam("resource") UriRef uri,
-            @QueryParam("graph") UriRef graphUri) {
-        final MGraph mGraph = graphUri == null ? cgProvider.getContentGraph() :
-            tcManager.getMGraph(graphUri);
-        return new GraphNode(uri, mGraph);
-    }
-
-    /**
-     * replaces the subgraph serialized with RDF/XML in <code>revokedString
-     * </code> with the one from <code>assertedString</code>.
-     *
-     * @param graphUri the graph within which the replacement has to take place or null
-     * for the content graph
-     * @param assertedString the asserted Graph as RDF/XML
-     * @param revokedString the revoked Graph as RDF/XML
-     */
-    @POST
-    @Path("post")
-    public void postDiscobit(@QueryParam("graph") UriRef graphUri,
-            @FormParam("assert") String assertedString,
-            @FormParam("revoke") String revokedString,
-            @FormParam("rdfFormat") String rdfFormat) {
-        if (rdfFormat == null) {
-            rdfFormat = rdfXml;
-        }
-        MediaType mediaType = MediaType.valueOf(rdfFormat);
-        MessageBodyReader<Graph> graphReader = providers.getMessageBodyReader(Graph.class, Graph.class, null,mediaType);
-        final Graph assertedGraph;
-        final Graph revokedGraph;
-        try {
-            assertedGraph = graphReader.readFrom(Graph.class, Graph.class, new Annotation[0], mediaType, null, new ByteArrayInputStream(assertedString.getBytes()));
-            revokedGraph = graphReader.readFrom(Graph.class, Graph.class, new Annotation[0], mediaType, null, new ByteArrayInputStream(revokedString.getBytes()));
-        } catch (IOException ex) {
-            logger.error("reading graph {}", ex);
-            throw new WebApplicationException(ex, 500);
-        }
-        final MGraph mGraph = graphUri == null ? cgProvider.getContentGraph() :
-            tcManager.getMGraph(graphUri);
-        try {
-            serializer.serialize(System.out, revokedGraph, "text/turtle");
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            serializer.serialize(baos, revokedGraph, "text/turtle");
-            System.out.println(new String(baos.toByteArray()).contains("\r"));
-            MGraphUtils.removeSubGraph(mGraph, revokedGraph);
-        } catch (NoSuchSubGraphException ex) {
-            throw new RuntimeException(ex);
-        }
-        mGraph.addAll(assertedGraph);
-    }
-
-    @GET
-    //this is to work around
-    @Produces(MediaType.APPLICATION_OCTET_STREAM)
-    public PathNode getStaticFile(@Context UriInfo uriInfo) {
-        TrailingSlash.enforcePresent(uriInfo);
-        final PathNode node = getNode("disco.xhtml");
-        logger.debug("serving static {}", node);
-        return node;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java
deleted file mode 100644
index 8693216..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java
+++ /dev/null
@@ -1,105 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import java.util.Iterator;
-import java.util.concurrent.locks.Lock;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.ontologies.DISCOBITS;
-import org.apache.clerezza.rdf.ontologies.RDF;
-
-/**
- * Represents an InfoDiscoBit
- *
- * @author reto
- */
-public class InfoDiscobit {
-
-    private GraphNode infoBit;
-
-
-    /**
-     *
-     * @param infoBit
-     * @return an instance of InfoDiscobit or null if node is not an InfoDiscoBit
-     */
-    public static InfoDiscobit createInstance(GraphNode node) {
-        Lock l = node.readLock();
-        l.lock();
-        try {
-            Iterator<Resource> types = node.getObjects(RDF.type);
-            while(types.hasNext()) {
-                if (types.next().equals(DISCOBITS.InfoDiscoBit)){
-                    return new InfoDiscobit(node);
-                }
-            }
-            return null;
-        } finally {
-            l.unlock();
-        }
-    }
-
-    InfoDiscobit(GraphNode infoBit) {
-        this.infoBit = infoBit;
-    }
-
-    public String getContentType() {
-        Lock readLock = infoBit.readLock();
-        readLock.lock();
-        try {
-            Iterator<Literal> mediaTypeLits = infoBit.getLiterals(DISCOBITS.mediaType);
-            if (mediaTypeLits.hasNext()) {
-                return mediaTypeLits.next().getLexicalForm();
-            } else {
-                throw new RuntimeException("InfoDiscobit has no media type property");
-            }
-        } finally {
-            readLock.unlock();
-        }
-    }
-    
-    public byte[] getData() {
-        byte[] result;
-        Lock readLock = infoBit.readLock();
-        readLock.lock();
-        try {
-            Iterator<Literal> infoBitLits = infoBit.getLiterals(DISCOBITS.infoBit);
-            if (infoBitLits.hasNext()) {
-                final Literal literalValue = infoBitLits.next();
-                if (literalValue instanceof TypedLiteral) {
-                    result = LiteralFactory.getInstance().createObject(
-                            (new byte[0]).getClass(), (TypedLiteral) literalValue);
-                } else {
-                    throw new RuntimeException("InfoDiscobit has infoBit value which is not a TypedLiteral but "+literalValue);
-                }
-            } else {
-                throw new RuntimeException("InfoDiscobit has not infoBit property");
-            }
-        } finally {
-            readLock.unlock();
-        }        
-        return result;    
-    };
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java
deleted file mode 100644
index e3a2aa4..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java
+++ /dev/null
@@ -1,67 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-
-
-/**
- * 
- * @scr.component
- * @scr.service interface="java.lang.Object"
- * @scr.property name="javax.ws.rs" type="Boolean" value="true"
- *
- * @author reto
- */
-@Provider
-@Produces("*/*")
-public class InfoDiscobitWriter implements MessageBodyWriter<InfoDiscobit> {
-
-    @Override
-    public boolean isWriteable(Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType) {
-        return InfoDiscobit.class.isAssignableFrom(type);
-    }
-
-    @Override
-    public long getSize(InfoDiscobit t, Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType) {
-        return t.getData().length;
-    }
-
-    @Override
-    public void writeTo(InfoDiscobit t, Class<?> type, Type genericType,
-            Annotation[] annotations, MediaType mediaType,
-            MultivaluedMap<String, Object> httpHeaders,
-            OutputStream entityStream) throws IOException,
-            WebApplicationException {
-        httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, t.getContentType());
-        entityStream.write(t.getData());
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java
deleted file mode 100644
index ccce889..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  Copyright 2010 reto.
- * 
- *  Licensed 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.
- *  under the License.
- */
-
-package org.apache.clerezza.platform.content;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-/**
- * An instance of this service is called by DiscoBitHandler if a resource
- * is not found in the content graph.
- *
- * @author reto
- */
-public interface PageNotFoundService {
-
-    /**
-     * Creates a response when a resource could not be found in the Content 
-     * Graph, this is a 404 response.
-     * 
-     * @param uriInfo
-     * @return
-     */
-    public Response createResponse(UriInfo uriInfo);
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java
deleted file mode 100644
index 69171ff..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java
+++ /dev/null
@@ -1,49 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
-import java.util.Set;
-import org.apache.clerezza.rdf.core.MGraph;
-
-/**
- *
- * @author reto
- */
-class SimpleDiscobitsHandler extends AbstractDiscobitsHandler {
-    
-    private final MGraph mGraph;
-
-    public SimpleDiscobitsHandler(MGraph mGraph) {
-        this.mGraph = mGraph;
-    }
-
-    @Override
-    protected MGraph getMGraph() {
-        return mGraph;
-    }
-
-    @Override
-    protected Set<MetaDataGenerator> getMetaDataGenerators() {
-        return null;
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java
deleted file mode 100644
index 094e773..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java
+++ /dev/null
@@ -1,142 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import javax.ws.rs.core.MediaType;
-import org.apache.clerezza.platform.typerendering.CallbackRenderer;
-import org.apache.clerezza.platform.typerendering.Renderlet;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.ontologies.DISCOBITS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-/**
- * A renderlet for rendering TitledContent. The contained elements are rendered
- * calling back to the specified <code>Renderer</code>.
- *
- * This renderlet uses a thread-local variable to set the appropriate heading
- * level (h1 - h6)
- *
- * @author rbn, mir
- *
- * @scr.component
- * @scr.service interface="org.apache.clerezza.platform.typerendering.Renderlet"
- */
-public class TitledContentRenderlet implements Renderlet {
-
-    private static ThreadLocal<Integer> headingLevel  = new ThreadLocal<Integer>() {
-
-        @Override
-        protected Integer initialValue() {
-            return 1;
-        }
-
-    };
-    @Override
-    public void render(GraphNode res, GraphNode context, Map<String, Object> sharedRenderingValues,
-            CallbackRenderer callbackRenderer,
-            URI renderingSpecification,
-            String mode,
-            MediaType mediaType, RequestProperties requestProperties,
-            OutputStream os) throws IOException {
-        PrintWriter writer = new PrintWriter(os);
-        List<GraphNode> containedNodes = getContainedNodes(res);
-        if (containedNodes.size() < 2) {
-            String nodeLabel = res.getNode() instanceof UriRef ?
-                ((UriRef)res.getNode()).getUnicodeString() : " Bnode";
-            writer.print(nodeLabel+": titled and/or content could not be found");
-            writer.flush();
-            return;
-        }
-        writer.print(getHeaderOpen());
-        writer.flush();
-        callbackRenderer.render(
-                containedNodes.get(0),
-                context, mode, os);
-        writer.println(getHeaderClose());
-        headingLevel.set(headingLevel.get()+1);
-        writer.print("<div class='tx-content'>");
-        writer.flush();
-        callbackRenderer.render(
-                containedNodes.get(1),
-                context, mode, os);
-        headingLevel.set(headingLevel.get()-1);
-        writer.println("</div>");
-        writer.flush();
-    }
-
-
-    private List<GraphNode> getContainedNodes(GraphNode titledContent) {
-        final SortedSet<GraphNode> entries = new TreeSet<GraphNode>(new Comparator<GraphNode>() {
-
-            @Override
-            public int compare(GraphNode o1, GraphNode o2) {
-                    int pos1 = getPos(o1);
-                    int pos2 = getPos(o2);
-                    return pos1 - pos2;
-            }
-            private int getPos(GraphNode o) {
-                try {
-                    return Integer.parseInt(o.getLiterals(DISCOBITS.pos).next().getLexicalForm());
-                } catch (NullPointerException e) {
-                    return -1;
-                }
-            }
-
-        });
-        final Iterator<Resource> entriesIter = titledContent.getObjects(DISCOBITS.contains);
-        while (entriesIter.hasNext()) {
-            Resource resource = entriesIter.next();
-            entries.add(new GraphNode((NonLiteral) resource,titledContent.getGraph()));
-        }
-        final List<GraphNode> result = new ArrayList<GraphNode>();
-        for (GraphNode graphNode : entries) {
-            Iterator<Resource> holded = graphNode.getObjects(DISCOBITS.holds);
-            if (!holded.hasNext()) {
-                throw new RuntimeException(
-                        "Titled Content must contain a first element: "+graphNode.getNodeContext());
-            }
-            result.add(new GraphNode(holded.next(),
-                    titledContent.getGraph()));
-        }
-        return result;
-    }
-
-    private String getHeaderOpen() {
-        final Integer level = headingLevel.get();
-        return level < 7 ? "<h"+level+">" : "<div class = \"heading\">";
-    }
-
-    private String getHeaderClose() {
-        final Integer level = headingLevel.get();
-        return level < 7 ? "</h"+level+">" : "</div>";
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java
deleted file mode 100644
index aea5190..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java
+++ /dev/null
@@ -1,703 +0,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.
- */
-
-package org.apache.clerezza.platform.content;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMResult;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TripleCollection;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.DCTERMS;
-import org.apache.clerezza.rdf.ontologies.HIERARCHY;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- * @author agron
- */
-class WebDavUtils {
-
-    static final String infinite = "infinite";
-    static final String prop = "prop";
-    static final String allprop = "allprop";
-    static final String propname = "propname";
-    static final String propfind = "propfind";
-    static final String proppatch = "propertyupdate";
-    static final String set = "set";
-    static final String remove = "remove";
-    private static final String davUri = "DAV:";
-    private static final String multistat = "multistatus";
-    private static final String response = "response";
-    private static final String href = "href";
-    private static final String propstat = "propstat";
-    private static final String status = "status";
-
-    //WebDAV properties
-    private static final String creationdate = "creationdate";
-    private static final String displayname = "displayname";
-    private static final String getcontentlanguage = "getcontentlanguage";
-    private static final String getcontentlength = "getcontentlength";
-    private static final String getcontenttype = "getcontenttype";
-    private static final String getetag = "getetag";
-    private static final String getlastmodified = "getlastmodified";
-    private static final String lockdiscovery = "lockdiscovery";
-    private static final String resourcetype = "resourcetype";
-    private static final String supportedlock = "supportedlock";
-
-    private static final List<String> davProps = new ArrayList<String>(Arrays.asList(
-            creationdate, displayname, getcontentlanguage, getcontentlength,
-            getcontenttype, getetag, getlastmodified, lockdiscovery,
-            resourcetype, supportedlock));
-    
-    private static final List<String> protectedProps = new ArrayList<String>(Arrays.asList(
-            creationdate, getcontentlength, getetag, getlastmodified,
-            lockdiscovery, resourcetype, supportedlock));
-
-
-    /**
-     * Returns the {@link Node} from a given {@link Document}
-     * @param doc
-     * @param nodeName
-     * @return null if Node wasen't found
-     */
-    static Node getNode(Document doc, String nodeName){
-        NodeList nodes = doc.getElementsByTagNameNS(davUri, nodeName);
-        if(nodes.getLength() == 1){
-            return nodes.item(0);
-        }
-        return null;
-    }
-
-    /**
-     * @param node
-     * @return returns the first non Text node or null
-     */
-    static Node getFirstChild(Node node){
-        NodeList nodeList = node.getChildNodes();
-        for (int i = 0; i < nodeList.getLength(); i++) {
-            if(nodeList.item(i).getLocalName() != null){
-                return nodeList.item(i);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Converts a {@link Source} to a {@link Document}
-     *
-     * @throws ParserConfigurationException
-     * @throws TransformerFactoryConfigurationError
-     * @throws TransformerException
-     */
-    static Document sourceToDocument(Source body)
-            throws ParserConfigurationException,
-            TransformerFactoryConfigurationError, TransformerException {
-        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
-                .newDocument();
-        Transformer transformer = TransformerFactory.newInstance().newTransformer();
-        DOMResult result = new DOMResult(doc);
-        transformer.transform(body, result);
-        return (Document) result.getNode();
-    }
-
-    /**
-     * Returns the content of a requested header as a {@link String}
-     *
-     * @param headers
-     * @param header
-     *            header to be returned
-     * @return returns <code>null</code> if the requested header is empty
-     */
-    static String getHeaderAsString(HttpHeaders headers, String header) {
-        List<String> requestedHeader = headers.getRequestHeader(header);
-        if(requestedHeader == null){
-            return null;
-        }
-        Iterator<String> headerIterator = requestedHeader.iterator();
-        if (headerIterator.hasNext()) {
-            return headerIterator.next();
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * @param clazz
-     * @return returns an ok Response with a DAV: and an ALLOW: header
-     */
-    static Response options(Class<?> clazz){
-        Response.ResponseBuilder builder = Response.ok();
-        builder.header("Dav", "1");
-        Set<String> allow = new HashSet<String>();
-        Method[] methods = clazz.getMethods();
-        for (Method method : methods){
-            for (Annotation annotation : method.getAnnotations()){
-                HttpMethod httpMethod = annotation.annotationType()
-                        .getAnnotation(HttpMethod.class);
-                if(httpMethod != null){
-                    allow.add(httpMethod.value());
-                }
-            }
-        }
-        if (allow.isEmpty()) {
-            builder.header("Allow", "");
-        } else {
-            final Iterator<String> iterator = allow.iterator();
-            final StringBuffer buffer = new StringBuffer(iterator.next());
-            while (iterator.hasNext()) {
-                buffer.append(", ");
-                buffer.append(iterator.next());
-            }
-            builder.header("Allow", buffer.toString());
-        }
-        return builder.build();
-    }
-
-    /*------------------------------------------*
-     * Putting the properties in a DOM Document *
-     *------------------------------------------*/
-
-    static Document createResponseDoc(Map<UriRef, PropertyMap> resultMap)
-            throws ParserConfigurationException {
-        Document responseDoc = DocumentBuilderFactory.newInstance().
-                newDocumentBuilder().newDocument();
-        Set<UriRef> nodeNameSet = resultMap.keySet();
-
-        Element multistatElement = responseDoc.createElementNS(davUri,"D:" + multistat);
-        // add multistat element to response
-        responseDoc.appendChild(multistatElement);
-        for (UriRef nodeName : nodeNameSet) {
-            Element responseElement = responseDoc.createElementNS(davUri, "D:" + response);
-            // add response element to response Document
-            multistatElement.appendChild(responseElement);
-            PropertyMap propertyMap = resultMap.get(nodeName);
-            addElementsToResponse(propertyMap, responseElement, responseDoc, nodeName);
-        }
-        return responseDoc;
-    }
-
-    private static void addElementsToResponse(PropertyMap propertyMap,
-            Element responseElement, Document responseDoc, UriRef nodeName) {
-        Element hrefElement = responseDoc.createElementNS(davUri, "D:" + href);
-        hrefElement.setTextContent(nodeName.getUnicodeString());
-        // add hrefElement element to responseElement
-        responseElement.appendChild(hrefElement);
-        addPropsToPropstat(responseElement, propertyMap, responseDoc);
-
-    }
-
-    private static void addPropsToPropstat(Element responseElement, PropertyMap propertyMap,
-            Document responseDoc) {
-        Set<Property> props = propertyMap.keySet();
-        Element propFoundElement = responseDoc.createElementNS(davUri, "D:" + prop);
-        Element propNotFoundElement = responseDoc.createElementNS(davUri, "D:" + prop);
-        for(Property propVal : props){
-            String propName = propVal.prop;
-            String ns = propVal.ns;
-            String prf = ns.equalsIgnoreCase(davUri) ? "D:":"R:";
-            String value = propertyMap.get(propVal);
-            Element resultElement = responseDoc.createElementNS(ns, prf + propName);
-            if(value != null){
-                if (!(value.isEmpty())){
-                    if (value.equals("collection")) {
-                        resultElement.appendChild(responseDoc.createElementNS(
-                                davUri, "D:collection"));
-                    } else {
-                        resultElement.setTextContent(value);
-                    }
-                }
-                propFoundElement.appendChild(resultElement);
-            } else {
-                propNotFoundElement.appendChild(resultElement);
-            }
-        }
-        Element propstatFoundElement = responseDoc.createElementNS(davUri,
-                "D:" + propstat);
-        Element statusFoundElement = responseDoc.createElementNS(davUri,
-                "D:" + status);
-        propstatFoundElement.appendChild(propFoundElement);
-        statusFoundElement.setTextContent("HTTP/1.1 200 OK");
-        propstatFoundElement.appendChild(statusFoundElement);
-        responseElement.appendChild(propstatFoundElement);
-        if(propNotFoundElement.hasChildNodes()){
-            Element propstatNotFoundElement = responseDoc.createElementNS(davUri,
-                    "D:" + propstat);
-            Element statusNotFoundElement = responseDoc.createElementNS(davUri,
-                    "D:" + status);
-            propstatNotFoundElement.appendChild(propNotFoundElement);
-            statusNotFoundElement.setTextContent("HTTP/1.1 404 Not Found");
-            propstatNotFoundElement.appendChild(statusNotFoundElement);
-            responseElement.appendChild(propstatNotFoundElement);
-        }
-
-    }
-
-    /*------------------------------------------------------------*
-     * Get the properties from the CollectionNode and its members *
-     *------------------------------------------------------------*/
-
-    static Map<UriRef, PropertyMap> getPropsByName(NodeList children,
-            GraphNode node, String depthHeader, boolean includeValues) {
-        List<Property> requestedUserProps = new ArrayList<Property>();
-        List<Property> requestedDavProps = new ArrayList<Property>();
-
-        for (int i = 0; i < children.getLength(); i++) {
-            Node child = children.item(i);
-            String localName = child.getLocalName();
-            if(localName == null){
-                continue;
-            }
-            String nsUri = child.getNamespaceURI();
-            if (nsUri.equals(davUri)) {
-                requestedDavProps.add(new Property(nsUri, localName));
-            } else {
-                requestedUserProps.add(new Property(nsUri, localName));
-            }
-        }
-        Map<UriRef, PropertyMap> allprops = new HashMap<UriRef, PropertyMap>();
-
-        if (node.hasProperty(RDF.type, HIERARCHY.Collection)) {
-            return getCollectionProps(allprops, requestedUserProps, requestedDavProps,
-                    node, depthHeader, includeValues);
-        }else{
-            addNodeProperties(allprops, requestedUserProps, requestedDavProps,
-                    node, includeValues);
-            return allprops;
-        }
-
-    }
-    
-    static Map<UriRef, PropertyMap> getCollectionProps(Map<UriRef, PropertyMap> allprops,
-            List<Property> requestedUserProps, List<Property> requestedDavProps,
-            GraphNode collection, String depthHeader, boolean includeValues) {
-        if(allprops == null){
-            allprops = new HashMap<UriRef, PropertyMap>();
-        }
-        addNodeProperties(allprops, requestedUserProps, requestedDavProps, collection,
-                includeValues);
-        if (depthHeader.equals("1") || depthHeader.equals(infinite)) {
-            Iterator<GraphNode> membersIter = collection.getSubjectNodes(HIERARCHY.parent);
-            List<GraphNode> members = new ArrayList<GraphNode>();
-            while (membersIter.hasNext()) {
-                members.add(membersIter.next());
-            }
-            addMemberProps(allprops, requestedUserProps, requestedDavProps, members,
-                    depthHeader, includeValues);
-        }
-        return allprops;
-    }
-
-    private static void addMemberProps(Map<UriRef, PropertyMap> allprops,
-            List<Property> requestedUserProps, List<Property> requestedDavProps,
-            List<GraphNode> members, String depthHeader, boolean includeValues) {
-        for (GraphNode member : members) {
-            if (depthHeader.equals(infinite) && member.hasProperty(RDF.type, HIERARCHY.Collection)) {
-                getCollectionProps(allprops, requestedUserProps, requestedDavProps,
-                        member, depthHeader, includeValues);
-            } else {
-                addNodeProperties(allprops, requestedUserProps, requestedDavProps,
-                        member,    includeValues);
-            }
-        }
-    }
-
-    static void addNodeProperties(Map<UriRef, PropertyMap> allprops,
-            List<Property> requestedUserProps, List<Property> requestedDavProps,
-            GraphNode node,    boolean includeValues) {
-
-        if (requestedDavProps == null) {
-            requestedDavProps = new ArrayList<Property>();
-            for(String st : davProps){
-                requestedDavProps.add(new Property(davUri, st));
-            }
-        }
-        PropertyMap propertyMap = new PropertyMap();
-        if (includeValues) {
-            addDavProps(node, propertyMap, requestedDavProps);
-            addUserProps(node, propertyMap, requestedUserProps);
-        } else {
-            addDavPropsWithoutValues(propertyMap);
-            addUserPropsWithoutValues(node, propertyMap);
-        }
-        allprops.put((UriRef) node.getNode(), propertyMap);
-
-    }
-
-    private static void addUserProps(GraphNode node, PropertyMap propertyMap,
-            List<Property> requestedProps) {
-        Iterator<UriRef> userPropsIter;
-        Lock readLock = node.readLock();
-        readLock.lock(); 
-        try {
-            userPropsIter = node.getProperties();
-        } finally {
-            readLock.unlock();
-        }
-        Set<UriRef> userProps = new HashSet<UriRef>();
-        while (userPropsIter.hasNext()) {
-            userProps.add(userPropsIter.next());
-        }
-        userProps.remove(HIERARCHY.members);
-        if (requestedProps != null) {
-            for (Property requestedProp : requestedProps) {
-                UriRef predicate = new UriRef(requestedProp.value());
-                if (userProps.contains(predicate)) {
-                    readLock.lock();
-                    try {
-                        Iterator<Resource> value = node.getObjects(predicate);
-                        if (value.hasNext()) {
-                            propertyMap.put(requestedProp, getValue(value.next()));
-                        } else {
-                            propertyMap.put(requestedProp, "");
-                        }
-                    } finally {
-                        readLock.unlock();
-                    }
-                } else {
-                    propertyMap.put(requestedProp, null);
-                }
-            }
-        } else {
-            for (UriRef uri : userProps) {
-                String userProp = uri.getUnicodeString();
-                int index = userProp.lastIndexOf("#");
-                if (index == -1) {
-                    index = userProp.lastIndexOf("/");
-                }
-                Property property = new Property(userProp.substring(0, index + 1),
-                        userProp.substring(index + 1));
-
-                Iterator<Resource> value = node.getObjects(uri);
-                readLock.lock();
-                try {
-                    if (value.hasNext()) {
-                        propertyMap.put(property, getValue(value.next()));
-                    } else {
-                        propertyMap.put(property, "");
-                    }
-                } finally {
-                    readLock.unlock();
-                }
-            }
-        }
-    }
-
-    private static void addUserPropsWithoutValues(GraphNode node,
-            PropertyMap propertyMap) {
-        Iterator<UriRef> userPropsIter;
-        Lock readLock = node.readLock();
-        readLock.lock();
-        try {
-            userPropsIter = node.getProperties();
-        } finally {
-            readLock.unlock();
-        }
-        Set<UriRef> userProps = new HashSet<UriRef>();
-        while (userPropsIter.hasNext()) {
-            userProps.add(userPropsIter.next());
-        }
-        userProps.remove(HIERARCHY.members);
-        for (UriRef uri : userProps) {
-            String userProp = uri.getUnicodeString();
-            int index = userProp.lastIndexOf("#");
-            if (index == -1) {
-                index = userProp.lastIndexOf("/");
-            }
-            Property property = new Property(userProp.substring(0, index + 1),
-                    userProp.substring(index + 1));
-            propertyMap.put(property, "");
-        }
-    }
-
-    /**
-     * @param resource
-     * @return returns the unicode string of an UriRef or the lexical form of a
-     * Literal or the return value of a toString() on a BNode
-     */
-    private static String getValue(Resource resource){
-        if(resource instanceof UriRef){
-            return ((UriRef)resource).getUnicodeString();
-        }else if(resource instanceof Literal){
-            return ((Literal)resource).getLexicalForm();
-        }else {
-            return resource.toString();
-        }
-    }
-
-    /**
-     * FIXME find better implementation
-     * @param node
-     * @param propertyMap
-     * @param includeValues
-     * @param requestedProps
-     */
-    private static void addDavProps(GraphNode node, PropertyMap propertyMap,
-            List<Property> requestedProps) {
-        for (Property property : requestedProps) {
-            if (davProps.contains(property.prop)) {
-                if (property.prop.equalsIgnoreCase(displayname)) {
-                    propertyMap.put(property, getLastSection(((UriRef)node.getNode()).getUnicodeString()));
-                } else if (property.prop.equalsIgnoreCase(resourcetype)) {
-                    if (node.hasProperty(RDF.type, HIERARCHY.Collection)) {
-                        propertyMap.put(property, "collection");
-                    } else {
-                        propertyMap.put(property, "");
-                    }
-                } else if(property.prop.equalsIgnoreCase(creationdate)){
-                    Lock readLock = node.readLock();
-                    readLock.lock();
-                    try {
-                        Iterator<Resource> date = node.getObjects(DCTERMS.dateSubmitted);
-                        if (date.hasNext()) {
-                            String st = getValue(date.next());
-                            propertyMap.put(property, st);
-                        } else {
-                            propertyMap.put(property, "");
-                        }
-                    } finally {
-                        readLock.unlock();
-                    }
-                } else if(property.prop.equalsIgnoreCase(getlastmodified)){
-                    Lock readLock = node.readLock();
-                    readLock.lock();
-                    try {
-                        Iterator<Resource> date = node.getObjects(DCTERMS.modified);
-                        if (date.hasNext()) {
-                            String st = getValue(date.next());
-                            propertyMap.put(property, st);
-                        } else {
-                            propertyMap.put(property, "");
-                        }
-                    } finally {
-                        readLock.unlock();
-                    }
-                } else if(property.prop.equalsIgnoreCase(getcontenttype)){
-                    Lock readLock = node.readLock();
-                    readLock.lock();
-                    try {
-                        Iterator<Resource> mediaType = node.getObjects(DCTERMS.MediaType);
-                        if (mediaType.hasNext()) {
-                            String st = getValue(mediaType.next());
-                            propertyMap.put(property, st);
-                        } else {
-                            propertyMap.put(property, "");
-                        }
-                    } finally {
-                        readLock.unlock();
-                    }
-                } else {
-                    propertyMap.put(property, "");
-                }
-            } else {
-                propertyMap.put(property, null);
-            }
-        }
-    }
-
-    private static void addDavPropsWithoutValues(PropertyMap propertyMap) {
-        for (String property : davProps) {
-                propertyMap.put(new Property(davUri, property), "");
-        }
-    }
-
-    /*-------------------*
-     * Proppatch methods *
-     *-------------------*/
-
-    static Document modifyProperties(GraphNode hierarchyNode, NodeList propsToSet,
-            NodeList propsToRemove) throws ParserConfigurationException {
-        Document responseDoc = DocumentBuilderFactory.newInstance()
-                    .newDocumentBuilder().newDocument();
-        UriRef subject = (UriRef) hierarchyNode.getNode();
-        Element hrefElement = responseDoc.createElementNS(davUri, href);
-        hrefElement.setTextContent(subject.getUnicodeString());
-        Element multistatus = responseDoc.createElementNS(davUri, multistat);
-        Element responseElement = responseDoc.createElementNS(davUri, response);
-        Element propOk = responseDoc.createElementNS(davUri, prop);
-        Element propForbidden = responseDoc.createElementNS(davUri, prop);
-
-        responseDoc.appendChild(multistatus);
-        multistatus.appendChild(responseElement);
-        responseElement.appendChild(hrefElement);
-
-        Map<Property, String> setMap = getNodeListAsMap(propsToSet);
-        Map<Property, String> removeMap = getNodeListAsMap(propsToRemove);
-        TripleCollection contentGraph = hierarchyNode.getGraph();
-        for(Map.Entry<Property, String> entry : setMap.entrySet()){
-            Property property = entry.getKey();
-            if(property.ns.equalsIgnoreCase(davUri)){
-                if(protectedProps.contains(property.prop)){
-                    propForbidden.appendChild(responseDoc
-                            .createElementNS(davUri, property.prop));
-                } else {
-                    UriRef predicate = new UriRef(property.value());
-                    Lock writeLock = hierarchyNode.writeLock();
-                    writeLock.lock();
-                    try {
-                        Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
-                        replaceProp(subject, predicate, valIter, contentGraph, entry);
-                    } finally {
-                        writeLock.unlock();
-                    }
-                    propOk.appendChild(responseDoc.createElementNS(davUri, property.prop));
-                }
-            } else {
-                UriRef predicate = new UriRef(property.value());
-                Lock writeLock = hierarchyNode.writeLock();
-                writeLock.lock();
-                try {
-                    Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
-                    replaceProp(subject, predicate, valIter, contentGraph, entry);
-                } finally {
-                    writeLock.unlock();
-                }
-                propOk.appendChild(responseDoc.createElementNS(property.ns, "R:" + property.prop));
-            }
-        }
-
-        for(Map.Entry<Property, String> entry : removeMap.entrySet()){
-            Property property = entry.getKey();
-            if(davProps.contains(property.prop)){
-                propForbidden.appendChild(responseDoc
-                            .createElementNS(davUri, property.prop));
-            } else {
-                UriRef predicate = new UriRef(property.value());
-                Lock writeLock = hierarchyNode.writeLock();
-                writeLock.lock();
-                try {
-                    Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
-                    Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
-                    while (valIter.hasNext()) {
-                        triplesToBeRemoved.add(new TripleImpl(subject, predicate, valIter.next()));
-                    }
-                    contentGraph.removeAll(triplesToBeRemoved);
-                } finally {
-                    writeLock.unlock();
-                }
-                propOk.appendChild(responseDoc.createElementNS(property.ns, property.prop));
-
-            }
-        }
-
-        if(propOk.hasChildNodes()){
-            Element propstatOk = responseDoc.createElementNS(davUri, propstat);
-            Element statusOk = responseDoc.createElementNS(davUri, status);
-            responseElement.appendChild(propstatOk);
-            propstatOk.appendChild(propOk);
-            propstatOk.appendChild(statusOk);
-            statusOk.setTextContent("HTTP/1.1 200 OK");
-        }
-        if(propForbidden.hasChildNodes()){
-            Element propstatForbidden = responseDoc.createElementNS(davUri, propstat);
-            Element statusForbidden = responseDoc.createElementNS(davUri, status);
-            responseElement.appendChild(propstatForbidden);
-            propstatForbidden.appendChild(propForbidden);
-            propstatForbidden.appendChild(statusForbidden);
-            statusForbidden.setTextContent("HTTP/1.1 403 Forbidden");
-        }
-
-        return responseDoc;
-    }
-
-    private static Map<Property, String> getNodeListAsMap(NodeList nodeList) {
-        if (nodeList == null) {
-            return new HashMap<Property, String>();
-        }
-        Map<Property, String> result = new HashMap<Property, String>();
-        for (int i = 0; i < nodeList.getLength(); i++) {
-            Node node = nodeList.item(i);
-            String propName = node.getLocalName();
-            if (propName != null) {
-                String nsUri = node.getNamespaceURI();
-                result.put(new Property(nsUri, propName), node.getTextContent());
-            }
-        }
-        return result;
-    }
-
-    private static void replaceProp(UriRef subject, UriRef predicate,
-            Iterator<Resource> valIter, TripleCollection contentGraph,
-            Map.Entry<Property, String> entry) {
-        LiteralFactory fac = LiteralFactory.getInstance();
-        Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
-        if (valIter.hasNext()) {
-            triplesToBeRemoved.add(new TripleImpl(subject, predicate, valIter.next()));
-        }
-        contentGraph.removeAll(triplesToBeRemoved);
-        contentGraph.add(new TripleImpl(subject, predicate,
-                fac.createTypedLiteral(entry.getValue())));
-    }
-
-    private static String getLastSection(String s) {
-        return s.substring(s.lastIndexOf('/', s.length()-2));
-    }
-
-    /**
-     * Helper class whicht is a {@link HashMap} that maps {@link Property} to a {@link String}
-     * @author ali
-     */
-    @SuppressWarnings("serial")
-    static class PropertyMap extends HashMap<Property, String> {
-    }
-
-    static class Property {
-        final String ns;
-        final String prop;
-
-        public Property(String ns, String prop) {
-            this.ns = ns;
-            this.prop = prop;
-        }
-
-        public String value(){
-            return ns+prop;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java
deleted file mode 100644
index 012d917..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java
+++ /dev/null
@@ -1,74 +0,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.
- */
-
-package org.apache.clerezza.platform.content.collections;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.HIERARCHY;
-import org.apache.clerezza.rdf.ontologies.RDF;
-
-/**
- * Creates the collections containing a resource in an underlying MGraph
- *
- * @author reto
- */
-public class CollectionCreator {
-
-    private MGraph mGraph;
-
-    public CollectionCreator(MGraph mGraph) {
-        this.mGraph = mGraph;
-    }
-
-    public void createContainingCollections(UriRef uriRef) {
-        try {
-            URI uri = new URI(uriRef.getUnicodeString());
-            if (uri.getHost() == null) {
-                throw new IllegalArgumentException("Host name missing in " + uriRef);
-            }
-            String[] pathSections = uri.getRawPath().split("/");
-            for (int i = pathSections.length - 1; i >= 0 ; i--) {
-                String section = pathSections[i];
-                if (section.length() == 0) {
-                    if (i == 0) {
-                        return;
-                    } else {
-                        throw new IllegalArgumentException(
-                                uriRef+" contains consequtive slashes in path section");
-                    }
-                }
-                final String unicodeString = uriRef.getUnicodeString();
-                int lastIndexOf = unicodeString.lastIndexOf(section);
-                UriRef parentUriRef = new UriRef(unicodeString.substring(0, lastIndexOf));
-                mGraph.add(new TripleImpl(uriRef, HIERARCHY.parent, parentUriRef));
-                mGraph.add(new TripleImpl(parentUriRef, RDF.type, HIERARCHY.Collection));
-                uriRef = parentUriRef;
-
-            }
-        } catch (URISyntaxException ex) {
-            throw new IllegalArgumentException(ex);
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java
deleted file mode 100644
index 7881a34..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java
+++ /dev/null
@@ -1,53 +0,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.
- */
-package org.apache.clerezza.platform.content.genericmetadata;
-
-import java.util.Date;
-import javax.ws.rs.core.MediaType;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.ontologies.DCTERMS;
-
-/**
- * This class generates metadata about assets.
- *
- * @author tio
- */
-@Component()
-@Service(MetaDataGenerator.class)
-public class GenericMetaDataGenerator implements MetaDataGenerator {
-
-    @Override
-    public void generate(GraphNode node, byte[] data, MediaType mediaType) {
-        TypedLiteral dateLiteral = LiteralFactory.getInstance()
-                    .createTypedLiteral(new Date());
-        if(node.getObjects(DCTERMS.dateSubmitted).hasNext()) {
-            if(node.getObjects(DCTERMS.modified).hasNext()) {
-                node.deleteProperties(DCTERMS.modified);
-            }
-            node.addProperty(DCTERMS.modified, dateLiteral);
-        } else {
-            node.addProperty(DCTERMS.dateSubmitted, dateLiteral);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java
deleted file mode 100644
index 9b7c666..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java
+++ /dev/null
@@ -1,38 +0,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.
- */
-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 COPY requests
- * @author ali
- */
-
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod("COPY")
-public @interface COPY {
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java
deleted file mode 100644
index 8fb4630..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java
+++ /dev/null
@@ -1,38 +0,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.
- */
-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 LOCK requests
- * @author ali
- */
-
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod("LOCK")
-public @interface LOCK {
-
-}


[49/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala
new file mode 100644
index 0000000..3d8d929
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala
@@ -0,0 +1,646 @@
+/*
+ * 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.accountcontrolpanel
+
+import java.io.ByteArrayInputStream
+import java.io.IOException
+import java.io.InputStream
+import java.io.UnsupportedEncodingException
+import java.net.URL
+import java.security.AccessControlException
+import java.security.AccessController
+import java.security.MessageDigest
+import java.security.NoSuchAlgorithmException
+import java.security.PrivilegedAction
+import java.util.Dictionary
+import java.util.HashMap
+import java.util.HashSet
+import java.util.Hashtable
+import java.util.Iterator
+import java.util.Map
+import java.util.Set
+import javax.ws.rs.Consumes
+import javax.ws.rs.FormParam
+import javax.ws.rs.GET
+import javax.ws.rs.POST
+import javax.ws.rs.Path
+import javax.ws.rs.PathParam
+import javax.ws.rs.QueryParam
+import javax.ws.rs.WebApplicationException
+import javax.ws.rs.core.Context
+import javax.ws.rs.core.MediaType
+import javax.ws.rs.core.Response
+import javax.ws.rs.core.Response.ResponseBuilder
+import javax.ws.rs.core.UriInfo
+import org.apache.felix.scr.annotations.Component
+import org.apache.felix.scr.annotations.Property
+import org.apache.felix.scr.annotations.Reference
+import org.apache.felix.scr.annotations.ReferenceCardinality
+import org.apache.felix.scr.annotations.ReferencePolicy
+import org.apache.felix.scr.annotations.Service
+import org.osgi.framework.Bundle
+import org.osgi.framework.BundleException
+import org.osgi.service.cm.Configuration
+import org.osgi.service.cm.ConfigurationAdmin
+import org.osgi.service.component.ComponentContext
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+import org.apache.clerezza.jaxrs.utils.TrailingSlash
+import org.apache.clerezza.jaxrs.utils.RedirectUtil
+import org.apache.clerezza.jaxrs.utils.form.FormFile
+import org.apache.clerezza.jaxrs.utils.form.MultiPartBody
+import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.platform.config.SystemConfig
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
+import org.apache.clerezza.platform.typerendering.RenderletManager
+import org.apache.clerezza.platform.typerendering.scala.PageRenderlet
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet
+import org.apache.clerezza.rdf.core.BNode
+import org.apache.clerezza.rdf.core.Graph
+import org.apache.clerezza.rdf.core.Literal
+import org.apache.clerezza.rdf.core.LiteralFactory
+import org.apache.clerezza.rdf.core.MGraph
+import org.apache.clerezza.rdf.core.NonLiteral
+import org.apache.clerezza.rdf.core.Triple
+import org.apache.clerezza.rdf.core.TypedLiteral
+import org.apache.clerezza.rdf.core.UriRef
+import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl
+import org.apache.clerezza.rdf.core.impl.SimpleLiteralFactory
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph
+import org.apache.clerezza.rdf.core.impl.TripleImpl
+import org.apache.clerezza.rdf.ontologies.OSGI
+import org.apache.clerezza.rdf.ontologies.PERMISSION
+import org.apache.clerezza.rdf.ontologies.PLATFORM
+import org.apache.clerezza.rdf.ontologies.RDF
+import org.apache.clerezza.rdf.utils.GraphNode
+import org.apache.clerezza.rdf.utils.UnionMGraph
+
+object SettingPanel {
+  val logger: Logger = LoggerFactory.getLogger(classOf[SettingsPanel])
+}
+
+/**
+ *
+ * Account control panel
+ *
+ * @author mir, hasan
+ */
+@Path("/user/{id}/control-panel")
+class SettingsPanel {
+
+  import SettingPanel.logger
+
+  /**
+   * Mainpage
+   *
+   * @param id is the username as given in the URL
+   * @return an array of installed {@link Bundle}s to be managed
+   *
+   */
+  @GET
+  def settingsPage(@PathParam(value = "id") idP: String,
+              @QueryParam("changedPassword") changedPassword: String,
+              @Context uriInfo: UriInfo): GraphNode = {
+    TrailingSlash.enforceNotPresent(uriInfo)
+    val id: String = idP
+    var graphNode: GraphNode = null
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    try {
+      AccessController.checkPermission(new UserBundlePermission(id, ""))
+      graphNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
+        def run: GraphNode = {
+          var bundles: Array[Bundle] = userBundles(getAgent(id))
+          return asGraphNode(id, bundles)
+        }
+      })
+    }
+    catch {
+      case e: AccessControlException => {
+        graphNode = new GraphNode(new BNode, new SimpleMGraph)
+        graphNode.addProperty(CONTROLPANEL.userBundlePermission, LiteralFactory.getInstance.createTypedLiteral(false))
+      }
+    }
+    try {
+      AccessController.checkPermission(new ChangePasswordPermission(id, ""))
+      graphNode.addProperty(CONTROLPANEL.changePasswordPermission, LiteralFactory.getInstance.createTypedLiteral(true))
+    }
+    catch {
+      case e: AccessControlException => {
+        graphNode.addProperty(CONTROLPANEL.changePasswordPermission, LiteralFactory.getInstance.createTypedLiteral(false))
+      }
+    }
+    if (changedPassword != null && changedPassword.equals("false")) {
+      graphNode.addProperty(CONTROLPANEL.changedPassword, new PlainLiteralImpl("false"))
+    }
+    graphNode.addProperty(RDF.`type`, CONTROLPANEL.SettingsPage)
+    graphNode.addProperty(RDF.`type`, PLATFORM.HeadedPage)
+    return graphNode
+  }
+
+  private def addBundleDescriptionToGraph(responseGraph: MGraph, bundle: Bundle): Unit = {
+    var status: TypedLiteral = LiteralFactory.getInstance.createTypedLiteral(bundle.getState)
+    var bundleUri: UriRef = new UriRef(bundle.getLocation)
+    var triple: Triple = new TripleImpl(bundleUri, OSGI.status, status)
+    responseGraph.add(triple)
+    var bundleId: TypedLiteral = LiteralFactory.getInstance.createTypedLiteral(bundle.getBundleId)
+    triple = new TripleImpl(bundleUri, OSGI.bundle_id, bundleId)
+    responseGraph.add(triple)
+  }
+
+  private def asGraphNode(userId: String, bundles: Array[Bundle]): GraphNode = {
+    val responseGraph: MGraph = new SimpleMGraph
+    for (bundle <- bundles) {
+      addBundleDescriptionToGraph(responseGraph, bundle)
+    }
+    return AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
+      def run: GraphNode = {
+        var userDescriptionGraph: Graph = new GraphNode(getAgent(userId), systemGraph).getNodeContext
+        var unionGraph: UnionMGraph = new UnionMGraph(responseGraph, userDescriptionGraph)
+        var graphNode: GraphNode = new GraphNode(getAgent(userId), unionGraph)
+        graphNode.addProperty(CONTROLPANEL.userBundlePermission, LiteralFactory.getInstance.createTypedLiteral(true))
+        return graphNode
+      }
+    })
+  }
+
+  /**
+   * Retrieves all bundles owned by a user represented by agent
+   *
+   * @param agent represents the user who owns bundles to be returned
+   * @return an array of {@link Bundle}s owned by the user
+   *
+   */
+  private def userBundles(agent: NonLiteral): Array[Bundle] = {
+    logger.debug("Retrieve all bundles from user: {}", agent)
+    var installedBundles: Array[Bundle] = componentContext.getBundleContext.getBundles
+    val locationMapper: Map[String, Long] = new HashMap[String, Long]
+    for (b <- installedBundles) {
+      locationMapper.put(b.getLocation, b.getBundleId)
+    }
+    return AccessController.doPrivileged(new PrivilegedAction[Array[Bundle]] {
+      def run: Array[Bundle] = {
+        var bundles: Set[Bundle] = new HashSet[Bundle]
+        var agentBundles: Iterator[Triple] = systemGraph.filter(null, OSGI.owner, agent)
+        while (agentBundles.hasNext) {
+          val location: String = (agentBundles.next.getSubject.asInstanceOf[UriRef]).getUnicodeString
+          try {
+            val id: Long = locationMapper.get(location)
+            bundles.add(componentContext.getBundleContext.getBundle(id))
+          } catch {
+            case _:NumberFormatException => None
+          }
+        }
+        return bundles.toArray(new Array[Bundle](bundles.size))
+      }
+    })
+  }
+
+  private def getAgent(id: String): NonLiteral = {
+    logger.debug("Get agent with id {}", id)
+    var agents: Iterator[Triple] = systemGraph.filter(null, PLATFORM.userName, new PlainLiteralImpl(id))
+    if (agents.hasNext) {
+      return agents.next.getSubject
+    }
+    else {
+      logger.debug("System graph does not contain user: {}", id)
+      var responseBuilder: Response.ResponseBuilder = Response.ok("<html><body>User does not exist</body></html>")
+      throw new WebApplicationException(responseBuilder.build)
+    }
+  }
+
+  private def getAgentPathPrefix(agent: NonLiteral): PlainLiteralImpl = {
+    return AccessController.doPrivileged(new PrivilegedAction[PlainLiteralImpl] {
+      def run: PlainLiteralImpl = {
+        var pathPrefixes: Iterator[Triple] = systemGraph.filter(agent, OSGI.agent_path_prefix, null)
+        if (pathPrefixes.hasNext) {
+          return pathPrefixes.next.getObject.asInstanceOf[PlainLiteralImpl]
+        }
+        return null
+      }
+    })
+  }
+
+  /**
+   * Installs a bundle from the specified location.
+   *
+   * @param id is the username as given in the URL
+   * @param location specifies the URL of the bundle to be installed
+   * @return an array of installed {@link Bundle}s to be managed
+   *
+   */
+  @POST
+  @Path("install-bundle")
+  @Consumes def installBundle(@PathParam(value = "id") id: String, multiForm: MultiPartBody, @Context uriInfo: UriInfo): Response = {
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    AccessController.checkPermission(new UserBundlePermission(id, ""))
+    var formFiles: Array[FormFile] = multiForm.getFormFileParameterValues("bundle")
+    var filename: String = formFiles(0).getFileName
+    var bundleBytes: Array[Byte] = formFiles(0).getContent
+    if (bundleBytes.length == 0) {
+      var message: String = null
+      if (filename.equals("")) {
+        message = "No bundle specified"
+      }
+      else {
+        message = "Bundle has length 0"
+      }
+      var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(message)
+      throw new WebApplicationException(responseBuilder.build)
+    }
+    val bundleInputStream: InputStream = new ByteArrayInputStream(bundleBytes)
+    val location: String = "userbundle:" + id + "/" + filename
+    logger.info("Install bundle {} to location {}", id, location)
+    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
+      def run: Array[Bundle] = {
+        val agent: NonLiteral = getAgent(id)
+        val triple: Triple = new TripleImpl(new UriRef(location), OSGI.owner, agent)
+        try {
+          systemGraph.add(triple)
+          var bundle: Bundle = componentContext.getBundleContext.installBundle(location, bundleInputStream)
+          var prefix: PlainLiteralImpl = getAgentPathPrefix(agent)
+          if (prefix != null) {
+            addBundlePrefix(bundle, prefix.getLexicalForm)
+          }
+          return null
+        }
+        catch {
+          case ex: BundleException => {
+            systemGraph.remove(triple)
+            logger.debug("Failed to install a bundle from: {}", location)
+            logger.error("Exception during install bundle: {}", ex)
+            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ex.getMessage)
+            throw new WebApplicationException(responseBuilder.build)
+          }
+        }
+      }
+    })
+    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
+  }
+
+  private def addBundlePrefix(bundle: Bundle, prefix: String): Unit = {
+    var symbolicName: String = bundle.getSymbolicName
+    /*if (configAdmin != null) {
+      try {
+        var configuration: Configuration = configAdmin.getConfiguration(classOf[TriaxrsPrefixManager].getName)
+        val properties = configuration.getProperties match {
+          case null => new Hashtable[String, AnyRef]()
+          case dict: Dictionary[String, AnyRef] => dict
+        }
+        var mappings = TriaxrsPrefixManager.parseMappings(properties.get(TriaxrsPrefixManager.TRIAXRS_MAPPINGS).asInstanceOf[Array[String]])
+        logger.debug("Prefix {} added to bundle {}", prefix, symbolicName)
+        mappings.put(symbolicName, prefix)
+        var newMappings: Array[String] = TriaxrsPrefixManager.unparseMappings(mappings)
+        properties.put(TriaxrsPrefixManager.TRIAXRS_MAPPINGS, newMappings)
+        configuration.update(properties)
+      }
+      catch {
+        case e: IOException => {
+          logger.warn("Unable to update configuration: {}", e.toString)
+        }
+      }
+    }
+    else {
+      logger.warn("Cannot add prefix mapping. Configuration Admin is missing")
+    }*/
+  }
+
+  private[accountcontrolpanel] def removeBundlePrefix(bundle: Bundle): Unit = {
+    var symbolicName: String = bundle.getSymbolicName
+    /*if ((this.configAdmin != null) && (symbolicName != null)) {
+      try {
+        val configuration: Configuration = configAdmin.getConfiguration(classOf[TriaxrsPrefixManager].getName)
+        val properties = configuration.getProperties match {
+          case null => new Hashtable[String, AnyRef]()
+          case dict: Dictionary[String, AnyRef] => dict
+        }
+        val mappings = TriaxrsPrefixManager.parseMappings(properties.get(TriaxrsPrefixManager.TRIAXRS_MAPPINGS).asInstanceOf[Array[String]])
+        mappings.remove(symbolicName)
+        val newMappings: Array[String] = TriaxrsPrefixManager.unparseMappings(mappings)
+        properties.put(TriaxrsPrefixManager.TRIAXRS_MAPPINGS, newMappings)
+        configuration.update(properties)
+      }
+      catch {
+        case e: IOException => {
+          logger.warn("Unable to update configuration: {}", e.toString)
+        }
+      }
+    }
+    else {
+      logger.warn("Cannot add prefix mapping. Configuration Admin is missing")
+    }*/
+  }
+
+  /**
+   * Starts the bundle with the specified bundle id.
+   *
+   * @param id is the username as given in the URL
+   * @param bundleIdString specifies the id of the bundle to be started
+   * @return an array of installed {@link Bundle}s to be managed
+   *
+   */
+  @POST
+  @Path("start-bundle")
+  def startBundle(@PathParam(value = "id") idP: String,
+             @FormParam("bundleId") bundleIdStringP: String,
+             @Context uriInfo: UriInfo): Response = {
+    val id: String = idP
+    val bundleIdString: String = bundleIdStringP
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    AccessController.checkPermission(new UserBundlePermission(id, ""))
+    logger.info("Start bundle {} ", id)
+    val bundleId: Long = bundleIdString.toLong
+    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
+      def run: Array[Bundle] = {
+        try {
+          val bundle: Bundle = componentContext.getBundleContext.getBundle(bundleId)
+          bundle.start
+        }
+        catch {
+          case e: BundleException => {
+            logger.debug("Failed to start bundle {}", bundleIdString)
+            logger.error("Exception during start bundle: {}", e)
+            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage)
+            throw new WebApplicationException(responseBuilder.build)
+          }
+        }
+        return null
+      }
+    })
+    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
+  }
+
+  /**
+   * Stops the bundle with the specified bundle id.
+   *
+   * @param id is the username as given in the URL
+   * @param bundleIdString specifies the id of the bundle to be stopped
+   * @return an array of installed {@link Bundle}s to be managed
+   *
+   */
+  @POST
+  @Path("stop-bundle") def stopBundle(@PathParam(value = "id") idP: String,
+                          @FormParam("bundleId") bundleIdStringP: String,
+                          @Context uriInfo: UriInfo): Response = {
+    val id: String = idP
+    val bundleIdString: String = bundleIdStringP
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    AccessController.checkPermission(new UserBundlePermission(id, ""))
+    logger.info("Stop bundle {}", id)
+    val bundleId: Long = bundleIdString.toLong
+    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
+      def run: Array[Bundle] = {
+        try {
+          var bundle: Bundle = componentContext.getBundleContext.getBundle(bundleId)
+          bundle.stop
+        }
+        catch {
+          case e: BundleException => {
+            logger.debug("Failed to stop bundle ", bundleIdString)
+            logger.error("Exception during stop bundle: {}", e)
+            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage)
+            throw new WebApplicationException(responseBuilder.build)
+          }
+        }
+        return null
+      }
+    })
+    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
+  }
+
+  /**
+   * Uninstalls the bundle with the specified bundle id.
+   *
+   * @param id is the username as given in the URL
+   * @param bundleIdString specifies the id of the bundle to be uninstalled
+   * @return an array of installed {@link Bundle}s to be managed
+   *
+   */
+  @POST
+  @Path("uninstall-bundle")
+  def uninstallBundle(@PathParam(value = "id") idP: String,
+                @FormParam("bundleId") bundleIdStringP: String,
+                @Context uriInfo: UriInfo): Response = {
+    val id: String = idP
+    val bundleIdString: String = bundleIdStringP
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    AccessController.checkPermission(new UserBundlePermission(id, ""))
+    logger.info("Uninstall bundle {}", id)
+    val bundleId: Long = bundleIdString.toLong
+    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
+      def run: Array[Bundle] = {
+        val agent: NonLiteral = getAgent(id)
+        try {
+          var bundle: Bundle = componentContext.getBundleContext.getBundle(bundleId)
+          bundle.uninstall
+          val triple: Triple = new TripleImpl(new UriRef(bundle.getLocation), OSGI.owner, agent)
+          systemGraph.remove(triple)
+          removeBundlePrefix(bundle)
+        }
+        catch {
+          case e: BundleException => {
+            logger.debug("Failed to uninstall bundle {}", bundleIdString)
+            logger.error("Exception during uninstall bundle: {}", e)
+            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage)
+            throw new WebApplicationException(responseBuilder.build)
+          }
+        }
+        return null
+      }
+    })
+    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
+  }
+
+  /**
+   * changes the password of an user
+   *
+   * @param idP id is the username as given in the URL
+   * @param lang represents the user's new standard language.
+   * @return
+   */
+  @POST
+  @Path("change-language")
+  def changeUserLanguage(@PathParam(value = "id") idP: String,
+                  @FormParam("availablelanguages") lang: String,
+                  @Context uriInfo: UriInfo): Response = {
+    val id: String = idP
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
+      def run: AnyRef = {
+        var userNode: GraphNode = new GraphNode(getAgent(id), systemGraph)
+        userNode.deleteProperties(PLATFORM.preferredLangInISOCode)
+        userNode.addProperty(PLATFORM.preferredLangInISOCode, LiteralFactory.getInstance.createTypedLiteral(lang))
+        return null
+      }
+    })
+    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
+  }
+
+  /**
+   * changes the password of an user
+   *
+   * @param idP id is the username as given in the URL
+   * @param oldPW the current user password
+   * @param newPW the new password
+   * @param confirmNewPW the new password
+   * @return
+   */
+  @POST
+  @Path("change-password")
+  def changePassword(@PathParam(value = "id") idP: String,
+               @FormParam("oldPW") oldPW: String,
+               @FormParam("newPW") newPW: String,
+               @FormParam("confirmNewPW") confirmNewPW: String,
+               @Context uriInfo: UriInfo): Response = {
+    val id: String = idP
+    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
+    AccessController.checkPermission(new ChangePasswordPermission(id, ""))
+    var changedPassword: Boolean = false
+    if (newPW.trim.equals(confirmNewPW.trim) && checkPWStrings(oldPW, newPW)) {
+      changedPassword = AccessController.doPrivileged(new PrivilegedAction[Boolean] {
+        private def getCurrentPassword(agent: NonLiteral): String = {
+          var currentPassword: String = null
+          var oldPWTriple: Iterator[Triple] = systemGraph.filter(agent, PERMISSION.passwordSha1, null)
+          if (oldPWTriple.hasNext) {
+            var currentPWLiteral: Literal = oldPWTriple.next.getObject.asInstanceOf[Literal]
+            currentPassword = currentPWLiteral.getLexicalForm
+          }
+          return currentPassword
+        }
+
+        def run: Boolean = {
+          val agent: NonLiteral = getAgent(id)
+          var encodedOlpPW: String = getEncodedPW(oldPW)
+          var currentPassword: String = getCurrentPassword(agent)
+          if ((currentPassword != null) && !currentPassword.equals(encodedOlpPW)) {
+            logger.info("Typed wrong current password!")
+            return false
+          }
+          else {
+            removeOldPwAndAddNewPW(agent, currentPassword, newPW)
+            return true
+          }
+        }
+
+        private def removeOldPwAndAddNewPW(agent: NonLiteral, currentPassword: String, newPW: String): Unit = {
+          var newPWTriple: Triple = new TripleImpl(agent, PERMISSION.passwordSha1, new PlainLiteralImpl(getEncodedPW(newPW)))
+          if (currentPassword != null) {
+            var oldPWTriple: Triple = new TripleImpl(agent, PERMISSION.passwordSha1, new PlainLiteralImpl(currentPassword))
+            systemGraph.remove(oldPWTriple)
+            logger.debug("removed old password from systemgraph")
+          }
+          systemGraph.add(newPWTriple)
+          logger.debug("user " + id + " changed password")
+        }
+
+        private def getEncodedPW(password: String): String = {
+          if (password == null) {
+            return null
+          }
+          try {
+            return bytes2HexString(MessageDigest.getInstance("SHA1").digest(password.getBytes("UTF-8")))
+          }
+          catch {
+            case e: NoSuchAlgorithmException => {
+              throw new RuntimeException(e)
+            }
+            case e: UnsupportedEncodingException => {
+              throw new RuntimeException(e)
+            }
+          }
+        }
+
+        private def bytes2HexString(bytes: Array[Byte]): String = {
+          val HEXDIGITS: Array[Char] = "0123456789abcdef".toCharArray
+          val result = new Array[Char](bytes.length << 1)
+          var j: Int = 0
+          for (i <- 0 to bytes.length - 1) {
+            result(j) = HEXDIGITS(bytes(i) >> 4 & 0xF)
+            result(j + 1) = HEXDIGITS(bytes(i) & 0xF)
+            j += 2
+          }
+          return new String(result)
+        }
+      })
+    }
+    else {
+      logger.info("Changing password failed!")
+      changedPassword = false
+    }
+    if (changedPassword) {
+      return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
+    }
+    else {
+      return RedirectUtil.createSeeOtherResponse("../control-panel?changedPassword=false", uriInfo)
+    }
+  }
+
+  /**
+   * checks if the typed strings are valid
+   */
+  private def checkPWStrings(oldPW: String, newPW: String): Boolean = {
+    if (newPW.length == 0) {
+      return false
+    }
+    return true
+  }
+
+  /**
+   * The activate method is called when SCR activates the component configuration.
+   *
+   * @param componentContext
+   */
+  protected def activate(componentContext: ComponentContext): Unit = {
+    this.componentContext = componentContext
+  }
+
+  protected def bindConfigurationAdmin(configAdmin: ConfigurationAdmin): Unit = {
+    logger.debug("Binding configuration admin")
+    this.configAdmin = configAdmin
+  }
+
+  protected def unbindConfigurationAdmin(configAdmin: ConfigurationAdmin): Unit = {
+    logger.debug("Unbinding configuration admin")
+    this.configAdmin = null
+  }
+
+  protected def bindSystemGraph(mgraph: MGraph): Unit = {
+    systemGraph = mgraph
+  }
+
+  protected def unbindSystemGraph(mgraph: MGraph): Unit = {
+    if (systemGraph == mgraph) {
+      systemGraph = null
+    }
+  }
+
+  protected def bindCgProvider(contentgraphprovider: ContentGraphProvider): Unit = {
+    cgProvider = contentgraphprovider
+  }
+
+  protected def unbindCgProvider(contentgraphprovider: ContentGraphProvider): Unit = {
+    if (cgProvider == contentgraphprovider) {
+      cgProvider = null
+    }
+  }
+
+  private var componentContext: ComponentContext = null
+  private var systemGraph: MGraph = null
+  private var cgProvider: ContentGraphProvider = null
+  private var configAdmin: ConfigurationAdmin = null
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala
new file mode 100644
index 0000000..bb306aa
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala
@@ -0,0 +1,109 @@
+package org.apache.clerezza.platform.accountcontrolpanel.html
+
+/*
+ * 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 org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils._
+import org.apache.clerezza.rdf.ontologies.FOAF
+import org.apache.clerezza.rdf.ontologies.RDF
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.platform.typerendering.scala._
+
+
+
+/**
+ * Metadata class for the person panel
+ */
+class ContactConfirmRenderlet extends SRenderlet {
+  def getRdfType() = CONTROLPANEL.ContactConfirmPage
+
+
+  override def renderedPage(arguments: XmlResult.Arguments) = new XmlPerson(arguments)
+
+  /**
+   * Content class for the Person Panel
+   */
+  class XmlPerson(args: XmlResult.Arguments) extends XmlResult(args) {
+
+    import RenderingUtility._
+    
+    //
+    // the content itself.
+    // This is the piece that is closest to a pure ssp, though there is still too much code in it
+    //
+
+    override def content = {
+      val primarySubject = res/FOAF.primaryTopic
+      <div id="tx-content">
+        {
+        if (primarySubject.hasProperty(RDF.`type`, FOAF.Person)) {
+          <form action="addContact" method="post">
+            {render(primarySubject, "box-naked")}
+            <input type="hidden" name="webId" value={primarySubject*} />
+            <input type="submit" value="Add this contact" />
+          </form>
+        } else {
+          <div>
+          <span>The resource {primarySubject!} of type {primarySubject/RDF.`type`} is not known to be a Person</span>
+          {
+            import collection.JavaConversions._
+            val otherPersons = (for (t <- primarySubject.getNodeContext.filter(null, RDF.`type`, FOAF.Person))
+              yield t.getSubject).toList
+            val personsWithUri: List[UriRef] = for (otherPerson <- otherPersons;
+                if otherPerson.isInstanceOf[UriRef]) yield otherPerson.asInstanceOf[UriRef]
+            if (personsWithUri.isEmpty) {
+              <span>No person could be found</span>
+            } else {
+              <div>
+                Maybe you want to add {
+                  if (personsWithUri.size > 1) {
+                    "one of the following "+personsWithUri.size+" persons:"
+                  } else {
+                    "the person"
+                  }
+                }
+                {
+                  for (otherPerson <- personsWithUri) yield {
+                    <form action="addContact" method="post">
+                      <span>{otherPerson}</span>
+                      {render(otherPerson, "box-naked")}
+                      <input type="hidden" name="webId" value={otherPerson.getUnicodeString} />
+                      <input type="submit" value="Add this contact" />
+                    </form>
+                  }
+                }
+              </div>
+            }
+          }
+          {
+            <form action="addContact" method="post">
+            You can add {primarySubject} as contact even though it does not seem to be a person.
+            <input type="hidden" name="webId" value={primarySubject*} />
+            <input type="submit" value="Add anyway" />
+          </form>
+          } </div>
+        }
+      }
+      <a href="../profile" onclick="history.go(-1)">Cancel</a>
+      </div>
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala
new file mode 100644
index 0000000..2b9913c
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala
@@ -0,0 +1,63 @@
+package org.apache.clerezza.platform.accountcontrolpanel.html
+
+/*
+ * 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 org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils._
+import org.apache.clerezza.rdf.ontologies.FOAF
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.platform.typerendering.scala._
+import scala.xml.Text
+
+
+
+/**
+ * Metadata class for the person panel
+ */
+class PersonBox extends SRenderlet {
+  def getRdfType() = FOAF.Person
+
+  override def getModePattern = "box-naked"
+
+  override def renderedPage(arguments: XmlResult.Arguments) = new XmlPerson(arguments)
+
+  /**
+   * Content class for the Person Panel
+   */
+  class XmlPerson(args: XmlResult.Arguments) extends XmlResult(args) {
+
+    import RenderingUtility._
+    
+    //
+    // the content itself.
+    // This is the piece that is closest to a pure ssp, though there is still too much code in it
+    //
+
+    override def content = {
+      val pixml= getAgentPix(res)
+      <div class="personInABox">
+        <table><tr><td>{pixml}</td></tr>
+        <tr><td>{new Text(getName(res))}</td></tr>
+        </table>
+      </div>
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala
new file mode 100644
index 0000000..7d65dff
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala
@@ -0,0 +1,295 @@
+package org.apache.clerezza.platform.accountcontrolpanel.html
+
+/*
+ * 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 org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.foafssl.ontologies.CERT
+import org.apache.clerezza.foafssl.ontologies.RSA
+import org.apache.clerezza.platform.typerendering.scala._
+import java.math.BigInteger
+import java.util.Date
+import java.text._
+import org.apache.clerezza.rdf.core.UriRef
+import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.rdf.ontologies.{RDFS, DC, FOAF}
+
+class ProfilePanel extends SRenderlet {
+
+  override def getRdfType() = CONTROLPANEL.ProfilePage
+
+  override def renderedPage(arguments: XmlResult.Arguments) = new ProfilePanelXHTML(arguments)
+
+  class ProfilePanelXHTML(arguments: XmlResult.Arguments) extends XmlResult(arguments ) {
+
+    //set header properties
+
+    resultDocModifier.addStyleSheet("/account-control-panel/style/profile.css");
+    resultDocModifier.addScriptReference("/account-control-panel/scripts/profile.js");
+    resultDocModifier.addScriptReference("/account-control-panel/scripts/IEKeygen.js");
+    resultDocModifier.setTitle("Account Control Panel");
+    resultDocModifier.addNodes2Elem("tx-module", <h1>Account Control Panel</h1>);
+    resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Profile</a></li>);
+    resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li><a href="control-panel">Settings</a></li>);
+
+    //constants and variables
+
+    lazy val agent: RichGraphNode = res / FOAF.primaryTopic
+
+
+    // the content itself
+    // clearly in this case there is so much more in the the methods, that one could hesitate to call this an ssp
+
+    override def content = {
+      <div id="tx-content">
+        <h2>Personal Profile</h2>{agent ! match {
+          case _: BNode => createWebId()
+          case _: UriRef => existingWebId()
+         }}
+      </div>
+
+    }
+
+    //methods used to create content
+
+    def cp(s: Any) =  new UriRef("http://clerezza.org/2009/03/controlpanel#" + s)
+    def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
+
+
+    def createWebId() = {
+      <h3>Associate Profile to WebID</h3>
+      <div id="newOrExistingSelection">
+      <p>Your profile is not currently associated to a WebID. A WebID allows you
+        to link your friends as well as to log-in to many sites (supporting foaf+ssl
+        or open-id).
+      </p>
+      <p>You may either create a new WebID or associate your account to an
+        existing WebID. Only creating a WebID here will allow you to manage your
+        profile here.
+      </p>
+      <form action="#" id="associateSelection">
+        <button type="button" id="newWebIdButton">Create a new Web-Id</button>
+        <button type="button" id="existingWebIdButton">I already have a Web-ID and want to use it</button>
+      </form>
+      </div>
+      <div id="createNewWebId">
+      <p>You have chosen to create a new Web-Id.</p>
+      <p>The Web-ID will be created as follows:
+        <br/>
+        <ol>
+        <li>Web-Id:
+          {var webId = res / cp("suggestedPPDUri") *;
+          webId += "#me";
+          webId}
+        </li>
+        <li>Personal-Profile Document: {res/cp("suggestedPPDUri")*}</li>
+        </ol>
+      </p>
+      <form method="post" action="profile/create-new-web-id">
+        <input value="Create it!" type="submit"/>
+      </form>
+      </div>
+      <div id="setExistingWebId">
+      <p>Please enter your Web-Id, if your Web-Id supports Foaf+SSL you will
+        be able to use it to log in to this site.</p>
+      <form method="post" action="profile/set-existing-webid">
+        <label for="webid">WebID</label> <input type="text" name="webid" size="80" title="Web-ID"/>
+        <br/>
+        <input value="Associate Profile to Web-Id" type="submit"/>
+        <p/>
+      </form>
+      </div>
+
+    }
+
+    def existingWebId() = {
+      if ((res / cp("isLocalProfile")).as[Boolean]) {
+      existingLocalWebId()
+      } else {
+      roamingUser()
+      }
+    }
+
+
+    def existingLocalWebId() = {
+      <h3>Manage your profile</h3>
+       <p>Here you can change your public profile.</p>
+
+      <form method="post" action="profile/modify">
+      <input type="hidden" name="webId" value={agent *}/>
+      <table>
+        <tr><td class="formlabel">Name:</td>
+        <td><input type="text" name="name" value={agent / FOAF.name *}/></td>
+        </tr>
+        <tr><td class="formlabel multiline">Description:</td>
+        <td><textarea name="description" rows="3" cols="80">{agent / DC.description *}</textarea></td>
+        </tr>
+        <tr><td class="formlabel"><input value="Modify" type="submit"/></td><td/></tr>
+      </table>
+
+      <p/>
+      </form>
+
+      <h3>Contacts</h3>
+      
+      <table>{ var i =0
+        val friends = for (friend <- agent/FOAF.knows) yield {
+          <td><form method="post" action="profile/deleteContact">
+            {
+              friend! match {
+                case webId: UriRef => render(webId, "box-naked")
+                case _ => render(friend, "box-naked")
+              }
+            }
+            <br/>
+            <input type="hidden" name="contactWebId" value={friend*}/>
+            <input type="submit" value="remove contact" />
+          </form></td>
+        /*render(friend!.asInstanceOf[UriRef])
+              import PersonPanel._
+        <td class="personInABox">{personInABox(friend)}</td>*/
+       }
+       for (row <- friends.grouped(5)) yield <tr>{row}</tr>
+      }</table>
+      <form id="addContact" method="get" action="profile/addContact">
+      <label for="contactWebId">Add contact bei WebId:<br/></label>
+      <input type="text" name="contactWebId" size="80"/><input type="submit" value="add contact" />
+      </form>
+
+      <h3>Key and Certificate Creation</h3>
+
+      <script type="text/javascript"> <![CDATA[$(document).ready(  function() { configurePage(); }   ); ]]> </script>
+
+      <div id="iehelptext" style="display: none;">
+      <p>Using Internet Explorer under Windows Vista or above or Windows
+        Server 2008, you need to configure the following for this to work:</p>
+      <ul>
+        <li>Add this site to the <i>Trusted Sites</i> list: in Internet
+        Options -&gt; Security -&gt; Trusted Sites -&gt; Sites -&gt; Add ...</li>
+        <li>You may need to configure the trust level (in this tab), using
+        <i>Custom Level...</i>: enable <i>Initialize and script ActiveX
+          controls not marked as safe for scripting</i>.</li>
+        <li>If you are using Windows Vista without SP1 or above, you will
+        probably need to install <a href="cacert.crt">this certificate</a> as a
+        Trusted Root Certification Authority Certificate for your own
+        certificate installation to succeed. You should probably remove that
+        trusted root CA certificate afterwards.</li>
+      </ul>
+      </div>
+      <form id="keygenform" method="post" action="profile/keygen">
+      <input name="webId" id="webId" type="hidden" value={agent*} />
+      <table>
+        <colgroup><col width="1*"/><col/></colgroup>
+        <tr>
+        <td class="formlabel">Certificate Name:</td>
+        <td>
+          <input alt="create a certificate name that will help you distinguish it from others you may have" name="cn"
+              size="35" id="cn" type="text" value={ ((agent/FOAF.name*)+"@clerezza")}/>
+        </td>
+        </tr>
+        <tr>
+        <td class="formlabel">Key strength:</td>
+        <td id="keystrenghtd">
+          <keygen id="spkac" name="spkac" challenge="TheChallenge1"/>
+        </td>
+        </tr>
+        <tr>
+        <td class="formlabel">Valid for:</td>
+        <td>
+          <input type="text" name="days" value="365" size="4"/>
+          days <input type="text" name="hours" value="0.0" size="4"/> hours</td>
+        </tr>
+        <tr>
+        <td class="formlabel">Comment:</td>
+        <td><input type="text" name="comment" value="" size="80"/></td>
+        </tr>
+        <tr><td class="formlabel"><input id="keygensubmit" type="submit" value="create certificate" /></td><td/></tr>
+      </table>
+      </form>
+      <h3>Existing Certificates</h3>
+      <form method="post" action="profile/deletekey">
+      <table>
+        <tr><th>Delete</th><th>Certificate Details</th></tr>
+        <input name="webId" id="webId" type="hidden" value={agent*} />
+        <tbody>{
+          for (key <- agent/-CERT.identity )
+          yield { val modulus = (key/RSA.modulus).as[BigInteger]
+              if (modulus == null)  <span/> //todo: broken public key, should delete it
+              else <tr><td><input type="checkbox" name="keyhash" value={modulus.hashCode().toString()}/></td>
+            <td><table>
+              <tr><td class="propvalue">Created:</td><td>{beautifyDate(key/DC.date )}</td></tr>
+              <tr><td class="propvalue">Comment:</td><td>{ key/RDFS.comment* }</td></tr>
+              <tr><td class="propvalue multiline">Modulus:</td><td><code>{ beautifyHex(key/RSA.modulus) }</code></td></tr>
+              <tr><td class="propvalue">Exponent:</td><td><code>{ beautifyInt(key/RSA.public_exponent) }</code></td></tr>
+              </table>
+            </td>
+                </tr>}
+        }</tbody>
+      </table>
+      <input type="submit" value="Disable Keys"/>
+      </form>
+      <p></p>
+
+    }
+
+    def roamingUser() = {
+      <h3>Using remote profile</h3>
+       <p>
+      {agent / FOAF.nick *}, you have accessed this site using your WebID
+        {"<" + (agent *) + ">"}
+        which has not been
+        created on this site.To edit your profile you should visit the site issuing the
+        profile.</p>
+    }
+
+
+
+
+    def beautifyDate(dtIt: CollectedIter[RichGraphNode]) {
+      if (0 == dtIt.size) return "_"
+      DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.FULL).format(dtIt.as[Date])
+    }
+
+
+    def beautifyHex(dtIt: CollectedIter[RichGraphNode]): String = {
+      if (0 == dtIt.size) return "warning! missing. Key invalid"
+      //this is a problem, it should always be here or it is invalid, and key should be removed
+      val bigint: BigInteger = dtIt.as[BigInteger]
+      val bstr = bigint.toString(16).toUpperCase;
+      val sbuf = new StringBuffer(bstr.size + (bstr.size/2)+10)
+      var cnt = 0
+      for (c <- bstr.toCharArray) {
+      if ((cnt % 2) == 0) sbuf.append(' ')
+      sbuf.append(c)
+      cnt += 1
+      }
+      sbuf.toString
+    }
+
+
+
+    def beautifyInt(dtIt: CollectedIter[RichGraphNode] ) :String = {
+      if (0 == dtIt.size) return "warning! missing. Key invalid"
+      else return dtIt.as[BigInteger].toString
+    }
+  }
+}
+
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala
new file mode 100644
index 0000000..735aee0
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala
@@ -0,0 +1,94 @@
+/*
+ * 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.accountcontrolpanel.html
+
+
+import scala.xml.Node
+import scala.xml.NodeSeq
+import scala.xml.Text
+import java.net.URLEncoder
+import org.apache.clerezza._
+import org.apache.clerezza.rdf.core.UriRef
+import org.apache.clerezza.rdf.ontologies.FOAF
+import org.apache.clerezza.rdf.ontologies.RDFS
+import rdf.scala.utils.CollectedIter
+import rdf.scala.utils.RichGraphNode
+import rdf.scala.utils.Preamble._
+/**
+ * Some utility methods for the renderlets
+ */
+object RenderingUtility {
+  val emptyText = new Text("")
+
+  def ifE[T](arg:T)(template: T=>Node ):NodeSeq = {
+    def isEmpty(arg: Any): Boolean = {
+      arg match {
+        case prod: Product => prod.productIterator.forall(isEmpty(_))
+        case str: String => (str.size == 0)
+        case it: CollectedIter[RichGraphNode] => (it.size == 0)
+        case node: RichGraphNode => (null == node)
+        case other: AnyRef => (null == other)
+        case _ => false //literals can't be empty
+      }
+    }
+    if (isEmpty(arg)) return emptyText else template(arg)
+  }
+
+  def firstOf(node: RichGraphNode, uris: UriRef*):CollectedIter[RichGraphNode] = {
+    for (uri <- uris) {
+      val res : CollectedIter[RichGraphNode] = node/uri
+      if (res.size>0) return res
+    }
+    return new CollectedIter[RichGraphNode]()
+  }
+
+
+
+  /**
+   * Show a person: a picture, a link to their local profile and their name
+   * Different default icons should be shown if the agent is a person, company, group, robot...
+   *
+   * assumes the p is WebID node (can change later)
+   */
+  def getAgentPix(p: RichGraphNode) = {
+    val pix = firstOf(p, FOAF.depiction, FOAF.logo, FOAF.img).getNode match {
+      case uri: UriRef => uri.getUnicodeString
+      case _ => "http://upload.wikimedia.org/wikipedia/commons/0/0a/Gnome-stock_person.svg"
+    }
+    <a href={"/browse/person?uri="+encode(p*)}><img class="mugshot" src={pix}/></a>
+  }
+
+  private def encode(url: String): String =  URLEncoder.encode(url,"UTF8")
+
+  /**
+   * get a usable name from the properties available including nick
+   */
+  def getName(p: RichGraphNode): String =  {
+     val name = p/FOAF.name*;
+     if ("" != name ) { return name }
+     val firstNm: String = p/FOAF.firstName*;
+     val fmlyNm :String = firstOf(p, FOAF.family_name,FOAF.familyName)*;
+       if ("" != firstNm || "" != fmlyNm) { return firstNm+" "+fmlyNm }
+     return p*
+
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala
new file mode 100644
index 0000000..a2a58e6
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala
@@ -0,0 +1,163 @@
+/*
+ * 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.accountcontrolpanel.html
+
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
+import org.apache.clerezza.platform.typerendering.scala._
+
+
+class SettingsPanel extends SRenderlet {
+
+  val getRdfType = CONTROLPANEL.SettingsPage
+
+    override def renderedPage(arguments: XmlResult.Arguments) = new XmlResult(arguments ) {
+    override def content = {
+import org.apache.clerezza.rdf.core.UriRef
+import scala.xml.NodeBuffer
+import scala.collection.mutable.ListBuffer
+def cp(s: Any) = new UriRef("http://clerezza.org/2009/03/controlpanel#"+s)
+def osgi(s: Any) = new UriRef("http://clerezza.org/2008/11/osgi#"+s)
+def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
+val nodeBuff = new ListBuffer[NodeBuffer]
+resultDocModifier.setTitle("Account Control Panel");
+resultDocModifier.addNodes2Elem("tx-module", <h1>Account Control Panel</h1>);
+resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li><a href="profile">Profile</a></li>);
+resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Settings</a></li>);
+
+if ((res/cp("userBundlePermission")*) == "true") {
+  nodeBuff +=(<h2>Bundle Control Panel</h2>
+  <h3>Install Bundle</h3>
+
+  <form method="post" action="control-panel/install-bundle" enctype="multipart/form-data">
+    <input type="file" class="FieldText" name="bundle" size="30" title="bundle path"/><br/><br/>
+    <input style="width: 5em;" value="Install" type="submit"/><p />
+  </form>
+  <br/><br/>
+  <h3>User Bundles</h3>
+  <table border="1">
+  <tbody>
+    <tr>
+      <th>Location</th>
+      <th>Status</th>
+      <th colspan="4">Action</th>
+    </tr>
+
+    {for (renderlet <- (res/-osgi("owner")).sort((a,b) => ((a*)<(b*)))) yield
+    <tr>
+      <td>{renderlet*}</td>
+      <td>{renderlet/osgi("status")* match {
+        case "2" => "Installed"
+        case "4" => "Resolved"
+        case "8" => "Starting"
+        case "16" => "Stopping"
+        case "32" => "Active"
+        }}
+      </td>
+      {if (((renderlet/osgi("bundle_id")).length) > 0)
+      <td>
+      <form method="post" action="control-panel/start-bundle">
+      <input name="bundleId" value={(renderlet/osgi("bundle_id"))*} type="hidden"/>
+      <input value="start" type="submit"/>
+      </form>
+      </td>
+      <td>
+      <form method="post" action="control-panel/stop-bundle">
+      <input name="bundleId" value={(renderlet/osgi("bundle_id"))*} type="hidden"/>
+      <input value="stop" type="submit"/>
+      </form>
+      </td>
+      <td>
+      <form method="post" action="control-panel/uninstall-bundle">
+      <input name="bundleId" value={(renderlet/osgi("bundle_id"))*} type="hidden"/>
+      <input value="uninstall" type="submit"/>
+      </form>
+      </td>
+      else
+      <td colspan="3">Not registered as bundle</td>}
+      </tr>
+      }
+    </tbody>
+  </table>
+  <br/>)
+}
+
+if((res/cp("changePasswordPermission")*) == "true") {
+  nodeBuff +=(<h2>Change Password</h2>
+
+
+  <form action="control-panel/change-password" method="post">
+    <fieldset>
+      <ol style="display: block;">
+        <li class="tx-line" style="background-image: none;">
+          <label>Current Password:</label>
+          <span class="tx-item">
+            <input type="password" name="oldPW"/>
+          </span>
+        </li>
+        <li class="tx-line" style="background-image: none;">
+          <label>New Password:</label>
+          <span class="tx-item">
+            <input type="password" name="newPW"/>
+          </span>
+        </li>
+        <li class="tx-line" style="background-image: none;">
+          <label>Confirm new Password:</label>
+          <span class="tx-item">
+            <input type="password" name="confirmNewPW"/>
+          </span>
+        </li>
+        <br />
+        <input style="width: 5em;" type="submit" name="submit" value="Submit"/>
+      </ol>
+      <br/>
+    </fieldset>
+  </form>)
+
+
+}
+
+if((res/cp("changedPassword")).length > 0) {
+  nodeBuff +=(<br /><span>Password has not changed, either wrong current password or the
+        new password and the confirmation didn't match!<br /><br /></span>)
+}
+
+
+nodeBuff +=(<h2>Change user's default language</h2>
+  <form method="post" action="control-panel/change-language">
+    {render(context/platform("instance")/platform("languages"), "naked")}
+    <br/><br/>
+    <script type="text/javascript">$("#availablelanguages").val({"'" + (context/platform("user")/platform("preferredLangInISOCode")*) + "'"})</script>
+    <input style="width: 5em;" type="submit" name="submit" value="Submit"/>
+    <br/><br/>
+  </form>)
+
+<div id="tx-content">
+  <div class="tx-edit" style="margin-left: 0.5em;">
+  {if(nodeBuff.isEmpty)
+    <span>There are no settings you can configure for this account!</span>
+  else
+    nodeBuff
+  }
+  </div>
+</div>
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala
new file mode 100644
index 0000000..ae7953f
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala
@@ -0,0 +1,103 @@
+/*
+ * 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.accountcontrolpanel
+
+import java.security.Permission
+import org.slf4j.scala.Logging
+
+//note: file has lower class name, as it contains many classes
+
+
+/**
+ * superclass for the permission classes, to avoid a lot of boilerplate code
+ *
+ * @author bblfish, reto
+ */
+abstract
+class AbstractPermission(val accountName: String, val actions: String ="")
+  extends Permission(accountName) with Logging  {
+
+  if (actions != "") {
+    throw new RuntimeException(getClass.getName+": actions must be an empty String "+
+      "(second argument only in constructor for supporting building from canonical form")
+  }
+
+  def getActions: String = actions
+
+  /**
+   * A subclass implies another permission if and only if they are equals
+   */
+   override
+  def implies(permission: Permission): Boolean = {
+    logger.debug("checking for "+permission+" is implied by "+ this)
+    var result: Boolean = equals(permission)
+    return result
+  }
+
+  override
+  def equals(other: Any): Boolean =
+      other match {
+      case that:  AbstractPermission  =>  
+        (that eq this ) || ((this.getClass == that.getClass) && accountName == that.accountName )
+      case _ => false
+      }
+
+  /**
+   * For the hashCode the class and the accountName is considered
+   */
+  override
+  def hashCode: Int = {
+    return  getClass.hashCode + (if (accountName != null) accountName.hashCode else 0)
+  }
+}
+
+/**
+ * Permission to change the password
+ * @author ali
+ *
+ */
+class ChangePasswordPermission(accountName: String, actions: String ="")
+  extends AbstractPermission(accountName, actions) {
+
+}
+
+/**
+ * Permission to access the account control panel
+ *
+ * @author ali
+ *
+ */
+class AccountControlPanelAppPermission(accountName: String, actions: String ="")
+  extends AbstractPermission(accountName)  {
+
+
+}
+
+/**
+ * Permission for user to have own bundles
+ *
+ * @author mir
+ *
+ */
+class UserBundlePermission( accountName: String, actions: String ="")
+  extends AbstractPermission(accountName)  {
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..ff49a4d
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml
new file mode 100644
index 0000000..8d5a4cb
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml
@@ -0,0 +1,30 @@
+<?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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Usage" href="documentation/usage.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..38be885
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,28 @@
+<?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.
+
+-->
+
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>usage.xhtml</page>
+    </section>
+</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml
new file mode 100644
index 0000000..6c22c93
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml
@@ -0,0 +1,49 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Usage: How to use the Account Control Panel</title>
+	</head>
+	<body>
+		<h1>Usage: How to use the Account Control Panel</h1>
+		<p>Author: Tsuyoshi Ito - clerezza.org</p>
+		<p>Date: January 27, 2009</p>
+		<h2 id="list">1. List installed bundles</h2>
+		<p>
+			Each user can upload and install bundles into the platform. Users and permissions can be created via <a href="http://localhost:8282/admin/user-manager" target="_blank">http://localhost:8282/admin/user-manager</a> and <a href="http://localhost:8282/admin/role-manager" target="_blank">http://localhost:8282/admin/role-manager</a>. <br />
+			Enter the following URL: <a href="http://localhost:8282/user/admin/control-panel" target="_blank">http://localhost:8282/user/admin/control-panel</a> to list all bundles from the user "admin" (when asked to authenticate use username "admin" and password "admin). If you want to list installed bundles from another user, replace "admin" in the URL with the username of the other user.
+		</p>
+		<h2 id="install">2. Install a bundle</h2>
+		<p>
+            You can upload a bundle by clicking on the link <a href="http://localhost:8282/user/admin/control-panel/install-bundle-form">Install Bundle</a> on <a href="http://localhost:8282/user/admin/control-panel" target="_blank">http://localhost:8282/user/admin/control-panel</a>. Enter the URL of your bundle (e.g. Location: http://localhost/mybundle-1.0.jar) and click on the button "install". The uploaded and installed bundles have the same permission as you have. 
+        </p>
+		<h2 id="start">3. Start, Stop and Uninstall a bundle</h2>
+        <p>
+            A user can start, stop and  uninstall a bundle on <a href="http://localhost:8282/user/admin/control-panel" target="_blank">http://localhost:8282/user/admin/control-panel</a>, whereas "admin" can be replaced by another username. Click on the appropriate button for start , stop or uninstall a bundle.
+        </p>
+        <p>
+            That's all. Enjoy.
+        </p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..4b10edb
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html
@@ -0,0 +1,71 @@
+<!--
+
+ 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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2008 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>


[18/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/staticweb/scripts/language-list.js
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/staticweb/scripts/language-list.js b/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/staticweb/scripts/language-list.js
new file mode 100644
index 0000000..f88737e
--- /dev/null
+++ b/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/staticweb/scripts/language-list.js
@@ -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.
+ */
+
+/**
+ * The LanguageList is a global object which provides a function to retrieve
+ * the language selected in the language list widget.
+ * 
+ */
+
+LanguageList = new Object();
+
+
+LanguageList.getLanguage = function() {
+	var language = "";
+	$('#availablelanguages option:selected').each(function() {
+			language =  $(this).val();
+	});
+	return language;
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.ontologies/LICENSE b/platform/language/platform.language.ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/language/platform.language.ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.ontologies/pom.xml b/platform/language/platform.language.ontologies/pom.xml
new file mode 100644
index 0000000..e836b09
--- /dev/null
+++ b/platform/language/platform.language.ontologies/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.language</artifactId>
+        <version>0.3</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.language.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Language Ontologies</name>
+    <description>
+        Language Ontologies
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.ontologies/src/main/resources/org/apache/clerezza/platform/language/ontologies/language.rdf
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.ontologies/src/main/resources/org/apache/clerezza/platform/language/ontologies/language.rdf b/platform/language/platform.language.ontologies/src/main/resources/org/apache/clerezza/platform/language/ontologies/language.rdf
new file mode 100644
index 0000000..9e8ff8c
--- /dev/null
+++ b/platform/language/platform.language.ontologies/src/main/resources/org/apache/clerezza/platform/language/ontologies/language.rdf
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+
+<rdf:RDF
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:skos="http://www.w3.org/2008/05/skos#"
+>
+
+<!-- Ontology -->
+
+<owl:Ontology rdf:about="http://clerezza.org/2010/01/language#">
+	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
+	<dc:title xml:lang="en">
+		Clerezza Language
+	</dc:title>
+</owl:Ontology>
+
+
+<!-- Classes -->
+
+<rdfs:Class rdf:about="http://clerezza.org/2010/01/language#LanguageList">
+	 <rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List"/>
+     <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+     <rdfs:label xml:lang="en">Language List</rdfs:label>
+     <skos:definition xml:lang="en">A list containing Lingvoj language uris</skos:definition>
+     <rdfs:isDefinedBy rdf:resource="http://clerezza.org/2010/01/language#"/>
+</rdfs:Class>
+
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/pom.xml
----------------------------------------------------------------------
diff --git a/platform/language/pom.xml b/platform/language/pom.xml
new file mode 100644
index 0000000..cb1cae0
--- /dev/null
+++ b/platform/language/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.language</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Language</name>
+    <description>This bundles provides methods to manage languages in the Clerezza platform.
+    </description>
+    <modules>
+        <module>platform.language.ontologies</module>
+        <module>platform.language.core</module>
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/LICENSE
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/LICENSE b/platform/launcher.mulgara/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/platform/launcher.mulgara/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/pom.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/pom.xml b/platform/launcher.mulgara/pom.xml
new file mode 100644
index 0000000..2c44d16
--- /dev/null
+++ b/platform/launcher.mulgara/pom.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.2-SNAPSHOT</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.launcher.mulgara</artifactId>
+    <version>0.5-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Clerezza - Platform Launcher with Mulgara</name>
+    <description>Mulgara variant of standalone java application for launching the clerezza.org platform. It is also a bundle, but there is no OSGi container known to support this (we are working on it :-) ).</description>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.xsite</groupId>
+                <artifactId>xsite-maven-plugin</artifactId>
+                <configuration>
+                    <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                    <sitemapPath>content/sitemap.xml</sitemapPath>
+                    <skinPath>templates/skin.html</skinPath>
+                    <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>pre-site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.1</version>
+                <executions>
+                    <execution>
+                        <id>inline-jars</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>
+                                org.apache.clerezza.platform.launcher.storageless
+                            </includeArtifactIds>
+                            <outputDirectory>target/extracted</outputDirectory>
+                            <includes>**</includes>
+                            <excludes>
+                                META-INF/**
+                            </excludes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-platform-bundles</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-3</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeScope>runtime</includeScope>
+                            <excludeArtifactIds>slf4j-api</excludeArtifactIds>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.clerezza.platform.launcher.Main</mainClass>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Bundle-Name>Clerezza - Platform Launcher</Bundle-Name>
+                            <Bundle-SymbolicName>org.apache.clerezza.platform.launcher.tdb</Bundle-SymbolicName>
+                            <Bundle-Activator>org.apache.clerezza.platform.launcher.Main</Bundle-Activator>
+                            <Import-Package>org.osgi.framework,org.osgi.service.startlevel</Import-Package>
+                            <Private-Package>*</Private-Package>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>target/extracted/</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </resource>
+            <resource>
+                <targetPath>META-INF</targetPath>
+                <filtering>false</filtering>
+                <directory>${basedir}</directory>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.*</include>
+                </includes>
+            </resource>
+            <!-- the exclude rules are here because the maven-dependency-plugin
+            copies both -SNAPSHOT version as well as the one with the timestamp,
+            see http://jira.codehaus.org/browse/MDEP-209 -->
+            <resource>
+                <targetPath>bundles</targetPath>
+                <directory>target/bundles</directory>
+                <excludes>
+                    <exclude>**/*20*.*-*.jar</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.launcher.storageless</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!-- what makes this variant special -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.mulgara.storage</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.mulgara</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.openrdf.sesame</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/main/appended-resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/main/appended-resources/META-INF/NOTICE b/platform/launcher.mulgara/src/main/appended-resources/META-INF/NOTICE
new file mode 100644
index 0000000..27c71d2
--- /dev/null
+++ b/platform/launcher.mulgara/src/main/appended-resources/META-INF/NOTICE
@@ -0,0 +1,6 @@
+
+
+- Mort Bay Jetty Project (http://www.mortbay.org/jetty/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- WYMIWYG (http://wymiwyg.org/)
+- HP Labs Semantic Web Research (http://www.hpl.hp.com/semweb/)

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/resources/documentation/images/tut_1_class_diagram.png
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/resources/documentation/images/tut_1_class_diagram.png b/platform/launcher.mulgara/src/site/resources/documentation/images/tut_1_class_diagram.png
new file mode 100644
index 0000000..0bd04f4
Binary files /dev/null and b/platform/launcher.mulgara/src/site/resources/documentation/images/tut_1_class_diagram.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/resources/documentation/style/style.css b/platform/launcher.mulgara/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..ff49a4d
--- /dev/null
+++ b/platform/launcher.mulgara/src/site/resources/documentation/style/style.css
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/resources/images/clerezza.png b/platform/launcher.mulgara/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/launcher.mulgara/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/site.xml b/platform/launcher.mulgara/src/site/site.xml
new file mode 100644
index 0000000..62c8fd3
--- /dev/null
+++ b/platform/launcher.mulgara/src/site/site.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland).
+ * 
+ * Licensed 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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Information" href="documentation/information.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/xsite/content/information.xhtml
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/xsite/content/information.xhtml b/platform/launcher.mulgara/src/site/xsite/content/information.xhtml
new file mode 100644
index 0000000..5d30fab
--- /dev/null
+++ b/platform/launcher.mulgara/src/site/xsite/content/information.xhtml
@@ -0,0 +1,41 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Clerezza platform launcher with Mulgara storage</title>
+	</head>
+	<body>
+		<h1>Clerezza platform launcher with Jena TDB storage</h1>
+		<p>Author: Manuel Innerhofer - clerezza.org</p>
+		<p>Date: June 24, 2009</p>
+		<h2 id="information">Information</h2>
+		<p>
+			This is a launcher for the clerezza platform. It uses Mulgara as
+			rdf storage. For further information on how to use this launcher read
+			the documentation of the storageless launcher under
+            <br />
+			<a href="http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/</a>
+		</p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/xsite/content/sitemap.xml b/platform/launcher.mulgara/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..ecb9016
--- /dev/null
+++ b/platform/launcher.mulgara/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,26 @@
+<!--
+
+ 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.
+
+-->
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>information.xhtml</page>
+    </section>
+</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.mulgara/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/launcher.mulgara/src/site/xsite/templates/skin.html b/platform/launcher.mulgara/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..bb1b45d
--- /dev/null
+++ b/platform/launcher.mulgara/src/site/xsite/templates/skin.html
@@ -0,0 +1,71 @@
+<!--
+
+ 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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/DISCLAIMER
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/DISCLAIMER b/platform/launcher.sesame/DISCLAIMER
new file mode 100644
index 0000000..ab24be4
--- /dev/null
+++ b/platform/launcher.sesame/DISCLAIMER
@@ -0,0 +1,11 @@
+Apache Clerezza is an effort undergoing incubation at The Apache Software 
+Foundation (ASF), sponsored by the Apache Incubator. 
+
+Incubation is required of all newly accepted projects until a further 
+review indicates that the infrastructure, communications, and decision 
+making process have stabilized in a manner consistent with other 
+successful ASF projects. 
+
+While incubation status is not necessarily a reflection of the 
+completeness or stability of the code, it does indicate that the 
+project has yet to be fully endorsed by the ASF.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/LICENSE
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/LICENSE b/platform/launcher.sesame/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/platform/launcher.sesame/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/README.txt
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/README.txt b/platform/launcher.sesame/README.txt
new file mode 100644
index 0000000..6698c91
--- /dev/null
+++ b/platform/launcher.sesame/README.txt
@@ -0,0 +1,11 @@
+Apache Clerezza TDB Launcher
+
+The provided launcher jar is executable, however on most platform you must
+provide additional arguments to java so that Clerezza has enough memory to run.
+
+Start clerezza with:
+
+java -XX:MaxPermSize=400m -Dfile.encoding=utf-8 -Xss512k -Xmx2g -jar platform.launcher.tdb-*.jar
+
+Add the --help at the end of the line above to see possible argument for
+Clerezza

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/pom.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/pom.xml b/platform/launcher.sesame/pom.xml
new file mode 100644
index 0000000..9ae7e9a
--- /dev/null
+++ b/platform/launcher.sesame/pom.xml
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.3-SNAPSHOT</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.launcher.sesame</artifactId>
+    <version>0.5-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Clerezza - Platform Launcher with Sesame Storage</name>
+    <description>Sesame variant of standalone java application for launching the clerezza.org platform. It is also a bundle, but there is no OSGi container known to support this (we are working on it :-) ).</description>
+    <build>
+        <plugins>
+             <plugin>
+                    <groupId>org.codehaus.xsite</groupId>
+                    <artifactId>xsite-maven-plugin</artifactId>
+                    <configuration>
+                            <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                            <sitemapPath>content/sitemap.xml</sitemapPath>
+                            <skinPath>templates/skin.html</skinPath>
+                            <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                    </configuration>
+                    <executions>
+                            <execution>
+                                    <phase>pre-site</phase>
+                                    <goals>
+                                            <goal>run</goal>
+                                    </goals>
+                            </execution>
+                    </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.1</version>
+                <executions>
+                    <execution>
+                        <id>inline-jars</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>
+                                platform.launcher.storageless
+                            </includeArtifactIds>
+                            <outputDirectory>target/extracted</outputDirectory>
+                            <includes>**</includes>
+                            <excludes>
+                                META-INF/**
+                            </excludes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-platform-bundles</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-3</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeScope>runtime</includeScope>
+                            <excludeArtifactIds>slf4j-api</excludeArtifactIds>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.clerezza.platform.launcher.Main</mainClass>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Bundle-Name>Clerezza - Platform Launcher</Bundle-Name>
+                            <Bundle-SymbolicName>org.apache.clerezza.platform.launcher.sesame</Bundle-SymbolicName>
+                            <Bundle-Activator>org.apache.clerezza.platform.launcher.Main</Bundle-Activator>
+                            <Import-Package>org.osgi.framework,org.osgi.service.startlevel</Import-Package>
+                            <Private-Package>*</Private-Package>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.2.1</version>
+                <configuration>
+                    <finalName>clerezza-tdb</finalName>
+                    <descriptors>
+                        <descriptor>src/main/assembly/src.xml</descriptor>
+                    </descriptors>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
+                        <phase>package</phase> <!-- bind to the packaging phase -->
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>target/extracted/</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </resource>
+            <resource>
+                <targetPath>META-INF</targetPath>
+                <filtering>false</filtering>
+                <directory>${basedir}</directory>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.*</include>
+                </includes>
+            </resource>
+            <!-- the exclude rules are here because the maven-dependency-plugin
+            copies both -SNAPSHOT version as well as the one with the timestamp,
+            see http://jira.codehaus.org/browse/MDEP-209 -->
+            <resource>
+                <targetPath>bundles</targetPath>
+                <directory>target/bundles/</directory>
+                <excludes>
+                    <exclude>**/*20*.*-*.jar</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.launcher.storageless</artifactId>
+            <scope>provided</scope>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
+        <!-- what makes this variant special -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.sesame.storage</artifactId>
+            <scope>runtime</scope>
+            <version>0.13-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.openrdf.sesame</artifactId>
+            <scope>runtime</scope>
+            <version>0.5-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/main/appended-resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/main/appended-resources/META-INF/NOTICE b/platform/launcher.sesame/src/main/appended-resources/META-INF/NOTICE
new file mode 100644
index 0000000..27c71d2
--- /dev/null
+++ b/platform/launcher.sesame/src/main/appended-resources/META-INF/NOTICE
@@ -0,0 +1,6 @@
+
+
+- Mort Bay Jetty Project (http://www.mortbay.org/jetty/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- WYMIWYG (http://wymiwyg.org/)
+- HP Labs Semantic Web Research (http://www.hpl.hp.com/semweb/)

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/main/assembly/src.xml b/platform/launcher.sesame/src/main/assembly/src.xml
new file mode 100644
index 0000000..5c696d4
--- /dev/null
+++ b/platform/launcher.sesame/src/main/assembly/src.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>distribution</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <files>
+    <file>
+      <source>README.txt</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <!-- <file>
+        <source>target/platform.launcher.tdb-*-SNAPSHOT.jar</source>
+        <outputDirectory>/</outputDirectory>
+    </file> -->
+    <file>
+      <source>LICENSE</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <file>
+      <source>target/classes/META-INF/NOTICE</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <file>
+      <source>DISCLAIMER</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+  </files>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>LICENSE*</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>target</directory>
+            <includes>
+                <include>platform.launcher.sesame-*.jar</include>
+            </includes>
+            <excludes>
+                <exclude>*sources.jar</exclude>
+            </excludes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/resources/documentation/images/tut_1_class_diagram.png
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/resources/documentation/images/tut_1_class_diagram.png b/platform/launcher.sesame/src/site/resources/documentation/images/tut_1_class_diagram.png
new file mode 100644
index 0000000..0bd04f4
Binary files /dev/null and b/platform/launcher.sesame/src/site/resources/documentation/images/tut_1_class_diagram.png differ


[48/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE b/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml b/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml
new file mode 100644
index 0000000..023237b
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.accountcontrolpanel</artifactId>
+        <version>0.10</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.accountcontrolpanel.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Account Contral Panel Ontologies</name>
+    <description>
+        Ontologies of the Account Control Panel
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf b/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf
new file mode 100644
index 0000000..e6c76a8
--- /dev/null
+++ b/platform/accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf
@@ -0,0 +1,120 @@
+<?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.
+
+-->
+
+<rdf:RDF
+	xml:base="http://clerezza.org/2009/03/controlpanel#"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:skos="http://www.w3.org/2008/05/skos#"
+>
+
+<!-- Ontology -->
+
+<owl:Ontology rdf:about="http://clerezza.org/2009/03/controlpanel#">
+	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
+	<dc:title xml:lang="en">
+		Clerezza Concept Manager
+	</dc:title>
+</owl:Ontology>
+
+<!-- Classes -->
+
+<rdfs:Class rdf:about="#SettingsPage">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+	<rdfs:label xml:lang="en">account settings Page</rdfs:label>
+	<skos:definition xml:lang="en">A web page containing a list of bundles of a user. Over the page
+		bundles can be managed.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#ProfilePage">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+	<rdfs:label xml:lang="en">personal profile management page</rdfs:label>
+	<skos:definition xml:lang="en">A web page allowing users to change  
+	their profile.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#ContactConfirmPage">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+	<rdfs:label xml:lang="en">ContactConfirmPage</rdfs:label>
+	<skos:definition xml:lang="en">page for confiming a new contact
+	</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+</rdfs:Class>
+
+<!-- Properties -->
+
+<rdf:Property rdf:about="#userBundlePermission">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	<rdfs:label xml:lang="en">User Bundle Permission</rdfs:label>
+	<skos:definition xml:lang="en">Points to a boolean indicating if the user has
+		the permission to install bundles over his/her account control page, which is the subject.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+	<rdfs:domain rdf:resource="#SettingsPage" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#changePasswordPermission">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	<rdfs:label xml:lang="en">Change Password Permission</rdfs:label>
+	<skos:definition xml:lang="en">Points to a boolean indicating if the user has
+		the permission to change the password over his/her account control page, which is the subject.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+	<rdfs:domain rdf:resource="#SettingsPage" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#changedPassword">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	<rdfs:label xml:lang="en">change password</rdfs:label>
+	<skos:definition xml:lang="en">Points from a settings page over which an attempt was made to change the password of the user owning it
+		to a boolean indicating if an attempt succeeded.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+	<rdfs:domain rdf:resource="#SettingsPage" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#isLocalProfile">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	<rdfs:label xml:lang="en">profile local</rdfs:label>
+	<skos:definition xml:lang="en">Points from a profile page to a boolean 
+indicating if the server considers itself as authoritative for that profile.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+	<rdfs:domain rdf:resource="#SettingsPage" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#suggestedPPDUri">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	<rdfs:label xml:lang="en">Suggested PPD URI</rdfs:label>
+	<skos:definition xml:lang="en">Points to a uri suggested for a new local 
+	personal profile document of the subject.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
+	<rdfs:domain rdf:resource="#SettingsPage" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI"/>
+</rdf:Property>
+
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/accountcontrolpanel/pom.xml
----------------------------------------------------------------------
diff --git a/platform/accountcontrolpanel/pom.xml b/platform/accountcontrolpanel/pom.xml
new file mode 100644
index 0000000..a23edbd
--- /dev/null
+++ b/platform/accountcontrolpanel/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.accountcontrolpanel</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Account Control Panel</name>
+    <description>A web interface that provides functions to configure the account of a platform user.</description>
+    
+    <modules>
+        <module>platform.accountcontrolpanel.ontologies</module>
+        <module>platform.accountcontrolpanel.core</module>
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/LICENSE
----------------------------------------------------------------------
diff --git a/platform/concepts/LICENSE b/platform/concepts/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/concepts/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/README.txt
----------------------------------------------------------------------
diff --git a/platform/concepts/README.txt b/platform/concepts/README.txt
new file mode 100644
index 0000000..9edd812
--- /dev/null
+++ b/platform/concepts/README.txt
@@ -0,0 +1,18 @@
+JAX-RS resource called GenericResourcePage can be used to retrieve a resource and its associated concepts. 
+Go to http://[your.server]/concepts/generic-resource?uri=[resource] where [resource] 
+specifies the UriRef of the resource. Furthermore there is a JAX-RS resource called ResourceTagger
+ for associating concepts with resources. POST to http://[your.server]/concepts/tagger/set a form 
+with form parameter uri which specifies the UriRef of the resource and a form parameter 
+concepts which contains the UriRefs of the concepts.
+
+JAX-RS resource called ConceptManipulator can be used to add concept into the content graph
+The resource path is "/concepts/manipulator/add-concept" and the form parameters are
+pref-label, lang, and comment.
+
+On the client side there is a ConceptManipulator widget to add free concepts to the content graph
+and there is also a ConceptFinder widget to find exisiting concepts to be suggested for a specified search term.
+ 
+In ConceptManipulator widget and ConceptFinder widget a developer can register a callback function
+which is called when a concept is added to the list of selected concept.
+
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/LICENSE b/platform/concepts/platform.concepts.core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/pom.xml b/platform/concepts/platform.concepts.core/pom.xml
new file mode 100644
index 0000000..579930a
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/pom.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.concepts</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.concepts.core</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Concepts Core</name>
+    <description>The core part of Platform Concepts</description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.concepts.ontologies</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <scope>compile</scope>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.wink</groupId>
+            <artifactId>wink-common</artifactId>
+            <version>1.2.1-incubating</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java
new file mode 100644
index 0000000..25409bc
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java
@@ -0,0 +1,285 @@
+/*
+ * 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.concepts.core;
+
+import java.util.Date;
+import java.util.Iterator;
+import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.DC;
+import org.apache.clerezza.rdf.ontologies.OWL;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.ontologies.SKOS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+/**
+ * This class manages caches of SPARQL query results against a specific EndPoint
+ * and Graph.
+ *
+ * @author hasan
+ */
+class ConceptCache {
+    private UriRef sparqlEndPoint;
+    private UriRef defaultGraph;
+    private UriRef CONCEPT_CACHE_MGRAPH = new UriRef("urn:x-localinstance:/concept.cache");
+
+    /**
+     * Constructs a {@link ConceptCache} for the specified SPARQL EndPoint and
+     * Graph.
+     *
+     * @param sparqlEndPoint
+     *        the SPARQL EndPoint used in the query.
+     * @param defaultGraph
+     *        the Graph against which the query was executed.
+     *
+     */
+    public ConceptCache(UriRef sparqlEndPoint, UriRef defaultGraph) {
+        this.sparqlEndPoint = sparqlEndPoint;
+        this.defaultGraph = defaultGraph;
+    }
+
+    /**
+     * Caches the query results available in the specified Graph under a
+     * particular search term.
+     *
+     * @param searchTerm
+     *        the term used for querying concepts.
+     * @param parsedGraph
+     *        the Graph which contains query results.
+     */
+    void cache(String searchTerm, Graph parsedGraph) {
+        MGraph conceptCacheMGraph = getConceptCacheMGraph();
+        NonLiteral conceptCacheNode = getConceptCacheNode(conceptCacheMGraph);
+        if (conceptCacheNode != null) {
+            removeCachedConcepts(searchTerm, conceptCacheNode, conceptCacheMGraph);
+        }
+        addCacheEntry(searchTerm, conceptCacheNode, conceptCacheMGraph,
+                parsedGraph);
+    }
+
+    private MGraph getConceptCacheMGraph() {
+        MGraph conceptCacheMGraph = null;
+        TcManager tcManager = TcManager.getInstance();
+        try {
+            conceptCacheMGraph = tcManager.getMGraph(CONCEPT_CACHE_MGRAPH);
+        } catch (NoSuchEntityException nsee) {
+            conceptCacheMGraph = tcManager.createMGraph(CONCEPT_CACHE_MGRAPH);
+        }
+        return conceptCacheMGraph;
+    }
+
+    private NonLiteral getConceptCacheNode(MGraph conceptCacheMGraph) {
+        Iterator<Triple> conceptCaches = conceptCacheMGraph.filter(
+                null, RDF.type, CONCEPTS.ConceptCache);
+        while (conceptCaches.hasNext()) {
+            NonLiteral conceptCacheNode = conceptCaches.next().getSubject();
+            if (!conceptCacheMGraph.filter(conceptCacheNode,
+                    CONCEPTS.sparqlEndPoint, sparqlEndPoint).hasNext()) {
+                continue;
+            }
+            if (defaultGraph != null) {
+                if (!conceptCacheMGraph.filter(conceptCacheNode,
+                        CONCEPTS.defaultGraph, defaultGraph).hasNext()) {
+                    continue;
+                }
+            }
+            return conceptCacheNode;
+        }
+        return null;
+    }
+
+    private void removeCachedConcepts(String searchTerm,
+            NonLiteral conceptCacheNode, MGraph conceptCacheMGraph) {
+        NonLiteral conceptCacheEntryNode = getConceptCacheEntryNode(
+                searchTerm, conceptCacheNode, conceptCacheMGraph);
+        if (conceptCacheEntryNode == null) {
+            return;
+        }
+        GraphNode conceptCacheEntryGraphNode = new GraphNode(
+                conceptCacheEntryNode, conceptCacheMGraph);
+        removeCachedConcepts(conceptCacheEntryGraphNode);
+        conceptCacheMGraph.remove(new TripleImpl(conceptCacheNode,
+                CONCEPTS.cacheEntry, conceptCacheEntryNode));
+    }
+
+    private NonLiteral getConceptCacheEntryNode(String searchTerm,
+            NonLiteral conceptCacheNode, MGraph conceptCacheMGraph) {
+        TypedLiteral searchLiteral = LiteralFactory.getInstance()
+                .createTypedLiteral(searchTerm);
+        Iterator<Triple> cacheEntries = conceptCacheMGraph.filter(
+                conceptCacheNode, CONCEPTS.cacheEntry, null);
+        while (cacheEntries.hasNext()) {
+            NonLiteral conceptCacheEntryNode = (NonLiteral) cacheEntries.next()
+                    .getObject();
+            if (!conceptCacheMGraph.filter(conceptCacheEntryNode,
+                    CONCEPTS.searchTerm, searchLiteral).hasNext()) {
+                continue;
+            }
+            return conceptCacheEntryNode;
+        }
+        return null;
+    }
+
+    private void removeCachedConcepts(GraphNode conceptCacheEntryGraphNode) {
+        Iterator<Resource> searchResults =
+                conceptCacheEntryGraphNode.getObjects(CONCEPTS.searchResult);
+        while (searchResults.hasNext()) {
+            Resource concept = searchResults.next();
+            GraphNode conceptGraphNode = new GraphNode(concept,
+                    conceptCacheEntryGraphNode.getGraph());
+            conceptGraphNode.deleteProperties(OWL.sameAs);
+            conceptGraphNode.deleteProperties(RDFS.comment);
+            conceptGraphNode.deleteProperties(SKOS.prefLabel);
+            conceptGraphNode.deleteProperties(RDF.type);
+        }
+        conceptCacheEntryGraphNode.deleteProperties(CONCEPTS.searchResult);
+        conceptCacheEntryGraphNode.deleteProperties(DC.date);
+        conceptCacheEntryGraphNode.deleteProperties(CONCEPTS.searchTerm);
+        conceptCacheEntryGraphNode.deleteProperties(RDF.type);
+    }
+
+    private void addCacheEntry(String searchTerm, NonLiteral conceptCacheNode,
+            MGraph conceptCacheMGraph, Graph parsedGraph) {
+        GraphNode conceptCacheGraphNode = null;
+        if (conceptCacheNode == null) {
+            conceptCacheGraphNode = addConceptCacheNode(conceptCacheMGraph);
+        } else {
+            conceptCacheGraphNode = new GraphNode(conceptCacheNode,
+                    conceptCacheMGraph);
+        }
+        GraphNode conceptCacheEntryGraphNode = new GraphNode(new BNode(),
+                conceptCacheMGraph);
+        conceptCacheGraphNode.addProperty(CONCEPTS.cacheEntry,
+                conceptCacheEntryGraphNode.getNode());
+        conceptCacheEntryGraphNode.addProperty(RDF.type, CONCEPTS.SearchTerm);
+        conceptCacheEntryGraphNode.addProperty(CONCEPTS.searchTerm,
+                LiteralFactory.getInstance().createTypedLiteral(searchTerm));
+        conceptCacheEntryGraphNode.addProperty(DC.date,
+                LiteralFactory.getInstance().createTypedLiteral(new Date()));
+
+        Iterator<Triple> concepts = parsedGraph.filter(null, RDF.type, SKOS.Concept);
+        while (concepts.hasNext()) {
+            conceptCacheEntryGraphNode.addProperty(CONCEPTS.searchResult,
+                    concepts.next().getSubject());
+        }
+        conceptCacheMGraph.addAll(parsedGraph);
+    }
+
+    private GraphNode addConceptCacheNode(MGraph conceptCacheMGraph) {
+        GraphNode conceptCacheGraphNode = new GraphNode(new BNode(),
+                conceptCacheMGraph);
+        conceptCacheGraphNode.addProperty(RDF.type, CONCEPTS.ConceptCache);
+        conceptCacheGraphNode.addProperty(CONCEPTS.sparqlEndPoint,
+                sparqlEndPoint);
+        if (defaultGraph != null) {
+            conceptCacheGraphNode.addProperty(CONCEPTS.defaultGraph,
+                    defaultGraph);
+        }
+        return     conceptCacheGraphNode;
+    }
+
+    /**
+     * Retrieves concepts from the cache stored under the specified search term.
+     * Cache entries are invalid if they are older than the specified date.
+     *
+     * @param searchTerm
+     *        the search term under which the concepts are cached.
+     * @param acceptableOldestCachingDate
+     *        the Date before which a cache entry is considered invalid.
+     * @return
+     *        an {@link MGraph} containing the valid cached concepts.
+     */
+    MGraph retrieve(String searchTerm, Date acceptableOldestCachingDate) {
+        MGraph conceptCacheMGraph = getConceptCacheMGraph();
+
+        NonLiteral conceptCacheNode = getConceptCacheNode(conceptCacheMGraph);
+        if (conceptCacheNode == null) {
+            return null;
+        }
+        NonLiteral conceptCacheEntryNode = getConceptCacheEntryNode(searchTerm,
+                conceptCacheNode, conceptCacheMGraph);
+        if (conceptCacheEntryNode == null) {
+            return null;
+        }
+        GraphNode conceptCacheEntryGraphNode = new GraphNode(
+                conceptCacheEntryNode, conceptCacheMGraph);
+        Date cachingDate = getCachingDate(conceptCacheEntryGraphNode);
+        if (cachingDate == null || cachingDate.before(acceptableOldestCachingDate)) {
+            removeCachedConcepts(conceptCacheEntryGraphNode);
+            conceptCacheMGraph.remove(new TripleImpl(conceptCacheNode,
+                    CONCEPTS.cacheEntry, conceptCacheEntryNode));
+            return null;
+        }
+        return getCachedConcepts(conceptCacheEntryGraphNode);
+    }
+
+    private Date getCachingDate(GraphNode conceptCacheEntryGraphNode) {
+        Iterator<Literal> cachingDates = conceptCacheEntryGraphNode.getLiterals(
+                DC.date);
+        if (cachingDates.hasNext()) {
+            return LiteralFactory.getInstance().createObject(Date.class,
+                    (TypedLiteral) cachingDates.next());
+        }
+        return null;
+    }
+
+    private MGraph getCachedConcepts(GraphNode conceptCacheEntryGraphNode) {
+        MGraph resultMGraph = new SimpleMGraph();
+        MGraph conceptCacheMGraph = (MGraph) conceptCacheEntryGraphNode.getGraph();
+        NonLiteral conceptCacheNode = (NonLiteral) conceptCacheEntryGraphNode.getNode();
+        Iterator<Triple> triples = conceptCacheMGraph.filter(
+                conceptCacheNode, CONCEPTS.searchResult, null);
+        while (triples.hasNext()) {
+            UriRef concept = (UriRef) triples.next().getObject();
+            GraphNode graphNode = new GraphNode(concept, conceptCacheMGraph);
+            resultMGraph.add(new TripleImpl(concept, RDF.type, SKOS.Concept));
+
+            Iterator<Literal> prefLabelStatements = graphNode.getLiterals(SKOS.prefLabel);
+            while (prefLabelStatements.hasNext()) {
+                resultMGraph.add(new TripleImpl(concept, SKOS.prefLabel,
+                        prefLabelStatements.next()));
+            }
+            Iterator<Literal> commentStatements = graphNode.getLiterals(RDFS.comment);
+            while (commentStatements.hasNext()) {
+                resultMGraph.add(new TripleImpl(concept, RDFS.comment,
+                        commentStatements.next()));
+            }
+            Iterator<UriRef> sameAsStatements = graphNode.getUriRefObjects(OWL.sameAs);
+            while (sameAsStatements.hasNext()) {
+                resultMGraph.add(new TripleImpl(concept, OWL.sameAs,
+                        sameAsStatements.next()));
+            }
+        }
+        return resultMGraph;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java
new file mode 100644
index 0000000..18b1e6c
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java
@@ -0,0 +1,124 @@
+/*
+ * 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.concepts.core;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Language;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.PlainLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.ontologies.SKOS;
+import org.apache.clerezza.rdf.utils.UriRefUtil;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ * This JAX-RS resource can be used to add free concepts to the content graph.
+ * The URI path of this resource is /concepts/manipulator.
+ * 
+ * @author hasan
+ */
+@Component
+@Service(Object.class)
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("/concepts/manipulator")
+public class ConceptManipulator {
+
+    public static String FREE_CONCEPT_SCHEME = "concept-scheme/free-concepts";
+
+    @Reference
+    protected ContentGraphProvider cgProvider;
+
+    @Reference
+    private PlatformConfig platformConfig;
+
+    /**
+     * Creates and stores a concept with the specified prefLabel and comment
+     * into the content graph if a concept with this prefLabel does not already
+     * exist in the graph.
+     *
+     * @param prefLabel
+     *        if it is an empty string no concept is generated
+     * @param lang
+     *        the language of the prefLabel
+     * @param comment
+     *        is a human-readable description of the concept
+     * @return
+     *        - BAD REQUEST response if prefLabel is undefined or empty
+     *        - CONFLICT response if a concept with the same prefLabel and lang exists
+     *        - CREATED if everything is ok
+     */
+    @POST
+    @Path("add-concept")
+    public Response addConcept(@FormParam("pref-label") String prefLabel,
+            @FormParam("lang") String lang,
+            @FormParam("comment") String comment) {
+
+        if ((prefLabel == null) || (prefLabel.isEmpty())) {
+            return Response.status(Status.BAD_REQUEST)
+                    .entity("A concept must have a label!")
+                    .build();
+        }
+        MGraph contentGraph = cgProvider.getContentGraph();
+        PlainLiteral preferredLabel = new PlainLiteralImpl(prefLabel,
+                new Language(lang));
+
+        if (contentGraph.filter(null, SKOS.prefLabel, preferredLabel).hasNext()) {
+            return Response.status(Status.CONFLICT)
+                    .entity("A concept with the same label and language already exists!")
+                    .build();
+        }
+        
+        UriRef concept = getConceptUriRef(platformConfig, prefLabel);
+        contentGraph.add(new TripleImpl(concept, RDF.type,
+                SKOS.Concept));
+        String baseUri = platformConfig.getDefaultBaseUri().getUnicodeString();
+        contentGraph.add(new TripleImpl(concept, SKOS.inScheme,
+                new UriRef(baseUri + FREE_CONCEPT_SCHEME)));
+        contentGraph.add(new TripleImpl(concept, SKOS.prefLabel, preferredLabel));
+        if (!comment.isEmpty()) {
+            contentGraph.add(new TripleImpl(concept, RDFS.comment,
+                    new PlainLiteralImpl(comment, new Language(lang))));
+        }
+        return Response.status(Status.CREATED).entity(concept.getUnicodeString())
+                .build();
+    }
+
+    static UriRef getConceptUriRef(PlatformConfig platformConfig, String prefLabel) {
+        String baseUri = platformConfig.getDefaultBaseUri().getUnicodeString();
+        return new UriRef(baseUri + "concept/" +
+                UriRefUtil.stripNonUriRefChars(prefLabel));
+    }
+}
+
+
+
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java
new file mode 100644
index 0000000..cedd350
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java
@@ -0,0 +1,40 @@
+/*
+ * 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.concepts.core;
+
+import org.apache.clerezza.rdf.core.Graph;
+
+/**
+ * An implementation of this interface provides a function to retrieve
+ * concepts based on a search term.
+ * 
+ * @author hasan
+ */
+public interface ConceptProvider {
+    /**
+     * Returns a graph containing all concepts whose SKOS:prefLabels
+     * or SKOS:altLabels contain the search term.
+     *
+     * @param searchTerm a filter condition that specifies the term that must
+     *        be contained within SKOS:prefLabels or SKOS:altLabels of a concept.
+     * @return a Graph containing all concepts that meet the filter condition.
+     *
+     */
+    public Graph retrieveConcepts(String searchTerm);
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java
new file mode 100644
index 0000000..a7b39ec
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java
@@ -0,0 +1,39 @@
+/*
+ * 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.concepts.core;
+
+import java.util.List;
+
+/**
+ * An implementation of this class manages {@link ConceptProvider}s.
+ *
+ * @author hasan
+ */
+public interface ConceptProviderManager {
+
+    /**
+     * Returns a list of {@link ConceptProvider}s. The list order determines
+     * the priority of a {@link ConceptProvider}. The meaning of the priority
+     * is left to the implementation and application.
+     * 
+     * @return
+     *        a list of managed {@link ConceptProvider}s.
+     */
+    public List<ConceptProvider> getConceptProviders();
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java
new file mode 100644
index 0000000..c346a12
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java
@@ -0,0 +1,66 @@
+/*
+ *  Copyright 2010 reto.
+ * 
+ *  Licensed 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.
+ *  under the License.
+ */
+
+package org.apache.clerezza.platform.concepts.core;
+
+import java.security.Permission;
+import org.apache.clerezza.permissiondescriptions.PermissionInfo;
+
+/**
+ * Permssion to use an application to Manage Concept-Providers. Note that the
+ * user additionally need the respecitive rights on the underlying graphs.
+ *
+ * @author reto
+ */
+@PermissionInfo(value="Concept Provider Manager Access Permission", description="Grants access " +
+    "to the Concept Provider Manager page")
+public class ConceptProviderManagerAppPermission extends Permission {
+
+    public ConceptProviderManagerAppPermission() {
+        super("Graph Management permission");
+    }
+
+    /**
+     *
+     * @param target ignored
+     * @param action ignored
+     */
+    public ConceptProviderManagerAppPermission(String target, String actions) {
+        super("Graph Management permission");
+    }
+
+    @Override
+    public boolean implies(Permission permission) {
+        return equals(permission);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return getClass().equals(obj.getClass());
+    }
+
+    @Override
+    public int hashCode() {
+        return 77985;
+    }
+
+    @Override
+    public String getActions() {
+        return "";
+    }
+
+}


[16/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaApp.java
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaApp.java b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaApp.java
new file mode 100644
index 0000000..cbe8636
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaApp.java
@@ -0,0 +1,479 @@
+/*
+ * 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.launcher;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.security.AllPermission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+import org.apache.felix.framework.Felix;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.startlevel.StartLevel;
+import org.wymiwyg.commons.util.arguments.AnnotatedInterfaceArguments;
+import org.wymiwyg.commons.util.arguments.ArgumentHandler;
+import org.wymiwyg.commons.util.arguments.ArgumentProcessor;
+import org.wymiwyg.commons.util.arguments.InvalidArgumentsException;
+import org.wymiwyg.commons.util.dirbrowser.PathNameFilter;
+import org.wymiwyg.commons.util.dirbrowser.PathNode;
+import org.wymiwyg.commons.util.dirbrowser.PathNodeFactory;
+
+/**
+ * Clerezza Launcher Application.
+ *
+ *
+ * @author daniel, reto
+ */
+public class ClerezzaApp {
+
+    private Felix felixInstance = null;
+    private int exitCode = -1;
+    private List<ShutdownListener> shutdownListeners =
+            new ArrayList<ShutdownListener>(1);
+
+    /**
+     * Install bundles after core framework launch.
+     *
+     * @param context    the bundle context.
+     * @param artDescs    the bundles to install.
+     * @param nextLevel    the start level to change to after the installation.
+     * 
+     * @return    the installed bundles.
+     *
+     */
+    static Set<Bundle> installBundles(BundleContext context,
+            Collection<MavenArtifactDesc> artDescs,
+            int nextLevel) throws IOException, BundleException {
+
+        Set<Bundle> installedBundles = new HashSet<Bundle>();
+        for (MavenArtifactDesc artDesc : artDescs) {
+            try {
+                final Bundle installedBundle = context.installBundle(artDesc.toString(), artDesc.getInputStream());
+                installedBundles.add(installedBundle);
+            } catch (BundleException e) {
+                System.out.println(e.toString());
+            }
+        }
+
+        ServiceReference startLevelRef =
+                context.getServiceReference(StartLevel.class.getName());
+        StartLevel startLevel = (StartLevel) context.getService(startLevelRef);
+        for (Bundle bundle : installedBundles) {
+            startLevel.setBundleStartLevel(bundle, nextLevel);
+        }
+        return installedBundles;
+    }
+
+    /**
+     * Set Clerezza Instance system exit code.
+     *
+     * @param code    the code to set.
+     */
+    public void setExitCode(int code) {
+        exitCode = code;
+    }
+
+    /**
+     * Get Clerezza Instance system exit code.
+     *
+     * @return    the exit code.
+     */
+    public int getExitCode() {
+        return exitCode;
+    }
+
+    /**
+     * Add a shutdown listener.
+     * 
+     * @param shutdownListener    the shutdown listener.
+     */
+    public void addShutdownListener(ShutdownListener shutdownListener) {
+        shutdownListeners.add(shutdownListener);
+    }
+
+    /**
+     * Remove a shutdown Listener.
+     *
+     * @param shutdownListener    the shutdown listener.
+     */
+    public void removeShutdownListener(ShutdownListener shutdownListener) {
+        shutdownListeners.remove(shutdownListener);
+    }
+
+    /**
+     * Start this Clerezza Instance.
+     *
+     * Starts the Felix framework and installs CLerezza Bundles.
+     *
+     * This method exits after installing all bundles.
+     * It does not wait for the bundle installations to complete.
+     *
+     * @param args    Command line arguments.
+     */
+    public void start(String... args) throws Throwable {
+        LauncherArguments arguments;
+        try {
+            final ArgumentHandler argumentHandler = new ArgumentHandler(args);
+            arguments = argumentHandler.getInstance(LauncherArguments.class);
+            argumentHandler.processArguments(new ArgumentProcessor() {
+
+                @Override
+                public void process(List<String> remaining) throws InvalidArgumentsException {
+                    if (remaining.size() > 0) {
+                        throw new InvalidArgumentsException("The following arguments could not be understood: " + remaining);
+                    }
+                }
+            });
+        } catch (InvalidArgumentsException e) {
+            System.out.println(e.getMessage());
+            showUsage();
+            return;
+        }
+        if (arguments.getHelp()) {
+            showUsage();
+            return;
+        }
+        start(arguments);
+    }
+
+    private void start(LauncherArguments arguments) throws Throwable {
+        Properties configProps = getConfigProps(arguments);
+        Policy.setPolicy(new Policy() {
+
+            @Override
+            public PermissionCollection getPermissions(ProtectionDomain domain) {
+                PermissionCollection result = new Permissions();
+                result.add(new AllPermission());
+                return result;
+            }
+        });
+        System.setSecurityManager(new SecurityManager());
+        felixInstance = new Felix(configProps);
+        System.out.println("starting felix");
+        felixInstance.start();
+        final String revertParam = arguments.getRevertParam();
+        final PathNode bundlesRoot = PathNodeFactory.getPathNode(Main.class.getResource("/bundles"));
+        final BundleContext bundleContext = felixInstance.getBundleContext();
+        installBundlesForStartLevels(bundleContext, bundlesRoot, revertParam);
+    }
+
+    /**
+     * Stop this Clerezza instance.
+     *
+     * This method does not wait for the shutdown to complete before it exits.
+     */
+    public void stop() throws Throwable {
+        if (felixInstance != null) {
+            felixInstance.stop();
+        }
+    }
+
+    /**
+     * Wait for this Clerezza instance to shut down.
+     *
+     * After shut down all shutdown listeners are notified.
+     */
+    public void waitForStop() throws Throwable {
+        FrameworkEvent event = null;
+        try {
+            if (felixInstance != null) {
+                event = felixInstance.waitForStop(0);
+            }
+            setExitCode(0);
+        } catch (Throwable t) {
+            setExitCode(-1);
+            event = new FrameworkEvent(FrameworkEvent.ERROR, null, t);
+            throw t;
+        } finally {
+            notifyShutdownListeners(event);
+        }
+    }
+
+    private void notifyShutdownListeners(FrameworkEvent event) {
+        for (ShutdownListener shutdownListener : shutdownListeners) {
+            shutdownListener.notify(event);
+        }
+    }
+
+    private void installBundlesForStartLevels(final BundleContext bundleContext,
+            final PathNode bundlesRoot, final String revertParam) throws IOException, BundleException {
+        final String startlevelpathprefix = "startlevel-";
+        final String[] startLevelePaths = bundlesRoot.list(new PathNameFilter() {
+
+            @Override
+            public boolean accept(PathNode dir, String name) {
+                return name.startsWith(startlevelpathprefix);
+            }
+        });
+        Arrays.sort(startLevelePaths);
+        final Bundle[] installedBundles = bundleContext.getBundles();
+        final Set<Bundle> newlyInstalledBundles = new HashSet<Bundle>();
+        byte startLevel = 0;
+        for (String startLevelPath : startLevelePaths) {
+            startLevel = Byte.parseByte(
+                    startLevelPath.substring(startlevelpathprefix.length(),
+                    startLevelPath.length() - 1));
+            final PathNode startLevelPathNode = bundlesRoot.getSubPath(startLevelPath);
+            Set<MavenArtifactDesc> artDescs = getArtDescsFrom(startLevelPathNode);
+            if (revertParam != null) {
+                artDescs = getRevertArtifacts(revertParam, artDescs, installedBundles);
+            }
+            if (!alreadyInstalled(artDescs, installedBundles) || revertParam != null) {
+                newlyInstalledBundles.addAll(installBundles(bundleContext, new TreeSet(artDescs), startLevel));
+                System.out.println("level " + startLevel + " bundles installed");
+            }
+        }
+
+        for (Bundle bundle : newlyInstalledBundles) {
+            try {
+                bundle.start();
+            } catch (BundleException e) {
+                System.out.println("Exception installing Bundle " + bundle + ": " + e.toString());
+            }
+        }
+
+        ServiceReference startLevelRef =
+                bundleContext.getServiceReference(StartLevel.class.getName());
+        StartLevel startLevelService = (StartLevel) bundleContext.getService(startLevelRef);
+        startLevelService.setInitialBundleStartLevel(startLevel + 1);
+        startLevelService.setStartLevel(startLevel + 20);
+    }
+
+    private Set<MavenArtifactDesc> getArtDescsFrom(PathNode pathNode) {
+        Set<MavenArtifactDesc> result = new HashSet<MavenArtifactDesc>();
+        List<PathNode> jarPaths = getJarPaths(pathNode);
+        for (PathNode jarPath : jarPaths) {
+            result.add(MavenArtifactDesc.parseFromPath(jarPath));
+        }
+
+        return result;
+    }
+
+    private List<PathNode> getJarPaths(PathNode pathNode) {
+        List<PathNode> result = new ArrayList<PathNode>();
+        for (String childName : pathNode.list()) {
+            PathNode childNode = pathNode.getSubPath(childName);
+            if ((!childNode.isDirectory()) && (childName.endsWith(".jar"))) {
+                result.add(childNode);
+            } else {
+                for (PathNode subPath : getJarPaths(childNode)) {
+                    result.add(subPath);
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Returns true if a bundle is found, whose location starts with a short URI
+     * ("mvn:[groupId]/[artifactId]") of a Maven Artifact specified.
+     *
+     * Returns false iff none of the specified Maven Artifacts is installed.
+     *
+     * @param artDescs MavenArtifacts to be checked if a corresponding bundle is
+     *        already installed
+     * @param installedBundles Bundles installed in the framework
+     * @return
+     */
+    private boolean alreadyInstalled(Set<MavenArtifactDesc> artDescs,
+            Bundle[] installedBundles) {
+        for (int i = 0; i < installedBundles.length; i++) {
+            String bundleLocation = installedBundles[i].getLocation();
+            for (Iterator<MavenArtifactDesc> it = artDescs.iterator(); it.hasNext();) {
+                MavenArtifactDesc mavenArtifactDesc = it.next();
+                if (bundleLocation.matches(mavenArtifactDesc.getShortUri() + "/.*[0-9].*")) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Returns the Maven Artifacts that have to be reverted to default.
+     * If the revertParam equals "all", then all platform bundles already installed
+     * are uninstalled and the returned <code>Set</code> contains all
+     * Maven Artifacts.
+     * If the revertParam is a regular expression, then the returned <code>Set</code>
+     * contains all Maven Artifacts, whose short URI matches the expression. If
+     * a corresponding bundle is installed, then it is uninstalled.
+     * If the revertParam equals "missing" then the returned <code>Set</code>
+     * contains all Maven Artifacts that are not installed.
+     * @param revertParam
+     * @param artDescs
+     * @param installedBundles
+     * @return
+     * @throws org.osgi.framework.BundleException
+     */
+    private Set<MavenArtifactDesc> getRevertArtifacts(String revertParam,
+            Set<MavenArtifactDesc> artDescs,
+            Bundle[] installedBundles) throws BundleException {
+        boolean installMissing = revertParam.toLowerCase().equals("missing");
+        if (revertParam.equals("all")) {
+            revertParam = ".*";
+        }
+        Set<MavenArtifactDesc> artsToBeInstalled = new HashSet<MavenArtifactDesc>();
+        for (Iterator<MavenArtifactDesc> it = artDescs.iterator(); it.hasNext();) {
+            MavenArtifactDesc mavenArtifactDesc = it.next();
+            boolean isInstalled = false;
+            if (mavenArtifactDesc.getShortUri().matches(revertParam) || installMissing) {
+                for (int i = 0; i < installedBundles.length; i++) {
+                    Bundle bundle = installedBundles[i];
+                    if (bundle.getLocation().matches(mavenArtifactDesc.getShortUri() + "/.*[0-9].*")) {
+                        if (installMissing) {
+                            isInstalled = true;
+                        } else {
+                            bundle.uninstall();
+                        }
+                    }
+                }
+                if (!installMissing || (installMissing && !isInstalled)) {
+                    artsToBeInstalled.add(mavenArtifactDesc);
+                }
+            }
+        }
+        return artsToBeInstalled;
+    }
+
+    /**
+     * Prints usage instructions to stdout
+     */
+    public static void showUsage() {
+        System.out.print("Usage: LaunchBundle ");
+        System.out.println(AnnotatedInterfaceArguments.getArgumentsSyntax(LauncherArguments.class));
+        PrintWriter out = new PrintWriter(System.out, true);
+        AnnotatedInterfaceArguments.printArgumentDescriptions(
+                LauncherArguments.class, out);
+        out.flush();
+    }
+    
+
+    private Properties getConfigProps(LauncherArguments arguments) {
+
+        Properties configProps = new Properties();
+        
+        configProps.putAll(System.getProperties());
+        //ignored as we're setting the starlevel manually to last used start-level + 20
+        //configProps.put("org.osgi.framework.startlevel.beginning", "20");
+        {
+            if (arguments.getNotConsoleShell()) {
+                configProps.put("clerezza.shell.disable",
+                    "true");
+            }
+        }
+        
+        {
+            String argLogLevel = arguments.getLogLevel();
+            if (argLogLevel == null) {
+                argLogLevel = "INFO";
+            }
+            System.out.println("setting log-level to: " + argLogLevel);
+            configProps.put("org.ops4j.pax.logging.DefaultServiceLog.level",
+                    argLogLevel);
+        }
+        {
+            final String port = arguments.getPort();
+            if (port != null) {
+                configProps.put("org.osgi.service.http.port", port);
+            }
+            configProps.put("org.ops4j.pax.url.mvn.repositories", getCommaSeparatedListOfMavenRepos());
+        }
+        
+        {
+            //sun.reflect added because of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6265952 and loading of scala scripts
+            String extraPackages = (String) configProps.get("org.osgi.framework.system.packages.extra");
+            if (extraPackages == null) {
+                extraPackages = "sun.misc;sun.reflect";
+            } else {
+                extraPackages = "sun.misc;sun.reflect;"+extraPackages;
+            }
+            configProps.put("org.osgi.framework.system.packages.extra",extraPackages);
+        }
+
+        //public static final String CONTEXT_PROPERTY_HTTP_PORT_SECURE = "";
+        boolean httpsEnabled = false;
+        {
+
+            final String httpsPort = arguments.getSecurePort();
+            if (httpsPort != null && !"".equals(httpsPort)) {
+                configProps.put("org.osgi.service.http.port.secure", httpsPort);
+                httpsEnabled = true;
+            }
+        }
+        {
+
+            final String keyStorePath = arguments.getKeyStorePath();
+            if (keyStorePath != null && !"".equals(keyStorePath)) {
+                configProps.put("org.wymiwyg.jetty.httpservice.https.keystore.path", keyStorePath);
+                httpsEnabled = true;
+            }
+        }
+        {
+
+            final String keyStorePassword = arguments.getKeyStorePassword();
+            if (keyStorePassword != null && !"".equals(keyStorePassword)) {
+                configProps.put("org.wymiwyg.jetty.httpservice.https.keystore.password", keyStorePassword);
+                httpsEnabled = true;
+            }
+        }
+        {
+
+            final String keyStoreType = arguments.getKeyStoreType();
+            if (keyStoreType != null && !"".equals(keyStoreType)) {
+                configProps.put("org.wymiwyg.jetty.httpservice.https.keystore.type", keyStoreType);
+                httpsEnabled = true;
+            }
+        }
+
+        {
+
+            final String clientAuth = arguments.getClientAuth();
+            if (clientAuth != null && !"".equals(clientAuth)) {
+                configProps.put("org.wymiwyg.jetty.httpservice.clientauth", clientAuth);
+                httpsEnabled = true;
+            }
+        }
+
+        if (httpsEnabled) {
+            configProps.put("org.osgi.service.http.secure.enabled", "true");
+        }
+        return configProps;
+
+    }
+
+    private String getCommaSeparatedListOfMavenRepos() {
+        return "http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases@id=apache-snapshots,"
+                + "http://repo1.maven.org/maven2/@id=central";
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java
new file mode 100644
index 0000000..fb99d3b
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java
@@ -0,0 +1,70 @@
+/*
+ * 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.launcher;
+
+import org.wymiwyg.commons.util.arguments.CommandLine;
+
+/**
+ *
+ * @author mir
+ */
+public interface LauncherArguments {
+
+    @CommandLine(longName = "revert", shortName = {"R"}, required = false,
+    description = "Command to revert platform bundles to default. all|missing|<bundle-uri-pattern>")
+    public String getRevertParam();
+
+    @CommandLine(longName = "help", shortName = {"H"}, required = false,
+    isSwitch = true, description = "Show help on command line arguments")
+    public boolean getHelp();
+
+    @CommandLine(longName = "log", shortName = {"L"}, required = false,
+    description = "set the log-level, the value is one of the following: " +
+    "TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or NONE")
+    public String getLogLevel();
+
+    @CommandLine(longName = "port", shortName = {"P"}, required = false,
+    description = "The port on which the default webservice shall listen")
+    public String getPort();
+    
+    @CommandLine(longName = "https_port", shortName = {}, required = false,
+    description = "The port on which the https secure webserver shall listen")
+    public String getSecurePort();
+    
+    @CommandLine(longName = "https_keystore_path", shortName = {}, required = false,
+    description = "The folder with the keystore for https")
+    public String getKeyStorePath();
+    
+    @CommandLine(longName = "https_keystore_password", shortName = {}, required = false,
+    description = "The password for accessing the keystore for https")
+    public String getKeyStorePassword();
+    
+    @CommandLine(longName = "https_keystore_type", shortName = {}, required = false,
+    description = "The type of the key-store")
+    public String getKeyStoreType();
+    
+    @CommandLine(longName = "https_keystore_clientauth", shortName = {}, required = false,
+    description = "Client Auth request, one of \"none\", \"want\" or \"need\"")
+    public String getClientAuth();
+
+    @CommandLine(longName = "noConsoleShell", shortName = {"NCS"}, required = false,
+    isSwitch = true, description = "Disable the console shell")
+    public boolean getNotConsoleShell();
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java
new file mode 100644
index 0000000..cfa3366
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java
@@ -0,0 +1,48 @@
+/*
+ * 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.launcher;
+
+import java.io.IOException;
+
+/**
+ * Clerezza Application launcher class.
+ *
+ * @author daniel
+ */
+public class Main {
+    
+    public static void main(String... args) throws IOException {
+        ClerezzaApp clerezza = new ClerezzaApp();
+
+        try {
+            clerezza.start(args);
+        } catch (Throwable t) {
+            System.err.println("Could not start Clerezza: " + t);
+            t.printStackTrace();
+            System.exit(clerezza.getExitCode());
+        }
+        try {
+            clerezza.waitForStop();
+        } catch (Throwable t) {
+            System.err.println("Exception during Clerezza shutdown: " + t);
+            t.printStackTrace();
+            System.exit(-1);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/MavenArtifactDesc.java
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/MavenArtifactDesc.java b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/MavenArtifactDesc.java
new file mode 100644
index 0000000..c8a02bc
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/MavenArtifactDesc.java
@@ -0,0 +1,147 @@
+/*
+ * 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.launcher;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import org.wymiwyg.commons.util.dirbrowser.PathNode;
+
+/**
+ * Maven Artifact Description
+ * 
+ * @author daniel
+ */
+class MavenArtifactDesc implements Comparable<MavenArtifactDesc> {
+
+    //one of these is null
+    URL bundleUrl;
+    PathNode pathNode;
+    String groupId;
+    String artifactId;
+    String version;
+
+    /**
+     * Constructor with bundle URL.
+     *
+     * @param groupId    the group id.
+     * @param artifactId    the artifact id.
+     * @param version    the version.
+     * @param bundleUrl    the bundle URL.
+     */
+    MavenArtifactDesc(String groupId, String artifactId, String version, URL bundleUrl) {
+        this.groupId = groupId;
+        this.artifactId = artifactId;
+        this.version = version;
+        this.bundleUrl = bundleUrl;
+    }
+
+    /**
+     * Constructor with bundle path.
+     * 
+     * @param groupId    the group id.
+     * @param artifactId    the artifact id.
+     * @param version    the version.
+     * @param pathNode    the bundle path node.
+     */
+    MavenArtifactDesc(String groupId, String artifactId, String version, PathNode pathNode) {
+        this.groupId = groupId;
+        this.artifactId = artifactId;
+        this.version = version;
+        this.pathNode = pathNode;
+    }
+
+    /**
+     * Parse Maven Artifact Description from an URL.
+     *
+     * @param bundleUrl the URL.
+     * @return    A new MavenArtifactDesc object.
+     */
+    static MavenArtifactDesc parseFromURL(URL bundleUrl) {
+        String string = bundleUrl.toString();
+        int posSlashM1 = string.lastIndexOf('/');
+        int posSlashM2 = string.lastIndexOf('/', posSlashM1 - 1);
+        int posSlashM3 = string.lastIndexOf('/', posSlashM2 - 1);
+        String version = string.substring(posSlashM2 + 1, posSlashM1);
+        String artifactId = string.substring(posSlashM3 + 1, posSlashM2);
+        String groupId = getGroupId(string.substring(0, posSlashM3));
+        return new MavenArtifactDesc(groupId, artifactId, version, bundleUrl);
+    }
+
+    /**
+     * Parse Maven Artifact Description from a path node.
+     *
+     * @param pathNode    The path node.
+     * @return    A new MavenArtifactDesc object.
+     */
+    static MavenArtifactDesc parseFromPath(PathNode pathNode) {
+        String string = pathNode.getPath();
+        int posSlashM1 = string.lastIndexOf('/');
+        int posSlashM2 = string.lastIndexOf('/', posSlashM1 - 1);
+        int posSlashM3 = string.lastIndexOf('/', posSlashM2 - 1);
+        String version = string.substring(posSlashM2 + 1, posSlashM1);
+        String artifactId = string.substring(posSlashM3 + 1, posSlashM2);
+        String groupId = getGroupId(string.substring(0, posSlashM3));
+        return new MavenArtifactDesc(groupId, artifactId, version, pathNode);
+    }
+
+    /**
+     * Assembles group-id from the diretories after "bundles/"
+     *
+     * @param string a path-string. Must contain "bundles/".
+     */
+    static String getGroupId(String string) {
+        int startPos = string.indexOf("bundles/") + 8;
+        startPos = string.indexOf('/', startPos) + 1;
+        return string.substring(startPos).replace('/', '.');
+    }
+    
+    /**
+     * Returns an URI in the form "mvn:groupId/artifactId/version"
+     *
+     * @return the URI.
+     */
+    public String getShortUri() {
+        return "mvn:" + groupId + "/" + artifactId;
+    }
+
+    /**
+     * Returns a string representation of this object in the form
+     * "mvn:groupId/artifactId/version"
+     *
+     * @return    the string representation of this Maven Artifact Description.
+     */
+    @Override
+    public String toString() {
+        return "mvn:" + groupId + "/" + artifactId + "/" + version;
+    }
+
+    InputStream getInputStream() throws IOException {
+        if (bundleUrl == null) {
+            return pathNode.getInputStream();
+        }
+        return bundleUrl.openStream();
+    }
+
+    @Override
+    public int compareTo(MavenArtifactDesc o) {
+        return toString().compareTo(o.toString());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ShutdownListener.java
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ShutdownListener.java b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ShutdownListener.java
new file mode 100644
index 0000000..1d406ce
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ShutdownListener.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.launcher;
+
+import org.osgi.framework.FrameworkEvent;
+
+/**
+ * A listener that gets notified when the Felix Framework is shut down.
+ *
+ * @author daniel
+ */
+public interface ShutdownListener {
+
+    /**
+     * Notify listener of complete Clerezza shut down.
+     *
+     * @param event
+     *        What event caused the shutdown. Note: event may be null.
+     */
+    public void notify(FrameworkEvent event);
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/images/tut_1_class_diagram.png
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/images/tut_1_class_diagram.png b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/images/tut_1_class_diagram.png
new file mode 100644
index 0000000..0bd04f4
Binary files /dev/null and b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/images/tut_1_class_diagram.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/style/style.css b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..ff49a4d
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/documentation/style/style.css
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/images/clerezza.png b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/site.xml b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/site.xml
new file mode 100644
index 0000000..8d5a4cb
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/site.xml
@@ -0,0 +1,30 @@
+<?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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Usage" href="documentation/usage.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/sitemap.xml b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..38be885
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,28 @@
+<?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.
+
+-->
+
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>usage.xhtml</page>
+    </section>
+</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/usage.xhtml
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/usage.xhtml b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/usage.xhtml
new file mode 100644
index 0000000..4db0157
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/content/usage.xhtml
@@ -0,0 +1,180 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Usage: How to launch the clerezza platform</title>
+	</head>
+	<body>
+		<h1>Usage: How to launch the clerezza platform</h1>
+		<p>Author: Daniel Spicar, Tsuyoshi Ito - clerezza.org</p>
+		<p>Date: March 25, 2009</p>
+		<h2 id="download">1. Download the launcher</h2>
+		<p>
+			The latest snapshots of the launcher can be found on:
+            <br />
+            <br />
+			<a href="http://repo.trialox.org/snapshot/org/apache/clerezza/org.apache.clerezza.platform.launcher/" target="_blank">
+               http://repo.trialox.org/snapshot/org/apache/clerezza/org.apache.clerezza.platform.launcher/
+            </a>
+            <br />
+            <br />
+			or get a stable release from:
+            <br />
+            <br />
+			<a href="http://repo.trialox.org/release/org/apache/clerezza/org.apache.clerezza.platform.launcher/" target="_blank">
+                http://repo.trialox.org/release/org/apache/clerezza/org.apache.clerezza.platform.launcher/
+            </a>
+            <br />
+            <br />
+			(e.g. org.apache.clerezza.platform.launcher-0.2-20090421.105711-13.jar from <a href="http://repo.trialox.org/snapshot/org/apache/clerezza/org.apache.clerezza.platform.launcher/0.2-SNAPSHOT/" target="_blank">
+			http://repo.trialox.org/snapshot/org/apache/clerezza/org.apache.clerezza.platform.launcher/0.2-SNAPSHOT/
+            </a>).
+		</p>
+		<h2 id="run">2. Run the platform</h2>
+		<p>
+            Execute the jar by typing
+            the following into a console:
+        </p>
+		<pre>
+            <code>$ java -Dorg.ops4j.pax.logging.DefaultServiceLog.level=ERROR -jar '/path/to/org.apache.clerezza.platform.launcher-0.2-20090421.105711-13.jar'</code>
+        </pre>
+		<p>
+            This will launch the platform and send the logger output from the 
+			level ERROR and above to the console.
+            If problems are encountered, make sure the jar archive is executeable.
+            In a desktop environment like Microsoft Windows it can be enough to
+            double click the file in order to launch it.
+            <br />
+            If the platform was launched in the console, hit the return key to get a promt (->).
+            The loaded bundles and their state can be checked by typing:
+        </p>
+		<pre>
+            <code>
+                -> ps
+            </code>
+        </pre>
+        <p>
+            The output should look like this:
+        </p>
+        <pre>
+            <code>
+                START LEVEL 30
+                   ID   State         Level  Name
+                [   0] [Active     ] [    0] System Bundle (1.4.1)
+                [   1] [Resolved   ] [    1] Clerezza - Platform Security Conditions (0.2.0.SNAPSHOT)
+                [   2] [Active     ] [    2] Apache Felix Bundle Repository (1.2.1)
+                [   3] [Active     ] [    2] Apache Felix Configuration Admin Service (1.0.10)
+                    ...
+                    
+                    
+                <strong>[  28] [Active     ] [    3] Clerezza - Platform Account Control Panel (0.3.0.SNAPSHOT)</strong>
+                <strong>[  29] [Active     ] [    3] Clerezza - Platform Content (0.7.0.SNAPSHOT)</strong>
+                <strong>[  30] [Active     ] [    3] Clerezza - Platform Template Manager (0.2.0.SNAPSHOT)</strong>
+                <strong>[  32] [Active     ] [    3] Clerezza - Platform Type Handler Space (0.2.0.SNAPSHOT)</strong>
+                <strong>[  33] [Active     ] [    3] Clerezza - Platform Usermanager and Rolemanager (0.7.0.SNAPSHOT)</strong>
+                    ...
+                ->
+            </code>
+        </pre>
+        <p>
+            To see a list of available services type:
+        </p>
+        <pre>
+            <code>
+                -> scr list
+            </code>
+        </pre>
+        <p>
+            The output should look like this:
+        </p>
+        <pre>
+            <code>
+                   Id   State          Name
+                [   0] [active       ] org.apache.clerezza.platform.security.PermissionManager
+                [   1] [active       ] org.apache.clerezza.platform.security.auth.AuthenticatingFilter
+                [   2] [active       ] org.apache.clerezza.jaxrs.rdf.providers.GraphReader
+                [   3] [active       ] org.apache.clerezza.jaxrs.rdf.providers.GraphWriter
+
+
+                    ...
+                ->
+            </code>
+        </pre>
+        <p>
+            Now the platform can be accessed in a web browser by going to <i>http://localhost:8080/path_to_service/</i>, whereas <i>path_to_service</i> has to be replaced by the path to a service/module (when asked to authenticate use username "admin" and password "admin". The user account "admin" has all permissions).
+            <br />Try the following modules:
+        </p>
+        <ul>
+            <li><a href="http://localhost:8080/admin/user-manager/" target="_blank">http://localhost:8080/admin/user-manager/</a></li>
+            <li><a href="http://localhost:8080/admin/role-manager/" target="_blank">http://localhost:8080/admin/role-manager/</a></li>
+            <li><a href="http://localhost:8080/admin/template-manager/" target="_blank">http://localhost:8080/admin/template-manager/</a></li>
+            <li>
+                <a href="http://localhost:8080/user/admin/control-panel/" target="_blank">
+                    http://localhost:8080/user/admin/control-panel/
+                </a>
+                  (where <i>admin</i> can be the username of an arbitary user)
+            </li>
+            <li><a href="http://localhost:8080/tools/editor/" target="_blank">http://localhost:8080/tools/editor/</a></li>
+        </ul>
+        <p>
+            Check out the following sites for more information:
+        </p>
+        <ul>
+            <li>
+                <a href="http://clerezza.org/projects/org.apache.clerezza.platform.usermanager/" target="_blank">
+                   http://clerezza.org/projects/org.apache.clerezza.platform.usermanager/
+                </a>
+            </li>
+             <li><a href="http://clerezza.org/projects/org.apache.clerezza.platform.accountcontrolpanel/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.accountcontrolpanel/</a></li>
+             <li><a href="http://clerezza.org/projects/org.apache.clerezza.platform.templating.manager/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.templating.manager/</a></li>
+            <li><a href="http://clerezza.org/projects/org.apache.clerezza.platform.content/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.content/</a></li>
+        </ul>
+        <h2 id="shutdown">3. Shutdown the platform</h2>
+        <p>
+            The platform can be stopped by typing:
+        </p>
+            <pre>
+                <code>
+                    -> shutdown
+                </code>
+            </pre>
+
+		<h2 id="shutdown">4. Felix webconsole</h2>
+        <p>
+            As an alternative to the command-line interface Felix also provides
+			a web-based management interface available by default at
+			<a href="http://localhost:8080/system/console">http://localhost:8080/system/console</a>.
+			The port at which the console is accessible can be set with the
+			<code>org.osgi.service.http.port</code> system property.
+        </p>
+		<pre>
+            <code>$ java -Dorg.osgi.service.http.port=8383 -jar '/path/to/org.apache.clerezza.platform.launcher-0.2-20090421.105711-13.jar'</code>
+        </pre>
+		<p>
+           Starting the platform as above the web-console will be available on
+		   port 8383, note that this has no impact on the port of the plaftform's
+		   webserver which by default listens to port 8080.
+        </p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/templates/skin.html b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..bb1b45d
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/site/xsite/templates/skin.html
@@ -0,0 +1,71 @@
+<!--
+
+ 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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>


[42/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala
new file mode 100644
index 0000000..40bfb21
--- /dev/null
+++ b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala
@@ -0,0 +1,86 @@
+/*
+ * 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.fsadaptor
+
+import org.apache.clerezza.rdf.core.NonLiteral
+import org.apache.clerezza.rdf.core.Resource
+import org.apache.clerezza.rdf.core.Triple
+import org.apache.clerezza.rdf.core.TripleCollection
+import org.apache.clerezza.rdf.core.UriRef
+import org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph
+import org.apache.clerezza.utils.IteratorMerger
+import org.wymiwyg.commons.util.dirbrowser.PathNode
+import java.util.Iterator
+
+class DirectoryOverlay(pathNode: PathNode, base: TripleCollection)
+  extends AbstractTripleCollection {
+
+  
+
+  import collection.JavaConversions._
+
+  
+
+  override def performFilter(s: NonLiteral, p: UriRef,
+    o: Resource): Iterator[Triple] = {
+    val addedTriples = new SimpleMGraph()
+
+    PathNode2MGraph.describeInGraph(pathNode, addedTriples)
+    
+    val subjects = (for (triple <- addedTriples; subject = triple.getSubject) yield {
+      subject
+    }).toSet
+  
+    class FilteringIterator(baseIter: Iterator[Triple]) extends Iterator[Triple] {
+      var nextElem: Triple = null
+      def prepareNext {
+        nextElem = if (baseIter.hasNext) baseIter.next else null
+        if ((nextElem != null) && 
+          (subjects.contains(nextElem.getSubject))) {
+            //println("skipping "+nextElem)
+            prepareNext
+        }
+      }
+      prepareNext
+  
+      override def next = {
+        val result = nextElem
+        prepareNext
+        result
+      }
+      override def hasNext = nextElem != null
+      override def remove = throw new UnsupportedOperationException
+    }
+      
+    new IteratorMerger(new FilteringIterator(base.filter(s, p, o)), addedTriples.filter(s,p, o))
+  }
+
+  /**
+   * returns an upper bound of the size (removals in abse are not deducted)
+   */
+  override def size = {
+    val addedTriples = new SimpleMGraph()
+
+      PathNode2MGraph.describeInGraph(pathNode, addedTriples)
+
+   base.size+addedTriples.size 
+  }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala
new file mode 100644
index 0000000..684992a
--- /dev/null
+++ b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala
@@ -0,0 +1,30 @@
+/*
+ * 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.fsadaptor
+
+import org.slf4j.LoggerFactory
+//import org.slf4j.ext.LoggerWrapper
+
+trait Logger {
+
+  private val slf4jLogger = LoggerFactory.getLogger(this.getClass)
+//  val logger: org.slf4j.Logger = new LoggerWrapper(slf4jLogger, this.getClass.getName)
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala
new file mode 100644
index 0000000..8a62774
--- /dev/null
+++ b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala
@@ -0,0 +1,146 @@
+/*
+ * 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.fsadaptor;
+
+import java.io.ByteArrayOutputStream
+import javax.ws.rs.core.MediaType
+import org.apache.clerezza.platform.Constants
+import org.apache.clerezza.rdf.core.LiteralFactory
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl
+import org.apache.clerezza.rdf.core.impl.TripleImpl
+import org.apache.clerezza.rdf.ontologies.DISCOBITS
+import org.apache.clerezza.rdf.ontologies.HIERARCHY
+import org.apache.clerezza.rdf.ontologies.RDF
+import org.apache.clerezza.rdf.utils.GraphNode
+import org.apache.clerezza.web.fileserver.util.MediaTypeGuesser
+import org.wymiwyg.commons.util.dirbrowser.PathNode
+
+
+/**
+ *
+ * @author reto
+ */
+object PathNode2MGraph {
+
+  private val URI_PREFIX = Constants.URN_LOCAL_INSTANCE
+
+  private val literalFactory = LiteralFactory.getInstance
+
+  private def getMediaType(file: PathNode) = {
+    val guessedMediaType: MediaType = MediaTypeGuesser.getInstance().guessTypeForName(file.getPath());
+    if (guessedMediaType != null) {
+      guessedMediaType.toString
+    } else {
+      "application/octet-stream"
+    }
+
+  }
+
+  private def getData(file: PathNode) = {
+    val baos = new ByteArrayOutputStream
+    val in = file.getInputStream()
+    val buffer = new Array[Byte](4096)
+    var read = in.read(buffer)
+    while (read != -1) {
+      baos.write(buffer, 0, read)
+      read = in.read(buffer)
+    }
+    in.close()
+    baos.toByteArray
+  }
+
+  def describeInGraph(directory: PathNode, mGraph: MGraph) {
+    val basePathLength = directory.getPath.length
+    def createUriRef(file: PathNode, isDirectory: Boolean) = {
+      def addSlashIfNeeded(s: String) = {
+         if (s.endsWith("/")) {
+           s
+         } else {
+           s+'/'
+         }
+      }
+      val path =  if (isDirectory) {
+        addSlashIfNeeded(file.getPath.substring(basePathLength))
+      } else {
+        file.getPath.substring(basePathLength)
+      }
+      new UriRef(URI_PREFIX+path)
+    }
+    def processDirectory(directory: PathNode) {
+      val directoryResource = createUriRef(directory, true)
+      mGraph.add(new TripleImpl(directoryResource, RDF.`type`, HIERARCHY.Collection))
+      for (subPath <- directory.list) {
+        val file = directory.getSubPath(subPath)
+        val isDirectory = file.isDirectory
+        val resource = createUriRef(file, isDirectory)
+        mGraph.add(new TripleImpl(resource, HIERARCHY.parent, directoryResource))
+        if (isDirectory) {
+          processDirectory(file)
+        } else {
+          mGraph.add(new TripleImpl(resource, RDF.`type`, DISCOBITS.InfoDiscoBit))
+          val data = getData(file)
+          mGraph.add(new TripleImpl(resource, DISCOBITS.infoBit, literalFactory.createTypedLiteral(data)))
+          mGraph.add(new TripleImpl(resource, DISCOBITS.mediaType,
+                        literalFactory.createTypedLiteral(getMediaType(file))));
+        }
+      }
+    }
+    processDirectory(directory)
+  }
+
+  def removeNodesFromGraph(directory: PathNode, mGraph: MGraph) {
+    val basePathLength = directory.getPath.length
+    def createUriRef(file: PathNode, isDirectory: Boolean) = {
+      def addSlashIfNeeded(s: String) = {
+         if (s.endsWith("/")) {
+           s
+         } else {
+           s+'/'
+         }
+      }
+      val path =  if (isDirectory) {
+        addSlashIfNeeded(file.getPath.substring(basePathLength))
+      } else {
+        file.getPath.substring(basePathLength)
+      }
+      new UriRef(URI_PREFIX+path)
+    }
+    def processDirectory(directory: PathNode) {
+      val directoryResource = createUriRef(directory, true)
+      mGraph.remove(new TripleImpl(directoryResource, RDF.`type`, HIERARCHY.Collection))
+      for (subPath <- directory.list) {
+        val file = directory.getSubPath(subPath)
+        val isDirectory = file.isDirectory
+        val resource = createUriRef(file, isDirectory)
+        val node = new GraphNode(resource, mGraph)
+        if (isDirectory) {
+          processDirectory(file)
+        }
+        node.deleteProperties(HIERARCHY.parent)
+        node.deleteProperties(RDF.`type`)
+        node.deleteProperties(DISCOBITS.infoBit)
+        node.deleteProperties(DISCOBITS.mediaType)
+      }
+    }
+    processDirectory(directory)
+  }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.imagemetadata/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content.imagemetadata/LICENSE b/platform/content.imagemetadata/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content.imagemetadata/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.imagemetadata/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content.imagemetadata/pom.xml b/platform/content.imagemetadata/pom.xml
new file mode 100644
index 0000000..6b82b03
--- /dev/null
+++ b/platform/content.imagemetadata/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>clerezza</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content.imagemetadata</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Content Image Metadata</name>
+    <description>Provides a Meta Data Generator that generates metadata for
+    images.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils.imageprocessing</artifactId>
+            <version>0.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.metadata</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java
----------------------------------------------------------------------
diff --git a/platform/content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java b/platform/content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java
new file mode 100644
index 0000000..b49bffc
--- /dev/null
+++ b/platform/content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java
@@ -0,0 +1,64 @@
+/*
+ * 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.imagemetadata;
+
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
+import org.apache.clerezza.rdf.ontologies.EXIF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.utils.imageprocessing.ImageReaderService;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ * This class generates metadata about image data.
+ *
+ * @author mir, hasan
+ */
+@Component(metatype=true)
+@Service(MetaDataGenerator.class)
+public class ImageMetaDataGenerator implements MetaDataGenerator {
+
+    @Reference
+    private ImageReaderService imageReaderService;
+        
+    @Override
+    public void generate(GraphNode node, byte[] data, MediaType mediaType) {
+
+        if (mediaType.getType().startsWith("image")) {
+            try {
+                BufferedImage buffImage = imageReaderService.getBufferedImage(
+                                        new ByteArrayInputStream(data));
+                node.deleteProperties(EXIF.width);
+                node.deleteProperties(EXIF.height);
+                node.addProperty(EXIF.width, LiteralFactory.getInstance().
+                        createTypedLiteral(Integer.valueOf(buffImage.getWidth())));
+                node.addProperty(EXIF.height, LiteralFactory.getInstance().
+                        createTypedLiteral(Integer.valueOf(buffImage.getHeight())));
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content.representations/LICENSE b/platform/content.representations/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content.representations/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.core/LICENSE b/platform/content.representations/platform.content.representations.core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.core/pom.xml b/platform/content.representations/platform.content.representations.core/pom.xml
new file mode 100644
index 0000000..996e2a0
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.core/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>platform.content.representations</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content.representations.core</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Content Representations Core</name>
+    <description>Provides a Meta Data Generator that generates alternative
+        representations for data of    various media types</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.metadata</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils.imageprocessing</artifactId>
+            <version>0.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content</artifactId>
+            <version>0.14</version>
+        </dependency>
+<!--
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.resources.style</artifactId>
+        </dependency>
+-->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content.representations.ontologies</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java b/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
new file mode 100644
index 0000000..f7e5f57
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
@@ -0,0 +1,327 @@
+/*
+ * 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.representations.core;
+
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.concurrent.locks.Lock;
+import javax.imageio.ImageIO;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.platform.content.DiscobitsHandler;
+import org.apache.clerezza.platform.content.InfoDiscobit;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.utils.imageprocessing.ImageProcessor;
+import org.apache.clerezza.utils.imageprocessing.ImageReaderService;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * This class provides a method that generates a thumbnail for specified data
+ * if the specified media type is supported. The supported media types are "image/*".
+ * The generated thumbnail is added as a property to the specified
+ * <code>GraphNode</code>. The property URI is
+ * "http://discobits.org/ontology#thumbnail".
+ *
+ * @author mir
+ */
+@Component(metatype=true)
+@Service({
+    MetaDataGenerator.class,
+    AlternativeRepresentationGenerator.class
+})
+
+public class AlternativeRepresentationGenerator implements MetaDataGenerator {
+
+    private static class Resolution {
+
+        private int width;
+
+        private int height;
+        /**
+         * Takes a String, which contains a resoultion in the format
+         * [width]x[height].
+         *
+         * @param resoulutionString
+         */
+        public Resolution(String resoulutionString) {
+            String[] widthAndHeight = resoulutionString.split("x");
+            width = new Integer(widthAndHeight[0]);
+            height = new Integer(widthAndHeight[1]);
+        }
+
+        /**
+         * A Resolution with the specified width and height.
+         *
+         * @param width
+         * @param height
+         */
+        public Resolution(int width, int height) {
+            this.width = width;
+            this.height = height;
+        }
+
+        public int getHeight() {
+            return height;
+        }
+
+        public int getWidth() {
+            return width;
+        }
+    }
+    final static String EXACT_APPENDIX = "-exact";
+
+    @Reference
+    private ImageProcessor imageProcessor;
+        
+        @Reference
+    private ImageReaderService imageReaderService;
+
+    @Property(value="100x100,200x200", description="Specifies the resolutions of alternative" +
+            " representations in the format [width]x[height]. Multiple resolutions" +
+            " are separated by comma (e.g. 100x100,30x30)")
+    public static final String RESOLUTIONS = "resolutions";
+
+    @Property(value="100x100,200x200", description="Specifies the exact resolutions of alternative" +
+            " representations in the format [width]x[height]. Multiple resolutions" +
+            " are separated by comma (e.g. 100x100,30x30). The image will be cropped if it has not " +
+            "the needed proportions")
+    public static final String EXACT_RESOLUTIONS = "exact_resolutions";
+    
+    private volatile ServiceTracker discobitTracker;
+    private Resolution[] resolutions;
+    private Resolution[] exactResolutions;
+
+    /**
+     * Indicates if data given to the AlternativeRepresentationGenerator is a
+     * alternative representation itself and therefore does not have to have a
+     * alternative representation generated for it.
+     */
+    private ThreadLocal<Boolean> isAltRepresentation = new ThreadLocal<Boolean>() {
+
+        @Override
+        protected Boolean initialValue() {
+            return false;
+        }
+    };
+
+    protected void activate(ComponentContext context) {
+        resolutions = createResolutionArray((String) context.getProperties().get(RESOLUTIONS));
+        exactResolutions = createResolutionArray((String) context.getProperties().get(EXACT_RESOLUTIONS));
+        discobitTracker = new ServiceTracker(context.getBundleContext(),
+                DiscobitsHandler.class.getName(), null);
+        new Thread() {
+            @Override
+            public void run() {
+                discobitTracker.open();
+            }
+        }.start();
+    }
+
+    private Resolution[] createResolutionArray(String resolutionsString) {
+        String[] resoultionStrings = resolutionsString.split(",");
+        Resolution[] resolutionArray = new Resolution[resoultionStrings.length];
+        for (int i = 0; i < resoultionStrings.length; i++) {
+            resolutionArray[i] = new Resolution(resoultionStrings[i].trim());
+        }
+        return resolutionArray;
+    }
+
+    protected void deactivate(ComponentContext context) {
+        discobitTracker.close();
+        discobitTracker = null;
+    }
+
+    @Override
+    public void generate(GraphNode node, byte[] data, MediaType mediaType) {
+        if (isAltRepresentation.get()) {
+            return;
+        }
+        if (mediaType.getType().startsWith("image")) {
+            generateAlternativeImages(data, mediaType, node);
+        }
+    }
+
+    /**
+     * Generates an alternative image of the image at the specified infoBitNode.
+     * The parameters width and height specify the dimensions the generated
+     * image should have. The image will be resized to fit the specified
+     * dimensions (height and width of the generated image will be smaller
+     * or equals the specified width and height). Returns the URI of the
+     * generated image.
+     *
+     * @param infoBitNode an infoDiscoBit of media type image
+     * @param width the width the generated image should have
+     * @param height the height the generated image should have
+     * @return the URI of the generated image
+     */
+    public UriRef generateAlternativeImage(GraphNode infoBitNode, int width, int height) {
+        return generateAlternativeImage(infoBitNode, width, height, false);
+    }
+
+    /**
+     * Generates an alternative image of the image at the specified infoBitNode.
+     * The parameters width and height specify the dimensions the generated
+     * image should have. If exact is true, then the generated image will be
+     * resized and cropped to match the specified width and height exactly. If
+     * exact is false, then the image will be resized to fit the specified
+     * dimensions (height and width of the generated image will be smaller
+     * or equals the specified width and height). Returns the URI of the
+     * generated image.
+     *
+     * @param infoBitNode an infoDiscoBit of media type image
+     * @param width the width the generated image should have
+     * @param height the height the generated image should have
+     * @param exact specifies if the generated image must have the exact
+     *        width and height or not.
+     * @return the URI of the generated image
+     */
+    public UriRef generateAlternativeImage(GraphNode infoBitNode, int width, int height, 
+            boolean exact) {
+        try {
+            isAltRepresentation.set(Boolean.TRUE);
+            InfoDiscobit infoBit = InfoDiscobit.createInstance(infoBitNode);
+            BufferedImage buffImage = imageReaderService.getBufferedImage(
+                                new ByteArrayInputStream(infoBit.getData()));
+            return generateAlternativeImage(buffImage, new Resolution(width, height), 
+                    MediaType.valueOf(infoBit.getContentType()), infoBitNode, exact);
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        } finally {
+            isAltRepresentation.set(Boolean.FALSE);
+        }
+    }
+
+    private void generateAlternativeImages(byte[] data, MediaType mediaType,
+            GraphNode node) throws RuntimeException {
+        try {
+            isAltRepresentation.set(Boolean.TRUE);
+            BufferedImage buffImage = imageReaderService.getBufferedImage(
+                                new ByteArrayInputStream(data));
+            int imgWidth = buffImage.getWidth();
+            int imgHeigth = buffImage.getHeight();
+            for (Resolution resolution : resolutions) {
+                if (imgWidth > resolution.getWidth() || imgHeigth > resolution.getHeight()) {
+                    generateAlternativeImage(buffImage, resolution, mediaType, node, false);
+                }
+            }
+            for (Resolution resolution : exactResolutions) {
+                if (imgWidth > resolution.getWidth() && imgHeigth > resolution.getHeight()) {
+                    generateAlternativeImage(buffImage, resolution, mediaType, node, true);
+                }
+            }
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        } finally {
+            isAltRepresentation.set(Boolean.FALSE);
+        }
+    }
+
+    private UriRef generateAlternativeImage(BufferedImage buffImage, Resolution resolution,
+            MediaType mediaType, GraphNode node, boolean extact) throws IOException {
+        BufferedImage alternativeImage;
+        if (extact) {
+            alternativeImage = resizeAndCrop(resolution, buffImage);
+            if (alternativeImage == null) {
+                return null;
+            }
+        } else {
+            alternativeImage = imageProcessor.makeAThumbnail(buffImage,
+                    resolution.getWidth(), resolution.getHeight());
+        }
+        byte[] alternativeImageBytes = bufferedImage2ByteArray(alternativeImage, mediaType);
+        DiscobitsHandler contentHandler = (DiscobitsHandler) discobitTracker.getService();
+        
+        UriRef thumbnailUri = createThumbnailUri((UriRef) node.getNode(), alternativeImage, extact);
+        contentHandler.put(thumbnailUri, mediaType, alternativeImageBytes);
+        Lock writeLock = node.writeLock();
+        writeLock.lock();
+        try {
+            node.addProperty(DISCOBITS.thumbnail, thumbnailUri);
+            return thumbnailUri;
+        } finally {
+            writeLock.unlock();
+        }
+    }
+    
+        private BufferedImage resizeAndCrop(Resolution resolution, BufferedImage buffImage) {
+        BufferedImage alternativeImage;
+        int imageHeight = 0;
+        int imageWidth = 0;
+        int widthDiff = buffImage.getWidth() - resolution.getWidth() ;
+        int heightDiff = buffImage.getHeight() - resolution.getHeight();
+        // resize if both dimension are bigger than the dimensions of the needed resolution
+        if (widthDiff >= 0 && heightDiff >= 0) {
+            if (widthDiff < heightDiff) {
+                imageWidth = resolution.getWidth();
+            } else {
+                imageHeight = resolution.getHeight();
+            }
+            alternativeImage = imageProcessor.resizeProportional(buffImage, imageWidth, imageHeight);
+        } else {
+            return null;
+        }
+        // crop image to fit exact the resolution
+        if (widthDiff < heightDiff) {
+            heightDiff = alternativeImage.getHeight() - resolution.getHeight();
+            alternativeImage = alternativeImage.getSubimage(0, heightDiff/2, resolution.getWidth(),
+                    resolution.getHeight());
+        } else {
+            widthDiff = alternativeImage.getWidth() - resolution.getWidth();
+            alternativeImage = alternativeImage.getSubimage(widthDiff/2, 0, resolution.getWidth(),
+                    resolution.getHeight());
+        }
+        return alternativeImage;
+    }
+
+    private byte[] bufferedImage2ByteArray(BufferedImage image,
+            MediaType mediaType) throws IOException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ImageIO.write(image, mediaType.getSubtype(), baos);
+        byte[] bytes = baos.toByteArray();
+        baos.flush();
+        return bytes;
+    }
+
+    private UriRef createThumbnailUri(UriRef uriRef, BufferedImage img, boolean exact) {
+        String resolution = "-" + img.getWidth() + "x" + img.getHeight() + (exact ? EXACT_APPENDIX: "");
+        String oldUri = uriRef.getUnicodeString();
+        String newUri;
+        int lastIndexOfDot = oldUri.lastIndexOf(".");
+        int lastIndexOfSlash = oldUri.lastIndexOf("/");
+        // 6 characters to keep the extension at the end.
+        if (lastIndexOfSlash < lastIndexOfDot &&
+                lastIndexOfDot >= (oldUri.length() - 6)) {
+            String firstPart = oldUri.substring(0, lastIndexOfDot);
+            String lastPart = oldUri.substring(lastIndexOfDot, oldUri.length());
+            newUri = firstPart + resolution + lastPart;
+        } else {
+            newUri = oldUri + resolution;
+        }
+        return new UriRef(newUri);
+    }
+}


[05/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.config/pom.xml b/platform/platform.config/pom.xml
deleted file mode 100644
index 111680c..0000000
--- a/platform/platform.config/pom.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.config</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Configuration</name>
-    <description>This bundles initializes the system graph with default values,
-    provides a service to access configuration default values, and a GUI to
-    edit such values.
-    </description>
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.ontologies</artifactId>
-            <version>0.12</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.utils</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>permissiondescriptions</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.file.storage</artifactId>
-            <version>0.4</version>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java
----------------------------------------------------------------------
diff --git a/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java b/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java
deleted file mode 100644
index ebc0bf9..0000000
--- a/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java
+++ /dev/null
@@ -1,191 +0,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.
- */
-package org.apache.clerezza.platform.config;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import org.apache.clerezza.platform.Constants;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.component.ComponentContext;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.PLATFORM;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-/**
- * This class provides a OSGi service for getting system properties from
- * the sytem graph.
- * 
- * @author mir
- */
-@Component
-@Service(PlatformConfig.class)
-public class PlatformConfig {
-
-    @Reference(target = SystemConfig.SYSTEM_GRAPH_FILTER)
-    private LockableMGraph systemGraph;
-    private BundleContext context;
-    private static String DEFAULT_PORT = "8080";
-
-    /**
-     * @deprecated use org.apache.clerezza.platform.Contants instead
-     */
-    @Deprecated
-    public static final UriRef CONFIG_GRAPH_URI = Constants.CONFIG_GRAPH_URI;
-
-    /**
-     * A filter that can be used to get the config graph as OSGi service,
-     * that is provided by <code>org.apache.clerezza.rdf.core.access.TcManager</code>.
-     */
-    public static final String CONFIG_GRAPH_FILTER =
-            "(name="+ Constants.CONFIG_GRAPH_URI_STRING +")";
-
-    @Reference
-    private TcManager tcManager;
-
-
-    /**
-     * Returns the default base URI of the Clerezza platform instance.
-     * @return the base URI of the Clerezza platform
-     */
-    public UriRef getDefaultBaseUri() {
-        return AccessController.doPrivileged(new PrivilegedAction<UriRef>() {
-
-            @Override
-            public UriRef run() {
-                GraphNode platformInstance = getPlatformInstance();
-                Lock l = platformInstance.readLock();
-                l.lock();
-                try {
-                    Iterator<Resource> triples = platformInstance.getObjects(PLATFORM.defaultBaseUri);
-                    if (triples.hasNext()) {
-                        return (UriRef) triples.next();
-                    } else {
-                        String port = context.getProperty("org.osgi.service.http.port");
-                        if (port == null) {
-                            port = DEFAULT_PORT;
-                        }
-                        if (port.equals("80")) {
-                            return new UriRef("http://localhost/");
-                        }
-                        return new UriRef("http://localhost:" + port + "/");
-                    }
-                } finally {
-                    l.unlock();
-                }
-            }
-        });
-    }
-
-    /**
-     * Returns the platforminstance as <code>GraphNode</code> of the system
-     * graph (a LockableMGraph). Access controls applies to the system graph
-     * instance underlying the <code>GraphNode</code>.
-     *
-     * @return
-     */
-    public GraphNode getPlatformInstance() {
-        return new GraphNode(getPlatformInstanceResource(), systemGraph);
-    }
-
-    private NonLiteral getPlatformInstanceResource() {
-        Lock l = systemGraph.getLock().readLock();
-        l.lock();
-        try {
-            Iterator<Triple> instances = systemGraph.filter(null, RDF.type, PLATFORM.Instance);
-            if (!instances.hasNext()) {
-                throw new RuntimeException("No Platform:Instance in system graph.");
-            }
-            return instances.next().getSubject();
-        } finally {
-            l.unlock();
-        }
-    }
-
-    /**
-     * Returns the base URIs of the Clerezza platform instance.
-     * A base Uri is the shortest URI of a URI-Hierarhy the platform handles.
-     * @return the base URI of the Clerezza platform
-     */
-    //todo: if this is the only class that sets and reads base uris then getBaseURIs should keep a cache
-    public Set<UriRef> getBaseUris() {
-
-        return AccessController.doPrivileged(new PrivilegedAction<Set<UriRef>>() {
-
-            @Override
-            public Set<UriRef> run() {
-                Iterator<Resource> baseUrisIter = getPlatformInstance().
-                        getObjects(PLATFORM.baseUri);
-                Set<UriRef> baseUris = new HashSet<UriRef>();
-                while (baseUrisIter.hasNext()) {
-                    UriRef baseUri = (UriRef) baseUrisIter.next();
-                    baseUris.add(baseUri);
-                }
-                baseUris.add(getDefaultBaseUri());
-                return baseUris;
-            }
-        });
-
-    }
-
-    /**
-     * Adds a base URI to the Clerezza platform instance.
-     *
-     * @param baseUri The base URI which will be added to the platform instance
-     */
-    public void addBaseUri(UriRef baseUri) {
-        systemGraph.add(new TripleImpl(getPlatformInstanceResource(), PLATFORM.baseUri, baseUri));
-    }
-
-    /**
-     * Removes a base URI from the Clerezza platform instance.
-     *
-     * @param baseUri The base URI which will be removed from the platform instance
-     */
-    public void removeBaseUri(UriRef baseUri) {
-        systemGraph.remove(new TripleImpl(getPlatformInstanceResource(), PLATFORM.baseUri, baseUri));
-    }
-
-    protected void activate(ComponentContext componentContext) {
-        this.context = componentContext.getBundleContext();
-        try {
-            tcManager.getMGraph(Constants.CONFIG_GRAPH_URI);
-        } catch (NoSuchEntityException nsee) {
-            tcManager.createMGraph(Constants.CONFIG_GRAPH_URI);            
-        }
-    }
-    
-    protected void deactivate(ComponentContext componentContext) {
-        this.context = null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java
----------------------------------------------------------------------
diff --git a/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java b/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java
deleted file mode 100644
index 285300d..0000000
--- a/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java
+++ /dev/null
@@ -1,186 +0,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.
- */
-package org.apache.clerezza.platform.config;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Set;
-import org.apache.clerezza.platform.Constants;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.osgi.service.component.ComponentContext;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.TripleCollection;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
-import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
-import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.serializedform.Parser;
-import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.clerezza.rdf.core.serializedform.ParsingProvider;
-import org.apache.clerezza.rdf.core.serializedform.Serializer;
-import org.apache.clerezza.rdf.file.storage.FileMGraph;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Deactivate;
-
-/**
- * When the
- * <code>SystemConfig</code> component is activated it checks if the system
- * graph exists, in case it does not exist then it creates the system graph and
- * writes the default platform configuration into it.
- *
- * @author mir
- */
-@Component(immediate = true)
-@Service(WeightedTcProvider.class)
-public class SystemConfig implements WeightedTcProvider {
-
-    public static final String DEFAULT_SYSTEM_GRAPH = "default-system-graph.rdf";
-    private static final String DATA_FILE_SYSTEM_GRAPH = "system-graph.nt";
-    private final Logger logger = LoggerFactory.getLogger(getClass());
-    /**
-     *
-     * @deprecated use org.apache.clerezza.platform.Contants instead
-     */
-    @Deprecated
-    public static final UriRef SYSTEM_GRAPH_URI = Constants.SYSTEM_GRAPH_URI;
-    /**
-     * A filter that can be used to get the system graph as OSGi service, that
-     * is provided by
-     * <code>org.apache.clerezza.rdf.core.access.TcManager</code>.
-     */
-    public static final String SYSTEM_GRAPH_FILTER =
-            "(name=" + Constants.SYSTEM_GRAPH_URI_STRING + ")";
-    
-    public static final String PARSER_FILTER =
-            "(&("+SupportedFormat.supportedFormat+"=" + SupportedFormat.RDF_XML + ") "+
-            "("+SupportedFormat.supportedFormat+"=" + SupportedFormat.N_TRIPLE + "))";
-    @Reference(target = PARSER_FILTER)
-    private Parser parser;
-    
-    public static final String SERIALIZER_FILTER =
-            "("+SupportedFormat.supportedFormat+"=" + SupportedFormat.N_TRIPLE + ")";
-    @Reference(target = SERIALIZER_FILTER)
-    private Serializer serializer;
-    private MGraph systemGraph;
-
-    @Activate
-    protected void activate(ComponentContext componentContext) {
-        final BundleContext bundleContext = componentContext.getBundleContext();
-        File systemGraphFile = bundleContext.getDataFile(DATA_FILE_SYSTEM_GRAPH);
-        boolean dataFileExisted = systemGraphFile.exists();
-        //yould be good to use IndexedMGraph to be faster
-        systemGraph = new FileMGraph(systemGraphFile, parser, serializer);
-        if (!dataFileExisted) {
-            readConfigGraphFile(systemGraph);
-            logger.info("Add initial configuration to system graph");
-        }
-    }
-
-    @Deactivate
-    protected void deactivate(ComponentContext componentContext) {
-        systemGraph = null;
-    }
-
-    private void readConfigGraphFile(MGraph mGraph) {
-        URL config = getClass().getResource(DEFAULT_SYSTEM_GRAPH);
-        if (config == null) {
-            throw new RuntimeException("no config file found");
-        }
-        try {
-            parser.parse(mGraph, config.openStream(),
-                    SupportedFormat.RDF_XML, null);
-        } catch (IOException ex) {
-            logger.warn("Cannot parse coniguration at URL: {}", config);
-            throw new RuntimeException(ex);
-        }
-    }
-
-    /*
-     * Reason to be high: don't allow overwriting of system graph (by accident or as an attack)
-     * Reason to be low: avoid that TcManager always first tries to create TripleCollections using this provider
-     */
-    @Override
-    public int getWeight() {
-        return Integer.MAX_VALUE;
-    }
-
-    @Override
-    public Graph getGraph(UriRef name) throws NoSuchEntityException {
-        throw new NoSuchEntityException(name);
-    }
-
-    @Override
-    public MGraph getMGraph(UriRef name) throws NoSuchEntityException {
-        if (name.equals(Constants.SYSTEM_GRAPH_URI)) {
-            return systemGraph;
-        } else {
-            throw new NoSuchEntityException(name);
-        }
-    }
-
-    @Override
-    public TripleCollection getTriples(UriRef name) throws NoSuchEntityException {
-        return getMGraph(name);
-    }
-
-    @Override
-    public Set<UriRef> listGraphs() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public Set<UriRef> listMGraphs() {
-        return Collections.singleton(Constants.SYSTEM_GRAPH_URI);
-    }
-
-    @Override
-    public Set<UriRef> listTripleCollections() {
-        return listMGraphs();
-    }
-
-    @Override
-    public MGraph createMGraph(UriRef name) throws UnsupportedOperationException, EntityAlreadyExistsException {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    @Override
-    public Graph createGraph(UriRef name, TripleCollection triples) throws UnsupportedOperationException, EntityAlreadyExistsException {
-        throw new UnsupportedOperationException("Not supported yet."); 
-    }
-
-    @Override
-    public void deleteTripleCollection(UriRef name) throws UnsupportedOperationException, NoSuchEntityException, EntityUndeletableException {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    @Override
-    public Set<UriRef> getNames(Graph graph) {
-        return Collections.emptySet();
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java
----------------------------------------------------------------------
diff --git a/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java b/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java
deleted file mode 100644
index dd5199f..0000000
--- a/platform/platform.config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java
+++ /dev/null
@@ -1,70 +0,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.
- */
-
-package org.apache.clerezza.platform.config;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider;
-import org.apache.clerezza.permissiondescriptions.PermissionDescripton;
-import org.apache.clerezza.rdf.core.access.security.TcPermission;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
-
-/**
- * <code>PermissionDescriptionsProvider</code> implementation that provides
- * <code>PermissionDescripton</code>s of the graph access permissions for
- * the graphs used by the platform.
- * The access permissions for the following graphs are described:
- * <ul>
- *    <li>system graph</li>
- *    <li>config graph</li>
- * </ul>
- *
- * @author mir
- */
-@Component
-@Service(PermissionDescriptionsProvider.class)
-public class TcPermissionDescriptionsProvider implements PermissionDescriptionsProvider {
-
-    private static final Set<PermissionDescripton> GRAPH_ACCESS_PERMISSION_DESCRIPTIONS =
-            new HashSet<PermissionDescripton>();
-    static {
-        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("System Graph Read Permission",
-                "Grants permission to the user to read the system graph", null, TcPermission.class,
-                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/system.graph\" \"read\")"));
-
-        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("System Graph Read/Write Permission",
-                "Grants permission to the user to read and write the system graph", null, TcPermission.class,
-                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/system.graph\" \"readwrite\")"));
-
-        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Configuration Graph Read Permission",
-                "Grants permission to the user to read the configuration graph", null, TcPermission.class,
-                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/config.graph\" \"read\")"));
-
-        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Configuration Graph Read/Write Permission",
-                "Grants permission to the user to read and write the configuration graph", null, TcPermission.class,
-                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/config.graph\" \"readwrite\")"));
-    }
-
-    @Override
-    public Set<PermissionDescripton> getPermissionDescriptors() {
-        return GRAPH_ACCESS_PERMISSION_DESCRIPTIONS;
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf
----------------------------------------------------------------------
diff --git a/platform/platform.config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf b/platform/platform.config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf
deleted file mode 100644
index f530afd..0000000
--- a/platform/platform.config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf
+++ /dev/null
@@ -1,103 +0,0 @@
-<?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.
-
--->
-
-<rdf:RDF
-		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-		xmlns:perm="http://clerezza.org/2008/10/permission#"
-		xmlns:foaf="http://xmlns.com/foaf/0.1/"
-		xmlns:dc="http://purl.org/dc/elements/1.1/"
-		xmlns:sioc="http://rdfs.org/sioc/ns#"
-		xmlns:plat="http://clerezza.org/2009/08/platform#"
-		xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
-	<perm:Role>
-		<dc:title>CommunityUser</dc:title>
-		<perm:hasPermission rdf:parseType="Resource">
-			<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/user/{username}/*" "readwrite")</perm:javaPermissionEntry>
-		</perm:hasPermission>
-		<perm:hasPermission rdf:parseType="Resource">
-			<perm:javaPermissionEntry>(org.apache.clerezza.platform.accountcontrolpanel.UserBundlePermission "{username}" "")</perm:javaPermissionEntry>
-		</perm:hasPermission>
-	</perm:Role>
-	<plat:Instance></plat:Instance>
-	<foaf:Agent>
-		<plat:userName>anonymous</plat:userName>
-		<sioc:has_function>
-			<perm:Role>
-				<dc:title>BasePermissionsRole</dc:title>
-				<rdfs:comment>Every user implicitely has this role as this is a perm:BaseRole</rdfs:comment>
-				<rdf:type rdf:resource="http://clerezza.org/2008/10/permission#BaseRole"/>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(java.util.PropertyPermission "*" "read")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(org.osgi.framework.AdminPermission "*" "resource")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(org.osgi.framework.ServicePermission "*" "get")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(java.lang.RuntimePermission "accessDeclaredMembers" "")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-                                <perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(java.lang.RuntimePermission "getClassLoader" "")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<!-- it seems pax-logger impl needs this, see comment to https://issues.apache.org/jira/browse/CLEREZZA-205 -->
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(org.osgi.framework.AdminPermission "*" "metadata")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/content.graph" "read")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/documentation.graph" "read")</perm:javaPermissionEntry>
-				</perm:hasPermission>
-				<perm:hasPermission rdf:parseType="Resource">
-					<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/config.graph" "read")</perm:javaPermissionEntry>
-				</perm:hasPermission>				
-			</perm:Role>
-		</sioc:has_function>
-	</foaf:Agent>
-	<perm:Role>
-		<dc:title>DefaultRole</dc:title>
-		<rdfs:comment>A role regular users typically have</rdfs:comment>
-		<perm:hasPermission rdf:parseType="Resource">
-			<perm:javaPermissionEntry>(org.apache.clerezza.platform.accountcontrolpanel.AccountControlPanelAppPermission "{username}" "")</perm:javaPermissionEntry>
-		</perm:hasPermission>
-		<perm:hasPermission rdf:parseType="Resource">
-			<perm:javaPermissionEntry>(org.apache.clerezza.platform.accountcontrolpanel.ChangePasswordPermission "{username}" "")</perm:javaPermissionEntry>
-		</perm:hasPermission>
-	</perm:Role>
-	<rdf:Description rdf:about="urn:x-localinstance:/typePriorityList">
-		<rdf:rest rdf:parseType="Collection">
-			<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#Resource"/>
-		</rdf:rest>
-		<rdf:first rdf:resource="http://clerezza.org/2009/07/script#ScriptGeneratedResource"/>
-	</rdf:Description>
-	<foaf:Agent>
-		<perm:hasPermission rdf:parseType="Resource">
-			<perm:javaPermissionEntry>(java.security.AllPermission "" "")</perm:javaPermissionEntry>
-		</perm:hasPermission>
-		<plat:userName>admin</plat:userName>
-		<foaf:mbox rdf:resource="mailto:noreply@clerezza.org"/>
-		<perm:passwordSha1>d033e22ae348aeb5660fc2140aec35850c4da997</perm:passwordSha1>
-	</foaf:Agent>
-</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.default404/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content.default404/LICENSE b/platform/platform.content.default404/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content.default404/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.default404/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.default404/pom.xml b/platform/platform.content.default404/pom.xml
deleted file mode 100644
index 0cedbc1..0000000
--- a/platform/platform.content.default404/pom.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content.default404</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Content Default 404 response provider</name>
-    <description>
-        Provides a default implementation of PageNotFoundService
-    </description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.content</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.scala-lang</groupId>
-            <artifactId>scala-library</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <sourceDirectory>src/main/scala</sourceDirectory>
-        <testSourceDirectory>src/test/scala</testSourceDirectory>
-        <plugins>
-            <plugin>
-                <groupId>org.scala-tools</groupId>
-                <artifactId>maven-scala-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>compile</goal>
-                            <goal>testCompile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <!-- <scalaVersion>${scala.version}</scalaVersion> -->
-                    <!-- <args>
-                        <arg>-target:jvm-1.5</arg>
-                    </args> -->
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
-                        <Export-Package>org.apache.clerezza.platform.content.default404</Export-Package>
-                        <!-- <Bundle-SymbolicName>org.apache.clerezza.platform.users.core</Bundle-SymbolicName> -->
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.default404/src/main/resources/META-INF/documentation.nt
----------------------------------------------------------------------
diff --git a/platform/platform.content.default404/src/main/resources/META-INF/documentation.nt b/platform/platform.content.default404/src/main/resources/META-INF/documentation.nt
deleted file mode 100644
index d5a8a00..0000000
--- a/platform/platform.content.default404/src/main/resources/META-INF/documentation.nt
+++ /dev/null
@@ -1,35 +0,0 @@
-<bundle:///intro-content-el/0> <http://discobits.org/ontology#infoBit> "The default 404 Response Provider budle with id org.apache.clerezza.platform.content.default404 provides an implementation of the PageNotFoundService (package/bundle: org.apache.clerezza.platform.content) that the delivers the response retrieved from the uri with the same protocol and host and the /page-not-found. For example if 404 is to be generated for http://example.org/foo/bar the entity obtained by dereferencing http://example.org/page-not-found will be returned."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
-<bundle:///intro-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
-<bundle:///intro-content-el/1-content> <http://discobits.org/ontology#infoBit> "example: curl -u admin:admin -H \"Content-type: text/html\" -T tmp.html http://127.0.0.1:8080/page-not-found"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
-<bundle:///intro-content-el/1-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
-<bundle:///intro-content-el/1-title> <http://discobits.org/ontology#infoBit> "Uploading 404 response page with curl"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
-<bundle:///intro-content-el/1-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
-<bundle:///intro-content-el/1> <http://discobits.org/ontology#contains> _:6a610bd3bb246f2a6afd9624eeb843581 . 
-<bundle:///intro-content-el/1> <http://discobits.org/ontology#contains> _:e696a99dc91ebddcf13b5a4fd83e55991 . 
-<bundle:///intro-content-el/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
-<bundle:///intro-content> <http://discobits.org/ontology#contains> _:86e4309edd82a6d415338546caff2d551 . 
-<bundle:///intro-content> <http://discobits.org/ontology#contains> _:8ced329518dac9ef741f4099548bb8451 . 
-<bundle:///intro-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
-<bundle:///intro-title> <http://discobits.org/ontology#infoBit> "Default 404 Response Provider "^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
-<bundle:///intro-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
-<bundle:///intro> <http://discobits.org/ontology#contains> _:566a75916142ac411441d067f09a49f71 . 
-<bundle:///intro> <http://discobits.org/ontology#contains> _:eb4272f6f47656ae428d834bb170dfe81 . 
-<bundle:///intro> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
-_:566a75916142ac411441d067f09a49f71 <http://discobits.org/ontology#holds> <bundle:///intro-content> . 
-_:566a75916142ac411441d067f09a49f71 <http://discobits.org/ontology#pos> "1" . 
-_:566a75916142ac411441d067f09a49f71 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
-_:6a610bd3bb246f2a6afd9624eeb843581 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1-title> . 
-_:6a610bd3bb246f2a6afd9624eeb843581 <http://discobits.org/ontology#pos> "0" . 
-_:6a610bd3bb246f2a6afd9624eeb843581 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
-_:86e4309edd82a6d415338546caff2d551 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1> . 
-_:86e4309edd82a6d415338546caff2d551 <http://discobits.org/ontology#pos> "1" . 
-_:86e4309edd82a6d415338546caff2d551 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
-_:8ced329518dac9ef741f4099548bb8451 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/0> . 
-_:8ced329518dac9ef741f4099548bb8451 <http://discobits.org/ontology#pos> "0" . 
-_:8ced329518dac9ef741f4099548bb8451 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
-_:e696a99dc91ebddcf13b5a4fd83e55991 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1-content> . 
-_:e696a99dc91ebddcf13b5a4fd83e55991 <http://discobits.org/ontology#pos> "1" . 
-_:e696a99dc91ebddcf13b5a4fd83e55991 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
-_:eb4272f6f47656ae428d834bb170dfe81 <http://discobits.org/ontology#holds> <bundle:///intro-title> . 
-_:eb4272f6f47656ae428d834bb170dfe81 <http://discobits.org/ontology#pos> "0" . 
-_:eb4272f6f47656ae428d834bb170dfe81 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.default404/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.default404/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/platform.content.default404/src/main/resources/OSGI-INF/serviceComponents.xml
deleted file mode 100644
index 71c9b2b..0000000
--- a/platform/platform.content.default404/src/main/resources/OSGI-INF/serviceComponents.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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.
-
--->
-
-<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
-    <scr:component enabled="true" immediate="true" name="org.apache.clerezza.platform.content.default404.DefaultPageNotFoundService">
-        <implementation class="org.apache.clerezza.platform.content.default404.DefaultPageNotFoundService"/>
-        <service>
-            <provide interface="org.apache.clerezza.platform.content.PageNotFoundService" />
-        </service>
-    </scr:component>
-</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala
----------------------------------------------------------------------
diff --git a/platform/platform.content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala b/platform/platform.content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala
deleted file mode 100644
index a0c4ab6..0000000
--- a/platform/platform.content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala
+++ /dev/null
@@ -1,64 +0,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.
- */
-
-package org.apache.clerezza.platform.content.default404
-
-import org.apache.clerezza.platform.content.PageNotFoundService
-import javax.ws.rs.core.UriInfo
-import java.io.FileNotFoundException
-import java.io.InputStream
-import java.net.URL
-import java.security.AccessController
-import java.security.PrivilegedAction
-import javax.ws.rs.core.Response
-import javax.ws.rs.core.Response.Status
-
-/**
- * This returns the content of the resource /page-not-found dereferenced as uri
- * with the same authority section as the request.
- */
-class DefaultPageNotFoundService extends PageNotFoundService {
-
-  private val notFoundPagePath = "/page-not-found"
-
-  override def createResponse(uriInfo: UriInfo) = {
-    if (uriInfo.getPath == notFoundPagePath) {
-      Response.status(Status.NOT_FOUND).build();
-    } else {
-      val pageNotFoundUrl = new URL(uriInfo.getBaseUri.toURL, notFoundPagePath)
-      AccessController.doPrivileged(
-        new PrivilegedAction[Option[(String, InputStream)]] {
-          def run() = {
-            val connection = pageNotFoundUrl.openConnection()
-            try {
-              Some(connection.getContentType, connection.getInputStream)
-            } catch {
-              case _: FileNotFoundException => None
-            }
-          }
-        }
-      ) match {
-        case Some((mediaTypeString, in)) => Response.status(Status.NOT_FOUND).`type`(mediaTypeString).entity(in).build();
-        case None => Response.status(Status.NOT_FOUND).build();
-      }
-
-    }
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/LICENSE b/platform/platform.content.fsadaptor/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content.fsadaptor/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/pom.xml b/platform/platform.content.fsadaptor/pom.xml
deleted file mode 100644
index 1097fb9..0000000
--- a/platform/platform.content.fsadaptor/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content.fsadaptor</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Content Filesystem Adaptor</name>
-    <description>
-        Makes directories appear as a graph describing the files and theits
-        contents with the discobits ontology.
-    </description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.graphprovider.content</artifactId>
-            <version>0.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.scala.utils</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>web.fileserver</artifactId>
-            <version>0.10</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.scala-lang</groupId>
-            <artifactId>scala-library</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <sourceDirectory>src/main/scala</sourceDirectory>
-        <testSourceDirectory>src/test/scala</testSourceDirectory>
-        <plugins>
-            <plugin>
-                <groupId>org.scala-tools</groupId>
-                <artifactId>maven-scala-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>compile</goal>
-                            <goal>testCompile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <!-- <scalaVersion>${scala.version}</scalaVersion> -->
-                    <!-- <args>
-                        <arg>-target:jvm-1.5</arg>
-                    </args> -->
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
-                        <Export-Package>org.apache.clerezza.platform.content.fsadaptor</Export-Package>
-                        <!-- <Bundle-SymbolicName>org.apache.clerezza.platform.users.core</Bundle-SymbolicName> -->
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/platform.content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml
deleted file mode 100644
index 75b5938..0000000
--- a/platform/platform.content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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.
-
--->
-
-<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
-    <scr:component enabled="true" immediate="true" name="org.apache.clerezza.platform.content.fsadaptor.BundleFsLoader">
-        <implementation class="org.apache.clerezza.platform.content.fsadaptor.BundleFsLoader"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.rdf.core.access.WeightedTcProvider"/>
-        </service>
-        <reference name="tcManager" interface="org.apache.clerezza.rdf.core.access.TcManager"
-        cardinality="1..1" policy="static" bind="bindTcManager" unbind="unbindTcManager"/>
-        <reference name="cgProvider" interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider"
-        cardinality="1..1" policy="static" bind="bindContentGraphProvider" unbind="unbindContentGraphProvider"/>
-        <reference name="startLevel" interface="org.osgi.service.startlevel.StartLevel"
-        cardinality="1..1" policy="static" bind="bindStartLevel" unbind="unbindStartLevel"/>
-        <reference name="pathNode" interface="org.wymiwyg.commons.util.dirbrowser.PathNode"
-        cardinality="0..n" policy="dynamic" bind="bindPathNode" unbind="unbindPathNode"/>
-    </scr:component>
-</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala b/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
deleted file mode 100644
index 645dab1..0000000
--- a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
+++ /dev/null
@@ -1,301 +0,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.
- */
-
-package org.apache.clerezza.platform.content.fsadaptor
-
-import java.util.Collections
-import org.apache.clerezza.platform.Constants
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
-import org.apache.clerezza.rdf.core.Graph
-import org.apache.clerezza.rdf.core.MGraph
-import org.apache.clerezza.rdf.core.NonLiteral
-import org.apache.clerezza.rdf.core.Resource
-import org.apache.clerezza.rdf.core.TripleCollection
-import org.apache.clerezza.rdf.core.Triple
-import org.apache.clerezza.rdf.core.UriRef
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException
-import org.apache.clerezza.rdf.core.access.TcManager
-import org.apache.clerezza.rdf.core.access.WeightedTcProvider
-import org.apache.clerezza.rdf.core.access.security.TcPermission
-import org.apache.clerezza.rdf.core.impl.AbstractMGraph
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph
-import org.apache.clerezza.utils.osgi.BundlePathNode
-import org.osgi.framework.Bundle
-import org.osgi.framework.BundleEvent
-import org.osgi.framework.BundleListener
-import org.osgi.service.component.ComponentContext
-import org.osgi.service.startlevel.StartLevel
-import org.slf4j.LoggerFactory
-import org.wymiwyg.commons.util.dirbrowser.MultiPathNode
-import org.wymiwyg.commons.util.dirbrowser.PathNode
-import scala.util._
-
-/**
- * This weighted TcProvider provides a graph named urn:x-localinstance/web-resources.graph which contains descriptions
- * of the files below the CLEREZZA-INF/web-resources directory in every bundles. The
- * name of these descriptions (i.e. the rdf resources) use the urn:x-localinstance uri scheme to indicate that
- * they are local to the instance and they will thus be returned as description
- * for all uris with a local authority and the specified path-section.
- */
-class BundleFsLoader extends BundleListener with Logger with WeightedTcProvider {
-
-  private val RESOURCE_MGRAPH_URI = new UriRef(Constants.URN_LOCAL_INSTANCE+"/web-resources.graph")
-  private val cacheGraphPrefix = Constants.URN_LOCAL_INSTANCE+"/web-resources-cache.graph"
-  private var currentCacheUri: UriRef = null
-
-  private var tcManager: TcManager = null
-  private var cgProvider: ContentGraphProvider = null
-  private var startLevel: StartLevel = null
-  private var pathNodes: List[PathNode] = Nil 
-  private var bundleList = List[Bundle]()
-  private var currentCacheMGraph: MGraph = null
-  
-  private var frequentUpdateDirectory: Option[PathNode] = None
-
-  private val virtualMGraph: MGraph = new AbstractMGraph() {
-    
-    private def baseGraph: TripleCollection = frequentUpdateDirectory match {
-        case Some(p) => new DirectoryOverlay(p, currentCacheMGraph)
-        case None => currentCacheMGraph
-    }
-    
-    override def performFilter(s: NonLiteral, p: UriRef,
-                      o: Resource): java.util.Iterator[Triple] = {
-      val baseIter = baseGraph.filter(s,p,o)
-      new java.util.Iterator[Triple]() {
-        override def next = {
-          baseIter.next
-        }
-        override def hasNext = baseIter.hasNext
-        override def remove = throw new UnsupportedOperationException
-      }
-    }
-
-    override def size = baseGraph.size
-    
-    override def toString = "BundleFsLoader virtual graph"
-    
-  }
-
-  class UpdateThread extends Thread {
-
-    private var updateRequested = false;
-
-    start()
-
-    override def run() {
-      try {
-        while (!isInterrupted) {
-          synchronized {
-            while (!updateRequested) wait();
-          }
-          updateRequested = false
-          updateCache()
-        }
-      } catch {
-        case e: InterruptedException => BundleFsLoader.log.debug("Update thread interrupted");
-      }
-    }
-
-    def update() = {
-      synchronized {
-        updateRequested = true
-        notify();
-      }
-    }
-  }
-  
-  private var updateThread: UpdateThread = null
-
-
-  private def deleteCacheGraphs() {
-    import collection.JavaConversions._
-    for(mGraphUri <- tcManager.listMGraphs) {
-      if(mGraphUri.getUnicodeString.startsWith(cacheGraphPrefix)) {
-        tcManager.deleteTripleCollection(mGraphUri);
-      }
-    }
-  }
-
-  protected def activate(context: ComponentContext) {
-    synchronized {
-      deleteCacheGraphs()
-      for (bundle <- context.getBundleContext().getBundles();
-          if bundle.getState == Bundle.ACTIVE) {
-        bundleList ::= bundle
-      }
-      updateCache
-      tcManager.getTcAccessController.setRequiredReadPermissions(
-          RESOURCE_MGRAPH_URI, Collections.singleton(new TcPermission(Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ)))
-      cgProvider.addTemporaryAdditionGraph(RESOURCE_MGRAPH_URI)
-      updateThread = new UpdateThread()
-      context.getBundleContext().addBundleListener(this);
-    }
-  }
-  protected def deactivate(context: ComponentContext) {
-    synchronized {
-      context.getBundleContext().removeBundleListener(this);
-      updateThread.interrupt()
-      cgProvider.removeTemporaryAdditionGraph(RESOURCE_MGRAPH_URI)
-      tcManager.deleteTripleCollection(currentCacheUri);
-      updateThread == null;
-    }
-  }
-
-  private def updateCache() = {
-    def getVirtualTripleCollection(bundles: Seq[Bundle]): TripleCollection = {
-      if (bundles.isEmpty) {
-        new SimpleMGraph()
-      } else {
-        val pathNode = new BundlePathNode(bundles.head, "CLEREZZA-INF/web-resources");
-        if (pathNode.isDirectory) {
-          BundleFsLoader.log.debug("Creating directory overlay for "+bundles.head)
-          new DirectoryOverlay(pathNode, getVirtualTripleCollection(bundles.tail))
-        } else {
-          getVirtualTripleCollection(bundles.tail)
-        }
-      }
-    }
-    synchronized {
-      val sortedList = Sorting.stableSort(bundleList, (b:Bundle) => -startLevel.getBundleStartLevel(b))
-      val newCacheUri = new UriRef(cacheGraphPrefix+System.currentTimeMillis)
-      val newChacheMGraph = tcManager.createMGraph(newCacheUri);
-      tcManager.getTcAccessController.setRequiredReadPermissions(
-          newCacheUri, Collections.singleton(new TcPermission(Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ)))
-      newChacheMGraph.addAll(getVirtualTripleCollection(sortedList))
-      currentCacheMGraph = newChacheMGraph
-      val oldCacheUri = currentCacheUri
-      currentCacheUri = newCacheUri
-      if (oldCacheUri != null) tcManager.deleteTripleCollection(oldCacheUri);
-      BundleFsLoader.log.debug("updated web-resource cache")
-    }
-  }
-
-  
-
-  override def getWeight() = 30
-
-  override def getMGraph(name: UriRef) = {
-    if (name.equals(RESOURCE_MGRAPH_URI)) {
-      virtualMGraph
-    } else {
-      throw new NoSuchEntityException(name);
-    }
-  }
-
-  override def getTriples(name: UriRef) = {
-    getMGraph(name);
-  }
-
-  override def getGraph(name: UriRef) = {
-    throw new NoSuchEntityException(name);
-  }
-
-
-  override def listMGraphs(): java.util.Set[UriRef] = {
-    java.util.Collections.singleton(RESOURCE_MGRAPH_URI);
-  }
-
-  override def listGraphs() = {
-    new java.util.HashSet[UriRef]();
-  }
-
-  override def listTripleCollections() = {
-    Collections.singleton(RESOURCE_MGRAPH_URI);
-  }
-
-  override def createMGraph(name: UriRef) =  {
-    throw new UnsupportedOperationException("Not supported.");
-  }
-
-  override def createGraph(name: UriRef, triples: TripleCollection): Graph = {
-    throw new UnsupportedOperationException("Not supported.");
-  }
-
-  override def deleteTripleCollection(name: UriRef) {
-    throw new UnsupportedOperationException("Not supported.");
-  }
-
-  override def getNames(graph: Graph) = {
-    val result = new java.util.HashSet[UriRef]();
-    result;
-  }
-
-
-  def bundleChanged(event: BundleEvent) {
-    val updateThread = this.updateThread
-    if (updateThread == null) {
-      BundleFsLoader.log.error("UpdateThread is null, yet we get bundle Events")
-    }
-    val bundle = event.getBundle();
-    event.getType() match  {
-      case BundleEvent.STARTED => {
-        bundleList ::= bundle
-        updateThread.update()
-      }
-      case BundleEvent.STOPPED => {
-        bundleList = bundleList.filterNot(b => b == bundle)
-        updateThread.update()
-      }
-      case _ => BundleFsLoader.log.debug("only reacting on bundle start and stop")
-    }
-  }
-
-
-  def bindTcManager(tcManager: TcManager) {
-    this.tcManager = tcManager;
-  }
-
-  def unbindTcManager(tcManager: TcManager) {
-    this.tcManager = null;
-  }
-
-  def bindContentGraphProvider(p: ContentGraphProvider) {
-    cgProvider = p
-  }
-
-  def unbindContentGraphProvider(p: ContentGraphProvider) {
-    cgProvider = null
-  }
-
-  def bindStartLevel(startLevel: StartLevel) {
-    this.startLevel = startLevel;
-  }
-
-  def unbindStartLevel(startLevel: StartLevel) {
-    this.startLevel = null;
-  }
-  
-  def bindPathNode(pathNode: PathNode) {
-    this.pathNodes ::= pathNode;
-    frequentUpdateDirectory = Some(new MultiPathNode(pathNodes: _*))
-  }
-  
-  def unbindPathNode(pathNode: PathNode) {
-    this.pathNodes = this.pathNodes.filter(_ != pathNode);
-    frequentUpdateDirectory = pathNodes match {
-      case Nil => None
-      case _ => Some(new MultiPathNode(pathNodes: _*))
-    }
-  }
-  
-}
-object BundleFsLoader {
-  private val log = LoggerFactory.getLogger(classOf[BundleFsLoader])
-}
\ No newline at end of file


[04/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala b/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala
deleted file mode 100644
index 40bfb21..0000000
--- a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/DirectoryOverlay.scala
+++ /dev/null
@@ -1,86 +0,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.
- */
-
-package org.apache.clerezza.platform.content.fsadaptor
-
-import org.apache.clerezza.rdf.core.NonLiteral
-import org.apache.clerezza.rdf.core.Resource
-import org.apache.clerezza.rdf.core.Triple
-import org.apache.clerezza.rdf.core.TripleCollection
-import org.apache.clerezza.rdf.core.UriRef
-import org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph
-import org.apache.clerezza.utils.IteratorMerger
-import org.wymiwyg.commons.util.dirbrowser.PathNode
-import java.util.Iterator
-
-class DirectoryOverlay(pathNode: PathNode, base: TripleCollection)
-  extends AbstractTripleCollection {
-
-  
-
-  import collection.JavaConversions._
-
-  
-
-  override def performFilter(s: NonLiteral, p: UriRef,
-    o: Resource): Iterator[Triple] = {
-    val addedTriples = new SimpleMGraph()
-
-    PathNode2MGraph.describeInGraph(pathNode, addedTriples)
-    
-    val subjects = (for (triple <- addedTriples; subject = triple.getSubject) yield {
-      subject
-    }).toSet
-  
-    class FilteringIterator(baseIter: Iterator[Triple]) extends Iterator[Triple] {
-      var nextElem: Triple = null
-      def prepareNext {
-        nextElem = if (baseIter.hasNext) baseIter.next else null
-        if ((nextElem != null) && 
-          (subjects.contains(nextElem.getSubject))) {
-            //println("skipping "+nextElem)
-            prepareNext
-        }
-      }
-      prepareNext
-  
-      override def next = {
-        val result = nextElem
-        prepareNext
-        result
-      }
-      override def hasNext = nextElem != null
-      override def remove = throw new UnsupportedOperationException
-    }
-      
-    new IteratorMerger(new FilteringIterator(base.filter(s, p, o)), addedTriples.filter(s,p, o))
-  }
-
-  /**
-   * returns an upper bound of the size (removals in abse are not deducted)
-   */
-  override def size = {
-    val addedTriples = new SimpleMGraph()
-
-      PathNode2MGraph.describeInGraph(pathNode, addedTriples)
-
-   base.size+addedTriples.size 
-  }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala b/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala
deleted file mode 100644
index 684992a..0000000
--- a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/Logger.scala
+++ /dev/null
@@ -1,30 +0,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.
- */
-
-package org.apache.clerezza.platform.content.fsadaptor
-
-import org.slf4j.LoggerFactory
-//import org.slf4j.ext.LoggerWrapper
-
-trait Logger {
-
-  private val slf4jLogger = LoggerFactory.getLogger(this.getClass)
-//  val logger: org.slf4j.Logger = new LoggerWrapper(slf4jLogger, this.getClass.getName)
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala
----------------------------------------------------------------------
diff --git a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala b/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala
deleted file mode 100644
index 8a62774..0000000
--- a/platform/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/PathNode2MGraph.scala
+++ /dev/null
@@ -1,146 +0,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.
- */
-
-package org.apache.clerezza.platform.content.fsadaptor;
-
-import java.io.ByteArrayOutputStream
-import javax.ws.rs.core.MediaType
-import org.apache.clerezza.platform.Constants
-import org.apache.clerezza.rdf.core.LiteralFactory
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl
-import org.apache.clerezza.rdf.core.impl.TripleImpl
-import org.apache.clerezza.rdf.ontologies.DISCOBITS
-import org.apache.clerezza.rdf.ontologies.HIERARCHY
-import org.apache.clerezza.rdf.ontologies.RDF
-import org.apache.clerezza.rdf.utils.GraphNode
-import org.apache.clerezza.web.fileserver.util.MediaTypeGuesser
-import org.wymiwyg.commons.util.dirbrowser.PathNode
-
-
-/**
- *
- * @author reto
- */
-object PathNode2MGraph {
-
-  private val URI_PREFIX = Constants.URN_LOCAL_INSTANCE
-
-  private val literalFactory = LiteralFactory.getInstance
-
-  private def getMediaType(file: PathNode) = {
-    val guessedMediaType: MediaType = MediaTypeGuesser.getInstance().guessTypeForName(file.getPath());
-    if (guessedMediaType != null) {
-      guessedMediaType.toString
-    } else {
-      "application/octet-stream"
-    }
-
-  }
-
-  private def getData(file: PathNode) = {
-    val baos = new ByteArrayOutputStream
-    val in = file.getInputStream()
-    val buffer = new Array[Byte](4096)
-    var read = in.read(buffer)
-    while (read != -1) {
-      baos.write(buffer, 0, read)
-      read = in.read(buffer)
-    }
-    in.close()
-    baos.toByteArray
-  }
-
-  def describeInGraph(directory: PathNode, mGraph: MGraph) {
-    val basePathLength = directory.getPath.length
-    def createUriRef(file: PathNode, isDirectory: Boolean) = {
-      def addSlashIfNeeded(s: String) = {
-         if (s.endsWith("/")) {
-           s
-         } else {
-           s+'/'
-         }
-      }
-      val path =  if (isDirectory) {
-        addSlashIfNeeded(file.getPath.substring(basePathLength))
-      } else {
-        file.getPath.substring(basePathLength)
-      }
-      new UriRef(URI_PREFIX+path)
-    }
-    def processDirectory(directory: PathNode) {
-      val directoryResource = createUriRef(directory, true)
-      mGraph.add(new TripleImpl(directoryResource, RDF.`type`, HIERARCHY.Collection))
-      for (subPath <- directory.list) {
-        val file = directory.getSubPath(subPath)
-        val isDirectory = file.isDirectory
-        val resource = createUriRef(file, isDirectory)
-        mGraph.add(new TripleImpl(resource, HIERARCHY.parent, directoryResource))
-        if (isDirectory) {
-          processDirectory(file)
-        } else {
-          mGraph.add(new TripleImpl(resource, RDF.`type`, DISCOBITS.InfoDiscoBit))
-          val data = getData(file)
-          mGraph.add(new TripleImpl(resource, DISCOBITS.infoBit, literalFactory.createTypedLiteral(data)))
-          mGraph.add(new TripleImpl(resource, DISCOBITS.mediaType,
-                        literalFactory.createTypedLiteral(getMediaType(file))));
-        }
-      }
-    }
-    processDirectory(directory)
-  }
-
-  def removeNodesFromGraph(directory: PathNode, mGraph: MGraph) {
-    val basePathLength = directory.getPath.length
-    def createUriRef(file: PathNode, isDirectory: Boolean) = {
-      def addSlashIfNeeded(s: String) = {
-         if (s.endsWith("/")) {
-           s
-         } else {
-           s+'/'
-         }
-      }
-      val path =  if (isDirectory) {
-        addSlashIfNeeded(file.getPath.substring(basePathLength))
-      } else {
-        file.getPath.substring(basePathLength)
-      }
-      new UriRef(URI_PREFIX+path)
-    }
-    def processDirectory(directory: PathNode) {
-      val directoryResource = createUriRef(directory, true)
-      mGraph.remove(new TripleImpl(directoryResource, RDF.`type`, HIERARCHY.Collection))
-      for (subPath <- directory.list) {
-        val file = directory.getSubPath(subPath)
-        val isDirectory = file.isDirectory
-        val resource = createUriRef(file, isDirectory)
-        val node = new GraphNode(resource, mGraph)
-        if (isDirectory) {
-          processDirectory(file)
-        }
-        node.deleteProperties(HIERARCHY.parent)
-        node.deleteProperties(RDF.`type`)
-        node.deleteProperties(DISCOBITS.infoBit)
-        node.deleteProperties(DISCOBITS.mediaType)
-      }
-    }
-    processDirectory(directory)
-  }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.imagemetadata/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content.imagemetadata/LICENSE b/platform/platform.content.imagemetadata/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content.imagemetadata/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.imagemetadata/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.imagemetadata/pom.xml b/platform/platform.content.imagemetadata/pom.xml
deleted file mode 100644
index 6b82b03..0000000
--- a/platform/platform.content.imagemetadata/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>clerezza</artifactId>
-        <groupId>org.apache.clerezza</groupId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content.imagemetadata</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Content Image Metadata</name>
-    <description>Provides a Meta Data Generator that generates metadata for
-    images.</description>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.utils</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>utils.imageprocessing</artifactId>
-            <version>0.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.metadata</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java
----------------------------------------------------------------------
diff --git a/platform/platform.content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java b/platform/platform.content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java
deleted file mode 100644
index b49bffc..0000000
--- a/platform/platform.content.imagemetadata/src/main/java/org/apache/clerezza/platform/content/imagemetadata/ImageMetaDataGenerator.java
+++ /dev/null
@@ -1,64 +0,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.
- */
-package org.apache.clerezza.platform.content.imagemetadata;
-
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import javax.ws.rs.core.MediaType;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
-import org.apache.clerezza.rdf.ontologies.EXIF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.utils.imageprocessing.ImageReaderService;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-
-/**
- * This class generates metadata about image data.
- *
- * @author mir, hasan
- */
-@Component(metatype=true)
-@Service(MetaDataGenerator.class)
-public class ImageMetaDataGenerator implements MetaDataGenerator {
-
-    @Reference
-    private ImageReaderService imageReaderService;
-        
-    @Override
-    public void generate(GraphNode node, byte[] data, MediaType mediaType) {
-
-        if (mediaType.getType().startsWith("image")) {
-            try {
-                BufferedImage buffImage = imageReaderService.getBufferedImage(
-                                        new ByteArrayInputStream(data));
-                node.deleteProperties(EXIF.width);
-                node.deleteProperties(EXIF.height);
-                node.addProperty(EXIF.width, LiteralFactory.getInstance().
-                        createTypedLiteral(Integer.valueOf(buffImage.getWidth())));
-                node.addProperty(EXIF.height, LiteralFactory.getInstance().
-                        createTypedLiteral(Integer.valueOf(buffImage.getHeight())));
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/LICENSE b/platform/platform.content.representations/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content.representations/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.core/LICENSE b/platform/platform.content.representations/platform.content.representations.core/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content.representations/platform.content.representations.core/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.core/pom.xml b/platform/platform.content.representations/platform.content.representations.core/pom.xml
deleted file mode 100644
index 996e2a0..0000000
--- a/platform/platform.content.representations/platform.content.representations.core/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>platform.content.representations</artifactId>
-        <groupId>org.apache.clerezza</groupId>
-        <version>0.2</version>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content.representations.core</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Content Representations Core</name>
-    <description>Provides a Meta Data Generator that generates alternative
-        representations for data of    various media types</description>
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.utils</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.metadata</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>jaxrs.utils</artifactId>
-            <version>0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>utils.imageprocessing</artifactId>
-            <version>0.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.content</artifactId>
-            <version>0.14</version>
-        </dependency>
-<!--
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>web.resources.style</artifactId>
-        </dependency>
--->
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.content.representations.ontologies</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java b/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
deleted file mode 100644
index f7e5f57..0000000
--- a/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
+++ /dev/null
@@ -1,327 +0,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.
- */
-package org.apache.clerezza.platform.content.representations.core;
-
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.concurrent.locks.Lock;
-import javax.imageio.ImageIO;
-import javax.ws.rs.core.MediaType;
-import org.apache.clerezza.platform.content.DiscobitsHandler;
-import org.apache.clerezza.platform.content.InfoDiscobit;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
-import org.apache.clerezza.rdf.ontologies.DISCOBITS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.utils.imageprocessing.ImageProcessor;
-import org.apache.clerezza.utils.imageprocessing.ImageReaderService;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.service.component.ComponentContext;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * This class provides a method that generates a thumbnail for specified data
- * if the specified media type is supported. The supported media types are "image/*".
- * The generated thumbnail is added as a property to the specified
- * <code>GraphNode</code>. The property URI is
- * "http://discobits.org/ontology#thumbnail".
- *
- * @author mir
- */
-@Component(metatype=true)
-@Service({
-    MetaDataGenerator.class,
-    AlternativeRepresentationGenerator.class
-})
-
-public class AlternativeRepresentationGenerator implements MetaDataGenerator {
-
-    private static class Resolution {
-
-        private int width;
-
-        private int height;
-        /**
-         * Takes a String, which contains a resoultion in the format
-         * [width]x[height].
-         *
-         * @param resoulutionString
-         */
-        public Resolution(String resoulutionString) {
-            String[] widthAndHeight = resoulutionString.split("x");
-            width = new Integer(widthAndHeight[0]);
-            height = new Integer(widthAndHeight[1]);
-        }
-
-        /**
-         * A Resolution with the specified width and height.
-         *
-         * @param width
-         * @param height
-         */
-        public Resolution(int width, int height) {
-            this.width = width;
-            this.height = height;
-        }
-
-        public int getHeight() {
-            return height;
-        }
-
-        public int getWidth() {
-            return width;
-        }
-    }
-    final static String EXACT_APPENDIX = "-exact";
-
-    @Reference
-    private ImageProcessor imageProcessor;
-        
-        @Reference
-    private ImageReaderService imageReaderService;
-
-    @Property(value="100x100,200x200", description="Specifies the resolutions of alternative" +
-            " representations in the format [width]x[height]. Multiple resolutions" +
-            " are separated by comma (e.g. 100x100,30x30)")
-    public static final String RESOLUTIONS = "resolutions";
-
-    @Property(value="100x100,200x200", description="Specifies the exact resolutions of alternative" +
-            " representations in the format [width]x[height]. Multiple resolutions" +
-            " are separated by comma (e.g. 100x100,30x30). The image will be cropped if it has not " +
-            "the needed proportions")
-    public static final String EXACT_RESOLUTIONS = "exact_resolutions";
-    
-    private volatile ServiceTracker discobitTracker;
-    private Resolution[] resolutions;
-    private Resolution[] exactResolutions;
-
-    /**
-     * Indicates if data given to the AlternativeRepresentationGenerator is a
-     * alternative representation itself and therefore does not have to have a
-     * alternative representation generated for it.
-     */
-    private ThreadLocal<Boolean> isAltRepresentation = new ThreadLocal<Boolean>() {
-
-        @Override
-        protected Boolean initialValue() {
-            return false;
-        }
-    };
-
-    protected void activate(ComponentContext context) {
-        resolutions = createResolutionArray((String) context.getProperties().get(RESOLUTIONS));
-        exactResolutions = createResolutionArray((String) context.getProperties().get(EXACT_RESOLUTIONS));
-        discobitTracker = new ServiceTracker(context.getBundleContext(),
-                DiscobitsHandler.class.getName(), null);
-        new Thread() {
-            @Override
-            public void run() {
-                discobitTracker.open();
-            }
-        }.start();
-    }
-
-    private Resolution[] createResolutionArray(String resolutionsString) {
-        String[] resoultionStrings = resolutionsString.split(",");
-        Resolution[] resolutionArray = new Resolution[resoultionStrings.length];
-        for (int i = 0; i < resoultionStrings.length; i++) {
-            resolutionArray[i] = new Resolution(resoultionStrings[i].trim());
-        }
-        return resolutionArray;
-    }
-
-    protected void deactivate(ComponentContext context) {
-        discobitTracker.close();
-        discobitTracker = null;
-    }
-
-    @Override
-    public void generate(GraphNode node, byte[] data, MediaType mediaType) {
-        if (isAltRepresentation.get()) {
-            return;
-        }
-        if (mediaType.getType().startsWith("image")) {
-            generateAlternativeImages(data, mediaType, node);
-        }
-    }
-
-    /**
-     * Generates an alternative image of the image at the specified infoBitNode.
-     * The parameters width and height specify the dimensions the generated
-     * image should have. The image will be resized to fit the specified
-     * dimensions (height and width of the generated image will be smaller
-     * or equals the specified width and height). Returns the URI of the
-     * generated image.
-     *
-     * @param infoBitNode an infoDiscoBit of media type image
-     * @param width the width the generated image should have
-     * @param height the height the generated image should have
-     * @return the URI of the generated image
-     */
-    public UriRef generateAlternativeImage(GraphNode infoBitNode, int width, int height) {
-        return generateAlternativeImage(infoBitNode, width, height, false);
-    }
-
-    /**
-     * Generates an alternative image of the image at the specified infoBitNode.
-     * The parameters width and height specify the dimensions the generated
-     * image should have. If exact is true, then the generated image will be
-     * resized and cropped to match the specified width and height exactly. If
-     * exact is false, then the image will be resized to fit the specified
-     * dimensions (height and width of the generated image will be smaller
-     * or equals the specified width and height). Returns the URI of the
-     * generated image.
-     *
-     * @param infoBitNode an infoDiscoBit of media type image
-     * @param width the width the generated image should have
-     * @param height the height the generated image should have
-     * @param exact specifies if the generated image must have the exact
-     *        width and height or not.
-     * @return the URI of the generated image
-     */
-    public UriRef generateAlternativeImage(GraphNode infoBitNode, int width, int height, 
-            boolean exact) {
-        try {
-            isAltRepresentation.set(Boolean.TRUE);
-            InfoDiscobit infoBit = InfoDiscobit.createInstance(infoBitNode);
-            BufferedImage buffImage = imageReaderService.getBufferedImage(
-                                new ByteArrayInputStream(infoBit.getData()));
-            return generateAlternativeImage(buffImage, new Resolution(width, height), 
-                    MediaType.valueOf(infoBit.getContentType()), infoBitNode, exact);
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        } finally {
-            isAltRepresentation.set(Boolean.FALSE);
-        }
-    }
-
-    private void generateAlternativeImages(byte[] data, MediaType mediaType,
-            GraphNode node) throws RuntimeException {
-        try {
-            isAltRepresentation.set(Boolean.TRUE);
-            BufferedImage buffImage = imageReaderService.getBufferedImage(
-                                new ByteArrayInputStream(data));
-            int imgWidth = buffImage.getWidth();
-            int imgHeigth = buffImage.getHeight();
-            for (Resolution resolution : resolutions) {
-                if (imgWidth > resolution.getWidth() || imgHeigth > resolution.getHeight()) {
-                    generateAlternativeImage(buffImage, resolution, mediaType, node, false);
-                }
-            }
-            for (Resolution resolution : exactResolutions) {
-                if (imgWidth > resolution.getWidth() && imgHeigth > resolution.getHeight()) {
-                    generateAlternativeImage(buffImage, resolution, mediaType, node, true);
-                }
-            }
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        } finally {
-            isAltRepresentation.set(Boolean.FALSE);
-        }
-    }
-
-    private UriRef generateAlternativeImage(BufferedImage buffImage, Resolution resolution,
-            MediaType mediaType, GraphNode node, boolean extact) throws IOException {
-        BufferedImage alternativeImage;
-        if (extact) {
-            alternativeImage = resizeAndCrop(resolution, buffImage);
-            if (alternativeImage == null) {
-                return null;
-            }
-        } else {
-            alternativeImage = imageProcessor.makeAThumbnail(buffImage,
-                    resolution.getWidth(), resolution.getHeight());
-        }
-        byte[] alternativeImageBytes = bufferedImage2ByteArray(alternativeImage, mediaType);
-        DiscobitsHandler contentHandler = (DiscobitsHandler) discobitTracker.getService();
-        
-        UriRef thumbnailUri = createThumbnailUri((UriRef) node.getNode(), alternativeImage, extact);
-        contentHandler.put(thumbnailUri, mediaType, alternativeImageBytes);
-        Lock writeLock = node.writeLock();
-        writeLock.lock();
-        try {
-            node.addProperty(DISCOBITS.thumbnail, thumbnailUri);
-            return thumbnailUri;
-        } finally {
-            writeLock.unlock();
-        }
-    }
-    
-        private BufferedImage resizeAndCrop(Resolution resolution, BufferedImage buffImage) {
-        BufferedImage alternativeImage;
-        int imageHeight = 0;
-        int imageWidth = 0;
-        int widthDiff = buffImage.getWidth() - resolution.getWidth() ;
-        int heightDiff = buffImage.getHeight() - resolution.getHeight();
-        // resize if both dimension are bigger than the dimensions of the needed resolution
-        if (widthDiff >= 0 && heightDiff >= 0) {
-            if (widthDiff < heightDiff) {
-                imageWidth = resolution.getWidth();
-            } else {
-                imageHeight = resolution.getHeight();
-            }
-            alternativeImage = imageProcessor.resizeProportional(buffImage, imageWidth, imageHeight);
-        } else {
-            return null;
-        }
-        // crop image to fit exact the resolution
-        if (widthDiff < heightDiff) {
-            heightDiff = alternativeImage.getHeight() - resolution.getHeight();
-            alternativeImage = alternativeImage.getSubimage(0, heightDiff/2, resolution.getWidth(),
-                    resolution.getHeight());
-        } else {
-            widthDiff = alternativeImage.getWidth() - resolution.getWidth();
-            alternativeImage = alternativeImage.getSubimage(widthDiff/2, 0, resolution.getWidth(),
-                    resolution.getHeight());
-        }
-        return alternativeImage;
-    }
-
-    private byte[] bufferedImage2ByteArray(BufferedImage image,
-            MediaType mediaType) throws IOException {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ImageIO.write(image, mediaType.getSubtype(), baos);
-        byte[] bytes = baos.toByteArray();
-        baos.flush();
-        return bytes;
-    }
-
-    private UriRef createThumbnailUri(UriRef uriRef, BufferedImage img, boolean exact) {
-        String resolution = "-" + img.getWidth() + "x" + img.getHeight() + (exact ? EXACT_APPENDIX: "");
-        String oldUri = uriRef.getUnicodeString();
-        String newUri;
-        int lastIndexOfDot = oldUri.lastIndexOf(".");
-        int lastIndexOfSlash = oldUri.lastIndexOf("/");
-        // 6 characters to keep the extension at the end.
-        if (lastIndexOfSlash < lastIndexOfDot &&
-                lastIndexOfDot >= (oldUri.length() - 6)) {
-            String firstPart = oldUri.substring(0, lastIndexOfDot);
-            String lastPart = oldUri.substring(lastIndexOfDot, oldUri.length());
-            newUri = firstPart + resolution + lastPart;
-        } else {
-            newUri = oldUri + resolution;
-        }
-        return new UriRef(newUri);
-    }
-}


[38/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/LICENSE.txt
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/LICENSE.txt b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/LICENSE.txt
new file mode 100644
index 0000000..8b324c6
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/LICENSE.txt
@@ -0,0 +1,1446 @@
+Mozile is available under the Mozilla Public License version 1.1, the GNU 
+General Public Licence version 2, the GNU Lesser General Public License 
+version 2.1, and the Apache License version 2.0. As the recipient of Mozile 
+you may choose which license to accept this code under. Some modules and 
+included content may be licensed under different terms, as explicitly 
+specified in their respective COPYING or LICENSE files in the directories 
+in which they are found and in the files themselves.
+
+The full text of the MPL 1.1, GPL 2, LPGL 2.1, and Apache 2.0 licenses is 
+reproduced below.
+
+**********************************************************************
+
+
+
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (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.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
+
+
+
+**********************************************************************
+
+
+
+
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+
+
+
+**********************************************************************
+
+
+
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+
+
+
+**********************************************************************
+
+
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/README
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/README b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/README
new file mode 100644
index 0000000..cf21b4b
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/README
@@ -0,0 +1,119 @@
+Mozile Editor
+-------------
+
+http://mozile.mozdev.org
+mozile@mozdev.org
+
+Mozile adds what-you-see-is-what-you-get (WYSIWYG) editing to your web pages. 
+It uses JavaScript and is compatible with current Mozilla Firefox and 
+Internet Explorer web browsers.
+
+
+Getting Started
+---------------
+
+To use Mozile, first download the latest version from our web site 
+<http://mozile.mozdev.org>. Unzip the archive to a directory on your web 
+server.
+
+You include Mozile in your web page by adding a script tag like this to the 
+<head> section:
+
+	<script type="text/javascript" src="path/to/mozile.js"></script>
+
+You can then configure Mozile with a second <script>, like this:
+	
+	<script type="text/javascript" src="path/to/mozile.js"></script>
+	<script type="text/javascript">
+		window.onload = function() {
+			mozile.editElements("editor");
+			mozile.useSchema("../lib/xhtml.rng");
+		}
+	</script>
+
+For details on configuration options, visit 
+
+	http://mozile.mozdev.org/0.8/doc/html/index.html
+
+In this example configuration all elements that have their their "class" 
+attribute set to "editor" will be editable by Mozile. For example:
+
+	<div class="editor">
+		<p>This paragraph is editable.</p>
+	</div>
+
+Instead of using the 'mozile.editElements("editor")' command, you can set the
+"contentEditable" attribute of the elements you want to edit to "true", like
+this:
+
+	<div contentEditable="true">
+		<p>This paragraph is editable.</p>
+	</div>
+
+Either method will work, so choose whichever one you prefer. You can now edit 
+your web page with Mozile!
+
+For information about how to save the pages that Mozile has edited, see:
+
+	http://mozile.mozdev.org/0.8/doc/html/index.html
+
+
+Compatibility
+-------------
+
+Our goal is for Mozile to work in as many modern browsers as possible. At the 
+current stage of development Mozile works in:
+
+- Mozilla Firefox 1.5
+- Internet Explorer 6
+
+
+Documentation and Getting Help
+------------------------------
+
+The place to start looking for help or more information is our home page:
+
+	http://mozile.mozdev.org
+
+For information specific to Mozile 0.8 visit:
+
+	http://mozile.mozdev.org/0.8/index.html
+
+For information on using and configuring Mozile, see the documentation at:
+
+	http://mozile.mozdev.org/0.8/doc/html/index.html
+
+Developer documentation on our APIs is available at:
+
+	http://mozile.mozdev.org/0.8/doc/jsdoc/index.html
+
+You can send email to our mailing list, or browse the archives for answers to 
+your questions:
+
+	http://mozile.mozdev.org/list.html
+
+We also have an IRC chat room where you get immediate feedback from Mozile's 
+developers:
+
+	irc.freenode.net #mozile
+
+
+Mozile Source Code
+------------------
+
+You can access to the latest Mozile source code in our CVS repository. For 
+instructions see:
+
+	http://mozile.mozdev.org/source.html
+
+If you want to create a custom mozile.js file using your own list of Mozile 
+modules, our Apache Ant build script can help you. Ant version 1.6.x is 
+required (http://ant.apache.org). The tools/build.xml file contains the logic 
+and the tools/build.properties file contains user modifiable settings. Get 
+started by reading the help information:
+
+	%> cd tools
+	%> ant help
+
+
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/Mozile-16.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/Mozile-16.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/Mozile-16.png
new file mode 100644
index 0000000..c091927
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/Mozile-16.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-down.gif
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-down.gif b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-down.gif
new file mode 100644
index 0000000..e021f13
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-down.gif differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-right.gif
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-right.gif b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-right.gif
new file mode 100644
index 0000000..dce39ae
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/arrow-right.gif differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/COPYING
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/COPYING b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/COPYING
new file mode 100644
index 0000000..ce9ccf7
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/COPYING
@@ -0,0 +1 @@
+The images in this directory belong to the "Silk" icon set, created by Mark James and available at <http://www.famfamfam.com/lab/icons/silk/>. The copyright belongs to Mark James, and the images are distributed under a Creative Commons Attribution 2.5 License <http://creativecommons.org/licenses/by/2.5/>.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_redo.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_redo.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_redo.png
new file mode 100755
index 0000000..fdc394c
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_redo.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_undo.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_undo.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_undo.png
new file mode 100755
index 0000000..6972c5e
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/arrow_undo.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/bug.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/bug.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/bug.png
new file mode 100755
index 0000000..2d5fb90
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/bug.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/cut.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/cut.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/cut.png
new file mode 100755
index 0000000..f215d6f
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/cut.png differ


[44/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js
new file mode 100644
index 0000000..f30cc14
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+function SelectedConcepts(){};
+
+SelectedConcepts.exists = function (concept) {
+	var exists = false;
+	$("input[name='concepts']").each( function () {
+		if ($(this).val() == concept) {
+			exists = true;
+		}
+	});
+	return exists;
+}
+
+SelectedConcepts.addConcept = function (prefLabel, uri) {
+	var div = $("<div/>");
+	ConceptFinder.createConceptWidgets(prefLabel, uri).appendTo(div);
+	SelectedConcepts.createDeleteButton(prefLabel, uri).appendTo(div);
+	$("<br />").appendTo(div);
+	$("<br />").appendTo(div);
+	$("#selected-concepts").append(div);
+}
+
+/**
+ * Creates a button that allows to delete a concept.
+ */
+SelectedConcepts.createDeleteButton = function(prefLabel, uri) {
+	var deleteLink = $("<a/>").attr("href", "#");
+	deleteLink.addClass("tx-icon tx-icon-delete").text("Delete");
+	deleteLink.click(function() {
+		deleteLink.parent().remove();
+		ConceptFinder.createSystemFoundConcept(prefLabel, uri)
+	});
+	return deleteLink;
+}
+
+
+$(document).ready(function () {
+	$(".tx-icon-delete").click(function() {
+		$(this).parent().remove();
+	});
+});

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css
new file mode 100644
index 0000000..fe8d6fe
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+input, select, textarea {
+	width: 32em;
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java b/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java
new file mode 100644
index 0000000..c73da54
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java
@@ -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.
+ */
+package org.apache.clerezza.platform.concepts.core;
+
+import java.util.Arrays;
+import java.util.List;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.RuntimeDelegate;
+import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.LockableMGraphWrapper;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.wink.common.internal.runtime.RuntimeDelegateImpl;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This class tests the functionality of a SimpleConceptProviderManager.
+ *
+ * @author hasan
+ */
+public class ConceptProviderManagerTest {
+
+    private class TestConceptProvider implements ConceptProvider {
+        @Override
+        public Graph retrieveConcepts(String searchTerm) {
+            return null;
+        }
+    }
+
+    private class TestedConceptProviderManager extends SimpleConceptProviderManager {
+        public void fillConceptProviderList() {
+            ConceptProvider CP1 = new TestConceptProvider();
+            ConceptProvider CP2 = new TestConceptProvider();
+            getConceptProviders().add(CP1);
+            getConceptProviders().add(CP2);
+        }
+    }
+
+    private static LockableMGraph mGraph = new LockableMGraphWrapper(new SimpleMGraph());
+
+    private TestedConceptProviderManager testedConceptProviderManager;
+
+    @Before
+    public void setUp() {
+        RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
+        testedConceptProviderManager = new TestedConceptProviderManager();
+        testedConceptProviderManager.cgProvider = new ContentGraphProvider() {
+
+            @Override
+            public LockableMGraph getContentGraph() {
+                return mGraph;
+            }
+        };
+    }
+
+    @Test
+    public void testUpdateConceptProviders() {
+        testedConceptProviderManager.fillConceptProviderList();
+        List<ConceptProvider> cpl = testedConceptProviderManager
+                .getConceptProviders();
+        Assert.assertTrue(cpl.get(0) instanceof TestConceptProvider);
+        Assert.assertTrue(cpl.get(1) instanceof TestConceptProvider);
+        Assert.assertTrue(cpl.size()==2);
+        List<String> types = Arrays.asList(
+                CONCEPTS.LocalConceptProvider.getUnicodeString(),
+                CONCEPTS.RemoteConceptProvider.getUnicodeString());
+        List<String> sparqlEndPoint = Arrays.asList(
+                "", "http://example.org/sparql");
+        List<String> defaultGraphs = Arrays.asList(
+                "", "http://example.org/graph");
+        List<String> queryTemplates = Arrays.asList(
+                "", "CONSTRUCT {?a ?b ?c .} WHERE {?a ?b ?c .}");
+        List<String> conceptSchemes = Arrays.asList(
+                "http://localhost:8080/default", "");
+        Response response = testedConceptProviderManager.updateConceptProviders(
+                types, sparqlEndPoint, defaultGraphs, queryTemplates,
+                conceptSchemes);
+        cpl = testedConceptProviderManager.getConceptProviders();
+        Assert.assertTrue(cpl.get(0) instanceof LocalConceptProvider);
+        Assert.assertTrue(cpl.get(1) instanceof RemoteConceptProvider);
+        Assert.assertTrue(cpl.size()==2);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java b/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java
new file mode 100644
index 0000000..ef63d25
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java
@@ -0,0 +1,154 @@
+/*
+ * 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.concepts.core;
+
+import java.util.Arrays;
+import java.util.List;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.platform.concepts.ontologies.QUERYRESULT;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.LockableMGraphWrapper;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.OWL;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.SKOS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This class tests the functionality of a ConceptsFinder.
+ *
+ * @author hasan
+ */
+public class ConceptsFinderTest {
+
+    private final UriRef concept1a = new UriRef("http://example.org/concept1a");
+    private final UriRef concept1b = new UriRef("http://example.org/concept1b");
+    private final UriRef concept1c = new UriRef("http://example.org/concept1c");
+    private final UriRef concept1d = new UriRef("http://example.org/concept1d");
+
+    private final UriRef concept2a = new UriRef("http://example.org/concept2a");
+    private final UriRef concept2b = new UriRef("http://example.org/concept2b");
+    private final UriRef concept2c = new UriRef("http://example.org/concept2c");
+    private final UriRef concept2d = new UriRef("http://example.org/concept2d");
+
+    private final List<UriRef> concepts1 = Arrays.asList(
+            concept1a, concept1b, concept1c, concept1d);
+    private final List<UriRef> concepts2 = Arrays.asList(
+            concept2a, concept2b, concept2c, concept2d);
+
+    private class TestConceptProvider implements ConceptProvider {
+        MGraph conceptGraph = new SimpleMGraph();
+
+        public TestConceptProvider(List<UriRef> myConcepts,
+                List<UriRef> yourConcepts, List<Integer> sameAs) {
+            Assert.assertTrue(myConcepts.size()==4);
+            Assert.assertTrue(yourConcepts.size()==4);
+            for (UriRef concept : myConcepts) {
+                conceptGraph.add(new TripleImpl(concept, RDF.type, SKOS.Concept));
+            }
+            for (Integer index : sameAs) {
+                conceptGraph.add(new TripleImpl(myConcepts.get(index), OWL.sameAs,
+                    yourConcepts.get(index)));
+            }
+        }
+
+        @Override
+        public Graph retrieveConcepts(String searchTerm) {
+            return conceptGraph.getGraph();
+        }
+    }
+
+    private class TestedConceptProviderManager extends SimpleConceptProviderManager {
+        public void fillConceptProviderList() {
+            ConceptProvider CP1 = new TestConceptProvider(concepts1, concepts2,
+                    Arrays.asList(1,3));
+            ConceptProvider CP2 = new TestConceptProvider(concepts2, concepts1,
+                    Arrays.asList(2,3));
+            getConceptProviders().add(CP1);
+            getConceptProviders().add(CP2);
+        }
+    }
+
+    private class TestedConceptsFinder extends ConceptsFinder {
+    }
+
+    private static LockableMGraph mGraph = new LockableMGraphWrapper(new SimpleMGraph());
+    private TestedConceptProviderManager testedConceptProviderManager;
+    private TestedConceptsFinder testedConceptsFinder;
+
+    @Before
+    public void setUp() {
+        final PlatformConfig platformConfig = new PlatformConfig() {
+
+            @Override
+            public UriRef getDefaultBaseUri() {
+                return new UriRef("http://testing.localhost/");
+            }
+            
+        };
+        final ContentGraphProvider cgProvider = new ContentGraphProvider() {
+
+            @Override
+            public LockableMGraph getContentGraph() {
+                return new LockableMGraphWrapper(new SimpleMGraph());
+            }
+
+        };
+
+        testedConceptProviderManager = new TestedConceptProviderManager();
+        testedConceptProviderManager.cgProvider = new ContentGraphProvider() {
+            @Override
+            public LockableMGraph getContentGraph() {
+                return mGraph;
+            }
+        };
+        testedConceptsFinder = new TestedConceptsFinder() {
+            {
+                bindPlatformConfig(platformConfig);
+                bindCgProvider(cgProvider);
+            }
+        };
+        testedConceptsFinder.conceptProviderManager =
+                testedConceptProviderManager;
+
+    }
+
+    @Test
+    public void testFindConcepts() {
+        testedConceptProviderManager.fillConceptProviderList();
+        GraphNode proposals = testedConceptsFinder.findConcepts("any");
+        Assert.assertEquals(5, proposals.countObjects(QUERYRESULT.concept));
+        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1a));
+        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1b));
+        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1c));
+        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1d));
+        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept2a));
+        Assert.assertFalse(proposals.hasProperty(QUERYRESULT.concept, concept2b));
+        Assert.assertFalse(proposals.hasProperty(QUERYRESULT.concept, concept2c));
+        Assert.assertFalse(proposals.hasProperty(QUERYRESULT.concept, concept2d));
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.ontologies/LICENSE b/platform/concepts/platform.concepts.ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/concepts/platform.concepts.ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.ontologies/pom.xml b/platform/concepts/platform.concepts.ontologies/pom.xml
new file mode 100644
index 0000000..d266140
--- /dev/null
+++ b/platform/concepts/platform.concepts.ontologies/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.concepts</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.concepts.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Concepts Ontologies</name>
+    <description>
+        Ontologies for Platform Concepts Core
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf b/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf
new file mode 100644
index 0000000..a8cb5e4
--- /dev/null
+++ b/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf
@@ -0,0 +1,191 @@
+<?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.
+
+-->
+
+<rdf:RDF
+	xmlns="http://clerezza.org/2010/01/concepts#"
+	xml:base="http://clerezza.org/2010/01/concepts"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:skos="http://www.w3.org/2008/05/skos#"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+>
+
+<!-- Ontology -->
+
+<owl:Ontology rdf:about="http://clerezza.org/2010/01/concepts#">
+	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
+	<dc:title xml:lang="en">
+		Clerezza Concepts
+	</dc:title>
+</owl:Ontology>
+
+<!-- Classes -->
+
+<rdfs:Class rdf:about="#ConceptsPage">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Concepts Page</rdfs:label>
+	<skos:definition xml:lang="en">
+		A web page containing a list of concept entries and associated information.
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#ManageConceptProvidersPage">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Manage Concept Providers Page</rdfs:label>
+	<skos:definition xml:lang="en">
+		A web page for managing all concept providers
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#SearchTerm">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Search Term</rdfs:label>
+	<skos:definition xml:lang="en">A search term</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#ConceptProvider">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Concept Provider</rdfs:label>
+	<skos:definition xml:lang="en">
+		A Provider for retrieving concepts
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#LocalConceptProvider">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:subClassOf rdf:resource="ConceptProvider"/>
+	<rdfs:label xml:lang="en">Local Concept Provider</rdfs:label>
+	<skos:definition xml:lang="en">
+		A Concept Provider for retrieving concepts from a graph in localhost
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#RemoteConceptProvider">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Remote Concept Provider</rdfs:label>
+	<rdfs:subClassOf rdf:resource="ConceptProvider"/>
+	<skos:definition xml:lang="en">
+		A Concept Provider for retrieving concepts via a sparql endpoint
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#ConceptProviderList">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Concept Provider List</rdfs:label>
+	<skos:definition xml:lang="en">
+		A list of Concept Providers
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#ConceptCache">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Concept Cache</rdfs:label>
+	<skos:definition xml:lang="en">A cache for all concepts retrieved from a
+		specific Graph managed by a specific SPARQL End Point.
+	</skos:definition>
+</rdfs:Class>
+
+<rdfs:Class rdf:about="#GenericResourcePage">
+	<rdf:type rdf:resource="owl:Class"/>
+	<rdfs:label xml:lang="en">Generic Resource Page</rdfs:label>
+	<skos:definition xml:lang="en">
+		A web page containing a resource and selected concepts.
+	</skos:definition>
+</rdfs:Class>
+
+<!-- Properties -->
+
+<rdf:Property rdf:about="#selectedScheme">
+	<rdf:type rdf:resource="owl:ObjectProperty"/>
+	<rdfs:label xml:lang="en">selected concept scheme</rdfs:label>
+	<skos:definition xml:lang="en">Points to the selected concept scheme.</skos:definition>
+	<rdfs:domain rdf:resource="#ConceptsPage"/>
+	<rdfs:domain rdf:resource="#ConceptProvider"/>
+	<rdfs:range rdf:resource="skos:ConceptScheme"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#queryTemplate">
+	<rdf:type rdf:resource="owl:DatatypeProperty"/>
+	<rdfs:label xml:lang="en">query template</rdfs:label>
+	<skos:definition xml:lang="en">
+		Points to a template containing a sparql query string which will
+		be applied by the subject to retrieve concepts.
+	</skos:definition>
+	<rdfs:domain rdf:resource="#ConceptProvider"/>
+	<rdfs:range rdf:resource="xsd:string"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#searchTerm">
+	<rdf:type rdf:resource="owl:DatatypeProperty"/>
+	<rdfs:label xml:lang="en">search Term</rdfs:label>
+	<skos:definition xml:lang="en">Points to a string as a term to be
+		searched in concept labels.</skos:definition>
+	<rdfs:domain rdf:resource="#SearchTerm"/>
+	<rdfs:range rdf:resource="xsd:string"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#searchResult">
+	<rdf:type rdf:resource="owl:ObjectProperty"/>
+	<rdfs:label xml:lang="en">search Result</rdfs:label>
+	<skos:definition xml:lang="en">Points to a concept which is a result of
+		a search using the term represented by the subject.
+	</skos:definition>
+	<rdfs:domain rdf:resource="#SearchTerm"/>
+	<rdfs:range rdf:resource="skos:Concept"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#sparqlEndPoint">
+	<rdf:type rdf:resource="owl:ObjectProperty"/>
+	<rdfs:label xml:lang="en">Sparql End Point</rdfs:label>
+	<skos:definition xml:lang="en">
+		Points to a UriRef of a sparql endpoint.
+	</skos:definition>
+	<rdfs:domain rdf:resource="#RemoteConceptProvider"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#defaultGraph">
+	<rdf:type rdf:resource="owl:ObjectProperty"/>
+	<rdfs:label xml:lang="en">default Graph</rdfs:label>
+	<skos:definition xml:lang="en">Points to a graph against which the subject
+		performs its queries.</skos:definition>
+	<rdfs:domain rdf:resource="#ConceptProvider"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#cacheEntry">
+	<rdf:type rdf:resource="owl:ObjectProperty"/>
+	<rdfs:label xml:lang="en">cache Entry</rdfs:label>
+	<skos:definition xml:lang="en">Points to a resource which describes
+		cached search results for a search term.
+	</skos:definition>
+	<rdfs:domain rdf:resource="#ConceptCache"/>
+</rdf:Property>
+
+<rdf:Property rdf:about="#resource">
+	<rdf:type rdf:resource="owl:ObjectProperty"/>
+	<rdfs:label xml:lang="en">Resource</rdfs:label>
+	<skos:definition xml:lang="en">Points to a resource.</skos:definition>
+	<rdfs:domain rdf:resource="#GenericConceptScheme"/>
+</rdf:Property>
+
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf b/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf
new file mode 100644
index 0000000..4b298b0
--- /dev/null
+++ b/platform/concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf
@@ -0,0 +1,62 @@
+<?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.
+
+-->
+
+<rdf:RDF
+    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns:skos="http://www.w3.org/2008/05/skos#"
+    xmlns="http://clerezza.org/2010/04/queryresult#"
+    xmlns:owl="http://www.w3.org/2002/07/owl#"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+  xml:base="http://clerezza.org/2010/04/queryresult">
+  <owl:Ontology rdf:about="#">
+    <owl:versionInfo>Revision: 0.1</owl:versionInfo>
+    <dc:title xml:lang="en">
+		Ontology for describing the result of a Query for Concepts
+	</dc:title>
+  </owl:Ontology>
+  <rdfs:Class rdf:ID="QueryResult">
+    <rdfs:label xml:lang="en">Query Result</rdfs:label>
+    <skos:definition xml:lang="en">
+		The result of a query for concepts.
+	</skos:definition>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+  </rdfs:Class>
+  <rdf:Property rdf:ID="concept">
+    <rdfs:label xml:lang="en">concept</rdfs:label>
+    <skos:definition xml:lang="en">Points to a concept matching the query yielding to the subject.</skos:definition>
+    <rdfs:domain rdf:resource="#QueryResult"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2008/05/skos#Concept"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+  </rdf:Property>
+  <rdf:Property rdf:ID="creationOfNewFreeConceptSuggested">
+    <rdfs:label xml:lang="en">creationOfNewFreeConceptSuggested</rdfs:label>
+    <skos:definition xml:lang="en">Points to a boolean value that indicates whether 
+    consumers of the subject are suggested to create new concepts with a query as 
+    preferred label.</skos:definition>
+    <rdfs:domain rdf:resource="#QueryResult"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+  </rdf:Property>
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/pom.xml
----------------------------------------------------------------------
diff --git a/platform/concepts/pom.xml b/platform/concepts/pom.xml
new file mode 100644
index 0000000..7133468
--- /dev/null
+++ b/platform/concepts/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.concepts</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Concepts</name>
+    <description>Provides services for tagging resources with SKOS concepts.</description>
+    <modules>
+        <module>platform.concepts.ontologies</module>
+        <module>platform.concepts.core</module>
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config.gui/LICENSE
----------------------------------------------------------------------
diff --git a/platform/config.gui/LICENSE b/platform/config.gui/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/config.gui/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config.gui/pom.xml
----------------------------------------------------------------------
diff --git a/platform/config.gui/pom.xml b/platform/config.gui/pom.xml
new file mode 100644
index 0000000..96493dc
--- /dev/null
+++ b/platform/config.gui/pom.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.config.gui</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Configuration GUI</name>
+    <description>This bundles initializes a GUI to
+        edit configuration options.
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java
----------------------------------------------------------------------
diff --git a/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java b/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java
new file mode 100644
index 0000000..a341bc5
--- /dev/null
+++ b/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java
@@ -0,0 +1,66 @@
+/*
+ * 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.config.gui;
+
+import java.security.Permission;
+import org.apache.clerezza.permissiondescriptions.PermissionInfo;
+
+/**
+ * Permission to use the Config GUI. Note that the user
+ * additionally needs permission write into the system graph.
+ *
+ * @author tio
+ */
+@PermissionInfo(value="Config GUI Access Permission", description="Grants access " +
+    "to the Config GUI")
+public class ConfigGuiAccessPermission extends Permission{
+
+    public ConfigGuiAccessPermission() {
+        super("Config GUI Access permission");
+    }
+    /**
+     *
+     * @param target ignored
+     * @param action ignored
+     */
+    public ConfigGuiAccessPermission(String target, String actions) {
+        super("Config GUI Access permission");
+    }
+
+    @Override
+    public boolean implies(Permission permission) {
+        return equals(permission);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return getClass().equals(obj.getClass());
+    }
+
+    @Override
+    public int hashCode() {
+        return 2177987;
+    }
+
+    @Override
+    public String getActions() {
+        return "";
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java
----------------------------------------------------------------------
diff --git a/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java b/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java
new file mode 100644
index 0000000..647a0e6
--- /dev/null
+++ b/platform/config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java
@@ -0,0 +1,190 @@
+/*
+ * 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.config.gui;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.platform.config.SystemConfig;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Services;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
+import org.osgi.framework.Bundle;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.UriRef;
+
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.security.TcPermission;
+
+import org.apache.clerezza.rdf.ontologies.*;
+import org.apache.clerezza.web.fileserver.BundlePathNode;
+import org.apache.clerezza.web.fileserver.FileServer;
+import org.wymiwyg.commons.util.dirbrowser.PathNode;
+
+/**
+ * Provides a GUI to change platform default values.
+ *
+ * @author osr
+ */
+@Component
+@Services({
+    @Service(value = Object.class),
+    @Service(value = GlobalMenuItemsProvider.class)
+})
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("/admin/configuration")
+public class PlatformConfigGui implements GlobalMenuItemsProvider {
+
+    private final static char SLASH = '/';
+    @Reference
+    private PlatformConfig platformConfig;
+    @Reference
+    private RenderletManager renderletManager;
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+    private final UriRef CONFIG_PAGE = new UriRef("http://clerezza.org/2009/08/platform#ConfigPage");
+    private FileServer fileServer;
+
+    protected void activate(ComponentContext context) throws IOException,
+            URISyntaxException {
+        Bundle bundle = context.getBundleContext().getBundle();
+        URL resourceDir = getClass().getResource("staticweb");
+        PathNode pathNode = new BundlePathNode(bundle, resourceDir.getPath());
+
+        logger.debug("Initializing file server for {} ({})", resourceDir,
+                resourceDir.getFile());
+
+        fileServer = new FileServer(pathNode);
+
+        URL template = getClass().getResource(
+                "config.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(template.toURI().toString()),
+                CONFIG_PAGE, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+    }
+
+    protected void deactivate(ComponentContext context) {
+        fileServer = null;
+    }
+
+    /**
+     * Returns a headed page listing RSS Feeds. The optional parameter query is a
+     * search term, which tests if the term is contained in thee title or uri
+     * of the feed.
+     *
+     * @param query an optional parameter which specifies a search term criteria.
+     * The search term will be tested if contained in the title or the uri of the feed.
+     *
+     * @return {@link GraphNode}
+     *
+     */
+    @GET
+    public GraphNode getConfig() {
+        AccessController.checkPermission(new ConfigGuiAccessPermission());
+        GraphNode node = new GraphNode(new BNode(), new SimpleMGraph());
+        node.addProperty(RDF.type, CONFIG_PAGE);
+        node.addProperty(RDF.type, PLATFORM.HeadedPage);
+        node.addProperty(PLATFORM.defaultBaseUri, platformConfig.getDefaultBaseUri());
+        return node;
+
+    }
+
+    @POST
+    public Response setConfig(@FormParam(value = "defaultBaseUri") String defaultBaseUri,
+            @Context UriInfo uriInfo) {
+        AccessController.checkPermission(new ConfigGuiAccessPermission());
+        logger.debug("Setting base-uri to {}", defaultBaseUri);
+        if (defaultBaseUri.charAt(defaultBaseUri.length() - 1) != SLASH) {
+            defaultBaseUri += SLASH;
+        }
+        UriRef uri = new UriRef(defaultBaseUri);
+        GraphNode node = platformConfig.getPlatformInstance();
+        LockableMGraph sysGraph = (LockableMGraph) node.getGraph();
+        Lock writeLock = sysGraph.getLock().writeLock();
+        writeLock.lock();
+        try {
+            node.deleteProperties(PLATFORM.defaultBaseUri);
+            node.addProperty(PLATFORM.defaultBaseUri, uri);
+        } finally {
+            writeLock.unlock();
+        }
+        return Response.status(Response.Status.ACCEPTED).build();
+    }
+
+    @Override
+    public Set<GlobalMenuItem> getMenuItems() {
+        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
+        try {
+            AccessController.checkPermission(new ConfigGuiAccessPermission());
+            AccessController.checkPermission(
+                    new TcPermission(SystemConfig.SYSTEM_GRAPH_URI.toString(),
+                    TcPermission.READWRITE));
+        } catch (AccessControlException e) {
+            return items;
+        }
+        items.add(new GlobalMenuItem("/admin/configuration", "Configuration", "Configuration", 2,
+                "Administration"));
+        return items;
+    }
+
+    /**
+     * Returns a PathNode of a static file from the staticweb folder.
+     *
+     * @param path specifies the path parameter
+     * @return {@link PathNode}
+     */
+    @GET
+    @Path("{path:.+}")
+    public PathNode getStaticFile(
+            @PathParam("path") String path) {
+        return fileServer.getNode(path);
+
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp
----------------------------------------------------------------------
diff --git a/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp b/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp
new file mode 100644
index 0000000..627cf18
--- /dev/null
+++ b/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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 platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#"+s)
+resultDocModifier.addStyleSheet("style/form.css");
+resultDocModifier.addScriptReference("/jquery/jquery-1.3.2.min.js");
+resultDocModifier.addScriptReference("/admin/configuration/js/platformconfig.js");
+resultDocModifier.addStyleSheet("/yui/2/container/assets/container-core.css");
+resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
+resultDocModifier.addScriptReference("/yui/2/element/element-min.js");
+resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
+resultDocModifier.addScriptReference("/scripts/alert-message.js");
+resultDocModifier.addScriptReference("/scripts/ajax-options.js");
+resultDocModifier.addScriptReference("/scripts/modification-status.js");
+resultDocModifier.addScripts("ModificationStatus.watchElements(\"input\");");
+
+resultDocModifier.setTitle("Apache Clerezza Configuration");
+resultDocModifier.addNodes2Elem("tx-module", <h1>Apache Clerezza Configuration</h1>);
+resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a class="tx-button tx-button-create " id="saveButton" href="#">Save</a></li>);
+<div id="tx-content">
+	<fieldset>
+		<legend></legend>
+		<ol>
+			<li class="tx-line">
+				<label for="defaultBaseUri">Default Base URI</label>
+				<input id="defaultBaseUri" name="defaultBaseUri" value={res/platform("defaultBaseUri")*}/>
+
+			</li>
+		</ol>
+	</fieldset>
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js
----------------------------------------------------------------------
diff --git a/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js b/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js
new file mode 100644
index 0000000..5e922a1
--- /dev/null
+++ b/platform/config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+$(document).ready(function() {
+    $('#saveButton').click(function(){
+
+        if(isUrl($('#defaultBaseUri').val())){
+            var q = "Are you sure you want to change the URI to "+$('#defaultBaseUri').val();
+            AlertMessage.show(function(){
+
+                var data = "defaultBaseUri=" + encodeURIComponent($("#defaultBaseUri").val());
+                var options = new AjaxOptions("platform-config", "Save Config", function() {
+					ModificationStatus.isModified = false;
+				});
+                options.type = "POST";
+                options.url = "/admin/configuration/";
+                options.data = data;
+                $.ajax(options);
+            }, q , "Change Config?");
+            
+        }else {
+            AlertMessage.show(function(){}, " No valid URL ", "Error", "OK");
+        }
+
+
+
+
+    })
+})
+
+
+
+function isUrl(s) {
+    var regexp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
+    return regexp.test(s);
+}
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config/LICENSE
----------------------------------------------------------------------
diff --git a/platform/config/LICENSE b/platform/config/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/config/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.


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

Posted by re...@apache.org.
CLEREZZA-966: removed platform. prefix of folder names

Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/70220239
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/70220239
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/70220239

Branch: refs/heads/rdf-commons
Commit: 70220239fa0e864a2d5127b562c3e973e2bc668c
Parents: 4d35191
Author: Reto Gmuer <re...@apache.org>
Authored: Mon Mar 23 17:02:45 2015 +0000
Committer: Reto Gmuer <re...@apache.org>
Committed: Mon Mar 23 17:02:45 2015 +0000

----------------------------------------------------------------------
 platform/accountcontrolpanel/LICENSE            |   201 +
 .../platform.accountcontrolpanel.core/LICENSE   |   201 +
 .../platform.accountcontrolpanel.core/pom.xml   |   198 +
 .../account-control-panel/scripts/IEKeygen.js   |   287 +
 .../account-control-panel/scripts/profile.js    |    64 +
 .../account-control-panel/style/profile.css     |    51 +
 .../resources/OSGI-INF/serviceComponents.xml    |   101 +
 .../AcpPermissionDescriptionsProvider.scala     |    75 +
 .../accountcontrolpanel/MenuItemProvider.scala  |    71 +
 .../accountcontrolpanel/ProfilePanel.scala      |   466 +
 .../accountcontrolpanel/SettingsPanel.scala     |   646 +
 .../html/ContactConfirmRenderlet.scala          |   109 +
 .../accountcontrolpanel/html/PersonBox.scala    |    63 +
 .../accountcontrolpanel/html/ProfilePanel.scala |   295 +
 .../html/RenderingUtility.scala                 |    94 +
 .../html/SettingsPanel.scala                    |   163 +
 .../accountcontrolpanel/permissions.scala       |   103 +
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 .../src/site/site.xml                           |    30 +
 .../src/site/xsite/content/sitemap.xml          |    28 +
 .../src/site/xsite/content/usage.xhtml          |    49 +
 .../src/site/xsite/templates/skin.html          |    71 +
 .../LICENSE                                     |   201 +
 .../pom.xml                                     |    67 +
 .../ontologies/controlpanel.rdf                 |   120 +
 platform/accountcontrolpanel/pom.xml            |    41 +
 platform/concepts/LICENSE                       |   201 +
 platform/concepts/README.txt                    |    18 +
 .../concepts/platform.concepts.core/LICENSE     |   201 +
 .../concepts/platform.concepts.core/pom.xml     |   111 +
 .../platform/concepts/core/ConceptCache.java    |   285 +
 .../concepts/core/ConceptManipulator.java       |   124 +
 .../platform/concepts/core/ConceptProvider.java |    40 +
 .../concepts/core/ConceptProviderManager.java   |    39 +
 .../ConceptProviderManagerAppPermission.java    |    66 +
 .../platform/concepts/core/ConceptsFinder.java  |   266 +
 .../concepts/core/GenericResourcePage.java      |   111 +
 .../concepts/core/LocalConceptProvider.java     |    90 +
 .../concepts/core/RemoteConceptProvider.java    |   134 +
 .../core/RemoteConceptsDescriptionManager.java  |   102 +
 .../platform/concepts/core/ResourceTagger.java  |   131 +
 .../core/SimpleConceptProviderManager.java      |   319 +
 .../concepts/scripts/concept-find-create.js     |    21 +
 .../scripts/concept-provider-manipulation.js    |    21 +
 .../concepts/scripts/selected-concepts.js       |    21 +
 .../META-INF/static-web/concepts/style/form.css |    21 +
 .../concepts/core/concept-existing-subjects.ssp |    29 +
 .../concepts/core/concept-find-create.ssp       |    61 +
 .../platform/concepts/core/concept-tagging.ssp  |    23 +
 .../concepts/core/generic-resource-page.ssp     |    43 +
 .../core/manage-concept-providers-page.ssp      |   128 +
 .../concepts/core/selected-concepts.ssp         |    41 +
 .../concepts/core/skos-collection-json.ssp      |    33 +
 .../staticweb/scripts/concept-find-create.js    |   217 +
 .../scripts/concept-provider-manipulation.js    |   213 +
 .../scripts/jquery.rdfquery.core-1.0.js         |  4040 +++
 .../core/staticweb/scripts/selected-concepts.js |    58 +
 .../concepts/core/staticweb/style/form.css      |    24 +
 .../core/ConceptProviderManagerTest.java        |   104 +
 .../concepts/core/ConceptsFinderTest.java       |   154 +
 .../platform.concepts.ontologies/LICENSE        |   201 +
 .../platform.concepts.ontologies/pom.xml        |    65 +
 .../platform/concepts/ontologies/concepts.rdf   |   191 +
 .../concepts/ontologies/queryresult.rdf         |    62 +
 platform/concepts/pom.xml                       |    38 +
 platform/config.gui/LICENSE                     |   201 +
 platform/config.gui/pom.xml                     |    92 +
 .../config/gui/ConfigGuiAccessPermission.java   |    66 +
 .../platform/config/gui/PlatformConfigGui.java  |   190 +
 .../clerezza/platform/config/gui/config.ssp     |    49 +
 .../config/gui/staticweb/js/platformconfig.js   |    52 +
 platform/config/LICENSE                         |   201 +
 platform/config/pom.xml                         |    79 +
 .../platform/config/PlatformConfig.java         |   191 +
 .../clerezza/platform/config/SystemConfig.java  |   186 +
 .../TcPermissionDescriptionsProvider.java       |    70 +
 .../platform/config/default-system-graph.rdf    |   103 +
 platform/content.default404/LICENSE             |   201 +
 platform/content.default404/pom.xml             |   100 +
 .../main/resources/META-INF/documentation.nt    |    35 +
 .../resources/OSGI-INF/serviceComponents.xml    |    30 +
 .../default404/DefaultPageNotFoundService.scala |    64 +
 platform/content.fsadaptor/LICENSE              |   201 +
 platform/content.fsadaptor/pom.xml              |   116 +
 .../resources/OSGI-INF/serviceComponents.xml    |    38 +
 .../content/fsadaptor/BundleFsLoader.scala      |   301 +
 .../content/fsadaptor/DirectoryOverlay.scala    |    86 +
 .../platform/content/fsadaptor/Logger.scala     |    30 +
 .../content/fsadaptor/PathNode2MGraph.scala     |   146 +
 platform/content.imagemetadata/LICENSE          |   201 +
 platform/content.imagemetadata/pom.xml          |    67 +
 .../imagemetadata/ImageMetaDataGenerator.java   |    64 +
 platform/content.representations/LICENSE        |   201 +
 .../LICENSE                                     |   201 +
 .../pom.xml                                     |    87 +
 .../AlternativeRepresentationGenerator.java     |   327 +
 .../representations/core/ThumbnailService.java  |   378 +
 .../LICENSE                                     |   201 +
 .../pom.xml                                     |    67 +
 .../ontologies/representations.rdf              |    52 +
 platform/content.representations/pom.xml        |    41 +
 platform/content/LICENSE                        |   201 +
 platform/content/pom.xml                        |   154 +
 .../content/AbstractDiscobitsHandler.java       |   151 +
 .../platform/content/CollectionTypeHandler.java |   164 +
 .../platform/content/ContentPostSupport.java    |    98 +
 .../platform/content/DiscobitTemplating.java    |    77 +
 .../platform/content/DiscobitsHandler.java      |    70 +
 .../platform/content/DiscobitsTypeHandler.java  |   556 +
 .../clerezza/platform/content/Editor.java       |   177 +
 .../clerezza/platform/content/InfoDiscobit.java |   105 +
 .../platform/content/InfoDiscobitWriter.java    |    67 +
 .../platform/content/PageNotFoundService.java   |    40 +
 .../content/SimpleDiscobitsHandler.java         |    49 +
 .../content/TitledContentRenderlet.java         |   142 +
 .../clerezza/platform/content/WebDavUtils.java  |   703 +
 .../content/collections/CollectionCreator.java  |    74 +
 .../GenericMetaDataGenerator.java               |    53 +
 .../clerezza/platform/content/webdav/COPY.java  |    38 +
 .../clerezza/platform/content/webdav/LOCK.java  |    38 +
 .../clerezza/platform/content/webdav/MKCOL.java |    37 +
 .../clerezza/platform/content/webdav/MOVE.java  |    38 +
 .../platform/content/webdav/PROPFIND.java       |    37 +
 .../platform/content/webdav/PROPPATCH.java      |    37 +
 .../platform/content/webdav/UNLOCK.java         |    38 +
 .../main/resources/META-INF/documentation.nt    |    59 +
 .../platform/content/OrderedContent_naked.xhtml |     4 +
 .../clerezza/platform/content/Resource.xhtml    |    11 +
 .../platform/content/Resource_naked.xhtml       |     1 +
 .../platform/content/TitledContent.xhtml        |    15 +
 .../content/XHTML_InfoDiscoBit_naked.xhtml      |     1 +
 .../clerezza/platform/content/XmlLiteral.ssp    |    35 +
 .../clerezza/platform/content/collection.ssp    |    38 +
 .../platform/content/staticweb/disco.xhtml      |   171 +
 .../content/staticweb/discoscripts/identity.js  |   399 +
 .../content/staticweb/discoscripts/log.js       |   104 +
 .../content/staticweb/discoscripts/match.js     |   192 +
 .../staticweb/discoscripts/mozile/LICENSE.txt   |  1446 +
 .../staticweb/discoscripts/mozile/README        |   119 +
 .../discoscripts/mozile/images/Mozile-16.png    |   Bin 0 -> 920 bytes
 .../discoscripts/mozile/images/arrow-down.gif   |   Bin 0 -> 52 bytes
 .../discoscripts/mozile/images/arrow-right.gif  |   Bin 0 -> 57 bytes
 .../discoscripts/mozile/images/silk/COPYING     |     1 +
 .../mozile/images/silk/arrow_redo.png           |   Bin 0 -> 625 bytes
 .../mozile/images/silk/arrow_undo.png           |   Bin 0 -> 631 bytes
 .../discoscripts/mozile/images/silk/bug.png     |   Bin 0 -> 774 bytes
 .../discoscripts/mozile/images/silk/cut.png     |   Bin 0 -> 648 bytes
 .../discoscripts/mozile/images/silk/font.png    |   Bin 0 -> 567 bytes
 .../discoscripts/mozile/images/silk/help.png    |   Bin 0 -> 786 bytes
 .../discoscripts/mozile/images/silk/html.png    |   Bin 0 -> 578 bytes
 .../mozile/images/silk/information.png          |   Bin 0 -> 778 bytes
 .../mozile/images/silk/link_add.png             |   Bin 0 -> 570 bytes
 .../mozile/images/silk/link_break.png           |   Bin 0 -> 657 bytes
 .../mozile/images/silk/page_copy.png            |   Bin 0 -> 663 bytes
 .../mozile/images/silk/page_edit.png            |   Bin 0 -> 807 bytes
 .../mozile/images/silk/page_paste.png           |   Bin 0 -> 703 bytes
 .../mozile/images/silk/page_save.png            |   Bin 0 -> 774 bytes
 .../mozile/images/silk/paintbrush.png           |   Bin 0 -> 548 bytes
 .../mozile/images/silk/paintcan.png             |   Bin 0 -> 707 bytes
 .../mozile/images/silk/paste_plain.png          |   Bin 0 -> 605 bytes
 .../mozile/images/silk/photo_add.png            |   Bin 0 -> 707 bytes
 .../discoscripts/mozile/images/silk/pilcrow.png |   Bin 0 -> 361 bytes
 .../discoscripts/mozile/images/silk/style.png   |   Bin 0 -> 813 bytes
 .../mozile/images/silk/text_align_center.png    |   Bin 0 -> 234 bytes
 .../mozile/images/silk/text_align_justify.png   |   Bin 0 -> 209 bytes
 .../mozile/images/silk/text_align_left.png      |   Bin 0 -> 209 bytes
 .../mozile/images/silk/text_align_right.png     |   Bin 0 -> 209 bytes
 .../mozile/images/silk/text_bold.png            |   Bin 0 -> 304 bytes
 .../mozile/images/silk/text_heading_1.png       |   Bin 0 -> 276 bytes
 .../mozile/images/silk/text_heading_2.png       |   Bin 0 -> 304 bytes
 .../mozile/images/silk/text_heading_3.png       |   Bin 0 -> 306 bytes
 .../mozile/images/silk/text_heading_4.png       |   Bin 0 -> 293 bytes
 .../mozile/images/silk/text_heading_5.png       |   Bin 0 -> 304 bytes
 .../mozile/images/silk/text_heading_6.png       |   Bin 0 -> 310 bytes
 .../mozile/images/silk/text_horizontalrule.png  |   Bin 0 -> 317 bytes
 .../mozile/images/silk/text_indent.png          |   Bin 0 -> 353 bytes
 .../mozile/images/silk/text_indent_remove.png   |   Bin 0 -> 351 bytes
 .../mozile/images/silk/text_italic.png          |   Bin 0 -> 223 bytes
 .../mozile/images/silk/text_list_bullets.png    |   Bin 0 -> 344 bytes
 .../mozile/images/silk/text_list_numbers.png    |   Bin 0 -> 357 bytes
 .../mozile/images/silk/text_strikethrough.png   |   Bin 0 -> 269 bytes
 .../mozile/images/silk/text_subscript.png       |   Bin 0 -> 422 bytes
 .../mozile/images/silk/text_superscript.png     |   Bin 0 -> 421 bytes
 .../mozile/images/silk/text_underline.png       |   Bin 0 -> 273 bytes
 .../discoscripts/mozile/images/silk/tick.png    |   Bin 0 -> 537 bytes
 .../discoscripts/mozile/lib/docbook.rng         |   146 +
 .../discoscripts/mozile/lib/local.conf          |    25 +
 .../discoscripts/mozile/lib/xhtml-basic.rng     |   727 +
 .../staticweb/discoscripts/mozile/lib/xhtml.rng |   993 +
 .../mozile/lib/xhtml/exclude/basic-table.rng    |    56 +
 .../mozile/lib/xhtml/exclude/basic.rng          |   122 +
 .../mozile/lib/xhtml/exclude/form.rng           |   118 +
 .../discoscripts/mozile/lib/xhtml/index.html    |   129 +
 .../mozile/lib/xhtml/modules/applet.rng         |    47 +
 .../mozile/lib/xhtml/modules/attribs.rng        |    61 +
 .../mozile/lib/xhtml/modules/base.rng           |    23 +
 .../mozile/lib/xhtml/modules/basic-form.rng     |   200 +
 .../mozile/lib/xhtml/modules/basic-table.rng    |   146 +
 .../mozile/lib/xhtml/modules/bdo.rng            |    37 +
 .../mozile/lib/xhtml/modules/csismap.rng        |   102 +
 .../mozile/lib/xhtml/modules/datatypes.rng      |   120 +
 .../mozile/lib/xhtml/modules/edit.rng           |    55 +
 .../mozile/lib/xhtml/modules/events.rng         |   208 +
 .../mozile/lib/xhtml/modules/form.rng           |   209 +
 .../mozile/lib/xhtml/modules/frames.rng         |   111 +
 .../mozile/lib/xhtml/modules/hypertext.rng      |    61 +
 .../mozile/lib/xhtml/modules/iframe.rng         |    67 +
 .../mozile/lib/xhtml/modules/image.rng          |    40 +
 .../mozile/lib/xhtml/modules/inlstyle.rng       |    11 +
 .../mozile/lib/xhtml/modules/legacy.rng         |   502 +
 .../mozile/lib/xhtml/modules/link.rng           |    56 +
 .../mozile/lib/xhtml/modules/list.rng           |    92 +
 .../mozile/lib/xhtml/modules/meta.rng           |    37 +
 .../mozile/lib/xhtml/modules/nameident.rng      |    39 +
 .../mozile/lib/xhtml/modules/object.rng         |    82 +
 .../mozile/lib/xhtml/modules/param.rng          |    33 +
 .../mozile/lib/xhtml/modules/pres.rng           |   107 +
 .../mozile/lib/xhtml/modules/ruby.rng           |   102 +
 .../mozile/lib/xhtml/modules/script.rng         |    70 +
 .../mozile/lib/xhtml/modules/ssismap.rng        |    14 +
 .../mozile/lib/xhtml/modules/struct.rng         |    76 +
 .../mozile/lib/xhtml/modules/style.rng          |    36 +
 .../mozile/lib/xhtml/modules/table.rng          |   257 +
 .../mozile/lib/xhtml/modules/target.rng         |    31 +
 .../mozile/lib/xhtml/modules/text.rng           |   338 +
 .../mozile/lib/xhtml/xhtml-basic.rng            |    21 +
 .../mozile/lib/xhtml/xhtml-strict.rng           |    36 +
 .../discoscripts/mozile/lib/xhtml/xhtml.rng     |    39 +
 .../staticweb/discoscripts/mozile/mozile.js     |  1368 +
 .../discoscripts/mozile/src/gui/htmlToolbar.css |   162 +
 .../staticweb/discoscripts/parameters.js        |    72 +
 .../content/staticweb/discoscripts/rdfparser.js |   544 +
 .../staticweb/discoscripts/rdfxmlserializer.js  |   130 +
 .../content/staticweb/discoscripts/term.js      |   307 +
 .../content/staticweb/discoscripts/uri.js       |   123 +
 .../content/staticweb/discoscripts/util.js      |   174 +
 .../staticweb/discoscripts/widget-factory.js    |   995 +
 .../content/staticweb/scripts/tria-disco.js     |    56 +
 .../staticweb/style/disco-icon-round.png        |   Bin 0 -> 3798 bytes
 .../content/staticweb/style/disco-icon.png      |   Bin 0 -> 6734 bytes
 .../content/staticweb/style/discostyle.css      |    73 +
 .../content/staticweb/style/favicon.ico         |   Bin 0 -> 4286 bytes
 .../collections/CollectionsCreatorTest.java     |    54 +
 platform/cris/LICENSE                           |   201 +
 platform/cris/pom.xml                           |    95 +
 .../clerezza/platform/cris/IndexService.java    |   243 +
 platform/curieprefixmanager/LICENSE             |   201 +
 platform/curieprefixmanager/core/LICENSE        |   201 +
 platform/curieprefixmanager/core/pom.xml        |    89 +
 .../CuriePrefixRecommender.java                 |    36 +
 .../impl/CuriePrefixManager.java                |   237 +
 .../impl/curie-prefix-list-naked.ssp            |    46 +
 .../impl/curie-prefix-naked.ssp                 |    31 +
 platform/curieprefixmanager/ontologies/LICENSE  |   201 +
 platform/curieprefixmanager/ontologies/pom.xml  |    67 +
 .../curieprefixmanager/ontologies/curie.ttl     |    40 +
 platform/curieprefixmanager/pom.xml             |    59 +
 platform/dashboard.webinterface/LICENSE         |   201 +
 platform/dashboard.webinterface/pom.xml         |    91 +
 .../dashboard/webinterface/DashBoard.java       |   131 +
 .../webinterface/dashboard-template.ssp         |    41 +
 platform/dashboard/LICENSE                      |   201 +
 .../dashboard/platform.dashboard.core/LICENSE   |   201 +
 .../dashboard/platform.dashboard.core/pom.xml   |   114 +
 .../dashboard/ContextualMenuGenerator.java      |   207 +
 .../platform/dashboard/UserLoginNode.java       |    98 +
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 .../platform.dashboard.core/src/site/site.xml   |    30 +
 .../src/site/xsite/content/sitemap.xml          |    26 +
 .../src/site/xsite/content/usage.xhtml          |    70 +
 .../src/site/xsite/templates/skin.html          |    71 +
 .../platform.dashboard.ontologies/LICENSE       |   201 +
 .../platform.dashboard.ontologies/pom.xml       |    67 +
 .../platform/dashboard/ontologies/dashboard.rdf |    50 +
 .../dashboard/ontologies/globalmenu.rdf         |    87 +
 .../dashboard/platform.dashboard.tests/LICENSE  |   201 +
 .../dashboard/platform.dashboard.tests/pom.xml  |   257 +
 .../osgi/FelixContextualMenuGeneratorTest.java  |   195 +
 .../blackbox/osgi/GlobalMenuItemsProviderA.java |    52 +
 platform/dashboard/pom.xml                      |    42 +
 platform/documentation.viewer/LICENSE           |   201 +
 platform/documentation.viewer/pom.xml           |    65 +
 .../viewer/DocumentationViewer.java             |   238 +
 .../main/resources/META-INF/documentation.nt    |    26 +
 .../platform/documentation/viewer/SortTest.java |   143 +
 platform/documentation/LICENSE                  |   201 +
 platform/documentation/pom.xml                  |    75 +
 .../DocumentationInContentGraph.java            |    54 +
 .../documentation/DocumentationProvider.java    |   274 +
 .../documentation/UriMutatorIterator.java       |   176 +
 .../main/resources/META-INF/documentation.nt    |    47 +
 .../documentation/baseUriTransformation.xsl     |    47 +
 .../documentation/UriMutatorIteratorTest.java   |   113 +
 platform/editor/LICENSE                         |   201 +
 platform/editor/nbactions.xml                   |    11 +
 platform/editor/pom.xml                         |   191 +
 .../tools/editor/scripts/RDFa.1.3.0.js          |  3380 ++
 .../tools/editor/scripts/RDFaProcessor.1.3.0.js |  1644 +
 .../tools/editor/scripts/backbone-min.js        |     4 +
 .../tools/editor/scripts/backbone.stickit.js    |   468 +
 .../resources/tools/editor/scripts/etch.js      |   366 +
 .../tools/editor/scripts/greenrdfstore.js       |    78 +
 .../tools/editor/scripts/jquery.min.js          |     5 +
 .../resources/tools/editor/scripts/rdfstore.js  | 31836 +++++++++++++++++
 .../tools/editor/scripts/underscore-min.js      |     7 +
 .../resources/tools/editor/styles/etch.css      |    43 +
 .../tools/editor/styles/images/editor_icons.png |   Bin 0 -> 4893 bytes
 .../clerezza/platform/editor/Manager.scala      |    53 +
 .../renderlets/DiscobitsContentEtch.scala       |   277 +
 .../renderlets/HtmlInfoDicobitRDFaNaked.scala   |    34 +
 .../renderlets/OrderedContentRDFaNaked.scala    |    38 +
 .../renderlets/TitledContentRDFaNaked.scala     |    42 +
 platform/enrichment/LICENSE                     |   201 +
 platform/enrichment/pom.xml                     |    63 +
 .../rdf/enrichment/EnrichmentTcProvider.java    |   192 +
 platform/globalmenu.api/LICENSE                 |   201 +
 platform/globalmenu.api/pom.xml                 |    49 +
 .../platform/globalmenu/GlobalMenuItem.java     |   187 +
 .../globalmenu/GlobalMenuItemsProvider.java     |    39 +
 platform/graphnodeprovider/LICENSE              |   201 +
 platform/graphnodeprovider/pom.xml              |   141 +
 .../resources/OSGI-INF/serviceComponents.xml    |    42 +
 .../PlatformGraphNodeProvider.scala             |   245 +
 platform/graphprovider.content/LICENSE          |   201 +
 platform/graphprovider.content/pom.xml          |    64 +
 .../content/ContentGraphProvider.java           |   133 +
 .../content/GraphNameTransitioner.java          |    95 +
 .../TcPermissionDescriptionsProvider.java       |    58 +
 platform/language/LICENSE                       |   201 +
 .../language/platform.language.core/LICENSE     |   201 +
 .../language/platform.language.core/pom.xml     |    87 +
 .../platform/language/LanguageDescription.java  |   115 +
 .../platform/language/LanguageService.java      |   328 +
 .../platform/language/LanguageWidget.java       |   185 +
 .../platform/language/language-list.ssp         |    50 +
 .../clerezza/platform/language/lingvoj.rdf      | 20946 +++++++++++
 .../language/staticweb/scripts/language-list.js |    35 +
 .../platform.language.ontologies/LICENSE        |   201 +
 .../platform.language.ontologies/pom.xml        |    67 +
 .../platform/language/ontologies/language.rdf   |    52 +
 platform/language/pom.xml                       |    41 +
 platform/launcher.mulgara/LICENSE               |   202 +
 platform/launcher.mulgara/pom.xml               |   163 +
 .../src/main/appended-resources/META-INF/NOTICE |     6 +
 .../images/tut_1_class_diagram.png              |   Bin 0 -> 6985 bytes
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/launcher.mulgara/src/site/site.xml     |    26 +
 .../src/site/xsite/content/information.xhtml    |    41 +
 .../src/site/xsite/content/sitemap.xml          |    26 +
 .../src/site/xsite/templates/skin.html          |    71 +
 platform/launcher.sesame/DISCLAIMER             |    11 +
 platform/launcher.sesame/LICENSE                |   202 +
 platform/launcher.sesame/README.txt             |    11 +
 platform/launcher.sesame/pom.xml                |   178 +
 .../src/main/appended-resources/META-INF/NOTICE |     6 +
 .../launcher.sesame/src/main/assembly/src.xml   |    69 +
 .../images/tut_1_class_diagram.png              |   Bin 0 -> 6985 bytes
 .../resources/documentation/style/style.css     |   419 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/launcher.sesame/src/site/site.xml      |    26 +
 .../src/site/xsite/content/information.xhtml    |    41 +
 .../src/site/xsite/content/sitemap.xml          |    26 +
 .../src/site/xsite/templates/skin.html          |    70 +
 platform/launcher.storageless.parent/LICENSE    |   201 +
 .../platform.launcher.storageless/LICENSE       |   471 +
 .../platform.launcher.storageless/pom.xml       |   417 +
 .../src/main/appended-resources/META-INF/NOTICE |    18 +
 .../platform/launcher/ClerezzaActivator.java    |    73 +
 .../clerezza/platform/launcher/ClerezzaApp.java |   479 +
 .../platform/launcher/LauncherArguments.java    |    70 +
 .../apache/clerezza/platform/launcher/Main.java |    48 +
 .../platform/launcher/MavenArtifactDesc.java    |   147 +
 .../platform/launcher/ShutdownListener.java     |    38 +
 .../images/tut_1_class_diagram.png              |   Bin 0 -> 6985 bytes
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 .../src/site/site.xml                           |    30 +
 .../src/site/xsite/content/sitemap.xml          |    28 +
 .../src/site/xsite/content/usage.xhtml          |   180 +
 .../src/site/xsite/templates/skin.html          |    71 +
 platform/launcher.storageless.parent/pom.xml    |   927 +
 platform/launcher.tdb/DISCLAIMER                |    11 +
 platform/launcher.tdb/LICENSE                   |   471 +
 platform/launcher.tdb/README.txt                |    11 +
 platform/launcher.tdb/nb-configuration.xml      |    18 +
 platform/launcher.tdb/nbactions.xml             |    54 +
 platform/launcher.tdb/pom.xml                   |   229 +
 .../src/main/appended-resources/META-INF/NOTICE |    18 +
 platform/launcher.tdb/src/main/assembly/src.xml |    69 +
 .../images/tut_1_class_diagram.png              |   Bin 0 -> 6985 bytes
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/launcher.tdb/src/site/site.xml         |    26 +
 .../src/site/xsite/content/information.xhtml    |    41 +
 .../src/site/xsite/content/sitemap.xml          |    27 +
 .../src/site/xsite/templates/skin.html          |    71 +
 platform/launcher.virtuoso/DISCLAIMER           |    11 +
 platform/launcher.virtuoso/LICENSE              |   471 +
 platform/launcher.virtuoso/README.txt           |    24 +
 platform/launcher.virtuoso/pom.xml              |   251 +
 .../src/main/appended-resources/META-INF/NOTICE |    18 +
 .../launcher.virtuoso/src/main/assembly/src.xml |    69 +
 .../images/tut_1_class_diagram.png              |   Bin 0 -> 6985 bytes
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/launcher.virtuoso/src/site/site.xml    |    26 +
 .../src/site/xsite/content/information.xhtml    |    41 +
 .../src/site/xsite/content/sitemap.xml          |    27 +
 .../src/site/xsite/templates/skin.html          |    71 +
 platform/logging/LICENSE                        |   201 +
 platform/logging/core/LICENSE                   |   201 +
 platform/logging/core/pom.xml                   |    94 +
 .../platform/logging/LoggingManager.java        |   163 +
 .../logging/LoggingManagerAccessPermission.java |    71 +
 .../platform/logging/config-page-naked.ssp      |    32 +
 platform/logging/initializer/LICENSE            |   201 +
 platform/logging/initializer/pom.xml            |    68 +
 .../logging/initializer/Activator.scala         |    88 +
 platform/logging/ontologies/LICENSE             |   201 +
 platform/logging/ontologies/pom.xml             |    67 +
 .../platform/logging/ontologies/logging.ttl     |    32 +
 platform/logging/pom.xml                        |    49 +
 platform/mail/LICENSE                           |   201 +
 platform/mail/pom.xml                           |    75 +
 .../platform/mail/GraphNodeDataHandler.java     |   131 +
 .../apache/clerezza/platform/mail/MailMan.java  |   177 +
 .../clerezza/platform/mail/MailManImpl.java     |   291 +
 .../platform/mail/MailManPermission.java        |   135 +
 .../MailPermissionDescriptionsProvider.java     |    59 +
 .../platform/mail/MailSessionFactory.java       |    99 +
 .../platform/mail/MailManPermissionTest.java    |    94 +
 platform/platform.accountcontrolpanel/LICENSE   |   201 -
 .../platform.accountcontrolpanel.core/LICENSE   |   201 -
 .../platform.accountcontrolpanel.core/pom.xml   |   198 -
 .../account-control-panel/scripts/IEKeygen.js   |   287 -
 .../account-control-panel/scripts/profile.js    |    64 -
 .../account-control-panel/style/profile.css     |    51 -
 .../resources/OSGI-INF/serviceComponents.xml    |   101 -
 .../AcpPermissionDescriptionsProvider.scala     |    75 -
 .../accountcontrolpanel/MenuItemProvider.scala  |    71 -
 .../accountcontrolpanel/ProfilePanel.scala      |   466 -
 .../accountcontrolpanel/SettingsPanel.scala     |   646 -
 .../html/ContactConfirmRenderlet.scala          |   109 -
 .../accountcontrolpanel/html/PersonBox.scala    |    63 -
 .../accountcontrolpanel/html/ProfilePanel.scala |   295 -
 .../html/RenderingUtility.scala                 |    94 -
 .../html/SettingsPanel.scala                    |   163 -
 .../accountcontrolpanel/permissions.scala       |   103 -
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../src/site/site.xml                           |    30 -
 .../src/site/xsite/content/sitemap.xml          |    28 -
 .../src/site/xsite/content/usage.xhtml          |    49 -
 .../src/site/xsite/templates/skin.html          |    71 -
 .../LICENSE                                     |   201 -
 .../pom.xml                                     |    67 -
 .../ontologies/controlpanel.rdf                 |   120 -
 platform/platform.accountcontrolpanel/pom.xml   |    41 -
 platform/platform.concepts/LICENSE              |   201 -
 platform/platform.concepts/README.txt           |    18 -
 .../platform.concepts.core/LICENSE              |   201 -
 .../platform.concepts.core/pom.xml              |   111 -
 .../platform/concepts/core/ConceptCache.java    |   285 -
 .../concepts/core/ConceptManipulator.java       |   124 -
 .../platform/concepts/core/ConceptProvider.java |    40 -
 .../concepts/core/ConceptProviderManager.java   |    39 -
 .../ConceptProviderManagerAppPermission.java    |    66 -
 .../platform/concepts/core/ConceptsFinder.java  |   266 -
 .../concepts/core/GenericResourcePage.java      |   111 -
 .../concepts/core/LocalConceptProvider.java     |    90 -
 .../concepts/core/RemoteConceptProvider.java    |   134 -
 .../core/RemoteConceptsDescriptionManager.java  |   102 -
 .../platform/concepts/core/ResourceTagger.java  |   131 -
 .../core/SimpleConceptProviderManager.java      |   319 -
 .../concepts/scripts/concept-find-create.js     |    21 -
 .../scripts/concept-provider-manipulation.js    |    21 -
 .../concepts/scripts/selected-concepts.js       |    21 -
 .../META-INF/static-web/concepts/style/form.css |    21 -
 .../concepts/core/concept-existing-subjects.ssp |    29 -
 .../concepts/core/concept-find-create.ssp       |    61 -
 .../platform/concepts/core/concept-tagging.ssp  |    23 -
 .../concepts/core/generic-resource-page.ssp     |    43 -
 .../core/manage-concept-providers-page.ssp      |   128 -
 .../concepts/core/selected-concepts.ssp         |    41 -
 .../concepts/core/skos-collection-json.ssp      |    33 -
 .../staticweb/scripts/concept-find-create.js    |   217 -
 .../scripts/concept-provider-manipulation.js    |   213 -
 .../scripts/jquery.rdfquery.core-1.0.js         |  4040 ---
 .../core/staticweb/scripts/selected-concepts.js |    58 -
 .../concepts/core/staticweb/style/form.css      |    24 -
 .../core/ConceptProviderManagerTest.java        |   104 -
 .../concepts/core/ConceptsFinderTest.java       |   154 -
 .../platform.concepts.ontologies/LICENSE        |   201 -
 .../platform.concepts.ontologies/pom.xml        |    65 -
 .../platform/concepts/ontologies/concepts.rdf   |   191 -
 .../concepts/ontologies/queryresult.rdf         |    62 -
 platform/platform.concepts/pom.xml              |    38 -
 platform/platform.config.gui/LICENSE            |   201 -
 platform/platform.config.gui/pom.xml            |    92 -
 .../config/gui/ConfigGuiAccessPermission.java   |    66 -
 .../platform/config/gui/PlatformConfigGui.java  |   190 -
 .../clerezza/platform/config/gui/config.ssp     |    49 -
 .../config/gui/staticweb/js/platformconfig.js   |    52 -
 platform/platform.config/LICENSE                |   201 -
 platform/platform.config/pom.xml                |    79 -
 .../platform/config/PlatformConfig.java         |   191 -
 .../clerezza/platform/config/SystemConfig.java  |   186 -
 .../TcPermissionDescriptionsProvider.java       |    70 -
 .../platform/config/default-system-graph.rdf    |   103 -
 platform/platform.content.default404/LICENSE    |   201 -
 platform/platform.content.default404/pom.xml    |   100 -
 .../main/resources/META-INF/documentation.nt    |    35 -
 .../resources/OSGI-INF/serviceComponents.xml    |    30 -
 .../default404/DefaultPageNotFoundService.scala |    64 -
 platform/platform.content.fsadaptor/LICENSE     |   201 -
 platform/platform.content.fsadaptor/pom.xml     |   116 -
 .../resources/OSGI-INF/serviceComponents.xml    |    38 -
 .../content/fsadaptor/BundleFsLoader.scala      |   301 -
 .../content/fsadaptor/DirectoryOverlay.scala    |    86 -
 .../platform/content/fsadaptor/Logger.scala     |    30 -
 .../content/fsadaptor/PathNode2MGraph.scala     |   146 -
 platform/platform.content.imagemetadata/LICENSE |   201 -
 platform/platform.content.imagemetadata/pom.xml |    67 -
 .../imagemetadata/ImageMetaDataGenerator.java   |    64 -
 .../platform.content.representations/LICENSE    |   201 -
 .../LICENSE                                     |   201 -
 .../pom.xml                                     |    87 -
 .../AlternativeRepresentationGenerator.java     |   327 -
 .../representations/core/ThumbnailService.java  |   378 -
 .../LICENSE                                     |   201 -
 .../pom.xml                                     |    67 -
 .../ontologies/representations.rdf              |    52 -
 .../platform.content.representations/pom.xml    |    41 -
 platform/platform.content/LICENSE               |   201 -
 platform/platform.content/pom.xml               |   154 -
 .../content/AbstractDiscobitsHandler.java       |   151 -
 .../platform/content/CollectionTypeHandler.java |   164 -
 .../platform/content/ContentPostSupport.java    |    98 -
 .../platform/content/DiscobitTemplating.java    |    77 -
 .../platform/content/DiscobitsHandler.java      |    70 -
 .../platform/content/DiscobitsTypeHandler.java  |   556 -
 .../clerezza/platform/content/Editor.java       |   177 -
 .../clerezza/platform/content/InfoDiscobit.java |   105 -
 .../platform/content/InfoDiscobitWriter.java    |    67 -
 .../platform/content/PageNotFoundService.java   |    40 -
 .../content/SimpleDiscobitsHandler.java         |    49 -
 .../content/TitledContentRenderlet.java         |   142 -
 .../clerezza/platform/content/WebDavUtils.java  |   703 -
 .../content/collections/CollectionCreator.java  |    74 -
 .../GenericMetaDataGenerator.java               |    53 -
 .../clerezza/platform/content/webdav/COPY.java  |    38 -
 .../clerezza/platform/content/webdav/LOCK.java  |    38 -
 .../clerezza/platform/content/webdav/MKCOL.java |    37 -
 .../clerezza/platform/content/webdav/MOVE.java  |    38 -
 .../platform/content/webdav/PROPFIND.java       |    37 -
 .../platform/content/webdav/PROPPATCH.java      |    37 -
 .../platform/content/webdav/UNLOCK.java         |    38 -
 .../main/resources/META-INF/documentation.nt    |    59 -
 .../platform/content/OrderedContent_naked.xhtml |     4 -
 .../clerezza/platform/content/Resource.xhtml    |    11 -
 .../platform/content/Resource_naked.xhtml       |     1 -
 .../platform/content/TitledContent.xhtml        |    15 -
 .../content/XHTML_InfoDiscoBit_naked.xhtml      |     1 -
 .../clerezza/platform/content/XmlLiteral.ssp    |    35 -
 .../clerezza/platform/content/collection.ssp    |    38 -
 .../platform/content/staticweb/disco.xhtml      |   171 -
 .../content/staticweb/discoscripts/identity.js  |   399 -
 .../content/staticweb/discoscripts/log.js       |   104 -
 .../content/staticweb/discoscripts/match.js     |   192 -
 .../staticweb/discoscripts/mozile/LICENSE.txt   |  1446 -
 .../staticweb/discoscripts/mozile/README        |   119 -
 .../discoscripts/mozile/images/Mozile-16.png    |   Bin 920 -> 0 bytes
 .../discoscripts/mozile/images/arrow-down.gif   |   Bin 52 -> 0 bytes
 .../discoscripts/mozile/images/arrow-right.gif  |   Bin 57 -> 0 bytes
 .../discoscripts/mozile/images/silk/COPYING     |     1 -
 .../mozile/images/silk/arrow_redo.png           |   Bin 625 -> 0 bytes
 .../mozile/images/silk/arrow_undo.png           |   Bin 631 -> 0 bytes
 .../discoscripts/mozile/images/silk/bug.png     |   Bin 774 -> 0 bytes
 .../discoscripts/mozile/images/silk/cut.png     |   Bin 648 -> 0 bytes
 .../discoscripts/mozile/images/silk/font.png    |   Bin 567 -> 0 bytes
 .../discoscripts/mozile/images/silk/help.png    |   Bin 786 -> 0 bytes
 .../discoscripts/mozile/images/silk/html.png    |   Bin 578 -> 0 bytes
 .../mozile/images/silk/information.png          |   Bin 778 -> 0 bytes
 .../mozile/images/silk/link_add.png             |   Bin 570 -> 0 bytes
 .../mozile/images/silk/link_break.png           |   Bin 657 -> 0 bytes
 .../mozile/images/silk/page_copy.png            |   Bin 663 -> 0 bytes
 .../mozile/images/silk/page_edit.png            |   Bin 807 -> 0 bytes
 .../mozile/images/silk/page_paste.png           |   Bin 703 -> 0 bytes
 .../mozile/images/silk/page_save.png            |   Bin 774 -> 0 bytes
 .../mozile/images/silk/paintbrush.png           |   Bin 548 -> 0 bytes
 .../mozile/images/silk/paintcan.png             |   Bin 707 -> 0 bytes
 .../mozile/images/silk/paste_plain.png          |   Bin 605 -> 0 bytes
 .../mozile/images/silk/photo_add.png            |   Bin 707 -> 0 bytes
 .../discoscripts/mozile/images/silk/pilcrow.png |   Bin 361 -> 0 bytes
 .../discoscripts/mozile/images/silk/style.png   |   Bin 813 -> 0 bytes
 .../mozile/images/silk/text_align_center.png    |   Bin 234 -> 0 bytes
 .../mozile/images/silk/text_align_justify.png   |   Bin 209 -> 0 bytes
 .../mozile/images/silk/text_align_left.png      |   Bin 209 -> 0 bytes
 .../mozile/images/silk/text_align_right.png     |   Bin 209 -> 0 bytes
 .../mozile/images/silk/text_bold.png            |   Bin 304 -> 0 bytes
 .../mozile/images/silk/text_heading_1.png       |   Bin 276 -> 0 bytes
 .../mozile/images/silk/text_heading_2.png       |   Bin 304 -> 0 bytes
 .../mozile/images/silk/text_heading_3.png       |   Bin 306 -> 0 bytes
 .../mozile/images/silk/text_heading_4.png       |   Bin 293 -> 0 bytes
 .../mozile/images/silk/text_heading_5.png       |   Bin 304 -> 0 bytes
 .../mozile/images/silk/text_heading_6.png       |   Bin 310 -> 0 bytes
 .../mozile/images/silk/text_horizontalrule.png  |   Bin 317 -> 0 bytes
 .../mozile/images/silk/text_indent.png          |   Bin 353 -> 0 bytes
 .../mozile/images/silk/text_indent_remove.png   |   Bin 351 -> 0 bytes
 .../mozile/images/silk/text_italic.png          |   Bin 223 -> 0 bytes
 .../mozile/images/silk/text_list_bullets.png    |   Bin 344 -> 0 bytes
 .../mozile/images/silk/text_list_numbers.png    |   Bin 357 -> 0 bytes
 .../mozile/images/silk/text_strikethrough.png   |   Bin 269 -> 0 bytes
 .../mozile/images/silk/text_subscript.png       |   Bin 422 -> 0 bytes
 .../mozile/images/silk/text_superscript.png     |   Bin 421 -> 0 bytes
 .../mozile/images/silk/text_underline.png       |   Bin 273 -> 0 bytes
 .../discoscripts/mozile/images/silk/tick.png    |   Bin 537 -> 0 bytes
 .../discoscripts/mozile/lib/docbook.rng         |   146 -
 .../discoscripts/mozile/lib/local.conf          |    25 -
 .../discoscripts/mozile/lib/xhtml-basic.rng     |   727 -
 .../staticweb/discoscripts/mozile/lib/xhtml.rng |   993 -
 .../mozile/lib/xhtml/exclude/basic-table.rng    |    56 -
 .../mozile/lib/xhtml/exclude/basic.rng          |   122 -
 .../mozile/lib/xhtml/exclude/form.rng           |   118 -
 .../discoscripts/mozile/lib/xhtml/index.html    |   129 -
 .../mozile/lib/xhtml/modules/applet.rng         |    47 -
 .../mozile/lib/xhtml/modules/attribs.rng        |    61 -
 .../mozile/lib/xhtml/modules/base.rng           |    23 -
 .../mozile/lib/xhtml/modules/basic-form.rng     |   200 -
 .../mozile/lib/xhtml/modules/basic-table.rng    |   146 -
 .../mozile/lib/xhtml/modules/bdo.rng            |    37 -
 .../mozile/lib/xhtml/modules/csismap.rng        |   102 -
 .../mozile/lib/xhtml/modules/datatypes.rng      |   120 -
 .../mozile/lib/xhtml/modules/edit.rng           |    55 -
 .../mozile/lib/xhtml/modules/events.rng         |   208 -
 .../mozile/lib/xhtml/modules/form.rng           |   209 -
 .../mozile/lib/xhtml/modules/frames.rng         |   111 -
 .../mozile/lib/xhtml/modules/hypertext.rng      |    61 -
 .../mozile/lib/xhtml/modules/iframe.rng         |    67 -
 .../mozile/lib/xhtml/modules/image.rng          |    40 -
 .../mozile/lib/xhtml/modules/inlstyle.rng       |    11 -
 .../mozile/lib/xhtml/modules/legacy.rng         |   502 -
 .../mozile/lib/xhtml/modules/link.rng           |    56 -
 .../mozile/lib/xhtml/modules/list.rng           |    92 -
 .../mozile/lib/xhtml/modules/meta.rng           |    37 -
 .../mozile/lib/xhtml/modules/nameident.rng      |    39 -
 .../mozile/lib/xhtml/modules/object.rng         |    82 -
 .../mozile/lib/xhtml/modules/param.rng          |    33 -
 .../mozile/lib/xhtml/modules/pres.rng           |   107 -
 .../mozile/lib/xhtml/modules/ruby.rng           |   102 -
 .../mozile/lib/xhtml/modules/script.rng         |    70 -
 .../mozile/lib/xhtml/modules/ssismap.rng        |    14 -
 .../mozile/lib/xhtml/modules/struct.rng         |    76 -
 .../mozile/lib/xhtml/modules/style.rng          |    36 -
 .../mozile/lib/xhtml/modules/table.rng          |   257 -
 .../mozile/lib/xhtml/modules/target.rng         |    31 -
 .../mozile/lib/xhtml/modules/text.rng           |   338 -
 .../mozile/lib/xhtml/xhtml-basic.rng            |    21 -
 .../mozile/lib/xhtml/xhtml-strict.rng           |    36 -
 .../discoscripts/mozile/lib/xhtml/xhtml.rng     |    39 -
 .../staticweb/discoscripts/mozile/mozile.js     |  1368 -
 .../discoscripts/mozile/src/gui/htmlToolbar.css |   162 -
 .../staticweb/discoscripts/parameters.js        |    72 -
 .../content/staticweb/discoscripts/rdfparser.js |   544 -
 .../staticweb/discoscripts/rdfxmlserializer.js  |   130 -
 .../content/staticweb/discoscripts/term.js      |   307 -
 .../content/staticweb/discoscripts/uri.js       |   123 -
 .../content/staticweb/discoscripts/util.js      |   174 -
 .../staticweb/discoscripts/widget-factory.js    |   995 -
 .../content/staticweb/scripts/tria-disco.js     |    56 -
 .../staticweb/style/disco-icon-round.png        |   Bin 3798 -> 0 bytes
 .../content/staticweb/style/disco-icon.png      |   Bin 6734 -> 0 bytes
 .../content/staticweb/style/discostyle.css      |    73 -
 .../content/staticweb/style/favicon.ico         |   Bin 4286 -> 0 bytes
 .../collections/CollectionsCreatorTest.java     |    54 -
 platform/platform.cris/LICENSE                  |   201 -
 platform/platform.cris/pom.xml                  |    95 -
 .../clerezza/platform/cris/IndexService.java    |   243 -
 platform/platform.curieprefixmanager/LICENSE    |   201 -
 .../platform.curieprefixmanager/core/LICENSE    |   201 -
 .../platform.curieprefixmanager/core/pom.xml    |    89 -
 .../CuriePrefixRecommender.java                 |    36 -
 .../impl/CuriePrefixManager.java                |   237 -
 .../impl/curie-prefix-list-naked.ssp            |    46 -
 .../impl/curie-prefix-naked.ssp                 |    31 -
 .../ontologies/LICENSE                          |   201 -
 .../ontologies/pom.xml                          |    67 -
 .../curieprefixmanager/ontologies/curie.ttl     |    40 -
 platform/platform.curieprefixmanager/pom.xml    |    59 -
 .../platform.dashboard.webinterface/LICENSE     |   201 -
 .../platform.dashboard.webinterface/pom.xml     |    91 -
 .../dashboard/webinterface/DashBoard.java       |   131 -
 .../webinterface/dashboard-template.ssp         |    41 -
 platform/platform.dashboard/LICENSE             |   201 -
 .../platform.dashboard.core/LICENSE             |   201 -
 .../platform.dashboard.core/pom.xml             |   114 -
 .../dashboard/ContextualMenuGenerator.java      |   207 -
 .../platform/dashboard/UserLoginNode.java       |    98 -
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../platform.dashboard.core/src/site/site.xml   |    30 -
 .../src/site/xsite/content/sitemap.xml          |    26 -
 .../src/site/xsite/content/usage.xhtml          |    70 -
 .../src/site/xsite/templates/skin.html          |    71 -
 .../platform.dashboard.ontologies/LICENSE       |   201 -
 .../platform.dashboard.ontologies/pom.xml       |    67 -
 .../platform/dashboard/ontologies/dashboard.rdf |    50 -
 .../dashboard/ontologies/globalmenu.rdf         |    87 -
 .../platform.dashboard.tests/LICENSE            |   201 -
 .../platform.dashboard.tests/pom.xml            |   257 -
 .../osgi/FelixContextualMenuGeneratorTest.java  |   195 -
 .../blackbox/osgi/GlobalMenuItemsProviderA.java |    52 -
 platform/platform.dashboard/pom.xml             |    42 -
 platform/platform.documentation.viewer/LICENSE  |   201 -
 platform/platform.documentation.viewer/pom.xml  |    65 -
 .../viewer/DocumentationViewer.java             |   238 -
 .../main/resources/META-INF/documentation.nt    |    26 -
 .../platform/documentation/viewer/SortTest.java |   143 -
 platform/platform.documentation/LICENSE         |   201 -
 platform/platform.documentation/pom.xml         |    75 -
 .../DocumentationInContentGraph.java            |    54 -
 .../documentation/DocumentationProvider.java    |   274 -
 .../documentation/UriMutatorIterator.java       |   176 -
 .../main/resources/META-INF/documentation.nt    |    47 -
 .../documentation/baseUriTransformation.xsl     |    47 -
 .../documentation/UriMutatorIteratorTest.java   |   113 -
 platform/platform.editor/LICENSE                |   201 -
 platform/platform.editor/nbactions.xml          |    11 -
 platform/platform.editor/pom.xml                |   191 -
 .../tools/editor/scripts/RDFa.1.3.0.js          |  3380 --
 .../tools/editor/scripts/RDFaProcessor.1.3.0.js |  1644 -
 .../tools/editor/scripts/backbone-min.js        |     4 -
 .../tools/editor/scripts/backbone.stickit.js    |   468 -
 .../resources/tools/editor/scripts/etch.js      |   366 -
 .../tools/editor/scripts/greenrdfstore.js       |    78 -
 .../tools/editor/scripts/jquery.min.js          |     5 -
 .../resources/tools/editor/scripts/rdfstore.js  | 31836 -----------------
 .../tools/editor/scripts/underscore-min.js      |     7 -
 .../resources/tools/editor/styles/etch.css      |    43 -
 .../tools/editor/styles/images/editor_icons.png |   Bin 4893 -> 0 bytes
 .../clerezza/platform/editor/Manager.scala      |    53 -
 .../renderlets/DiscobitsContentEtch.scala       |   277 -
 .../renderlets/HtmlInfoDicobitRDFaNaked.scala   |    34 -
 .../renderlets/OrderedContentRDFaNaked.scala    |    38 -
 .../renderlets/TitledContentRDFaNaked.scala     |    42 -
 platform/platform.enrichment/LICENSE            |   201 -
 platform/platform.enrichment/pom.xml            |    63 -
 .../rdf/enrichment/EnrichmentTcProvider.java    |   192 -
 platform/platform.globalmenu.api/LICENSE        |   201 -
 platform/platform.globalmenu.api/pom.xml        |    49 -
 .../platform/globalmenu/GlobalMenuItem.java     |   187 -
 .../globalmenu/GlobalMenuItemsProvider.java     |    39 -
 platform/platform.graphnodeprovider/LICENSE     |   201 -
 platform/platform.graphnodeprovider/pom.xml     |   141 -
 .../resources/OSGI-INF/serviceComponents.xml    |    42 -
 .../PlatformGraphNodeProvider.scala             |   245 -
 platform/platform.graphprovider.content/LICENSE |   201 -
 platform/platform.graphprovider.content/pom.xml |    64 -
 .../content/ContentGraphProvider.java           |   133 -
 .../content/GraphNameTransitioner.java          |    95 -
 .../TcPermissionDescriptionsProvider.java       |    58 -
 platform/platform.language/LICENSE              |   201 -
 .../platform.language.core/LICENSE              |   201 -
 .../platform.language.core/pom.xml              |    87 -
 .../platform/language/LanguageDescription.java  |   115 -
 .../platform/language/LanguageService.java      |   328 -
 .../platform/language/LanguageWidget.java       |   185 -
 .../platform/language/language-list.ssp         |    50 -
 .../clerezza/platform/language/lingvoj.rdf      | 20946 -----------
 .../language/staticweb/scripts/language-list.js |    35 -
 .../platform.language.ontologies/LICENSE        |   201 -
 .../platform.language.ontologies/pom.xml        |    67 -
 .../platform/language/ontologies/language.rdf   |    52 -
 platform/platform.language/pom.xml              |    41 -
 platform/platform.launcher.mulgara/LICENSE      |   202 -
 platform/platform.launcher.mulgara/pom.xml      |   163 -
 .../src/main/appended-resources/META-INF/NOTICE |     6 -
 .../images/tut_1_class_diagram.png              |   Bin 6985 -> 0 bytes
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../platform.launcher.mulgara/src/site/site.xml |    26 -
 .../src/site/xsite/content/information.xhtml    |    41 -
 .../src/site/xsite/content/sitemap.xml          |    26 -
 .../src/site/xsite/templates/skin.html          |    71 -
 platform/platform.launcher.sesame/DISCLAIMER    |    11 -
 platform/platform.launcher.sesame/LICENSE       |   202 -
 platform/platform.launcher.sesame/README.txt    |    11 -
 platform/platform.launcher.sesame/pom.xml       |   178 -
 .../src/main/appended-resources/META-INF/NOTICE |     6 -
 .../src/main/assembly/src.xml                   |    69 -
 .../images/tut_1_class_diagram.png              |   Bin 6985 -> 0 bytes
 .../resources/documentation/style/style.css     |   419 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../platform.launcher.sesame/src/site/site.xml  |    26 -
 .../src/site/xsite/content/information.xhtml    |    41 -
 .../src/site/xsite/content/sitemap.xml          |    26 -
 .../src/site/xsite/templates/skin.html          |    70 -
 .../LICENSE                                     |   201 -
 .../platform.launcher.storageless/LICENSE       |   471 -
 .../platform.launcher.storageless/pom.xml       |   417 -
 .../src/main/appended-resources/META-INF/NOTICE |    18 -
 .../platform/launcher/ClerezzaActivator.java    |    73 -
 .../clerezza/platform/launcher/ClerezzaApp.java |   479 -
 .../platform/launcher/LauncherArguments.java    |    70 -
 .../apache/clerezza/platform/launcher/Main.java |    48 -
 .../platform/launcher/MavenArtifactDesc.java    |   147 -
 .../platform/launcher/ShutdownListener.java     |    38 -
 .../images/tut_1_class_diagram.png              |   Bin 6985 -> 0 bytes
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../src/site/site.xml                           |    30 -
 .../src/site/xsite/content/sitemap.xml          |    28 -
 .../src/site/xsite/content/usage.xhtml          |   180 -
 .../src/site/xsite/templates/skin.html          |    71 -
 .../pom.xml                                     |   927 -
 platform/platform.launcher.tdb/DISCLAIMER       |    11 -
 platform/platform.launcher.tdb/LICENSE          |   471 -
 platform/platform.launcher.tdb/README.txt       |    11 -
 .../platform.launcher.tdb/nb-configuration.xml  |    18 -
 platform/platform.launcher.tdb/nbactions.xml    |    54 -
 platform/platform.launcher.tdb/pom.xml          |   229 -
 .../src/main/appended-resources/META-INF/NOTICE |    18 -
 .../src/main/assembly/src.xml                   |    69 -
 .../images/tut_1_class_diagram.png              |   Bin 6985 -> 0 bytes
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../platform.launcher.tdb/src/site/site.xml     |    26 -
 .../src/site/xsite/content/information.xhtml    |    41 -
 .../src/site/xsite/content/sitemap.xml          |    27 -
 .../src/site/xsite/templates/skin.html          |    71 -
 platform/platform.launcher.virtuoso/DISCLAIMER  |    11 -
 platform/platform.launcher.virtuoso/LICENSE     |   471 -
 platform/platform.launcher.virtuoso/README.txt  |    24 -
 platform/platform.launcher.virtuoso/pom.xml     |   251 -
 .../src/main/appended-resources/META-INF/NOTICE |    18 -
 .../src/main/assembly/src.xml                   |    69 -
 .../images/tut_1_class_diagram.png              |   Bin 6985 -> 0 bytes
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../src/site/site.xml                           |    26 -
 .../src/site/xsite/content/information.xhtml    |    41 -
 .../src/site/xsite/content/sitemap.xml          |    27 -
 .../src/site/xsite/templates/skin.html          |    71 -
 platform/platform.logging/LICENSE               |   201 -
 platform/platform.logging/core/LICENSE          |   201 -
 platform/platform.logging/core/pom.xml          |    94 -
 .../platform/logging/LoggingManager.java        |   163 -
 .../logging/LoggingManagerAccessPermission.java |    71 -
 .../platform/logging/config-page-naked.ssp      |    32 -
 platform/platform.logging/initializer/LICENSE   |   201 -
 platform/platform.logging/initializer/pom.xml   |    68 -
 .../logging/initializer/Activator.scala         |    88 -
 platform/platform.logging/ontologies/LICENSE    |   201 -
 platform/platform.logging/ontologies/pom.xml    |    67 -
 .../platform/logging/ontologies/logging.ttl     |    32 -
 platform/platform.logging/pom.xml               |    49 -
 platform/platform.mail/LICENSE                  |   201 -
 platform/platform.mail/pom.xml                  |    75 -
 .../platform/mail/GraphNodeDataHandler.java     |   131 -
 .../apache/clerezza/platform/mail/MailMan.java  |   177 -
 .../clerezza/platform/mail/MailManImpl.java     |   291 -
 .../platform/mail/MailManPermission.java        |   135 -
 .../MailPermissionDescriptionsProvider.java     |    59 -
 .../platform/mail/MailSessionFactory.java       |    99 -
 .../platform/mail/MailManPermissionTest.java    |    94 -
 .../platform.scripting.scriptmanager/LICENSE    |   201 -
 .../platform.scripting.scriptmanager/pom.xml    |    99 -
 .../scripting/scriptmanager/ScriptManager.java  |   849 -
 .../ScriptManagerAppPermission.java             |    66 -
 .../scriptmanager/ontology/SCRIPTMANAGER.java   |    87 -
 .../main/resources/META-INF/documentation.nt    |   103 -
 .../scriptmanager/ontology/scriptmanager.rdf    |   150 -
 .../scriptmanager-execution-uri-list.xhtml      |    41 -
 .../scriptmanager-execution-uri-overview.ssp    |    50 -
 .../scriptmanager-script-information.xhtml      |    91 -
 .../scriptmanager-script-install.ssp            |    99 -
 .../scriptmanager-script-list.xhtml             |    31 -
 .../scriptmanager-script-overview.ssp           |    69 -
 .../staticweb/js/scriptmanager-execution-uri.js |    27 -
 .../staticweb/js/scriptmanager-overview.js      |    45 -
 .../scriptmanager/staticweb/js/scriptmanager.js |   170 -
 platform/platform.scripting/LICENSE             |   201 -
 platform/platform.scripting/pom.xml             |    75 -
 .../JRubyScriptEngineFactoryWrapper.java        |   100 -
 .../platform/scripting/NoEngineException.java   |    41 -
 .../scripting/ScriptEngineFactoryManager.java   |   183 -
 .../platform/scripting/ScriptExecution.java     |   315 -
 .../ScriptGeneratedResourceTypeHandler.java     |   128 -
 .../scripting/ScriptLanguageDescription.java    |    90 -
 platform/platform.security.conditions/LICENSE   |   201 -
 platform/platform.security.conditions/pom.xml   |    60 -
 .../conditions/NotBundleLocationCondition.java  |    47 -
 platform/platform.security.foafssl/LICENSE      |   201 -
 platform/platform.security.foafssl/core/LICENSE |   201 -
 platform/platform.security.foafssl/core/pom.xml |   139 -
 .../resources/OSGI-INF/serviceComponents.xml    |    47 -
 .../foafssl/auth/FoafSslAuthentication.scala    |   127 -
 .../clerezza/foafssl/auth/WebIDClaim.scala      |   216 -
 .../clerezza/foafssl/auth/X509Claim.scala       |   279 -
 .../apache/clerezza/foafssl/ssl/Activator.scala |   108 -
 .../ssl/X509TrustManagerWrapperService.scala    |    70 -
 .../ontologies/LICENSE                          |   201 -
 .../ontologies/pom.xml                          |    67 -
 .../clerezza/foafssl/ontologies/atomowl.rdf     |   653 -
 .../apache/clerezza/foafssl/ontologies/cert.n3  |   187 -
 .../apache/clerezza/foafssl/ontologies/earl.rdf |   245 -
 .../apache/clerezza/foafssl/ontologies/rsa.rdf  |   114 -
 .../apache/clerezza/foafssl/ontologies/test.n3  |   205 -
 platform/platform.security.foafssl/pom.xml      |    39 -
 platform/platform.security.foafssl/test/LICENSE |   201 -
 platform/platform.security.foafssl/test/pom.xml |   162 -
 .../main/resources/META-INF/documentation.nt    |     2 -
 .../resources/OSGI-INF/serviceComponents.xml    |    43 -
 .../clerezza/foafssl/test/WebIDTester.scala     |   757 -
 .../foafssl/test/pages/WebIDClaimPg.scala       |   240 -
 platform/platform.shellcustomizer/LICENSE       |   201 -
 platform/platform.shellcustomizer/pom.xml       |   112 -
 .../resources/OSGI-INF/serviceComponents.xml    |    33 -
 .../platform/shellcustomizer/PlatformDsl.scala  |    51 -
 .../PlatformShellCustomizer.scala               |    51 -
 .../LICENSE                                     |   201 -
 .../pom.xml                                     |    79 -
 .../web-resources/web-gui-examples/alert.xhtml  |    99 -
 .../web-gui-examples/buttons.xhtml              |   201 -
 .../web-resources/web-gui-examples/edit.xhtml   |   164 -
 .../web-resources/web-gui-examples/header.xhtml |   299 -
 .../web-gui-examples/overlay.xhtml              |   108 -
 .../web-gui-examples/panel-thumbnail.xhtml      |   351 -
 .../web-gui-examples/panel-tree.xhtml           |   324 -
 .../web-resources/web-gui-examples/panel.xhtml  |   235 -
 .../web-gui-examples/style/demo.css             |    64 -
 .../web-resources/web-gui-examples/table.xhtml  |   227 -
 .../web-gui-examples/temp/img/eye1.jpg          |   Bin 4517 -> 0 bytes
 .../web-gui-examples/temp/img/tiger1.jpg        |   Bin 4860 -> 0 bytes
 .../web-gui-examples/temp/img/tiger2.jpg        |   Bin 6321 -> 0 bytes
 .../web-gui-examples/thumbnail.xhtml            |   214 -
 .../web-gui-examples/tree-edit.xhtml            |   301 -
 .../web-gui-examples/tree-thumbnail.xhtml       |   320 -
 .../web-resources/web-gui-examples/tree.xhtml   |   207 -
 .../main/resources/META-INF/documentation.nt    |    13 -
 platform/platform.style.classic/LICENSE         |   201 -
 platform/platform.style.classic/README.txt      |    17 -
 platform/platform.style.classic/pom.xml         |    96 -
 .../style/classic/ClassicStyleConfig.java       |    50 -
 .../clerezza/platform/style/classic/Style.java  |    82 -
 .../CLEREZZA-INF/web-resources/favicon.ico      |   Bin 3638 -> 0 bytes
 .../web-resources/style/autocomplete.css        |    68 -
 .../CLEREZZA-INF/web-resources/style/button.css |    79 -
 .../web-resources/style/clearfix.css            |    58 -
 .../web-resources/style/discobits.css           |    26 -
 .../CLEREZZA-INF/web-resources/style/edit.css   |   210 -
 .../CLEREZZA-INF/web-resources/style/filter.css |    64 -
 .../CLEREZZA-INF/web-resources/style/form.css   |   100 -
 .../web-resources/style/general.css             |   100 -
 .../CLEREZZA-INF/web-resources/style/header.css |   192 -
 .../CLEREZZA-INF/web-resources/style/icon.css   |   326 -
 .../style/images/bg/fade-black.png              |   Bin 452 -> 0 bytes
 .../style/images/bg/fade-filter.png             |   Bin 736 -> 0 bytes
 .../style/images/bg/fade-header-module.png      |   Bin 694 -> 0 bytes
 .../style/images/bg/fade-header-system.png      |   Bin 512 -> 0 bytes
 .../style/images/bg/fade-header.png             |   Bin 1056 -> 0 bytes
 .../style/images/bg/fade-header1.png            |   Bin 512 -> 0 bytes
 .../style/images/bg/fade-header2.png            |   Bin 694 -> 0 bytes
 .../style/images/bg/fade-input.png              |   Bin 165 -> 0 bytes
 .../style/images/bg/fade-login.png              |   Bin 6960 -> 0 bytes
 .../web-resources/style/images/bg/fade-menu.png |   Bin 241 -> 0 bytes
 .../style/images/bg/fade-panel-search.png       |   Bin 397 -> 0 bytes
 .../style/images/bg/fade-panel.png              |   Bin 425 -> 0 bytes
 .../style/images/bg/fade-tab-edit.png           |   Bin 672 -> 0 bytes
 .../style/images/bg/fade-tab-off.png            |   Bin 556 -> 0 bytes
 .../style/images/bg/fade-tab-on.png             |   Bin 169 -> 0 bytes
 .../style/images/bg/fade-tab-status.png         |   Bin 323 -> 0 bytes
 .../style/images/bg/fade-th-off.png             |   Bin 161 -> 0 bytes
 .../style/images/bg/fade-th-on.png              |   Bin 170 -> 0 bytes
 .../style/images/bg/fade-window.png             |   Bin 3840 -> 0 bytes
 .../web-resources/style/images/bg/tooltip.png   |   Bin 2076 -> 0 bytes
 .../style/images/icons/anim-loading.gif         |   Bin 4714 -> 0 bytes
 .../style/images/icons/arr-down-inverse.png     |   Bin 179 -> 0 bytes
 .../style/images/icons/arr-down.png             |   Bin 183 -> 0 bytes
 .../style/images/icons/arr-left-inverse.png     |   Bin 171 -> 0 bytes
 .../style/images/icons/arr-left.png             |   Bin 198 -> 0 bytes
 .../style/images/icons/arr-right-inverse.png    |   Bin 166 -> 0 bytes
 .../style/images/icons/arr-right.png            |   Bin 197 -> 0 bytes
 .../style/images/icons/arr-up-inverse.png       |   Bin 177 -> 0 bytes
 .../web-resources/style/images/icons/arr-up.png |   Bin 185 -> 0 bytes
 .../style/images/icons/btn-alert.png            |   Bin 811 -> 0 bytes
 .../style/images/icons/btn-back.png             |   Bin 607 -> 0 bytes
 .../style/images/icons/btn-close.png            |   Bin 668 -> 0 bytes
 .../style/images/icons/btn-delete.gif           |   Bin 612 -> 0 bytes
 .../style/images/icons/btn-drag.png             |   Bin 138 -> 0 bytes
 .../style/images/icons/btn-forward.png          |   Bin 559 -> 0 bytes
 .../images/icons/btn-langauge-switch-x.png      |   Bin 625 -> 0 bytes
 .../style/images/icons/btn-langauge-switch.png  |   Bin 725 -> 0 bytes
 .../style/images/icons/btn-list-off.png         |   Bin 183 -> 0 bytes
 .../style/images/icons/btn-list-on.png          |   Bin 281 -> 0 bytes
 .../style/images/icons/btn-modify-x.png         |   Bin 886 -> 0 bytes
 .../style/images/icons/btn-modify.png           |   Bin 890 -> 0 bytes
 .../style/images/icons/btn-ok-x.png             |   Bin 774 -> 0 bytes
 .../web-resources/style/images/icons/btn-ok.png |   Bin 832 -> 0 bytes
 .../style/images/icons/btn-person.png           |   Bin 599 -> 0 bytes
 .../style/images/icons/btn-plus-x.png           |   Bin 690 -> 0 bytes
 .../style/images/icons/btn-plus.png             |   Bin 721 -> 0 bytes
 .../style/images/icons/btn-remove-x.png         |   Bin 676 -> 0 bytes
 .../style/images/icons/btn-remove.png           |   Bin 746 -> 0 bytes
 .../style/images/icons/btn-resize.png           |   Bin 225 -> 0 bytes
 .../style/images/icons/btn-search-x.png         |   Bin 590 -> 0 bytes
 .../style/images/icons/btn-search.png           |   Bin 717 -> 0 bytes
 .../style/images/icons/btn-sitechooser.png      |   Bin 839 -> 0 bytes
 .../style/images/icons/btn-size1-off.png        |   Bin 426 -> 0 bytes
 .../style/images/icons/btn-size1-on.png         |   Bin 503 -> 0 bytes
 .../style/images/icons/btn-size2-off.png        |   Bin 440 -> 0 bytes
 .../style/images/icons/btn-size2-on.png         |   Bin 492 -> 0 bytes
 .../style/images/icons/btn-size3-off.png        |   Bin 311 -> 0 bytes
 .../style/images/icons/btn-size3-on.png         |   Bin 351 -> 0 bytes
 .../style/images/icons/btn-thumb-off.png        |   Bin 177 -> 0 bytes
 .../style/images/icons/btn-thumb-on.png         |   Bin 283 -> 0 bytes
 .../style/images/icons/btn-toggle-list-off.png  |   Bin 452 -> 0 bytes
 .../style/images/icons/btn-toggle-list-on.png   |   Bin 624 -> 0 bytes
 .../style/images/icons/btn-toggle-size1-off.png |   Bin 583 -> 0 bytes
 .../style/images/icons/btn-toggle-size1-on.png  |   Bin 764 -> 0 bytes
 .../style/images/icons/btn-toggle-size2-off.png |   Bin 554 -> 0 bytes
 .../style/images/icons/btn-toggle-size2-on.png  |   Bin 740 -> 0 bytes
 .../style/images/icons/btn-toggle-size3-off.png |   Bin 508 -> 0 bytes
 .../style/images/icons/btn-toggle-size3-on.png  |   Bin 681 -> 0 bytes
 .../images/icons/btn-toggle-thumbnail-off.png   |   Bin 440 -> 0 bytes
 .../images/icons/btn-toggle-thumbnail-on.png    |   Bin 630 -> 0 bytes
 .../style/images/icons/btn-toggle-tree-off.png  |   Bin 490 -> 0 bytes
 .../style/images/icons/btn-toggle-tree-on.png   |   Bin 675 -> 0 bytes
 .../style/images/icons/btn-user.png             |   Bin 747 -> 0 bytes
 .../style/images/icons/btn-zoomin.png           |   Bin 787 -> 0 bytes
 .../style/images/icons/btn-zoomout.png          |   Bin 764 -> 0 bytes
 .../style/images/icons/d-arr-left-inverse.png   |   Bin 495 -> 0 bytes
 .../style/images/icons/d-arr-right-inverse.png  |   Bin 495 -> 0 bytes
 .../style/images/icons/fade-create.png          |   Bin 393 -> 0 bytes
 .../style/images/icons/fade-generic-on.png      |   Bin 165 -> 0 bytes
 .../style/images/icons/fade-generic.png         |   Bin 258 -> 0 bytes
 .../style/images/icons/fade-generic2.png        |   Bin 280 -> 0 bytes
 .../style/images/icons/fade-modify.png          |   Bin 404 -> 0 bytes
 .../style/images/icons/fade-remove.png          |   Bin 346 -> 0 bytes
 .../style/images/icons/mediatype/any.png        |   Bin 4381 -> 0 bytes
 .../icons/mediatype/application/msword.png      |   Bin 37681 -> 0 bytes
 .../mediatype/application/octet-stream.png      |   Bin 4381 -> 0 bytes
 .../images/icons/mediatype/application/pdf.png  |   Bin 11999 -> 0 bytes
 .../mediatype/application/vnd.ms-excel.png      |   Bin 49350 -> 0 bytes
 .../mediatype/application/vnd.ms-powerpoint.png |   Bin 15153 -> 0 bytes
 .../icons/mediatype/application/x-amf.png       |   Bin 14553 -> 0 bytes
 .../icons/mediatype/application/x-tar.png       |   Bin 13655 -> 0 bytes
 .../style/images/icons/mediatype/audio/any.png  |   Bin 16747 -> 0 bytes
 .../style/images/icons/mediatype/text/plain.png |   Bin 11461 -> 0 bytes
 .../web-resources/style/images/logo-big.png     |   Bin 4984 -> 0 bytes
 .../web-resources/style/images/logo.png         |   Bin 2144 -> 0 bytes
 .../web-resources/style/images/panel/bg-tab.png |   Bin 191 -> 0 bytes
 .../style/images/panel/tab-button-default.png   |   Bin 342 -> 0 bytes
 .../CLEREZZA-INF/web-resources/style/list.css   |   147 -
 .../CLEREZZA-INF/web-resources/style/loader.css |    47 -
 .../CLEREZZA-INF/web-resources/style/menu.css   |   163 -
 .../CLEREZZA-INF/web-resources/style/pager.css  |   100 -
 .../CLEREZZA-INF/web-resources/style/panel.css  |   385 -
 .../web-resources/style/scripts/login.js        |    26 -
 .../web-resources/style/scripts/panel.js        |    59 -
 .../CLEREZZA-INF/web-resources/style/style.css  |    49 -
 .../CLEREZZA-INF/web-resources/style/table.css  |   225 -
 .../CLEREZZA-INF/web-resources/style/tabs.css   |   116 -
 .../web-resources/style/tooltip.css             |    41 -
 .../CLEREZZA-INF/web-resources/style/tree.css   |   335 -
 .../CLEREZZA-INF/web-resources/style/window.css |   191 -
 .../CLEREZZA-INF/web-resources/style/yui.css    |   197 -
 .../platform/style/classic/globalmenu-naked.ssp |    86 -
 .../style/classic/headed-page-template.ssp      |    80 -
 .../style/classic/rdf-list-template.ssp         |    28 -
 platform/platform.style.default/LICENSE         |   201 -
 platform/platform.style.default/nbactions.xml   |    11 -
 platform/platform.style.default/pom.xml         |   123 -
 .../web-resources/images/feather.png            |   Bin 16890 -> 0 bytes
 .../web-resources/images/footer-logo.png        |   Bin 6539 -> 0 bytes
 .../CLEREZZA-INF/web-resources/images/logo.png  |   Bin 5834 -> 0 bytes
 .../web-resources/images/sw-vert-w3c.png        |   Bin 5979 -> 0 bytes
 .../style/fonts/TitilliumText25L001.otf         |   Bin 52736 -> 0 bytes
 .../style/fonts/TitilliumText25L003.otf         |   Bin 52064 -> 0 bytes
 .../style/fonts/TitilliumTitle20.otf            |   Bin 41144 -> 0 bytes
 .../web-resources/style/images/bg-bar.png       |   Bin 199 -> 0 bytes
 .../web-resources/style/images/bg-divider.gif   |   Bin 63 -> 0 bytes
 .../web-resources/style/images/icn-note.jpg     |   Bin 1636 -> 0 bytes
 .../web-resources/style/images/logo-big.png     |   Bin 5834 -> 0 bytes
 .../CLEREZZA-INF/web-resources/style/style.css  |   459 -
 .../src/main/scala/Activator.scala              |    46 -
 .../src/main/scala/CollectionHeader.scala       |    38 -
 .../src/main/scala/GlobalMenuRenderlet.scala    |    95 -
 .../src/main/scala/HeadedPageRenderlet.scala    |   160 -
 .../src/main/scala/RdfListRenderlet.scala       |    53 -
 .../platform.typehandlerspace.jaxrs2/LICENSE    |   201 -
 .../nbactions.xml                               |    11 -
 .../platform.typehandlerspace.jaxrs2/pom.xml    |    56 -
 .../jaxrs/TypeHandlerSpace.java                 |   137 -
 platform/platform.typehandlerspace.wink/LICENSE |   201 -
 platform/platform.typehandlerspace.wink/pom.xml |    65 -
 .../typehandlerspace/wink/TypeHandlerSpace.java |   188 -
 platform/platform.typehandlerspace/LICENSE      |   201 -
 platform/platform.typehandlerspace/pom.xml      |    95 -
 .../platform/typehandlerspace/OPTIONS.java      |    33 -
 .../typehandlerspace/SupportedTypes.java        |    49 -
 .../typehandlerspace/TypeHandlerDiscovery.java  |    46 -
 .../impl/TypeHandlerDiscoveryImpl.java          |   109 -
 .../documentation/style/documentation.css       |    34 -
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../platform.typehandlerspace/src/site/site.xml |    30 -
 .../src/site/xsite/content/reference.xhtml      |    81 -
 .../src/site/xsite/content/sitemap.xml          |    28 -
 .../src/site/xsite/templates/skin.html          |    71 -
 .../typehandlerspace/GraphWriterDummy.java      |    65 -
 .../typehandlerspace/TypeHandlerSpaceTest.java  |   331 -
 platform/platform.typepriority/LICENSE          |   201 -
 platform/platform.typepriority/pom.xml          |   102 -
 .../platform/typepriority/TypePrioritizer.java  |   147 -
 .../documentation/style/documentation.css       |    34 -
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../platform.typepriority/src/site/site.xml     |    30 -
 .../src/site/xsite/content/reference.xhtml      |    81 -
 .../src/site/xsite/content/sitemap.xml          |    28 -
 .../src/site/xsite/templates/skin.html          |    71 -
 .../typepriority/TypePrioritizerTest.java       |    83 -
 platform/platform.typerendering.gui/LICENSE     |   201 -
 platform/platform.typerendering.gui/pom.xml     |   133 -
 .../web-resources/styles/renderlets/style.css   |    38 -
 .../src/main/scala/Activator.scala              |   126 -
 .../src/main/scala/Ontology.scala               |    39 -
 .../scala/RenderletDescriptionRenderlet.scala   |    59 -
 platform/platform.typerendering.scala/LICENSE   |   201 -
 .../platform.typerendering.scala/nbactions.xml  |    11 -
 platform/platform.typerendering.scala/pom.xml   |    86 -
 .../main/resources/META-INF/documentation.nt    |    25 -
 .../typerendering/scala/AbstractRenderlet.scala |    91 -
 .../typerendering/scala/PageRenderlet.scala     |    64 -
 .../typerendering/scala/RenderedPage.scala      |   176 -
 .../typerendering/scala/SRenderlet.scala        |    90 -
 .../typerendering/scala/XmlResult.scala         |   177 -
 .../LICENSE                                     |   201 -
 .../nbactions.xml                               |    11 -
 .../pom.xml                                     |    60 -
 .../ScalaServerPagesRenderlet.java              |   218 -
 .../ScalaServerPagesService.java                |    95 -
 .../scalaserverpages/SspTypeRenderlet.java      |   172 -
 .../main/resources/META-INF/documentation.nt    |   124 -
 .../scalaserverpages/implicit-header.txt        |    13 -
 .../scalaserverpages/typerenderlet-header.txt   |    16 -
 .../platform.typerendering.seedsnipe/LICENSE    |   201 -
 .../platform.typerendering.seedsnipe/pom.xml    |    69 -
 .../seedsnipe/SeedsnipeRenderlet.java           |    65 -
 .../seedsnipe/WebRenderingFunctions.java        |   333 -
 .../typerendering/seedsnipe/GenericTest.java    |    78 -
 .../seedsnipe/WebRenderingFunctionsTest.java    |   113 -
 .../typerendering/seedsnipe/data-1.turtle       |     8 -
 .../typerendering/seedsnipe/ifTest.seed         |     2 -
 .../typerendering/seedsnipe/ifTest.turtle       |     5 -
 .../platform/typerendering/seedsnipe/ifTest.txt |     2 -
 .../typerendering/seedsnipe/lexicalForm.seed    |     1 -
 .../typerendering/seedsnipe/lexicalForm.turtle  |     7 -
 .../typerendering/seedsnipe/lexicalForm.txt     |     1 -
 .../typerendering/seedsnipe/result-1.txt        |     1 -
 .../typerendering/seedsnipe/template-1.seed     |     1 -
 platform/platform.typerendering/LICENSE         |   201 -
 .../platform.typerendering.core/LICENSE         |   201 -
 .../platform.typerendering.core/pom.xml         |    91 -
 .../typerendering/CallbackRenderer.java         |    64 -
 .../typerendering/CallbackRendererImpl.java     |    85 -
 .../typerendering/GenericGraphNodeMBW.java      |   227 -
 .../platform/typerendering/Renderer.java        |    65 -
 .../platform/typerendering/RendererFactory.java |   224 -
 .../typerendering/RenderingException.java       |    69 -
 .../RenderingspecificationException.java        |   138 -
 .../platform/typerendering/Renderlet.java       |   131 -
 .../typerendering/RenderletManager.java         |    53 -
 .../typerendering/RenderletManagerImpl.java     |   328 -
 .../RenderletNotFoundException.java             |    31 -
 .../typerendering/RenderletRendererImpl.java    |    99 -
 .../typerendering/ResultDocModifier.java        |   282 -
 .../typerendering/TypeRenderingException.java   |    92 -
 .../TypeRenderingExceptionMapper.java           |    88 -
 .../platform/typerendering/TypeRenderlet.java   |   165 -
 .../TypeRenderletRendererImpl.java              |    84 -
 .../typerendering/UserContextProvider.java      |    48 -
 .../typerendering/WebRenderingService.java      |    34 -
 .../typerendering/utils/MediaTypeMap.java       |   142 -
 .../platform/typerendering/utils/RegexMap.java  |   170 -
 .../typerendering/exception-template.ssp        |    55 -
 .../typerendering/utils/RegexMapTest.java       |    37 -
 .../platform.typerendering.ontologies/LICENSE   |   201 -
 .../platform.typerendering.ontologies/pom.xml   |    67 -
 .../typerendering/ontologies/typerendering.rdf  |   106 -
 platform/platform.typerendering/pom.xml         |    41 -
 .../platform.usermanager.webinterface/LICENSE   |   201 -
 .../platform.usermanager.webinterface/pom.xml   |   146 -
 .../usermanager/webinterface/PasswordReset.java |   180 -
 .../PermissionManagerAccessPermission.java      |    66 -
 .../UserManagerAccessPermission.java            |    66 -
 .../webinterface/UserManagerWeb.java            |  1295 -
 .../webinterface/ontology/USERMANAGER.java      |   134 -
 .../webinterface/add-property-template.ssp      |   142 -
 .../webinterface/add-user-template.ssp          |   131 -
 .../webinterface/custom-property-template.ssp   |    87 -
 .../webinterface/custom-user-infos-template.ssp |    67 -
 .../webinterface/ontology/customfield.rdf       |    84 -
 .../webinterface/ontology/usermanager.rdf       |    94 -
 .../usermanager/webinterface/reset.xhtml        |    70 -
 .../usermanager/webinterface/reset_mail.txt     |    12 -
 .../webinterface/role-overview-template.ssp     |   111 -
 .../webinterface/role-permission-template.ssp   |   153 -
 .../webinterface/staticweb/add-role.xhtml       |    44 -
 .../staticweb/js/fancybox/fancy_closebox.png    |   Bin 1910 -> 0 bytes
 .../staticweb/js/fancybox/fancy_left.png        |   Bin 1623 -> 0 bytes
 .../staticweb/js/fancybox/fancy_progress.png    |   Bin 12412 -> 0 bytes
 .../staticweb/js/fancybox/fancy_right.png       |   Bin 1645 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_e.png    |   Bin 146 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_n.png    |   Bin 129 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_ne.png   |   Bin 245 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_nw.png   |   Bin 207 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_s.png    |   Bin 136 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_se.png   |   Bin 239 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_sw.png   |   Bin 221 -> 0 bytes
 .../staticweb/js/fancybox/fancy_shadow_w.png    |   Bin 140 -> 0 bytes
 .../staticweb/js/fancybox/fancy_title_left.png  |   Bin 556 -> 0 bytes
 .../staticweb/js/fancybox/fancy_title_main.png  |   Bin 149 -> 0 bytes
 .../staticweb/js/fancybox/fancy_title_right.png |   Bin 559 -> 0 bytes
 .../staticweb/js/fancybox/jquery.easing.1.3.js  |   226 -
 .../js/fancybox/jquery.fancybox-1.2.1.js        |   568 -
 .../js/fancybox/jquery.fancybox-1.2.1.pack.js   |    30 -
 .../staticweb/js/fancybox/jquery.fancybox.css   |   336 -
 .../webinterface/staticweb/js/reset.js          |    45 -
 .../staticweb/js/usermanager-custom-property.js |    77 -
 .../staticweb/js/usermanager-overview.js        |    93 -
 .../staticweb/js/usermanager-role-overview.js   |   102 -
 .../staticweb/js/usermanager-role-permission.js |    49 -
 .../staticweb/js/usermanager-user-permission.js |    49 -
 .../webinterface/staticweb/js/usermanager.js    |    40 -
 .../webinterface/update-user-template.ssp       |   141 -
 .../webinterface/user-overview-template.ssp     |   123 -
 .../webinterface/user-permission-template.ssp   |   179 -
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 .../src/site/site.xml                           |    32 -
 .../src/site/xsite/content/jaas.xhtml           |   109 -
 .../src/site/xsite/content/sitemap.xml          |    30 -
 .../src/site/xsite/content/usage-role.xhtml     |    52 -
 .../src/site/xsite/content/usage-user.xhtml     |    66 -
 .../src/site/xsite/templates/skin.html          |    71 -
 platform/platform.usermanager/LICENSE           |   201 -
 platform/platform.usermanager/pom.xml           |   102 -
 .../EmailAlreadyAssignedException.java          |    31 -
 .../usermanager/RoleUnavailableException.java   |    32 -
 .../usermanager/UserAlreadyExistsException.java |    30 -
 .../platform/usermanager/UserComparator.java    |    43 -
 .../usermanager/UserHasNoNameException.java     |    31 -
 .../platform/usermanager/UserManager.java       |   256 -
 .../platform/usermanager/UserManagerImpl.java   |   735 -
 .../usermanager/UserNotExistsException.java     |    31 -
 .../resources/documentation/style/style.css     |   421 -
 .../src/site/resources/images/clerezza.png      |   Bin 7113 -> 0 bytes
 platform/platform.usermanager/src/site/site.xml |    26 -
 .../src/site/xsite/content/sitemap.xml          |    28 -
 .../src/site/xsite/content/usage.xhtml          |    54 -
 .../src/site/xsite/templates/skin.html          |    71 -
 platform/platform.users/LICENSE                 |   201 -
 platform/platform.users/core/LICENSE            |   201 -
 platform/platform.users/core/pom.xml            |   128 -
 .../resources/OSGI-INF/serviceComponents.xml    |    45 -
 .../UserGraphAcessPermissionProvider.scala      |    39 -
 .../platform/users/WebIdGraphsService.scala     |   212 -
 .../clerezza/platform/users/WebIdInfo.scala     |    61 -
 platform/platform.users/ontologies/LICENSE      |   201 -
 platform/platform.users/ontologies/pom.xml      |    67 -
 platform/platform.users/pom.xml                 |    41 -
 platform/platform.xhtml2html/LICENSE            |   201 -
 platform/platform.xhtml2html/pom.xml            |    66 -
 .../platform/xhtml2html/AcceptHeader.java       |   180 -
 .../ContentLengthSettingOutputStream.java       |    86 -
 .../DocTypeFilteringOutputStream.java           |   140 -
 .../clerezza/platform/xhtml2html/MediaType.java |   100 -
 .../xhtml2html/MediaTypeComparator.java         |   169 -
 .../platform/xhtml2html/ResponseStatusInfo.java |    34 -
 .../SelfClosing2ClosingTagsOutputStream.java    |   183 -
 .../platform/xhtml2html/WrappedRequest.java     |    61 -
 .../platform/xhtml2html/WrappedResponse.java    |   160 -
 .../platform/xhtml2html/Xhtml2HtmlFilter.java   |   115 -
 .../DocTypeSettingByteChannelTest.java          |   185 -
 .../SelfClosing2ClosingTagsByteChannelTest.java |    82 -
 platform/pom.xml                                |    94 +-
 platform/scripting.scriptmanager/LICENSE        |   201 +
 platform/scripting.scriptmanager/pom.xml        |    99 +
 .../scripting/scriptmanager/ScriptManager.java  |   849 +
 .../ScriptManagerAppPermission.java             |    66 +
 .../scriptmanager/ontology/SCRIPTMANAGER.java   |    87 +
 .../main/resources/META-INF/documentation.nt    |   103 +
 .../scriptmanager/ontology/scriptmanager.rdf    |   150 +
 .../scriptmanager-execution-uri-list.xhtml      |    41 +
 .../scriptmanager-execution-uri-overview.ssp    |    50 +
 .../scriptmanager-script-information.xhtml      |    91 +
 .../scriptmanager-script-install.ssp            |    99 +
 .../scriptmanager-script-list.xhtml             |    31 +
 .../scriptmanager-script-overview.ssp           |    69 +
 .../staticweb/js/scriptmanager-execution-uri.js |    27 +
 .../staticweb/js/scriptmanager-overview.js      |    45 +
 .../scriptmanager/staticweb/js/scriptmanager.js |   170 +
 platform/scripting/LICENSE                      |   201 +
 platform/scripting/pom.xml                      |    75 +
 .../JRubyScriptEngineFactoryWrapper.java        |   100 +
 .../platform/scripting/NoEngineException.java   |    41 +
 .../scripting/ScriptEngineFactoryManager.java   |   183 +
 .../platform/scripting/ScriptExecution.java     |   315 +
 .../ScriptGeneratedResourceTypeHandler.java     |   128 +
 .../scripting/ScriptLanguageDescription.java    |    90 +
 platform/security.conditions/LICENSE            |   201 +
 platform/security.conditions/pom.xml            |    60 +
 .../conditions/NotBundleLocationCondition.java  |    47 +
 platform/security.foafssl/LICENSE               |   201 +
 platform/security.foafssl/core/LICENSE          |   201 +
 platform/security.foafssl/core/pom.xml          |   139 +
 .../resources/OSGI-INF/serviceComponents.xml    |    47 +
 .../foafssl/auth/FoafSslAuthentication.scala    |   127 +
 .../clerezza/foafssl/auth/WebIDClaim.scala      |   216 +
 .../clerezza/foafssl/auth/X509Claim.scala       |   279 +
 .../apache/clerezza/foafssl/ssl/Activator.scala |   108 +
 .../ssl/X509TrustManagerWrapperService.scala    |    70 +
 platform/security.foafssl/ontologies/LICENSE    |   201 +
 platform/security.foafssl/ontologies/pom.xml    |    67 +
 .../clerezza/foafssl/ontologies/atomowl.rdf     |   653 +
 .../apache/clerezza/foafssl/ontologies/cert.n3  |   187 +
 .../apache/clerezza/foafssl/ontologies/earl.rdf |   245 +
 .../apache/clerezza/foafssl/ontologies/rsa.rdf  |   114 +
 .../apache/clerezza/foafssl/ontologies/test.n3  |   205 +
 platform/security.foafssl/pom.xml               |    39 +
 platform/security.foafssl/test/LICENSE          |   201 +
 platform/security.foafssl/test/pom.xml          |   162 +
 .../main/resources/META-INF/documentation.nt    |     2 +
 .../resources/OSGI-INF/serviceComponents.xml    |    43 +
 .../clerezza/foafssl/test/WebIDTester.scala     |   757 +
 .../foafssl/test/pages/WebIDClaimPg.scala       |   240 +
 platform/shellcustomizer/LICENSE                |   201 +
 platform/shellcustomizer/pom.xml                |   112 +
 .../resources/OSGI-INF/serviceComponents.xml    |    33 +
 .../platform/shellcustomizer/PlatformDsl.scala  |    51 +
 .../PlatformShellCustomizer.scala               |    51 +
 platform/style.classic.webguiexamples/LICENSE   |   201 +
 platform/style.classic.webguiexamples/pom.xml   |    79 +
 .../web-resources/web-gui-examples/alert.xhtml  |    99 +
 .../web-gui-examples/buttons.xhtml              |   201 +
 .../web-resources/web-gui-examples/edit.xhtml   |   164 +
 .../web-resources/web-gui-examples/header.xhtml |   299 +
 .../web-gui-examples/overlay.xhtml              |   108 +
 .../web-gui-examples/panel-thumbnail.xhtml      |   351 +
 .../web-gui-examples/panel-tree.xhtml           |   324 +
 .../web-resources/web-gui-examples/panel.xhtml  |   235 +
 .../web-gui-examples/style/demo.css             |    64 +
 .../web-resources/web-gui-examples/table.xhtml  |   227 +
 .../web-gui-examples/temp/img/eye1.jpg          |   Bin 0 -> 4517 bytes
 .../web-gui-examples/temp/img/tiger1.jpg        |   Bin 0 -> 4860 bytes
 .../web-gui-examples/temp/img/tiger2.jpg        |   Bin 0 -> 6321 bytes
 .../web-gui-examples/thumbnail.xhtml            |   214 +
 .../web-gui-examples/tree-edit.xhtml            |   301 +
 .../web-gui-examples/tree-thumbnail.xhtml       |   320 +
 .../web-resources/web-gui-examples/tree.xhtml   |   207 +
 .../main/resources/META-INF/documentation.nt    |    13 +
 platform/style.classic/LICENSE                  |   201 +
 platform/style.classic/README.txt               |    17 +
 platform/style.classic/pom.xml                  |    96 +
 .../style/classic/ClassicStyleConfig.java       |    50 +
 .../clerezza/platform/style/classic/Style.java  |    82 +
 .../CLEREZZA-INF/web-resources/favicon.ico      |   Bin 0 -> 3638 bytes
 .../web-resources/style/autocomplete.css        |    68 +
 .../CLEREZZA-INF/web-resources/style/button.css |    79 +
 .../web-resources/style/clearfix.css            |    58 +
 .../web-resources/style/discobits.css           |    26 +
 .../CLEREZZA-INF/web-resources/style/edit.css   |   210 +
 .../CLEREZZA-INF/web-resources/style/filter.css |    64 +
 .../CLEREZZA-INF/web-resources/style/form.css   |   100 +
 .../web-resources/style/general.css             |   100 +
 .../CLEREZZA-INF/web-resources/style/header.css |   192 +
 .../CLEREZZA-INF/web-resources/style/icon.css   |   326 +
 .../style/images/bg/fade-black.png              |   Bin 0 -> 452 bytes
 .../style/images/bg/fade-filter.png             |   Bin 0 -> 736 bytes
 .../style/images/bg/fade-header-module.png      |   Bin 0 -> 694 bytes
 .../style/images/bg/fade-header-system.png      |   Bin 0 -> 512 bytes
 .../style/images/bg/fade-header.png             |   Bin 0 -> 1056 bytes
 .../style/images/bg/fade-header1.png            |   Bin 0 -> 512 bytes
 .../style/images/bg/fade-header2.png            |   Bin 0 -> 694 bytes
 .../style/images/bg/fade-input.png              |   Bin 0 -> 165 bytes
 .../style/images/bg/fade-login.png              |   Bin 0 -> 6960 bytes
 .../web-resources/style/images/bg/fade-menu.png |   Bin 0 -> 241 bytes
 .../style/images/bg/fade-panel-search.png       |   Bin 0 -> 397 bytes
 .../style/images/bg/fade-panel.png              |   Bin 0 -> 425 bytes
 .../style/images/bg/fade-tab-edit.png           |   Bin 0 -> 672 bytes
 .../style/images/bg/fade-tab-off.png            |   Bin 0 -> 556 bytes
 .../style/images/bg/fade-tab-on.png             |   Bin 0 -> 169 bytes
 .../style/images/bg/fade-tab-status.png         |   Bin 0 -> 323 bytes
 .../style/images/bg/fade-th-off.png             |   Bin 0 -> 161 bytes
 .../style/images/bg/fade-th-on.png              |   Bin 0 -> 170 bytes
 .../style/images/bg/fade-window.png             |   Bin 0 -> 3840 bytes
 .../web-resources/style/images/bg/tooltip.png   |   Bin 0 -> 2076 bytes
 .../style/images/icons/anim-loading.gif         |   Bin 0 -> 4714 bytes
 .../style/images/icons/arr-down-inverse.png     |   Bin 0 -> 179 bytes
 .../style/images/icons/arr-down.png             |   Bin 0 -> 183 bytes
 .../style/images/icons/arr-left-inverse.png     |   Bin 0 -> 171 bytes
 .../style/images/icons/arr-left.png             |   Bin 0 -> 198 bytes
 .../style/images/icons/arr-right-inverse.png    |   Bin 0 -> 166 bytes
 .../style/images/icons/arr-right.png            |   Bin 0 -> 197 bytes
 .../style/images/icons/arr-up-inverse.png       |   Bin 0 -> 177 bytes
 .../web-resources/style/images/icons/arr-up.png |   Bin 0 -> 185 bytes
 .../style/images/icons/btn-alert.png            |   Bin 0 -> 811 bytes
 .../style/images/icons/btn-back.png             |   Bin 0 -> 607 bytes
 .../style/images/icons/btn-close.png            |   Bin 0 -> 668 bytes
 .../style/images/icons/btn-delete.gif           |   Bin 0 -> 612 bytes
 .../style/images/icons/btn-drag.png             |   Bin 0 -> 138 bytes
 .../style/images/icons/btn-forward.png          |   Bin 0 -> 559 bytes
 .../images/icons/btn-langauge-switch-x.png      |   Bin 0 -> 625 bytes
 .../style/images/icons/btn-langauge-switch.png  |   Bin 0 -> 725 bytes
 .../style/images/icons/btn-list-off.png         |   Bin 0 -> 183 bytes
 .../style/images/icons/btn-list-on.png          |   Bin 0 -> 281 bytes
 .../style/images/icons/btn-modify-x.png         |   Bin 0 -> 886 bytes
 .../style/images/icons/btn-modify.png           |   Bin 0 -> 890 bytes
 .../style/images/icons/btn-ok-x.png             |   Bin 0 -> 774 bytes
 .../web-resources/style/images/icons/btn-ok.png |   Bin 0 -> 832 bytes
 .../style/images/icons/btn-person.png           |   Bin 0 -> 599 bytes
 .../style/images/icons/btn-plus-x.png           |   Bin 0 -> 690 bytes
 .../style/images/icons/btn-plus.png             |   Bin 0 -> 721 bytes
 .../style/images/icons/btn-remove-x.png         |   Bin 0 -> 676 bytes
 .../style/images/icons/btn-remove.png           |   Bin 0 -> 746 bytes
 .../style/images/icons/btn-resize.png           |   Bin 0 -> 225 bytes
 .../style/images/icons/btn-search-x.png         |   Bin 0 -> 590 bytes
 .../style/images/icons/btn-search.png           |   Bin 0 -> 717 bytes
 .../style/images/icons/btn-sitechooser.png      |   Bin 0 -> 839 bytes
 .../style/images/icons/btn-size1-off.png        |   Bin 0 -> 426 bytes
 .../style/images/icons/btn-size1-on.png         |   Bin 0 -> 503 bytes
 .../style/images/icons/btn-size2-off.png        |   Bin 0 -> 440 bytes
 .../style/images/icons/btn-size2-on.png         |   Bin 0 -> 492 bytes
 .../style/images/icons/btn-size3-off.png        |   Bin 0 -> 311 bytes
 .../style/images/icons/btn-size3-on.png         |   Bin 0 -> 351 bytes
 .../style/images/icons/btn-thumb-off.png        |   Bin 0 -> 177 bytes
 .../style/images/icons/btn-thumb-on.png         |   Bin 0 -> 283 bytes
 .../style/images/icons/btn-toggle-list-off.png  |   Bin 0 -> 452 bytes
 .../style/images/icons/btn-toggle-list-on.png   |   Bin 0 -> 624 bytes
 .../style/images/icons/btn-toggle-size1-off.png |   Bin 0 -> 583 bytes
 .../style/images/icons/btn-toggle-size1-on.png  |   Bin 0 -> 764 bytes
 .../style/images/icons/btn-toggle-size2-off.png |   Bin 0 -> 554 bytes
 .../style/images/icons/btn-toggle-size2-on.png  |   Bin 0 -> 740 bytes
 .../style/images/icons/btn-toggle-size3-off.png |   Bin 0 -> 508 bytes
 .../style/images/icons/btn-toggle-size3-on.png  |   Bin 0 -> 681 bytes
 .../images/icons/btn-toggle-thumbnail-off.png   |   Bin 0 -> 440 bytes
 .../images/icons/btn-toggle-thumbnail-on.png    |   Bin 0 -> 630 bytes
 .../style/images/icons/btn-toggle-tree-off.png  |   Bin 0 -> 490 bytes
 .../style/images/icons/btn-toggle-tree-on.png   |   Bin 0 -> 675 bytes
 .../style/images/icons/btn-user.png             |   Bin 0 -> 747 bytes
 .../style/images/icons/btn-zoomin.png           |   Bin 0 -> 787 bytes
 .../style/images/icons/btn-zoomout.png          |   Bin 0 -> 764 bytes
 .../style/images/icons/d-arr-left-inverse.png   |   Bin 0 -> 495 bytes
 .../style/images/icons/d-arr-right-inverse.png  |   Bin 0 -> 495 bytes
 .../style/images/icons/fade-create.png          |   Bin 0 -> 393 bytes
 .../style/images/icons/fade-generic-on.png      |   Bin 0 -> 165 bytes
 .../style/images/icons/fade-generic.png         |   Bin 0 -> 258 bytes
 .../style/images/icons/fade-generic2.png        |   Bin 0 -> 280 bytes
 .../style/images/icons/fade-modify.png          |   Bin 0 -> 404 bytes
 .../style/images/icons/fade-remove.png          |   Bin 0 -> 346 bytes
 .../style/images/icons/mediatype/any.png        |   Bin 0 -> 4381 bytes
 .../icons/mediatype/application/msword.png      |   Bin 0 -> 37681 bytes
 .../mediatype/application/octet-stream.png      |   Bin 0 -> 4381 bytes
 .../images/icons/mediatype/application/pdf.png  |   Bin 0 -> 11999 bytes
 .../mediatype/application/vnd.ms-excel.png      |   Bin 0 -> 49350 bytes
 .../mediatype/application/vnd.ms-powerpoint.png |   Bin 0 -> 15153 bytes
 .../icons/mediatype/application/x-amf.png       |   Bin 0 -> 14553 bytes
 .../icons/mediatype/application/x-tar.png       |   Bin 0 -> 13655 bytes
 .../style/images/icons/mediatype/audio/any.png  |   Bin 0 -> 16747 bytes
 .../style/images/icons/mediatype/text/plain.png |   Bin 0 -> 11461 bytes
 .../web-resources/style/images/logo-big.png     |   Bin 0 -> 4984 bytes
 .../web-resources/style/images/logo.png         |   Bin 0 -> 2144 bytes
 .../web-resources/style/images/panel/bg-tab.png |   Bin 0 -> 191 bytes
 .../style/images/panel/tab-button-default.png   |   Bin 0 -> 342 bytes
 .../CLEREZZA-INF/web-resources/style/list.css   |   147 +
 .../CLEREZZA-INF/web-resources/style/loader.css |    47 +
 .../CLEREZZA-INF/web-resources/style/menu.css   |   163 +
 .../CLEREZZA-INF/web-resources/style/pager.css  |   100 +
 .../CLEREZZA-INF/web-resources/style/panel.css  |   385 +
 .../web-resources/style/scripts/login.js        |    26 +
 .../web-resources/style/scripts/panel.js        |    59 +
 .../CLEREZZA-INF/web-resources/style/style.css  |    49 +
 .../CLEREZZA-INF/web-resources/style/table.css  |   225 +
 .../CLEREZZA-INF/web-resources/style/tabs.css   |   116 +
 .../web-resources/style/tooltip.css             |    41 +
 .../CLEREZZA-INF/web-resources/style/tree.css   |   335 +
 .../CLEREZZA-INF/web-resources/style/window.css |   191 +
 .../CLEREZZA-INF/web-resources/style/yui.css    |   197 +
 .../platform/style/classic/globalmenu-naked.ssp |    86 +
 .../style/classic/headed-page-template.ssp      |    80 +
 .../style/classic/rdf-list-template.ssp         |    28 +
 platform/style.default/LICENSE                  |   201 +
 platform/style.default/nbactions.xml            |    11 +
 platform/style.default/pom.xml                  |   123 +
 .../web-resources/images/feather.png            |   Bin 0 -> 16890 bytes
 .../web-resources/images/footer-logo.png        |   Bin 0 -> 6539 bytes
 .../CLEREZZA-INF/web-resources/images/logo.png  |   Bin 0 -> 5834 bytes
 .../web-resources/images/sw-vert-w3c.png        |   Bin 0 -> 5979 bytes
 .../style/fonts/TitilliumText25L001.otf         |   Bin 0 -> 52736 bytes
 .../style/fonts/TitilliumText25L003.otf         |   Bin 0 -> 52064 bytes
 .../style/fonts/TitilliumTitle20.otf            |   Bin 0 -> 41144 bytes
 .../web-resources/style/images/bg-bar.png       |   Bin 0 -> 199 bytes
 .../web-resources/style/images/bg-divider.gif   |   Bin 0 -> 63 bytes
 .../web-resources/style/images/icn-note.jpg     |   Bin 0 -> 1636 bytes
 .../web-resources/style/images/logo-big.png     |   Bin 0 -> 5834 bytes
 .../CLEREZZA-INF/web-resources/style/style.css  |   459 +
 .../src/main/scala/Activator.scala              |    46 +
 .../src/main/scala/CollectionHeader.scala       |    38 +
 .../src/main/scala/GlobalMenuRenderlet.scala    |    95 +
 .../src/main/scala/HeadedPageRenderlet.scala    |   160 +
 .../src/main/scala/RdfListRenderlet.scala       |    53 +
 platform/typehandlerspace.jaxrs2/LICENSE        |   201 +
 platform/typehandlerspace.jaxrs2/nbactions.xml  |    11 +
 platform/typehandlerspace.jaxrs2/pom.xml        |    56 +
 .../jaxrs/TypeHandlerSpace.java                 |   137 +
 platform/typehandlerspace.wink/LICENSE          |   201 +
 platform/typehandlerspace.wink/pom.xml          |    65 +
 .../typehandlerspace/wink/TypeHandlerSpace.java |   188 +
 platform/typehandlerspace/LICENSE               |   201 +
 platform/typehandlerspace/pom.xml               |    95 +
 .../platform/typehandlerspace/OPTIONS.java      |    33 +
 .../typehandlerspace/SupportedTypes.java        |    49 +
 .../typehandlerspace/TypeHandlerDiscovery.java  |    46 +
 .../impl/TypeHandlerDiscoveryImpl.java          |   109 +
 .../documentation/style/documentation.css       |    34 +
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/typehandlerspace/src/site/site.xml     |    30 +
 .../src/site/xsite/content/reference.xhtml      |    81 +
 .../src/site/xsite/content/sitemap.xml          |    28 +
 .../src/site/xsite/templates/skin.html          |    71 +
 .../typehandlerspace/GraphWriterDummy.java      |    65 +
 .../typehandlerspace/TypeHandlerSpaceTest.java  |   331 +
 platform/typepriority/LICENSE                   |   201 +
 platform/typepriority/pom.xml                   |   102 +
 .../platform/typepriority/TypePrioritizer.java  |   147 +
 .../documentation/style/documentation.css       |    34 +
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/typepriority/src/site/site.xml         |    30 +
 .../src/site/xsite/content/reference.xhtml      |    81 +
 .../src/site/xsite/content/sitemap.xml          |    28 +
 .../src/site/xsite/templates/skin.html          |    71 +
 .../typepriority/TypePrioritizerTest.java       |    83 +
 platform/typerendering.gui/LICENSE              |   201 +
 platform/typerendering.gui/pom.xml              |   133 +
 .../web-resources/styles/renderlets/style.css   |    38 +
 .../src/main/scala/Activator.scala              |   126 +
 .../src/main/scala/Ontology.scala               |    39 +
 .../scala/RenderletDescriptionRenderlet.scala   |    59 +
 platform/typerendering.scala/LICENSE            |   201 +
 platform/typerendering.scala/nbactions.xml      |    11 +
 platform/typerendering.scala/pom.xml            |    86 +
 .../main/resources/META-INF/documentation.nt    |    25 +
 .../typerendering/scala/AbstractRenderlet.scala |    91 +
 .../typerendering/scala/PageRenderlet.scala     |    64 +
 .../typerendering/scala/RenderedPage.scala      |   176 +
 .../typerendering/scala/SRenderlet.scala        |    90 +
 .../typerendering/scala/XmlResult.scala         |   177 +
 platform/typerendering.scalaserverpages/LICENSE |   201 +
 .../nbactions.xml                               |    11 +
 platform/typerendering.scalaserverpages/pom.xml |    60 +
 .../ScalaServerPagesRenderlet.java              |   218 +
 .../ScalaServerPagesService.java                |    95 +
 .../scalaserverpages/SspTypeRenderlet.java      |   172 +
 .../main/resources/META-INF/documentation.nt    |   124 +
 .../scalaserverpages/implicit-header.txt        |    13 +
 .../scalaserverpages/typerenderlet-header.txt   |    16 +
 platform/typerendering.seedsnipe/LICENSE        |   201 +
 platform/typerendering.seedsnipe/pom.xml        |    69 +
 .../seedsnipe/SeedsnipeRenderlet.java           |    65 +
 .../seedsnipe/WebRenderingFunctions.java        |   333 +
 .../typerendering/seedsnipe/GenericTest.java    |    78 +
 .../seedsnipe/WebRenderingFunctionsTest.java    |   113 +
 .../typerendering/seedsnipe/data-1.turtle       |     8 +
 .../typerendering/seedsnipe/ifTest.seed         |     2 +
 .../typerendering/seedsnipe/ifTest.turtle       |     5 +
 .../platform/typerendering/seedsnipe/ifTest.txt |     2 +
 .../typerendering/seedsnipe/lexicalForm.seed    |     1 +
 .../typerendering/seedsnipe/lexicalForm.turtle  |     7 +
 .../typerendering/seedsnipe/lexicalForm.txt     |     1 +
 .../typerendering/seedsnipe/result-1.txt        |     1 +
 .../typerendering/seedsnipe/template-1.seed     |     1 +
 platform/typerendering/LICENSE                  |   201 +
 .../platform.typerendering.core/LICENSE         |   201 +
 .../platform.typerendering.core/pom.xml         |    91 +
 .../typerendering/CallbackRenderer.java         |    64 +
 .../typerendering/CallbackRendererImpl.java     |    85 +
 .../typerendering/GenericGraphNodeMBW.java      |   227 +
 .../platform/typerendering/Renderer.java        |    65 +
 .../platform/typerendering/RendererFactory.java |   224 +
 .../typerendering/RenderingException.java       |    69 +
 .../RenderingspecificationException.java        |   138 +
 .../platform/typerendering/Renderlet.java       |   131 +
 .../typerendering/RenderletManager.java         |    53 +
 .../typerendering/RenderletManagerImpl.java     |   328 +
 .../RenderletNotFoundException.java             |    31 +
 .../typerendering/RenderletRendererImpl.java    |    99 +
 .../typerendering/ResultDocModifier.java        |   282 +
 .../typerendering/TypeRenderingException.java   |    92 +
 .../TypeRenderingExceptionMapper.java           |    88 +
 .../platform/typerendering/TypeRenderlet.java   |   165 +
 .../TypeRenderletRendererImpl.java              |    84 +
 .../typerendering/UserContextProvider.java      |    48 +
 .../typerendering/WebRenderingService.java      |    34 +
 .../typerendering/utils/MediaTypeMap.java       |   142 +
 .../platform/typerendering/utils/RegexMap.java  |   170 +
 .../typerendering/exception-template.ssp        |    55 +
 .../typerendering/utils/RegexMapTest.java       |    37 +
 .../platform.typerendering.ontologies/LICENSE   |   201 +
 .../platform.typerendering.ontologies/pom.xml   |    67 +
 .../typerendering/ontologies/typerendering.rdf  |   106 +
 platform/typerendering/pom.xml                  |    41 +
 platform/usermanager.webinterface/LICENSE       |   201 +
 platform/usermanager.webinterface/pom.xml       |   146 +
 .../usermanager/webinterface/PasswordReset.java |   180 +
 .../PermissionManagerAccessPermission.java      |    66 +
 .../UserManagerAccessPermission.java            |    66 +
 .../webinterface/UserManagerWeb.java            |  1295 +
 .../webinterface/ontology/USERMANAGER.java      |   134 +
 .../webinterface/add-property-template.ssp      |   142 +
 .../webinterface/add-user-template.ssp          |   131 +
 .../webinterface/custom-property-template.ssp   |    87 +
 .../webinterface/custom-user-infos-template.ssp |    67 +
 .../webinterface/ontology/customfield.rdf       |    84 +
 .../webinterface/ontology/usermanager.rdf       |    94 +
 .../usermanager/webinterface/reset.xhtml        |    70 +
 .../usermanager/webinterface/reset_mail.txt     |    12 +
 .../webinterface/role-overview-template.ssp     |   111 +
 .../webinterface/role-permission-template.ssp   |   153 +
 .../webinterface/staticweb/add-role.xhtml       |    44 +
 .../staticweb/js/fancybox/fancy_closebox.png    |   Bin 0 -> 1910 bytes
 .../staticweb/js/fancybox/fancy_left.png        |   Bin 0 -> 1623 bytes
 .../staticweb/js/fancybox/fancy_progress.png    |   Bin 0 -> 12412 bytes
 .../staticweb/js/fancybox/fancy_right.png       |   Bin 0 -> 1645 bytes
 .../staticweb/js/fancybox/fancy_shadow_e.png    |   Bin 0 -> 146 bytes
 .../staticweb/js/fancybox/fancy_shadow_n.png    |   Bin 0 -> 129 bytes
 .../staticweb/js/fancybox/fancy_shadow_ne.png   |   Bin 0 -> 245 bytes
 .../staticweb/js/fancybox/fancy_shadow_nw.png   |   Bin 0 -> 207 bytes
 .../staticweb/js/fancybox/fancy_shadow_s.png    |   Bin 0 -> 136 bytes
 .../staticweb/js/fancybox/fancy_shadow_se.png   |   Bin 0 -> 239 bytes
 .../staticweb/js/fancybox/fancy_shadow_sw.png   |   Bin 0 -> 221 bytes
 .../staticweb/js/fancybox/fancy_shadow_w.png    |   Bin 0 -> 140 bytes
 .../staticweb/js/fancybox/fancy_title_left.png  |   Bin 0 -> 556 bytes
 .../staticweb/js/fancybox/fancy_title_main.png  |   Bin 0 -> 149 bytes
 .../staticweb/js/fancybox/fancy_title_right.png |   Bin 0 -> 559 bytes
 .../staticweb/js/fancybox/jquery.easing.1.3.js  |   226 +
 .../js/fancybox/jquery.fancybox-1.2.1.js        |   568 +
 .../js/fancybox/jquery.fancybox-1.2.1.pack.js   |    30 +
 .../staticweb/js/fancybox/jquery.fancybox.css   |   336 +
 .../webinterface/staticweb/js/reset.js          |    45 +
 .../staticweb/js/usermanager-custom-property.js |    77 +
 .../staticweb/js/usermanager-overview.js        |    93 +
 .../staticweb/js/usermanager-role-overview.js   |   102 +
 .../staticweb/js/usermanager-role-permission.js |    49 +
 .../staticweb/js/usermanager-user-permission.js |    49 +
 .../webinterface/staticweb/js/usermanager.js    |    40 +
 .../webinterface/update-user-template.ssp       |   141 +
 .../webinterface/user-overview-template.ssp     |   123 +
 .../webinterface/user-permission-template.ssp   |   179 +
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 .../usermanager.webinterface/src/site/site.xml  |    32 +
 .../src/site/xsite/content/jaas.xhtml           |   109 +
 .../src/site/xsite/content/sitemap.xml          |    30 +
 .../src/site/xsite/content/usage-role.xhtml     |    52 +
 .../src/site/xsite/content/usage-user.xhtml     |    66 +
 .../src/site/xsite/templates/skin.html          |    71 +
 platform/usermanager/LICENSE                    |   201 +
 platform/usermanager/pom.xml                    |   102 +
 .../EmailAlreadyAssignedException.java          |    31 +
 .../usermanager/RoleUnavailableException.java   |    32 +
 .../usermanager/UserAlreadyExistsException.java |    30 +
 .../platform/usermanager/UserComparator.java    |    43 +
 .../usermanager/UserHasNoNameException.java     |    31 +
 .../platform/usermanager/UserManager.java       |   256 +
 .../platform/usermanager/UserManagerImpl.java   |   735 +
 .../usermanager/UserNotExistsException.java     |    31 +
 .../resources/documentation/style/style.css     |   421 +
 .../src/site/resources/images/clerezza.png      |   Bin 0 -> 7113 bytes
 platform/usermanager/src/site/site.xml          |    26 +
 .../src/site/xsite/content/sitemap.xml          |    28 +
 .../src/site/xsite/content/usage.xhtml          |    54 +
 .../src/site/xsite/templates/skin.html          |    71 +
 platform/users/LICENSE                          |   201 +
 platform/users/core/LICENSE                     |   201 +
 platform/users/core/pom.xml                     |   128 +
 .../resources/OSGI-INF/serviceComponents.xml    |    45 +
 .../UserGraphAcessPermissionProvider.scala      |    39 +
 .../platform/users/WebIdGraphsService.scala     |   212 +
 .../clerezza/platform/users/WebIdInfo.scala     |    61 +
 platform/users/ontologies/LICENSE               |   201 +
 platform/users/ontologies/pom.xml               |    67 +
 platform/users/pom.xml                          |    41 +
 platform/xhtml2html/LICENSE                     |   201 +
 platform/xhtml2html/pom.xml                     |    66 +
 .../platform/xhtml2html/AcceptHeader.java       |   180 +
 .../ContentLengthSettingOutputStream.java       |    86 +
 .../DocTypeFilteringOutputStream.java           |   140 +
 .../clerezza/platform/xhtml2html/MediaType.java |   100 +
 .../xhtml2html/MediaTypeComparator.java         |   169 +
 .../platform/xhtml2html/ResponseStatusInfo.java |    34 +
 .../SelfClosing2ClosingTagsOutputStream.java    |   183 +
 .../platform/xhtml2html/WrappedRequest.java     |    61 +
 .../platform/xhtml2html/WrappedResponse.java    |   160 +
 .../platform/xhtml2html/Xhtml2HtmlFilter.java   |   115 +
 .../DocTypeSettingByteChannelTest.java          |   185 +
 .../SelfClosing2ClosingTagsByteChannelTest.java |    82 +
 1713 files changed, 152291 insertions(+), 152291 deletions(-)
----------------------------------------------------------------------



[22/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/underscore-min.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/underscore-min.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/underscore-min.js
new file mode 100644
index 0000000..4db9729
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/underscore-min.js
@@ -0,0 +1,7 @@
+//     Underscore.js 1.5.0
+//     http://underscorejs.org
+//     (c) 2009-2011 Jeremy Ashkenas, DocumentCloud Inc.
+//     (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Underscore may be freely distributed under the MIT license.
+!function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,v=e.reduce,h=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,w=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.0";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(j.has(n,a)&&t.call(e,n[a],a,n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,
 e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduce===v)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduceRight===h)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,fu
 nction(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.va
 lue},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e};var F=function(n){return j.isFunction(n)?n:function(t){return t[n]}};j.sortBy=function(n,t,r){var e=F(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index<t.index?-1:1}),"value")};var k=function(n,t,r,e){var u={},i=F(null==t?j.identity:t);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};j.groupBy=function(n,t,r){return k(n,t,r,function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)})},j.countBy=function(n,t,r){return k(n,t,r,function(n,t){j.has(
 n,t)||(n[t]=0),n[t]++})},j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:F(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var R=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return R(n,t,[])},j.without=function(n){return j.differen
 ce(n,o.call(arguments,1))},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){return j.unzip.apply(j,o.call(arguments))},j.unzip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e
 ]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var M=function(){};j.bind=function(n,t){var r,e;if(w&&n.bind===w)return w.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));M.prototype=n.prototype;var u=new M;M.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){
 var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u=null;return function(){var i=this,a=arguments,o=function(){u=null,r||(e=n.apply(i,a))},c=r&&!u;return clearTimeout(u),u=setTimeout(o,t),c&&(e=n.apply(i,a)),e}},j.once=function(n)
 {var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){var t=[];for(var r in n)j.has(n,r)&&t.push(n[r]);return t},j.pairs=function(n){var t=[];for(var r in n)j.has(n,r)&&t.push([r,n[r]]);return t},j.invert=function(n){var t={};for(var r in n)j.has(n,r)&&(t[n[r]]=r);return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){va
 r t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(
 r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=
 typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){retu
 rn I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(z,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),
 i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var D=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this);
+//# sourceMappingURL=underscore-min.map
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/etch.css
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/etch.css b/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/etch.css
new file mode 100644
index 0000000..cd820ba
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/etch.css
@@ -0,0 +1,43 @@
+body {
+    padding-top: 3cm;
+}
+
+/* === Editor === */
+.etch-editor-panel { display: none; padding: 5px; position: absolute; z-index: 10000;
+    background: #dadada; border: 1px solid #bdbdbd; color: #535353; text-shadow: 0 1px 0 #fff;
+    background-image: -moz-linear-gradient(center bottom, #ccc 0%, #ddd 100%);
+    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddd), to(#ccc));
+    -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;
+    -webkit-box-shadow: inset 1px 0 0 #dfdfdf, inset 0 1px 0 #dfdfdf, inset -1px 0 0 #dfdfdf, inset 0 -1px 0 #dfdfdf, 0 0 5px rgba(0,0,0,.3);
+ }
+.etch-editor-button { display: block; float: left; margin-right: 3px; position: relative; text-decoration: none;
+    display: block; width: 27px; height: 27px; background: #dadada; border: 1px solid #aaa; color: #535353; text-shadow: 0 1px 0 #fff;
+    background: -moz-linear-gradient(center bottom, #e1e1e1 0%, #efefef 100%);
+    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fFfFfF), to(#f1f1f1));
+    -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;
+     }
+
+.etch-editor-button:last-child { margin-right: 0; }
+.etch-editor-button:hover { background: #fff; border-color: #999; }
+.etch-editor-button span:active { box-shadow: inset 0 0 15px rgba(0,0,0,.5); border-color: #999; }
+
+.etch-editor-button span,
+.etch-editor-button span { background: url('images/editor_icons.png') no-repeat;
+    display: block; height: 100%; width: 100%;
+}
+
+.etch-editor-panel .etch-bold span { background-position: 0 0; }
+.etch-editor-panel .etch-italic span { background-position: -30px 0; }
+.etch-editor-panel .etch-underline span { background-position: -60px 0; }
+.etch-editor-panel .etch-unordered-list span { background-position: -90px 0; }
+.etch-editor-panel .etch-ordered-list span { background-position: -120px 0; }
+.etch-editor-panel .etch-image span { background-position: -150px 0; }
+.etch-editor-panel .etch-link span { background-position: -180px 0; }
+.etch-editor-panel .etch-save span { background-position: -210px 0; }
+.etch-editor-panel .etch-justify-left span { background-position: -240px 0; }
+.etch-editor-panel .etch-justify-center span { background-position: -270px 0; }
+.etch-editor-panel .etch-justify-right span { background-position: -300px 0; }
+.etch-editor-panel .etch-cite span { background-position: -330px 0; }
+.etch-editor-panel .etch-heading span { background-position: -360px 0; }
+.etch-editor-panel .etch-clear-formatting span { background-position: -390px 0; }
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/images/editor_icons.png
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/images/editor_icons.png b/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/images/editor_icons.png
new file mode 100644
index 0000000..f94f5a6
Binary files /dev/null and b/platform/editor/src/main/resources/META-INF/resources/tools/editor/styles/images/editor_icons.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/Manager.scala
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/Manager.scala b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/Manager.scala
new file mode 100644
index 0000000..e8e6665
--- /dev/null
+++ b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/Manager.scala
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2013 The Apache Software Foundation.
+ *
+ * Licensed 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.editor
+
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
+import org.apache.clerezza.rdf.core.Graph
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+
+@Component
+@Service(Array(classOf[Object]))
+@Property(name="javax.ws.rs", boolValue=Array(true))
+@Path("/tools/editor/create")
+class Manager {
+  
+  @Reference
+  var cgp: ContentGraphProvider = null;
+  
+  @GET
+  def sayHello = "Size of content graph: "+cgp.getContentGraph.size
+  
+  @PUT
+  def putData(graph: Graph) = {
+    //TODO implement
+    graph
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/DiscobitsContentEtch.scala
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/DiscobitsContentEtch.scala b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/DiscobitsContentEtch.scala
new file mode 100644
index 0000000..36c5d15
--- /dev/null
+++ b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/DiscobitsContentEtch.scala
@@ -0,0 +1,277 @@
+package org.apache.clerezza.platform.editor
+
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import javax.ws.rs.core.MediaType
+import org.apache.clerezza.platform.typerendering.TypeRenderlet
+import org.apache.clerezza.platform.typerendering.scala._
+import org.apache.clerezza.rdf.ontologies.DISCOBITS
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;import scala.xml.Unparsed
+import scala.xml._
+import scala.xml.transform._
+
+
+
+abstract class DiscobitsContentEtch extends SRenderlet {
+    
+  override val getMediaType = MediaType.TEXT_HTML_TYPE
+
+  override def getModePattern = "edit"
+
+  override def renderedPage(arguments: XmlResult.Arguments) = {
+    new XmlResult(arguments) {
+      override def content = {
+        val initScript = """
+            var discoBitsCollection = new Backbone.Collection();
+            $(function() {
+                
+                GreenRdfStore.getGraph(document, function(origGraph) {
+                    //now that we have the orig graph we no longer need the content atr
+                    $("span[property='disco:infoBit']").removeAttr("content");
+                    var InfoBit = Backbone.Model.extend({
+                        defaults: {
+                            "@type": 'disco:XHTMLInfoDiscoBit',
+                            "disco:infoBit": 'Some content'
+                        },
+                        initialize: function() {
+                            console.log('This model has been initialized.');
+                            var m = this;
+                            this.on('change', function(msg) {
+                                console.log('A value for this model has changed: ');
+                                console.log(m.changed);
+                                console.log(m.get("@id"));
+                                console.log('A value for this model has changed: '+m.hasChanged(null));
+                                m.foo = "bar"
+                            });
+                        }
+                    });
+                    function saveAllModified() {
+                        GreenRdfStore.getGraph(document, function(newGraph) {
+                            //alert("orig: "+origGraph.toNT());
+                            //alert("new: "+ newGraph.toNT());
+                            $.post( "/tools/editor/post", { assert: newGraph.toNT(), revoke: origGraph.toNT(), rdfFormat: 'text/turtle' }, function( data ) {
+                                alert("saved");
+                                origTurtle = newTurtle;
+                              }) .fail(function( data) {
+                                errdata = data
+                                alert( "error: " + data.statusText);
+                              });
+                        });
+
+                    }
+                    var InfoBitView = Backbone.View.extend({
+                        initialize: function() {
+                            _.bindAll(this, 'save')
+                            this.model.bind('save', this.save);
+                            var infoBit = $(this.el).find('[property="disco:infoBit"]').html()
+                            console.log(this.model.hasChanged(null))
+                            //this.model.set("disco:infoBit", infoBit)
+                            console.log(this.model.hasChanged(null))
+                            this.stickit();
+                        },
+                        events: {
+                            'mousedown .editable': 'editableClick'
+                        },
+                        bindings: {
+                            '[property="disco:infoBit"]': 'disco:infoBit'
+                        },
+                        editableClick: etch.editableInit,
+                        save: function() {
+
+                            // normally you would call model.save() here but this is a demo
+                            // $(this.el).find('.editable').effect('highlight', {color: 'yellow'});
+                            // $('.save-event').fadeIn('fast', function() {
+                            //     setTimeout($(this).fadeOut('slow'), 10000);
+                            // });
+                            console.log("this modified: ");
+                            console.log(this.model.get("@id"));
+                            console.log(this.model.changed);
+                            console.log("this is modified: "+this.model.hasChanged(null));
+                            saveAllModified();
+                        }
+
+                    });
+                    //$article = $('[property="disco:infoBit"]');
+                    $('[property="disco:infoBit"]').addClass("editable")
+                    $('[property="disco:infoBit"]').attr("data-button-class", "all")
+                    //this ensure two way binding with stickit
+                    $('[property="disco:infoBit"]').attr("contenteditable", "true")
+                    $article = $('[typeof="disco:XHTMLInfoDiscoBit"]');
+                    _.forEach($article, function(art) {
+                        console.log(art);
+                        var infoBit = $(art).find('[property="disco:infoBit"]').html()
+                        var about = $(art).attr('about')
+                        var model = new InfoBit({
+                            "@id": about,
+                            "disco:infoBit": infoBit
+                        });
+                        new InfoBitView({model: model, el: art, tagName: art.tagName});
+                        discoBitsCollection.add(model)
+                    });
+                    
+                    
+                    
+                });
+                /*var store = rdfstore.create();
+                
+                    CallbackProcessor.prototype = new RDFaProcessor();
+                    CallbackProcessor.prototype.constructor=RDFaProcessor;
+                    function CallbackProcessor() {
+                       RDFaProcessor.call(this);
+                    }
+
+                    CallbackProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+                       alert("New triple: "+subject+", predicate "+predicate+", object "+object.value+", "+object.language+", "+object.type);
+                       //RDFaProcessor.prototype.addTriple.call(this, origin, subject, predicate, object);
+                       //graph.add(env.createTriple())
+                    }*/
+                    //var gp = new GraphRDFaProcessor();
+                    /*function WrappedGraphProcessor() {
+                        GraphRDFaProcessor.call(this)
+                    }
+                    WrappedGraphProcessor.prototype = new GraphRDFaProcessor();
+                    WrappedGraphProcessor.prototype.addTriple= function(origin,subject,predicate,object) {
+                            alert("uff "+origin+","+subject+","+predicate+","+object);
+                            if (origin.getAttribute("content")) {
+                                object.value = origin.getAttribute("content");
+                            }
+                            GraphRDFaProcessor.prototype.addTriple.call(this, origin, subject, predicate, object);
+                        }
+                    var gp = new WrappedGraphProcessor();
+                    //var gp = new CallbackProcessor();
+                    gp.target.graph = new RDFaGraph();
+                    gp.process(document);
+                    var origTurtle = gp.target.graph.toString();
+                    alert(origTurtle);*/
+                    
+                            
+                //});
+                
+
+                
+
+                
+                //var view = new articleView({model: model, el: $article[0], tagName: $article[0].tagName});
+
+            });
+        
+            Backbone.on('all', function(s) {
+                console.log('Handling all: ' + s);
+            });
+        
+            
+        
+            /*document.addEventListener(
+              "rdfa.loaded",
+              function() {
+                 _.forEach(document.getElementsByType("http://discobits.org/ontology#Entry"), function(e) {
+                  $(e).css('background-color', 'blue');
+                });
+                console.log('all colored');
+                //console.log('activating: '+RDFaProcessor);
+                CallbackProcessor.prototype = new RDFaProcessor();
+                CallbackProcessor.prototype.constructor=RDFaProcessor;
+                function CallbackProcessor() {
+                   RDFaProcessor.call(this);
+                }
+
+                CallbackProcessor.prototype.newSubjectOrigin = function(origin,subject) {
+                   console.log("New origin for "+subject);
+                }
+
+                CallbackProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+                   console.log("New triple: "+subject+", predicate "+predicate+
+                               ", object "+object.value+", "+object.language+", "+object.type);
+                }
+                console.log('activated: '+CallbackProcessor);
+                processor = new CallbackProcessor();
+                processor.finishedHandlers.push(
+                    function(node) {
+                       alert("Done!");
+                    }
+                 );
+                 processor.process(document);
+                 console.log('done');
+              },
+              false
+            );*/
+            """
+        val html = <html xmlns:disco="http://discobits.org/ontology#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 
+          
+            <head>
+                <link type="text/css" href="/style/style.css" rel="stylesheet" />
+                <link rel="stylesheet" href="/tools/editor/styles/etch.css" />
+                {for (part <- res/DISCOBITS.contains;  if ((part/DISCOBITS.pos*) == "0")) yield
+                <title>Editing: {part/DISCOBITS.holds/DISCOBITS.infoBit*}</title> }
+                <script src="/tools/editor/scripts/RDFaProcessor.1.3.0.js"></script>
+                <script src="/tools/editor/scripts/RDFa.1.3.0.js"></script>
+            </head>
+          <body>
+            {render(res, "rdfa-naked")}
+            <script src="/tools/editor/scripts/jquery.min.js"></script>
+            <script src="/tools/editor/scripts/underscore-min.js"></script>
+            <script src="/tools/editor/scripts/backbone-min.js"></script>
+            <script src="/tools/editor/scripts/etch.js"></script>
+            <script src="/tools/editor/scripts/backbone.stickit.js"></script>
+            <script src="/tools/editor/scripts/rdfstore.js" type="text/javascript"></script>
+            <script src="/tools/editor/scripts/greenrdfstore.js"></script>
+            <script>
+              {Unparsed(initScript)}
+            </script>
+          </body>
+        </html>
+        
+        //From: http://www.w3.org/TR/html5/syntax.html#syntax     
+        //"A single newline may be placed immediately after the start tag of pre 
+        //and textarea elements. If the element's contents are intended to 
+        //start with a newline, two consecutive newlines thus need to be 
+        //included by the author."
+        object preRule extends RewriteRule {
+          override def transform(n: Node): Seq[Node] = n match {
+            case e:Elem
+            	if(e.label == "pre") => e.child(0) match   {
+            		case t : Text =>
+            		  if (t.text(0) == '\n') {
+             				val newText = Text("\n"+t.text)
+     					    	e.copy(child = newText ++ e.child.tail)
+     					    } else {
+     					    	e
+     					    }
+     					  case _ => e
+     					}
+            case other => other
+          }
+        }
+        
+        object htmlLineBreaks extends RuleTransformer(preRule)
+
+        htmlLineBreaks(html)
+      }
+    }
+  }
+
+}
+
+@Component
+@Service(Array(classOf[TypeRenderlet]))
+class TitledContentEtch extends DiscobitsContentEtch {
+
+  val getRdfType = DISCOBITS.TitledContent 
+}
+            
+@Component
+@Service(Array(classOf[TypeRenderlet]))
+class HtmlInfoDiscobitEtch extends DiscobitsContentEtch {
+
+  override val getRdfType = DISCOBITS.XHTMLInfoDiscoBit 
+    
+}
+
+@Component
+@Service(Array(classOf[TypeRenderlet]))
+class OrderedContentDiscobitEtch extends DiscobitsContentEtch {
+
+  override val getRdfType = DISCOBITS.OrderedContent
+    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/HtmlInfoDicobitRDFaNaked.scala
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/HtmlInfoDicobitRDFaNaked.scala b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/HtmlInfoDicobitRDFaNaked.scala
new file mode 100644
index 0000000..5e64b41
--- /dev/null
+++ b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/HtmlInfoDicobitRDFaNaked.scala
@@ -0,0 +1,34 @@
+package org.apache.clerezza.platform.editor
+
+
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import javax.ws.rs.core.MediaType
+import org.apache.clerezza.platform.typerendering.TypeRenderlet
+import org.apache.clerezza.platform.typerendering.scala._
+import org.apache.clerezza.rdf.ontologies.DISCOBITS
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;import scala.xml.Unparsed
+
+
+@Component
+@Service(Array(classOf[TypeRenderlet]))
+class HtmlInfoDicobitRDFaNaked extends SRenderlet {
+
+  val getRdfType = DISCOBITS.XHTMLInfoDiscoBit 
+    
+  override val getMediaType = MediaType.TEXT_HTML_TYPE
+
+  override def getModePattern = "rdfa-naked"
+
+  override def renderedPage(arguments: XmlResult.Arguments) = {
+    new XmlResult(arguments) {
+      override def content = {
+              <div typeof="disco:XHTMLInfoDiscoBit" about={res*}>
+                <span property="disco:infoBit" content={(res/DISCOBITS.infoBit*).replace("\n","\\n")} datatype="rdf:XMLLiteral">{Unparsed(res/DISCOBITS.infoBit*)}</span>
+              </div>
+      }
+    }
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/OrderedContentRDFaNaked.scala
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/OrderedContentRDFaNaked.scala b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/OrderedContentRDFaNaked.scala
new file mode 100644
index 0000000..e8e00f5
--- /dev/null
+++ b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/OrderedContentRDFaNaked.scala
@@ -0,0 +1,38 @@
+package org.apache.clerezza.platform.editor
+
+
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import javax.ws.rs.core.MediaType
+import org.apache.clerezza.platform.typerendering.TypeRenderlet
+import org.apache.clerezza.platform.typerendering.scala._
+import org.apache.clerezza.rdf.ontologies.DISCOBITS
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+
+@Component
+@Service(Array(classOf[TypeRenderlet]))
+class OrderedContentRDFaNaked extends SRenderlet {
+
+  val getRdfType = DISCOBITS.OrderedContent
+    
+  override val getMediaType = MediaType.TEXT_HTML_TYPE
+
+  override def getModePattern = "rdfa-naked"
+
+  override def renderedPage(arguments: XmlResult.Arguments) = {
+    new XmlResult(arguments) {
+      override def content = {
+              <div about={res*} typeof="disco:OrderedContent">
+                {for (part <- (res/DISCOBITS.contains).sortBy(part => (part/DISCOBITS.pos*).toInt)) 
+                  yield <div property="disco:contains" typeof="disco:Entry">
+                       <div property="disco:pos" style="display: none">{part/DISCOBITS.pos*}</div>
+                       <div property="disco:holds" resource={part/DISCOBITS.holds*}>{render(part/DISCOBITS.holds, "rdfa-naked")}</div>
+                    </div>
+                }
+              </div>
+      }
+    }
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/TitledContentRDFaNaked.scala
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/TitledContentRDFaNaked.scala b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/TitledContentRDFaNaked.scala
new file mode 100644
index 0000000..94e29fd
--- /dev/null
+++ b/platform/editor/src/main/scala/org/apache/clerezza/platform/editor/renderlets/TitledContentRDFaNaked.scala
@@ -0,0 +1,42 @@
+package org.apache.clerezza.platform.editor
+
+
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.rdf.scala.utils.Preamble._
+import javax.ws.rs.core.MediaType
+import org.apache.clerezza.platform.typerendering.TypeRenderlet
+import org.apache.clerezza.platform.typerendering.scala._
+import org.apache.clerezza.rdf.ontologies.DISCOBITS
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+
+@Component
+@Service(Array(classOf[TypeRenderlet]))
+class TitledContentRDFaNaked extends SRenderlet {
+
+  val getRdfType = DISCOBITS.TitledContent 
+    
+  override val getMediaType = MediaType.TEXT_HTML_TYPE
+
+  override def getModePattern = "rdfa-naked"
+
+  override def renderedPage(arguments: XmlResult.Arguments) = {
+    new XmlResult(arguments) {
+      override def content = {
+              <div typeof="disco:TitledContent" about={res*}>
+              {for (part <- res/DISCOBITS.contains;  if ((part/DISCOBITS.pos*) == "0")) 
+                yield <span property="disco:contains" typeof="disco:Entry">
+                   <span property="disco:pos" style="display: none">0</span>
+                   <h1 resource={part/DISCOBITS.holds*} property="disco:holds">{render(part/DISCOBITS.holds, "rdfa-naked")}</h1>
+                  </span>}
+              {for (part <- res/DISCOBITS.contains;  if ((part/DISCOBITS.pos*) == "1")) 
+                yield <div property="disco:contains" typeof="disco:Entry">
+                       <div property="disco:pos" style="display: none">{part/DISCOBITS.pos*}</div>
+                       <div property="disco:holds" resource={part/DISCOBITS.holds*}>{render(part/DISCOBITS.holds, "rdfa-naked")}</div>
+                    </div>}
+              </div>
+      }
+    }
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/enrichment/LICENSE
----------------------------------------------------------------------
diff --git a/platform/enrichment/LICENSE b/platform/enrichment/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/enrichment/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/enrichment/pom.xml
----------------------------------------------------------------------
diff --git a/platform/enrichment/pom.xml b/platform/enrichment/pom.xml
new file mode 100644
index 0000000..f844156
--- /dev/null
+++ b/platform/enrichment/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.enrichment</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform RDF Enrichment</name>
+    <description>Provides a Content-Graph Extension using Enrichers</description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.enrichment</artifactId>
+            <version>0.2</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java
----------------------------------------------------------------------
diff --git a/platform/enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java b/platform/enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java
new file mode 100644
index 0000000..56bf615
--- /dev/null
+++ b/platform/enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java
@@ -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.
+ */
+package org.apache.clerezza.platform.rdf.enrichment;
+
+import java.security.Permission;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.clerezza.platform.Constants;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
+import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
+import org.apache.clerezza.rdf.core.access.security.TcPermission;
+import org.apache.clerezza.rdf.enrichment.Enricher;
+import org.apache.clerezza.rdf.enrichment.EnrichmentTriples;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.References;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * Provides a read-only MGraph with the name urn:x-localinstance:/enrichment.graph
+ * containing the enrichments provided by all available services of type 
+ * Enricher on the content graph.
+ *
+ * For performance reasons EnrichmentTcProvider gets the content-graph from
+ * TcManager and doesn't do access control check on every request, to prevent
+ * deductions about the content of the content graph by unauthorized users
+ * the required permissions on the enrichment graph are set to those on the
+ * content graph.
+ *
+ *
+ * @author reto
+ */
+@Component
+@Service(WeightedTcProvider.class)
+@References(
+    {
+        @Reference(referenceInterface=Enricher.class, name="enricher",
+                cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
+                policy=ReferencePolicy.DYNAMIC)
+    }
+)
+public class EnrichmentTcProvider implements WeightedTcProvider {
+
+    public static final UriRef ENRICHMENT_GRAPH_URI = new UriRef("urn:x-localinstance:/enrichment.graph");
+    
+    private LockableMGraph contentGraph;
+    private final Collection<Enricher> enrichers = Collections.synchronizedCollection(new HashSet<Enricher>());
+
+    @Reference
+    private ContentGraphProvider cgProvider;
+
+    @Reference
+    private TcManager tcManager;
+
+    @Override
+    public Graph getGraph(UriRef name) throws NoSuchEntityException {
+        throw new NoSuchEntityException(name);
+    }
+
+    @Override
+    public MGraph getMGraph(UriRef name) throws NoSuchEntityException {
+        if (ENRICHMENT_GRAPH_URI.equals(name)) {
+            return getEnrichmentGraph();
+        }
+        throw new NoSuchEntityException(name);
+    }
+
+    @Override
+    public TripleCollection getTriples(UriRef name) throws NoSuchEntityException {
+        if (ENRICHMENT_GRAPH_URI.equals(name)) {
+            return getEnrichmentGraph();
+        }
+        throw new NoSuchEntityException(name);
+    }
+
+    @Override
+    public Set<UriRef> listGraphs() {
+        return new HashSet<UriRef>(0);
+    }
+
+    @Override
+    public Set<UriRef> listMGraphs() {
+        return Collections.singleton(ENRICHMENT_GRAPH_URI);
+    }
+
+    @Override
+    public Set<UriRef> listTripleCollections() {
+        return Collections.singleton(ENRICHMENT_GRAPH_URI);
+    }
+
+    @Override
+    public MGraph createMGraph(UriRef name) throws UnsupportedOperationException, EntityAlreadyExistsException {
+        throw new UnsupportedOperationException("creating entities not supported");
+    }
+
+    @Override
+    public Graph createGraph(UriRef name, TripleCollection triples) throws UnsupportedOperationException, EntityAlreadyExistsException {
+        throw new UnsupportedOperationException("creating entities not supported");
+    }
+
+    @Override
+    public void deleteTripleCollection(UriRef name) throws UnsupportedOperationException, NoSuchEntityException, EntityUndeletableException {
+        throw new UnsupportedOperationException("deleting entities not supported");
+    }
+
+    @Override
+    public Set<UriRef> getNames(Graph graph) {
+        return new HashSet<UriRef>(0);
+    }
+
+    @Override
+    public int getWeight() {
+        return 0;
+    }
+
+    private MGraph getEnrichmentGraph() {
+        return new EnrichmentTriples(contentGraph, enrichers);
+    }
+
+    /**
+     * avtivates the component and adds the enrichment-graph to the virtual
+     * content graph.
+     * 
+     * gets the base content-graph from tcManager and sets the permission
+     * required to access the enrichment-graph accordingly
+     */
+    protected void activate(ComponentContext context) {
+        contentGraph = tcManager.getMGraph(Constants.CONTENT_GRAPH_URI);
+        Collection<Permission> requiredReadPermissions =
+                tcManager.getTcAccessController().getRequiredReadPermissions(Constants.CONTENT_GRAPH_URI);
+        if (requiredReadPermissions.isEmpty()) {
+            tcManager.getTcAccessController().setRequiredReadPermissionStrings(
+                    ENRICHMENT_GRAPH_URI, Collections.singleton(
+                        new TcPermission(Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ).toString()
+                    ));
+        } else {
+            tcManager.getTcAccessController().setRequiredReadPermissions(
+                    ENRICHMENT_GRAPH_URI, requiredReadPermissions);
+        }
+        cgProvider.addTemporaryAdditionGraph(ENRICHMENT_GRAPH_URI);
+    }
+
+    /**
+     * deactivates the compononent removing the enrichment-graph from the
+     * virtual content graph
+     */
+    protected void deactivate(ComponentContext context) {
+        cgProvider.removeTemporaryAdditionGraph(ENRICHMENT_GRAPH_URI);
+        contentGraph = null;
+    }
+
+
+
+    protected void bindEnricher(Enricher enricher) {
+        enrichers.add(enricher);
+    }
+
+    protected void unbindEnricher(Enricher enricher) {
+        enrichers.remove(enricher);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/globalmenu.api/LICENSE
----------------------------------------------------------------------
diff --git a/platform/globalmenu.api/LICENSE b/platform/globalmenu.api/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/globalmenu.api/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/globalmenu.api/pom.xml
----------------------------------------------------------------------
diff --git a/platform/globalmenu.api/pom.xml b/platform/globalmenu.api/pom.xml
new file mode 100644
index 0000000..0ada0be
--- /dev/null
+++ b/platform/globalmenu.api/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.globalmenu.api</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform GlobalMenu API</name>
+    <description>
+        The API for providing entries to the global clerezza menu
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItem.java
----------------------------------------------------------------------
diff --git a/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItem.java b/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItem.java
new file mode 100644
index 0000000..e552bad
--- /dev/null
+++ b/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItem.java
@@ -0,0 +1,187 @@
+/*
+ * 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.globalmenu;
+
+/**
+ * This class keeps information about an item for the global menu.
+ *
+ * @author mir
+ */
+public class GlobalMenuItem implements Comparable<GlobalMenuItem> {
+
+    private String path;
+    private String label;
+    private String description;
+    private String identifier;
+    private int priority;
+    private String groupIdentifier;
+
+    /**
+     * Creates a new <code>GlobalMenuItem</code>.
+     *
+     * @param relativeUri of the resource to be shown in the menu.
+     * @param identifier The identifier of the menu item.
+     * @param label Specifies the label of the menu entry.
+     * @param priority the priority, higher numbers appear first in the menu
+     * @param groupIdentifier Specifies the the identifier of the group of which
+     *        the menu item is part.
+     */
+    public GlobalMenuItem(String path, String identifier, String label,
+            int priority, String groupIdentifier) {
+        if (label == null) {
+            throw new IllegalArgumentException("label may not be null");
+        }
+        this.path = path;
+        this.label = label;
+        this.identifier = identifier;
+        this.priority = priority;
+        this.groupIdentifier = groupIdentifier;
+    }
+
+    /**
+     * Creates a new <code>GlobalMenuItem</code>.
+     *
+     * @param relativeUri of the resource to be shown in the menu.
+     * @param identifier The identifier of the menu item.
+     * @param label Specifies the label of the menu entry.
+     * @param description The description of the menu item.
+     * @param priority the priority, higher numbers appear first in the menu
+     * @param groupIdentifier Specifies the the identifier of the group of which
+     *        the menu item is part.
+     */
+    public GlobalMenuItem(String path, String identifier, String label, String description,
+            int priority, String groupIdentifier) {
+        if (label == null) {
+            throw new IllegalArgumentException("label may not be null");
+        }
+        this.path = path;
+        this.label = label;
+        this.description = description;
+        this.identifier = identifier;
+        this.priority = priority;
+        this.groupIdentifier = groupIdentifier;
+    }
+
+    /**
+     * Returns the path of the resource to be shown in the menu. The
+     * path is additional to the bundle prefix and if existing to the
+     * <code>javax.ws.rs.Path</code> annotation of the
+     * <code>GlobalMenuItemsProvider</code> that returned this
+     * <code>GlobalMenuItem</code>.
+     * @return the path
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * Returns the label of the menu entry
+     * @return the label
+     */
+    public String getLabel() {
+        return label;
+    }
+
+    /**
+     * Returns the description of the menu entry.
+     * @return the groupIdentifier
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Return the identifier of the menu entry.
+     *
+     * @return
+     */
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    /**
+     * Returns the the priority within the group, which is used for sorting
+     * the menu Items, higher numbers appear first in the menu
+     * @return the priority
+     */
+    public int getPriority() {
+        return priority;
+    }
+
+    /**
+     * Returns the the identifier of the group of which this menu item is part,
+     * null if this is a top-level item.
+     * @return the groupIdentifier
+     */
+    public String getGroupIdentifier() {
+        return groupIdentifier;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final GlobalMenuItem other = (GlobalMenuItem) obj;
+        if ((this.path == null) ? (other.path != null) : !this.path.equals(other.path)) {
+            return false;
+        }
+        if (!this.label.equals(other.label)) {
+            return false;
+        }
+        if ((this.description == null) ? (other.description != null) : !this.description.equals(other.description)) {
+            return false;
+        }
+        if (this.priority != other.priority) {
+            return false;
+        }
+        if ((this.groupIdentifier == null) ? (other.groupIdentifier != null) : !this.groupIdentifier.equals(other.groupIdentifier)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 5;
+        hash = 53 * hash + (this.path != null ? this.path.hashCode() : 0);
+        hash = 53 * hash + this.label.hashCode();
+        hash = 53 * hash + (this.description != null ? this.description.hashCode() : 0);
+        hash = 53 * hash + this.priority;
+        hash = 53 * hash + (this.groupIdentifier != null ? this.groupIdentifier.hashCode() : 0);
+        return hash;
+    }
+
+    
+
+    @Override
+    public int compareTo(GlobalMenuItem o) {
+        if (getPriority() == o.getPriority()) {
+            if (this.equals(o)) {
+                return 0;
+            } else {
+                return getLabel().compareTo(o.getLabel());
+            }
+        }
+        return o.getPriority() - getPriority();
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItemsProvider.java
----------------------------------------------------------------------
diff --git a/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItemsProvider.java b/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItemsProvider.java
new file mode 100644
index 0000000..f4ff7ce
--- /dev/null
+++ b/platform/globalmenu.api/src/main/java/org/apache/clerezza/platform/globalmenu/GlobalMenuItemsProvider.java
@@ -0,0 +1,39 @@
+/*
+ * 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.globalmenu;
+
+import java.util.Set;
+
+/**
+ * An implementation of this interface provides a set of
+ * <code>GlobalMenuItem</code>S. A <code>GlobalMenuItem</code> represents an
+ * item in the global menu of the Clerezza Platform.
+ *
+ * @author mir
+ */
+public interface  GlobalMenuItemsProvider {
+
+    /**
+     * Returns a <code>Set</code> of <code>GlobalMenuItem</code>S. If there is
+     * no <code>GlobalMenuItem</code> available (e.g. the current user has not
+     * the needed permissions) then the returned set is empty.
+     * @return
+     */
+    public Set<GlobalMenuItem> getMenuItems();
+}


[06/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js
deleted file mode 100644
index f30cc14..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/selected-concepts.js
+++ /dev/null
@@ -1,58 +0,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.
- */
-function SelectedConcepts(){};
-
-SelectedConcepts.exists = function (concept) {
-	var exists = false;
-	$("input[name='concepts']").each( function () {
-		if ($(this).val() == concept) {
-			exists = true;
-		}
-	});
-	return exists;
-}
-
-SelectedConcepts.addConcept = function (prefLabel, uri) {
-	var div = $("<div/>");
-	ConceptFinder.createConceptWidgets(prefLabel, uri).appendTo(div);
-	SelectedConcepts.createDeleteButton(prefLabel, uri).appendTo(div);
-	$("<br />").appendTo(div);
-	$("<br />").appendTo(div);
-	$("#selected-concepts").append(div);
-}
-
-/**
- * Creates a button that allows to delete a concept.
- */
-SelectedConcepts.createDeleteButton = function(prefLabel, uri) {
-	var deleteLink = $("<a/>").attr("href", "#");
-	deleteLink.addClass("tx-icon tx-icon-delete").text("Delete");
-	deleteLink.click(function() {
-		deleteLink.parent().remove();
-		ConceptFinder.createSystemFoundConcept(prefLabel, uri)
-	});
-	return deleteLink;
-}
-
-
-$(document).ready(function () {
-	$(".tx-icon-delete").click(function() {
-		$(this).parent().remove();
-	});
-});

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css
deleted file mode 100644
index fe8d6fe..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/style/form.css
+++ /dev/null
@@ -1,24 +0,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.
- *
-*/
-
-input, select, textarea {
-	width: 32em;
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java b/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java
deleted file mode 100644
index c73da54..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerTest.java
+++ /dev/null
@@ -1,104 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.util.Arrays;
-import java.util.List;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.RuntimeDelegate;
-import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.core.access.LockableMGraphWrapper;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.wink.common.internal.runtime.RuntimeDelegateImpl;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This class tests the functionality of a SimpleConceptProviderManager.
- *
- * @author hasan
- */
-public class ConceptProviderManagerTest {
-
-    private class TestConceptProvider implements ConceptProvider {
-        @Override
-        public Graph retrieveConcepts(String searchTerm) {
-            return null;
-        }
-    }
-
-    private class TestedConceptProviderManager extends SimpleConceptProviderManager {
-        public void fillConceptProviderList() {
-            ConceptProvider CP1 = new TestConceptProvider();
-            ConceptProvider CP2 = new TestConceptProvider();
-            getConceptProviders().add(CP1);
-            getConceptProviders().add(CP2);
-        }
-    }
-
-    private static LockableMGraph mGraph = new LockableMGraphWrapper(new SimpleMGraph());
-
-    private TestedConceptProviderManager testedConceptProviderManager;
-
-    @Before
-    public void setUp() {
-        RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
-        testedConceptProviderManager = new TestedConceptProviderManager();
-        testedConceptProviderManager.cgProvider = new ContentGraphProvider() {
-
-            @Override
-            public LockableMGraph getContentGraph() {
-                return mGraph;
-            }
-        };
-    }
-
-    @Test
-    public void testUpdateConceptProviders() {
-        testedConceptProviderManager.fillConceptProviderList();
-        List<ConceptProvider> cpl = testedConceptProviderManager
-                .getConceptProviders();
-        Assert.assertTrue(cpl.get(0) instanceof TestConceptProvider);
-        Assert.assertTrue(cpl.get(1) instanceof TestConceptProvider);
-        Assert.assertTrue(cpl.size()==2);
-        List<String> types = Arrays.asList(
-                CONCEPTS.LocalConceptProvider.getUnicodeString(),
-                CONCEPTS.RemoteConceptProvider.getUnicodeString());
-        List<String> sparqlEndPoint = Arrays.asList(
-                "", "http://example.org/sparql");
-        List<String> defaultGraphs = Arrays.asList(
-                "", "http://example.org/graph");
-        List<String> queryTemplates = Arrays.asList(
-                "", "CONSTRUCT {?a ?b ?c .} WHERE {?a ?b ?c .}");
-        List<String> conceptSchemes = Arrays.asList(
-                "http://localhost:8080/default", "");
-        Response response = testedConceptProviderManager.updateConceptProviders(
-                types, sparqlEndPoint, defaultGraphs, queryTemplates,
-                conceptSchemes);
-        cpl = testedConceptProviderManager.getConceptProviders();
-        Assert.assertTrue(cpl.get(0) instanceof LocalConceptProvider);
-        Assert.assertTrue(cpl.get(1) instanceof RemoteConceptProvider);
-        Assert.assertTrue(cpl.size()==2);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java b/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java
deleted file mode 100644
index ef63d25..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/test/java/org/apache/clerezza/platform/concepts/core/ConceptsFinderTest.java
+++ /dev/null
@@ -1,154 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.util.Arrays;
-import java.util.List;
-import org.apache.clerezza.platform.config.PlatformConfig;
-import org.apache.clerezza.platform.concepts.ontologies.QUERYRESULT;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.core.access.LockableMGraphWrapper;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.SKOS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This class tests the functionality of a ConceptsFinder.
- *
- * @author hasan
- */
-public class ConceptsFinderTest {
-
-    private final UriRef concept1a = new UriRef("http://example.org/concept1a");
-    private final UriRef concept1b = new UriRef("http://example.org/concept1b");
-    private final UriRef concept1c = new UriRef("http://example.org/concept1c");
-    private final UriRef concept1d = new UriRef("http://example.org/concept1d");
-
-    private final UriRef concept2a = new UriRef("http://example.org/concept2a");
-    private final UriRef concept2b = new UriRef("http://example.org/concept2b");
-    private final UriRef concept2c = new UriRef("http://example.org/concept2c");
-    private final UriRef concept2d = new UriRef("http://example.org/concept2d");
-
-    private final List<UriRef> concepts1 = Arrays.asList(
-            concept1a, concept1b, concept1c, concept1d);
-    private final List<UriRef> concepts2 = Arrays.asList(
-            concept2a, concept2b, concept2c, concept2d);
-
-    private class TestConceptProvider implements ConceptProvider {
-        MGraph conceptGraph = new SimpleMGraph();
-
-        public TestConceptProvider(List<UriRef> myConcepts,
-                List<UriRef> yourConcepts, List<Integer> sameAs) {
-            Assert.assertTrue(myConcepts.size()==4);
-            Assert.assertTrue(yourConcepts.size()==4);
-            for (UriRef concept : myConcepts) {
-                conceptGraph.add(new TripleImpl(concept, RDF.type, SKOS.Concept));
-            }
-            for (Integer index : sameAs) {
-                conceptGraph.add(new TripleImpl(myConcepts.get(index), OWL.sameAs,
-                    yourConcepts.get(index)));
-            }
-        }
-
-        @Override
-        public Graph retrieveConcepts(String searchTerm) {
-            return conceptGraph.getGraph();
-        }
-    }
-
-    private class TestedConceptProviderManager extends SimpleConceptProviderManager {
-        public void fillConceptProviderList() {
-            ConceptProvider CP1 = new TestConceptProvider(concepts1, concepts2,
-                    Arrays.asList(1,3));
-            ConceptProvider CP2 = new TestConceptProvider(concepts2, concepts1,
-                    Arrays.asList(2,3));
-            getConceptProviders().add(CP1);
-            getConceptProviders().add(CP2);
-        }
-    }
-
-    private class TestedConceptsFinder extends ConceptsFinder {
-    }
-
-    private static LockableMGraph mGraph = new LockableMGraphWrapper(new SimpleMGraph());
-    private TestedConceptProviderManager testedConceptProviderManager;
-    private TestedConceptsFinder testedConceptsFinder;
-
-    @Before
-    public void setUp() {
-        final PlatformConfig platformConfig = new PlatformConfig() {
-
-            @Override
-            public UriRef getDefaultBaseUri() {
-                return new UriRef("http://testing.localhost/");
-            }
-            
-        };
-        final ContentGraphProvider cgProvider = new ContentGraphProvider() {
-
-            @Override
-            public LockableMGraph getContentGraph() {
-                return new LockableMGraphWrapper(new SimpleMGraph());
-            }
-
-        };
-
-        testedConceptProviderManager = new TestedConceptProviderManager();
-        testedConceptProviderManager.cgProvider = new ContentGraphProvider() {
-            @Override
-            public LockableMGraph getContentGraph() {
-                return mGraph;
-            }
-        };
-        testedConceptsFinder = new TestedConceptsFinder() {
-            {
-                bindPlatformConfig(platformConfig);
-                bindCgProvider(cgProvider);
-            }
-        };
-        testedConceptsFinder.conceptProviderManager =
-                testedConceptProviderManager;
-
-    }
-
-    @Test
-    public void testFindConcepts() {
-        testedConceptProviderManager.fillConceptProviderList();
-        GraphNode proposals = testedConceptsFinder.findConcepts("any");
-        Assert.assertEquals(5, proposals.countObjects(QUERYRESULT.concept));
-        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1a));
-        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1b));
-        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1c));
-        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept1d));
-        Assert.assertTrue(proposals.hasProperty(QUERYRESULT.concept, concept2a));
-        Assert.assertFalse(proposals.hasProperty(QUERYRESULT.concept, concept2b));
-        Assert.assertFalse(proposals.hasProperty(QUERYRESULT.concept, concept2c));
-        Assert.assertFalse(proposals.hasProperty(QUERYRESULT.concept, concept2d));
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.ontologies/LICENSE b/platform/platform.concepts/platform.concepts.ontologies/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.concepts/platform.concepts.ontologies/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.ontologies/pom.xml b/platform/platform.concepts/platform.concepts.ontologies/pom.xml
deleted file mode 100644
index d266140..0000000
--- a/platform/platform.concepts/platform.concepts.ontologies/pom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
-
- 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.
-
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>platform.concepts</artifactId>
-        <version>0.2</version>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.concepts.ontologies</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Concepts Ontologies</name>
-    <description>
-        Ontologies for Platform Concepts Core
-    </description>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.clerezza</groupId>
-                <artifactId>maven-ontologies-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>generate-sources</phase>
-                        <configuration>
-                            <resourcePath>${basedir}/src/main/resources</resourcePath>
-                            <sources>
-                                <source>${basedir}/target/generated-sources/main/java</source>
-                            </sources>
-                        </configuration>
-                        <goals>
-                            <goal>generate</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <version>0.4</version>
-        </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf b/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf
deleted file mode 100644
index a8cb5e4..0000000
--- a/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/concepts.rdf
+++ /dev/null
@@ -1,191 +0,0 @@
-<?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.
-
--->
-
-<rdf:RDF
-	xmlns="http://clerezza.org/2010/01/concepts#"
-	xml:base="http://clerezza.org/2010/01/concepts"
-	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-	xmlns:owl="http://www.w3.org/2002/07/owl#"
-	xmlns:dc="http://purl.org/dc/elements/1.1/"
-	xmlns:skos="http://www.w3.org/2008/05/skos#"
-	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
->
-
-<!-- Ontology -->
-
-<owl:Ontology rdf:about="http://clerezza.org/2010/01/concepts#">
-	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
-	<dc:title xml:lang="en">
-		Clerezza Concepts
-	</dc:title>
-</owl:Ontology>
-
-<!-- Classes -->
-
-<rdfs:Class rdf:about="#ConceptsPage">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Concepts Page</rdfs:label>
-	<skos:definition xml:lang="en">
-		A web page containing a list of concept entries and associated information.
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#ManageConceptProvidersPage">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Manage Concept Providers Page</rdfs:label>
-	<skos:definition xml:lang="en">
-		A web page for managing all concept providers
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#SearchTerm">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Search Term</rdfs:label>
-	<skos:definition xml:lang="en">A search term</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#ConceptProvider">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Concept Provider</rdfs:label>
-	<skos:definition xml:lang="en">
-		A Provider for retrieving concepts
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#LocalConceptProvider">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:subClassOf rdf:resource="ConceptProvider"/>
-	<rdfs:label xml:lang="en">Local Concept Provider</rdfs:label>
-	<skos:definition xml:lang="en">
-		A Concept Provider for retrieving concepts from a graph in localhost
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#RemoteConceptProvider">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Remote Concept Provider</rdfs:label>
-	<rdfs:subClassOf rdf:resource="ConceptProvider"/>
-	<skos:definition xml:lang="en">
-		A Concept Provider for retrieving concepts via a sparql endpoint
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#ConceptProviderList">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Concept Provider List</rdfs:label>
-	<skos:definition xml:lang="en">
-		A list of Concept Providers
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#ConceptCache">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Concept Cache</rdfs:label>
-	<skos:definition xml:lang="en">A cache for all concepts retrieved from a
-		specific Graph managed by a specific SPARQL End Point.
-	</skos:definition>
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#GenericResourcePage">
-	<rdf:type rdf:resource="owl:Class"/>
-	<rdfs:label xml:lang="en">Generic Resource Page</rdfs:label>
-	<skos:definition xml:lang="en">
-		A web page containing a resource and selected concepts.
-	</skos:definition>
-</rdfs:Class>
-
-<!-- Properties -->
-
-<rdf:Property rdf:about="#selectedScheme">
-	<rdf:type rdf:resource="owl:ObjectProperty"/>
-	<rdfs:label xml:lang="en">selected concept scheme</rdfs:label>
-	<skos:definition xml:lang="en">Points to the selected concept scheme.</skos:definition>
-	<rdfs:domain rdf:resource="#ConceptsPage"/>
-	<rdfs:domain rdf:resource="#ConceptProvider"/>
-	<rdfs:range rdf:resource="skos:ConceptScheme"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#queryTemplate">
-	<rdf:type rdf:resource="owl:DatatypeProperty"/>
-	<rdfs:label xml:lang="en">query template</rdfs:label>
-	<skos:definition xml:lang="en">
-		Points to a template containing a sparql query string which will
-		be applied by the subject to retrieve concepts.
-	</skos:definition>
-	<rdfs:domain rdf:resource="#ConceptProvider"/>
-	<rdfs:range rdf:resource="xsd:string"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#searchTerm">
-	<rdf:type rdf:resource="owl:DatatypeProperty"/>
-	<rdfs:label xml:lang="en">search Term</rdfs:label>
-	<skos:definition xml:lang="en">Points to a string as a term to be
-		searched in concept labels.</skos:definition>
-	<rdfs:domain rdf:resource="#SearchTerm"/>
-	<rdfs:range rdf:resource="xsd:string"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#searchResult">
-	<rdf:type rdf:resource="owl:ObjectProperty"/>
-	<rdfs:label xml:lang="en">search Result</rdfs:label>
-	<skos:definition xml:lang="en">Points to a concept which is a result of
-		a search using the term represented by the subject.
-	</skos:definition>
-	<rdfs:domain rdf:resource="#SearchTerm"/>
-	<rdfs:range rdf:resource="skos:Concept"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#sparqlEndPoint">
-	<rdf:type rdf:resource="owl:ObjectProperty"/>
-	<rdfs:label xml:lang="en">Sparql End Point</rdfs:label>
-	<skos:definition xml:lang="en">
-		Points to a UriRef of a sparql endpoint.
-	</skos:definition>
-	<rdfs:domain rdf:resource="#RemoteConceptProvider"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#defaultGraph">
-	<rdf:type rdf:resource="owl:ObjectProperty"/>
-	<rdfs:label xml:lang="en">default Graph</rdfs:label>
-	<skos:definition xml:lang="en">Points to a graph against which the subject
-		performs its queries.</skos:definition>
-	<rdfs:domain rdf:resource="#ConceptProvider"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#cacheEntry">
-	<rdf:type rdf:resource="owl:ObjectProperty"/>
-	<rdfs:label xml:lang="en">cache Entry</rdfs:label>
-	<skos:definition xml:lang="en">Points to a resource which describes
-		cached search results for a search term.
-	</skos:definition>
-	<rdfs:domain rdf:resource="#ConceptCache"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#resource">
-	<rdf:type rdf:resource="owl:ObjectProperty"/>
-	<rdfs:label xml:lang="en">Resource</rdfs:label>
-	<skos:definition xml:lang="en">Points to a resource.</skos:definition>
-	<rdfs:domain rdf:resource="#GenericConceptScheme"/>
-</rdf:Property>
-
-</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf b/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf
deleted file mode 100644
index 4b298b0..0000000
--- a/platform/platform.concepts/platform.concepts.ontologies/src/main/resources/org/apache/clerezza/platform/concepts/ontologies/queryresult.rdf
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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.
-
--->
-
-<rdf:RDF
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-    xmlns:skos="http://www.w3.org/2008/05/skos#"
-    xmlns="http://clerezza.org/2010/04/queryresult#"
-    xmlns:owl="http://www.w3.org/2002/07/owl#"
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
-    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-  xml:base="http://clerezza.org/2010/04/queryresult">
-  <owl:Ontology rdf:about="#">
-    <owl:versionInfo>Revision: 0.1</owl:versionInfo>
-    <dc:title xml:lang="en">
-		Ontology for describing the result of a Query for Concepts
-	</dc:title>
-  </owl:Ontology>
-  <rdfs:Class rdf:ID="QueryResult">
-    <rdfs:label xml:lang="en">Query Result</rdfs:label>
-    <skos:definition xml:lang="en">
-		The result of a query for concepts.
-	</skos:definition>
-    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
-  </rdfs:Class>
-  <rdf:Property rdf:ID="concept">
-    <rdfs:label xml:lang="en">concept</rdfs:label>
-    <skos:definition xml:lang="en">Points to a concept matching the query yielding to the subject.</skos:definition>
-    <rdfs:domain rdf:resource="#QueryResult"/>
-    <rdfs:range rdf:resource="http://www.w3.org/2008/05/skos#Concept"/>
-    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
-  </rdf:Property>
-  <rdf:Property rdf:ID="creationOfNewFreeConceptSuggested">
-    <rdfs:label xml:lang="en">creationOfNewFreeConceptSuggested</rdfs:label>
-    <skos:definition xml:lang="en">Points to a boolean value that indicates whether 
-    consumers of the subject are suggested to create new concepts with a query as 
-    preferred label.</skos:definition>
-    <rdfs:domain rdf:resource="#QueryResult"/>
-    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
-    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
-  </rdf:Property>
-</rdf:RDF>
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/pom.xml b/platform/platform.concepts/pom.xml
deleted file mode 100644
index 7133468..0000000
--- a/platform/platform.concepts/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
-
- 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.
-
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.concepts</artifactId>
-    <packaging>pom</packaging>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Clerezza - Platform Concepts</name>
-    <description>Provides services for tagging resources with SKOS concepts.</description>
-    <modules>
-        <module>platform.concepts.ontologies</module>
-        <module>platform.concepts.core</module>
-    </modules>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config.gui/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.config.gui/LICENSE b/platform/platform.config.gui/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.config.gui/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config.gui/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.config.gui/pom.xml b/platform/platform.config.gui/pom.xml
deleted file mode 100644
index 96493dc..0000000
--- a/platform/platform.config.gui/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.config.gui</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Configuration GUI</name>
-    <description>This bundles initializes a GUI to
-        edit configuration options.
-    </description>
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.ontologies</artifactId>
-            <version>0.12</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.utils</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.globalmenu.api</artifactId>
-            <version>0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.graphprovider.content</artifactId>
-            <version>0.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>web.fileserver</artifactId>
-            <version>0.10</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.config</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.scalaserverpages</artifactId>
-            <version>0.4</version>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java
----------------------------------------------------------------------
diff --git a/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java b/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java
deleted file mode 100644
index a341bc5..0000000
--- a/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/ConfigGuiAccessPermission.java
+++ /dev/null
@@ -1,66 +0,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.
- */
-
-package org.apache.clerezza.platform.config.gui;
-
-import java.security.Permission;
-import org.apache.clerezza.permissiondescriptions.PermissionInfo;
-
-/**
- * Permission to use the Config GUI. Note that the user
- * additionally needs permission write into the system graph.
- *
- * @author tio
- */
-@PermissionInfo(value="Config GUI Access Permission", description="Grants access " +
-    "to the Config GUI")
-public class ConfigGuiAccessPermission extends Permission{
-
-    public ConfigGuiAccessPermission() {
-        super("Config GUI Access permission");
-    }
-    /**
-     *
-     * @param target ignored
-     * @param action ignored
-     */
-    public ConfigGuiAccessPermission(String target, String actions) {
-        super("Config GUI Access permission");
-    }
-
-    @Override
-    public boolean implies(Permission permission) {
-        return equals(permission);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return getClass().equals(obj.getClass());
-    }
-
-    @Override
-    public int hashCode() {
-        return 2177987;
-    }
-
-    @Override
-    public String getActions() {
-        return "";
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java
----------------------------------------------------------------------
diff --git a/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java b/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java
deleted file mode 100644
index 647a0e6..0000000
--- a/platform/platform.config.gui/src/main/java/org/apache/clerezza/platform/config/gui/PlatformConfigGui.java
+++ /dev/null
@@ -1,190 +0,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.
- */
-package org.apache.clerezza.platform.config.gui;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import org.apache.clerezza.platform.config.PlatformConfig;
-import org.apache.clerezza.platform.config.SystemConfig;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.felix.scr.annotations.Services;
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
-import org.osgi.framework.Bundle;
-import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.rdf.core.UriRef;
-
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.core.access.security.TcPermission;
-
-import org.apache.clerezza.rdf.ontologies.*;
-import org.apache.clerezza.web.fileserver.BundlePathNode;
-import org.apache.clerezza.web.fileserver.FileServer;
-import org.wymiwyg.commons.util.dirbrowser.PathNode;
-
-/**
- * Provides a GUI to change platform default values.
- *
- * @author osr
- */
-@Component
-@Services({
-    @Service(value = Object.class),
-    @Service(value = GlobalMenuItemsProvider.class)
-})
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/admin/configuration")
-public class PlatformConfigGui implements GlobalMenuItemsProvider {
-
-    private final static char SLASH = '/';
-    @Reference
-    private PlatformConfig platformConfig;
-    @Reference
-    private RenderletManager renderletManager;
-    private final Logger logger = LoggerFactory.getLogger(getClass());
-    private final UriRef CONFIG_PAGE = new UriRef("http://clerezza.org/2009/08/platform#ConfigPage");
-    private FileServer fileServer;
-
-    protected void activate(ComponentContext context) throws IOException,
-            URISyntaxException {
-        Bundle bundle = context.getBundleContext().getBundle();
-        URL resourceDir = getClass().getResource("staticweb");
-        PathNode pathNode = new BundlePathNode(bundle, resourceDir.getPath());
-
-        logger.debug("Initializing file server for {} ({})", resourceDir,
-                resourceDir.getFile());
-
-        fileServer = new FileServer(pathNode);
-
-        URL template = getClass().getResource(
-                "config.ssp");
-        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
-                new UriRef(template.toURI().toString()),
-                CONFIG_PAGE, "naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-    }
-
-    protected void deactivate(ComponentContext context) {
-        fileServer = null;
-    }
-
-    /**
-     * Returns a headed page listing RSS Feeds. The optional parameter query is a
-     * search term, which tests if the term is contained in thee title or uri
-     * of the feed.
-     *
-     * @param query an optional parameter which specifies a search term criteria.
-     * The search term will be tested if contained in the title or the uri of the feed.
-     *
-     * @return {@link GraphNode}
-     *
-     */
-    @GET
-    public GraphNode getConfig() {
-        AccessController.checkPermission(new ConfigGuiAccessPermission());
-        GraphNode node = new GraphNode(new BNode(), new SimpleMGraph());
-        node.addProperty(RDF.type, CONFIG_PAGE);
-        node.addProperty(RDF.type, PLATFORM.HeadedPage);
-        node.addProperty(PLATFORM.defaultBaseUri, platformConfig.getDefaultBaseUri());
-        return node;
-
-    }
-
-    @POST
-    public Response setConfig(@FormParam(value = "defaultBaseUri") String defaultBaseUri,
-            @Context UriInfo uriInfo) {
-        AccessController.checkPermission(new ConfigGuiAccessPermission());
-        logger.debug("Setting base-uri to {}", defaultBaseUri);
-        if (defaultBaseUri.charAt(defaultBaseUri.length() - 1) != SLASH) {
-            defaultBaseUri += SLASH;
-        }
-        UriRef uri = new UriRef(defaultBaseUri);
-        GraphNode node = platformConfig.getPlatformInstance();
-        LockableMGraph sysGraph = (LockableMGraph) node.getGraph();
-        Lock writeLock = sysGraph.getLock().writeLock();
-        writeLock.lock();
-        try {
-            node.deleteProperties(PLATFORM.defaultBaseUri);
-            node.addProperty(PLATFORM.defaultBaseUri, uri);
-        } finally {
-            writeLock.unlock();
-        }
-        return Response.status(Response.Status.ACCEPTED).build();
-    }
-
-    @Override
-    public Set<GlobalMenuItem> getMenuItems() {
-        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
-        try {
-            AccessController.checkPermission(new ConfigGuiAccessPermission());
-            AccessController.checkPermission(
-                    new TcPermission(SystemConfig.SYSTEM_GRAPH_URI.toString(),
-                    TcPermission.READWRITE));
-        } catch (AccessControlException e) {
-            return items;
-        }
-        items.add(new GlobalMenuItem("/admin/configuration", "Configuration", "Configuration", 2,
-                "Administration"));
-        return items;
-    }
-
-    /**
-     * Returns a PathNode of a static file from the staticweb folder.
-     *
-     * @param path specifies the path parameter
-     * @return {@link PathNode}
-     */
-    @GET
-    @Path("{path:.+}")
-    public PathNode getStaticFile(
-            @PathParam("path") String path) {
-        return fileServer.getNode(path);
-
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp b/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp
deleted file mode 100644
index 627cf18..0000000
--- a/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/config.ssp
+++ /dev/null
@@ -1,49 +0,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.
- *
-*/
-
-def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#"+s)
-resultDocModifier.addStyleSheet("style/form.css");
-resultDocModifier.addScriptReference("/jquery/jquery-1.3.2.min.js");
-resultDocModifier.addScriptReference("/admin/configuration/js/platformconfig.js");
-resultDocModifier.addStyleSheet("/yui/2/container/assets/container-core.css");
-resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
-resultDocModifier.addScriptReference("/yui/2/element/element-min.js");
-resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
-resultDocModifier.addScriptReference("/scripts/alert-message.js");
-resultDocModifier.addScriptReference("/scripts/ajax-options.js");
-resultDocModifier.addScriptReference("/scripts/modification-status.js");
-resultDocModifier.addScripts("ModificationStatus.watchElements(\"input\");");
-
-resultDocModifier.setTitle("Apache Clerezza Configuration");
-resultDocModifier.addNodes2Elem("tx-module", <h1>Apache Clerezza Configuration</h1>);
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a class="tx-button tx-button-create " id="saveButton" href="#">Save</a></li>);
-<div id="tx-content">
-	<fieldset>
-		<legend></legend>
-		<ol>
-			<li class="tx-line">
-				<label for="defaultBaseUri">Default Base URI</label>
-				<input id="defaultBaseUri" name="defaultBaseUri" value={res/platform("defaultBaseUri")*}/>
-
-			</li>
-		</ol>
-	</fieldset>
-</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js
----------------------------------------------------------------------
diff --git a/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js b/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js
deleted file mode 100644
index 5e922a1..0000000
--- a/platform/platform.config.gui/src/main/resources/org/apache/clerezza/platform/config/gui/staticweb/js/platformconfig.js
+++ /dev/null
@@ -1,52 +0,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.
- */
-$(document).ready(function() {
-    $('#saveButton').click(function(){
-
-        if(isUrl($('#defaultBaseUri').val())){
-            var q = "Are you sure you want to change the URI to "+$('#defaultBaseUri').val();
-            AlertMessage.show(function(){
-
-                var data = "defaultBaseUri=" + encodeURIComponent($("#defaultBaseUri").val());
-                var options = new AjaxOptions("platform-config", "Save Config", function() {
-					ModificationStatus.isModified = false;
-				});
-                options.type = "POST";
-                options.url = "/admin/configuration/";
-                options.data = data;
-                $.ajax(options);
-            }, q , "Change Config?");
-            
-        }else {
-            AlertMessage.show(function(){}, " No valid URL ", "Error", "OK");
-        }
-
-
-
-
-    })
-})
-
-
-
-function isUrl(s) {
-    var regexp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
-    return regexp.test(s);
-}
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.config/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.config/LICENSE b/platform/platform.config/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.config/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.


[26/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFaProcessor.1.3.0.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFaProcessor.1.3.0.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFaProcessor.1.3.0.js
new file mode 100644
index 0000000..1dc3f47
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFaProcessor.1.3.0.js
@@ -0,0 +1,1644 @@
+/** @preserve green-turtle version 1.3.0 Copyright (c) 2011-2013, R. Alexander Milowski <al...@milowski.com> All rights reserved. */
+/**         
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+function URIResolver() {
+}
+URIResolver.SCHEME = /^[A-Za-z][A-Za-z0-9\+\-\.]*\:/;
+
+URIResolver.prototype.parseURI = function(uri) {
+   var match = URIResolver.SCHEME.exec(uri);
+   if (!match) {
+      throw "Bad URI value, no scheme: "+uri;
+   }
+   var parsed = { spec: uri };
+   parsed.scheme = match[0].substring(0,match[0].length-1);
+   parsed.schemeSpecificPart = parsed.spec.substring(match[0].length);
+   if (parsed.schemeSpecificPart.charAt(0)=='/' && parsed.schemeSpecificPart.charAt(1)=='/') {
+      this.parseGeneric(parsed);
+   } else {
+      parsed.isGeneric = false;
+   }
+   parsed.normalize = function() {
+      if (!this.isGeneric) {
+         return;
+      }
+      if (this.segments.length==0) {
+         return;
+      }
+      // edge case of ending in "/."
+      if (this.path.length>1 && this.path.substring(this.path.length-2)=="/.") {
+         this.path = this.path.substring(0,this.path.length-1);
+         this.segments.splice(this.segments.length-1,1);
+         this.schemeSpecificPart = "//"+this.authority+this.path;
+         if (typeof this.query != "undefined") {
+            this.schemeSpecificPart += "?" + this.query;
+         }
+         if (typeof this.fragment != "undefined") {
+            this.schemeSpecificPart += "#" + this.fragment;
+         }
+         this.spec = this.scheme+":"+this.schemeSpecificPart;
+         return;
+      }
+      var end = this.path.charAt(this.path.length-1);
+      if (end!="/") {
+         end = "";
+      }
+      for (var i=0; i<this.segments.length; i++) {
+         if (i>0 && this.segments[i]=="..") {
+            this.segments.splice(i-1,2);
+            i -= 2;
+         }
+         if (this.segments[i]==".") {
+            this.segments.splice(i,1);
+            i--;
+         }
+      }
+      this.path = this.segments.length==0 ? "/" : "/"+this.segments.join("/")+end;
+      this.schemeSpecificPart = "//"+this.authority+this.path;
+      if (typeof this.query != "undefined") {
+         this.schemeSpecificPart += "?" + this.query;
+      }
+      if (typeof this.fragment != "undefined") {
+         this.schemeSpecificPart += "#" + this.fragment;
+      }
+      this.spec = this.scheme+":"+this.schemeSpecificPart;
+   }
+   parsed.resolve = function(href) {
+      if (!href) {
+         return this.spec;
+      }
+      if (href.charAt(0)=='#') {
+         var lastHash = this.spec.lastIndexOf('#');
+         return lastHash<0 ? this.spec+href : this.spec.substring(0,lastHash)+href;
+      }
+      if (!this.isGeneric) {
+         throw "Cannot resolve uri against non-generic URI: "+this.spec;
+      }
+      var colon = href.indexOf(':');
+      if (href.charAt(0)=='/') {
+         return this.scheme+"://"+this.authority+href;
+      } else if (href.charAt(0)=='.' && href.charAt(1)=='/') {
+         if (this.path.charAt(this.path.length-1)=='/') {
+            return this.scheme+"://"+this.authority+this.path+href.substring(2);
+         } else {
+            var last = this.path.lastIndexOf('/');
+            return this.scheme+"://"+this.authority+this.path.substring(0,last)+href.substring(1);
+         }
+      } else if (URIResolver.SCHEME.test(href)) {
+         return href;
+      } else if (href.charAt(0)=="?") {
+         return this.scheme+"://"+this.authority+this.path+href;
+      } else {
+         if (this.path.charAt(this.path.length-1)=='/') {
+            return this.scheme+"://"+this.authority+this.path+href;
+         } else {
+            var last = this.path.lastIndexOf('/');
+            return this.scheme+"://"+this.authority+this.path.substring(0,last+1)+href;
+         }
+      }
+   };
+   parsed.relativeTo = function(otherURI) {
+      if (otherURI.scheme!=this.scheme) {
+         return this.spec;
+      }
+      if (!this.isGeneric) {
+         throw "A non generic URI cannot be made relative: "+this.spec;
+      }
+      if (!otherURI.isGeneric) {
+         throw "Cannot make a relative URI against a non-generic URI: "+otherURI.spec;
+      }
+      if (otherURI.authority!=this.authority) {
+         return this.spec;
+      }
+      var i=0;
+      for (; i<this.segments.length && i<otherURI.segments.length; i++) {
+         if (this.segments[i]!=otherURI.segments[i]) {
+            //alert(this.path+" different from "+otherURI.path+" at '"+this.segments[i]+"' vs '"+otherURI.segments[i]+"'");
+            var relative = "";
+            for (var j=i; j<otherURI.segments.length; j++) {
+               relative += "../";
+            }
+            for (var j=i; j<this.segments.length; j++) {
+               relative += this.segments[j];
+               if ((j+1)<this.segments.length) {
+                  relative += "/";
+               }
+            }
+            if (this.path.charAt(this.path.length-1)=='/') {
+               relative += "/";
+            }
+            return relative;
+         }
+      }
+      if (this.segments.length==otherURI.segments.length) {
+         return this.hash ? this.hash : (this.query ? this.query : "");
+      } else if (i<this.segments.length) {
+         var relative = "";
+         for (var j=i; j<this.segments.length; j++) {
+            relative += this.segments[j];
+            if ((j+1)<this.segments.length) {
+               relative += "/";
+            }
+         }
+         if (this.path.charAt(this.path.length-1)=='/') {
+            relative += "/";
+         }
+         return relative;
+      } else {
+         throw "Cannot calculate a relative URI for "+this.spec+" against "+otherURI.spec;
+      } 
+   };
+   return parsed;
+}
+
+URIResolver.prototype.parseGeneric = function(parsed) {
+   if (parsed.schemeSpecificPart.charAt(0)!='/' || parsed.schemeSpecificPart.charAt(1)!='/') {
+      throw "Generic URI values should start with '//':"+parsed.spec;
+   }
+  
+   var work = parsed.schemeSpecificPart.substring(2);
+   var pathStart = work.indexOf("/");
+   parsed.authority = pathStart<0 ? work : work.substring(0,pathStart);
+   parsed.path = pathStart<0 ? "" : work.substring(pathStart);
+   var hash = parsed.path.indexOf('#');
+   if (hash>=0) {
+      parsed.fragment = parsed.path.substring(hash+1);
+      parsed.path = parsed.path.substring(0,hash);
+   }
+   var questionMark = parsed.path.indexOf('?');
+   if (questionMark>=0) {
+      parsed.query = parsed.path.substring(questionMark+1);
+      parsed.path = parsed.path.substring(0,questionMark);
+   }
+   if (parsed.path=="/" || parsed.path=="") {
+      parsed.segments = [];
+   } else {
+      parsed.segments = parsed.path.split(/\//);
+      if (parsed.segments.length>0 && parsed.segments[0]=='' && parsed.path.length>1 && parsed.path.charAt(1)!='/') {
+         // empty segment at the start, remove it
+         parsed.segments.shift();
+      }
+      if (parsed.segments.length>0 && parsed.path.length>0 && parsed.path.charAt(parsed.path.length-1)=='/' && parsed.segments[parsed.segments.length-1]=='') {
+         // we may have an empty the end
+         // check to see if it is legimate
+         if (parsed.path.length>1 && parsed.path.charAt(parsed.path.length-2)!='/') {
+            parsed.segments.pop();
+         }
+      }
+      // check for non-escaped characters
+      for (var i=0; i<parsed.segments.length; i++) {
+         var check = parsed.segments[i].split(/%[A-Za-z0-9][A-Za-z0-9]|[\ud800-\udfff][\ud800-\udfff]|[A-Za-z0-9\-\._~!$&'()*+,;=@:\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/);
+
+                 for (var j=0; j<check.length; j++) {
+            if (check[j].length>0) {
+               throw "Unecaped character "+check[j].charAt(0)+" ("+check[j].charCodeAt(0)+") in URI "+parsed.spec;
+            }
+         }
+      }
+   }
+   parsed.isGeneric = true;
+}
+
+RDFaProcessor.prototype = new URIResolver();
+RDFaProcessor.prototype.constructor=RDFaProcessor;
+function RDFaProcessor(targetObject) {
+   if (targetObject) {
+      this.target = targetObject;
+   } else {
+      this.target = {
+         graph: {
+            subjects: {},
+            prefixes: {},
+            terms: {}
+         }
+      };
+   }
+   this.theOne = "_:"+(new Date()).getTime();
+   this.language = null;
+   this.vocabulary = null;
+   this.blankCounter = 0;
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" } ];
+   this.inXHTMLMode = false;
+   this.absURIRE = /[\w\_\-]+:\S+/;
+   this.finishedHandlers = [];
+   this.init();
+}
+
+RDFaProcessor.prototype.newBlankNode = function() {
+   this.blankCounter++;
+   return "_:"+this.blankCounter;
+}
+
+RDFaProcessor.XMLLiteralURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"; 
+RDFaProcessor.HTMLLiteralURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"; 
+RDFaProcessor.PlainLiteralURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral";
+RDFaProcessor.objectURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#object";
+RDFaProcessor.typeURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
+
+RDFaProcessor.nameChar = '[-A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF\.0-9\u00B7\u0300-\u036F\u203F-\u2040]';
+RDFaProcessor.nameStartChar = '[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0
 B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u
 1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]';
+RDFaProcessor.NCNAME = new RegExp('^' + RDFaProcessor.nameStartChar + RDFaProcessor.nameChar + '*$');
+
+RDFaProcessor.trim = function(str) {
+   return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+}
+
+RDFaProcessor.prototype.tokenize = function(str) {
+   return RDFaProcessor.trim(str).split(/\s+/);
+}
+
+
+RDFaProcessor.prototype.parseSafeCURIEOrCURIEOrURI = function(value,prefixes,base) {
+   value = RDFaProcessor.trim(value);
+   if (value.charAt(0)=='[' && value.charAt(value.length-1)==']') {
+      value = value.substring(1,value.length-1);
+      value = value.trim(value);
+      if (value.length==0) {
+         return null;
+      }
+      if (value=="_:") {
+         // the one node
+         return this.theOne;
+      }
+      return this.parseCURIE(value,prefixes,base);
+   } else {
+      return this.parseCURIEOrURI(value,prefixes,base);
+   }
+}
+
+RDFaProcessor.prototype.parseCURIE = function(value,prefixes,base) {
+   var colon = value.indexOf(":");
+   if (colon>=0) {
+      var prefix = value.substring(0,colon);
+      if (prefix=="") {
+         // default prefix
+         var uri = prefixes[""];
+         return uri ? uri+value.substring(colon+1) : null;
+      } else if (prefix=="_") {
+         // blank node
+         return "_:"+value.substring(colon+1);
+      } else if (RDFaProcessor.NCNAME.test(prefix)) {
+         var uri = prefixes[prefix];
+         if (uri) {
+            return uri+value.substring(colon+1);
+         }
+      }
+   }
+   return null;
+}
+
+RDFaProcessor.prototype.parseCURIEOrURI = function(value,prefixes,base) {
+   var curie = this.parseCURIE(value,prefixes,base);
+   if (curie) {
+      return curie;
+   }
+   return this.resolveAndNormalize(base,value);
+}
+
+RDFaProcessor.prototype.parsePredicate = function(value,defaultVocabulary,terms,prefixes,base,ignoreTerms) {
+   if (value=="") {
+      return null;
+   }
+   var predicate = this.parseTermOrCURIEOrAbsURI(value,defaultVocabulary,ignoreTerms ? null : terms,prefixes,base);
+   if (predicate && predicate.indexOf("_:")==0) {
+      return null;
+   }
+   return predicate;
+}
+
+RDFaProcessor.prototype.parseTermOrCURIEOrURI = function(value,defaultVocabulary,terms,prefixes,base) {
+   //alert("Parsing "+value+" with default vocab "+defaultVocabulary);
+   value = RDFaProcessor.trim(value);
+   var curie = this.parseCURIE(value,prefixes,base);
+   if (curie) {
+      return curie;
+   } else {
+       var term = terms[value];
+       if (term) {
+          return term;
+       }
+       var lcvalue = value.toLowerCase();
+       term = terms[lcvalue];
+       if (term) {
+          return term;
+       }
+       if (defaultVocabulary && !this.absURIRE.exec(value)) {
+          return defaultVocabulary+value
+       }
+   }
+   return this.resolveAndNormalize(base,value);
+}
+
+RDFaProcessor.prototype.parseTermOrCURIEOrAbsURI = function(value,defaultVocabulary,terms,prefixes,base) {
+   //alert("Parsing "+value+" with default vocab "+defaultVocabulary);
+   value = RDFaProcessor.trim(value);
+   var curie = this.parseCURIE(value,prefixes,base);
+   if (curie) {
+      return curie;
+   } else if (terms) {
+       if (defaultVocabulary && !this.absURIRE.exec(value)) {
+          return defaultVocabulary+value
+       }
+       var term = terms[value];
+       if (term) {
+          return term;
+       }
+       var lcvalue = value.toLowerCase();
+       term = terms[lcvalue];
+       if (term) {
+          return term;
+       }
+   }
+   if (this.absURIRE.exec(value)) {
+      return this.resolveAndNormalize(base,value);
+   }
+   return null;
+}
+
+RDFaProcessor.prototype.resolveAndNormalize = function(base,href) {
+   var u = base.resolve(href);
+   var parsed = this.parseURI(u);
+   parsed.normalize();
+   return parsed.spec;
+}
+
+RDFaProcessor.prototype.parsePrefixMappings = function(str,target) {
+   var values = this.tokenize(str);
+   var prefix = null;
+   var uri = null;
+   for (var i=0; i<values.length; i++) {
+      if (values[i][values[i].length-1]==':') {
+         prefix = values[i].substring(0,values[i].length-1);
+      } else if (prefix) {
+         target[prefix] = this.target.baseURI ? this.target.baseURI.resolve(values[i]) : values[i];
+         prefix = null;
+      }
+   }
+}
+
+RDFaProcessor.prototype.copyMappings = function(mappings) {
+   var newMappings = {};
+   for (var k in mappings) {
+      newMappings[k] = mappings[k];
+   }
+   return newMappings;
+}
+
+RDFaProcessor.prototype.ancestorPath = function(node) {
+   var path = "";
+   while (node && node.nodeType!=Node.DOCUMENT_NODE) {
+      path = "/"+node.localName+path;
+      node = node.parentNode;
+   }
+   return path;
+}
+
+RDFaProcessor.prototype.setContext = function(node) {
+
+   // We only recognized XHTML+RDFa 1.1 if the version is set propertyly
+   if (node.localName=="html" && node.getAttribute("version")=="XHTML+RDFa 1.1") {
+      this.setXHTMLContext();
+   } else if (node.localName=="html" || node.namespaceURI=="http://www.w3.org/1999/xhtml") {
+      if (document.doctype) {
+         if (document.doctype.publicId=="-//W3C//DTD XHTML+RDFa 1.0//EN" && document.doctype.systemId=="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd") {
+            console.log("WARNING: RDF 1.0 is not supported.  Defaulting to HTML5 mode.");
+            this.setHTMLContext();
+         } else if (document.doctype.publicId=="-//W3C//DTD XHTML+RDFa 1.1//EN" && document.doctype.systemId=="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd") {
+            this.setXHTMLContext();
+         } else {
+            this.setHTMLContext();
+         }
+      } else {
+         this.setHTMLContext();
+      }
+   } else {
+      this.setXMLContext();
+   }
+
+}
+
+RDFaProcessor.prototype.setInitialContext = function() {
+   this.vocabulary = null;
+   // By default, the prefixes are terms are loaded to the RDFa 1.1. standard within the graph constructor
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" } ];
+}
+
+RDFaProcessor.prototype.setXMLContext = function() {
+   this.setInitialContext();
+   this.inXHTMLMode = false;
+   this.inHTMLMode = false;
+}
+
+RDFaProcessor.prototype.setHTMLContext = function() {
+   this.setInitialContext();
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" },
+                           { namespaceURI: null, localName: "lang" }];
+   this.inXHTMLMode = false;
+   this.inHTMLMode = true;
+}
+
+RDFaProcessor.prototype.setXHTMLContext = function() {
+
+   this.setInitialContext();
+   
+   this.inXHTMLMode = true;
+   this.inHTMLMode = false;
+   
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" },
+                           { namespaceURI: null, localName: "lang" }];
+
+   // From http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1
+   this.target.graph.terms["alternate"] = "http://www.w3.org/1999/xhtml/vocab#alternate";
+   this.target.graph.terms["appendix"] = "http://www.w3.org/1999/xhtml/vocab#appendix";
+   this.target.graph.terms["bookmark"] = "http://www.w3.org/1999/xhtml/vocab#bookmark";
+   this.target.graph.terms["cite"] = "http://www.w3.org/1999/xhtml/vocab#cite"
+   this.target.graph.terms["chapter"] = "http://www.w3.org/1999/xhtml/vocab#chapter";
+   this.target.graph.terms["contents"] = "http://www.w3.org/1999/xhtml/vocab#contents";
+   this.target.graph.terms["copyright"] = "http://www.w3.org/1999/xhtml/vocab#copyright";
+   this.target.graph.terms["first"] = "http://www.w3.org/1999/xhtml/vocab#first";
+   this.target.graph.terms["glossary"] = "http://www.w3.org/1999/xhtml/vocab#glossary";
+   this.target.graph.terms["help"] = "http://www.w3.org/1999/xhtml/vocab#help";
+   this.target.graph.terms["icon"] = "http://www.w3.org/1999/xhtml/vocab#icon";
+   this.target.graph.terms["index"] = "http://www.w3.org/1999/xhtml/vocab#index";
+   this.target.graph.terms["last"] = "http://www.w3.org/1999/xhtml/vocab#last";
+   this.target.graph.terms["license"] = "http://www.w3.org/1999/xhtml/vocab#license";
+   this.target.graph.terms["meta"] = "http://www.w3.org/1999/xhtml/vocab#meta";
+   this.target.graph.terms["next"] = "http://www.w3.org/1999/xhtml/vocab#next";
+   this.target.graph.terms["prev"] = "http://www.w3.org/1999/xhtml/vocab#prev";
+   this.target.graph.terms["previous"] = "http://www.w3.org/1999/xhtml/vocab#previous";
+   this.target.graph.terms["section"] = "http://www.w3.org/1999/xhtml/vocab#section";
+   this.target.graph.terms["stylesheet"] = "http://www.w3.org/1999/xhtml/vocab#stylesheet";
+   this.target.graph.terms["subsection"] = "http://www.w3.org/1999/xhtml/vocab#subsection";
+   this.target.graph.terms["start"] = "http://www.w3.org/1999/xhtml/vocab#start";
+   this.target.graph.terms["top"] = "http://www.w3.org/1999/xhtml/vocab#top";
+   this.target.graph.terms["up"] = "http://www.w3.org/1999/xhtml/vocab#up";
+   this.target.graph.terms["p3pv1"] = "http://www.w3.org/1999/xhtml/vocab#p3pv1";
+
+   // other
+   this.target.graph.terms["related"] = "http://www.w3.org/1999/xhtml/vocab#related";
+   this.target.graph.terms["role"] = "http://www.w3.org/1999/xhtml/vocab#role";
+   this.target.graph.terms["transformation"] = "http://www.w3.org/1999/xhtml/vocab#transformation";
+}
+
+RDFaProcessor.prototype.init = function() {
+}
+
+RDFaProcessor.prototype.newSubjectOrigin = function(origin,subject) {
+}
+
+RDFaProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+}
+
+RDFaProcessor.dateTimeTypes = [
+   { pattern: /-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,
+     type: "http://www.w3.org/2001/XMLSchema#duration" },
+   { pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,
+     type: "http://www.w3.org/2001/XMLSchema#dateTime" },
+   { pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,
+     type: "http://www.w3.org/2001/XMLSchema#date" },
+   { pattern: /(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,
+     type: "http://www.w3.org/2001/XMLSchema#time" },
+   { pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,
+     type: "http://www.w3.org/2001/XMLSchema#gYearMonth" },
+   { pattern: /-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,
+     type: "http://www.w3.org/2001/XMLSchema#gYear" }
+];
+
+RDFaProcessor.deriveDateTimeType = function(value) {
+   for (var i=0; i<RDFaProcessor.dateTimeTypes.length; i++) {
+      //console.log("Checking "+value+" against "+RDFaProcessor.dateTimeTypes[i].type);
+      var matched = RDFaProcessor.dateTimeTypes[i].pattern.exec(value);
+      if (matched && matched[0].length==value.length) {
+         //console.log("Matched!");
+         return RDFaProcessor.dateTimeTypes[i].type;
+      }
+   }
+   return null;
+}
+
+RDFaProcessor.prototype.process = function(node,options) {
+
+   /*
+   if (!window.console) {
+      window.console = { log: function() {} };
+   }*/
+   if (node.nodeType==Node.DOCUMENT_NODE) {
+      node = node.documentElement;
+      this.setContext(node);
+   } else if (node.parentNode.nodeType==Node.DOCUMENT_NODE) {
+      this.setContext(node);
+   } 
+   var queue = [];
+   // Fix for Firefox that includes the hash in the base URI
+   var removeHash = function(baseURI) {
+      var hash = baseURI.indexOf("#");
+      if (hash>=0) {
+         baseURI = baseURI.substring(0,hash);
+      }
+      if (options && options.baseURIMap) {
+         baseURI = options.baseURIMap(baseURI);
+      }
+      return baseURI;
+   }
+   queue.push({ current: node, context: this.push(null,removeHash(node.baseURI))});
+   while (queue.length>0) {
+      var item = queue.shift();
+      if (item.parent) {
+         // Sequence Step 14: list triple generation
+         if (item.context.parent && item.context.parent.listMapping==item.listMapping) {
+            // Skip a child context with exactly the same mapping
+            continue;
+         }
+         //console.log("Generating lists for "+item.subject+", tag "+item.parent.localName);
+         for (var predicate in item.listMapping) {
+            var list = item.listMapping[predicate];
+            if (list.length==0) {
+               this.addTriple(item.parent,item.subject,predicate,{ type: RDFaProcessor.objectURI, value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" });
+               continue;
+            }
+            var bnodes = [];
+            for (var i=0; i<list.length; i++) {
+               bnodes.push(this.newBlankNode());
+               //this.newSubject(item.parent,bnodes[i]);
+            }
+            for (var i=0; i<bnodes.length; i++) {
+               this.addTriple(item.parent,bnodes[i],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",list[i]);
+               this.addTriple(item.parent,bnodes[i],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{ type: RDFaProcessor.objectURI , value: (i+1)<bnodes.length ? bnodes[i+1] : "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" });
+            }
+            this.addTriple(item.parent,item.subject,predicate,{ type: RDFaProcessor.objectURI, value: bnodes[0] });
+         }
+         continue;
+      }
+      var current = item.current;
+      var context = item.context;
+
+      //console.log("Tag: "+current.localName+", listMapping="+JSON.stringify(context.listMapping));
+
+      // Sequence Step 1
+      var skip = false;
+      var newSubject = null;
+      var currentObjectResource = null;
+      var typedResource = null;
+      var prefixes = context.prefixes;
+      var prefixesCopied = false;
+      var incomplete = [];
+      var listMapping = context.listMapping;
+      var listMappingDifferent = context.parent ? false : true;
+      var language = context.language;
+      var vocabulary = context.vocabulary;
+
+      // TODO: the "base" element may be used for HTML+RDFa 1.1
+      var base = this.parseURI(removeHash(current.baseURI));
+      current.item = null;
+
+      // Sequence Step 2: set the default vocabulary
+      var vocabAtt = current.getAttributeNode("vocab");
+      if (vocabAtt) {
+         var value = RDFaProcessor.trim(vocabAtt.value);
+         if (value.length>0) {
+            vocabulary = value;
+            var baseSubject = base.spec;
+            //this.newSubject(current,baseSubject);
+            this.addTriple(current,baseSubject,"http://www.w3.org/ns/rdfa#usesVocabulary",{ type: RDFaProcessor.objectURI , value: vocabulary});
+         } else {
+            vocabulary = this.vocabulary;
+         }
+      }
+
+      // Sequence Step 3: IRI mappings
+      // handle xmlns attributes
+      for (var i=0; i<current.attributes.length; i++) {
+         var att = current.attributes[i];
+         //if (att.namespaceURI=="http://www.w3.org/2000/xmlns/") {
+         if (att.nodeName.charAt(0)=="x" && att.nodeName.indexOf("xmlns:")==0) {
+            if (!prefixesCopied) {
+               prefixes = this.copyMappings(prefixes);
+               prefixesCopied = true;
+            }
+            var prefix = att.nodeName.substring(6);
+            // TODO: resolve relative?
+            var ref = RDFaProcessor.trim(att.value);
+            prefixes[prefix] = this.target.baseURI ? this.target.baseURI.resolve(ref) : ref;
+         }
+      }
+      // Handle prefix mappings (@prefix)
+      var prefixAtt = current.getAttributeNode("prefix");
+      if (prefixAtt) {
+         if (!prefixesCopied) {
+            prefixes = this.copyMappings(prefixes);
+            prefixesCopied = true;
+         }
+         this.parsePrefixMappings(prefixAtt.value,prefixes);
+      }
+
+
+      // Sequence Step 4: language
+      var xmlLangAtt = null;
+      for (var i=0; !xmlLangAtt && i<this.langAttributes.length; i++) {
+         xmlLangAtt = current.getAttributeNodeNS(this.langAttributes[i].namespaceURI,this.langAttributes[i].localName);
+      }
+      if (xmlLangAtt) {
+         var value = RDFaProcessor.trim(xmlLangAtt.value);
+         if (value.length>0) {
+            language = value;
+         } else {
+            language = null;
+         }
+      }
+
+      var relAtt = current.getAttributeNode("rel");
+      var revAtt = current.getAttributeNode("rev");
+      var typeofAtt = current.getAttributeNode("typeof");
+      var propertyAtt = current.getAttributeNode("property");
+      var datatypeAtt = current.getAttributeNode("datatype");
+      var datetimeAtt = this.inHTMLMode ? current.getAttributeNode("datetime") : null;
+      var contentAtt = current.getAttributeNode("content");
+      var aboutAtt = current.getAttributeNode("about");
+      var srcAtt = current.getAttributeNode("src");
+      var resourceAtt = current.getAttributeNode("resource");
+      var hrefAtt = current.getAttributeNode("href");
+      var inlistAtt = current.getAttributeNode("inlist");
+      
+      var relAttPredicates = [];
+      if (relAtt) {
+         var values = this.tokenize(relAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var predicate = this.parsePredicate(values[i],vocabulary,context.terms,prefixes,base,this.inHTMLMode && propertyAtt!=null);
+            if (predicate) {
+               relAttPredicates.push(predicate);
+            }
+         }
+      }
+      var revAttPredicates = [];
+      if (revAtt) {
+         var values = this.tokenize(revAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var predicate = this.parsePredicate(values[i],vocabulary,context.terms,prefixes,base,this.inHTMLMode && propertyAtt!=null);
+            if (predicate) {
+               revAttPredicates.push(predicate);
+            }
+         }
+      }
+      
+      // Section 3.1, bullet 7
+      if (this.inHTMLMode && (relAtt!=null || revAtt!=null) && propertyAtt!=null) {
+         if (relAttPredicates.length==0) {
+            relAtt = null;
+         }
+         if (revAttPredicates.length==0) {
+            revAtt = null;
+         }
+      }
+
+      if (relAtt || revAtt) {
+         // Sequence Step 6: establish new subject and value
+         if (aboutAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value,prefixes,base);
+         }
+         if (typeofAtt) {
+            typedResource = newSubject;
+         }
+         if (!newSubject) {
+            if (current.parentNode.nodeType==Node.DOCUMENT_NODE) {
+               newSubject = removeHash(current.baseURI);
+            } else if (context.parentObject) {
+               // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
+               newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+            }
+         }
+         if (resourceAtt) {
+            currentObjectResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+         }
+         
+         if (!currentObjectResource) {
+            if (hrefAtt) {
+               currentObjectResource = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+            } else if (srcAtt) {
+               currentObjectResource = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+            } else if (typeofAtt && !aboutAtt && !(this.inXHTMLMode && (current.localName=="head" || current.localName=="body"))) {
+               currentObjectResource = this.newBlankNode();
+            }
+         }
+         if (typeofAtt && !aboutAtt && this.inXHTMLMode && (current.localName=="head" || current.localName=="body")) {
+            typedResource = newSubject;
+         } else if (typeofAtt && !aboutAtt) {
+            typedResource = currentObjectResource;
+         }
+
+      } else if (propertyAtt && !contentAtt && !datatypeAtt) {
+         // Sequence Step 5.1: establish a new subject
+         if (aboutAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value,prefixes,base);
+            if (typeofAtt) {
+               typedResource = newSubject;
+            }
+         }
+         if (!newSubject && current.parentNode.nodeType==Node.DOCUMENT_NODE) {
+            newSubject = removeHash(current.baseURI);
+            if (typeofAtt) {
+               typedResource = newSubject;
+            }
+         } else if (!newSubject && context.parentObject) {
+            // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
+            newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+         }
+         if (typeofAtt && !typedResource) {
+            if (resourceAtt) {
+               typedResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+            }
+            if (!typedResource &&hrefAtt) {
+               typedResource = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+            }
+            if (!typedResource && srcAtt) {
+               typedResource = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+            }
+            if (!typedResource && (this.inXHTMLMode || this.inHTMLMode) && (current.localName=="head" || current.localName=="body")) {
+               typedResource = newSubject;
+            }
+            if (!typedResource) {
+               typedResource = this.newBlankNode();
+            }
+            currentObjectResource = typedResource;
+         }
+         //console.log(current.localName+", newSubject="+newSubject+", typedResource="+typedResource+", currentObjectResource="+currentObjectResource);
+      } else {
+         // Sequence Step 5.2: establish a new subject
+         if (aboutAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value,prefixes,base);
+         }
+         if (!newSubject && resourceAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+         }
+         if (!newSubject && hrefAtt) {
+            newSubject = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+         }
+         if (!newSubject && srcAtt) {
+            newSubject = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+         }
+         if (!newSubject) {
+            if (current.parentNode.nodeType==Node.DOCUMENT_NODE) {
+               newSubject = removeHash(current.baseURI);
+            } else if ((this.inXHTMLMode || this.inHTMLMode) && (current.localName=="head" || current.localName=="body")) {
+               newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+            } else if (typeofAtt) {
+               newSubject = this.newBlankNode();
+            } else if (context.parentObject) {
+               // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
+               newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+               if (!propertyAtt) {
+                  skip = true;
+               }
+            }
+         }
+         if (typeofAtt) {
+            typedResource = newSubject;
+         }
+      }
+
+      //console.log(current.tagName+": newSubject="+newSubject+", currentObjectResource="+currentObjectResource+", typedResource="+typedResource+", skip="+skip);
+
+      var rdfaData = null;
+      if (newSubject) {
+         //this.newSubject(current,newSubject);
+         if (aboutAtt || resourceAtt || typedResource) {
+            var id = newSubject;
+            if (typeofAtt && !aboutAtt && !resourceAtt && currentObjectResource) {
+               id = currentObjectResource;
+            }
+            //console.log("Setting data attribute for "+current.localName+" for subject "+id);
+            this.newSubjectOrigin(current,id);
+         }
+      }
+      
+      // Sequence Step 7: generate type triple
+      if (typedResource) {
+         var values = this.tokenize(typeofAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var object = this.parseTermOrCURIEOrAbsURI(values[i],vocabulary,context.terms,prefixes,base);
+            if (object) {
+               this.addTriple(current,typedResource,RDFaProcessor.typeURI,{ type: RDFaProcessor.objectURI , value: object});
+            }
+         }
+      }
+
+      // Sequence Step 8: new list mappings if there is a new subject
+      //console.log("Step 8: newSubject="+newSubject+", context.parentObject="+context.parentObject);
+      if (newSubject && newSubject!=context.parentObject) {
+         //console.log("Generating new list mapping for "+newSubject);
+         listMapping = {};
+         listMappingDifferent = true;
+      }
+
+      // Sequence Step 9: generate object triple
+      if (currentObjectResource) {
+         if (relAtt && inlistAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               var list = listMapping[relAttPredicates[i]];
+               if (!list) {
+                  list = [];
+                  listMapping[relAttPredicates[i]] = list;
+               }
+               list.push({ type: RDFaProcessor.objectURI, value: currentObjectResource });
+            }
+         } else if (relAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               this.addTriple(current,newSubject,relAttPredicates[i],{ type: RDFaProcessor.objectURI, value: currentObjectResource});
+            }
+         }
+         if (revAtt) {
+            for (var i=0; i<revAttPredicates.length; i++) {
+               this.addTriple(current,currentObjectResource, revAttPredicates[i], { type: RDFaProcessor.objectURI, value: newSubject});
+            }
+         }
+      } else {
+         // Sequence Step 10: incomplete triples
+         if (newSubject && !currentObjectResource && (relAtt || revAtt)) {
+            currentObjectResource = this.newBlankNode();
+            //alert(current.tagName+": generated blank node, newSubject="+newSubject+" currentObjectResource="+currentObjectResource);
+         }
+         if (relAtt && inlistAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               var list = listMapping[relAttPredicates[i]];
+               if (!list) {
+                  list = [];
+                  listMapping[predicate] = list;
+               }
+               //console.log("Adding incomplete list for "+predicate);
+               incomplete.push({ predicate: relAttPredicates[i], list: list });
+            }
+         } else if (relAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               incomplete.push({ predicate: relAttPredicates[i], forward: true });
+            }
+         }
+         if (revAtt) {
+            for (var i=0; i<revAttPredicates.length; i++) {
+               incomplete.push({ predicate: revAttPredicates[i], forward: false });
+            }
+         }
+      }
+
+      // Step 11: Current property values
+      if (propertyAtt) {
+         var datatype = null;
+         var content = null; 
+         if (datatypeAtt) {
+            datatype = datatypeAtt.value=="" ? RDFaProcessor.PlainLiteralURI : this.parseTermOrCURIEOrAbsURI(datatypeAtt.value,vocabulary,context.terms,prefixes,base);
+            if (datetimeAtt && !contentAtt) {
+               content = datetimeAtt.value;
+            } else {
+               content = datatype==RDFaProcessor.XMLLiteralURI || datatype==RDFaProcessor.HTMLLiteralURI ? null : (contentAtt ? contentAtt.value : current.textContent);
+            }
+         } else if (contentAtt) {
+            datatype = RDFaProcessor.PlainLiteralURI;
+            content = contentAtt.value;
+         } else if (datetimeAtt) {
+            content = datetimeAtt.value;
+            datatype = RDFaProcessor.deriveDateTimeType(content);
+            if (!datatype) {
+               datatype = RDFaProcessor.PlainLiteralURI;
+            }
+         } else if (!relAtt && !revAtt) {
+            if (resourceAtt) {
+               content = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+            }
+            if (!content && hrefAtt) {
+               content = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+            } else if (!content && srcAtt) {
+               content = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+            }
+            if (content) {
+               datatype = RDFaProcessor.objectURI;
+            }
+         }
+         if (!datatype) {
+            if (typeofAtt && !aboutAtt) {
+               datatype = RDFaProcessor.objectURI;
+               content = typedResource;
+            } else {
+               content = current.textContent;
+               if (this.inHTMLMode && current.localName=="time") {
+                  datatype = RDFaProcessor.deriveDateTimeType(content);
+               }
+               if (!datatype) {
+                  datatype = RDFaProcessor.PlainLiteralURI;
+               }
+            }
+         }
+         var values = this.tokenize(propertyAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var predicate = this.parsePredicate(values[i],vocabulary,context.terms,prefixes,base);
+            if (predicate) {
+               if (inlistAtt) {
+                  var list = listMapping[predicate];
+                  if (!list) {
+                     list = [];
+                     listMapping[predicate] = list;
+                  }
+                  list.push((datatype==RDFaProcessor.XMLLiteralURI || datatype==RDFaProcessor.HTMLLiteralURI) ? { type: datatype, value: current.childNodes} : { type: datatype ? datatype : RDFaProcessor.PlainLiteralURI, value: content, language: language});
+               } else {
+                  if (datatype==RDFaProcessor.XMLLiteralURI || datatype==RDFaProcessor.HTMLLiteralURI) {
+                     this.addTriple(current,newSubject,predicate,{ type: datatype, value: current.childNodes});
+                  } else {
+                     this.addTriple(current,newSubject,predicate,{ type: datatype ? datatype : RDFaProcessor.PlainLiteralURI, value: content, language: language});
+                     //console.log(newSubject+" "+predicate+"="+content);
+                  }
+               }
+            }
+         }
+      }
+
+      // Sequence Step 12: complete incomplete triples with new subject
+      if (newSubject && !skip) {
+         for (var i=0; i<context.incomplete.length; i++) {
+            if (context.incomplete[i].list) {
+               //console.log("Adding subject "+newSubject+" to list for "+context.incomplete[i].predicate);
+               // TODO: it is unclear what to do here
+               context.incomplete[i].list.push({ type: RDFaProcessor.objectURI, value: newSubject });
+            } else if (context.incomplete[i].forward) {
+               //console.log(current.tagName+": completing forward triple "+context.incomplete[i].predicate+" with object="+newSubject);
+               this.addTriple(current,context.subject,context.incomplete[i].predicate, { type: RDFaProcessor.objectURI, value: newSubject});
+            } else {
+               //console.log(current.tagName+": completing reverse triple with object="+context.subject);
+               this.addTriple(current,newSubject,context.incomplete[i].predicate,{ type: RDFaProcessor.objectURI, value: context.subject});
+            }
+         }
+      }
+
+      var childContext = null;
+      var listSubject = newSubject;
+      if (skip) {
+         // TODO: should subject be null?
+         childContext = this.push(context,context.subject);
+         // TODO: should the entObject be passed along?  If not, then intermediary children will keep properties from being associated with incomplete triples.
+         // TODO: Verify: if the current baseURI has changed and the parentObject is the parent's base URI, then the baseURI should change
+         childContext.parentObject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+         childContext.incomplete = context.incomplete;
+         childContext.language = language;
+         childContext.prefixes = prefixes;
+         childContext.vocabulary = vocabulary;
+      } else {
+         childContext = this.push(context,newSubject);
+         childContext.parentObject = currentObjectResource ? currentObjectResource : (newSubject ? newSubject : context.subject);
+         childContext.prefixes = prefixes;
+         childContext.incomplete = incomplete;
+         if (currentObjectResource) {
+            //console.log("Generating new list mapping for "+currentObjectResource);
+            listSubject = currentObjectResource;
+            listMapping = {};
+            listMappingDifferent = true;
+         }
+         childContext.listMapping = listMapping;
+         childContext.language = language;
+         childContext.vocabulary = vocabulary;
+      }
+      if (listMappingDifferent) {
+         //console.log("Pushing list parent "+current.localName);
+         queue.unshift({ parent: current, context: context, subject: listSubject, listMapping: listMapping});
+      }
+      for (var child = current.lastChild; child; child = child.previousSibling) {
+         if (child.nodeType==Node.ELEMENT_NODE) {
+            //console.log("Pushing child "+child.localName);
+            queue.unshift({ current: child, context: childContext});
+         }
+      }
+   }
+   
+   if (this.inHTMLMode) {
+      this.copyProperties();
+   }
+
+   for (var i=0; i<this.finishedHandlers.length; i++) {
+      this.finishedHandlers[i](node);
+   }
+}
+
+RDFaProcessor.prototype.copyProperties = function() {
+}
+
+
+RDFaProcessor.prototype.push = function(parent,subject) {
+   return {
+      parent: parent,
+      subject: subject ? subject : (parent ? parent.subject : null),
+      parentObject: null,
+      incomplete: [],
+      listMapping: parent ? parent.listMapping : {},
+      language: parent ? parent.language : this.language,
+      prefixes: parent ? parent.prefixes : this.target.graph.prefixes,
+      terms: parent ? parent.terms : this.target.graph.terms,
+      vocabulary: parent ? parent.vocabulary : this.vocabulary
+   };
+};
+
+function RDFaGraph()
+{
+   var dataContext = this;
+   this.curieParser = {
+      trim: function(str) {
+         return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+      },
+      parse: function(value,resolve) {
+         value = this.trim(value);
+         if (value.charAt(0)=='[' && value.charAt(value.length-1)==']') {
+            value = value.substring(1,value.length-1);
+         }
+         var colon = value.indexOf(":");
+         if (colon>=0) {
+            var prefix = value.substring(0,colon);
+            if (prefix=="") {
+               // default prefix
+               var uri = dataContext.prefixes[""];
+               return uri ? uri+value.substring(colon+1) : null;
+            } else if (prefix=="_") {
+               // blank node
+               return "_:"+value.substring(colon+1);
+            } else if (DocumentData.NCNAME.test(prefix)) {
+               var uri = dataContext.prefixes[prefix];
+               if (uri) {
+                  return uri+value.substring(colon+1);
+               }
+            }
+         }
+
+         return resolve ? dataContext.baseURI.resolve(value) : value;
+      }
+   };
+   this.base =  null;
+   this.toString = function(requestOptions) {
+      var options = requestOptions && requestOptions.shorten ? { graph: this, shorten: true, prefixesUsed: {} } : null;
+      if (requestOptions && requestOptions.blankNodePrefix) {
+         options.filterBlankNode = function(id) {
+            return "_:"+requestOptions.blankNodePrefix+id.substring(2);
+         }
+      }
+      if (requestOptions && requestOptions.numericalBlankNodePrefix) {
+         var onlyNumbers = /^[0-9]+$/;
+         options.filterBlankNode = function(id) {
+            var label = id.substring(2);
+            return onlyNumbers.test(label) ? "_:"+requestOptions.numericalBlankNodePrefix+label : id;
+         }
+      }
+      s = "";
+      for (var subject in this.subjects) {
+         var snode = this.subjects[subject];
+         s += snode.toString(options);
+         s += "\n";
+      }
+      var prolog = requestOptions && requestOptions.baseURI ? "@base <"+baseURI+"> .\n" : "";
+      if (options && options.shorten) {
+         for (var prefix in options.prefixesUsed) {
+            prolog += "@prefix "+prefix+": <"+this.prefixes[prefix]+"> .\n";
+         }
+      }
+      return prolog.length==0 ? s : prolog+"\n"+s;
+   };
+   this.blankNodeCounter = 0;
+   this.clear = function() {
+      this.subjects = {};
+      this.prefixes = {};
+      this.terms = {};
+      this.blankNodeCounter = 0;
+   }
+   this.clear();
+   this.prefixes[""] = "http://www.w3.org/1999/xhtml/vocab#";
+
+   // w3c
+   this.prefixes["grddl"] = "http://www.w3.org/2003/g/data-view#";
+   this.prefixes["ma"] = "http://www.w3.org/ns/ma-ont#";
+   this.prefixes["owl"] = "http://www.w3.org/2002/07/owl#";
+   this.prefixes["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   this.prefixes["rdfa"] = "http://www.w3.org/ns/rdfa#";
+   this.prefixes["rdfs"] = "http://www.w3.org/2000/01/rdf-schema#";
+   this.prefixes["rif"] = "http://www.w3.org/2007/rif#";
+   this.prefixes["skos"] = "http://www.w3.org/2004/02/skos/core#";
+   this.prefixes["skosxl"] = "http://www.w3.org/2008/05/skos-xl#";
+   this.prefixes["wdr"] = "http://www.w3.org/2007/05/powder#";
+   this.prefixes["void"] = "http://rdfs.org/ns/void#";
+   this.prefixes["wdrs"] = "http://www.w3.org/2007/05/powder-s#";
+   this.prefixes["xhv"] = "http://www.w3.org/1999/xhtml/vocab#";
+   this.prefixes["xml"] = "http://www.w3.org/XML/1998/namespace";
+   this.prefixes["xsd"] = "http://www.w3.org/2001/XMLSchema#";
+   // non-rec w3c
+   this.prefixes["sd"] = "http://www.w3.org/ns/sparql-service-description#";
+   this.prefixes["org"] = "http://www.w3.org/ns/org#";
+   this.prefixes["gldp"] = "http://www.w3.org/ns/people#";
+   this.prefixes["cnt"] = "http://www.w3.org/2008/content#";
+   this.prefixes["dcat"] = "http://www.w3.org/ns/dcat#";
+   this.prefixes["earl"] = "http://www.w3.org/ns/earl#";
+   this.prefixes["ht"] = "http://www.w3.org/2006/http#";
+   this.prefixes["ptr"] = "http://www.w3.org/2009/pointers#";
+   // widely used
+   this.prefixes["cc"] = "http://creativecommons.org/ns#";
+   this.prefixes["ctag"] = "http://commontag.org/ns#";
+   this.prefixes["dc"] = "http://purl.org/dc/terms/";
+   this.prefixes["dcterms"] = "http://purl.org/dc/terms/";
+   this.prefixes["foaf"] = "http://xmlns.com/foaf/0.1/";
+   this.prefixes["gr"] = "http://purl.org/goodrelations/v1#";
+   this.prefixes["ical"] = "http://www.w3.org/2002/12/cal/icaltzd#";
+   this.prefixes["og"] = "http://ogp.me/ns#";
+   this.prefixes["rev"] = "http://purl.org/stuff/rev#";
+   this.prefixes["sioc"] = "http://rdfs.org/sioc/ns#";
+   this.prefixes["v"] = "http://rdf.data-vocabulary.org/#";
+   this.prefixes["vcard"] = "http://www.w3.org/2006/vcard/ns#";
+   this.prefixes["schema"] = "http://schema.org/";
+   
+   // terms
+   this.terms["describedby"] = "http://www.w3.org/2007/05/powder-s#describedby";
+   this.terms["license"] = "http://www.w3.org/1999/xhtml/vocab#license";
+   this.terms["role"] = "http://www.w3.org/1999/xhtml/vocab#role";
+
+   Object.defineProperty(this,"tripleCount",{
+      enumerable: true,
+      configurable: false,
+      get: function() {
+         var count = 0;
+         for (var s in this.subjects) {
+            var snode = this.subjects[s];
+            for (var p in snode.predicates) {
+               count += snode.predicates[p].objects.length;
+            }
+         }
+         return count;
+      }
+   });
+}
+
+RDFaGraph.prototype.newBlankNode = function() {
+   this.blankNodeCounter++;
+   return "_:"+this.blankNodeCounter;
+}
+
+RDFaGraph.prototype.expand = function(curie) {
+   return this.curieParser.parse(curie,true);  
+}
+
+RDFaGraph.prototype.shorten = function(uri,prefixesUsed) {
+   for (prefix in this.prefixes) {
+      var mapped = this.prefixes[prefix];
+      if (uri.indexOf(mapped)==0) {
+         if (prefixesUsed) {
+            prefixesUsed[prefix] = mapped;
+         }
+         return prefix+":"+uri.substring(mapped.length);
+      }
+   }
+   return null;
+}
+
+RDFaGraph.prototype.add = function(subject,predicate,object,options) {
+   if (!subject || !predicate || !object) {
+      return;
+   }
+   subject = this.expand(subject);
+   predicate = this.expand(predicate);
+   var snode = this.subjects[subject];
+   if (!snode) {
+      snode = new RDFaSubject(this,subject);
+      this.subjects[subject] = snode;
+   }
+   if (options && options.origin) {
+      snode.origins.push(options.origin);
+   }
+   if (predicate=="http://www.w3.org/1999/02/22-rdf-syntax-ns#type") {
+      snode.types.push(object);
+   }
+   var pnode = snode.predicates[predicate];
+   if (!pnode) {
+      pnode = new RDFaPredicate(predicate);
+      snode.predicates[predicate] = pnode;
+   }
+   
+   if (typeof object == "string") {
+      pnode.objects.push({
+         type: RDFaProcessor.PlainLiteralURI,
+         value: object
+      });
+   } else {
+      pnode.objects.push({
+         type: object.type ? this.expand(object.type) : RDFaProcessor.PlainLiteralURI,
+         value: object.value ? object.value : "",
+         origin: object.origin,
+         language: object.language
+      });
+   }
+   
+}
+
+RDFaGraph.prototype.addCollection = function(subject,predicate,objectList,options) {
+   if (!subject || !predicate || !objectList) {
+      return;
+   }
+   
+   var lastSubject = subject;
+   var lastPredicate = predicate;
+   for (var i=0; i<objectList.length; i++) {
+      var object = { type: options && options.type ? options.type : "rdf:PlainLiteral"};
+      if (options && options.language) {
+         object.language = options.language;
+      }
+      if (options && options.datatype) {
+         object.datatype = options.datatype;
+      }
+      if (typeof objectList[i] == "object") {
+         object.value = objectList[i].value ?  objectList[i].value : "";
+         if (objectList[i].type) {
+            object.type = objectList[i].type;
+         }
+         if (objectList[i].language) {
+            object.language = objectList[i].language;
+         }
+         if (objectList[i].datatype) {
+            object.datatype = objectList[i].datatype;
+         }
+      } else {
+         object.value = objectList[i]
+      }
+      var bnode = this.newBlankNode();
+      this.add(lastSubject,lastPredicate,{ type: "rdf:object", value: bnode});
+      this.add(bnode,"rdf:first",object);
+      lastSubject = bnode;
+      lastPredicate = "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";
+   }
+   this.add(lastSubject,lastPredicate,{ type: "rdf:object", value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});
+}
+
+RDFaGraph.prototype.remove = function(subject,predicate) {
+   if (!subject) {
+      this.subjects = {};
+      return;
+   }
+   subject = this.expand(subject);
+   var snode = this.subjects[snode];
+   if (!snode) {
+      return;
+   }
+   if (!predicate) {
+      delete this.subjects[subject];
+      return;
+   }
+   predicate = this.expand(predicate);
+   delete snode.predicates[predicate];
+}
+
+function RDFaSubject(graph,subject) {
+   this.graph = graph;
+   // TODO: subject or id?
+   this.subject = subject
+   this.id = subject;
+   this.predicates =  {};
+   this.origins = [];
+   this.types = [];
+}
+
+RDFaSubject.prototype.toString = function(options) {
+   var s = null;
+   if (this.subject.substring(0,2)=="_:") {
+      if (options && options.filterBlankNode) {
+         s = options.filterBlankNode(this.subject);
+      } else {
+         s = this.subject;
+      }
+   } else if (options && options.shorten) {
+      s = this.graph.shorten(this.subject,options.prefixesUsed);
+      if (!s) {
+         s = "<" + this.subject + ">";
+      }
+   } else {
+      s = "<" + this.subject + ">";
+   }
+   var first = true;
+   for (var predicate in this.predicates) {
+      if (!first) {
+         s += ";\n";
+      } else {
+         first = false;
+      }
+      s += " " + this.predicates[predicate].toString(options);
+   }
+   s += " .";
+   return s;
+}
+
+RDFaSubject.prototype.toObject = function() {
+   var o = { subject: this.subject, predicates: {} };
+   for (var predicate in this.predicates) {
+      var pnode = this.predicates[predicate];
+      var p = { predicate: predicate, objects: [] };
+      o.predicates[predicate] = p;
+      for (var i=0; i<pnode.objects.length; i++) {
+         var object = pnode.objects[i];
+         if (object.type==RDFaProcessor.XMLLiteralURI) {
+            var serializer = new XMLSerializer();
+            var value = "";
+            for (var x=0; x<object.value.length; x++) {
+               if (object.value[x].nodeType==Node.ELEMENT_NODE) {
+                  value += serializer.serializeToString(object.value[x]);
+               } else if (object.value[x].nodeType==Node.TEXT_NODE) {
+                  value += object.value[x].nodeValue;
+               }
+            } 
+            p.objects.push({ type: object.type, value: value, language: object.language });
+         } else {
+            p.objects.push({ type: object.type, value: object.value, language: object.language });
+         }
+      }
+   }
+   return o;
+   
+}
+
+RDFaSubject.prototype.getValues = function() {
+   var values = [];
+   for (var i=0; i<arguments.length; i++) {
+      var property = this.graph.curieParser.parse(arguments[i],true)
+      var pnode = this.predicates[property];
+      if (pnode) {
+         for (var j=0; j<pnode.objects.length; j++) {
+            values.push(pnode.objects[j].value);
+         }
+      }
+   }
+   return values;
+}
+
+function RDFaPredicate(predicate) {
+   this.id = predicate;
+   this.predicate = predicate;
+   this.objects = [];
+}
+
+RDFaPredicate.getPrefixMap = function(e) {
+   var prefixMap = {};
+   while (e.attributes) {
+      for (var i=0; i<e.attributes.length; i++) {
+         if (e.attributes[i].namespaceURI=="http://www.w3.org/2000/xmlns/") {
+            var prefix = e.attributes[i].localName;
+            if (e.attributes[i].localName=="xmlns") {
+               prefix = "";
+            }
+            if (!(prefix in prefixMap)) {
+               prefixMap[prefix] = e.attributes[i].nodeValue;
+            }
+         }
+      }
+      e = e.parentNode;
+   }
+   return prefixMap;
+}
+
+RDFaPredicate.prototype.toString = function(options) {
+   var s = null;
+   if (options && options.shorten && options.graph) {
+      s = options.graph.shorten(this.predicate,options.prefixesUsed);
+      if (!s) {
+         s = "<" + this.predicate + ">"
+      }
+   } else {
+      s = "<" + this.predicate + ">"
+   }
+   s += " ";
+   for (var i=0; i<this.objects.length; i++) {
+      if (i>0) {
+         s += ", ";
+      }
+      // TODO: handle HTML literal
+      if (this.objects[i].type=="http://www.w3.org/1999/02/22-rdf-syntax-ns#object") {
+         if (this.objects[i].value.substring(0,2)=="_:") {
+            if (options && options.filterBlankNode) {
+               s += options.filterBlankNode(this.objects[i].value);
+            } else {
+               s += this.objects[i].value;
+            }
+         } else if (options && options.shorten && options.graph) {
+            u = options.graph.shorten(this.objects[i].value,options.prefixesUsed);
+            if (u) {
+               s += u;
+            } else {
+               s += "<" + this.objects[i].value + ">";
+            }
+         } else {
+            s += "<" + this.objects[i].value + ">";
+         }
+      } else if (this.objects[i].type=="http://www.w3.org/2001/XMLSchema#integer" ||
+                 this.objects[i].type=="http://www.w3.org/2001/XMLSchema#decimal" ||
+                 this.objects[i].type=="http://www.w3.org/2001/XMLSchema#double" ||
+                 this.objects[i].type=="http://www.w3.org/2001/XMLSchema#boolean") {
+         s += this.objects[i].value;
+      } else if (this.objects[i].type=="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") {
+         var serializer = new XMLSerializer();
+         var value = "";
+         for (var x=0; x<this.objects[i].value.length; x++) {
+            if (this.objects[i].value[x].nodeType==Node.ELEMENT_NODE) {
+               var prefixMap = RDFaPredicate.getPrefixMap(this.objects[i].value[x]);
+               var prefixes = [];
+               for (var prefix in prefixMap) {
+                  prefixes.push(prefix);
+               }
+               prefixes.sort();
+               var e = this.objects[i].value[x].cloneNode(true);
+               for (var p=0; p<prefixes.length; p++) {
+                  e.setAttributeNS("http://www.w3.org/2000/xmlns/",prefixes[p].length==0 ? "xmlns" : "xmlns:"+prefixes[p],prefixMap[prefixes[p]]);
+               }
+               value += serializer.serializeToString(e);
+            } else if (this.objects[i].value[x].nodeType==Node.TEXT_NODE) {
+               value += this.objects[i].value[x].nodeValue;
+            }
+         }
+         s += '"""'+value.replace(/"""/,"\\\"\\\"\\\"")+'"""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>';
+      } else {
+         var l = this.objects[i].value;
+         if (l.indexOf("\n")>=0 || l.indexOf("\r")>=0) {
+            s += '"""' + l.replace(/"""/,"\\\"\\\"\\\"") + '"""';
+         } else {
+            s += '"' + l.replace(/"/,"\\\"") + '"';
+         }
+         if (this.objects[i].type!="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral") {
+             s += "^^<"+this.objects[i].type+">";
+         } else if (this.objects[i].language) {
+             s += "@"+this.objects[i].language;
+         }
+      }
+   }
+   return s;
+}
+GraphRDFaProcessor.prototype = new RDFaProcessor();
+GraphRDFaProcessor.prototype.constructor=RDFaProcessor;
+function GraphRDFaProcessor(target) {
+   RDFaProcessor.call(this,target);
+}
+
+GraphRDFaProcessor.prototype.getObjectSize = function(obj) {
+   var size = 0;
+   for (var key in obj) {
+      if (obj.hasOwnProperty(key)) {
+         size++;
+      }
+   }
+   return size;
+};
+
+
+GraphRDFaProcessor.prototype.init = function() {
+   var thisObj = this;
+   this.finishedHandlers.push(function(node) {
+      for (var subject in thisObj.target.graph.subjects) {
+         var snode = thisObj.target.graph.subjects[subject];
+         if (thisObj.getObjectSize(snode.predicates)==0) {
+            delete thisObj.target.graph.subjects[subject];
+         }
+      }
+   });
+}
+GraphRDFaProcessor.prototype.newBlankNode = function() {
+   return this.target.graph.newBlankNode();
+}
+
+GraphRDFaProcessor.prototype.newSubjectOrigin = function(origin,subject) {
+   var snode = this.newSubject(null,subject);
+   for (var i=0; i<snode.origins.length; i++) {
+      if (snode.origins[i]===origin) {
+         return;
+      }
+   }
+   snode.origins.push(origin);
+   if (!origin.data) {
+      Object.defineProperty(origin,"data", {
+            value: snode,
+            writable: false,
+            configurable: true,
+            enumerable: true
+         });
+   }
+}
+
+GraphRDFaProcessor.prototype.newSubject = function(origin,subject) {
+   var snode = this.target.graph.subjects[subject];
+   if (!snode) {
+      snode = new RDFaSubject(this.target.graph,subject);
+      this.target.graph.subjects[subject] = snode;
+   }
+   return snode;
+}
+
+
+GraphRDFaProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+   var snode = this.newSubject(origin,subject);
+   var pnode = snode.predicates[predicate];
+   if (!pnode) {
+      pnode = new RDFaPredicate(predicate);
+      snode.predicates[predicate] = pnode;
+   }
+
+   for (var i=0; i<pnode.objects.length; i++) {
+      if (pnode.objects[i].type==object.type && pnode.objects[i].value==object.value) {
+         if (pnode.objects[i].origin!==origin) {
+            if (!Array.isArray(pnode.objects[i].origin)) {
+               var origins = [];
+               origins.push(pnode.objects[i].origin);
+               pnode.objects[i].origin = origins;
+            }
+            pnode.objects[i].origin.push(origin);
+         }
+         return;
+      }
+   }
+   pnode.objects.push(object);   
+   object.origin = origin;
+   if (predicate==RDFaProcessor.typeURI) {
+      snode.types.push(object.value);
+   }
+}
+
+GraphRDFaProcessor.rdfaCopyPredicate = "http://www.w3.org/ns/rdfa#copy";
+GraphRDFaProcessor.rdfaPatternType = "http://www.w3.org/ns/rdfa#Pattern";
+
+GraphRDFaProcessor.prototype.copyProperties = function() {
+   var copySubjects = [];
+   var patternSubjects = {};
+   for (var subject in this.target.graph.subjects) {
+      var snode = this.target.graph.subjects[subject];
+      var pnode = snode.predicates[GraphRDFaProcessor.rdfaCopyPredicate];
+      if (!pnode) {
+         continue;
+      }
+      copySubjects.push(subject);
+      for (var i=0; i<pnode.objects.length; i++) {
+         if (pnode.objects[i].type!=RDFaProcessor.objectURI) {
+            continue;
+         }
+         var target = pnode.objects[i].value;
+         var patternSubjectNode = this.target.graph.subjects[target];
+         if (!patternSubjectNode) {
+            continue;
+         }
+         var patternTypes = patternSubjectNode.predicates[RDFaProcessor.typeURI];
+         if (!patternTypes) {
+            continue;
+         }
+         var isPattern = false;
+         for (var j=0; j<patternTypes.objects.length && !isPattern; j++) {
+            if (patternTypes.objects[j].value==GraphRDFaProcessor.rdfaPatternType && 
+                patternTypes.objects[j].type==RDFaProcessor.objectURI) {
+               isPattern = true;
+            }
+         }
+         if (!isPattern) {
+            continue;
+         }
+         patternSubjects[target] = true;
+         for (var predicate in patternSubjectNode.predicates) {
+            var targetPNode = patternSubjectNode.predicates[predicate];
+            if (predicate==RDFaProcessor.typeURI) {
+               if (targetPNode.objects.length==1) {
+                  continue;
+               }
+               for (var j=0; j<targetPNode.objects.length; j++) {
+                  if (targetPNode.objects[j].value!=GraphRDFaProcessor.rdfaPatternType) {
+                      var subjectPNode = snode.predicates[predicate];
+                      if (!subjectPNode) {
+                         subjectPNode = new RDFaPredicate(predicate);
+                         snode.predicates[predicate] = subjectPNode;
+                      }
+                      subjectPNode.objects.push(
+                         { type: targetPNode.objects[j].type, 
+                           value: targetPNode.objects[j].value, 
+                           language: targetPNode.objects[j].language, 
+                           origin: targetPNode.objects[j].origin}
+                      );
+                      snode.types.push(targetPNode.objects[j].value);
+                  }
+               }
+            } else {
+               var subjectPNode = snode.predicates[predicate];
+               if (!subjectPNode) {
+                  subjectPNode = new RDFaPredicate(predicate);
+                  snode.predicates[predicate] = subjectPNode;
+               }
+               for (var j=0; j<targetPNode.objects.length; j++) {
+                   subjectPNode.objects.push(
+                      { type: targetPNode.objects[j].type, 
+                        value: targetPNode.objects[j].value, 
+                        language: targetPNode.objects[j].language, 
+                        origin: targetPNode.objects[j].origin}
+                   );
+               }
+            }
+         }
+      }
+   }
+   for (var i=0; i<copySubjects.length; i++) {
+      var snode = this.target.graph.subjects[copySubjects[i]];
+      delete snode.predicates[GraphRDFaProcessor.rdfaCopyPredicate];
+   }
+   for (var subject in patternSubjects) {
+      delete this.target.graph.subjects[subject];
+   }
+}
+


[47/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java
new file mode 100644
index 0000000..f3ac14e
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java
@@ -0,0 +1,266 @@
+/*
+ * 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.concepts.core;
+
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.clerezza.platform.concepts.ontologies.QUERYRESULT;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.OWL;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.ontologies.SKOS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * This JAX-RS resource can be used to search concepts accessible through
+ * registered {@link ConceptProvider}s. If no {@link LocalConceptProvider} is
+ * registered for {@link ConceptManipulator.FREE_CONCEPT_SCHEME}, then one is
+ * created to find free concepts in the content graph.
+ * Concept providers are prioritized.
+ * The URI, SKOS:prefLabel and RDFS:comment of a concept from a provider of a 
+ * higher priority will be used instead of those concepts having an OWL:sameAs
+ * relation with this concept, but from a provider of lower priority.
+ * Implicitly created {@link LocalConceptProvider} for free concepts has the
+ * lowest priority.
+ * 
+ * The URI path of this service is /concepts/find.
+ * 
+ * @author hasan
+ */
+@Component
+@Service(Object.class)
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("/concepts/find")
+public class ConceptsFinder {
+
+    @Reference
+    private RenderletManager renderletManager;
+
+    @Reference
+    protected ConceptProviderManager conceptProviderManager;
+
+    @Reference
+    private TcManager tcManager;
+
+    @Reference
+    private ContentGraphProvider cgProvider;
+
+    @Reference
+    private PlatformConfig platformConfig;
+
+    private LocalConceptProvider freeConceptProvider = null;
+
+    private UriRef freeConceptScheme = null;
+
+    protected void activate(ComponentContext context) throws URISyntaxException {
+        URL template = getClass().getResource("skos-collection-json.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(template.toURI().toString()),
+                SKOS.Collection, null,
+                MediaType.APPLICATION_JSON_TYPE, true);
+
+        freeConceptScheme =
+                new UriRef(platformConfig.getDefaultBaseUri().getUnicodeString()
+                + ConceptManipulator.FREE_CONCEPT_SCHEME);
+        freeConceptProvider = new LocalConceptProvider(tcManager, cgProvider,
+                freeConceptScheme);
+    }
+
+    /**
+     * Searches concepts for a specified search term. The actual search task
+     * is delegated to each {@link ConceptProvider} instance. The results from
+     * each {@link ConceptProvider} are merged into a single result graph.
+     * However, concepts from providers of lower priority are only considered if
+     * they are not staying in an OWL:sameAs relation with concepts from
+     * providers of higher priority.
+     * 
+     * @param searchTerm
+     *            The search term in form of a String.
+     * @return
+     *        A GraphNode containing the search results.
+     */
+    @GET
+    @Produces("application/rdf+json")
+    public GraphNode findConcepts(@QueryParam(value="searchTerm")
+            String searchTerm) {
+
+        boolean freeConceptProviderFound = false;
+
+        List<ConceptProvider> conceptProviderList = conceptProviderManager
+                .getConceptProviders();
+
+        MGraph resultMGraph = new SimpleMGraph();
+        GraphNode resultNode = new GraphNode(new BNode(), resultMGraph);
+        boolean first = true;
+        for (ConceptProvider cp : conceptProviderList) {
+            if (!freeConceptProviderFound) {
+                if (cp instanceof LocalConceptProvider) {
+                    if (((LocalConceptProvider) cp).getSelectedScheme().equals(
+                            freeConceptScheme)) {
+                        freeConceptProviderFound = true;
+                    }
+                }
+            }
+            retrieveConcepts(cp, first, resultNode, searchTerm);
+            if (first) {
+                first = false;
+            }
+        }
+        if (!freeConceptProviderFound && freeConceptProvider != null) {
+            retrieveConcepts(freeConceptProvider, first, resultNode, searchTerm);
+        }
+        addCreationOfNewFreeConceptSuggested(resultNode, searchTerm);
+        resultNode.addProperty(RDF.type, QUERYRESULT.QueryResult);
+        return resultNode;
+    }
+
+    /**
+     * Adds a boolean value that answers whether the UI shall suggest to create
+     * a new free concept. A new free concept may not be added if the has the
+     * same base uri and search term. Therefore the consumer shall be suggested
+     * not to propose creation.
+     * 
+     * @param resultNode
+     *            the result node to add the property to
+     * @param searchTerm
+     *            the search term the data was searched for
+     */
+    private void addCreationOfNewFreeConceptSuggested(GraphNode resultNode,
+            String searchTerm) {
+        UriRef conceptUriRef = ConceptManipulator.getConceptUriRef(
+                platformConfig, searchTerm);
+        resultNode.addProperty(QUERYRESULT.creationOfNewFreeConceptSuggested,
+                LiteralFactory.getInstance().createTypedLiteral(
+                        !cgProvider.getContentGraph().contains(
+                                new TripleImpl(conceptUriRef, RDF.type,
+                                        SKOS.Concept))));
+    }
+
+    /**
+     * Retrieve concepts for the given search term.
+     * 
+     * @param conceptProvider
+     *            the provider delivers concepts
+     * @param first
+     *            is this the first execution
+     * @param resultNode
+     *            the node to attach the concepts to
+     * @param searchTerm
+     *            the search term that the concepts have to match against
+     */
+    private void retrieveConcepts(ConceptProvider conceptProvider,
+            boolean first, GraphNode resultNode, String searchTerm) {
+        MGraph resultMGraph = (MGraph) resultNode.getGraph();
+        Graph graph = conceptProvider.retrieveConcepts(searchTerm);
+        Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
+        if (first) {
+            while (concepts.hasNext()) {
+                resultNode.addProperty(QUERYRESULT.concept, concepts.next()
+                        .getSubject());
+            }
+            resultMGraph.addAll(graph);
+        } else {
+            while (concepts.hasNext()) {
+                NonLiteral concept = concepts.next().getSubject();
+                GraphNode conceptGraphNode = new GraphNode(concept, graph);
+                Iterator<Resource> sameAsConcepts = conceptGraphNode
+                        .getObjects(OWL.sameAs);
+                if (!(hasSameAs(resultMGraph, concept) || hasAnyConcept(
+                        resultMGraph, sameAsConcepts))) {
+                    resultNode.addProperty(QUERYRESULT.concept, concept);
+                    addConceptToResultMGraph(resultMGraph, conceptGraphNode);
+                }
+
+            }
+        }
+    }
+
+    private boolean hasSameAs(MGraph graph, NonLiteral sameAsConcept) {
+        Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
+        while (concepts.hasNext()) {
+            NonLiteral concept = concepts.next().getSubject();
+            if (graph.filter(concept, OWL.sameAs, sameAsConcept).hasNext()) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean hasAnyConcept(MGraph graph, Iterator<Resource> concepts) {
+        while (concepts.hasNext()) {
+            NonLiteral concept = (NonLiteral) concepts.next();
+            if (graph.filter(concept, RDF.type, SKOS.Concept).hasNext()) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private void addConceptToResultMGraph(MGraph resultMGraph,
+            GraphNode graphNode) {
+        NonLiteral concept = (NonLiteral) graphNode.getNode();
+        resultMGraph.add(new TripleImpl(concept, RDF.type, SKOS.Concept));
+
+        Iterator<Literal> prefLabelStatements = graphNode.getLiterals(SKOS.prefLabel);
+        while (prefLabelStatements.hasNext()) {
+            resultMGraph.add(new TripleImpl(concept, SKOS.prefLabel,
+                    prefLabelStatements.next()));
+        }
+        Iterator<Literal> commentStatements = graphNode.getLiterals(RDFS.comment);
+        while (commentStatements.hasNext()) {
+            resultMGraph.add(new TripleImpl(concept, RDFS.comment,
+                    commentStatements.next()));
+        }
+        Iterator<UriRef> sameAsStatements = graphNode.getUriRefObjects(OWL.sameAs);
+        while (sameAsStatements.hasNext()) {
+            resultMGraph.add(new TripleImpl(concept, OWL.sameAs,
+                    sameAsStatements.next()));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java
new file mode 100644
index 0000000..e96069e
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java
@@ -0,0 +1,111 @@
+/*
+ * 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.concepts.core;
+
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.Response.Status;
+
+import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.clerezza.utils.UriException;
+import org.apache.clerezza.web.fileserver.FileServer;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * This JAX-RS resource can be used to show selected concepts of a resource.
+ * The URI path of this service is /concepts/generic-resource.
+ * 
+ * @author tio
+ */
+@Component
+@Service(Object.class)
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("/concepts/generic-resource")
+public class GenericResourcePage extends FileServer {
+
+    @Reference
+    protected ContentGraphProvider cgProvider;
+    @Reference
+    private RenderletManager renderletManager;
+
+    private RemoteConceptsDescriptionManager remoteConceptsDescriptionManager = null;
+
+    protected void activate(ComponentContext context)
+            throws URISyntaxException {
+        
+        configure(context.getBundleContext());
+        
+        URL template = getClass().getResource("generic-resource-page.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(template.toURI().toString()),
+                CONCEPTS.GenericResourcePage, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        remoteConceptsDescriptionManager = new RemoteConceptsDescriptionManager();
+    }
+
+    /**
+     * Retrieves a resource and its associated concepts to be rendered with a template
+     * registered for CONCEPTS.GenericResourcePage.
+     * 
+     * @param uri specifies the uri of a resource
+     * 
+     * @return GraphNode
+     */
+    @GET
+    public GraphNode GenericResourcePage(@QueryParam("uri") UriRef uri,
+            @Context UriInfo uriInfo) {
+
+        GraphNode node = new GraphNode(new BNode(), new UnionMGraph(new SimpleMGraph(),
+                cgProvider.getContentGraph(),
+                remoteConceptsDescriptionManager.getRemoteConceptsDescriptionMGraph()));
+        node.addProperty(RDF.type, PLATFORM.HeadedPage);
+        node.addProperty(RDF.type, CONCEPTS.GenericResourcePage);
+        if (uri != null) {
+            node.addProperty(CONCEPTS.resource, uri);
+        } else {
+            throw new WebApplicationException(Response.status(Status.BAD_REQUEST)
+                    .entity("No resource uri defined.").build());
+        }
+        return node;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java
new file mode 100644
index 0000000..4b96110
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java
@@ -0,0 +1,90 @@
+/*
+ * 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.concepts.core;
+
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.sparql.ParseException;
+import org.apache.clerezza.rdf.core.sparql.QueryParser;
+import org.apache.clerezza.rdf.core.sparql.query.ConstructQuery;
+
+/**
+ * This {@link ConceptProvider} operates on concepts available in the localhost.
+ *
+ * @author tio, hasan
+ */
+public class LocalConceptProvider implements ConceptProvider {
+
+    private TcManager tcManager = null;
+    private ContentGraphProvider contentGraphProvider = null;
+    private UriRef selectedScheme = null;
+
+    /**
+     * Constructs a {@link LocalConceptProvider} with the specified parameters.
+     *
+     * @param tcManager
+     *        Reference to the {@link TcManager}
+     * @param contentGraphProvider
+     *        Reference to a {@link ContentGraphProvider}
+     * @param selectedScheme
+     *        The scheme in which concepts are to be searched.
+     */
+    public LocalConceptProvider(TcManager tcManager,
+            ContentGraphProvider contentGraphProvider, UriRef selectedScheme) {
+        this.tcManager = tcManager;
+        this.contentGraphProvider = contentGraphProvider;
+        this.selectedScheme = selectedScheme;
+    }
+
+    public UriRef getSelectedScheme() {
+        return this.selectedScheme;
+    }
+
+    @Override
+    public Graph retrieveConcepts(String searchTerm) {
+        QueryParser queryParser = QueryParser.getInstance();
+
+        String query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
+                "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " +
+                "PREFIX skos: <http://www.w3.org/2008/05/skos#> " +
+                "CONSTRUCT {?concept a skos:Concept; skos:prefLabel ?prefLabel; " +
+                "rdfs:comment ?comment; owl:sameAs ?sameConcept .} " +
+                "WHERE {?concept skos:inScheme " + selectedScheme.toString() +
+                "; skos:prefLabel ?prefLabel . " +
+                "OPTIONAL { ?concept skos:altLabel ?altLabel .} " +
+                "OPTIONAL { ?concept rdfs:comment ?comment .} " +
+                "OPTIONAL { ?concept owl:sameAs ?sameConcept .} " +
+                "FILTER (REGEX(STR(?prefLabel), '" +
+                searchTerm + "', 'i') || REGEX(STR(?altLabel), '" +
+                searchTerm + "', 'i'))}";
+
+        ConstructQuery constructQuery;
+        try {
+            constructQuery = (ConstructQuery) queryParser.parse(query);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex);
+        }
+
+        MGraph defaultGraph = contentGraphProvider.getContentGraph();
+        return tcManager.executeSparqlQuery(constructQuery, defaultGraph);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java
new file mode 100644
index 0000000..f933a53
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java
@@ -0,0 +1,134 @@
+/*
+ * 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.concepts.core;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.Calendar;
+import java.util.Date;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.serializedform.Parser;
+import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
+
+/**
+ * This implementation of {@link ConceptProvider} provides a functionality
+ * to query a SPARQL End Point for a given search term. The query is to be
+ * generated from a template by replacing the place holder for the search term
+ * with the specified search term.
+ *
+ * @author tio, hasan
+ */
+public class RemoteConceptProvider implements ConceptProvider {
+
+    private UriRef sparqlEndPoint = null;
+    private UriRef defaultGraph = null;
+    private String queryTemplate = null;
+    private ConceptCache conceptCache = null;
+    private RemoteConceptsDescriptionManager remoteConceptsDescriptionManager = null;
+
+    /**
+     * Constructs a {@link RemoteConceptProvider} with the specified parameters.
+     * 
+     * @param sparqlEndPoint
+     *        the SPARQL End Point to connect to
+     * @param defaultGraph
+     *        the Graph to query for concepts
+     * @param queryTemplate
+     *        the template for query containing place holders for the search term.
+     */
+    public RemoteConceptProvider(
+            UriRef sparqlEndPoint, UriRef defaultGraph, String queryTemplate) {
+        this.sparqlEndPoint = sparqlEndPoint;
+        this.defaultGraph = defaultGraph;
+        this.queryTemplate = queryTemplate;
+        this.conceptCache = new ConceptCache(sparqlEndPoint, defaultGraph);
+        this.remoteConceptsDescriptionManager = new RemoteConceptsDescriptionManager();
+    }
+
+    @Override
+    public Graph retrieveConcepts(String searchTerm) {
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.DAY_OF_MONTH, -30);
+        Date acceptableOldestCachingDate = calendar.getTime();
+        MGraph cachedConcepts = conceptCache.retrieve(searchTerm.toLowerCase(),
+                acceptableOldestCachingDate);
+        if (cachedConcepts != null) {
+            return cachedConcepts.getGraph();
+        } else {
+            final int connectionTimeout = 4000;
+            String query = queryTemplate.replace("${searchTerm}", searchTerm);
+            try {
+                String param = "query=" + URLEncoder.encode(query, "UTF-8");
+                if (defaultGraph != null) {
+                    param += "&default-graph-uri=" + defaultGraph.getUnicodeString();
+                }
+                final URL url = new URL(sparqlEndPoint.getUnicodeString());
+                final HttpURLConnection con =
+                        (HttpURLConnection) url.openConnection();
+                con.setRequestProperty("Accept", "application/rdf+xml");
+                con.setRequestMethod("POST");
+                con.setDoOutput(true);
+                con.setDoInput(true);
+                con.setUseCaches(false);
+                con.setConnectTimeout(connectionTimeout);
+
+                final OutputStream os = con.getOutputStream();
+                os.write(param.getBytes());
+                os.close();
+
+                if (con.getResponseCode() < 400) {
+                    final InputStream is = con.getInputStream();
+                    Graph parsedGraph = Parser.getInstance().parse(is,
+                            SupportedFormat.RDF_XML);
+                    is.close();
+                    conceptCache.cache(searchTerm.toLowerCase(), parsedGraph);
+                    remoteConceptsDescriptionManager.storeConceptsDescription(parsedGraph);
+                    return parsedGraph;
+                } else {
+                    final InputStream es = con.getErrorStream();
+                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                    for (int ch = es.read(); ch != -1; ch = es.read()) {
+                        baos.write(ch);
+                    }
+                    es.close();
+                    throw new RuntimeException(baos.toString());
+                }
+            } catch (ProtocolException ex) {
+                throw new RuntimeException(ex);
+            } catch (MalformedURLException ex) {
+                throw new RuntimeException(ex);
+            } catch (UnsupportedEncodingException ex) {
+                throw new RuntimeException(ex);
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
new file mode 100644
index 0000000..7932829
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
@@ -0,0 +1,102 @@
+/*
+ * 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.concepts.core;
+
+import java.util.Iterator;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.ontologies.SKOS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+/**
+ * This class stores description of concepts resulted from searches
+ * performed by {@link RemoteConceptProvider}s.
+ *
+ * @author hasan
+ */
+public class RemoteConceptsDescriptionManager {
+
+    private UriRef REMOTE_CONCEPTS_DESCRIPTION_MGRAPH =
+            new UriRef("urn:x-localinstance:/remote.concepts.description");
+
+    /**
+     * Stores SKOS:prefLabel and RDFS.comment of concepts available in the
+     * specified Graph.
+     *
+     * @param graph
+     *        the Graph which contains concepts and their descriptions.
+     */
+    void storeConceptsDescription(Graph graph) {
+        MGraph remoteConceptsDescriptionMGraph =
+                getRemoteConceptsDescriptionMGraph();
+
+        Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
+        while (concepts.hasNext()) {
+            UriRef concept = (UriRef) concepts.next().getSubject();
+            copyConceptDescription(new GraphNode(concept, graph),
+                    new GraphNode(concept, remoteConceptsDescriptionMGraph));
+        }
+    }
+
+    /**
+     * This method creates an {@link MGraph} to store concepts' descriptions
+     * if this graph does not already exist.
+     *
+     * @return
+     *        an {@link MGraph}
+     */
+    public MGraph getRemoteConceptsDescriptionMGraph() {
+        MGraph remoteConceptsDescriptionMGraph = null;
+        TcManager tcManager = TcManager.getInstance();
+        try {
+            remoteConceptsDescriptionMGraph =
+                    tcManager.getMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH);
+        } catch (NoSuchEntityException nsee) {
+            remoteConceptsDescriptionMGraph =
+                    tcManager.createMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH);
+        }
+        return remoteConceptsDescriptionMGraph;
+    }
+
+    private void copyConceptDescription(GraphNode sourceGraphNode,
+            GraphNode destinationGraphNode) {
+
+        destinationGraphNode.deleteNodeContext();
+
+        Iterator<Literal> prefLabelStatements =
+                sourceGraphNode.getLiterals(SKOS.prefLabel);
+        if (prefLabelStatements.hasNext()) {
+            destinationGraphNode.addProperty(SKOS.prefLabel,
+                    prefLabelStatements.next());
+        }
+        Iterator<Literal> commentStatements =
+                sourceGraphNode.getLiterals(RDFS.comment);
+        while (commentStatements.hasNext()) {
+            destinationGraphNode.addProperty(RDFS.comment,
+                    commentStatements.next());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
new file mode 100644
index 0000000..3bff348
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
@@ -0,0 +1,131 @@
+/*
+ * 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.concepts.core;
+
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.clerezza.jaxrs.utils.RedirectUtil;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesService;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.ontologies.DCTERMS;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * This JAX-RS resource can be used for adding concepts to a resource.
+ *
+ * The URI path of this service is /concepts/tagger.
+ *
+ * @author tio
+ */
+@Component
+@Service(Object.class)
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("/concepts/tagger/")
+public class ResourceTagger {
+
+    @Reference
+    protected ContentGraphProvider cgProvider;
+    @Reference
+    private ScalaServerPagesService scalaServerPagesService;
+
+    protected void activate(ComponentContext context)
+            throws URISyntaxException {
+
+        BundleContext bundleContext = context.getBundleContext();
+        URL template = getClass().getResource("concept-existing-subjects.ssp");
+
+        scalaServerPagesService.registerScalaServerPage(
+                template,
+                RDFS.Resource, "concept-existing-subjects-naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
+
+        template = getClass().getResource("concept-tagging.ssp");
+        scalaServerPagesService.registerScalaServerPage(
+                template,
+                RDFS.Resource, "concept-tagging-naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
+
+        template = getClass().getResource("concept-find-create.ssp");
+        scalaServerPagesService.registerScalaServerPage(
+                template,
+                RDFS.Resource, "concept-find-create-naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
+
+        template = getClass().getResource("selected-concepts.ssp");
+        scalaServerPagesService.registerScalaServerPage(
+                template,
+                RDFS.Resource, "selectedconcepts-naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
+    }
+
+    /**
+     * Adds concepts to a resource. If parameters uri and
+     * concepts are not defined a response with code BAD_REQUEST is returned. If
+     * the relation is succefully added a redirect to /concepts/generic-resource with
+     * the UriRef of the resource as parameter.
+     *
+     * @param uri specifies the uri of a resource
+     * @param concepts specifies a list of concept uris.
+     *
+     * @return
+     *        A Response
+     */
+    @POST
+    @Path("set")
+    public Response updateConcepts(@FormParam("uri") UriRef uri,
+            @FormParam("concepts") List<String> concepts,
+            @Context UriInfo uriInfo) {
+
+        
+        if (uri != null) {
+            GraphNode node = new GraphNode(uri, cgProvider.getContentGraph());
+            node.deleteProperties(DCTERMS.subject);
+            if(concepts != null) {
+                for (String subject : concepts) {
+                    node.addProperty(DCTERMS.subject, new UriRef(subject));
+                }
+            }
+        } else {
+            throw new WebApplicationException(Response.status(
+                    Status.BAD_REQUEST).entity("No resource uri defined.").build());
+        }
+        return RedirectUtil.createSeeOtherResponse("/concepts/generic-resource?uri=" +
+                uri.getUnicodeString(), uriInfo);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
new file mode 100644
index 0000000..98ee7cc
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
@@ -0,0 +1,319 @@
+/*
+ * 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.concepts.core;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
+import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.access.security.TcPermission;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.RdfList;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * This service manages concept providers. Concept providers are prioritized.
+ *
+ * The URI path of this service is /concepts/provider-manager.
+ *
+ * @author hasan, tio
+ */
+@Component
+@Services({
+    @Service(Object.class),
+    @Service(ConceptProviderManager.class),
+    @Service(GlobalMenuItemsProvider.class)
+})
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("/concepts/provider-manager")
+public class SimpleConceptProviderManager implements ConceptProviderManager,
+        GlobalMenuItemsProvider {
+
+    @Reference
+    private TcManager tcManager;
+
+    @Reference
+    protected ContentGraphProvider cgProvider;
+
+    @Reference
+    private RenderletManager renderletManager;
+
+    private List<ConceptProvider> conceptProviderList =
+            new ArrayList<ConceptProvider>();
+
+    /**
+     * The activate method is called when SCR activates the component
+     * configuration. 
+     * 
+     * @param context
+     * @throws IOException
+     * @throws URISyntaxException
+     */
+    protected void activate(ComponentContext context)
+            throws IOException,
+            URISyntaxException {
+
+        URL template = getClass().getResource("manage-concept-providers-page.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(template.toURI().toString()),
+                CONCEPTS.ManageConceptProvidersPage, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        instantiateConceptProviders();
+    }
+
+    protected void deactivate(ComponentContext context) {
+        conceptProviderList.clear();
+    }
+
+    private void instantiateConceptProviders() {
+        conceptProviderList.clear();
+        MGraph contentGraph = cgProvider.getContentGraph();
+
+        NonLiteral cplNode = getConceptProviderListNode(contentGraph);
+        RdfList cpl = new RdfList(cplNode, contentGraph);
+        for (int i = 0; i < cpl.size(); i++) {
+            NonLiteral conceptProvider = (NonLiteral) cpl.get(i);
+            Iterator<Triple> conceptProviderTypes = contentGraph.filter(
+                    conceptProvider, RDF.type, null);
+            if (conceptProviderTypes.hasNext()) {
+                UriRef conceptProviderType = (UriRef) conceptProviderTypes.next().getObject();
+                if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
+                    instantiateLocalConceptProvider(contentGraph, conceptProvider);
+                } else {
+                    instantiateRemoteConceptProvider(contentGraph, conceptProvider);
+                }
+            }
+        }
+    }
+
+    private NonLiteral getConceptProviderListNode(MGraph contentGraph) {
+        Iterator<Triple> triples = contentGraph.filter(null, RDF.type,
+                CONCEPTS.ConceptProviderList);
+        if (triples.hasNext()) {
+            return triples.next().getSubject();
+        }
+        NonLiteral cplNode = new BNode();
+        new RdfList(cplNode, contentGraph);
+        contentGraph.add(new TripleImpl(cplNode, RDF.type,
+                CONCEPTS.ConceptProviderList));
+        return cplNode;
+    }
+
+    private void instantiateLocalConceptProvider(MGraph contentGraph,
+            NonLiteral conceptProvider) {
+        Iterator<Triple> selectedSchemes = contentGraph.filter(
+                conceptProvider, CONCEPTS.selectedScheme, null);
+        if (selectedSchemes.hasNext()) {
+            UriRef selectedScheme = (UriRef) selectedSchemes.next().getObject();
+            conceptProviderList.add(new LocalConceptProvider(tcManager,
+                    cgProvider, selectedScheme));
+        }
+    }
+
+    private void instantiateRemoteConceptProvider(MGraph contentGraph,
+            NonLiteral conceptProvider) {
+        Iterator<Triple> endPoints = contentGraph.filter(
+                conceptProvider, CONCEPTS.sparqlEndPoint, null);
+        if (endPoints.hasNext()) {
+            UriRef sparqlEndPoint = (UriRef) endPoints.next().getObject();
+            Iterator<Triple> defaultGraphs = contentGraph.filter(
+                    conceptProvider, CONCEPTS.defaultGraph, null);
+            UriRef defaultGraph = null;
+            if (defaultGraphs.hasNext()) {
+                defaultGraph = (UriRef) defaultGraphs.next().getObject();
+            }
+            Iterator<Triple> queryTemplates = contentGraph.filter(
+                    conceptProvider, CONCEPTS.queryTemplate, null);
+            if (queryTemplates.hasNext()) {
+                TypedLiteral queryTemplate =
+                        (TypedLiteral) queryTemplates.next().getObject();
+                conceptProviderList.add(
+                        new RemoteConceptProvider(sparqlEndPoint,
+                        defaultGraph, queryTemplate.getLexicalForm()));
+            }
+        }
+    }
+
+    /**
+     * Returns a GraphNode containing a list of {@link ConceptProvider}s stored
+     * in the content graph to be managed. The order in the list represents
+     * the priority of the providers.
+     * This resource is accessible through a GET request on the URI sub-path
+     * "edit-concept-provider-list".
+     *
+     */
+    @GET
+    @Path("edit-concept-provider-list")
+    public GraphNode getProviderList(@Context UriInfo uriInfo) {
+        AccessController.checkPermission(
+                new ConceptProviderManagerAppPermission());
+        TrailingSlash.enforceNotPresent(uriInfo);
+        MGraph contentGraph = cgProvider.getContentGraph();
+        MGraph resultGraph = new SimpleMGraph();
+
+        NonLiteral cplNode = getConceptProviderListNode(contentGraph);
+        GraphNode resultNode = new GraphNode(cplNode, resultGraph);
+
+        resultNode.addProperty(RDF.type, CONCEPTS.ManageConceptProvidersPage);
+        resultNode.addProperty(RDF.type, PLATFORM.HeadedPage);
+        return new GraphNode(resultNode.getNode(),
+                new UnionMGraph(resultGraph, contentGraph));
+    }
+
+    /**
+     * Allows the list of {@link ConceptProvider}s stored in the content graph
+     * to be updated with the list POSTed via the URI sub-path
+     * "update-concept-provider-list".
+     * The order in the list represents the priority of the providers.
+     *
+     * @param types
+     *        specify the type of each ConceptProvider: either a
+     *        LocalConceptProvider or a RemoteConceptProvider.
+     * @param sparqlEndPoints
+     *        the SPARQL EndPoint to connect to in case of a RemoteConceptProvider.
+     * @param defaultGraphs
+     *        the Graph to be queried in case of a RemoteConceptProvider.
+     * @param queryTemplates
+     *        the template for the query to be used in case of a RemoteConceptProvider.
+     * @param conceptSchemes
+     *        the concept scheme within which concepts are to be searched,
+     *        in case of a LocalConceptProvider.
+     * @return
+     *        - a 200 (OK) response if everything is fine.
+     *        - a 400 (BAD REQUEST) response if types parameter is undefined.
+     */
+    @POST
+    @Path("update-concept-provider-list")
+    public Response updateConceptProviders(
+            @FormParam("types") List<String> types,
+            @FormParam("sparqlEndPoints") List<String> sparqlEndPoints,
+            @FormParam("defaultGraphs") List<String> defaultGraphs,
+            @FormParam("queryTemplates") List<String> queryTemplates,
+            @FormParam("conceptSchemes") List<String> conceptSchemes) {
+
+        if (types == null) {
+            //types is null when all provider have been removed, processing empty list
+            types = new ArrayList<String>();
+        }
+        MGraph contentGraph = cgProvider.getContentGraph();
+        NonLiteral cplNode = getConceptProviderListNode(contentGraph);
+        GraphNode cplGraphNode = new GraphNode(cplNode, contentGraph);
+        cplGraphNode.deleteNodeContext();
+
+        cplNode = getConceptProviderListNode(contentGraph);
+        RdfList cpl = new RdfList(cplNode, contentGraph);
+
+        int length = types.size();
+        for (int i=0; i<length; i++) {
+            UriRef conceptProviderType = new UriRef(types.get(i));
+            BNode conceptProvider = new BNode();
+            contentGraph.add(new TripleImpl(conceptProvider, RDF.type,
+                    conceptProviderType));
+            if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
+                contentGraph.add(new TripleImpl(conceptProvider,
+                        CONCEPTS.selectedScheme,
+                        new UriRef(conceptSchemes.get(i))));
+            } else {
+                contentGraph.add(new TripleImpl(conceptProvider,
+                        CONCEPTS.sparqlEndPoint,
+                        new UriRef(sparqlEndPoints.get(i))));
+                String defaultGraph = defaultGraphs.get(i);
+                if (!defaultGraph.trim().isEmpty()) {
+                    contentGraph.add(new TripleImpl(conceptProvider,
+                            CONCEPTS.defaultGraph,
+                            new UriRef(defaultGraph)));
+                }
+                contentGraph.add(new TripleImpl(conceptProvider,
+                        CONCEPTS.queryTemplate,
+                        LiteralFactory.getInstance().createTypedLiteral(
+                        queryTemplates.get(i))));
+            }
+            cpl.add(i, conceptProvider);
+        }
+        instantiateConceptProviders();
+        return Response.status(Status.OK).build();
+    }
+
+    @Override
+    public List<ConceptProvider> getConceptProviders() {
+        return conceptProviderList;
+    }
+
+    @Override
+    public Set<GlobalMenuItem> getMenuItems() {
+        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
+        try {
+            AccessController.checkPermission(
+                    new TcPermission("urn:x-localinstance:/content.graph",
+                    TcPermission.READWRITE));
+        } catch (AccessControlException e) {
+            return items;
+        }
+        try {
+            AccessController.checkPermission(
+                    new ConceptProviderManagerAppPermission());
+        } catch (AccessControlException e) {
+            return items;
+        }
+        items.add(new GlobalMenuItem("/concepts/provider-manager/edit-concept-provider-list",
+                "CPM", "Concept Providers", 5, "Administration"));
+        return items;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
new file mode 100644
index 0000000..67c4ee4
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
@@ -0,0 +1,21 @@
+/*
+ *
+ * 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.
+ *
+*/
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
new file mode 100644
index 0000000..67c4ee4
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
@@ -0,0 +1,21 @@
+/*
+ *
+ * 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.
+ *
+*/
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
new file mode 100644
index 0000000..67c4ee4
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
@@ -0,0 +1,21 @@
+/*
+ *
+ * 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.
+ *
+*/
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
new file mode 100644
index 0000000..67c4ee4
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
@@ -0,0 +1,21 @@
+/*
+ *
+ * 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.
+ *
+*/
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
new file mode 100644
index 0000000..823cb97
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
@@ -0,0 +1,29 @@
+/*
+ *
+ * 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 skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
+def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
+def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s);
+
+<form method="post" action="/concepts/tagger/set" id="selected-concepts-form">
+	<input type="hidden" name="uri" value={res/cpt("resource")*}></input>
+	{render(res/cpt("resource"), "selectedconcepts-naked")}
+</form>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
new file mode 100644
index 0000000..c0436d8
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+resultDocModifier.addScriptReference("/jquery/jquery-1.3.2.min.js");
+resultDocModifier.addScriptReference("/scripts/ajax-options.js");
+//resultDocModifier.addScriptReference("/scripts/modification-status.js");
+resultDocModifier.addScriptReference("/scripts/status-message.js");
+
+resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/concept-find-create.js");
+resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/jquery.rdfquery.core-1.0.js");
+
+resultDocModifier.addScriptReference("/scripts/alert-message.js");
+resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
+resultDocModifier.addScriptReference("/yui/2/element/element-min.js");
+resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
+resultDocModifier.addStyleSheet("/yui/2/container/assets/container-core.css");
+
+
+<div>Add Concepts</div>
+<form onsubmit="return ConceptFinder.search()" id="search-form">
+	<br/>
+	<input type="text" value="" name="search-term"/>
+	<a href="#" id="go-button" class="tx-icon tx-icon-search">Go</a>
+	<br/>
+	<br/>
+	<div id="system-found-concepts-area">
+		<div id="label-for-search-results">
+			Found Concepts:
+		</div>
+		<br/>
+		<div id="system-found-concepts"></div>
+	</div>
+	<br/>
+	<div id="user-defined-concept-area">
+		<div id="add-button-label"></div>
+		<div>Description (optional):</div>
+		<textarea rows="8" id="concept-description" name="comment"/>
+		<input type="hidden" value="en" name="lang"/>
+		<div>
+			<a href="#" class="tx-icon tx-icon-plus" id="add-user-defined-concept">Add</a>
+		</div>
+	</div>
+</form>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
new file mode 100644
index 0000000..a81d5a2
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
@@ -0,0 +1,23 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+<div class="concept-tagging">{render(res,"concept-existing-subjects-naked")}
+{render(res,"concept-find-create-naked")}</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
new file mode 100644
index 0000000..e27759b
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
@@ -0,0 +1,43 @@
+/*
+ *
+ * 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 skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
+def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
+def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s);
+
+resultDocModifier.setTitle("Generic Resource Page");
+resultDocModifier.addNodes2Elem("tx-module", <h1>Generic Resource Page</h1>);
+resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Resource</a></li>);
+resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="#">Save</a></li>);
+
+<div id="tx-content">
+	<script type="text/javascript">
+		$(document).ready(function() {{
+			$("#addButton").click(function() {{
+				$("#selected-concepts-form").submit();
+			}});
+		}});
+	</script>
+	<h4>About: {res/cpt("resource")*}</h4>
+	<div><object width="80%" data={res/cpt("resource")*}></object></div>
+	<br/>
+	{render(res,"concept-tagging-naked")}
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
new file mode 100644
index 0000000..e0ef754
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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 skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
+def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s)
+def lingvoj(s: Any) = new UriRef("http://www.lingvoj.org/ontology#"+s)
+def rdfs(s: Any) = new UriRef("http://www.w3.org/2000/01/rdf-schema#"+s)
+def rdf(s: Any) = new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#"+s)
+
+def createProvider(rdfType: String, selectedScheme: String, sparqlEndPoint: String, defaultGraph: String, query: String) =
+						<tr>
+							<td>
+								<input type="checkbox" value={rdfType}/>
+							</td>
+							<td>
+							<div>Provider:
+							</div>
+								{createSelection(!selectedScheme.equals(""))}
+							<br/>
+							<div>Concept Scheme:</div>
+							<input type="text" value={selectedScheme} name="conceptSchemes"/>
+							<div>SPARQL Endpoint:</div>
+							<input type="text" value={sparqlEndPoint} name="sparqlEndPoints"/>
+							<div>Default Graph:</div>
+							<input type="text" value={defaultGraph} name="defaultGraphs"/>
+							<div>Query Template:</div>
+							<textarea rows="8" name="queryTemplates">{query}</textarea>
+							<br/>
+							<br/>
+							</td>
+						</tr>
+
+
+def createSelection(isLocal: Boolean) = <select name="types">
+									{if(isLocal) {
+										<option value={cpt("LocalConceptProvider").getUnicodeString()} selected="selected">LocalConceptProvider</option>
+										<option value={cpt("RemoteConceptProvider").getUnicodeString()} >RemoteConceptProvider</option>
+									} else {
+										<option value={cpt("LocalConceptProvider").getUnicodeString()}>LocalConceptProvider</option>
+										<option value={cpt("RemoteConceptProvider").getUnicodeString()} selected="selected">RemoteConceptProvider</option>
+									}}
+						</select>
+
+resultDocModifier.addStyleSheet("/static/concepts/style/form.css");
+resultDocModifier.addScriptReference("/jquery/jquery.tooltip.pack.js");
+resultDocModifier.addScriptReference("/jquery/jquery.ajaxQueue.js");
+resultDocModifier.addScriptReference("/jquery/jquery.autocomplete.min.js");
+resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
+/*resultDocModifier.addScriptReference("/yui/2/container/assets/container-core.css");*/
+resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
+resultDocModifier.addScriptReference("/scripts/alert-message.js");
+resultDocModifier.addScriptReference("/scripts/ajax-options.js");
+resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/concept-provider-manipulation.js");
+resultDocModifier.setTitle("Resource Tagging");
+resultDocModifier.addNodes2Elem("tx-module", <h1>Resource Tagging</h1>);
+
+resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="">Concept Providers Manager</a></li>);
+
+resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="deleteButton" class="tx-button tx-button-remove" href="#">Remove</a></li>);
+resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="#">Save</a></li>);
+
+<div id="tx-content">
+	<div  class="tx-tree">
+		<form action="" id="providers" method="post">
+			<fieldset>
+				<table>
+					<thead>
+						<tr>
+							<th><a href="#"></a></th>
+							<th style="width: 95%"><a href="#"></a>Concept Providers</th>
+						</tr>
+					</thead>
+					<tbody>
+						{	for (provider <- (res!!)) yield {
+								if((provider/rdf("type")*).indexOf("LocalConceptProvider") != -1) {
+									createProvider((provider/rdf("type")*), provider/cpt("selectedScheme")*, "", "", "")
+								} else {
+									createProvider((provider/rdf("type")*), "", provider/cpt("sparqlEndPoint")*, provider/cpt("defaultGraph")*, provider/cpt("queryTemplate")*)
+								}
+							}
+						}
+						<tr id="last">
+							<td></td>
+							<td>
+								<div>Add Concept Provider:</div>
+								<select id="type">
+									<option value={cpt("LocalConceptProvider").getUnicodeString()}>LocalConceptProvider</option>
+									<option value={cpt("RemoteConceptProvider").getUnicodeString()}>RemoteConceptProvider</option>
+								</select>
+								<div>Concept Scheme:</div>
+								<input type="text" name="conceptScheme" id="conceptScheme"/>
+								<div>SPARQL Endpoint</div>
+								<input type="text" name="sparqlEndPoint" id="sparqlEndPoint" />
+								<div>Default Graph:</div>
+								<input type="text" name="defaultGraph" id="defaultGraph"/>
+								<div>Query Template:</div>
+								<textarea rows="8" id="query"/>
+								<br/>
+								<br/>
+								<div>
+									<a href="#" class="tx-icon tx-icon-ok" id="addProvider">Add</a>
+								</div>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+			</fieldset>
+		</form>
+	</div>
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
new file mode 100644
index 0000000..707c11a
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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 skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
+def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
+
+resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/selected-concepts.js");
+
+<div>
+	<div id="selected-concepts">
+		{for (concept <- (res/dct("subject"))) yield {
+		<div>
+			<div>PrefLabel: {concept/skos("prefLabel")*}</div>
+			<div>Uri: {concept*}</div>
+			<input type="hidden" name="concepts" value={concept*}></input>
+			<a href="#" class="tx-icon tx-icon-delete" >Remove</a>
+			<br />
+			<br />
+		</div>
+		}
+		}
+	</div>
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
new file mode 100644
index 0000000..5ee4663
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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 org.json.simple.JSONObject
+
+def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
+
+"{\"concepts\":" +
+	(for (concept <- (res/skos("member"))) yield {
+		"{" +
+			"\"prefLabel\":\"" + JSONObject.escape(concept/skos("prefLabel")*) + "\"," +
+			"\"uri\":\"" + JSONObject.escape(concept*) + "\"" +
+		"}"
+	}).mkString("[", ",", "]") +
+"}";

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
new file mode 100644
index 0000000..e31bd88
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
@@ -0,0 +1,217 @@
+/*
+ * 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.
+ * 
+ * @author hasan, andre
+ */
+function ConceptFinder(){
+};
+
+ConceptFinder.callback;
+
+ConceptFinder.setAddConceptCallback = function(callback){
+	this.callback = callback;
+}
+
+/**
+ * Request the server concepts that match the search term in the input field "search-term"
+ */
+ConceptFinder.search = function(){
+	$("#system-found-concepts").empty();
+	var queryResult = null;
+	var searchTerm = $(":text[name=\"search-term\"]").val();
+	if (searchTerm.length > 0) {
+		var options = new AjaxOptions("find-concepts", "finding concepts", function(data){
+			var databank = $.rdf.databank();
+			var store = databank.load(data, {});
+			var query = $.rdf({
+				databank: store
+			});
+			query.prefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
+			query.prefix('concepts', 'http://clerezza.org/2010/01/concepts#');
+			query.prefix('rdfs', 'http://www.w3.org/2000/01/rdf-schema#');
+			query.prefix('qr', 'http://clerezza.org/2010/04/queryresult#');
+			var resultSet = query.where('?subject rdf:type qr:QueryResult');
+			if (resultSet.size() != 1) {
+				AlertMessage.show(function(){
+				}, "The query results did not match what's expected: exactly 1 result");
+			}
+			var queryResult = query.node(resultSet.get(0).subject);
+			var conceptProperty = $.rdf.resource("<http://clerezza.org/2010/04/queryresult#concept>");
+			var conceptProperties = queryResult.get(conceptProperty);
+			if (conceptProperties) {
+				ConceptFinder.addFoundConcepts(conceptProperties);
+			}
+			$("#add-button-label").html("<div>Add '" + searchTerm + "' as new Free Concept</div>");
+			$("#system-found-concepts-area").show();
+			var newFreeConceptProperty = $.rdf.resource("<http://clerezza.org/2010/04/queryresult#creationOfNewFreeConceptSuggested>");
+			var creationOfNewFreeConceptSuggested = queryResult.get(newFreeConceptProperty)[0].value.toString() == "true";
+			if (creationOfNewFreeConceptSuggested) {
+				$("#user-defined-concept-area").show();
+			} else {
+				$("#user-defined-concept-area").hide();
+			}
+		});
+		options.url = "/concepts/find";
+		options.data = "searchTerm=" + encodeURIComponent(searchTerm) + "&xPropObj=http://clerezza.org/2010/04/queryresult%23concept";
+		options.dataType = "json";
+		options.beforeSend = function(req){
+			req.setRequestHeader("Accept", "application/rdf+json");
+		};
+		
+		$.ajax(options);
+	}
+	return false;
+}
+
+/**
+ * Adds the given (array of) concepts to the UI (that's currently being displayed). Displays them by a 
+ * +-button and labels (for each of them)
+ *
+ * @param Json array of concepts
+ */
+ConceptFinder.addFoundConcepts = function(concepts){
+	var selectedConceptsExists = false;
+	if (typeof(SelectedConcepts) != "undefined") {
+		selectedConceptsExists = true;
+	}
+	var added = false;
+	for (var i = 0; i < concepts.length; i++) {
+		var concept = concepts[i];
+		if (!selectedConceptsExists || !SelectedConcepts.exists(concept.value)) {
+			added = true;
+			var prefLabelProperty = $.rdf.resource("<http://www.w3.org/2008/05/skos#prefLabel>"); 
+			var prefLabel = concept.get(prefLabelProperty).value;
+			var uri = concept.value;
+			ConceptFinder.createSystemFoundConcept(prefLabel, uri);
+		}
+	}
+	if (added) {
+		$("#label-for-search-results").text("Concepts found:");
+	}
+	else {
+		$("#label-for-search-results").text("No additional concepts found.");
+	}
+}
+
+/**
+ * Creates the widget that show the user a concept that was found on the backend. Shows prefLabel, 
+ * uri and a button to add the concept to the backend
+ * 
+ * @param {Object} prefLabel
+ * @param {Object} uri
+ */
+ConceptFinder.createSystemFoundConcept = function(prefLabel, uri) {
+	var div = $("<div/>");
+	ConceptFinder.createConceptWidgets(prefLabel, uri).appendTo(div)
+	$("<a/>").addClass("tx-icon tx-icon-plus").attr({
+		href: "#"
+	}).text("Add").click(ConceptFinder.onAddClicked(prefLabel, uri)).appendTo(div);
+	$("<br/>").appendTo(div);
+	$("<br/>").appendTo(div);
+	div.appendTo("#system-found-concepts")
+}
+
+ConceptFinder.onAddClicked = function(prefLabel, uri){
+	return function(){
+		if (typeof(SelectedConcepts) != "undefined") {
+			SelectedConcepts.addConcept(prefLabel, uri);
+		}
+		if (typeof(ConceptFinder.callback) == "function") {
+			ConceptFinder.callback(prefLabel, uri);
+		}
+		$(this).parent().remove();
+	};
+}
+
+/**
+ * Creates html elements that show the given pref label and uri. Appends them to the given div.
+ * 
+ * @param {Object} prefLabel
+ * @param {Object} uri
+ * @param {Object} div
+ */
+ConceptFinder.createConceptWidgets = function(prefLabel, uri) {
+	var div = $("<div/>");
+	if (prefLabel.substr(0,1) == "\"") {
+		prefLabel = prefLabel.substring(1, prefLabel.length - 1);
+	}
+	$("<div/>").text("PrefLabel: " + prefLabel).appendTo(div);
+	$("<div/>").text("Uri: " + uri).appendTo(div);
+	$("<input/>").attr({
+		"type": "hidden",
+		"name": "concepts"
+	}).val(uri).appendTo(div);
+	return div;
+}
+
+/**
+ * Checks if a concept with the given uri already exists
+ * @param {Object} uri
+ */
+ConceptFinder.exists = function(uri){
+
+};
+
+function ConceptManipulator(){
+};
+
+ConceptManipulator.callback;
+
+ConceptManipulator.setAddConceptCallback = function(callback){
+	this.callback = callback;
+}
+
+/**
+ * sends a new concept to the backend for addition. Uses the search term entered by the user (in the same form).
+ */
+ConceptManipulator.addConcept = function(){
+	var searchTerm = $(":text[name='search-term']").val();
+	if (searchTerm.length > 0) {
+		var options = new AjaxOptions("add-concepts", "adding concepts", function(uri){
+			$("#concept-description").val("");
+			if (typeof(SelectedConcepts) != "undefined") {
+				SelectedConcepts.addConcept(searchTerm, uri);
+			}
+			if (typeof(this.callback) == "function") {
+				this.callback(searchTerm, uri);
+			}
+		});
+		options.type = "POST";
+		options.url = "/concepts/manipulator/add-concept";
+		options.data = {
+			"pref-label": searchTerm,
+			lang: $(":input[name='lang']").val(),
+			comment: $(":textarea[name='comment']").val()
+		}
+		
+		$.ajax(options);
+	}
+	return false;
+}
+
+$(document).ready(function(){
+	$("#go-button").click(function(){
+		ConceptFinder.search();
+	});
+	$("#add-user-defined-concept").click(function(){
+		ConceptManipulator.addConcept();
+		$("#user-defined-concept-area").hide();
+	});
+	$("#system-found-concepts-area").hide();
+	$("#user-defined-concept-area").hide();
+});


[45/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js
new file mode 100644
index 0000000..745a2cf
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js
@@ -0,0 +1,4040 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*
+ * $ URIs @VERSION
+ * 
+ * Copyright (c) 2008,2009 Jeni Tennison
+ * Licensed under the MIT (MIT-LICENSE.txt)
+ *
+ */
+/**
+ * @fileOverview $ URIs
+ * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
+ * @copyright (c) 2008,2009 Jeni Tennison
+ * @license MIT license (MIT-LICENSE.txt)
+ * @version 1.0
+ */
+/**
+ * @class
+ * @name jQuery
+ * @exports $ as jQuery
+ * @description rdfQuery is a <a href="http://jquery.com/">jQuery</a> plugin. The only fields and methods listed here are those that come as part of the rdfQuery library.
+ */
+(function ($) {
+
+  var
+    mem = {},
+    uriRegex = /^(([a-z][\-a-z0-9+\.]*):)?(\/\/([^\/?#]+))?([^?#]*)?(\?([^#]*))?(#(.*))?$/i,
+    docURI,
+
+    parseURI = function (u) {
+      var m = u.match(uriRegex);
+      if (m === null) {
+        throw "Malformed URI: " + u;
+      }
+      return {
+        scheme: m[1] ? m[2].toLowerCase() : undefined,
+        authority: m[3] ? m[4] : undefined,
+        path: m[5] || '',
+        query: m[6] ? m[7] : undefined,
+        fragment: m[8] ? m[9] : undefined
+      };
+    },
+
+    removeDotSegments = function (u) {
+      var r = '', m = [];
+      if (/\./.test(u)) {
+        while (u !== undefined && u !== '') {
+          if (u === '.' || u === '..') {
+            u = '';
+          } else if (/^\.\.\//.test(u)) { // starts with ../
+            u = u.substring(3);
+          } else if (/^\.\//.test(u)) { // starts with ./
+            u = u.substring(2);
+          } else if (/^\/\.(\/|$)/.test(u)) { // starts with /./ or consists of /.
+            u = '/' + u.substring(3);
+          } else if (/^\/\.\.(\/|$)/.test(u)) { // starts with /../ or consists of /..
+            u = '/' + u.substring(4);
+            r = r.replace(/\/?[^\/]+$/, '');
+          } else {
+            m = u.match(/^(\/?[^\/]*)(\/.*)?$/);
+            u = m[2];
+            r = r + m[1];
+          }
+        }
+        return r;
+      } else {
+        return u;
+      }
+    },
+
+    merge = function (b, r) {
+      if (b.authority !== '' && (b.path === undefined || b.path === '')) {
+        return '/' + r;
+      } else {
+        return b.path.replace(/[^\/]+$/, '') + r;
+      }
+    };
+
+  /**
+   * Creates a new jQuery.uri object. This should be invoked as a method rather than constructed using new.
+   * @class Represents a URI
+   * @param {String} [relative='']
+   * @param {String|jQuery.uri} [base] Defaults to the base URI of the page
+   * @returns {jQuery.uri} The new jQuery.uri object.
+   * @example uri = jQuery.uri('/my/file.html');
+   */
+  $.uri = function (relative, base) {
+    var uri;
+    relative = relative || '';
+    if (mem[relative]) {
+      return mem[relative];
+    }
+    base = base || $.uri.base();
+    if (typeof base === 'string') {
+      base = $.uri.absolute(base);
+    }
+    uri = new $.uri.fn.init(relative, base);
+    if (mem[uri]) {
+      return mem[uri];
+    } else {
+      mem[uri] = uri;
+      return uri;
+    }
+  };
+
+  $.uri.fn = $.uri.prototype = {
+    /**
+     * The scheme used in the URI
+     * @type String
+     */
+    scheme: undefined,
+    /**
+     * The authority used in the URI
+     * @type String
+     */
+    authority: undefined,
+    /**
+     * The path used in the URI
+     * @type String
+     */
+    path: undefined,
+    /**
+     * The query part of the URI
+     * @type String
+     */
+    query: undefined,
+    /**
+     * The fragment part of the URI
+     * @type String
+     */
+    fragment: undefined,
+    
+    init: function (relative, base) {
+      var r = {};
+      base = base || {};
+      $.extend(this, parseURI(relative));
+      if (this.scheme === undefined) {
+        this.scheme = base.scheme;
+        if (this.authority !== undefined) {
+          this.path = removeDotSegments(this.path);
+        } else {
+          this.authority = base.authority;
+          if (this.path === '') {
+            this.path = base.path;
+            if (this.query === undefined) {
+              this.query = base.query;
+            }
+          } else {
+            if (!/^\//.test(this.path)) {
+              this.path = merge(base, this.path);
+            }
+            this.path = removeDotSegments(this.path);
+          }
+        }
+      }
+      if (this.scheme === undefined) {
+        throw "Malformed URI: URI is not an absolute URI and no base supplied: " + relative;
+      }
+      return this;
+    },
+  
+    /**
+     * Resolves a relative URI relative to this URI
+     * @param {String} relative
+     * @returns jQuery.uri
+     */
+    resolve: function (relative) {
+      return $.uri(relative, this);
+    },
+    
+    /**
+     * Creates a relative URI giving the path from this URI to the absolute URI passed as a parameter
+     * @param {String|jQuery.uri} absolute
+     * @returns String
+     */
+    relative: function (absolute) {
+      var aPath, bPath, i = 0, j, resultPath = [], result = '';
+      if (typeof absolute === 'string') {
+        absolute = $.uri(absolute, {});
+      }
+      if (absolute.scheme !== this.scheme || 
+          absolute.authority !== this.authority) {
+        return absolute.toString();
+      }
+      if (absolute.path !== this.path) {
+        aPath = absolute.path.split('/');
+        bPath = this.path.split('/');
+        if (aPath[1] !== bPath[1]) {
+          result = absolute.path;
+        } else {
+          while (aPath[i] === bPath[i]) {
+            i += 1;
+          }
+          j = i;
+          for (; i < bPath.length - 1; i += 1) {
+            resultPath.push('..');
+          }
+          for (; j < aPath.length; j += 1) {
+            resultPath.push(aPath[j]);
+          }
+          result = resultPath.join('/');
+        }
+        result = absolute.query === undefined ? result : result + '?' + absolute.query;
+        result = absolute.fragment === undefined ? result : result + '#' + absolute.fragment;
+        return result;
+      }
+      if (absolute.query !== undefined && absolute.query !== this.query) {
+        return '?' + absolute.query + (absolute.fragment === undefined ? '' : '#' + absolute.fragment);
+      }
+      if (absolute.fragment !== undefined && absolute.fragment !== this.fragment) {
+        return '#' + absolute.fragment;
+      }
+      return '';
+    },
+  
+    /**
+     * Returns the URI as an absolute string
+     * @returns String
+     */
+    toString: function () {
+      var result = '';
+      if (this._string) {
+        return this._string;
+      } else {
+        result = this.scheme === undefined ? result : (result + this.scheme + ':');
+        result = this.authority === undefined ? result : (result + '//' + this.authority);
+        result = result + this.path;
+        result = this.query === undefined ? result : (result + '?' + this.query);
+        result = this.fragment === undefined ? result : (result + '#' + this.fragment);
+        this._string = result;
+        return result;
+      }
+    }
+  
+  };
+
+  $.uri.fn.init.prototype = $.uri.fn;
+
+  /**
+   * Creates a {@link jQuery.uri} from a known-to-be-absolute URI
+   * @param {String}
+   * @returns {jQuery.uri}
+   */
+  $.uri.absolute = function (uri) {
+    return $.uri(uri, {});
+  };
+
+  /**
+   * Creates a {@link jQuery.uri} from a relative URI and an optional base URI
+   * @returns {jQuery.uri}
+   * @see jQuery.uri
+   */
+  $.uri.resolve = function (relative, base) {
+    return $.uri(relative, base);
+  };
+  
+  /**
+   * Creates a string giving the relative path from a base URI to an absolute URI
+   * @param {String} absolute
+   * @param {String} base
+   * @returns {String}
+   */
+  $.uri.relative = function (absolute, base) {
+    return $.uri(base, {}).relative(absolute);
+  };
+  
+  /**
+   * Returns the base URI of the page
+   * @returns {jQuery.uri}
+   */
+  $.uri.base = function () {
+    return $(document).base();
+  };
+  
+  /**
+   * Returns the base URI in scope for the first selected element
+   * @methodOf jQuery#
+   * @name jQuery#base
+   * @returns {jQuery.uri}
+   * @example baseURI = $('img').base();
+   */
+  $.fn.base = function () {
+    var base = $(this).parents().andSelf().find('base').attr('href'),
+      doc = $(this)[0].ownerDocument || document,
+      docURI = $.uri.absolute(doc.location === null ? document.location.href : doc.location.href);
+    return base === undefined ? docURI : $.uri(base, docURI);
+  };
+
+})(jQuery);
+/*
+ * jQuery CURIE @VERSION
+ * 
+ * Copyright (c) 2008,2009 Jeni Tennison
+ * Licensed under the MIT (MIT-LICENSE.txt)
+ *
+ * Depends:
+ *  jquery.uri.js
+ */
+/**
+ * @fileOverview XML Namespace processing
+ * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
+ * @copyright (c) 2008,2009 Jeni Tennison
+ * @license MIT license (MIT-LICENSE.txt)
+ * @version 1.0
+ * @requires jquery.uri.js
+ */
+
+/*global jQuery */
+(function ($) {
+
+  var 
+    xmlNs = 'http://www.w3.org/XML/1998/namespace',
+    xmlnsNs = 'http://www.w3.org/2000/xmlns/',
+    
+    xmlnsRegex = /\sxmlns(?::([^ =]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g,
+    
+    ncNameChar = '[-A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF\.0-9\u00B7\u0300-\u036F\u203F-\u2040]',
+    ncNameStartChar = '[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B1
 3-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F
 18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]',
+    ncNameRegex = new RegExp('^' + ncNameStartChar + ncNameChar + '*$');
+    
+
+/**
+ * Returns the namespaces declared in the scope of the first selected element, or
+ * adds a namespace declaration to all selected elements. Pass in no parameters
+ * to return all namespaces bindings on the first selected element. If only 
+ * the prefix parameter is specified, this method will return the namespace
+ * URI that is bound to the specified prefix on the first element in the selection
+ * If the prefix and uri parameters are both specified, this method will
+ * add the binding of the specified prefix and namespace URI to all elements
+ * in the selection.
+ * @methodOf jQuery#
+ * @name jQuery#xmlns
+ * @param {String} [prefix] Restricts the namespaces returned to only the namespace with the specified namespace prefix.
+ * @param {String|jQuery.uri} [uri] Adds a namespace declaration to the selected elements that maps the specified prefix to the specified namespace.
+ * @param {Object} [inherited] A map of inherited namespace bindings.
+ * @returns {Object|jQuery.uri|jQuery}
+ * @example 
+ * // Retrieve all of the namespace bindings on the HTML document element
+ * var nsMap = $('html').xmlns();
+ * @example
+ * // Retrieve the namespace URI mapped to the 'dc' prefix on the HTML document element
+ * var dcNamespace = $('html').xmlns('dc');
+ * @example
+ * // Create a namespace declaration that binds the 'dc' prefix to the URI 'http://purl.org/dc/elements/1.1/'
+ * $('html').xmlns('dc', 'http://purl.org/dc/elements/1.1/');
+ */
+  $.fn.xmlns = function (prefix, uri, inherited) {
+    var 
+      elem = this.eq(0),
+      ns = elem.data('xmlns'),
+      e = elem[0], a, p, i,
+      decl = prefix ? 'xmlns:' + prefix : 'xmlns',
+      value,
+      tag, found = false;
+    if (uri === undefined) {
+      if (prefix === undefined) { // get the in-scope declarations on the first element
+        if (ns === undefined) {
+          ns = {
+//            xml: $.uri(xmlNs)
+          };
+          if (e.attributes && e.attributes.getNamedItemNS) {
+            for (i = 0; i < e.attributes.length; i += 1) {
+              a = e.attributes[i];
+              if (/^xmlns(:(.+))?$/.test(a.nodeName)) {
+                prefix = /^xmlns(:(.+))?$/.exec(a.nodeName)[2] || '';
+                value = a.nodeValue;
+                if (prefix === '' || (value !== '' && value !== xmlNs && value !== xmlnsNs && ncNameRegex.test(prefix) && prefix !== 'xml' && prefix !== 'xmlns')) {
+                  ns[prefix] = $.uri(a.nodeValue);
+                  found = true;
+                }
+              }
+            }
+          } else {
+            tag = /<[^>]+>/.exec(e.outerHTML);
+            a = xmlnsRegex.exec(tag);
+            while (a !== null) {
+              prefix = a[1] || '';
+              value = a[2] || a[3];
+              if (prefix === '' || (value !== '' && value !== xmlNs && value !== xmlnsNs && ncNameRegex.test(prefix) && prefix !== 'xml' && prefix !== 'xmlns')) {
+                ns[prefix] = $.uri(a[2] || a[3]);
+                found = true;
+              }
+              a = xmlnsRegex.exec(tag);
+            }
+            xmlnsRegex.lastIndex = 0;
+          }
+          inherited = inherited || (e.parentNode.nodeType === 1 ? elem.parent().xmlns() : {});
+          ns = found ? $.extend({}, inherited, ns) : inherited;
+          elem.data('xmlns', ns);
+        }
+        return ns;
+      } else if (typeof prefix === 'object') { // set the prefix mappings defined in the object
+        for (p in prefix) {
+          if (typeof prefix[p] === 'string' && ncNameRegex.test(p)) {
+            this.xmlns(p, prefix[p]);
+          }
+        }
+        this.find('*').andSelf().removeData('xmlns');
+        return this;
+      } else { // get the in-scope declaration associated with this prefix on the first element
+        if (ns === undefined) {
+          ns = elem.xmlns();
+        }
+        return ns[prefix];
+      }
+    } else { // set
+      this.find('*').andSelf().removeData('xmlns');
+      return this.attr(decl, uri);
+    }
+  };
+
+/**
+ * Removes one or more XML namespace bindings from the selected elements.
+ * @methodOf jQuery#
+ * @name jQuery#removeXmlns
+ * @param {String|Object|String[]} prefix The prefix(es) of the XML namespace bindings that are to be removed from the selected elements.
+ * @returns {jQuery} The original jQuery object.
+ * @example
+ * // Remove the foaf namespace declaration from the body element:
+ * $('body').removeXmlns('foaf');
+ * @example
+ * // Remove the foo and bar namespace declarations from all h2 elements
+ * $('h2').removeXmlns(['foo', 'bar']);
+ * @example
+ * // Remove the foo and bar namespace declarations from all h2 elements
+ * var namespaces = { foo : 'http://www.example.org/foo', bar : 'http://www.example.org/bar' };
+ * $('h2').removeXmlns(namespaces);
+ */
+  $.fn.removeXmlns = function (prefix) {
+    var decl, p, i;
+    if (typeof prefix === 'object') {
+      if (prefix.length === undefined) { // assume an object representing namespaces
+        for (p in prefix) {
+          if (typeof prefix[p] === 'string') {
+            this.removeXmlns(p);
+          }
+        }
+      } else { // it's an array
+        for (i = 0; i < prefix.length; i += 1) {
+          this.removeXmlns(prefix[i]);
+        }
+      }
+    } else {
+      decl = prefix ? 'xmlns:' + prefix : 'xmlns';
+      this.removeAttr(decl);
+    }
+    this.find('*').andSelf().removeData('xmlns');
+    return this;
+  };
+
+  $.fn.qname = function (name) {
+    var m, prefix, namespace;
+    if (name === undefined) {
+      if (this[0].outerHTML === undefined) {
+        name = this[0].nodeName.toLowerCase();
+      } else {
+        name = /<([^ >]+)/.exec(this[0].outerHTML)[1].toLowerCase();
+      }
+    }
+    if (name === '?xml:namespace') {
+      // there's a prefix on the name, but we can't get at it
+      throw "XMLinHTML: Unable to get the prefix to resolve the name of this element";
+    }
+    m = /^(([^:]+):)?([^:]+)$/.exec(name);
+    prefix = m[2] || '';
+    namespace = this.xmlns(prefix);
+    if (namespace === undefined && prefix !== '') {
+      throw "MalformedQName: The prefix " + prefix + " is not declared";
+    }
+    return {
+      namespace: namespace,
+      localPart: m[3],
+      prefix: prefix,
+      name: name
+    };
+  };
+
+})(jQuery);
+/*
+ * jQuery CURIE @VERSION
+ *
+ * Copyright (c) 2008,2009 Jeni Tennison
+ * Licensed under the MIT (MIT-LICENSE.txt)
+ *
+ * Depends:
+ *  jquery.uri.js
+ */
+/**
+ * @fileOverview XML Schema datatype handling
+ * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
+ * @copyright (c) 2008,2009 Jeni Tennison
+ * @license MIT license (MIT-LICENSE.txt)
+ * @version 1.0
+ * @requires jquery.uri.js
+ */
+
+(function ($) {
+
+  var strip = function (value) {
+    return value.replace(/[ \t\n\r]+/, ' ').replace(/^ +/, '').replace(/ +$/, '');
+  };
+
+  /**
+   * Creates a new jQuery.typedValue object. This should be invoked as a method
+   * rather than constructed using new.
+   * @class Represents a value with an XML Schema datatype
+   * @param {String} value The string representation of the value
+   * @param {String} datatype The XML Schema datatype URI
+   * @returns {jQuery.typedValue}
+   * @example intValue = jQuery.typedValue('42', 'http://www.w3.org/2001/XMLSchema#integer');
+   */
+  $.typedValue = function (value, datatype) {
+    return $.typedValue.fn.init(value, datatype);
+  };
+
+  $.typedValue.fn = $.typedValue.prototype = {
+    /**
+     * The string representation of the value
+     * @memberOf jQuery.typedValue#
+     */
+    representation: undefined,
+    /**
+     * The value as an object. The type of the object will
+     * depend on the XML Schema datatype URI specified
+     * in the constructor. The following table lists the mappings
+     * currently supported:
+     * <table>
+     *   <tr>
+     *   <th>XML Schema Datatype</th>
+     *   <th>Value type</th>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#string</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#token</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#NCName</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#boolean</td>
+     *     <td>bool</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#decimal</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#integer</td>
+     *     <td>int</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#int</td>
+     *     <td>int</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#float</td>
+     *     <td>float</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#double</td>
+     *     <td>float</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#dateTime</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#date</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#gYear</td>
+     *     <td>int</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#gMonthDay</td>
+     *     <td>string</td>
+     *   </tr>
+     *   <tr>
+     *     <td>http://www.w3.org/2001/XMLSchema#anyURI</td>
+     *     <td>{@link jQuery.uri}</td>
+     *   </tr>
+     * </table>
+     * @memberOf jQuery.typedValue#
+     */
+    value: undefined,
+    /**
+     * The XML Schema datatype URI for the value's datatype
+     * @memberOf jQuery.typedValue#
+     */
+    datatype: undefined,
+
+    init: function (value, datatype) {
+      var d = $.typedValue.types[datatype];
+      if ($.typedValue.valid(value, datatype)) {
+        this.representation = value;
+        this.datatype = datatype;
+        this.value = d === undefined ? strip(value) : d.value(d.strip ? strip(value) : value);
+        return this;
+      } else {
+        throw {
+          name: 'InvalidValue',
+          message: value + ' is not a valid ' + datatype + ' value'
+        };
+      }
+    }
+  };
+
+  $.typedValue.fn.init.prototype = $.typedValue.fn;
+
+  /**
+   * An object that holds the datatypes supported by the script. The properties of this object are the URIs of the datatypes, and each datatype has four properties:
+   * <dl>
+   *   <dt>strip</dt>
+   *   <dd>A boolean value that indicates whether whitespace should be stripped from the value prior to testing against the regular expression or passing to the value function.</dd>
+   *   <dt>regex</dt>
+   *   <dd>A regular expression that valid values of the type must match.</dd>
+   *   <dt>validate</dt>
+   *   <dd>Optional. A function that performs further testing on the value.</dd>
+   *   <dt>value</dt>
+   *   <dd>A function that returns a Javascript object equivalent for the value.</dd>
+   * </dl>
+   * You can add to this object as necessary for your own datatypes, and {@link jQuery.typedValue} and {@link jQuery.typedValue.valid} will work with them.
+   * @see jQuery.typedValue
+   * @see jQuery.typedValue.valid
+   */
+  $.typedValue.types = {};
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#string'] = {
+    regex: /^.*$/,
+    strip: false,
+    /** @ignore */
+    value: function (v) {
+      return v;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#token'] = {
+    regex: /^.*$/,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return strip(v);
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#NCName'] = {
+    regex: /^[a-z_][-\.a-z0-9]+$/i,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return strip(v);
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#boolean'] = {
+    regex: /^(?:true|false|1|0)$/,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return v === 'true' || v === '1';
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#decimal'] = {
+    regex: /^[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)$/,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return v;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#integer'] = {
+    regex: /^[\-\+]?[0-9]+$/,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return parseInt(v, 10);
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#int'] = {
+    regex: /^[\-\+]?[0-9]+$/,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return parseInt(v, 10);
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'] = {
+    regex: /^(?:[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)(?:[eE][\-\+]?[0-9]+)?|[\-\+]?INF|NaN)$/,
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      if (v === '-INF') {
+        return -1 / 0;
+      } else if (v === 'INF' || v === '+INF') {
+        return 1 / 0;
+      } else {
+        return parseFloat(v);
+      }
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#double'] = {
+    regex: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].regex,
+    strip: true,
+    value: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].value
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#duration'] = {
+    regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\.[0-9]+))?S)?)$/,
+    /** @ignore */
+    validate: function (v) {
+      var m = this.regex.exec(v);
+      return m[2] || m[3] || m[4] || m[5] || m[6] || m[7];
+    },
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return v;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#yearMonthDuration'] = {
+    regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?$/,
+    /** @ignore */
+    validate: function (v) {
+      var m = this.regex.exec(v);
+      return m[2] || m[3];
+    },
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      var m = this.regex.exec(v),
+        years = m[2] || 0,
+        months = m[3] || 0;
+      months += years * 12;
+      return m[1] === '-' ? -1 * months : months;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#dateTime'] = {
+    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):(([0-9]{2})(\.([0-9]+))?)((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
+    /** @ignore */
+    validate: function (v) {
+      var
+        m = this.regex.exec(v),
+        year = parseInt(m[1], 10),
+        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, ''),
+        date;
+      if (year === 0 ||
+          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
+        return false;
+      }
+      try {
+        year = year < 100 ? Math.abs(year) + 1000 : year;
+        month = parseInt(m[2], 10);
+        day = parseInt(m[3], 10);
+        if (day > 31) {
+          return false;
+        } else if (day > 30 && !(month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12)) {
+          return false;
+        } else if (month === 2) {
+          if (day > 29) {
+            return false;
+          } else if (day === 29 && (year % 4 !== 0 || (year % 100 === 0 && year % 400 !== 0))) {
+            return false;
+          }
+        }
+        date = '' + year + '/' + m[2] + '/' + m[3] + ' ' + m[4] + ':' + m[5] + ':' + m[7] + ' ' + tz;
+        date = new Date(date);
+        return true;
+      } catch (e) {
+        return false;
+      }
+    },
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return v;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#date'] = {
+    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
+    /** @ignore */
+    validate: function (v) {
+      var
+        m = this.regex.exec(v),
+        year = parseInt(m[1], 10),
+        month = parseInt(m[2], 10),
+        day = parseInt(m[3], 10),
+        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, '');
+      if (year === 0 ||
+          month > 12 ||
+          day > 31 ||
+          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return v;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gYear'] = {
+    regex: /^-?([0-9]{4,})$/,
+    /** @ignore */
+    validate: function (v) {
+      var i = parseInt(v, 10);
+      return i !== 0;
+    },
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return parseInt(v, 10);
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gMonthDay'] = {
+    regex: /^--([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
+    /** @ignore */
+    validate: function (v) {
+      var
+        m = this.regex.exec(v),
+        month = parseInt(m[1], 10),
+        day = parseInt(m[2], 10),
+        tz = m[3] === undefined || m[3] === 'Z' ? '+0000' : m[3].replace(/:/, '');
+      if (month > 12 ||
+          day > 31 ||
+          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
+        return false;
+      } else if (month === 2 && day > 29) {
+        return false;
+      } else if ((month === 4 || month === 6 || month === 9 || month === 11) && day > 30) {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    strip: true,
+    /** @ignore */
+    value: function (v) {
+      return v;
+    }
+  };
+
+  $.typedValue.types['http://www.w3.org/2001/XMLSchema#anyURI'] = {
+    regex: /^.*$/,
+    strip: true,
+    /** @ignore */
+    value: function (v, options) {
+      var opts = $.extend({}, $.typedValue.defaults, options);
+      return $.uri.resolve(v, opts.base);
+    }
+  };
+
+  $.typedValue.defaults = {
+    base: $.uri.base(),
+    namespaces: {}
+  };
+
+  /**
+   * Checks whether a value is valid according to a given datatype. The datatype must be held in the {@link jQuery.typedValue.types} object.
+   * @param {String} value The value to validate.
+   * @param {String} datatype The URI for the datatype against which the value will be validated.
+   * @returns {boolean} True if the value is valid or the datatype is not recognised.
+   * @example validDate = $.typedValue.valid(date, 'http://www.w3.org/2001/XMLSchema#date');
+   */
+  $.typedValue.valid = function (value, datatype) {
+    var d = $.typedValue.types[datatype];
+    if (d === undefined) {
+      return true;
+    } else {
+      value = d.strip ? strip(value) : value;
+      if (d.regex.test(value)) {
+        return d.validate === undefined ? true : d.validate(value);
+      } else {
+        return false;
+      }
+    }
+  };
+
+})(jQuery);
+/*
+ * jQuery CURIE @VERSION
+ *
+ * Copyright (c) 2008,2009 Jeni Tennison
+ * Licensed under the MIT (MIT-LICENSE.txt)
+ *
+ * Depends:
+ *  jquery.uri.js
+ *  jquery.xmlns.js
+ */
+
+/**
+ * @fileOverview jQuery CURIE handling
+ * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
+ * @copyright (c) 2008,2009 Jeni Tennison
+ * @license MIT license (MIT-LICENSE.txt)
+ * @version 1.0
+ * @requires jquery.uri.js
+ * @requires jquery.xmlns.js
+ */
+(function ($) {
+
+   /**
+    * Creates a {@link jQuery.uri} object by parsing a CURIE.
+    * @methodOf jQuery
+    * @param {String} curie The CURIE to be parsed
+    * @param {String} uri The URI string to be converted to a CURIE.
+    * @param {Object} [options] CURIE parsing options
+    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
+    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
+    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
+    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']] A list of local names that will always be mapped to the URI specified by reservedNamespace.
+    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
+    * <dl>
+    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>
+    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>
+    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
+    * </dl>
+    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
+    */
+  $.curie = function (curie, options) {
+    var
+      opts = $.extend({}, $.curie.defaults, options || {}),
+      m = /^(([^:]*):)?(.+)$/.exec(curie),
+      prefix = m[2],
+      local = m[3],
+      ns = opts.namespaces[prefix];
+    if (/^:.+/.test(curie)) { // This is the case of a CURIE like ":test"
+      if (opts.reservedNamespace === undefined || opts.reservedNamespace === null) {
+        throw "Malformed CURIE: No prefix and no default namespace for unprefixed CURIE " + curie;
+      } else {
+        ns = opts.reservedNamespace;
+      }
+    } else if (prefix) {
+      if (ns === undefined) {
+        throw "Malformed CURIE: No namespace binding for " + prefix + " in CURIE " + curie;
+      }
+    } else {
+      if (opts.charcase === 'lower') {
+        curie = curie.toLowerCase();
+      } else if (opts.charcase === 'upper') {
+        curie = curie.toUpperCase();
+      }
+      if (opts.reserved.length && $.inArray(curie, opts.reserved) >= 0) {
+        ns = opts.reservedNamespace;
+        local = curie;
+      } else if (opts.defaultNamespace === undefined || opts.defaultNamespace === null) {
+        // the default namespace is provided by the application; it's not clear whether
+        // the default XML namespace should be used if there's a colon but no prefix
+        throw "Malformed CURIE: No prefix and no default namespace for unprefixed CURIE " + curie;
+      } else {
+        ns = opts.defaultNamespace;
+      }
+    }
+    return $.uri(ns + local);
+  };
+
+  $.curie.defaults = {
+    namespaces: {},
+    reserved: [],
+    reservedNamespace: undefined,
+    defaultNamespace: undefined,
+    charcase: 'preserve'
+  };
+
+   /**
+    * Creates a {@link jQuery.uri} object by parsing a safe CURIE string (a CURIE
+    * contained within square brackets). If the input safeCurie string does not
+    * start with '[' and end with ']', the entire string content will be interpreted
+    * as a URI string.
+    * @methodOf jQuery
+    * @param {String} safeCurie The safe CURIE string to be parsed.
+    * @param {Object} [options] CURIE parsing options
+    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
+    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
+    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
+    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
+      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
+      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]
+                        A list of local names that will always be mapped to the URI specified by reservedNamespace.
+    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
+    * <dl>
+    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>
+    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>
+    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
+    * </dl>
+    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
+    */
+  $.safeCurie = function (safeCurie, options) {
+    var m = /^\[([^\]]+)\]$/.exec(safeCurie);
+    return m ? $.curie(m[1], options) : $.uri(safeCurie);
+  };
+
+   /**
+    * Creates a CURIE string from a URI string.
+    * @methodOf jQuery
+    * @param {String} uri The URI string to be converted to a CURIE.
+    * @param {Object} [options] CURIE parsing options
+    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#']
+    *        If the input URI starts with this value, the generated CURIE will
+    *        have no namespace prefix and will start with a colon character (:),
+    *        unless the local part of the CURIE is one of the reserved names specified
+    *        by the reservedNames option (see below), in which case the generated
+    *        CURIE will have no namespace prefix and will not start with a colon
+    *        character.
+    * @param {string} [options.defaultNamespace]  If the input URI starts with this value, the generated CURIE will have no namespace prefix and will not start with a colon.
+    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
+    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
+      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
+      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]
+                        A list of local names that will always be mapped to the URI specified by reservedNamespace.
+    * @param {string} [options.charcase='lower'] Specifies the case normalisation done to the CURIE. Acceptable values are:
+    * <dl>
+    * <dt>lower</dt><dd>Normalise the CURIE to lower case.</dd>
+    * <dt>upper</dt><dd>Normalise the CURIE to upper case.</dd>
+    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
+    * </dl>
+    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
+    */
+  $.createCurie = function (uri, options) {
+    var opts = $.extend({}, $.curie.defaults, options || {}),
+      ns = opts.namespaces,
+      curie;
+    uri = $.uri(uri).toString();
+    if (opts.reservedNamespace !== undefined && 
+        uri.substring(0, opts.reservedNamespace.toString().length) === opts.reservedNamespace.toString()) {
+      curie = uri.substring(opts.reservedNamespace.toString().length);
+      if ($.inArray(curie, opts.reserved) === -1) {
+        curie = ':' + curie;
+      }
+    } else {
+      $.each(ns, function (prefix, namespace) {
+        if (uri.substring(0, namespace.toString().length) === namespace.toString()) {
+          curie = prefix + ':' + uri.substring(namespace.toString().length);
+          return null;
+        }
+      });
+    }
+    if (curie === undefined) {
+      throw "No Namespace Binding: There's no appropriate namespace binding for generating a CURIE from " + uri;
+    } else {
+      return curie;
+    }
+  };
+
+   /**
+    * Creates a {@link jQuery.uri} object by parsing the specified
+    * CURIE string in the context of the namespaces defined by the
+    * jQuery selection.
+    * @methodOf jQuery#
+    * @name jQuery#curie
+    * @param {String} curie The CURIE string to be parsed
+    * @param {Object} options The CURIE parsing options.
+    *        See {@link jQuery.curie} for details of the supported options.
+    *        The namespace declarations declared on the current jQuery
+    *        selection (and inherited from any ancestor elements) will automatically
+    *        be included in the options.namespaces property.
+    * @returns {jQuery.uri}
+    * @see jQuery.curie
+    */
+  $.fn.curie = function (curie, options) {
+    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
+    return $.curie(curie, opts);
+  };
+
+   /**
+    * Creates a {@link jQuery.uri} object by parsing the specified
+    * safe CURIE string in the context of the namespaces defined by
+    * the jQuery selection.
+    *
+    * @methodOf jQuery#
+    * @name jQuery#safeCurie
+    * @param {String} safeCurie The safe CURIE string to be parsed. See {@link jQuery.safeCurie} for details on how safe CURIE strings are processed.
+    * @param {Object} options   The CURIE parsing options.
+    *        See {@link jQuery.safeCurie} for details of the supported options.
+    *        The namespace declarations declared on the current jQuery
+    *        selection (and inherited from any ancestor elements) will automatically
+    *        be included in the options.namespaces property.
+    * @returns {jQuery.uri}
+    * @see jQuery.safeCurie
+    */
+  $.fn.safeCurie = function (safeCurie, options) {
+    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
+    return $.safeCurie(safeCurie, opts);
+  };
+
+   /**
+    * Creates a CURIE string from a URI string using the namespace
+    * bindings in the context of the current jQuery selection.
+    *
+    * @methodOf jQuery#
+    * @name jQuery#createCurie
+    * @param {String|jQuery.uri} uri The URI string to be converted to a CURIE
+    * @param {Object} options the CURIE parsing options.
+    *        See {@link jQuery.createCurie} for details of the supported options.
+    *        The namespace declarations declared on the current jQuery
+    *        selection (and inherited from any ancestor elements) will automatically
+    *        be included in the options.namespaces property.
+    * @returns {String}
+    * @see jQuery.createCurie
+    */
+  $.fn.createCurie = function (uri, options) {
+    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
+    return $.createCurie(uri, opts);
+  };
+
+  $.fn.curie.defaults = {
+    reserved: [
+      'alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
+      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
+      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up'
+    ],
+    reservedNamespace: 'http://www.w3.org/1999/xhtml/vocab#',
+    defaultNamespace: undefined,
+    charcase: 'lower'
+  };
+
+})(jQuery);
+/*
+ * jQuery RDF @VERSION
+ *
+ * Copyright (c) 2008,2009 Jeni Tennison
+ * Licensed under the MIT (MIT-LICENSE.txt)
+ *
+ * Depends:
+ *  jquery.uri.js
+ *  jquery.xmlns.js
+ *  jquery.datatype.js
+ *  jquery.curie.js
+ *  jquery.json.js
+ */
+/**
+ * @fileOverview jQuery RDF
+ * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
+ * @copyright (c) 2008,2009 Jeni Tennison
+ * @license MIT license (MIT-LICENSE.txt)
+ * @version 1.0
+ */
+/**
+ * @exports $ as jQuery
+ */
+/**
+ * @ignore
+ */
+(function ($) {
+  var
+    memResource = {},
+    memBlank = {},
+    memLiteral = {},
+    memTriple = {},
+    memPattern = {},
+    
+    xsdNs = "http://www.w3.org/2001/XMLSchema#",
+    rdfNs = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+    rdfsNs = "http://www.w3.org/2000/01/rdf-schema#",
+    
+    uriRegex = /^<(([^>]|\\>)*)>$/,
+    literalRegex = /^("""((\\"|[^"])*)"""|"((\\"|[^"])*)")(@([a-z]+(-[a-z0-9]+)*)|\^\^(.+))?$/,
+    tripleRegex = /(("""((\\"|[^"])*)""")|("(\\"|[^"]|)*")|(<(\\>|[^>])*>)|\S)+/g,
+
+    blankNodeSeed = databankSeed = new Date().getTime() % 1000,
+    blankNodeID = function () {
+      blankNodeSeed += 1;
+      return 'b' + blankNodeSeed.toString(16);
+    },
+
+    databankID = function () {
+      databankSeed += 1;
+      return 'data' + databankSeed.toString(16);
+    },
+    databanks = {},
+
+    documentQueue = {},
+
+    subject = function (subject, opts) {
+      if (typeof subject === 'string') {
+        try {
+          return $.rdf.resource(subject, opts);
+        } catch (e) {
+          try {
+            return $.rdf.blank(subject, opts);
+          } catch (f) {
+            throw "Bad Triple: Subject " + subject + " is not a resource: " + f;
+          }
+        }
+      } else {
+        return subject;
+      }
+    },
+
+    property = function (property, opts) {
+      if (property === 'a') {
+        return $.rdf.type;
+      } else if (typeof property === 'string') {
+        try {
+          return $.rdf.resource(property, opts);
+        } catch (e) {
+          throw "Bad Triple: Property " + property + " is not a resource: " + e;
+        }
+      } else {
+        return property;
+      }
+    },
+
+    object = function (object, opts) {
+      if (typeof object === 'string') {
+        try {
+          return $.rdf.resource(object, opts);
+        } catch (e) {
+          try {
+            return $.rdf.blank(object, opts);
+          } catch (f) {
+            try {
+              return $.rdf.literal(object, opts);
+            } catch (g) {
+              throw "Bad Triple: Object " + object + " is not a resource or a literal " + g;
+            }
+          }
+        }
+      } else {
+        return object;
+      }
+    },
+
+    testResource = function (resource, filter, existing) {
+      var variable;
+      if (typeof filter === 'string') {
+        variable = filter.substring(1);
+        if (existing[variable] && existing[variable] !== resource) {
+          return null;
+        } else {
+          existing[variable] = resource;
+          return existing;
+        }
+      } else if (filter === resource) {
+        return existing;
+      } else {
+        return null;
+      }
+    },
+
+    findMatches = function (databank, pattern) {
+      if (databank.union === undefined) {
+        if (pattern.subject.type !== undefined) {
+          if (databank.subjectIndex[pattern.subject] === undefined) {
+            return [];
+          }
+          return $.map(databank.subjectIndex[pattern.subject], function (triple) {
+            var bindings = pattern.exec(triple);
+            return bindings === null ? null : { bindings: bindings, triples: [triple] };
+          });
+        } else if (pattern.object.type === 'uri' || pattern.object.type === 'bnode') {
+          if (databank.objectIndex[pattern.object] === undefined) {
+            return [];
+          }
+          return $.map(databank.objectIndex[pattern.object], function (triple) {
+            var bindings = pattern.exec(triple);
+            return bindings === null ? null : { bindings: bindings, triples: [triple] };
+          });
+        } else if (pattern.property.type !== undefined) {
+          if (databank.propertyIndex[pattern.property] === undefined) {
+            return [];
+          }
+          return $.map(databank.propertyIndex[pattern.property], function (triple) {
+            var bindings = pattern.exec(triple);
+            return bindings === null ? null : { bindings: bindings, triples: [triple] };
+          });
+        }
+      }
+      return $.map(databank.triples(), function (triple) {
+        var bindings = pattern.exec(triple);
+        return bindings === null ? null : { bindings: bindings, triples: [triple] };
+      });
+    },
+
+    mergeMatches = function (existingMs, newMs, optional) {
+      return $.map(existingMs, function (existingM, i) {
+        var compatibleMs = $.map(newMs, function (newM) {
+          // For newM to be compatible with existingM, all the bindings
+          // in newM must either be the same as in existingM, or not
+          // exist in existingM
+          var k, b, isCompatible = true;
+          for (k in newM.bindings) {
+            b = newM.bindings[k];
+            if (!(existingM.bindings[k] === undefined ||
+                  existingM.bindings[k] === b)) {
+              isCompatible = false;
+              break;
+            }
+          }
+          return isCompatible ? newM : null;
+        });
+        if (compatibleMs.length > 0) {
+          return $.map(compatibleMs, function (compatibleM) {
+            return {
+              bindings: $.extend({}, existingM.bindings, compatibleM.bindings),
+              triples: $.unique(existingM.triples.concat(compatibleM.triples))
+            };
+          });
+        } else {
+          return optional ? existingM : null;
+        }
+      });
+    },
+
+    registerQuery = function (databank, query) {
+      var s, p, o;
+      if (query.filterExp !== undefined && !$.isFunction(query.filterExp)) {
+        if (databank.union === undefined) {
+          s = typeof query.filterExp.subject === 'string' ? '' : query.filterExp.subject;
+          p = typeof query.filterExp.property === 'string' ? '' : query.filterExp.property;
+          o = typeof query.filterExp.object === 'string' ? '' : query.filterExp.object;
+          if (databank.queries[s] === undefined) {
+            databank.queries[s] = {};
+          }
+          if (databank.queries[s][p] === undefined) {
+            databank.queries[s][p] = {};
+          }
+          if (databank.queries[s][p][o] === undefined) {
+            databank.queries[s][p][o] = [];
+          }
+          databank.queries[s][p][o].push(query);
+        } else {
+          $.each(databank.union, function (i, databank) {
+            registerQuery(databank, query);
+          });
+        }
+      }
+    },
+
+    resetQuery = function (query) {
+      query.length = 0;
+      query.matches = [];
+      $.each(query.children, function (i, child) {
+        resetQuery(child);
+      });
+      $.each(query.partOf, function (i, union) {
+        resetQuery(union);
+      });
+    },
+
+    updateQuery = function (query, matches) {
+      if (matches.length > 0) {
+        $.each(query.children, function (i, child) {
+          leftActivate(child, matches);
+        });
+        $.each(query.partOf, function (i, union) {
+          updateQuery(union, matches);
+        });
+        $.each(matches, function (i, match) {
+          query.matches.push(match);
+          Array.prototype.push.call(query, match.bindings);
+        });
+      }
+    },
+
+    leftActivate = function (query, matches) {
+      var newMatches;
+      if (query.union === undefined) {
+        if (query.top || query.parent.top) {
+          newMatches = query.alphaMemory;
+        } else {
+          matches = matches || query.parent.matches;
+          if ($.isFunction(query.filterExp)) {
+            newMatches = $.map(matches, function (match, i) {
+              return query.filterExp.call(match.bindings, i, match.bindings, match.triples) ? match : null;
+            });
+          } else {
+            newMatches = mergeMatches(matches, query.alphaMemory, query.filterExp.optional);
+          }
+        }
+      } else {
+        newMatches = $.map(query.union, function (q) {
+          return q.matches;
+        });
+      }
+      updateQuery(query, newMatches);
+    },
+
+    rightActivate = function (query, match) {
+      var newMatches;
+      if (query.filterExp.optional) {
+        resetQuery(query);
+        leftActivate(query);
+      } else {
+        if (query.top || query.parent.top) {
+          newMatches = [match];
+        } else {
+          newMatches = mergeMatches(query.parent.matches, [match], false);
+        }
+        updateQuery(query, newMatches);
+      }
+    },
+
+    addToQuery = function (query, triple) {
+      var match,
+        bindings = query.filterExp.exec(triple);
+      if (bindings !== null) {
+        match = { triples: [triple], bindings: bindings };
+        query.alphaMemory.push(match);
+        rightActivate(query, match);
+      }
+    },
+
+    removeFromQuery = function (query, triple) {
+      query.alphaMemory.splice($.inArray(triple, query.alphaMemory), 1);
+      resetQuery(query);
+      leftActivate(query);
+    },
+
+    addToQueries = function (queries, triple) {
+      $.each(queries, function (i, query) {
+        addToQuery(query, triple);
+      });
+    },
+
+    removeFromQueries = function (queries, triple) {
+      $.each(queries, function (i, query) {
+        removeFromQuery(query, triple);
+      });
+    },
+
+    addToDatabankQueries = function (databank, triple) {
+      var s = triple.subject,
+        p = triple.property,
+        o = triple.object;
+      if (databank.union === undefined) {
+        if (databank.queries[s] !== undefined) {
+          if (databank.queries[s][p] !== undefined) {
+            if (databank.queries[s][p][o] !== undefined) {
+              addToQueries(databank.queries[s][p][o], triple);
+            }
+            if (databank.queries[s][p][''] !== undefined) {
+              addToQueries(databank.queries[s][p][''], triple);
+            }
+          }
+          if (databank.queries[s][''] !== undefined) {
+            if (databank.queries[s][''][o] !== undefined) {
+              addToQueries(databank.queries[s][''][o], triple);
+            }
+            if (databank.queries[s][''][''] !== undefined) {
+              addToQueries(databank.queries[s][''][''], triple);
+            }
+          }
+        }
+        if (databank.queries[''] !== undefined) {
+          if (databank.queries[''][p] !== undefined) {
+            if (databank.queries[''][p][o] !== undefined) {
+              addToQueries(databank.queries[''][p][o], triple);
+            }
+            if (databank.queries[''][p][''] !== undefined) {
+              addToQueries(databank.queries[''][p][''], triple);
+            }
+          }
+          if (databank.queries[''][''] !== undefined) {
+            if (databank.queries[''][''][o] !== undefined) {
+              addToQueries(databank.queries[''][''][o], triple);
+            }
+            if (databank.queries[''][''][''] !== undefined) {
+              addToQueries(databank.queries[''][''][''], triple);
+            }
+          }
+        }
+      } else {
+        $.each(databank.union, function (i, databank) {
+          addToDatabankQueries(databank, triple);
+        });
+      }
+    },
+
+    removeFromDatabankQueries = function (databank, triple) {
+      var s = triple.subject,
+        p = triple.property,
+        o = triple.object;
+      if (databank.union === undefined) {
+        if (databank.queries[s] !== undefined) {
+          if (databank.queries[s][p] !== undefined) {
+            if (databank.queries[s][p][o] !== undefined) {
+              removeFromQueries(databank.queries[s][p][o], triple);
+            }
+            if (databank.queries[s][p][''] !== undefined) {
+              removeFromQueries(databank.queries[s][p][''], triple);
+            }
+          }
+          if (databank.queries[s][''] !== undefined) {
+            if (databank.queries[s][''][o] !== undefined) {
+              removeFromQueries(databank.queries[s][''][o], triple);
+            }
+            if (databank.queries[s][''][''] !== undefined) {
+              removeFromQueries(databank.queries[s][''][''], triple);
+            }
+          }
+        }
+        if (databank.queries[''] !== undefined) {
+          if (databank.queries[''][p] !== undefined) {
+            if (databank.queries[''][p][o] !== undefined) {
+              removeFromQueries(databank.queries[''][p][o], triple);
+            }
+            if (databank.queries[''][p][''] !== undefined) {
+              removeFromQueries(databank.queries[''][p][''], triple);
+            }
+          }
+          if (databank.queries[''][''] !== undefined) {
+            if (databank.queries[''][''][o] !== undefined) {
+              removeFromQueries(databank.queries[''][''][o], triple);
+            }
+            if (databank.queries[''][''][''] !== undefined) {
+              removeFromQueries(databank.queries[''][''][''], triple);
+            }
+          }
+        }
+      } else {
+        $.each(databank.union, function (i, databank) {
+          removeFromDatabankQueries(databank, triple);
+        });
+      }
+    },
+
+    createJson = function (triples) {
+      var e = {},
+        i, t, s, p;
+      for (i = 0; i < triples.length; i += 1) {
+        t = triples[i];
+        s = t.subject.value.toString();
+        p = t.property.value.toString();
+        if (e[s] === undefined) {
+          e[s] = {};
+        }
+        if (e[s][p] === undefined) {
+          e[s][p] = [];
+        }
+        e[s][p].push(t.object.dump());
+      }
+      return e;
+    },
+
+    parseJson = function (data) {
+      var s, subject, p, property, o, object, i, opts, triples = [];
+      for (s in data) {
+        subject = (s.substring(0, 2) === '_:') ? $.rdf.blank(s) : $.rdf.resource('<' + s + '>');
+        for (p in data[s]) {
+          property = $.rdf.resource('<' + p + '>');
+          for (i = 0; i < data[s][p].length; i += 1) {
+            o = data[s][p][i];
+            if (o.type === 'uri') {
+              object = $.rdf.resource('<' + o.value + '>');
+            } else if (o.type === 'bnode') {
+              object = $.rdf.blank(o.value);
+            } else {
+              // o.type === 'literal'
+              if (o.datatype !== undefined) {
+                object = $.rdf.literal(o.value, { datatype: o.datatype });
+              } else {
+                opts = {};
+                if (o.lang !== undefined) {
+                  opts.lang = o.lang;
+                }
+                object = $.rdf.literal('"' + o.value + '"', opts);
+              }
+            }
+            triples.push($.rdf.triple(subject, property, object));
+          }
+        }
+      }
+      return triples;
+    },
+
+    addAttribute = function (parent, namespace, name, value) {
+      var doc = parent.ownerDocument,
+        a;
+      if (namespace !== undefined && namespace !== null) {
+        if (doc.createAttributeNS) {
+          a = doc.createAttributeNS(namespace, name);
+          a.nodeValue = value;
+          parent.attributes.setNamedItemNS(a);
+        } else {
+          a = doc.createNode(2, name, namespace);
+          a.nodeValue = value;
+          parent.attributes.setNamedItem(a);
+        }
+      } else {
+        a = doc.createAttribute(name);
+        a.nodeValue = value;
+        parent.attributes.setNamedItem(a);
+      }
+      return parent;
+    },
+
+    createXmlnsAtt = function (parent, namespace, prefix) {
+      if (prefix) {
+        addAttribute(parent, 'http://www.w3.org/2000/xmlns/', 'xmlns:' + prefix, namespace);
+      } else {
+        addAttribute(parent, undefined, 'xmlns', namespace);
+      }
+      return parent;
+    },
+
+    createDocument = function (namespace, name) {
+      var doc, xmlns = '', prefix, addAttribute = false;
+      if (namespace !== undefined && namespace !== null) {
+        if (/:/.test(name)) {
+          prefix = /([^:]+):/.exec(name)[1];
+        }
+        addAttribute = true;
+      }
+      if (document.implementation &&
+          document.implementation.createDocument) {
+        doc = document.implementation.createDocument(namespace, name, null);
+        if (addAttribute) {
+          createXmlnsAtt(doc.documentElement, namespace, prefix);
+        }
+        return doc;
+      } else {
+        doc = new ActiveXObject("Microsoft.XMLDOM");
+        doc.async = "false";
+        if (prefix === undefined) {
+          xmlns = ' xmlns="' + namespace + '"';
+        } else {
+          xmlns = ' xmlns:' + prefix + '="' + namespace + '"';
+        }
+        doc.loadXML('<' + name + xmlns + '/>');
+        return doc;
+      }
+    },
+
+    appendElement = function (parent, namespace, name) {
+      var doc = parent.ownerDocument,
+        e;
+      if (namespace !== undefined && namespace !== null) {
+        e = doc.createElementNS ? doc.createElementNS(namespace, name) : doc.createNode(1, name, namespace);
+      } else {
+        e = doc.createElement(name);
+      }
+      parent.appendChild(e);
+      return e;
+    },
+
+    appendText = function (parent, text) {
+      var doc = parent.ownerDocument,
+        t;
+      t = doc.createTextNode(text);
+      parent.appendChild(t);
+      return parent;
+    },
+
+    appendXML = function (parent, xml) {
+      var parser, doc, i, child;
+      try {
+        doc = new ActiveXObject('Microsoft.XMLDOM');
+        doc.async = "false";
+        doc.loadXML('<temp>' + xml + '</temp>');
+      } catch(e) {
+        parser = new DOMParser();
+        doc = parser.parseFromString('<temp>' + xml + '</temp>', 'text/xml');
+      }
+      for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {
+        parent.appendChild(doc.documentElement.childNodes[i].cloneNode(true));
+      }
+      return parent;
+    },
+
+    createRdfXml = function (triples, options) {
+      var doc = createDocument(rdfNs, 'rdf:RDF'),
+        dump = createJson(triples),
+        namespaces = options.namespaces || {},
+        n, s, se, p, pe, i, v,
+        m, local, ns, prefix;
+      for (n in namespaces) {
+        createXmlnsAtt(doc.documentElement, namespaces[n], n);
+      }
+      for (s in dump) {
+        if (dump[s][$.rdf.type.value] !== undefined) {
+          m = /(.+[#\/])([^#\/]+)/.exec(dump[s][$.rdf.type.value][0].value);
+          ns = m[1];
+          local = m[2];
+          for (n in namespaces) {
+            if (namespaces[n].toString() === ns) {
+              prefix = n;
+              break;
+            }
+          }
+          se = appendElement(doc.documentElement, ns, prefix + ':' + local);
+        } else {
+          se = appendElement(doc.documentElement, rdfNs, 'rdf:Description');
+        }
+        if (/^_:/.test(s)) {
+          addAttribute(se, rdfNs, 'rdf:nodeID', s.substring(2));
+        } else {
+          addAttribute(se, rdfNs, 'rdf:about', s);
+        }
+        for (p in dump[s]) {
+          if (p !== $.rdf.type.value.toString() || dump[s][p].length > 1) {
+            m = /(.+[#\/])([^#\/]+)/.exec(p);
+            ns = m[1];
+            local = m[2];
+            for (n in namespaces) {
+              if (namespaces[n].toString() === ns) {
+                prefix = n;
+                break;
+              }
+            }
+            for (i = (p === $.rdf.type.value.toString() ? 1 : 0); i < dump[s][p].length; i += 1) {
+              v = dump[s][p][i];
+              pe = appendElement(se, ns, prefix + ':' + local);
+              if (v.type === 'uri') {
+                addAttribute(pe, rdfNs, 'rdf:resource', v.value);
+              } else if (v.type === 'literal') {
+                if (v.datatype !== undefined) {
+                  if (v.datatype === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') {
+                    addAttribute(pe, rdfNs, 'rdf:parseType', 'Literal');
+                    appendXML(pe, v.value);
+                  } else {
+                    addAttribute(pe, rdfNs, 'rdf:datatype', v.datatype);
+                    appendText(pe, v.value);
+                  }
+                } else if (v.lang !== undefined) {
+                  addAttribute(pe, 'http://www.w3.org/XML/1998/namespace', 'xml:lang', v.lang);
+                  appendText(pe, v.value);
+                } else {
+                  appendText(pe, v.value);
+                }
+              } else {
+                // blank node
+                addAttribute(pe, rdfNs, 'rdf:nodeID', v.value.substring(2));
+              }
+            }
+          }
+        }
+      }
+      return doc;
+    },
+
+    getDefaultNamespacePrefix = function (namespaceUri) {
+      switch (namespaceUri) {
+        case 'http://www.w3.org/1999/02/22-rdf-syntax-ns':
+          return 'rdf';
+        case 'http://www.w3.org/XML/1998/namespace':
+          return 'xml';
+        case 'http://www.w3.org/2000/xmlns/':
+          return 'xmlns';
+        default:
+          throw ('No default prefix mapped for namespace ' + namespaceUri);
+      }
+    },
+
+    hasAttributeNS  = function(elem, namespace, name){
+      var basename;
+      if (elem.hasAttributeNS) {
+        return elem.hasAttributeNS(namespace, name);
+      } else {
+        try {
+          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;
+          return elem.attributes.getQualifiedItem(basename, namespace) !== null;
+        } catch (e) {
+          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name) !== null;
+        }
+      }
+    },
+
+    getAttributeNS = function(elem, namespace, name){
+      var basename;
+      if (elem.getAttributeNS) {
+        return elem.getAttributeNS(namespace, name);
+      } else {
+        try {
+          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;
+          return elem.attributes.getQualifiedItem(basename, namespace).nodeValue;
+        } catch (e) {
+          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name);
+        }
+      }
+    },
+
+    getLocalName = function(elem){
+      return elem.localName || elem.baseName;
+    },
+
+    parseRdfXmlSubject = function (elem, base) {
+      var s, subject;
+      if (hasAttributeNS(elem, rdfNs, 'about')) {
+        s = getAttributeNS(elem, rdfNs, 'about');
+        subject = $.rdf.resource('<' + s + '>', { base: base });
+      } else if (hasAttributeNS(elem, rdfNs, 'ID')) {
+        s = getAttributeNS(elem, rdfNs, 'ID');
+        subject = $.rdf.resource('<#' + s + '>', { base: base });
+      } else if (hasAttributeNS(elem, rdfNs, 'nodeID')) {
+        s = getAttributeNS(elem, rdfNs, 'nodeID');
+        subject = $.rdf.blank('_:' + s);
+      } else {
+        subject = $.rdf.blank('[]');
+      }
+      return subject;
+    },
+
+    parseRdfXmlDescription = function (elem, isDescription, base, lang) {
+      var subject, p, property, o, object, reified, lang, i, j, li = 1,
+        collection1, collection2, collectionItem, collectionItems = [],
+        parseType, serializer, literalOpts = {}, oTriples, triples = [];
+      lang = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;
+      base = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'base') || base;
+      if (lang !== null && lang !== undefined && lang !== '') {
+        literalOpts = { lang: lang };
+      }
+      subject = parseRdfXmlSubject(elem, base);
+      if (isDescription && (elem.namespaceURI !== rdfNs || getLocalName(elem) !== 'Description')) {
+        property = $.rdf.type;
+        object = $.rdf.resource('<' + elem.namespaceURI + getLocalName(elem) + '>');
+        triples.push($.rdf.triple(subject, property, object));
+      }
+      for (i = 0; i < elem.attributes.length; i += 1) {
+        p = elem.attributes.item(i);
+        if (p.namespaceURI !== undefined &&
+            p.namespaceURI !== 'http://www.w3.org/2000/xmlns/' &&
+            p.namespaceURI !== 'http://www.w3.org/XML/1998/namespace' &&
+            p.prefix !== 'xmlns' &&
+            p.prefix !== 'xml') {
+          if (p.namespaceURI !== rdfNs) {
+            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');
+            object = $.rdf.literal(literalOpts.lang ? p.nodeValue : '"' + p.nodeValue + '"', literalOpts);
+            triples.push($.rdf.triple(subject, property, object));
+          } else if (getLocalName(p) === 'type') {
+            property = $.rdf.type;
+            object = $.rdf.resource('<' + p.nodeValue + '>', { base: base });
+            triples.push($.rdf.triple(subject, property, object));
+          }
+        }
+      }
+      for (i = 0; i < elem.childNodes.length; i += 1) {
+        p = elem.childNodes[i];
+        if (p.nodeType === 1) {
+          if (p.namespaceURI === rdfNs && getLocalName(p) === 'li') {
+            property = $.rdf.resource('<' + rdfNs + '_' + li + '>');
+            li += 1;
+          } else {
+            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');
+          }
+          lang = getAttributeNS(p, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;
+          if (lang !== null && lang !== undefined && lang !== '') {
+            literalOpts = { lang: lang };
+          }
+          if (hasAttributeNS(p, rdfNs, 'resource')) {
+            o = getAttributeNS(p, rdfNs, 'resource');
+            object = $.rdf.resource('<' + o + '>', { base: base });
+          } else if (hasAttributeNS(p, rdfNs, 'nodeID')) {
+            o = getAttributeNS(p, rdfNs, 'nodeID');
+            object = $.rdf.blank('_:' + o);
+          } else if (hasAttributeNS(p, rdfNs, 'parseType')) {
+            parseType = getAttributeNS(p, rdfNs, 'parseType');
+            if (parseType === 'Literal') {
+              try {
+                serializer = new XMLSerializer();
+                o = serializer.serializeToString(p.getElementsByTagName('*')[0]);
+              } catch (e) {
+                o = "";
+                for (j = 0; j < p.childNodes.length; j += 1) {
+                  o += p.childNodes[j].xml;
+                }
+              }
+              object = $.rdf.literal(o, { datatype: rdfNs + 'XMLLiteral' });
+            } else if (parseType === 'Resource') {
+              oTriples = parseRdfXmlDescription(p, false, base, lang);
+              if (oTriples.length > 0) {
+                object = oTriples[oTriples.length - 1].subject;
+                triples = triples.concat(oTriples);
+              } else {
+                object = $.rdf.blank('[]');
+              }
+            } else if (parseType === 'Collection') {
+              if (p.getElementsByTagName('*').length > 0) {
+                for (j = 0; j < p.childNodes.length; j += 1) {
+                  o = p.childNodes[j];
+                  if (o.nodeType === 1) {
+                    collectionItems.push(o);
+                  }
+                }
+                collection1 = $.rdf.blank('[]');
+                object = collection1;
+                for (j = 0; j < collectionItems.length; j += 1) {
+                  o = collectionItems[j];
+                  oTriples = parseRdfXmlDescription(o, true, base, lang);
+                  if (oTriples.length > 0) {
+                    collectionItem = oTriples[oTriples.length - 1].subject;
+                    triples = triples.concat(oTriples);
+                  } else {
+                    collectionItem = parseRdfXmlSubject(o);
+                  }
+                  triples.push($.rdf.triple(collection1, $.rdf.first, collectionItem));
+                  if (j === collectionItems.length - 1) {
+                    triples.push($.rdf.triple(collection1, $.rdf.rest, $.rdf.nil));
+                  } else {
+                    collection2 = $.rdf.blank('[]');
+                    triples.push($.rdf.triple(collection1, $.rdf.rest, collection2));
+                    collection1 = collection2;
+                  }
+                }
+              } else {
+                object = $.rdf.nil;
+              }
+            }
+          } else if (hasAttributeNS(p, rdfNs, 'datatype')) {
+            o = p.childNodes[0].nodeValue;
+            object = $.rdf.literal(o, { datatype: getAttributeNS(p, rdfNs, 'datatype') });
+          } else if (p.getElementsByTagName('*').length > 0) {
+            for (j = 0; j < p.childNodes.length; j += 1) {
+              o = p.childNodes[j];
+              if (o.nodeType === 1) {
+                oTriples = parseRdfXmlDescription(o, true, base, lang);
+                if (oTriples.length > 0) {
+                  object = oTriples[oTriples.length - 1].subject;
+                  triples = triples.concat(oTriples);
+                } else {
+                  object = parseRdfXmlSubject(o);
+                }
+              }
+            }
+          } else if (p.childNodes.length > 0) {
+            o = p.childNodes[0].nodeValue;
+            object = $.rdf.literal(literalOpts.lang ? o : '"' + o + '"', literalOpts);
+          } else {
+            oTriples = parseRdfXmlDescription(p, false, base, lang);
+            if (oTriples.length > 0) {
+              object = oTriples[oTriples.length - 1].subject;
+              triples = triples.concat(oTriples);
+            } else {
+              object = $.rdf.blank('[]');
+            }
+          }
+          triples.push($.rdf.triple(subject, property, object));
+          if (hasAttributeNS(p, rdfNs, 'ID')) {
+            reified = $.rdf.resource('<#' + getAttributeNS(p, rdfNs, 'ID') + '>', { base: base });
+            triples.push($.rdf.triple(reified, $.rdf.subject, subject));
+            triples.push($.rdf.triple(reified, $.rdf.property, property));
+            triples.push($.rdf.triple(reified, $.rdf.object, object));
+          }
+        }
+      }
+      return triples;
+    },
+
+    parseRdfXml = function (doc) {
+      var i, lang, d, triples = [];
+      if (doc.documentElement.namespaceURI === rdfNs && getLocalName(doc.documentElement) === 'RDF') {
+        lang = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'lang');
+        base = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'base') || $.uri.base();
+        triples = $.map(doc.documentElement.childNodes, function (d) {
+          if (d.nodeType === 1) {
+            return parseRdfXmlDescription(d, true, base, lang);
+          } else {
+            return null;
+          }
+        });
+        /*
+        for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {
+          d = doc.documentElement.childNodes[i];
+          if (d.nodeType === 1) {
+            triples = triples.concat(parseRdfXmlDescription(d, true, base, lang));
+          }
+        }
+        */
+      } else {
+        triples = parseRdfXmlDescription(doc.documentElement, true);
+      }
+      return triples;
+    },
+    
+    group = function (bindings, variables, base) {
+      var variable = variables[0], grouped = {}, results = [], i, newbase;
+      base = base || {};
+      if (variables.length === 0) {
+        for (i = 0; i < bindings.length; i += 1) {
+          for (v in bindings[i]) {
+            if (base[v] === undefined) {
+              base[v] = [];
+            }
+            if ($.isArray(base[v])) {
+              base[v].push(bindings[i][v]);
+            }
+          }
+        }
+        return [base];
+      }
+      // collect together the grouped results
+      for (i = 0; i < bindings.length; i += 1) {
+        key = bindings[i][variable];
+        if (grouped[key] === undefined) {
+          grouped[key] = [];
+        }
+        grouped[key].push(bindings[i]);
+      }
+      // call recursively on each group
+      variables = variables.splice(1, 1);
+      for (v in grouped) {
+        newbase = $.extend({}, base);
+        newbase[variable] = grouped[v][0][variable];
+        results = results.concat(group(grouped[v], variables, newbase));
+      }
+      return results;
+    },
+    
+    queue = function (databank, url, callbacks) {
+      if (documentQueue[databank.id] === undefined) {
+        documentQueue[databank.id] = {};
+      }
+      if (documentQueue[databank.id][url] === undefined) {
+        documentQueue[databank.id][url] = callbacks;
+        return false;
+      }
+      return true;
+    }
+    
+    dequeue = function (databank, url, result, args) {
+      var callbacks = documentQueue[databank.id][url];
+      if ($.isFunction(callbacks[result])) {
+        callbacks[result].call(databank, args);
+      }
+      documentQueue[databank.id][url] = undefined;
+    };
+
+  $.typedValue.types['http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'] = {
+    regex: /^.*$/m,
+    strip: false,
+    value: function (v) {
+      return v;
+    }
+  };
+
+  /**
+   * <p>Creates a new jQuery.rdf object. This should be invoked as a method rather than constructed using new; indeed you will usually want to generate these objects using a method such as {@link jQuery#rdf} or {@link jQuery.rdf#where}.</p>
+   * @class <p>A jQuery.rdf object represents the results of a query over its {@link jQuery.rdf#databank}. The results of a query are a sequence of objects which represent the bindings of values to the variables used in filter expressions specified using {@link jQuery.rdf#where} or {@link jQuery.rdf#optional}. Each of the objects in this sequence has associated with it a set of triples that are the sources for the variable bindings, which you can get at using {@link jQuery.rdf#sources}.</p>
+    * <p>The {@link jQuery.rdf} object itself is a lot like a {@link jQuery} object. It has a {@link jQuery.rdf#length} and the individual matches can be accessed using <code>[<var>n</var>]</code>, but you can also iterate through the matches using {@link jQuery.rdf#map} or {@link jQuery.rdf#each}.</p>
+    * <p>{@link jQuery.rdf} is designed to mirror the functionality of <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> while providing an interface that's familiar and easy to use for jQuery programmers.</p>
+   * @param {Object} [options]
+   * @param {jQuery.rdf.databank} [options.databank] The databank that this query should operate over.
+   * @param {jQuery.rdf.triple[]} [options.triples] A set of triples over which the query operates; this is only used if options.databank isn't specified, in which case a new databank with these triples is generated.
+   * @param {Object} [options.namespaces] An object representing a set of namespace bindings. Rather than passing this in when you construct the {@link jQuery.rdf} instance, you will usually want to use the {@link jQuery.rdf#prefix} method.
+   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the query.
+   * @returns {jQuery.rdf}
+   * @example rdf = jQuery.rdf();
+   * @see jQuery#rdf
+   */
+  $.rdf = function (options) {
+    return new $.rdf.fn.init(options);
+  };
+
+  $.rdf.fn = $.rdf.prototype = {
+    /**
+     * The version of rdfQuery.
+     * @type String
+     */
+    rdfquery: '1.1',
+
+    init: function (options) {
+      var databanks;
+      options = options || {};
+      /* must specify either a parent or a union, otherwise it's the top */
+      this.parent = options.parent;
+      this.union = options.union;
+      this.top = this.parent === undefined && this.union === undefined;
+      if (this.union === undefined) {
+        if (options.databank === undefined) {
+          /**
+           * The databank over which this query operates.
+           * @type jQuery.rdf.databank
+           */
+          this.databank = this.parent === undefined ? $.rdf.databank(options.triples, options) : this.parent.databank;
+        } else {
+          this.databank = options.databank;
+        }
+      } else {
+        databanks = $.map(this.union, function (query) {
+          return query.databank;
+        });
+        databanks = $.unique(databanks);
+        if (databanks[1] !== undefined) {
+          this.databank = $.rdf.databank(undefined, { union: databanks });
+        } else {
+          this.databank = databanks[0];
+        }
+      }
+      this.children = [];
+      this.partOf = [];
+      this.filterExp = options.filter;
+      this.alphaMemory = [];
+      this.matches = [];
+      /**
+       * The number of matches represented by the {@link jQuery.rdf} object.
+       * @type Integer
+       */
+      this.length = 0;
+      if (this.filterExp !== undefined) {
+        if (!$.isFunction(this.filterExp)) {
+          registerQuery(this.databank, this);
+          this.alphaMemory = findMatches(this.databank, this.filterExp);
+        }
+      }
+      leftActivate(this);
+      return this;
+    },
+
+    /**
+     * Sets or returns the base URI of the {@link jQuery.rdf#databank}.
+     * @param {String|jQuery.uri} [base]
+     * @returns A {@link jQuery.uri} if no base URI is specified, otherwise returns this {@link jQuery.rdf} object.
+     * @example baseURI = jQuery('html').rdf().base();
+     * @example jQuery('html').rdf().base('http://www.example.org/');
+     * @see jQuery.rdf.databank#base
+     */
+    base: function (base) {
+      if (base === undefined) {
+        return this.databank.base();
+      } else {
+        this.databank.base(base);
+        return this;
+      }
+    },
+
+    /**
+     * Sets or returns a namespace binding on the {@link jQuery.rdf#databank}.
+     * @param {String} [prefix]
+     * @param {String} [namespace]
+     * @returns {Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the {@link jQuery.rdf.databank}. If a prefix is specified without a namespace, returns the {@link jQuery.uri} associated with that prefix. Otherwise returns this {@link jQuery.rdf} object after setting the namespace binding.
+     * @example namespace = jQuery('html').rdf().prefix('foaf');
+     * @example jQuery('html').rdf().prefix('foaf', 'http://xmlns.com/foaf/0.1/');
+     * @see jQuery.rdf.databank#prefix
+     */
+    prefix: function (prefix, namespace) {
+      if (namespace === undefined) {
+        return this.databank.prefix(prefix);
+      } else {
+        this.databank.prefix(prefix, namespace);
+        return this;
+      }
+    },
+
+    /**
+     * Adds a triple to the {@link jQuery.rdf#databank} or another {@link jQuery.rdf} object to create a union.
+     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern|jQuery.rdf} triple The triple, {@link jQuery.rdf.pattern} or {@link jQuery.rdf} object to be added to this one. If the triple is a {@link jQuery.rdf} object, the two queries are unioned together. If the triple is a string, it's parsed as a {@link jQuery.rdf.pattern}. The pattern will be completed using the current matches on the {@link jQuery.rdf} object to create multiple triples, one for each set of bindings.
+     * @param {Object} [options]
+     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
+     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
+     * @returns {jQuery.rdf} This {@link jQuery.rdf} object.
+     * @example
+     * var rdf = $.rdf()
+     *   .prefix('dc', ns.dc)
+     *   .prefix('foaf', ns.foaf)
+     *   .add('&lt;photo1.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')
+     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo1.jpg> .');
+     * @example
+     * var rdfA = $.rdf()
+     *   .prefix('dc', ns.dc)
+     *   .add('&lt;photo1.jpg> dc:creator "Jane"');
+     * var rdfB = $.rdf()
+     *   .prefix('foaf', ns.foaf)
+     *   .add('&lt;photo1.jpg> foaf:depicts "Jane"');
+     * var rdf = rdfA.add(rdfB);
+     * @see jQuery.rdf.databank#add
+     */
+    add: function (triple, options) {
+      var query, databank;
+      if (triple.rdfquery !== undefined) {
+        if (triple.top) {
+          databank = this.databank.add(triple.databank);
+          query = $.rdf({ parent: this.parent, databank: databank });
+          return query;
+        } else if (this.top) {
+          databank = triple.databank.add(this.databank);
+          query = $.rdf({ parent: triple.parent, databank: databank });
+          return query;
+        } else if (this.union === undefined) {
+          query = $.rdf({ union: [this, triple] });
+          this.partOf.push(query);
+          triple.partOf.push(query);
+          return query;
+        } else {
+          this.union.push(triple);
+          triple.partOf.push(this);
+        }
+      } else {
+        if (typeof triple === 'string') {
+          options = $.extend({}, { base: this.base(), namespaces: this.prefix(), source: triple }, options);
+          triple = $.rdf.pattern(triple, options);
+        }
+        if (triple.isFixed()) {
+          this.databank.add(triple.triple(), options);
+        } else {
+          query = this;
+          this.each(function (i, data) {
+            var t = triple.triple(data);
+            if (t !== null) {
+              query.databank.add(t, options);
+            }
+          });
+        }
+      }
+      return this;
+    },
+
+    /**
+     * Removes a triple or several triples from the {@link jQuery.rdf#databank}.
+     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern} triple The triple to be removed, or a {@link jQuery.rdf.pattern} that matches the triples that should be removed.
+     * @param {Object} [options]
+     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the triple or pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
+     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple or pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
+     * @returns {jQuery.rdf} The {@link jQuery.rdf} object itself.
+     * @example
+     * var rdf = $('html').rdf()
+     *   .prefix('foaf', ns.foaf)
+     *   .where('?person foaf:givenname ?gname')
+     *   .where('?person foaf:family_name ?fname')
+     *   .remove('?person foaf:family_name ?fname');
+     * @see jQuery.rdf.databank#remove
+     */
+    remove: function (triple, options) {
+      if (typeof triple === 'string') {
+        options = $.extend({}, { base: this.base(), namespaces: this.prefix() }, options);
+        triple = $.rdf.pattern(triple, options);
+      }
+      if (triple.isFixed()) {
+        this.databank.remove(triple.triple(), options);
+      } else {
+        query = this;
+        this.each(function (i, data) {
+          var t = triple.triple(data);
+          if (t !== null) {
+            query.databank.remove(t, options);
+          }
+        });
+      }
+      return this;
+    },
+
+    /**
+     * Loads some data into the {@link jQuery.rdf#databank}
+     * @param data
+     * @param {Object} [options]
+     * @see jQuery.rdf.databank#load
+     */
+    load: function (data, options) {
+      var rdf = this, success = options.success;
+      if (success !== undefined) {
+        options.success = function () {
+          success.call(rdf);
+        }
+      }
+      this.databank.load(data, options);
+      return this;
+    },
+
+    /**
+     * Creates a new {@link jQuery.rdf} object whose databank contains all the triples in this object's

<TRUNCATED>

[32/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon-round.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon-round.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon-round.png
new file mode 100644
index 0000000..597b334
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon-round.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon.png
new file mode 100644
index 0000000..156e74c
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/disco-icon.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/discostyle.css
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/discostyle.css b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/discostyle.css
new file mode 100644
index 0000000..3977035
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/discostyle.css
@@ -0,0 +1,73 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+img {
+	border: 0;
+}
+
+ol {
+	padding-left: 0;
+}
+
+.titledContent {
+	list-style-type: none;
+}
+
+.titledContent .content {
+	padding-left: 1em;
+}
+
+.titledContent .title .typeWidget {
+	font-size: 200%;
+	color: red;
+}
+	
+.titledContent .titledContent  .title .typeWidget {
+	font-size: 150%;
+}
+
+
+.titledContent .titledContent .titledContent .title .typeWidget {
+	font-size: 130%;
+	color: black;
+}
+
+.titledContent .titledContent .titledContent .titledContent .title .typeWidget {
+	font-size: 100%;
+}
+
+.orderedContent {
+	padding-left: 2em;
+}
+.controlArea {
+	float: right;
+}
+
+.sourceEdit {
+	background-color: grey;
+	position: absolute; top: 10%; right: 10%; left: 10%; bottom: 10%
+}
+
+.sourceEdit textarea {
+	width: 100%;
+	height: 90%
+}
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/favicon.ico
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/favicon.ico b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/favicon.ico
new file mode 100644
index 0000000..4cb26c1
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/style/favicon.ico differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/test/java/org/apache/clerezza/platform/content/collections/CollectionsCreatorTest.java
----------------------------------------------------------------------
diff --git a/platform/content/src/test/java/org/apache/clerezza/platform/content/collections/CollectionsCreatorTest.java b/platform/content/src/test/java/org/apache/clerezza/platform/content/collections/CollectionsCreatorTest.java
new file mode 100644
index 0000000..7e5b242
--- /dev/null
+++ b/platform/content/src/test/java/org/apache/clerezza/platform/content/collections/CollectionsCreatorTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.collections;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.HIERARCHY;
+import org.apache.clerezza.rdf.ontologies.RDF;
+
+
+/**
+ * @author mir, rbn
+ */
+public class CollectionsCreatorTest{
+
+    private static UriRef root = new UriRef("http://localhost:8282/");
+    private UriRef foo = new UriRef("http://localhost:8282/foo/");
+    private UriRef fooResource = new UriRef("http://localhost:8282/foo/resource");
+    private UriRef fooTest = new UriRef("http://localhost:8282/foo/test/");
+    private UriRef fooTestResource4 = new UriRef("http://localhost:8282/foo/test/resource4");
+        
+    @Test
+    public void listPositionTest() throws Exception {
+        MGraph mGraph = new SimpleMGraph();
+        CollectionCreator collectionCreator = new CollectionCreator(mGraph);
+        collectionCreator.createContainingCollections(fooTestResource4);
+        Assert.assertTrue(mGraph.contains(new TripleImpl(fooTest, RDF.type, HIERARCHY.Collection)));
+        Assert.assertTrue(mGraph.contains(new TripleImpl(fooTestResource4, HIERARCHY.parent, fooTest)));
+        Assert.assertTrue(mGraph.contains(new TripleImpl(foo, HIERARCHY.parent, root)));
+        Assert.assertTrue(mGraph.contains(new TripleImpl(root, RDF.type, HIERARCHY.Collection)));
+        collectionCreator.createContainingCollections(fooResource);
+        Assert.assertTrue(mGraph.contains(new TripleImpl(fooResource, HIERARCHY.parent, foo)));
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/cris/LICENSE
----------------------------------------------------------------------
diff --git a/platform/cris/LICENSE b/platform/cris/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/cris/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/cris/pom.xml
----------------------------------------------------------------------
diff --git a/platform/cris/pom.xml b/platform/cris/pom.xml
new file mode 100644
index 0000000..4585ac3
--- /dev/null
+++ b/platform/cris/pom.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.cris</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform CRIS service for the content graph</name>
+    <description>
+        A composite resource index service for resources described in the content graph
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.cris.ontologies</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.cris.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.scala.utils</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.lucene</groupId>
+            <artifactId>lucene-memory</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Import-Package>org.osgi.framework; version="[1,2)", 
+                            org.osgi.service.component; version="[1,2)",*</Import-Package>
+                        <Export-Package>org.apache.clerezza.platform.cris.*</Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/cris/src/main/java/org/apache/clerezza/platform/cris/IndexService.java
----------------------------------------------------------------------
diff --git a/platform/cris/src/main/java/org/apache/clerezza/platform/cris/IndexService.java b/platform/cris/src/main/java/org/apache/clerezza/platform/cris/IndexService.java
new file mode 100644
index 0000000..a3cb10e
--- /dev/null
+++ b/platform/cris/src/main/java/org/apache/clerezza/platform/cris/IndexService.java
@@ -0,0 +1,243 @@
+/*
+ * 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.cris;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.cris.Condition;
+import org.apache.clerezza.rdf.cris.FacetCollector;
+import org.apache.clerezza.rdf.cris.GraphIndexer;
+import org.apache.clerezza.rdf.cris.IndexDefinitionManager;
+import org.apache.clerezza.rdf.cris.ResourceFinder;
+import org.apache.clerezza.rdf.cris.SortSpecification;
+import org.apache.clerezza.rdf.cris.VirtualProperty;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.store.FSDirectory;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Service to index and find resources from the content graph.
+ * 
+ * @author tio
+ */
+@Component(metatype=true)
+@Service(IndexService.class)
+public class IndexService extends ResourceFinder {
+
+    @Property(intValue=0, label="The delay in minutes until the first index optimization is invoked.", 
+            description="This allows to set the time of the first invocation. 0 Is the lowest acceptable value and means run instantly.")
+    static final String OPTIMIZE_DELAY = "org.apache.clerezza.platform.cris.optimizedelay";
+    
+    @Property(intValue=0, label="The period in minutes between index optimizations.", 
+            description="When a new value is set, the first invocation will happen after the specified delay and the old schedule will be canceled instantly. The minimum acceptable value is 1 (min). A value of 0 turns off optimizations.")
+    static final String OPTIMIZE_PERIOD = "org.apache.clerezza.platform.cris.optimizeperiod";
+    
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
+    IndexDefinitionManager indexDefinitionManager = null;
+
+    GraphIndexer graphIndexer  = null;
+
+    @Reference
+    ContentGraphProvider cgProvider;
+
+    @Reference
+    TcManager tcManager;
+
+    UriRef definitionGraphUri = new UriRef("http://zz.localhost/cris.definitions.graph");
+
+    LockableMGraph definitionGraph = null;
+
+    Integer optimizePeriod = 0;
+    Integer optimizeDelay = 0;
+    
+    protected void activate(ComponentContext context) {
+
+        optimizePeriod = (Integer) context.getProperties().get(OPTIMIZE_PERIOD);
+        optimizeDelay = (Integer) context.getProperties().get(OPTIMIZE_DELAY);
+        if(optimizeDelay == null || optimizeDelay < 0) {
+            optimizeDelay = 0;
+        }
+        
+        try {
+            definitionGraph = tcManager.getMGraph(definitionGraphUri);
+        } catch (NoSuchEntityException ex) {
+            definitionGraph = tcManager.createMGraph(definitionGraphUri);
+        }
+        File luceneIndexDir = context.getBundleContext().getDataFile("lucene-index");
+        boolean createNewIndex = luceneIndexDir.exists();
+        logger.info("Create new index: {}", !createNewIndex);
+
+        indexDefinitionManager = new IndexDefinitionManager(definitionGraph);
+        try {
+            graphIndexer = new GraphIndexer(definitionGraph, cgProvider.getContentGraph(),
+                    FSDirectory.open(luceneIndexDir), !createNewIndex);
+            if(optimizePeriod != null && optimizePeriod >= 1) {
+                long period = optimizePeriod * 60000;
+                long delay = optimizeDelay * 60000;
+                logger.info("Scheduling optimizations with delay {} min and period {} min", delay, period);
+                graphIndexer.scheduleIndexOptimizations(delay, period);
+            }
+        } catch (IOException ex) {
+            logger.error("Could not open lucene index directory.");
+            throw new IllegalStateException(ex);
+        }
+    }
+
+    protected void deactivate(ComponentContext context) {
+        if(optimizePeriod >= 1) {
+            graphIndexer.terminateIndexOptimizationSchedule();
+        }
+        optimizeDelay = 0;
+        optimizePeriod = 0;
+        graphIndexer.closeLuceneIndex();
+        graphIndexer = null;
+
+    }
+    
+    @Override
+    public List<NonLiteral> findResources(List<? extends Condition> conditions, 
+            SortSpecification sortSpecification, FacetCollector... facetCollectors) {
+        try {
+            return graphIndexer.findResources(conditions, sortSpecification, facetCollectors);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+    
+    @Override
+    public List<NonLiteral> findResources(List<? extends Condition> conditions, 
+            FacetCollector... facetCollectors) {
+        try {
+            return graphIndexer.findResources(conditions, facetCollectors);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+
+    @Override
+    public List<NonLiteral> findResources(List<? extends Condition> conditions) {
+        try {
+            return graphIndexer.findResources(conditions);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+
+    @Override
+    public List<NonLiteral> findResources(UriRef uriRef, String pattern) {
+        try {
+            return graphIndexer.findResources(uriRef, pattern);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+    
+    @Override
+    public List<NonLiteral> findResources(UriRef uriRef, String pattern, 
+            boolean escapePattern) {
+        
+        try {
+            return graphIndexer.findResources(uriRef, pattern, escapePattern);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+    
+    @Override
+    public List<NonLiteral> findResources(UriRef uriRef, String pattern, 
+            boolean escapePattern, FacetCollector... facetCollectors) {
+        
+        try {
+            return graphIndexer.findResources(uriRef, pattern, escapePattern, facetCollectors);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+    
+    @Override
+    public List<NonLiteral> findResources(UriRef uriRef, String pattern, 
+            boolean escapePattern, SortSpecification sortSpecification, 
+            FacetCollector... facetCollectors) {
+        
+        try {
+            return graphIndexer.findResources(uriRef, pattern, escapePattern, 
+                    sortSpecification, facetCollectors);
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+    
+    @Override
+    public void reCreateIndex() {
+        graphIndexer.reCreateIndex();
+    }
+
+    @Override
+    public void optimizeIndex() {
+        graphIndexer.optimizeIndex();
+    }
+
+    public void addDefintion(UriRef propertyType, List<UriRef> predicates) {
+        Lock lock = definitionGraph.getLock().writeLock();
+        lock.lock();
+        try {
+            indexDefinitionManager.addDefinition(propertyType, predicates);
+        } finally {
+            lock.unlock();
+        }
+    }
+
+    public void addDefinitionVirtual(UriRef propertyType, List<VirtualProperty> predicates) {
+        Lock lock = definitionGraph.getLock().writeLock();
+        lock.lock();
+        try {
+            indexDefinitionManager.addDefinitionVirtual(propertyType, predicates);
+        } finally {
+            lock.unlock();
+        }
+
+    }
+
+    public void deleteDefintion(UriRef propertyType) {
+        Lock lock = definitionGraph.getLock().writeLock();
+        lock.lock();
+        try {
+            indexDefinitionManager.deleteDefinition(propertyType);
+        } finally {
+            lock.unlock();
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/LICENSE
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/LICENSE b/platform/curieprefixmanager/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/curieprefixmanager/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/core/LICENSE b/platform/curieprefixmanager/core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/curieprefixmanager/core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/core/pom.xml b/platform/curieprefixmanager/core/pom.xml
new file mode 100644
index 0000000..d45ecc1
--- /dev/null
+++ b/platform/curieprefixmanager/core/pom.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.curieprefixmanager</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.curieprefixmanager.core</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - CURIE prefix manager core</name>
+    <description>
+        Skeleton Core
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.curieprefixmanager.ontologies</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/CuriePrefixRecommender.java
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/CuriePrefixRecommender.java b/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/CuriePrefixRecommender.java
new file mode 100644
index 0000000..e03a19a
--- /dev/null
+++ b/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/CuriePrefixRecommender.java
@@ -0,0 +1,36 @@
+/*
+ * 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.curieprefixmanager;
+
+/**
+ *
+ * Describes a service that recommends a CURIE prefix given an IRI prefix
+ *
+ * @author reto
+ */
+public interface CuriePrefixRecommender {
+
+    /**
+     * 
+     * @param iriPrefix that part of the iri that will be replaced by the return value n the CURIE
+     * @return the suggested prefix or null if no suggestion is available
+     */
+    public String getRecommendedPrefix(String iriPrefix);
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/impl/CuriePrefixManager.java
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/impl/CuriePrefixManager.java b/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/impl/CuriePrefixManager.java
new file mode 100644
index 0000000..cf8d22e
--- /dev/null
+++ b/platform/curieprefixmanager/core/src/main/java/org/apache/clerezza/platform/curieprefixmanager/impl/CuriePrefixManager.java
@@ -0,0 +1,237 @@
+/*
+ * 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.curieprefixmanager.impl;
+
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.concurrent.locks.Lock;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.RedirectUtil;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
+import org.apache.clerezza.platform.curieprefixmanager.CuriePrefixRecommender;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.platform.curieprefixmanager.ontologies.CURIE;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.utils.RdfList;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.service.component.ComponentContext;
+
+
+/**
+ * Allows to mana a set of CURIE prefix bindings. Multiple URI-Prefix can point
+ * to the same prefix, but per uri-prefix only one suggested prefix is supported.
+ * 
+ * @author reto
+ */
+@Component
+@Services({
+    @Service(Object.class), 
+    @Service(CuriePrefixRecommender.class)
+})
+@Property(name="javax.ws.rs", boolValue=true)
+@Path("/admin/curie-prefix/manager")
+public class CuriePrefixManager implements CuriePrefixRecommender {
+    private static final LiteralFactory literalFactory = LiteralFactory.getInstance();
+
+    @Reference
+    private RenderletManager renderletManager;
+
+    @Reference
+    private ContentGraphProvider cgProvider;
+
+    public void activate(ComponentContext context) throws URISyntaxException {
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(getClass().getResource(
+                "curie-prefix-naked.ssp").toURI().toString()),
+                CURIE.CuriePrefixBinding, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(getClass().getResource(
+                "curie-prefix-list-naked.ssp").toURI().toString()),
+                CURIE.CuriePrefixBindingList, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+    }
+
+    @GET
+    @Path("new")
+    public GraphNode emptyPrefixBinding() {
+        MGraph resultMGraph = new SimpleMGraph();
+        GraphNode result = new GraphNode(new BNode(), resultMGraph);
+        result.addProperty(RDF.type, CURIE.CuriePrefixBinding);
+        result.addProperty(CURIE.prefix,
+                literalFactory.createTypedLiteral("foaf"));
+        result.addProperty(CURIE.binding,
+                literalFactory.createTypedLiteral("http://xmlns.com/foaf/0.1/"));
+        result.addProperty(RDF.type, PLATFORM.HeadedPage);
+        return result;
+    }
+
+    /**
+     * Saves a PrefixBiding, replacing an existing binding to the same value and
+     * if oldBinding is not null then it is removed
+     */
+    @POST
+    @Path("save")
+    public Response savePrefixBinding(@Context UriInfo uriInfo,
+            @FormParam("prefix") String prefix,
+            @FormParam("binding") String bindingValue,
+             @FormParam("oldBinding") String oldBindingValue) {
+        LockableMGraph contentGraph = cgProvider.getContentGraph();
+        Lock l = contentGraph.getLock().writeLock();
+        l.lock();
+        
+        try {
+            NonLiteral binding = getBindingWithValue(bindingValue, contentGraph);
+            if (binding == null) {
+                binding = new BNode();
+            }
+            GraphNode bindingNode;
+            if (oldBindingValue != null) {
+                NonLiteral oldBinding = getBindingWithValue(oldBindingValue, contentGraph);
+                if (oldBinding != null) {
+                    GraphNode oldBindingNode = new GraphNode(oldBinding, contentGraph);
+                    oldBindingNode.replaceWith(binding);
+                }
+            }
+            bindingNode = new GraphNode(binding, contentGraph);
+            bindingNode.addProperty(RDF.type, CURIE.CuriePrefixBinding);
+            bindingNode.deleteProperties(CURIE.prefix);
+            bindingNode.addProperty(CURIE.prefix, literalFactory.createTypedLiteral(prefix));
+            bindingNode.deleteProperties(CURIE.binding);
+            bindingNode.addProperty(CURIE.binding, literalFactory.createTypedLiteral(bindingValue));
+        } finally {
+            l.unlock();
+        }
+        return RedirectUtil.createSeeOtherResponse("./", uriInfo);
+    }
+
+    @POST
+    @Path("delete")
+    public Response delete(@Context UriInfo uriInfo,
+            @FormParam("binding") String bindingValue) {
+        LockableMGraph contentGraph = cgProvider.getContentGraph();
+        Lock l = contentGraph.getLock().writeLock();
+        l.lock();
+        try {
+            NonLiteral binding = getBindingWithValue(bindingValue, contentGraph);
+            GraphNode bindingNode = new GraphNode(binding, contentGraph);
+            bindingNode.deleteProperty(RDF.type, CURIE.CuriePrefixBinding);
+            bindingNode.deleteProperties(CURIE.prefix);
+            bindingNode.deleteProperties(CURIE.binding);
+        } finally {
+            l.unlock();
+        }
+        return RedirectUtil.createSeeOtherResponse("./", uriInfo);
+    }
+
+    @GET
+    public GraphNode list(@Context UriInfo uriInfo) {
+        TrailingSlash.enforcePresent(uriInfo);
+        TripleCollection resultGraph = new SimpleMGraph();
+        LockableMGraph contentGraph = cgProvider.getContentGraph();
+        GraphNode result = new GraphNode(new BNode(), new UnionMGraph(resultGraph, contentGraph));
+        RdfList list = new RdfList(result);        
+        Lock l = contentGraph.getLock().readLock();
+        l.lock();
+        try {
+            Iterator<Triple> greetings = contentGraph.filter(null, RDF.type, CURIE.CuriePrefixBinding);
+            while (greetings.hasNext()) {
+                list.add(greetings.next().getSubject());
+            }
+        } finally {
+            l.unlock();
+        }
+        result.addProperty(RDF.type, CURIE.CuriePrefixBindingList);
+        result.addProperty(RDF.type, PLATFORM.HeadedPage);
+        return result;
+    }
+
+    @GET
+    @Path("get")
+    public GraphNode getSingle(@QueryParam("binding") String bindingValue) {
+        TripleCollection resultGraph = new SimpleMGraph();
+        LockableMGraph contentGraph = cgProvider.getContentGraph();
+        MGraph unionMGraph = new UnionMGraph(resultGraph, contentGraph);
+        Lock l = contentGraph.getLock().readLock();
+        l.lock();
+        try {
+            GraphNode result = new GraphNode(getBindingWithValue(bindingValue, contentGraph), unionMGraph);
+            result.addProperty(RDF.type, PLATFORM.HeadedPage);
+            return result;
+        } finally {
+            l.unlock();
+        }
+    }
+
+    private static NonLiteral getBindingWithValue(String bindingValue, LockableMGraph graph) {
+        Iterator<Triple> triples = graph.filter(null, CURIE.binding,
+                literalFactory.createTypedLiteral(bindingValue));
+        if (triples.hasNext()) {
+            return triples.next().getSubject();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public String getRecommendedPrefix(String iriPrefix) {
+        LockableMGraph contentGraph = cgProvider.getContentGraph();
+        Lock l = contentGraph.getLock().readLock();
+        l.lock();
+        try {
+            NonLiteral binding = getBindingWithValue(iriPrefix, contentGraph);
+            if (binding == null) {
+                return null;
+            }
+            GraphNode graphNode = new GraphNode(binding, contentGraph);
+            return ((Literal)graphNode.getObjects(CURIE.prefix).next()).getLexicalForm();
+        } finally {
+            l.unlock();
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-list-naked.ssp
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-list-naked.ssp b/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-list-naked.ssp
new file mode 100644
index 0000000..416cffe
--- /dev/null
+++ b/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-list-naked.ssp
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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 curie(s: Any) = new UriRef("http://clerezza.apache.org/platform/curieprefix#" + s)
+
+<div id="tx-content">
+	<h3>The following IRI bases are bound to a CURIE Prefix:</h3>
+	<table>
+
+		<tr><th>IRI prefix</th>
+		<th>CURIE Prefix</th>
+		<th></th></tr>
+	{for (binding <- res!!) yield <tr>
+	<td><a href={"get?binding="+(binding/curie("binding")*)}>{binding/curie("binding")*}</a></td>
+	<td>{binding/curie("prefix")*}</td>
+	<td><form action="delete" method="post">
+		<input name="binding" type="hidden" value={binding/curie("binding")*}/>
+		<a class="tx-icon tx-icon-delete" href="#" onclick="this.parentNode.submit(); return false">Delete</a></form></td>
+	</tr>}
+	</table>
+	<h3>Add new Prefix Binding:</h3>
+	<form action="save" method="post">
+		<label for="prefix">Prefix:</label><input name="prefix" type="text" value=""/><br/>
+		<label for="binding">Expanded form:</label><input name="binding" type="text" size="80" value=""/><br/>
+		<input type="submit" name="add"/>
+	</form>
+
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-naked.ssp
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-naked.ssp b/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-naked.ssp
new file mode 100644
index 0000000..74d2b47
--- /dev/null
+++ b/platform/curieprefixmanager/core/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/impl/curie-prefix-naked.ssp
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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 curie(s: Any) = new UriRef("http://clerezza.apache.org/platform/curieprefix#" + s)
+
+<div id="tx-content">
+	<h3>A CURIE Prefix Binding:</h3>
+	<form method="post" action="save">
+		<input type="text" name="prefix" value={res/curie("prefix")*}/><br/>
+		<input type="text" name="binding" value={res/curie("binding")*}/><br/>
+		<input type="submit" name="Save"/>
+	</form>
+</div>


[33/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/src/gui/htmlToolbar.css
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/src/gui/htmlToolbar.css b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/src/gui/htmlToolbar.css
new file mode 100644
index 0000000..18d0939
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/src/gui/htmlToolbar.css
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/* ***** BEGIN LICENSE BLOCK *****
+ * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ * Full Terms at http://mozile.mozdev.org/0.8/LICENSE
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is James A. Overton's code (james@overton.ca).
+ *
+ * The Initial Developer of the Original Code is James A. Overton.
+ * Portions created by the Initial Developer are Copyright (C) 2005-2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *	James A. Overton <ja...@overton.ca>
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/**
+ * @fileoverview Provides CSS styles for Mozile's HTML Toolbar GUI.
+ * @link http://mozile.mozdev.org 
+ * @author James A. Overton <ja...@overton.ca>
+ * @version 0.8
+ * $Id: htmlToolbar.css,v 1.3 2006/08/31 14:18:17 jameso Exp $
+ */
+
+/* 
+ * NOTE: There are several CSS hacks coded into the "htmlToolbar.js" file which override the defaults set here. Be careful.
+ */
+
+/*
+#mozileToolbar, .mozileMenu {
+	background-color: #EEEEEE;
+	border: 1px solid #888888;
+	font-family: Arial, Helvitica, sans-serif;
+}
+*/
+
+#mozileToolbar {
+	text-decoration: none;
+	color: black;
+	background-color: #EEEEEE;
+	border: 1px solid #888888;
+	font-family: sans-serif;
+	padding: 1px 0px 1px 0px;
+	position: absolute;
+	top: -1px;
+	left: 0px;
+	z-index: 1000;
+	vertical-align: middle;
+	font-family: Arial, Helvitica, sans-serif;
+	-moz-user-select: none;
+}
+
+#mozileToolbar img {
+	border: 0px;
+	vertical-align: middle;
+}
+
+#mozileToolbar *[available=false] {
+	opacity: 0.5;
+}
+
+.mozileButton {
+	margin: 0px 0px 1px 0px;
+	padding: 1px 1px 2px 1px;
+	border: 0px;
+	text-decoration: none;
+	min-width: 16px;
+	height: 16px;
+}
+
+.mozileButton img {
+	margin: 0px;
+	padding: 0px;
+}
+
+.mozileButton * {
+	text-decoration: none;
+}
+
+.mozileButton[active=true] {
+	background-color: #C1D2EE;
+	border: 1px solid #316AC5;
+	padding: 0px 0px 1px 0px;
+}
+
+.mozileButton:hover {
+	background-color: #DDDDFF;
+	border: 1px solid #316AC5;
+	padding: 0px 0px 1px 0px;
+}
+
+.mozileMenuItem {
+	vertical-align: middle;
+	cursor: pointer;
+	padding: 0px;
+}
+
+.mozileMenuItem td {
+	margin: 0px;
+}
+
+.mozileMenuItem:hover {
+	background-color: #316AC5;
+	color: white;
+}
+
+.mozileMenuItem img {
+	vertical-align: middle;
+}
+
+.mozileMenu {
+	background-color: #EEEEEE;
+	border: 1px solid #888888;
+	position: absolute;
+	padding: 1px 1px 1px 1px;
+	vertical-align: middle;
+}
+
+.mozileRight {
+	position: absolute;
+	right: 2px;
+	vertical-align: middle;
+}
+
+.mozileActive {
+}
+
+.mozileIcon {
+}
+
+.mozileLabel {
+	white-space: pre;
+}
+
+.mozileAccel {
+	text-align: right;
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/parameters.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/parameters.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/parameters.js
new file mode 100644
index 0000000..6fdcde7
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/parameters.js
@@ -0,0 +1,72 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+function Parameters() {
+
+	this.parameterArray = new Array(0);
+    var url   = window.location.search;
+    if (url != "")
+     {
+      url = url.substring(1,url.length);                      
+      splittedURL = url.split("&"); 
+      for (i=0;i < splittedURL.length;i++)
+       {
+        temp = splittedURL[i].split("=");
+        currentField = new field();
+				currentField.name = temp[0];
+				currentField.value = Parameters.readField(temp[1]);
+				this.parameterArray.push(currentField);
+       }
+     }
+     
+}
+
+Parameters.prototype.getField = function(name) {
+
+	for (i = 0; i < this.parameterArray.length; i++) {
+		if (this.parameterArray[i].name == name) {
+			return this.parameterArray[i].value;
+		}
+	}
+	return null;
+}
+
+Parameters.readField = function(raw) {
+	if (raw == null) {
+		return null;
+	}
+	var result = raw.replace(/\+/g," ");
+	return unescape(result);
+}
+
+	 
+function field() {
+ 	var name;
+	var value;
+}
+	
+	
+	
+	
+
+
+   
+	 	

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfparser.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfparser.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfparser.js
new file mode 100644
index 0000000..74eaa46
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfparser.js
@@ -0,0 +1,544 @@
+/**
+ * @fileoverview
+ * TABULATOR RDF PARSER
+ *
+ * Version 0.1
+ *  Parser believed to be in full positive RDF/XML parsing compliance
+ *  with the possible exception of handling deprecated RDF attributes
+ *  appropriately. Parser is believed to comply fully with other W3C
+ *  and industry standards where appropriate (DOM, ECMAScript, &c.)
+ *
+ *  Author: David Sheets <ds...@mit.edu>
+ *  SVN ID: $Id$
+ *
+ * W3C® SOFTWARE NOTICE AND LICENSE
+ * http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ * This work (and included software, documentation such as READMEs, or
+ * other related items) is being provided by the copyright holders under
+ * the following license. By obtaining, using and/or copying this work,
+ * you (the licensee) agree that you have read, understood, and will
+ * comply with the following terms and conditions.
+ * 
+ * Permission to copy, modify, and distribute this software and its
+ * documentation, with or without modification, for any purpose and
+ * without fee or royalty is hereby granted, provided that you include
+ * the following on ALL copies of the software and documentation or
+ * portions thereof, including modifications:
+ * 
+ * 1. The full text of this NOTICE in a location viewable to users of
+ * the redistributed or derivative work.
+ * 2. Any pre-existing intellectual property disclaimers, notices, or terms and
+ * conditions. If none exist, the W3C Software Short Notice should be
+ * included (hypertext is preferred, text is permitted) within the body
+ * of any redistributed or derivative code.
+ * 3. Notice of any changes or modifications to the files, including the
+ * date changes were made. (We recommend you provide URIs to the location
+ * from which the code is derived.)
+ * 
+ * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
+ * HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
+ * FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
+ * DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
+ * TRADEMARKS OR OTHER RIGHTS.
+ * 
+ * COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL
+ * OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
+ * DOCUMENTATION.
+ * 
+ * The name and trademarks of copyright holders may NOT be used in
+ * advertising or publicity pertaining to the software without specific,
+ * written prior permission. Title to copyright in this software and any
+ * associated documentation will at all times remain with copyright
+ * holders.
+ */
+/**
+ * @class Class defining an RDFParser resource object tied to an RDFStore
+ *  
+ * @author David Sheets <ds...@mit.edu>
+ * @version 0.1
+ * 
+ * @constructor
+ * @param {RDFStore} store An RDFStore object
+ */
+function RDFParser(store) {
+    /** Standard namespaces that we know how to handle @final
+     *  @member RDFParser
+     */
+    RDFParser['ns'] = {'RDF':
+		       "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+		       'RDFS':
+		       "http://www.w3.org/2000/01/rdf-schema#"}
+    /** DOM Level 2 node type magic numbers @final
+     *  @member RDFParser
+     */
+    RDFParser['nodeType'] = {'ELEMENT': 1, 'ATTRIBUTE': 2, 'TEXT': 3,
+			     'CDATA_SECTION': 4, 'ENTITY_REFERENCE': 5,
+			     'ENTITY': 6, 'PROCESSING_INSTRUCTION': 7,
+			     'COMMENT': 8, 'DOCUMENT': 9, 'DOCUMENT_TYPE': 10,
+			     'DOCUMENT_FRAGMENT': 11, 'NOTATION': 12}
+
+    /**
+     * Frame class for namespace and base URI lookups
+     * Base lookups will always resolve because the parser knows
+     * the default base.
+     *
+     * @private
+     */
+    this['frameFactory'] = function (parser, parent, element) {
+	return {'NODE': 1,
+		'ARC': 2,
+		'parent': parent,
+		'parser': parser,
+		'store': parser['store'],
+		'element': element,
+		'lastChild': 0,
+		'base': null,
+		'lang': null,
+		'node': null,
+		'nodeType': null,
+		'listIndex': 1,
+		'rdfid': null,
+		'datatype': null,
+		'collection': false,
+
+	/** Terminate the frame and notify the store that we're done */
+		'terminateFrame': function () {
+		    if (this['collection']) {
+			this['node']['close']()
+		    }
+		},
+	
+	/** Add a symbol of a certain type to the this frame */
+		'addSymbol': function (type, uri) {
+		    uri = Util.uri.join(uri, this['base'])
+		    this['node'] = this['store']['sym'](uri)
+		    this['nodeType'] = type
+		},
+	
+	/** Load any constructed triples into the store */
+		'loadTriple': function () {
+		    if (this['parent']['parent']['collection']) {
+			this['parent']['parent']['node']['append'](this['node'])
+		    }
+		    else {
+			this['store']['add'](this['parent']['parent']['node'],
+				       this['parent']['node'],
+				       this['node'],
+				       this['parser']['why'])
+		    }
+		    if (this['parent']['rdfid'] != null) { // reify
+			var triple = this['store']['sym'](
+			    Util.uri.join("#"+this['parent']['rdfid'],
+					  this['base']))
+			this['store']['add'](triple,
+					     this['store']['sym'](
+						 RDFParser['ns']['RDF']
+						     +"type"),
+					     this['store']['sym'](
+						 RDFParser['ns']['RDF']
+						     +"Statement"),
+					     this['parser']['why'])
+			this['store']['add'](triple,
+					     this['store']['sym'](
+						 RDFParser['ns']['RDF']
+						     +"subject"),
+					     this['parent']['parent']['node'],
+					     this['parser']['why'])
+			this['store']['add'](triple,
+					     this['store']['sym'](
+						 RDFParser['ns']['RDF']
+						     +"predicate"),
+					     this['parent']['node'],
+					     this['parser']['why'])
+			this['store']['add'](triple,
+					     this['store']['sym'](
+						 RDFParser['ns']['RDF']
+						     +"object"),
+					     this['node'],
+					     this['parser']['why'])
+		    }
+		},
+
+	/** Check if it's OK to load a triple */
+		'isTripleToLoad': function () {
+		    return (this['parent'] != null
+			    && this['parent']['parent'] != null
+			    && this['nodeType'] == this['NODE']
+			    && this['parent']['nodeType'] == this['ARC']
+			    && this['parent']['parent']['nodeType']
+			    == this['NODE'])
+		},
+
+	/** Add a symbolic node to this frame */
+		'addNode': function (uri) {
+		    this['addSymbol'](this['NODE'],uri)
+		    if (this['isTripleToLoad']()) {
+			this['loadTriple']()
+		    }
+		},
+
+	/** Add a collection node to this frame */
+		'addCollection': function () {
+		    this['nodeType'] = this['NODE']
+		    this['node'] = this['store']['collection']()
+		    this['collection'] = true
+		    if (this['isTripleToLoad']()) {
+			this['loadTriple']()
+		    }
+		},
+
+	/** Add a collection arc to this frame */
+		'addCollectionArc': function () {
+		    this['nodeType'] = this['ARC']
+		},
+
+	/** Add a bnode to this frame */
+		'addBNode': function (id) {
+		    if (id != null) {
+			if (this['parser']['bnodes'][id] != null) {
+			    this['node'] = this['parser']['bnodes'][id]
+			} else {
+			    this['node'] = this['parser']['bnodes'][id] = this['store']['bnode']()
+			}
+		    } else { this['node'] = this['store']['bnode']() }
+		    
+		    this['nodeType'] = this['NODE']
+		    if (this['isTripleToLoad']()) {
+			this['loadTriple']()
+		    }
+		},
+
+	/** Add an arc or property to this frame */
+		'addArc': function (uri) {
+		    if (uri == RDFParser['ns']['RDF']+"li") {
+			uri = RDFParser['ns']['RDF']+"_"+this['parent']['listIndex']++
+		    }
+		    this['addSymbol'](this['ARC'], uri)
+		},
+
+	/** Add a literal to this frame */
+		'addLiteral': function (value) {
+		    if (this['parent']['datatype']) {
+			this['node'] = this['store']['literal'](
+			    value, "", this['store']['sym'](
+				this['parent']['datatype']))
+		    }
+		    else {
+			this['node'] = this['store']['literal'](
+			    value, this['lang'])
+		    }
+		    this['nodeType'] = this['NODE']
+		    if (this['isTripleToLoad']()) {
+			this['loadTriple']()
+		    }
+		}
+	       }
+    }
+
+    /** Our triple store reference @private */
+    this['store'] = store
+    /** Our identified blank nodes @private */
+    this['bnodes'] = {}
+    /** A context for context-aware stores @private */
+    this['why'] = null
+    /** Reification flag */
+    this['reify'] = false
+
+    /**
+     * Build our initial scope frame and parse the DOM into triples
+     * @param {DOMTree} document The DOM to parse
+     * @param {String} base The base URL to use 
+     * @param {Object} why The context to which this resource belongs
+     */
+    this['parse'] = function (document, base, why) {
+	var children = document['childNodes']
+
+	// clean up for the next run
+	this['cleanParser']()
+
+	// figure out the root element
+	if (document['nodeType'] == RDFParser['nodeType']['DOCUMENT']) {
+	    for (var c=0; c<children['length']; c++) {
+		if (children[c]['nodeType']
+		    == RDFParser['nodeType']['ELEMENT']) {
+		    var root = children[c]
+		    break
+		}
+	    }	    
+	}
+	else if (document['nodeType'] == RDFParser['nodeType']['ELEMENT']) {
+	    var root = document
+	}
+	else {
+	    throw new Error("RDFParser: can't find root in " + base
+			    + ". Halting. ")
+	    return false
+	}
+	
+	this['why'] = why
+
+	// our topmost frame
+
+	var f = this['frameFactory'](this)
+	f['base'] = base
+	f['lang'] = ''
+	
+	this['parseDOM'](this['buildFrame'](f,root))
+	return true
+    }
+    this['parseDOM'] = function (frame) {
+	// a DOM utility function used in parsing
+	var elementURI = function (el) {
+	    return el['namespaceURI'] + el['localName']
+	}
+	var dig = true // if we'll dig down in the tree on the next iter
+
+	while (frame['parent']) {
+	    var dom = frame['element']
+	    var attrs = dom['attributes']
+
+	    if (dom['nodeType']
+		== RDFParser['nodeType']['TEXT']
+		|| dom['nodeType']
+		== RDFParser['nodeType']['CDATA_SECTION']) {//we have a literal
+		frame['addLiteral'](dom['nodeValue'])
+	    }
+	    else if (elementURI(dom)
+		     != RDFParser['ns']['RDF']+"RDF") { // not root
+		if (frame['parent'] && frame['parent']['collection']) {
+		    // we're a collection element
+		    frame['addCollectionArc']()
+		    frame = this['buildFrame'](frame,frame['element'])
+		    frame['parent']['element'] = null
+		}
+                if (!frame['parent'] || !frame['parent']['nodeType']
+		    || frame['parent']['nodeType'] == frame['ARC']) {
+		    // we need a node
+		    var about =dom['getAttributeNodeNS'](
+			RDFParser['ns']['RDF'],"about")
+		    var rdfid =dom['getAttributeNodeNS'](
+			RDFParser['ns']['RDF'],"ID")
+		    if (about && rdfid) {
+			throw new Error("RDFParser: " + dom['nodeName']
+					+ " has both rdf:id and rdf:about."
+					+ " Halting. Only one of these"
+					+ " properties may be specified on a"
+					+ " node.");
+		    }
+		    if (about == null && rdfid) {
+			frame['addNode']("#"+rdfid['nodeValue'])
+			dom['removeAttributeNode'](rdfid)
+		    }
+		    else if (about == null && rdfid == null) {
+			var bnid = dom['getAttributeNodeNS'](
+			    RDFParser['ns']['RDF'],"nodeID")
+			if (bnid) {
+			    frame['addBNode'](bnid['nodeValue'])
+			    dom['removeAttributeNode'](bnid)
+			} else { frame['addBNode']() }
+		    }
+		    else {
+			frame['addNode'](about['nodeValue'])
+			dom['removeAttributeNode'](about)
+		    }
+		
+		    // Typed nodes
+		    var rdftype = dom['getAttributeNodeNS'](
+			RDFParser['ns']['RDF'],"type")
+		    if (RDFParser['ns']['RDF']+"Description"
+			!= elementURI(dom)) {
+			rdftype = {'nodeValue': elementURI(dom)}
+		    }
+		    if (rdftype != null) {
+			this['store']['add'](frame['node'],
+					     this['store']['sym'](
+						 RDFParser['ns']['RDF']+"type"),
+					     this['store']['sym'](
+						 Util.uri.join(
+						     rdftype['nodeValue'],
+						     frame['base'])),
+					     this['why'])
+			if (rdftype['nodeName']){
+			    dom['removeAttributeNode'](rdftype)
+			}
+		    }
+		    
+		    // Property Attributes
+		    for (var x = attrs['length']-1; x >= 0; x--) {
+			this['store']['add'](frame['node'],
+					     this['store']['sym'](
+						 elementURI(attrs[x])),
+					     this['store']['literal'](
+						 attrs[x]['nodeValue'],
+						 frame['lang']),
+					     this['why'])
+		    }
+		}
+		else { // we should add an arc (or implicit bnode+arc)
+		    frame['addArc'](elementURI(dom))
+
+		    // save the arc's rdf:ID if it has one
+		    if (this['reify']) {
+			var rdfid = dom['getAttributeNodeNS'](
+			    RDFParser['ns']['RDF'],"ID")
+			if (rdfid) {
+			    frame['rdfid'] = rdfid['nodeValue']
+			    dom['removeAttributeNode'](rdfid)
+			}
+		    }
+
+		    var parsetype = dom['getAttributeNodeNS'](
+			RDFParser['ns']['RDF'],"parseType")
+		    var datatype = dom['getAttributeNodeNS'](
+			RDFParser['ns']['RDF'],"datatype")
+		    if (datatype) {
+			frame['datatype'] = datatype['nodeValue']
+			dom['removeAttributeNode'](datatype)
+		    }
+
+		    if (parsetype) {
+			var nv = parsetype['nodeValue']
+			if (nv == "Literal") {
+			    frame['datatype']
+				= RDFParser['ns']['RDF']+"XMLLiteral"
+			    // (this.buildFrame(frame)).addLiteral(dom)
+			    // should work but doesn't
+			    frame = this['buildFrame'](frame)
+			    frame['addLiteral'](dom)
+			    dig = false
+			}
+			else if (nv == "Resource") {
+			    frame = this['buildFrame'](frame,frame['element'])
+			    frame['parent']['element'] = null
+			    frame['addBNode']()
+			}
+			else if (nv == "Collection") {
+			    frame = this['buildFrame'](frame,frame['element'])
+			    frame['parent']['element'] = null
+			    frame['addCollection']()
+			}
+			dom['removeAttributeNode'](parsetype)
+		    }
+
+		    if (attrs['length'] != 0) {
+			var resource = dom['getAttributeNodeNS'](
+			    RDFParser['ns']['RDF'],"resource")
+			var bnid = dom['getAttributeNodeNS'](
+			    RDFParser['ns']['RDF'],"nodeID")
+
+			frame = this['buildFrame'](frame)
+			if (resource) {
+			    frame['addNode'](resource['nodeValue'])
+			    dom['removeAttributeNode'](resource)
+			} else {
+			    if (bnid) {
+				frame['addBNode'](bnid['nodeValue'])
+				dom['removeAttributeNode'](bnid)
+			    } else { frame['addBNode']() }
+			}
+
+			for (var x = attrs['length']-1; x >= 0; x--) {
+			    var f = this['buildFrame'](frame)
+			    f['addArc'](elementURI(attrs[x]))
+			    if (elementURI(attrs[x])
+				==RDFParser['ns']['RDF']+"type"){
+				(this['buildFrame'](f))['addNode'](
+				    attrs[x]['nodeValue'])
+			    } else {
+				(this['buildFrame'](f))['addLiteral'](
+				    attrs[x]['nodeValue'])
+			    }
+			}
+		    }
+		    else if (dom['childNodes']['length'] == 0) {
+			(this['buildFrame'](frame))['addLiteral']("")
+		    }
+		}
+	    } // rdf:RDF
+
+	    // dig dug
+	    dom = frame['element']
+	    while (frame['parent']) {
+		var pframe = frame
+		while (dom == null) {
+		    frame = frame['parent']
+		    dom = frame['element']
+		}
+		var candidate = dom['childNodes'][frame['lastChild']]
+		if (candidate == null || !dig) {
+		    frame['terminateFrame']()
+		    if (!(frame = frame['parent'])) { break } // done
+		    dom = frame['element']
+		    dig = true
+		}
+		else if ((candidate['nodeType']
+			  != RDFParser['nodeType']['ELEMENT']
+			  && candidate['nodeType']
+			  != RDFParser['nodeType']['TEXT']
+			  && candidate['nodeType']
+			  != RDFParser['nodeType']['CDATA_SECTION'])
+			 || ((candidate['nodeType']
+			      == RDFParser['nodeType']['TEXT']
+			      || candidate['nodeType']
+			      == RDFParser['nodeType']['CDATA_SECTION'])
+			     && dom['childNodes']['length'] != 1)) {
+		    frame['lastChild']++
+		}
+		else { // not a leaf
+		    frame['lastChild']++
+		    frame = this['buildFrame'](pframe,
+					       dom['childNodes'][frame['lastChild']-1])
+		    break
+		}
+	    }
+	} // while
+    }
+
+    /**
+     * Cleans out state from a previous parse run
+     * @private
+     */
+    this['cleanParser'] = function () {
+	this['bnodes'] = {}
+	this['why'] = null
+    }
+
+    /**
+     * Builds scope frame 
+     * @private
+     */
+    this['buildFrame'] = function (parent, element) {
+	var frame = this['frameFactory'](this,parent,element)
+	if (parent) {
+	    frame['base'] = parent['base']
+	    frame['lang'] = parent['lang']
+	}
+	if (element == null
+	    || element['nodeType'] == RDFParser['nodeType']['TEXT']
+	    || element['nodeType'] == RDFParser['nodeType']['CDATA_SECTION']) {
+	    return frame
+	}
+
+	var attrs = element['attributes']
+
+	var base = element['getAttributeNode']("xml:base")
+	if (base != null) {
+	    frame['base'] = base['nodeValue']
+	    element['removeAttribute']("xml:base")
+	}
+	var lang = element['getAttributeNode']("xml:lang")
+	if (lang != null) {
+	    frame['lang'] = lang['nodeValue']
+	    element['removeAttribute']("xml:lang")
+	}
+
+	// remove all extraneous xml and xmlns attributes
+	for (var x = attrs['length']-1; x >= 0; x--) {
+	    if (attrs[x]['nodeName']['substr'](0,3) == "xml") {
+		element['removeAttributeNode'](attrs[x])
+	    }
+	}
+	return frame
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfxmlserializer.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfxmlserializer.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfxmlserializer.js
new file mode 100644
index 0000000..edbf4c8
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/rdfxmlserializer.js
@@ -0,0 +1,130 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+function RDFXMLSerializer() {
+}
+
+
+RDFXMLSerializer.serialize = function(rdfFormula, baseURL) {
+	var statements = rdfFormula.statements;
+	var result = document.implementation.createDocument("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf:RDF", null);
+	var root = result.firstChild;
+	var elementMap = new Object();
+	for (var i = 0; i < statements.length; i++) {
+		RDFXMLSerializer.addStatement(statements[i], result, root, baseURL, elementMap);
+	}
+	root.appendChild(result.createTextNode("\n"));
+	for (var key in elementMap) {
+		elementMap[key].appendChild(result.createTextNode("\n\t"));
+	}
+	//alert(new XMLSerializer().serializeToString(result));
+	return result;
+}
+
+RDFXMLSerializer.addStatement = function(statement, result, root, baseURL, elementMap) {
+	
+	var elem = result.createElementNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdf:Description");
+	var elemId;
+	if (statement.subject.termType == "symbol") {
+		elemId = statement.subject.uri;
+		elem.setAttributeNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdf:about", RDFXMLSerializer.getRelativePath(statement.subject.uri, baseURL));
+	} else {
+		elemId = statement.subject.id;
+		elem.setAttributeNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdf:nodeID", "a"+statement.subject.id);
+	}
+	if (elementMap[elemId]) {
+		elem = elementMap[elemId];
+	} else {
+		elementMap[elemId] = elem;
+		root.appendChild(result.createTextNode("\n\t"));
+		root.appendChild(elem);
+	}
+	elem.appendChild(result.createTextNode("\n"));
+	elem.appendChild(result.createTextNode("\t\t"));
+	var splittedURI = RDFXMLSerializer.splitURI(statement.predicate.uri);
+	var propertyElem = result.createElementNS(splittedURI.ns, splittedURI.name);
+	elem.appendChild(propertyElem);
+	if (statement.object.termType == "symbol") {
+		propertyElem.setAttributeNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdf:resource", RDFXMLSerializer.getRelativePath(statement.object.uri, baseURL));
+	} else {
+		if (statement.object.termType == "literal") {
+			//note supports hacked xml-literals, other types are not in the store
+			if (statement.object.elementValue) {
+				var nodes = statement.object.elementValue.childNodes;
+				for (var i = 0; i < nodes.length; i ++) {
+					propertyElem.appendChild(nodes[i].cloneNode(true));
+				}
+				propertyElem.setAttributeNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdf:parseType", "Literal");
+			} else {
+				var textNode = result.createTextNode(statement.object.value);
+				propertyElem.appendChild(textNode);
+				if (statement.object.lang) {
+					propertyElem.setAttribute("xml:lang", statement.object.lang);
+				}
+			}
+		} else {
+			propertyElem.setAttributeNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#","rdf:nodeID", "a"+statement.object.id);
+		}
+	}
+}
+
+RDFXMLSerializer.splitURI = function(uri) {
+	var poundPos = uri.indexOf('#');
+	var splitPos; 
+	if (poundPos > -1) {
+		splitPos = poundPos;
+	} else {
+		splitPos = uri.lastIndexOf('/');
+	}
+	var result = new Object();
+	result.ns = uri.substring(0, splitPos+1);
+	result.name = uri.substring(splitPos+1);
+	return result;
+	
+}
+
+RDFXMLSerializer.getRelativePath = function(url, contextURL) {
+	if (!contextURL) {
+		return url;
+	}
+	var contextCollection = contextURL.substring(0, contextURL.lastIndexOf('/'));
+	var contextualisation =  RDFXMLSerializer.getRelativePathToCollection(url, contextCollection);
+	if (contextualisation) {
+		return contextualisation;
+	} else {
+		return url;
+	}
+}
+
+RDFXMLSerializer.getRelativePathToCollection = function(url, contextCollection) {
+	if (url.indexOf(contextCollection) == 0) {
+		return url.substring(contextCollection.length+1);
+	} else {
+		if (contextCollection.match(/.*\/\/.*\.*\//)) {
+			var contextCollection = contextCollection.substring(0, contextCollection.lastIndexOf('/'));
+			var superContextualisation = RDFXMLSerializer.getRelativePathToCollection(url, contextCollection);
+			if (superContextualisation) {
+				return "../"+superContextualisation;
+			}
+		} 
+		return null;
+	}
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/term.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/term.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/term.js
new file mode 100644
index 0000000..29e5d7f
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/term.js
@@ -0,0 +1,307 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+// These are the classes corresponding to the RDF and N3 data models
+//
+// Designed to look like rdflib and cwm designs.
+//
+// Issues: Should the names start with RDF to make them
+//      unique as program-wide symbols?
+//
+// W3C open source licence 2005.
+//
+
+RDFTracking = 0  // Are we requiring reasons for statements?
+
+//takes in an object and makes it an object if it's a literal
+function makeTerm(val) {
+    //  fyi("Making term from " + val)
+    if (typeof val == 'object') return val;
+    if (typeof val == 'string') return new RDFLiteral(val);
+    if (typeof val == 'undefined') return undefined;
+    alert("Can't make term from " + val + " of type " + typeof val) // @@ add numbers
+}
+
+
+
+//	Symbol
+
+function RDFEmpty() {
+	return this;
+}
+RDFEmpty.prototype.termType = 'empty'
+RDFEmpty.prototype.toString = function () { return "" }
+RDFEmpty.prototype.toNT = function () { return "" }
+
+function RDFSymbol_toNT(x) {
+    return ("<" + x.uri + ">")
+}
+
+function toNT() {
+    return RDFSymbol_toNT(this)
+}
+
+function RDFSymbol(uri) {
+    this.uri = uri
+    return this
+}
+	
+RDFSymbol.prototype.termType = 'symbol'
+RDFSymbol.prototype.toString = toNT
+RDFSymbol.prototype.toNT = toNT
+
+
+//	Blank Node
+
+var RDFNextId = 0;  // Gobal genid
+RDFGenidPrefix = "genid:"
+NTAnonymousNodePrefix = "_:n"
+
+function RDFBlankNode(id) {
+    /*if (id)
+    	this.id = id;
+    else*/
+    this.id = RDFNextId++
+    return this
+}
+
+RDFBlankNode.prototype.termType = 'bnode'
+
+RDFBlankNode.prototype.toNT = function() {
+    return NTAnonymousNodePrefix + this.id
+}
+RDFBlankNode.prototype.toString = RDFBlankNode.prototype.toNT  
+
+//	Literal
+
+//LiteralSmush = []
+
+function RDFLiteral(value, lang, datatype) {
+	if (typeof value == 'object') {	
+		var serializer = new XMLSerializer();
+		this.value = serializer.serializeToString(value);
+		this.elementValue = value.cloneNode(true); //cloning so taht literal doesn't become mutable
+	} else {
+		//console.debug("value: " +value+" type "+ typeof value);
+    	this.value = value.toString();
+    }
+    this.lang=lang;	  // string
+    this.datatype=datatype;  // term
+    this.toString = RDFLiteralToString
+    this.toNT = RDFLiteral_toNT
+    //if (LiteralSmush[this.toNT()]) return LiteralSmush[this.toNT()];
+    //else LiteralSmush[this.toNT()]=this;
+    return this
+}
+
+RDFLiteral.prototype.termType = 'literal'
+
+function RDFLiteral_toNT() {
+    var str = this.value
+    if (typeof str != 'string') {
+	throw Error("Value of RDF literal is not string: "+str)
+    }
+    str = str.replace(/\\/g, '\\\\');  // escape
+    str = str.replace(/\"/g, '\\"');
+    str = '"' + str + '"'
+
+    if (this.datatype){
+    //alert(this.datatype.termType+"   "+typeof this.datatype)
+	str = str + '^^' + this.datatype//.toNT()
+    }
+    if (this.lang) {
+	str = str + "@" + this.lang
+    }
+    return str
+}
+
+function RDFLiteralToString() {
+    return this.value
+}
+    
+RDFLiteral.prototype.toString = RDFLiteralToString   
+RDFLiteral.prototype.toNT = RDFLiteral_toNT
+
+function RDFCollection() {
+    this.id = RDFNextId++
+    this.elements = []
+    this.closed = false
+}
+
+RDFCollection.prototype.termType = 'collection'
+
+RDFCollection.prototype.toNT = function() {
+    return NTAnonymousNodePrefix + this.id
+}
+RDFCollection.prototype.toString = RDFCollection.prototype.toNT 
+
+RDFCollection.prototype.append = function (el) {
+    this.elements.push(el)
+}
+
+RDFCollection.prototype.close = function () {
+    this.closed = true
+}
+
+//	Statement
+//
+//  This is a triple with an optional reason.
+//
+//   The reason can point to provenece or inference
+//
+function RDFStatement_toNT() {
+    return (this.subject.toNT() + " "
+	    + this.predicate.toNT() + " "
+	    +  this.object.toNT() +" .")
+}
+
+function RDFStatement(subject, predicate, object, why) {
+    this.subject = makeTerm(subject)
+    this.predicate = makeTerm(predicate)
+    this.object = makeTerm(object)
+    if (typeof why !='undefined') {
+	this.why = why
+    } else if (RDFTracking) {
+	fyi("WARNING: No reason on "+subject+" "+predicate+" "+object)
+    }
+    return this
+}
+
+RDFStatement.prototype.toNT = RDFStatement_toNT
+RDFStatement.prototype.toString = RDFStatement_toNT
+	
+
+//	Formula
+//
+//	Set of statements.
+
+function RDFFormula() {
+    this.statements = []
+    this.constraints = []
+    this.initBindings = []
+    this.optional = []
+    return this
+}
+
+/*function RDFQueryFormula() {
+	this.statements = []
+	this.constraints = []
+	this.initBindings = []
+	this.optional = []
+	return this
+}*/
+
+function RDFFormula_toNT() {
+    return "{\n" + this.statements.join('\n') + "}"
+}
+
+//RDFQueryFormula.prototype = new RDFFormula()
+//RDFQueryFormula.termType = 'queryFormula'
+RDFFormula.prototype.termType = 'formula'
+RDFFormula.prototype.toNT = RDFFormula_toNT
+RDFFormula.prototype.toString = RDFFormula_toNT   
+
+RDFFormula.prototype.add = function(subj, pred, obj, why) {
+    this.statements.push(new RDFStatement(subj, pred, obj, why))
+}
+
+// Convenience methods on a formula allow the creation of new RDF terms:
+
+RDFFormula.prototype.sym = function(uri,name) {
+    if (name != null) {
+	uri = this.namespaces[uri] + name
+    }
+    return new RDFSymbol(uri)
+}
+
+RDFFormula.prototype.literal = function(val, lang, dt) {
+    return new RDFLiteral(val, lang, dt)
+}
+
+RDFFormula.prototype.bnode = function(id) {
+    return new RDFBlankNode(id)
+}
+
+RDFFormula.prototype.formula = function() {
+    return new RDFFormula()
+}
+
+RDFFormula.prototype.collection = function () {
+    return new RDFCollection()
+}
+
+
+/*RDFFormula.prototype.queryFormula = function() {
+	return new RDFQueryFormula()
+}*/
+
+RDFVariableBase = "varid:"; // We deem variabe x to be the symbol varid:x 
+
+//An RDFVariable is a type of s/p/o that's not literal. All it holds is it's URI.
+//It has type 'variable', and a function toNT that turns it into NTriple form
+function RDFVariable(rel) {
+    this.uri = URIjoin(rel, RDFVariableBase);
+    return this;
+}
+
+RDFVariable.prototype.termType = 'variable';
+RDFVariable.prototype.toNT = function() {
+    if (this.uri.slice(0, RDFVariableBase.length) == RDFVariableBase) {
+	return '?'+ this.uri.slice(RDFVariableBase.length);} // @@ poor man's refTo
+    return '?' + this.uri;
+};
+
+RDFVariable.prototype.toString = RDFVariable.prototype.toNT;
+RDFVariable.prototype.classOrder = 7;
+
+RDFFormula.prototype.variable = function(name) {
+    return new RDFVariable(name);
+};
+
+RDFVariable.prototype.hashString = RDFVariable.prototype.toNT;
+
+
+// The namespace function generator 
+
+function Namespace(nsuri) {
+    return function(ln) { return new RDFSymbol(nsuri+ln) }
+}
+
+// Parse a single token
+//
+// The bnode bit should not be used on program-external values; designed
+// for internal work such as storing a bnode id in an HTML attribute.
+// Not coded for literals.
+
+RDFFormula.prototype.fromNT = function(str) {
+    var len = str.length
+    var ch = str.slice(0,1)
+    if (ch == '<') return this.sym(str.slice(1,len-1))
+    if (ch == '_') {
+	var x = new RDFBlankNode()
+	x.id = parseInt(str.slice(3))
+	RDFNextId--
+	return x
+    }
+    alert("Can't yet convert from NT: '"+str+"', "+str[0])
+}
+
+// ends

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/uri.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/uri.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/uri.js
new file mode 100644
index 0000000..2a8582e
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/uri.js
@@ -0,0 +1,123 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+//  Implementing URI-specific functions
+//
+//	See RFC 2386
+//
+// This is or was   http://www.w3.org/2005/10/ajaw/uri.js
+// 2005 W3C open source licence
+//
+//
+//  Take a URI given in relative or absolute form and a base
+//  URI, and return an absolute URI
+//
+//  See also http://www.w3.org/2000/10/swap/uripath.py
+//
+
+if (typeof Util == "undefined") { Util = {}}
+if (typeof Util.uri == "undefined") { Util.uri = {}}
+
+Util.uri.join = function (given, base) {
+    // if (typeof fyi != 'undefined') fyi("   URI given="+given+" base="+base)
+    var baseHash = base.indexOf('#')
+    if (baseHash > 0) base = base.slice(0, baseHash)
+    if (given.length==0) return base // before chopping its filename off
+    if (given.indexOf('#')==0) return base + given
+    var colon = given.indexOf(':')
+    if (colon >= 0) return given	// Absolute URI form overrides base URI
+    var baseColon = base.indexOf(':')
+    if (baseColon<0) {alert("Invalid base URL "+ base); return given}
+    var baseScheme = base.slice(0,baseColon+1)  // eg http:
+    if (given.indexOf("//") == 0)     // Starts with //
+	return baseScheme + given;
+    if (base.indexOf('//', baseColon)==baseColon+1) {  // Any hostpart?
+	    var baseSingle = base.indexOf("/", baseColon+3)
+	if (baseSingle < 0) {
+	    if (base.length-baseColon-3 > 0) {
+		return base + "/" + given
+	    } else {
+		return baseScheme + given
+	    }
+	}
+    } else {
+	var baseSingle = base.indexOf("/", baseColon+1)
+	if (baseSingle < 0) {
+	    if (base.length-baseColon-1 > 0) {
+		return base + "/" + given
+	    } else {
+		return baseScheme + given
+	    }
+	}
+    }
+
+    if (given.indexOf('/') == 0)	// starts with / but not //
+	return base.slice(0, baseSingle) + given
+    
+    var path = base.slice(baseSingle)
+    var lastSlash = path.lastIndexOf("/")
+    if (lastSlash <0) return baseScheme + given
+    if ((lastSlash >=0) && (lastSlash < (path.length-1)))
+	path = path.slice(0, lastSlash+1) // Chop trailing filename from base
+    
+    path = path + given
+    while (path.match(/[^\/]*\/\.\.\//)) // must apply to result of prev
+	path = path.replace( /[^\/]*\/\.\.\//, '') // ECMAscript spec 7.8.5
+    path = path.replace( /\.\//g, '') // spec vague on escaping
+    return base.slice(0, baseSingle) + path
+}
+
+/** returns URI without the frag **/
+Util.uri.docpart = function (uri) {
+    var i = uri.indexOf("#")
+    if (i < 0) return uri
+    return uri.slice(0,i)
+} 
+
+/** return the protocol of a uri **/
+Util.uri.protocol = function (uri) {
+    return uri.slice(0, uri.indexOf(':'))
+} //protocol
+
+URIjoin = Util.uri.join
+uri_docpart = Util.uri.docpart
+uri_protocol = Util.uri.protocol
+
+
+/** returns true if has a protocol & domain **/
+/* No -- this is general URI code.  Not all URIs have protocol and domain.
+** Eg file:, mailto: etc
+
+function uri_valid(uri) {
+	return (uri.match(/(.+?):\/\/(.+?)/));  
+} //valid
+
+
+// returns the filename of a uri @fixme
+function uri_filename(uri) {
+	if (uri_valid(uri))
+		return uri.slice(uri.lastIndexOf('/')+1);
+} //filename
+
+*/
+
+
+//ends

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/util.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/util.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/util.js
new file mode 100644
index 0000000..3c43d13
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/util.js
@@ -0,0 +1,174 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/**
+ * Utility functions for tabulator
+ */
+
+/**
+ * A function emulating Scheme's filter. Should have been part of JavaScript so
+ * it is global.
+ */
+function filter(func, list) {
+    //tdebug("entered filter with list length=" + list.length);
+    var output = [];
+    for (var elt in list) {
+	//tdebug("elt=" + list[elt] + ", true? " + func(list[elt]));
+	if (func(list[elt])) {
+	    output.push(list[elt]);
+	}
+    } //construct output
+    //tdebug("exiting filter with list length=" + output.length);
+    return output;
+}
+
+/** 
+ * A function emulating Scheme's map. Should have been part of JavaScript so it
+ * is global.
+ */
+function map(func, list) {
+    //tdebug("entered map with list=" + list.join(", "));
+    var output = [];
+    for (var i in list)  //works on assoc? i hope so
+	output[i] = func(list[i]);
+    return output;
+}
+
+// These are extra
+
+/**
+ * @class A utility class
+ */
+Util = {
+    /** A simple debugging function */         
+        'output': function (o) {
+	    var k = document.createElement('div')
+	    k.textContent = o
+	    document.body.appendChild(k)
+	},
+    /**
+     * A standard way to add callback functionality to an object
+     */
+        'callbackify': function (obj,callbacks) {
+	    obj.callbacks = {}
+	    for (var x=callbacks.length-1; x>=0; x--) {
+		obj.callbacks[callbacks[x]] = []
+	    }
+	    
+	    obj.addHook = function (hook) {
+		if (!obj.callbacks[hook]) { obj.callbacks[hook] = [] }
+	    }
+
+	    obj.addCallback = function (hook, func) {
+		obj.callbacks[hook].push(func)
+	    }
+
+	    obj.fireCallbacks = function (hook, args) {
+		var newCallbacks = []
+		var replaceCallbacks = []
+		var len = obj.callbacks[hook].length
+		for (var x=len-1; x>=0; x--) {
+		    if (obj.callbacks[hook][x].apply(obj,args)) {
+			newCallbacks.push(obj.callbacks[hook][x])
+		    }
+		}
+
+		for (var x=newCallbacks.length-1; x>=0; x--) {
+		    replaceCallbacks.push(newCallbacks[x])
+		}
+		
+		for (var x=len; x<obj.callbacks[hook].length; x++) {
+		    replaceCallbacks.push(obj.callbacks[hook][x])
+		}
+		
+		obj.callbacks[hook] = replaceCallbacks
+	    }
+	},
+    
+    /**
+     * A standard way to create XMLHttpRequest objects
+     */
+	'XMLHTTPFactory': function () {
+	    if (window.XMLHttpRequest) {
+		try {
+		    return new XMLHttpRequest()
+		} catch (e) {
+		    return false
+		}
+	    }
+	    else if (window.ActiveXObject) {
+		try {
+		    return new ActiveXObject("Msxml2.XMLHTTP")
+		} catch (e) {
+		    try {
+			return new ActiveXObject("Microsoft.XMLHTTP")
+		    } catch (e) {
+			return false
+		    }
+		}
+	    }
+	    else {
+		return false
+	    }
+	},
+    /**
+     * Returns a hash of headers and values
+     */
+	'getHTTPHeaders': function (xhr) {
+	    var lines = xhr.getAllResponseHeaders().split("\n")
+	    var headers = {}
+	    var last = undefined
+	    for (var x=0; x<lines.length; x++) {
+		if (lines[x].length > 0) {
+		    var pair = lines[x].split(': ')
+		    if (typeof pair[1] == "undefined") { // continuation
+			headers[last] += "\n"+pair[0]
+		    } else {
+			last = pair[0].toLowerCase()
+			headers[last] = pair[1]
+		    }
+		}
+	    }
+	    return headers
+	},
+
+        'dtstamp': function () {
+	    var now = new Date();
+	    var year  = now.getYear() + 1900;
+	    var month = now.getMonth() + 1;
+	    var day  = now.getDate() + 1;
+	    var hour = now.getUTCHours();
+	    var minute = now.getUTCMinutes();
+	    var second = now.getSeconds();
+	    if (month < 10) month = "0" + month;
+	    if (day < 10) day = "0" + day;
+	    if (hour < 10) hour = "0" + hour;
+	    if (minute < 10) minute = "0" + minute;
+	    if (second < 10) second = "0" + second;
+	    return year + "-" + month + "-" + day + "T"
+		+ hour + ":" + minute + ":" + second + "Z";
+	},
+
+        'enablePrivilege': netscape.security.PrivilegeManager.enablePrivilege,
+
+        'disablePrivilege': netscape.security.PrivilegeManager.disablePrivilege
+}
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/widget-factory.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/widget-factory.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/widget-factory.js
new file mode 100644
index 0000000..1d5317c
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/widget-factory.js
@@ -0,0 +1,995 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+xhtmlNS  = "http://www.w3.org/1999/xhtml";
+
+function RDF(localName) {
+	return new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#'+localName);
+}
+
+function RDFS(localName) {
+	return new RDFSymbol('http://www.w3.org/2000/01/rdf-schema#'+localName);
+}
+
+function WidgetFactory() {
+}
+
+window.onbeforeunload = function () {
+	var overview = "";
+	var unsavedCount = 0;
+	for (var i = 0; i < WidgetFactory.openWidgets.length; i++) {
+		overview += WidgetFactory.openWidgets [i].rdfSymbol+"="+WidgetFactory.openWidgets[i].modified+", ";
+		if (WidgetFactory.openWidgets[i].modified) {
+			unsavedCount++;
+		}
+	}
+	//alert("DEBUG. "+overview);
+	if (unsavedCount > 1) {
+		return "There are "+unsavedCount+" unsaved discobits.";
+	}
+	if (unsavedCount == 1) {
+		return "There is an unsaved discobit.";
+	}
+	return undefined;
+}
+
+WidgetFactory.typeWidgets = new Array();
+
+WidgetFactory.openWidgets = new Array();
+
+
+/**
+ * Creates a new widget
+ * ...
+ * @param {RDFIndexedFormula} lastSavedContent the last saved version of the store, if this is provided the save-link is active in the new widget
+ * @type String
+ */
+WidgetFactory.createBackground = function(terminationListener, rdfSymbol, xhtmlContainer, providedFunctions, store, widgetHolder, lastSavedContent) {
+			// use FireBug extension to inspect console.debug'd objects
+		// Using TestStore you can access store.triples
+		/*if (typeof(console) !=  'undefined') {
+			console.debug('creating '+rdfSymbol+' with WidgetFactory.store',WidgetFactory.store);
+		}*/
+	if (!widgetHolder) {
+		var widgetHolder = new Object();
+		//temporary pseudo-widget, a hack to make rdfSymbol accesible already
+		widgetHolder.widget = new Object();
+		widgetHolder.widget.rdfSymbol = rdfSymbol;
+	}
+	window.setTimeout(function(){
+		WidgetFactory.create(terminationListener, rdfSymbol, xhtmlContainer, providedFunctions, store, widgetHolder, lastSavedContent);
+		
+	}, 0)
+	
+	return widgetHolder;
+}
+WidgetFactory.create = function(terminationListener, rdfSymbol, xhtmlContainer, providedFunctions, store, widgetHolder, lastSavedContent) {
+	//alert("creating widget");
+	//private functions
+	if (!widgetHolder) {
+			var widgetHolder = new Object();
+	}
+	var fillController = function(functions, container) {
+		while (container.firstChild) {
+			container.removeChild(container.firstChild);
+		}
+		for (var i = 0; i < functions.length; i++) {
+			var controlFunction = functions[i];
+			var functionLinkElement = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
+			if (controlFunction.icon) {
+				var functIcon = document.createElementNS("http://www.w3.org/1999/xhtml", "img");
+				functionLinkElement.appendChild(functIcon);
+				functIcon.src = controlFunction.icon;
+				functIcon.alt = controlFunction.label;
+			} else {
+				functionLinkElement.appendChild(document.createTextNode(controlFunction.label));			
+				
+			}
+			functionLinkElement.href = "#";
+			container.appendChild(functionLinkElement);
+			
+			functionLinkElement.onclick = WidgetFactory.createOnClickFromPerform(controlFunction.perform);
+			container.appendChild(document.createTextNode(" "));
+		}
+	}
+	
+	var getGenericControls = function() {
+		var controlFunctions = new Array();
+		var RDFControl = new Object();
+	   	RDFControl.label = "RDF"
+	   	RDFControl.perform = function() {
+	   		mozile.edit.disable();
+		   	var div = document.createElementNS(xhtmlNS, "div");
+			var textarea = document.createElementNS(xhtmlNS, "textarea");
+			div.appendChild(textarea);
+			var useButton = document.createElementNS(xhtmlNS, "button");
+			useButton.appendChild(document.createTextNode("use"));
+			div.appendChild(useButton);
+			var discardButton = document.createElementNS(xhtmlNS, "button");
+			discardButton.appendChild(document.createTextNode("discard"));
+			div.appendChild(discardButton);
+			var body = document.getElementsByTagNameNS(xhtmlNS,"body")[0];
+			div.className = "sourceEdit";
+			textarea.appendChild(document.createTextNode(new XMLSerializer().serializeToString(RDFXMLSerializer.serialize(widgetHolder.widget.getStore(), ""))));
+	   		body.appendChild(div);
+	   		useButton.onclick = function() {
+	   			var editedStore = new RDFIndexedFormula();
+	   			var nodeTree = (new DOMParser()).parseFromString(textarea.value, 'text/xml');
+	   			var docElem = nodeTree.documentElement;
+	   			if (docElem.namespaceURI == 'http://www.mozilla.org/newlayout/xml/parsererror.xml') {
+	   				alert(new XMLSerializer().serializeToString(docElem.firstChild));
+	   				return;
+	   			}
+	   			var parser = new RDFParser(editedStore);
+	   			parser.parse(nodeTree,rdfSymbol.uri);
+				while (xhtmlContainer.firstChild) {
+					xhtmlContainer.removeChild(xhtmlContainer.firstChild);
+				}
+				widgetHolder.widget.remove();
+				WidgetFactory.create(function() {
+					body.removeChild(div);
+					mozile.edit.enable();
+				}, rdfSymbol, xhtmlContainer, providedFunctions, editedStore, widgetHolder, widgetHolder.widget.lastSavedContent);
+					   		}
+	   		discardButton.onclick = function() {
+				body.removeChild(div);
+				mozile.edit.enable();
+	   		}
+   		}
+   		controlFunctions[controlFunctions.length] = RDFControl;
+   		
+   		/* control to view RDF to be revoked
+   		var revRDFControl = new Object();
+	   	revRDFControl.label = "REVRDF"
+	   	revRDFControl.perform = function() {
+	   	
+	   		alert(new XMLSerializer().serializeToString(RDFXMLSerializer.serialize(widget.lastSavedContent, "")));
+   		}
+   		controlFunctions[controlFunctions.length] = revRDFControl;
+   		*/
+   		var uriControl = new Object();
+	   	uriControl.label = "URI"
+	   	uriControl.perform = function() {
+	   		alert(rdfSymbol.uri);
+   		}
+   		controlFunctions[controlFunctions.length] = uriControl;
+   		
+   		var reloadControl = new Object();
+	   	reloadControl.label = "RELOAD"
+	   	reloadControl.perform = function() {
+			var reloadedStore = new RDFIndexedFormula();
+			WidgetFactory.load(rdfSymbol, reloadedStore, function() {
+				while (xhtmlContainer.firstChild) {
+					xhtmlContainer.removeChild(xhtmlContainer.firstChild);
+				}
+				widgetHolder.widget.remove();
+				var body = document.getElementsByTagNameNS(xhtmlNS,"body")[0];
+				var origCursor = body.style.cursor;
+				body.style.cursor = 'progress';
+				WidgetFactory.create(function() {
+					body.style.cursor = origCursor;
+				},rdfSymbol, xhtmlContainer, providedFunctions, reloadedStore, widgetHolder);
+			});
+
+   		}
+   		controlFunctions[controlFunctions.length] = reloadControl;
+   		
+	 	return controlFunctions;
+	}
+	
+	
+	xhtmlContainer.style.border = "dashed";
+	xhtmlContainer.style.borderWidth = "1px 1px 0px 0px";
+	
+	var saveLink = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
+	saveLink.style.visibility ="hidden";
+	//saveLink.appendChild(document.createTextNode("Save"));
+	var saveIcon = document.createElementNS("http://www.w3.org/1999/xhtml", "img");
+	saveLink.appendChild(saveIcon);
+	saveIcon.src = WidgetFactory.root+"mozile/images/silk/page_save.png";
+	;
+	saveLink.onclick = function() {
+		widgetHolder.widget.save();
+	}
+	var controlArea = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+	controlArea.className = "controlArea";
+	
+	//order: genericControls, widgetControls, contextControls, save
+	var genericFunctionContainer = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
+	controlArea.appendChild(genericFunctionContainer);
+	var widgetFunctionContainer = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
+	controlArea.appendChild(widgetFunctionContainer);
+	var contextFunctionContainer = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
+	controlArea.appendChild(contextFunctionContainer);
+	xhtmlContainer.appendChild(controlArea);
+	controlArea.appendChild(saveLink);
+	
+	fillController(getGenericControls(), genericFunctionContainer);
+	
+	var fillContextControler = function(contextFunctions) {
+		fillController(contextFunctions, contextFunctionContainer);
+	}
+
+	if (providedFunctions) {
+		fillContextControler(providedFunctions);
+	}
+		
+	var typeWidget = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+	typeWidget.className = "typeWidget";
+	xhtmlContainer.appendChild(typeWidget);
+	
+	
+	var afterLoading = function() {
+		//	alert("hasType "+WidgetFactory.hasType(rdfSymbol, new RDFSymbol("http://discobits.org/ontology#XHTMLInfoDiscoBit")));
+		
+		widgetHolder.widget = null;
+		
+		var controller = new Object();
+		controller.modifiedStateChanged = function(newState, widget) {
+			if (newState) {
+				saveLink.style.visibility ="";
+				widget.modified = true;
+			} else {
+				saveLink.style.visibility ="hidden";
+				widget.modified = false;
+			}
+		}
+		
+		for (var i = 0; i < WidgetFactory.typeWidgets.length; i++) {
+			if (WidgetFactory.hasType(rdfSymbol, WidgetFactory.typeWidgets[i].type, store)) {
+				widgetHolder.widget = new WidgetFactory.typeWidgets[i](store, rdfSymbol, typeWidget, controller, function(widget) {
+					WidgetFactory.openWidgets.push(widget);
+					if(terminationListener) {
+						window.setTimeout(function(){
+							terminationListener(widgetHolder);
+						}, 0);
+					}
+				});
+				break;
+			}
+		}
+	
+		if (widgetHolder.widget == null) {
+			//throw new Error(rdfSymbol+" no good");
+			widgetHolder.widget = new TypeSelectionWidget(rdfSymbol, typeWidget, xhtmlContainer, providedFunctions);
+			if(terminationListener) {
+				terminationListener(widgetHolder);
+			}
+		}
+	
+		widgetHolder.widget.remove = function() {
+			var newOpenWidgets = new Array();
+			for (var i = 0; i < WidgetFactory.openWidgets.length; i++) {
+				if (WidgetFactory.openWidgets[i] != widgetHolder.widget) {
+					newOpenWidgets.push(WidgetFactory.openWidgets[i]);
+				}
+			}
+			WidgetFactory.openWidgets = newOpenWidgets;
+			if (this.removeChildWidgets) {
+				this.removeChildWidgets();
+			}
+		}
+		 
+	
+		if (widgetHolder.widget.getWidgetControls) {
+			fillController(widgetHolder.widget.getWidgetControls(), widgetFunctionContainer);
+		}
+		widgetHolder.widget.fillContextControler = fillContextControler;
+		widgetHolder.widget.xhtmlContainer = xhtmlContainer
+		widgetHolder.widget.rdfSymbol = rdfSymbol;
+		widgetHolder.widget.controller = controller;
+		if (lastSavedContent) {
+			widgetHolder.widget.lastSavedContent = lastSavedContent;
+			widgetHolder.widget.controller.modifiedStateChanged(true, widgetHolder.widget);
+		} else {
+			if (widgetHolder.widget.getStore) {
+				widgetHolder.widget.lastSavedContent = widgetHolder.widget.getStore();
+			}
+		}
+		if (widgetHolder.widget.getStore) {
+			widgetHolder.widget.save = function() {
+				var widgetStore = widgetHolder.widget.getStore();
+				WidgetFactory.putData(widgetHolder.widget.rdfSymbol, widgetStore, widgetHolder.widget.lastSavedContent);
+				widgetHolder.widget.lastSavedContent = widgetStore;
+				widgetHolder.widget.controller.modifiedStateChanged(false, widgetHolder.widget);
+			}
+		}
+		//alert(new XMLSerializer().serializeToString(RDFXMLSerializer.serialize(widget.getStore(), rdfSymbol.uri)));
+		
+		
+	}
+	
+	if (!store) {
+		var store = WidgetFactory.store;
+		WidgetFactory.ensureDicoBitLoaded(rdfSymbol, function() {
+			store = WidgetFactory.store;
+			afterLoading();
+		});
+	} else {
+		afterLoading();
+	}
+
+}
+
+WidgetFactory.createOnClickFromPerform = function(perform) {
+	return function() {
+		perform();
+		return false;
+	}
+}
+
+TypeSelectionWidget = function(rdfSymbol, typeWidget, xhtmlContainer, providedFunctions) {
+	var select = document.createElementNS("http://www.w3.org/1999/xhtml", "select");
+	typeWidget.appendChild(select);
+	var selectText = "--- select type ----";
+	var option = document.createElementNS("http://www.w3.org/1999/xhtml", "option");
+		select.appendChild(option);
+		option.appendChild(document.createTextNode(selectText));
+	for (var i = 0; i < WidgetFactory.typeWidgets.length; i++) {
+		var option = document.createElementNS("http://www.w3.org/1999/xhtml", "option");
+		select.appendChild(option);
+		option.value = WidgetFactory.typeWidgets[i].type.uri;
+		var label;
+		if (WidgetFactory.typeWidgets[i].description) {
+			label = WidgetFactory.typeWidgets[i].description;
+		} else {
+			label = WidgetFactory.typeWidgets[i].type.uri
+		}
+		option.appendChild(document.createTextNode(label));
+	}
+	var button = document.createElementNS("http://www.w3.org/1999/xhtml", "button");
+	button.appendChild(document.createTextNode("set"));
+	button.disabled = true;
+	typeWidget.appendChild(button);
+	select.onchange = function() {
+		button.disabled = (this.value == selectText);
+	};
+	button.onclick = function() {
+		WidgetFactory.store.add(rdfSymbol, 
+			new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), 
+			new RDFSymbol(select.value));
+		while (xhtmlContainer.firstChild) {
+			xhtmlContainer.removeChild(xhtmlContainer.firstChild);
+		}
+		WidgetFactory.create(function() {}, rdfSymbol, xhtmlContainer, providedFunctions, undefined, undefined, new RDFIndexedFormula());
+		//alert(select.value);
+	};
+}
+
+
+//mozile.debug.logLevel = "debug";
+
+{
+	var found = false;
+	for(var i=0; i < mozile.edit.commands._commands.length; i++) {
+		if(mozile.edit.commands._commands[i] == mozile.edit.save);
+		//delete(mozile.edit.commands._commands[i]);
+		found = true;
+		if (found) {
+			mozile.edit.commands._commands[i] = mozile.edit.commands._commands[i+1];
+		}
+	}
+	mozile.edit.commands._commands.pop();
+}
+
+	
+function XHTMLInfoDiscoBitWidget(store, rdfSymbol, xhtmlContainer, controller, terminationListener) {
+	// Configure Mozile Basics
+	if (!XHTMLInfoDiscoBitWidget.mozileInitialized) {
+		mozile.root = WidgetFactory.root+"mozile/";
+		mozile.useSchema("lib/xhtml.rng");
+		XHTMLInfoDiscoBitWidget.mozileInitialized = true;
+	}
+	this.rdfSymbol = rdfSymbol;
+	this.controller = controller;
+	this.xhtmlContainer = xhtmlContainer;
+	this.origStore = store;
+	this.loadData(store);
+	terminationListener(this);
+}
+
+WidgetFactory.typeWidgets.push(XHTMLInfoDiscoBitWidget);
+
+XHTMLInfoDiscoBitWidget.type = new RDFSymbol("http://discobits.org/ontology#XHTMLInfoDiscoBit");
+
+
+XHTMLInfoDiscoBitWidget.prototype.getWidgetControls = function() {
+	var controlFunctions = new Array();
+	var RDFControl = new Object();
+   	RDFControl.label = "XHTML"
+   	var widget = this;
+   	RDFControl.perform = function() {
+   		mozile.edit.disable();
+	   	var div = document.createElementNS(xhtmlNS, "div");
+		var textarea = document.createElementNS(xhtmlNS, "textarea");
+		div.appendChild(textarea);
+		var useButton = document.createElementNS(xhtmlNS, "button");
+		useButton.appendChild(document.createTextNode("use"));
+		div.appendChild(useButton);
+		var discardButton = document.createElementNS(xhtmlNS, "button");
+		discardButton.appendChild(document.createTextNode("discard"));
+		div.appendChild(discardButton);
+		var body = document.getElementsByTagNameNS(xhtmlNS,"body")[0];
+		div.className = "sourceEdit";
+		var serialized = "";
+		for (var i = 0; i < widget.editableArea.childNodes.length; i++) {
+			serialized += new XMLSerializer().serializeToString(widget.editableArea.childNodes[i]);
+		}
+		textarea.appendChild(document.createTextNode(serialized));
+   		body.appendChild(div);
+   		useButton.onclick = function() {
+   			var editedStore = new RDFIndexedFormula();
+   			var nodeTree = (new DOMParser()).parseFromString("<elem xmlns=\"http://www.w3.org/1999/xhtml\">"+textarea.value+"</elem>", 'text/xml');
+   			var docElem = nodeTree.documentElement;
+   			if (docElem.namespaceURI == 'http://www.mozilla.org/newlayout/xml/parsererror.xml') {
+   				alert(new XMLSerializer().serializeToString(docElem.firstChild));
+   				return;
+   			}
+   			widget.remove();
+   			while (widget.editableArea.firstChild) {
+	   			widget.editableArea.removeChild(widget.editableArea.firstChild);
+   			}
+   			for (var i = 0; i < nodeTree.documentElement.childNodes.length; i++) {
+				widget.editableArea.appendChild(nodeTree.documentElement.childNodes[i].cloneNode(true));
+			}
+			widget.controller.modifiedStateChanged(true, widget);
+   			body.removeChild(div);
+			mozile.edit.enable();
+   		}
+   		discardButton.onclick = function() {
+			body.removeChild(div);
+			mozile.edit.enable();
+   		}
+  		}
+  		controlFunctions[controlFunctions.length] = RDFControl;
+  		return controlFunctions;
+}   		
+
+XHTMLInfoDiscoBitWidget.prototype.loadData = function(store) {
+	var infobitProperty = store.anyStatementMatching(this.rdfSymbol, new RDFSymbol("http://discobits.org/ontology#infoBit"), undefined);
+	if (infobitProperty) {
+		var objectElement = infobitProperty.object.elementValue;
+	} else {
+		var objectElement = document.createElementNS("http://discobits.org/ontology#","infoBit");
+		objectElement.appendChild(document.createTextNode("empty"));
+	}
+	//var editableParagraph = document.createElementNS("http://www.w3.org/1999/xhtml", "p");
+	//xhtmlContainer.appendChild(editableParagraph);
+	WidgetFactory.appendChildrenInDiv(objectElement, this.xhtmlContainer);
+	this.editableArea = this.xhtmlContainer.childNodes[0];
+	mozile.editElement(this.editableArea);
+	var controller = this.controller;
+	var widget = this;
+	var modifiedTrue = function() {
+		controller.modifiedStateChanged(true, widget);
+	}
+	this.editableArea.addEventListener("change", modifiedTrue, false);
+}
+
+XHTMLInfoDiscoBitWidget.prototype.getStore = function() {
+	var store = new RDFIndexedFormula();
+	store.add(this.rdfSymbol, new RDFSymbol("http://discobits.org/ontology#infoBit"), new RDFLiteral(this.editableArea));
+	store.add(this.rdfSymbol, 
+		new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), 
+		new RDFSymbol("http://discobits.org/ontology#XHTMLInfoDiscoBit"));
+	var origStatements = this.origStore.statements
+	for (var i=0; i<origStatements.length; i++) {
+        var statement = origStatements[i];
+		if (statement.subject.uri == this.rdfSymbol.uri) {
+			if (!(statement.predicate.uri == "http://discobits.org/ontology#infoBit")) {
+				store.add(statement.subject, statement.predicate, statement.object)
+			}
+		}
+    }
+	return store;
+}
+
+
+
+
+
+function OrderedContentWidget(store, rdfSymbol, xhtmlContainer, controller, terminationListener) {
+	this.controller = controller;
+	this.rdfSymbol = rdfSymbol;
+	this.origStore = store;
+	this.load(store, rdfSymbol, xhtmlContainer, terminationListener);	
+}
+
+
+
+OrderedContentWidget.prototype.load = function(store, rdfSymbol, xhtmlContainer, terminationListener) {
+   
+    var containsStatements = store.statementsMatching(rdfSymbol, new RDFSymbol("http://discobits.org/ontology#contains"), undefined);
+    this.childElemContainer = document.createElementNS("http://www.w3.org/1999/xhtml", "ol");
+    this.childElemContainer.className = this.getChildElemContainerClassName();
+    
+    var children = new Array();//the rdfSymbolS of the children, will accessible by childWidgets[i].rdfSymbol
+    var thisWidget = this;
+    for(var i=0;i<containsStatements.length;i++) {
+        var entry = containsStatements[i].object;
+        var pos = store.statementsMatching(entry, new RDFSymbol("http://discobits.org/ontology#pos"), undefined);
+        var holdsStatements = store.statementsMatching(entry, new RDFSymbol("http://discobits.org/ontology#holds"), undefined);
+        children[pos[0].object] = holdsStatements[0].object; 
+    }
+	var elementsToAdd = children.length;
+	if (elementsToAdd == 0) {
+    	window.setTimeout(function() {terminationListener(thisWidget);}, 0);
+    }
+    this.childWidgets = new Array(children.length);
+    for(var j=0;j<children.length;j++) {  
+    	this.addChild(children[j], j, undefined, function() {
+    		elementsToAdd--;
+    		if (elementsToAdd == 0) {
+    			terminationListener(thisWidget);
+    		}
+    	});    	
+    }
+    xhtmlContainer.appendChild(this.childElemContainer);
+}
+
+OrderedContentWidget.type = new RDFSymbol("http://discobits.org/ontology#OrderedContent");
+
+WidgetFactory.typeWidgets.push(OrderedContentWidget);
+
+OrderedContentWidget.prototype.addChild = function(child, pos, lastSavedStore, terminationListener) {
+   	var li = document.createElementNS("http://www.w3.org/1999/xhtml", "li");
+   	var div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+   	this.positionHandling(pos, div);
+   	var controlFunctions = this.getControlFunctions(li, pos);
+   	this.childElemContainer.appendChild(li);
+   	li.appendChild(div);
+   	this.childWidgets[pos] = WidgetFactory.createBackground(terminationListener, child, div, controlFunctions, undefined, undefined, lastSavedStore);
+}
+
+OrderedContentWidget.prototype.removeChildWidgets = function() {
+	for (var i = 0; i < this.childWidgets.length; i++) {
+		this.childWidgets[i].widget.remove();
+	}
+}
+
+OrderedContentWidget.prototype.getWidgetControls = function() {
+	var controlFunctions = new Array();
+	var moveUpControl = new Object();
+   	moveUpControl.label = "ADD";
+   	var orderedContentWidget = this;
+   	moveUpControl.perform = function() {
+   		var baseURI = orderedContentWidget.rdfSymbol.uri;
+   		if (!baseURI.match(/\/$/)) {
+   			baseURI += "-el/";
+   		}
+   		var childRDFSymbol = new RDFSymbol(baseURI+orderedContentWidget.childWidgets.length);
+   		orderedContentWidget.addChild(childRDFSymbol, orderedContentWidget.childWidgets.length); 
+   		orderedContentWidget.controller.modifiedStateChanged(true, orderedContentWidget);
+   	}
+   	controlFunctions[controlFunctions.length] = moveUpControl;
+	return controlFunctions;
+}
+OrderedContentWidget.prototype.getControlFunctions = function(li, pos) {
+	var controlFunctions = new Array();
+	var childWidgets = this.childWidgets;
+	var containerWidget = this;
+	
+	if (pos > 0) {
+	   	var moveUpControl = new Object();
+	   	moveUpControl.label = "UP";
+	   	moveUpControl.perform = function() {
+	   		if (!li.previousSibling) {
+	   			alert("no previous element");
+	   			return;
+	   		}
+	   		var previousLiElem = li.previousSibling;
+	   		var ulElem = li.parentNode;
+	   		ulElem.removeChild(li);
+	   		ulElem.insertBefore(li, previousLiElem);
+	   		var previousWidget = childWidgets[pos -1];
+	   		childWidgets[pos -1] = childWidgets[pos];
+	   		childWidgets[pos] = previousWidget;
+	   		for (var i = 0; i < childWidgets.length; i++) {
+	   			childWidgets[i].widget.fillContextControler(containerWidget.getControlFunctions(ulElem.childNodes[i], i));
+	   		}
+	   		containerWidget.controller.modifiedStateChanged(true, containerWidget);
+	   	}
+	   	controlFunctions[controlFunctions.length] = moveUpControl;
+	   	
+   	}
+   	if (pos < (this.childWidgets.length -1)) {
+	   	var moveDownControl = new Object();
+	   	moveDownControl.label = "DOWN";
+	   	moveDownControl.perform = function() {
+	   		if (!li.nextSibling) {
+	   			alert("no next element");
+	   			return;
+	   		}
+	   		var nextLiElem = li.nextSibling;
+	   		var ulElem = li.parentNode;
+	   		ulElem.removeChild(nextLiElem);
+	   		ulElem.insertBefore(nextLiElem, li);
+	   		var nextWidget = childWidgets[pos +1];
+	   		childWidgets[pos +1] = childWidgets[pos];
+	   		childWidgets[pos] = nextWidget;
+	   		for (var i = 0; i < childWidgets.length; i++) {
+	   			childWidgets[i].widget.fillContextControler(containerWidget.getControlFunctions(ulElem.childNodes[i], i));
+	   		}
+	   		containerWidget.controller.modifiedStateChanged(true, containerWidget);
+	   	}
+	   	controlFunctions[controlFunctions.length] = moveDownControl;
+   	}
+   	
+   	
+   	var removeControl = new Object();
+   	removeControl.label = "REMOVE"
+   	removeControl.perform = function() {
+   		var ulElem = li.parentNode;
+   		ulElem.removeChild(li);
+   		containerWidget.controller.modifiedStateChanged(true, containerWidget);
+   		var j = 0;
+   		for (var i = 0; i < childWidgets.length; i++) {
+   			if (i != pos) {
+	   			childWidgets[j] = childWidgets[i];
+	   			j++;
+	   		} else {
+	   			//alert("DEBUG: removing "+childWidgets[i].widget.rdfSymbol);
+	   			childWidgets[i].widget.remove();
+	   		}
+	   	}
+	   	childWidgets.length = childWidgets.length-1;
+	   	for (var i = 0; i < childWidgets.length; i++) {
+		   	childWidgets[i].widget.fillContextControler(containerWidget.getControlFunctions(ulElem.childNodes[i], i));
+		}
+   	}
+   	controlFunctions[controlFunctions.length] = removeControl;
+   	
+   	return controlFunctions;
+}
+
+OrderedContentWidget.prototype.getChildElemContainerClassName = function() {
+	return "orderedContent";
+}
+
+OrderedContentWidget.prototype.positionHandling = function(pos, div) {
+	//div.appendChild(document.createTextNode("regular: "));
+}
+OrderedContentWidget.prototype.getStore = function() {
+	var store = new RDFIndexedFormula();
+	store.add(this.rdfSymbol, 
+		new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), 
+		new RDFSymbol('http://discobits.org/ontology#OrderedContent'));
+	for (var i = 0; i < this.childWidgets.length; i++) {
+		var entry = this.getEntryForChild(store, i);
+		store.add(this.rdfSymbol,  
+		new RDFSymbol('http://discobits.org/ontology#contains'),
+		entry);
+	}
+	var origStatements = this.origStore.statements
+	for (i=0; i<origStatements.length; i++) {
+        var statement = origStatements[i];
+		if (statement.subject.uri == this.rdfSymbol.uri) {
+			if (!(statement.predicate.uri == "http://discobits.org/ontology#contains")) {
+				store.add(statement.subject, statement.predicate, statement.object)
+			}
+		}
+    }
+	return store;
+}
+
+OrderedContentWidget.prototype.getEntryForChild = function(store, entryPos) {
+	var result = new RDFBlankNode();
+	store.add(result, 
+		new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), 
+		new RDFSymbol('http://discobits.org/ontology#Entry'));
+	store.add(result,  
+		new RDFSymbol('http://discobits.org/ontology#pos'),
+		new RDFLiteral(entryPos));
+	store.add(result,  
+		new RDFSymbol('http://discobits.org/ontology#holds'),
+		this.childWidgets[entryPos].widget.rdfSymbol);
+	return result;
+}
+
+
+function TitledContentWidget(store, rdfSymbol, xhtmlContainer, controller, terminationListener) {
+	var containsStatements = store.statementsMatching(rdfSymbol, new RDFSymbol("http://discobits.org/ontology#contains"), undefined);
+    this.childElemContainer = document.createElementNS("http://www.w3.org/1999/xhtml", "ol");
+    this.childElemContainer.className = this.getChildElemContainerClassName();
+	this.origStore = store
+    var titledContentWidget = this;
+    var elementsToAdd = 2;
+    var subTerminationListener = function() {
+    	elementsToAdd--;
+    	if (elementsToAdd == 0) {
+    		terminationListener(titledContentWidget);
+    	}
+    }
+    
+    if (containsStatements.length != 2) {
+    	this.childWidgets = new Array(2);
+    	var baseURI = rdfSymbol.uri;
+   		if (!baseURI.match(/\/$/)) {
+   			baseURI += "-";
+   		}
+   		
+   		var titleURI = baseURI + "title";
+   		var titleRDFSymbol = new RDFSymbol(titleURI);
+   		WidgetFactory.store.add(titleRDFSymbol,  RDF("type"), XHTMLInfoDiscoBitWidget.type);
+		this.addChild(titleRDFSymbol, 0, new RDFIndexedFormula(), function(widgetHolder) {
+			widgetHolder.widget.controller.modifiedStateChanged(true, widgetHolder.widget);
+			//titledContentWidget.childWidgets[0].widget.controller.modifiedStateChanged(true);
+			subTerminationListener();
+		});    		
+   		var contentURI = baseURI + "content";
+   		var contentRDFSymbol = new RDFSymbol(contentURI);
+		this.addChild(contentRDFSymbol, 1, undefined, subTerminationListener); 
+   		controller.modifiedStateChanged(true, this);
+   		
+   		xhtmlContainer.appendChild(this.childElemContainer);
+    } else {
+		this.load(store, rdfSymbol, xhtmlContainer, terminationListener);
+	}
+
+	
+}
+
+TitledContentWidget.type = new RDFSymbol("http://discobits.org/ontology#TitledContent");
+
+WidgetFactory.typeWidgets.push(TitledContentWidget);
+
+TitledContentWidget.prototype.load = OrderedContentWidget.prototype.load;
+TitledContentWidget.prototype.addChild = OrderedContentWidget.prototype.addChild;
+TitledContentWidget.prototype.getEntryForChild = OrderedContentWidget.prototype.getEntryForChild;
+TitledContentWidget.prototype.removeChildWidgets = OrderedContentWidget.prototype.removeChildWidgets;
+
+TitledContentWidget.prototype.getControlFunctions = function(li, pos) {
+	controlFunctions = new Array();
+	return controlFunctions;
+}
+
+TitledContentWidget.prototype.getChildElemContainerClassName = function() {
+	return "titledContent";
+}
+
+TitledContentWidget.prototype.positionHandling = function(pos, div) {
+	if (pos == 0) {
+		WidgetFactory.addClass(div, "title");
+	}
+	
+	if (pos == 1) {
+		WidgetFactory.addClass(div, "content");
+	}
+}
+
+TitledContentWidget.prototype.getStore = function() {
+	var store = new RDFIndexedFormula();
+	store.add(this.rdfSymbol, 
+		new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), 
+		new RDFSymbol('http://discobits.org/ontology#TitledContent'));
+	for (var i = 0; i < this.childWidgets.length; i++) {
+		var entry = this.getEntryForChild(store, i);
+		store.add(this.rdfSymbol,  
+		new RDFSymbol('http://discobits.org/ontology#contains'),
+		entry);
+	}
+	var origStatements = this.origStore.statements
+	for (i=0; i<origStatements.length; i++) {
+        var statement = origStatements[i];
+		if (statement.subject.uri == this.rdfSymbol.uri) {
+			if (!(statement.predicate.uri == "http://discobits.org/ontology#contains")) {
+				store.add(statement.subject, statement.predicate, statement.object)
+			}
+		}
+    }
+	return store;
+}
+
+// helpers ////////////
+WidgetFactory.addClass = function(elem, className) {
+	//elem.className += "foo bar ";
+	elem.className += " "+className;
+	
+}
+WidgetFactory.hasType = function(rdfSymbol, type, store) {
+ 	//alert("anyStatementMatching for "+rdfSymbol+WidgetFactory.store.anyStatementMatching(rdfSymbol, undefined, undefined));
+	//return (typeof(WidgetFactory.store.anyStatementMatching(rdfSymbol, undefined, type)) != 'undefined')
+	return (typeof(store.anyStatementMatching(rdfSymbol, new RDFSymbol('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), type)) != 'undefined')
+}
+
+WidgetFactory.appendChildrenInDiv = function(objectElement, xhtmlContainer) {
+		var div = document.createElementNS("http://www.w3.org/1999/xhtml", "p");
+		/*if (typeof(console) !=  'undefined') {
+			console.debug(objectElement);
+		}*/
+		for( var i=0; i< objectElement.childNodes.length; i++ ){
+			/*if (typeof(console) !=  'undefined') {
+				console.debug("adding node "+i+" "+objectElement.childNodes[i]);
+			}*/
+			div.appendChild(objectElement.childNodes[i].cloneNode(true));		
+		}
+		xhtmlContainer.appendChild(div);	
+	}
+WidgetFactory.putData = function(rdfSymbol, store, previousStore, noContainerCreation) {
+	var url = rdfSymbol.uri;
+	var xhr = Util.XMLHTTPFactory();
+	
+	xhr.open("PUT", url, false);
+	xhr.setRequestHeader("Content-Type", "application/rdf+xml");
+	xhr.send(new XMLSerializer().serializeToString(RDFXMLSerializer.serialize(store, rdfSymbol.uri)));
+	/*RFC 2518 says: "A PUT that would result in the creation of a resource without an
+   appropriately scoped parent collection MUST fail with a 409."
+   
+   Apache however sends a 403*/
+	if ((xhr.status == 409) || (xhr.status == 403)) {
+  		//alert("collection does not exist"+xhr.responseText);
+  		if (!noContainerCreation) {
+  			WidgetFactory.createContainingCollection(url);
+  			WidgetFactory.putData(rdfSymbol, store, previousStore, true);
+  		} else {
+  			throw new Error(xhr.responseText);
+  		}
+  	} else {
+	  	if (xhr.status >= 300) {
+	  		alert("server returned failure: "+xhr.responseText);
+	  	}
+	 }
+}
+
+WidgetFactory.createContainingCollection = function(url, noContainerCreation) {
+	if (url == "/") {
+		return;
+	} 
+	var containerURL = url.substring(0, url.lastIndexOf('/',url.length -2)+1);
+	var xhr = Util.XMLHTTPFactory();
+	xhr.open("MKCOL", containerURL, false);
+	xhr.send();
+	if ((xhr.status == 409) || (xhr.status == 403)) {
+  		//alert("collection does not exist"+xhr.responseText);
+  		if (!noContainerCreation) {
+  			WidgetFactory.createContainingCollection(containerURL);
+  			WidgetFactory.createContainingCollection(url, true);
+  		} else {
+  			throw new Error(xhr.responseText);
+  		}
+  	} else {
+	  	if (xhr.status >= 300) {
+	  		alert("server returned failure: "+xhr.responseText);
+	  	}
+  	}
+}
+
+WidgetFactory.ensureDicoBitLoaded = function(rdfSymbol, terminationListener) {
+	if(WidgetFactory.isLoading) {
+		window.setTimeout(function() {
+			WidgetFactory.ensureDicoBitLoaded(rdfSymbol, terminationListener);
+		}, 10);
+	} else {
+		if (typeof(WidgetFactory.store.anyStatementMatching(rdfSymbol)) == 'undefined') {
+			WidgetFactory.isLoading = true;
+			WidgetFactory.store = WidgetFactory.removeContext(rdfSymbol, WidgetFactory.store);
+			WidgetFactory.load(rdfSymbol, WidgetFactory.store, function(store) {
+				WidgetFactory.isLoading = false;
+				terminationListener(store);
+			});
+		} else {
+			terminationListener();
+		}
+	}
+}
+
+WidgetFactory.createURIderefURL = function(uri) {
+	return uri;
+}
+/**
+* returns the context of a resource as an aaray of statements
+*/
+WidgetFactory.getContext = function(rdfSymbol, store, pResult) {
+	if (pResult) {
+		var result = pResult;
+	} else {
+		var result = [ ];
+	}
+	var directedExpander = function(directioner) {
+		for (var i = 0; i < statements.length; i++) {
+			if (result.contains(statements[i])) {
+				continue;
+			}
+			result.push(statements[i]);
+			var other = directioner(statements[i]);
+			if (other.termType == 'bnode') {
+				WidgetFactory.getContext(other, store, result);
+			}
+		}
+	}
+	var statements = store.statementsMatching(rdfSymbol, undefined, undefined);
+	directedExpander(function(statement) {
+		return statement.object;
+	});
+	statements = store.statementsMatching(undefined, undefined, rdfSymbol);
+	directedExpander(function(statement) {
+		return statement.subject;
+	});
+	return result;
+}
+
+WidgetFactory.removeContext = function(rdfSymbol, store) {
+	var result = new RDFIndexedFormula();
+	var blockStatements = WidgetFactory.getContext(rdfSymbol, store);
+	var statements = store.statementsMatching(undefined, undefined, undefined);
+	for (var i = 0; i < statements.length; i++) {
+		if (!blockStatements.contains(statements[i])) {
+			result.statements.push(statements[i]);
+		}
+	}
+	return result;
+}
+
+
+WidgetFactory.load = function(rdfSymbol, pStore, terminationListener) {
+	var store;
+	if (pStore) {
+		store = pStore;
+	} else {
+		store = new RDFIndexedFormula();
+	}
+	var parser = new RDFParser(store);
+	parser.reify = parser.forceRDF = true;
+	// forceRDF isn't used??
+	
+	
+	// var url = 'http://something.or/other';
+	
+	// get the XML
+	var xhr = Util.XMLHTTPFactory(); // returns a new XMLHttpRequest, or ActiveX XMLHTTP object
+	if (xhr.overrideMimeType) {
+	    xhr.overrideMimeType("text/xml");
+	}
+	// the "data/" path and encoding is just how I store files locally
+	xhr.onload = function() {
+		var nodeTree = xhr.responseXML;
+		if (nodeTree === null && xhr.responseText !== null) {
+		    // Only if the server fails to set Content-Type: text/xml AND xmlhttprequest doesn't have the overrideMimeType method
+		    nodeTree = (new DOMParser()).parseFromString(xhr.responseText, 'text/xml');
+		}
+		// must be an XML document node tree
+		parser.parse(nodeTree,rdfSymbol.uri);
+		terminationListener(store);	
+	};
+	xhr.open("GET", WidgetFactory.createURIderefURL(rdfSymbol.uri), true);
+        xhr.setRequestHeader("Accept", "application/rdf+xml");
+	// xhr.open("GET", "data/" + encodeURIComponent(encodeURIComponent(url)), false);
+	xhr.send("");
+	
+	
+}
+WidgetFactory.store = new RDFIndexedFormula();//WidgetFactory.load(document.location.toString().substring(0, document.location.toString().lastIndexOf('/')+1)+'sample1b.rdf');
+
+Array.prototype.contains = function(element) {
+  for(var i = 0; i < this.length; i++) {
+    if (this[i] == element) {
+      return true;
+    }
+  }
+  return false;
+}
+
+
+//////////////////
+
+
+
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/scripts/tria-disco.js
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/scripts/tria-disco.js b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/scripts/tria-disco.js
new file mode 100644
index 0000000..7026eca
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/scripts/tria-disco.js
@@ -0,0 +1,56 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+function TriaDisco() {
+	var graphUri = null;
+}
+
+
+TriaDisco.putData = function(rdfSymbol, store, previousStore, noContainerCreation) {
+    var xhr = Util.XMLHTTPFactory();
+    var postUrl = "post";
+	if (TriaDisco.graphUri != null) {
+		postUrl += "?graph="+TriaDisco.graphUri
+	}
+    xhr.open('POST', postUrl, false);
+
+	var assertedRDF = new XMLSerializer().serializeToString(RDFXMLSerializer.serialize(store, ""));
+	var revokedRDF = new XMLSerializer().serializeToString(RDFXMLSerializer.serialize(previousStore, ""));
+	var parameters = "assert="+encodeURIComponent(assertedRDF);
+	parameters += "&revoke="+encodeURIComponent(revokedRDF);
+	xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+	xhr.setRequestHeader("Content-length", parameters.length);
+	//xhr.setRequestHeader("Connection", "close");
+	xhr.send(parameters);
+    if (xhr.status >= 300) {
+        alert(xhr.status+" " +xhr.statusText);
+        throw new Error(xhr.status+" " +xhr.statusText);
+    }
+            
+}
+
+WidgetFactory.createURIderefURL = function(uri) {
+	var getUrl = "get?resource="+uri;
+	if (TriaDisco.graphUri != null) {
+		getUrl += "&graph="+TriaDisco.graphUri
+	}
+	return getUrl;
+}


[29/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation.viewer/pom.xml
----------------------------------------------------------------------
diff --git a/platform/documentation.viewer/pom.xml b/platform/documentation.viewer/pom.xml
new file mode 100644
index 0000000..1d9be7c
--- /dev/null
+++ b/platform/documentation.viewer/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.documentation.viewer</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Clerezza - Platform Documentation Viewer</name>
+    <description>Presents the documentation of the Clerezza Platform
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.documentation</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation.viewer/src/main/java/org/apache/clerezza/platform/documentation/viewer/DocumentationViewer.java
----------------------------------------------------------------------
diff --git a/platform/documentation.viewer/src/main/java/org/apache/clerezza/platform/documentation/viewer/DocumentationViewer.java b/platform/documentation.viewer/src/main/java/org/apache/clerezza/platform/documentation/viewer/DocumentationViewer.java
new file mode 100644
index 0000000..32ad8d7
--- /dev/null
+++ b/platform/documentation.viewer/src/main/java/org/apache/clerezza/platform/documentation/viewer/DocumentationViewer.java
@@ -0,0 +1,238 @@
+/*
+ * 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.documentation.viewer;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
+import org.apache.clerezza.platform.documentation.DocumentationProvider;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.DOCUMENTATION;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+
+/**
+ *
+ * The documentation viewer provides a webpage that shows the available
+ * documentation.
+ *
+ * @scr.component
+ * @scr.service interface="java.lang.Object"
+ * @scr.property name="javax.ws.rs" type="Boolean" value="true"
+ *
+ * @author mir
+ */
+@Path("/documentation")
+public class DocumentationViewer {
+
+    /**
+     * @scr.reference
+     */
+    private TcManager tcManager;
+        
+    /**
+     * Redirects to the overview page
+     *
+     * @return {@link Response}
+     *
+     */
+    @GET
+    public GraphNode documentationPage(@Context UriInfo uriInfo) {
+        TrailingSlash.enforcePresent(uriInfo);
+        Graph documentations = tcManager.getGraph(
+                DocumentationProvider.DOCUMENTATION_GRAPH_URI);        
+        Collection<DocumentationItem> docItems = getDocItems(documentations);        
+        List<DocumentationItem> sortedDocItems = sortDocItems(docItems);        
+        MGraph mGraph = new SimpleMGraph();
+        BNode orderedContent = createOrderedContent(sortedDocItems, mGraph);
+        BNode titledContent = createTitledContent(orderedContent, mGraph);
+        MGraph resultGraph = new UnionMGraph(mGraph, documentations);
+        GraphNode resultNode = new GraphNode(titledContent, resultGraph);
+        return resultNode;
+    }
+
+    private Collection<DocumentationItem> getDocItems(Graph documentations) {
+        Iterator<Triple> docs = documentations.filter(null, 
+                DOCUMENTATION.documentation, null);        
+
+        Map<UriRef,DocumentationItem> uri2docItemObj = 
+            new HashMap<UriRef,DocumentationItem>();
+        
+        while (docs.hasNext()) {
+            Triple docc = docs.next();
+            UriRef docItem = (UriRef) docc.getObject();
+            Iterator<Triple> afterDocItemsIter = documentations.filter(docItem,
+                DOCUMENTATION.after, null);
+            Set<UriRef> afterDocItems = new HashSet<UriRef>();
+            while (afterDocItemsIter.hasNext()) {
+                afterDocItems.add((UriRef) afterDocItemsIter.next().getObject());
+            }
+            DocumentationItem docItemObj = new DocumentationItem(
+                    docItem, afterDocItems, uri2docItemObj);
+            uri2docItemObj.put(docItem, docItemObj);
+        }        
+        return uri2docItemObj.values();
+    }
+
+    protected List<DocumentationItem> sortDocItems(
+        Collection<DocumentationItem> docItems) {
+        List<DocumentationItem> result = 
+                new ArrayList<DocumentationItem>();
+        Iterator<DocumentationItem> items = docItems.iterator();
+
+        OUTER: while (items.hasNext()) {
+            DocumentationItem item = items.next();
+            for (int i = 0; i < result.size(); i++ ) {
+                if (result.get(i).isAfer(item.documentationItem)) {
+                    result.add(i, item);
+                    continue OUTER;
+                }
+            }
+            result.add(item);
+        }
+        return result;
+    }
+
+    private BNode createOrderedContent(List<DocumentationItem> sortedDocItems,
+        MGraph mGraph) {
+        BNode orderedContent = new BNode();
+        mGraph.add(new TripleImpl(orderedContent, RDF.type, DISCOBITS.OrderedContent));
+        Integer pos = 0;
+        Iterator<DocumentationItem> docItemObjsIter = sortedDocItems.iterator();
+        while (docItemObjsIter.hasNext()) {
+            DocumentationItem docItemObj = docItemObjsIter.next();
+            BNode containedDoc = new BNode();
+            mGraph.add(new TripleImpl(orderedContent, DISCOBITS.contains,
+                    containedDoc));
+            mGraph.add(new TripleImpl(containedDoc, DISCOBITS.pos,
+                    new PlainLiteralImpl(pos.toString())));
+            mGraph.add(new TripleImpl(containedDoc, DISCOBITS.holds,
+                    docItemObj.documentationItem));
+            pos++;
+        }
+        return orderedContent;
+    }
+
+    private BNode createTitledContent(BNode orderedContent, MGraph mGraph) {
+        BNode titledContent = new BNode();
+        mGraph.add(new TripleImpl(titledContent, RDF.type, DISCOBITS.TitledContent));
+        BNode title = new BNode();
+        mGraph.add(new TripleImpl(title, DISCOBITS.pos, new PlainLiteralImpl("0")));
+        BNode titleXml = new BNode();
+        mGraph.add(new TripleImpl(titleXml, RDF.type, DISCOBITS.XHTMLInfoDiscoBit));
+        mGraph.add(new TripleImpl(titleXml, DISCOBITS.infoBit,
+                LiteralFactory.getInstance().createTypedLiteral("Documentation")));
+        mGraph.add(new TripleImpl(title, DISCOBITS.holds, titleXml));
+        mGraph.add(new TripleImpl(title, RDF.type, DISCOBITS.Entry));
+        mGraph.add(new TripleImpl(titledContent, DISCOBITS.contains, title));        
+        BNode content = new BNode();
+        mGraph.add(new TripleImpl(content, DISCOBITS.pos, new PlainLiteralImpl("1")));
+        mGraph.add(new TripleImpl(content, DISCOBITS.holds, orderedContent));
+        mGraph.add(new TripleImpl(content, RDF.type, DISCOBITS.Entry));
+        mGraph.add(new TripleImpl(titledContent, DISCOBITS.contains, content));        
+        return titledContent;
+    }
+
+    protected static class DocumentationItem {
+
+        private UriRef documentationItem;
+        private Set<UriRef> afterDocItems;
+        
+        private boolean transitiveAfterDocItemsAdded = false;
+        private Map<UriRef, DocumentationItem> uri2docItemObj;
+
+        DocumentationItem(UriRef doumentationItem, Set<UriRef> explicitAfterDocItems,
+            Map<UriRef, DocumentationItem> uri2docItemObj) {
+            this.documentationItem = doumentationItem;
+            this.afterDocItems = explicitAfterDocItems;
+            this.uri2docItemObj = uri2docItemObj;
+        }
+
+        public boolean isAfer(UriRef docItem) {
+            return getAfterDocItems().contains(docItem);
+        }
+        
+        private Set<UriRef> getAfterDocItems() {
+            Stack<DocumentationItem> stack = new Stack<DocumentationItem>();
+            stack.add(this);
+            return getAfterDocItems(stack);
+        }
+        
+        private Set<UriRef> getAfterDocItems(Stack<DocumentationItem> stack) {
+            if (!transitiveAfterDocItemsAdded) {
+                Iterator<UriRef> afterDocUrisIter = afterDocItems.iterator();
+                while (afterDocUrisIter.hasNext()) {
+                    UriRef uriRef = afterDocUrisIter.next();
+                    DocumentationItem docItem = uri2docItemObj.get(uriRef);
+                    if (stack.contains(docItem)) {
+                        throw new RuntimeException("Documentation: cycle detected!\n"
+                            + stack.toString());
+                    }
+                    stack.add(docItem);
+                    afterDocItems.addAll(docItem.getAfterDocItems(stack));
+                    
+                }
+                transitiveAfterDocItemsAdded = true;
+            }             
+            return afterDocItems;
+        }
+
+        @Override
+        public String toString() {
+            StringWriter writer = new StringWriter();
+            writer.append("[");
+            writer.append(documentationItem.getUnicodeString());
+            writer.append(" is after (");
+            Iterator<UriRef> afterDocs = afterDocItems.iterator();
+            while (afterDocs.hasNext()) {
+                UriRef uriRef = afterDocs.next();
+                writer.append(uriRef.getUnicodeString());
+                if (afterDocs.hasNext()) {
+                    writer.append(",");
+                }
+            }
+            writer.append(")]");
+            return writer.toString();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation.viewer/src/main/resources/META-INF/documentation.nt
----------------------------------------------------------------------
diff --git a/platform/documentation.viewer/src/main/resources/META-INF/documentation.nt b/platform/documentation.viewer/src/main/resources/META-INF/documentation.nt
new file mode 100644
index 0000000..1a3a6f4
--- /dev/null
+++ b/platform/documentation.viewer/src/main/resources/META-INF/documentation.nt
@@ -0,0 +1,26 @@
+<bundle:///intro-content-el/0> <http://discobits.org/ontology#infoBit> "The documentation viewer provides access to the documentation (provided by the different modules) at <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"/documentation\">/documentation</a>."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/1> <http://discobits.org/ontology#infoBit> "The documentation is ordered so that the after properties http://clerezza.org/2009/08/documentation#after are satisfied. When the documentation is written with the discobits editor such a property is typically set by adding something like the folleowing in the RDF editing mode to the xml element representing the resource: &lt;after xmlns=\"http://clerezza.org/2009/08/documentation#\" rdf:resource=\"bundle://org.apache.clerezza.platform.content/discobits-editor\"/ /&gt;"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:1e27a3b4f21eada7ec61fd7c55f2bd221 . 
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:86e4309edd82a6d415338546caff2d551 . 
+<bundle:///intro-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+<bundle:///intro-title> <http://discobits.org/ontology#infoBit> "Documentation Viewer"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro> <http://clerezza.org/2009/08/documentation#after> <bundle://org.apache.clerezza.platform.content/discobits-editor> .
+<bundle:///intro> <http://clerezza.org/2009/08/documentation#after> <bundle://org.apache.clerezza.platform.documentation/intro> .
+<bundle:///intro> <http://discobits.org/ontology#contains> _:cc06f094ff0d735a332291b856b0d4ae1 . 
+<bundle:///intro> <http://discobits.org/ontology#contains> _:ccd6d577f99d82c53d5323fdbe4b6ba31 . 
+<bundle:///intro> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+_:1e27a3b4f21eada7ec61fd7c55f2bd221 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/0> . 
+_:1e27a3b4f21eada7ec61fd7c55f2bd221 <http://discobits.org/ontology#pos> "0" . 
+_:1e27a3b4f21eada7ec61fd7c55f2bd221 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:86e4309edd82a6d415338546caff2d551 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1> . 
+_:86e4309edd82a6d415338546caff2d551 <http://discobits.org/ontology#pos> "1" . 
+_:86e4309edd82a6d415338546caff2d551 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:cc06f094ff0d735a332291b856b0d4ae1 <http://discobits.org/ontology#holds> <bundle:///intro-content> . 
+_:cc06f094ff0d735a332291b856b0d4ae1 <http://discobits.org/ontology#pos> "1" . 
+_:cc06f094ff0d735a332291b856b0d4ae1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:ccd6d577f99d82c53d5323fdbe4b6ba31 <http://discobits.org/ontology#holds> <bundle:///intro-title> . 
+_:ccd6d577f99d82c53d5323fdbe4b6ba31 <http://discobits.org/ontology#pos> "0" . 
+_:ccd6d577f99d82c53d5323fdbe4b6ba31 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation.viewer/src/test/java/org/apache/clerezza/platform/documentation/viewer/SortTest.java
----------------------------------------------------------------------
diff --git a/platform/documentation.viewer/src/test/java/org/apache/clerezza/platform/documentation/viewer/SortTest.java b/platform/documentation.viewer/src/test/java/org/apache/clerezza/platform/documentation/viewer/SortTest.java
new file mode 100644
index 0000000..a980223
--- /dev/null
+++ b/platform/documentation.viewer/src/test/java/org/apache/clerezza/platform/documentation/viewer/SortTest.java
@@ -0,0 +1,143 @@
+/*
+ * 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.documentation.viewer;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.clerezza.rdf.core.UriRef;
+
+/**
+ *
+ * @author mir
+ */
+public class SortTest {
+
+    @Test
+    public void sortTest() {
+        DocumentationViewer docViewer = new DocumentationViewer();
+
+        Map<UriRef,DocumentationViewer.DocumentationItem> uri2docItemObj =
+            new HashMap<UriRef,DocumentationViewer.DocumentationItem>();
+        UriRef ref1 = new UriRef("ref1");
+        UriRef ref2 = new UriRef("ref2");
+        UriRef ref3 = new UriRef("ref3");
+        UriRef ref4 = new UriRef("ref4");
+        UriRef ref5 = new UriRef("ref5");
+
+        Set<UriRef> set1 = new HashSet<UriRef>();
+        DocumentationViewer.DocumentationItem a =
+            new DocumentationViewer.DocumentationItem(ref1, set1, uri2docItemObj);
+
+        Set<UriRef> set2 = new HashSet<UriRef>();
+        set2.add(ref1);
+        DocumentationViewer.DocumentationItem b =
+            new DocumentationViewer.DocumentationItem(ref2, set2, uri2docItemObj);
+
+        Set<UriRef> set3 = new HashSet<UriRef>();
+        set3.add(ref2);
+        DocumentationViewer.DocumentationItem c =
+            new DocumentationViewer.DocumentationItem(ref3, set3, uri2docItemObj);
+
+        Set<UriRef> set4 = new HashSet<UriRef>();
+        set4.add(ref3);
+        DocumentationViewer.DocumentationItem d =
+            new DocumentationViewer.DocumentationItem(ref4, set4, uri2docItemObj);
+
+        Set<UriRef> set5 = new HashSet<UriRef>();
+        set5.add(ref4);
+        DocumentationViewer.DocumentationItem e =
+            new DocumentationViewer.DocumentationItem(ref5, set5, uri2docItemObj);
+
+        uri2docItemObj.put(ref2, b);
+        uri2docItemObj.put(ref4, d);
+        uri2docItemObj.put(ref1, a);
+        uri2docItemObj.put(ref3, c);
+        uri2docItemObj.put(ref5, e);
+
+        List<DocumentationViewer.DocumentationItem> orderedList = 
+            docViewer.sortDocItems(uri2docItemObj.values());
+
+        Iterator<DocumentationViewer.DocumentationItem> iter =
+            orderedList.iterator();
+
+        Object[] expecteds =
+            new DocumentationViewer.DocumentationItem[5];
+
+        expecteds[0] = a;
+        expecteds[1] = b;
+        expecteds[2] = c;
+        expecteds[3] = d;
+        expecteds[4] = e;
+
+        Assert.assertArrayEquals(expecteds, orderedList.toArray());
+    }
+
+    @Test(expected=RuntimeException.class)
+    public void cycleTest() {
+        DocumentationViewer docViewer = new DocumentationViewer();
+
+        Map<UriRef,DocumentationViewer.DocumentationItem> uri2docItemObj =
+            new HashMap<UriRef,DocumentationViewer.DocumentationItem>();
+        UriRef ref1 = new UriRef("ref1");
+        UriRef ref2 = new UriRef("ref2");
+        UriRef ref3 = new UriRef("ref3");
+        UriRef ref4 = new UriRef("ref4");
+        UriRef ref5 = new UriRef("ref5");
+
+        Set<UriRef> set1 = new HashSet<UriRef>();
+        set1.add(ref5);
+        DocumentationViewer.DocumentationItem a =
+            new DocumentationViewer.DocumentationItem(ref1, set1, uri2docItemObj);
+
+        Set<UriRef> set2 = new HashSet<UriRef>();
+        set2.add(ref1);
+        DocumentationViewer.DocumentationItem b =
+            new DocumentationViewer.DocumentationItem(ref2, set2, uri2docItemObj);
+
+        Set<UriRef> set3 = new HashSet<UriRef>();
+        set3.add(ref2);
+        DocumentationViewer.DocumentationItem c =
+            new DocumentationViewer.DocumentationItem(ref3, set3, uri2docItemObj);
+
+        Set<UriRef> set4 = new HashSet<UriRef>();
+        set4.add(ref3);
+        DocumentationViewer.DocumentationItem d =
+            new DocumentationViewer.DocumentationItem(ref4, set4, uri2docItemObj);
+
+        Set<UriRef> set5 = new HashSet<UriRef>();
+        set5.add(ref4);
+        DocumentationViewer.DocumentationItem e =
+            new DocumentationViewer.DocumentationItem(ref5, set5, uri2docItemObj);
+
+        uri2docItemObj.put(ref2, b);
+        uri2docItemObj.put(ref4, d);
+        uri2docItemObj.put(ref1, a);
+        uri2docItemObj.put(ref3, c);
+        uri2docItemObj.put(ref5, e);
+        
+        List<DocumentationViewer.DocumentationItem> orderedList =
+            docViewer.sortDocItems(uri2docItemObj.values());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/LICENSE
----------------------------------------------------------------------
diff --git a/platform/documentation/LICENSE b/platform/documentation/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/documentation/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/pom.xml
----------------------------------------------------------------------
diff --git a/platform/documentation/pom.xml b/platform/documentation/pom.xml
new file mode 100644
index 0000000..cd4b989
--- /dev/null
+++ b/platform/documentation/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>clerezza</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.documentation</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Documentation</name>
+    <description>Manages the documentation of the Clerezza Platform
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationInContentGraph.java
----------------------------------------------------------------------
diff --git a/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationInContentGraph.java b/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationInContentGraph.java
new file mode 100644
index 0000000..ad0ad8a
--- /dev/null
+++ b/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationInContentGraph.java
@@ -0,0 +1,54 @@
+/*
+ * 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.documentation;
+
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+
+/**
+ * Registers the documentation graph as addition to the content graph
+ * 
+ * @scr.component
+ * 
+ * @author rbn, hasan
+ */
+public class DocumentationInContentGraph {
+
+
+    /**
+     * we have this dependency to make sure we get started after the documentatinProvider
+     *
+     * @scr.reference
+     */
+    private DocumentationProvider documentationProvider;
+
+    /**
+     * @scr.reference
+     */
+    private ContentGraphProvider cgProvider;
+
+    protected void activate(final ComponentContext componentContext) {
+        cgProvider.addTemporaryAdditionGraph(DocumentationProvider.DOCUMENTATION_GRAPH_URI);
+    }
+
+    protected void deactivate(final ComponentContext componentContext) {
+        cgProvider.removeTemporaryAdditionGraph(DocumentationProvider.DOCUMENTATION_GRAPH_URI);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationProvider.java
----------------------------------------------------------------------
diff --git a/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationProvider.java b/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationProvider.java
new file mode 100644
index 0000000..3923a8b
--- /dev/null
+++ b/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/DocumentationProvider.java
@@ -0,0 +1,274 @@
+/*
+ * 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.documentation;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
+import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
+import org.apache.clerezza.rdf.core.impl.SimpleGraph;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.core.serializedform.Parser;
+import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.ontologies.DOCUMENTATION;
+import org.apache.clerezza.rdf.ontologies.OSGI;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+
+/**
+ * The DocumentationProvider gathers the documentations of bundles and provides
+ * a graph containing all documentations.
+ * It is an implementation of <code>WeightedTcProvider</code> with the default
+ * weight 30. 
+ * @author mir, hasan
+ */
+@Component
+@Services({
+    @Service(WeightedTcProvider.class),
+    @Service(DocumentationProvider.class)})
+@Property(name="weight", intValue=30)
+
+public class DocumentationProvider implements WeightedTcProvider, BundleListener {
+
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
+    /**
+     * File path to the file containing the documentation of the bundle
+     */
+    private static final String DOCUMENTATION_FILE = "/META-INF/documentation.nt";
+
+    @Reference
+    private PlatformConfig config;
+    
+    @Reference
+    private Parser parser;
+
+    /**
+     * Contains the map between bundles and their documentation-graph
+     */
+    private Map<Bundle, MGraph> bundle2DocGraphMap = new HashMap<Bundle, MGraph>();
+
+    /**
+     * UnionGraph which contains all documenation-graphs of the registered
+     * bundles
+     */
+    private Graph unitedDocumentations;
+
+    /**
+     * The URI of the graph containing the documentations
+     */
+    public static final UriRef DOCUMENTATION_GRAPH_URI =
+            new UriRef("urn:x-localinstance:/documentation.graph");
+
+    private int weight = 30;    
+
+    @Override
+    public int getWeight() {
+        return weight;
+    }
+
+    @Override
+    public Graph getGraph(UriRef name) throws NoSuchEntityException {
+        if (name.equals(DOCUMENTATION_GRAPH_URI)) {
+            return unitedDocumentations;
+        }
+        throw new NoSuchEntityException(name);
+    }
+
+    @Override
+    public MGraph getMGraph(UriRef name) throws NoSuchEntityException {
+        throw new NoSuchEntityException(name);
+    }
+
+    @Override
+    public TripleCollection getTriples(UriRef name) throws NoSuchEntityException {
+        return getGraph(name);
+    }
+
+    @Override
+    public Set<UriRef> listGraphs() {
+        return Collections.singleton(DOCUMENTATION_GRAPH_URI);
+    }
+
+    @Override
+    public Set<UriRef> listMGraphs() {
+        return new HashSet<UriRef>();
+    }
+
+    @Override
+    public Set<UriRef> listTripleCollections() {
+        return Collections.singleton(DOCUMENTATION_GRAPH_URI);
+    }
+
+    @Override
+    public MGraph createMGraph(UriRef name)
+            throws UnsupportedOperationException, EntityAlreadyExistsException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    @Override
+    public Graph createGraph(UriRef name, TripleCollection triples)
+            throws UnsupportedOperationException, EntityAlreadyExistsException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    @Override
+    public void deleteTripleCollection(UriRef name)
+            throws UnsupportedOperationException, NoSuchEntityException,
+            EntityUndeletableException {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    @Override
+    public Set<UriRef> getNames(Graph graph) {
+        final HashSet<UriRef> result = new HashSet<UriRef>();
+        if (unitedDocumentations.equals(graph)) {
+            result.add(DOCUMENTATION_GRAPH_URI);
+        }
+        return result;
+    }
+
+    @Override
+    public void bundleChanged(BundleEvent event) {
+        Bundle bundle = event.getBundle();
+        switch (event.getType()) {
+            case BundleEvent.STARTED:
+                registerDocumentation(bundle);
+                break;
+            case BundleEvent.STOPPED:
+                unregisterDocumentation(bundle);
+                break;
+        }
+        createUnionGraph();
+    }
+
+    protected void activate(final ComponentContext componentContext) {
+        componentContext.getBundleContext().addBundleListener(this);
+        weight = (Integer) componentContext.getProperties().get("weight");
+        registerExistingDocumentations(componentContext);
+        createUnionGraph();
+    }
+
+    protected void deactivate(final ComponentContext componentContext) {
+        componentContext.getBundleContext().removeBundleListener(this);
+    }    
+
+    private void registerExistingDocumentations(ComponentContext componentContext) {
+        Bundle[] bundles = componentContext.getBundleContext().getBundles();
+        for (Bundle bundle : bundles) {
+            if (bundle.getState() == Bundle.ACTIVE) {
+                registerDocumentation(bundle);
+            }
+        }
+    }
+
+    private void registerDocumentation(Bundle bundle) {
+        URL entry = bundle.getEntry(DOCUMENTATION_FILE);
+        if (entry == null) {
+            return;
+        }
+        MGraph docMGraph = getDocumentationMGraph(entry, bundle.getSymbolicName());
+        addAdditionalTriples(bundle, docMGraph);
+        bundle2DocGraphMap.put(bundle, docMGraph);
+        logger.info("Registered documentation of bundle: {}",
+                bundle.getSymbolicName());
+    }
+
+    private MGraph getDocumentationMGraph(URL docUrl, String symbolicName) {
+        try {
+            Graph parsedGraph = parser.parse(docUrl.openStream(),
+                    SupportedFormat.N_TRIPLE);
+            UriRef baseUri = config.getDefaultBaseUri();
+            return new SimpleMGraph(new UriMutatorIterator(
+                    parsedGraph.iterator(), baseUri.getUnicodeString(), symbolicName));
+        } catch (IOException ex) {
+            logger.warn("Cannot parse documentation at URL: {}", docUrl);
+            throw new RuntimeException(ex);
+        }
+    }
+
+    /**
+     * Adds triples that point from the bundle resource to its documentations.
+     *
+     * @param bundle
+     * @param docMGraph
+     */
+    private void addAdditionalTriples(Bundle bundle, MGraph docMGraph) {
+        UriRef bundleUri = new UriRef(bundle.getLocation());
+        Triple triple = new TripleImpl(bundleUri, RDF.type, OSGI.Bundle);
+        docMGraph.add(triple);
+        Iterator<Triple> titledContents = docMGraph.filter(null, RDF.type,
+                DISCOBITS.TitledContent);
+        Set<Triple> newTriples = new HashSet<Triple>();
+        for (Iterator<Triple> it = titledContents; it.hasNext();) {
+            NonLiteral titledContent = it.next().getSubject();
+            if (docMGraph.filter(null, DISCOBITS.holds, titledContent).hasNext()) {
+                continue;
+            }
+            triple = new TripleImpl(bundleUri, DOCUMENTATION.documentation,
+                    titledContent);
+            newTriples.add(triple);
+        }
+        docMGraph.addAll(newTriples);
+    }
+
+    private void unregisterDocumentation(Bundle bundle) {
+        bundle2DocGraphMap.remove(bundle);
+        logger.info("Unregistered documentation of bundle: {}",
+                bundle.getSymbolicName());
+    }
+
+    private void createUnionGraph() {
+        MGraph[] docGraphs = bundle2DocGraphMap.values().
+                toArray(new MGraph[bundle2DocGraphMap.size()]);
+        if (docGraphs.length > 0) {
+            unitedDocumentations = new SimpleGraph(new UnionMGraph(docGraphs), true);
+        } else {
+            unitedDocumentations = new SimpleGraph(new SimpleMGraph(), true);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/UriMutatorIterator.java
----------------------------------------------------------------------
diff --git a/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/UriMutatorIterator.java b/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/UriMutatorIterator.java
new file mode 100644
index 0000000..c728a76
--- /dev/null
+++ b/platform/documentation/src/main/java/org/apache/clerezza/platform/documentation/UriMutatorIterator.java
@@ -0,0 +1,176 @@
+/*
+ * 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.documentation;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.core.impl.TypedLiteralImpl;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * Replaces the <code>BASE_URI_PLACEHOLDER</code> in the <code>UriRef</code>s 
+ * as well as in the XML Literal of the <code>Triple</code>s provided by the
+ * specified <code>Iterator</code>s with the specified base URI.
+ *
+ * @author mir, hasan
+ */
+public class UriMutatorIterator implements Iterator<Triple> {
+
+    public static final Logger logger = LoggerFactory.getLogger(UriMutatorIterator.class);
+
+    private DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+
+    public static final UriRef XML_LITERAL =
+            new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
+
+    public static final String BASE_URI_PLACEHOLDER = "bundle://";
+    private Iterator<Triple> wrapped;
+    private String baseUri;
+    /*
+     * The symbolic name of the bundle from which the documentation origins.
+     */
+    private String originBundleSymbName;
+
+    UriMutatorIterator(Iterator<Triple> wrapped, String baseUri,
+            String bundleSymbolicName) {
+        this.wrapped = wrapped;
+        this.baseUri = baseUri;
+        this.originBundleSymbName = bundleSymbolicName;
+    }
+
+    @Override
+    public boolean hasNext() {
+        return wrapped.hasNext();
+    }
+
+    @Override
+    public Triple next() {
+        Triple triple = wrapped.next();
+
+        NonLiteral subject = triple.getSubject();
+        if (subject instanceof UriRef) {
+            subject = replacePlaceHolder((UriRef) subject);
+        }
+        UriRef predicate = replacePlaceHolder(triple.getPredicate());
+
+        Resource object = triple.getObject();
+        if (object instanceof UriRef) {
+            object = replacePlaceHolder((UriRef) object);
+        } else if (object instanceof TypedLiteral) {
+            TypedLiteral literal = (TypedLiteral) object;
+            if (literal.getDataType().equals(XML_LITERAL)) {
+                object = replacePlaceHolderInUrl(literal);
+            }
+        }
+        return new TripleImpl(subject, predicate, object);
+    }
+
+    @Override
+    public void remove() {
+        throw new UnsupportedOperationException("Not supported.");
+    }
+
+    private UriRef replacePlaceHolder(UriRef uriRef) {
+        String orig = uriRef.getUnicodeString();
+        if (orig.startsWith(BASE_URI_PLACEHOLDER)) {
+            int nextSlash = orig.indexOf("/", BASE_URI_PLACEHOLDER.length());
+            String bundleSymbolicName;
+            if (nextSlash != BASE_URI_PLACEHOLDER.length()) {
+                bundleSymbolicName = orig.subSequence(
+                        BASE_URI_PLACEHOLDER.length(), nextSlash).toString();
+            } else {
+                bundleSymbolicName = originBundleSymbName;
+            }
+            return new UriRef(baseUri + "bundle-doc/" + bundleSymbolicName +
+                    orig.substring(nextSlash));
+        }
+        return uriRef;
+    }
+
+    private TypedLiteral replacePlaceHolderInUrl(TypedLiteral xmlLiteral) {
+        final String tagName = "infoBit";
+        final String openingTag = "<" + tagName + ">";
+        final String closingTag = "</" + tagName + ">";
+        String text = openingTag + xmlLiteral.getLexicalForm() + closingTag;
+
+        InputStream styleSheet = getClass().getResourceAsStream("baseUriTransformation.xsl");
+        TransformerFactory transformerFactory = TransformerFactory.newInstance();
+        StreamSource styleSource = new StreamSource(styleSheet);
+        try {
+            Transformer transformer = transformerFactory.newTransformer(styleSource);
+
+            DocumentBuilder builder = factory.newDocumentBuilder();
+            Document document = builder.parse(new ByteArrayInputStream(text.getBytes("UTF-8")));
+            Source source = new DOMSource(document);
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream(text.length());
+            Result result = new StreamResult(baos);
+
+            transformer.setParameter("baseUri", baseUri);
+            transformer.setParameter("originBundleSymbolicName", originBundleSymbName);
+            transformer.transform(source, result);
+
+            String resultedText = baos.toString("UTF-8");
+            int startIdx = resultedText.indexOf(openingTag) + openingTag.length();
+            int endIdx = resultedText.lastIndexOf(closingTag);
+            return new TypedLiteralImpl(resultedText.substring(startIdx, endIdx),
+                    XML_LITERAL);
+        } catch (SAXException se) {
+            logger.warn("SAXException {} while transforming xml literal: {}",
+                    se.getMessage(), text);
+        } catch (ParserConfigurationException pce) {
+            logger.warn("ParserConfigurationException {} while transforming xml literal: {}",
+                    pce.getMessage(), text);
+        } catch (TransformerException te) {
+            logger.warn("TransformerException {} while transforming xml literal: {}",
+                    te.getMessage(), text);
+        } catch (UnsupportedEncodingException uee) {
+            logger.warn("UnsupportedEncodingException {} while transforming xml literal: {}",
+                    uee.getMessage(), text);
+        } catch (IOException ioe) {
+            logger.warn("IOException {} while transforming xml literal: {}",
+                    ioe.getMessage(), text);
+        }
+        return xmlLiteral;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/src/main/resources/META-INF/documentation.nt
----------------------------------------------------------------------
diff --git a/platform/documentation/src/main/resources/META-INF/documentation.nt b/platform/documentation/src/main/resources/META-INF/documentation.nt
new file mode 100644
index 0000000..3f473b5
--- /dev/null
+++ b/platform/documentation/src/main/resources/META-INF/documentation.nt
@@ -0,0 +1,47 @@
+<bundle:///intro-content-el/0> <http://discobits.org/ontology#infoBit> "Any bundle may provide some user documentation. This documentation is provided by a file named \"documentation.nt\" in the META-INF directory of the bundle-jar. This file can provide multiple documentation resources described using the discobits ontology. The resources have UriRefs starting with \"bundle:///\", this will be replaced with http://&lt;hostname&gt;/bundle-doc/&lt;Bundle-SymbolicName&gt; by the documentation aggregator which provides the graph urn:x-localinstance:/documentation.graph containing the documentation of all installed bundles. To reference a documentation entry from another bundle the bundle-uri can contain a Borundle-SymbolicName after the second slash, e.g. bundle://org.apache.clerezza.platform.content/intro."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/1> <http://discobits.org/ontology#infoBit> "By convention any bundle documentation provides a resource named bundle:///intro introducing the functionality of the bundle."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/2-content-el/0> <http://discobits.org/ontology#infoBit> "The recommended way to create and edit the documentation of a bundle is as follows:<ul xmlns=\"http://www.w3.org/1999/xhtml\"><li>Launch clerezza (in the following we assume its running on localhost:8080)</li><li>Install and start the stable n-triples serialization provider (to make the stored files more suitable for version control) by entering on the commmand line: <code>start(\"mvn:org.apache.clerezza/rdf.stable.serializer\")</code></li>\n<li>Install and start the file storage provider(to access local rdf files as named graphs)  by entering on the commmand line: <code>start(\"mvn:org.apache.clerezza/rdf.file.storage\")</code><code></code></li><li>If it doesn't exist yet create an empty file src/main/resources/META-INF/documentation.nt in the project to be documented and </li><li>Open http://localhost:8080/tools/editor/, enter the file-uri of the previously created file as Graph and a bundle-uri (
 such as bundle:///intro) as resource</li><li>edit, save, ship your bundle</li></ul>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/2-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/2-content> <http://discobits.org/ontology#contains> _:dca98a68e3413be1e9bb3f4e56f5cc561 . 
+<bundle:///intro-content-el/2-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+<bundle:///intro-content-el/2-title> <http://discobits.org/ontology#infoBit> "Writing Documentation"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/2-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/2> <http://discobits.org/ontology#contains> _:005cab2e8f532d75dbe6021467d5f7191 . 
+<bundle:///intro-content-el/2> <http://discobits.org/ontology#contains> _:3682407f1c90d02dcf9dbf4e83d964f51 . 
+<bundle:///intro-content-el/2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:0c33aa960ad81e72549c579dd55074231 . 
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:16fd3882eda078006a6b02abb28816da1 . 
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:da78c47eff7d6e6f75a17d01572cb4d81 . 
+<bundle:///intro-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+<bundle:///intro-title> <http://discobits.org/ontology#infoBit> "Platform Documentation Aggregator"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro> <bundle:///nullafter> <bundle://org.apache.clerezza.platform.content/discobits-editor> .
+<bundle:///intro> <http://discobits.org/ontology#contains> _:2d0db51a9a2a40d89460edf6544edbad1 . 
+<bundle:///intro> <http://discobits.org/ontology#contains> _:566a75916142ac411441d067f09a49f71 . 
+<bundle:///intro> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+_:005cab2e8f532d75dbe6021467d5f7191 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/2-content> . 
+_:005cab2e8f532d75dbe6021467d5f7191 <http://discobits.org/ontology#pos> "1" . 
+_:005cab2e8f532d75dbe6021467d5f7191 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:0c33aa960ad81e72549c579dd55074231 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/2> . 
+_:0c33aa960ad81e72549c579dd55074231 <http://discobits.org/ontology#pos> "2" . 
+_:0c33aa960ad81e72549c579dd55074231 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:16fd3882eda078006a6b02abb28816da1 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/0> . 
+_:16fd3882eda078006a6b02abb28816da1 <http://discobits.org/ontology#pos> "0" . 
+_:16fd3882eda078006a6b02abb28816da1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:2d0db51a9a2a40d89460edf6544edbad1 <http://discobits.org/ontology#holds> <bundle:///intro-title> . 
+_:2d0db51a9a2a40d89460edf6544edbad1 <http://discobits.org/ontology#pos> "0" . 
+_:2d0db51a9a2a40d89460edf6544edbad1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:3682407f1c90d02dcf9dbf4e83d964f51 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/2-title> . 
+_:3682407f1c90d02dcf9dbf4e83d964f51 <http://discobits.org/ontology#pos> "0" . 
+_:3682407f1c90d02dcf9dbf4e83d964f51 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:566a75916142ac411441d067f09a49f71 <http://discobits.org/ontology#holds> <bundle:///intro-content> . 
+_:566a75916142ac411441d067f09a49f71 <http://discobits.org/ontology#pos> "1" . 
+_:566a75916142ac411441d067f09a49f71 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:da78c47eff7d6e6f75a17d01572cb4d81 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1> . 
+_:da78c47eff7d6e6f75a17d01572cb4d81 <http://discobits.org/ontology#pos> "1" . 
+_:da78c47eff7d6e6f75a17d01572cb4d81 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:dca98a68e3413be1e9bb3f4e56f5cc561 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/2-content-el/0> . 
+_:dca98a68e3413be1e9bb3f4e56f5cc561 <http://discobits.org/ontology#pos> "0" . 
+_:dca98a68e3413be1e9bb3f4e56f5cc561 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/src/main/resources/org/apache/clerezza/platform/documentation/baseUriTransformation.xsl
----------------------------------------------------------------------
diff --git a/platform/documentation/src/main/resources/org/apache/clerezza/platform/documentation/baseUriTransformation.xsl b/platform/documentation/src/main/resources/org/apache/clerezza/platform/documentation/baseUriTransformation.xsl
new file mode 100644
index 0000000..9767343
--- /dev/null
+++ b/platform/documentation/src/main/resources/org/apache/clerezza/platform/documentation/baseUriTransformation.xsl
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+	<xsl:param name="baseUri"/>
+	<xsl:param name="originBundleSymbolicName"/>
+	<xsl:template match="@*|node()">
+		<xsl:copy>
+			<xsl:apply-templates select="@*|node()"/>
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="@href[parent::a]">
+		<xsl:attribute name="href">
+			<xsl:choose>
+				<xsl:when test="starts-with(.,'bundle:///')">
+					<xsl:value-of select="concat($baseUri,'bundle-doc/',$originBundleSymbolicName,substring-after(.,'bundle://'))"/>
+				</xsl:when>
+				<xsl:when test="starts-with(.,'bundle://')">
+					<xsl:value-of select="concat($baseUri,'bundle-doc/',substring-after(.,'bundle://'))"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="."/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:attribute>
+	</xsl:template>
+</xsl:stylesheet>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation/src/test/java/org/apache/clerezza/platform/documentation/UriMutatorIteratorTest.java
----------------------------------------------------------------------
diff --git a/platform/documentation/src/test/java/org/apache/clerezza/platform/documentation/UriMutatorIteratorTest.java b/platform/documentation/src/test/java/org/apache/clerezza/platform/documentation/UriMutatorIteratorTest.java
new file mode 100644
index 0000000..652dd1c
--- /dev/null
+++ b/platform/documentation/src/test/java/org/apache/clerezza/platform/documentation/UriMutatorIteratorTest.java
@@ -0,0 +1,113 @@
+/*
+ * 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.documentation;
+
+import java.util.Iterator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.core.impl.TypedLiteralImpl;
+
+/**
+ *
+ * @author mir
+ */
+public class UriMutatorIteratorTest {
+
+    private static final String HOST = "http://localhost:8282/";
+
+    private static String ORIGIN_BUNDLE_NAME = "my.symbolic.name";
+
+    private static String REFERENCED_BUNDLE_NAME = "your.symbolic.name";
+
+    @Test
+    public void testMutator() {
+        MGraph mGraph = new SimpleMGraph();
+        UriRef uriRef = new UriRef(UriMutatorIterator.BASE_URI_PLACEHOLDER +
+                REFERENCED_BUNDLE_NAME + "/bla#Test");
+        UriRef expectedUriRef = new UriRef(HOST + 
+                "bundle-doc/"+ REFERENCED_BUNDLE_NAME +"/bla#Test");
+        mGraph.add(new TripleImpl(uriRef, uriRef, uriRef));
+        Iterator<Triple> it = new UriMutatorIterator(mGraph.iterator(), HOST,
+                ORIGIN_BUNDLE_NAME);
+        Triple expectedTriple = new TripleImpl(expectedUriRef, expectedUriRef,
+                expectedUriRef);
+        Assert.assertEquals(expectedTriple, it.next());        
+    }
+
+    @Test
+    public void testMutatorNoSymbolicName() {
+        MGraph mGraph = new SimpleMGraph();
+        UriRef uriRef = new UriRef(UriMutatorIterator.BASE_URI_PLACEHOLDER +
+                "/bla#Test");
+        UriRef expectedUriRef = new UriRef(HOST +
+                "bundle-doc/"+ ORIGIN_BUNDLE_NAME +"/bla#Test");
+        mGraph.add(new TripleImpl(uriRef, uriRef, uriRef));
+        Iterator<Triple> it = new UriMutatorIterator(mGraph.iterator(), HOST,
+                ORIGIN_BUNDLE_NAME);
+        Triple expectedTriple = new TripleImpl(expectedUriRef, expectedUriRef,
+                expectedUriRef);
+        Assert.assertEquals(expectedTriple, it.next());
+    }
+
+    @Test
+    public void baseUriTransformation() {
+        MGraph mGraph = new SimpleMGraph();
+        String xml = "<a href=\"" + UriMutatorIterator.BASE_URI_PLACEHOLDER +
+            REFERENCED_BUNDLE_NAME + "/bla\"/>";
+        Literal literal = new TypedLiteralImpl(xml,
+                    UriMutatorIterator.XML_LITERAL);
+        String expectedXml = "<a href=\"" + HOST + 
+            "bundle-doc/"+ REFERENCED_BUNDLE_NAME +"/bla\"/>";
+        Literal expectedLiteral = new TypedLiteralImpl(expectedXml,
+                    UriMutatorIterator.XML_LITERAL);
+        UriRef uriRef = new UriRef("bla");
+            mGraph.add(new TripleImpl(uriRef, uriRef, literal));
+        Iterator<Triple> it = new UriMutatorIterator(mGraph.iterator(), HOST,
+                ORIGIN_BUNDLE_NAME);
+        Triple expectedTriple = new TripleImpl(uriRef, uriRef,
+                expectedLiteral);
+        Assert.assertEquals(expectedTriple, it.next());
+    }
+
+    @Test
+    public void baseUriTransformationNoSymbolicName() {
+        MGraph mGraph = new SimpleMGraph();
+        String xml = "<a href=\"" + UriMutatorIterator.BASE_URI_PLACEHOLDER +
+            "/bla\"/>";
+        Literal literal = new TypedLiteralImpl(xml,
+                    UriMutatorIterator.XML_LITERAL);
+        String expectedXml = "<a href=\"" + HOST +
+            "bundle-doc/"+ ORIGIN_BUNDLE_NAME +"/bla\"/>";
+        Literal expectedLiteral = new TypedLiteralImpl(expectedXml,
+                    UriMutatorIterator.XML_LITERAL);
+        UriRef uriRef = new UriRef("bla");
+            mGraph.add(new TripleImpl(uriRef, uriRef, literal));
+        Iterator<Triple> it = new UriMutatorIterator(mGraph.iterator(), HOST,
+                ORIGIN_BUNDLE_NAME);
+        Triple expectedTriple = new TripleImpl(uriRef, uriRef,
+                expectedLiteral);
+        Assert.assertEquals(expectedTriple, it.next());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/LICENSE
----------------------------------------------------------------------
diff --git a/platform/editor/LICENSE b/platform/editor/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/editor/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/nbactions.xml
----------------------------------------------------------------------
diff --git a/platform/editor/nbactions.xml b/platform/editor/nbactions.xml
new file mode 100644
index 0000000..9690e1a
--- /dev/null
+++ b/platform/editor/nbactions.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+  <action>
+    <actionName>CUSTOM-deploy to localhost:8080</actionName>
+    <displayName>deploy to localhost:8080</displayName>
+    <goals>
+      <goal>install</goal>
+      <goal>org.apache.sling:maven-sling-plugin:install</goal>
+    </goals>
+  </action>
+</actions>


[41/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java b/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
new file mode 100644
index 0000000..c58865c
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
@@ -0,0 +1,378 @@
+/*
+ * 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.representations.core;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.locks.Lock;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.RedirectUtil;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.ontologies.EXIF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This JAX-RS resource provides a method to retrieve the uri to
+ * the thumbnail or a other small representation of a InfoDiscoBit.
+ *
+ * @author mir
+ */
+@Component
+@Services({
+    @Service(Object.class),
+    @Service(ThumbnailService.class)
+})
+
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("thumbnail-service")
+public class ThumbnailService implements BundleListener {
+
+    @Reference
+    ContentGraphProvider cgProvider;
+    @Reference
+    PlatformConfig config;
+    @Reference
+    AlternativeRepresentationGenerator altRepGen;
+    private static final Logger log = LoggerFactory.getLogger(ThumbnailService.class);
+    private BundleContext bundleContext;
+    private String STATICWEB_PATH = "/CLEREZZA-INF/web-resources/style/";
+    private String MEDIA_TYPE_BASE_PATH = STATICWEB_PATH + "images/icons/mediatype/";
+    private Bundle cachedStyleBundle = null;
+    private Map<MediaType, String> mediaTypeIconUriCache =
+            Collections.synchronizedMap(new HashMap<MediaType, String>());
+
+    protected void activate(ComponentContext context) {
+        bundleContext = context.getBundleContext();
+        bundleContext.addBundleListener(this);
+    }
+
+    protected void deactivate(ComponentContext context) {
+        bundleContext.removeBundleListener(this);
+        bundleContext = null;
+        mediaTypeIconUriCache.clear();
+    }
+
+    /**
+     * Returns the thumbnail uri for a InfoDiscoBit which is located at the uri
+     * specified over the query parameter "uri". The thumbnails
+     * maximum width and height can optionally be specified over the query parameters
+     * "width" and "height". Futhermore there is the optional "exact" parameter,
+     * which specifies if the thumbnail must have the exact width and height as
+     * specified or not (default is "false"). If more than one acceptable thumbnail
+     * is available then the thumbnail uri of the thumbnail with the highest resolution
+     * (width * height) is returned. If no thumbnail is available and the logged
+     * in user has the write permission for the content graph, then an attempt is
+     * made to create the thumbnail on the fly. If this fails or the write permission
+     * is missing, then the uri of the icon representing the media type is returned.
+     * If also no media type icon is available the uri to default icon is returned.
+     *
+     * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail uri should
+     *        be returned
+     * @param height the maximum height that the thumbnail has
+     * @param width the maximum width that the thumbnail has
+     * @param exact boolean that specifies if the return thumbnail should have
+     *        the exact width and height.
+     * @return
+     */
+    @GET
+    public Response getThumbnailUri(@QueryParam("uri") UriRef infoBitUri,
+            @QueryParam("width") Integer width, @QueryParam("height") Integer height,
+            @DefaultValue("false") @QueryParam("exact") Boolean exact, @Context UriInfo uriInfo) {
+        return RedirectUtil.createSeeOtherResponse(
+                getThumbnailUri(infoBitUri, width, height, exact).getUnicodeString(), uriInfo);
+    }
+
+
+    /**
+     * Returns the thumbnail uri for a InfoDiscoBit which is located at the uri
+     * specified over the query parameter "uri". The thumbnails
+     * maximum width and height can optionally be specified over the query parameters
+     * "width" and "height". If more than one acceptable thumbnail is available
+     * then the thumbnail uri of the thumbnail with the highest resolution
+     * (width * height) is returned. If no thumbnail is available and the logged
+     * in user has the write permission for the content graph, then an attempt is
+     * made to create the thumbnail on the fly. If this fails or the write permission
+     * is missing, then the uri of the icon representing the media type is returned.
+     * If also no media type icon is available the uri to default icon is returned.
+     *
+     * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail uri should
+     *        be returned
+     * @param height the maximum height that the thumbnail has
+     * @param width the maximum width that the thumbnail has
+     * @return
+     */
+    public UriRef getThumbnailUri(UriRef infoBitUri, Integer width,  Integer height) {
+        return getThumbnailUri(infoBitUri, width, height, false);
+    }
+
+    /**
+     * Returns the thumbnail uri for a InfoDiscoBit which is located at the uri
+     * specified over the query parameter "uri". The thumbnails
+     * maximum width and height can optionally be specified over the query parameters
+     * "width" and "height". Futhermore there is the optional "exact" parameter,
+     * which specifies if the thumbnail must have the exact width and height as
+     * specified or not. If more than one acceptable thumbnail is available then
+     * the thumbnail uri of the thumbnail with the highest resolution (width * height)
+     * is returned. If no thumbnail is available and the logged in user has the write
+     * permission for the content graph, then an attempt is made to create the
+     * thumbnail on the fly. If this fails or the write permission is missing, then
+     * the uri of the icon representing the media type is returned. If also no
+     * media type icon is available the uri to default icon is returned.
+     *
+     * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail uri should
+     *        be returned
+     * @param height the maximum height that the thumbnail has
+     * @param width the maximum width that the thumbnail has
+     * @param exact boolean that specifies if the return thumbnail should have
+     *        the exact width and height.
+     * @return
+     */
+    public UriRef getThumbnailUri(UriRef infoBitUri, Integer width,  Integer height,
+            boolean exact) {
+        if ((width == null) && (height == null)) {
+            throw new IllegalArgumentException("height and/or width must be specified");
+        }
+        if (width == null) {
+            width = Integer.MAX_VALUE;
+        }
+        if (height == null) {
+            height = Integer.MAX_VALUE;
+        }
+        GraphNode infoBitNode = new GraphNode(infoBitUri, cgProvider.getContentGraph());
+        UriRef thumbnailUri = getGeneratedThumbnailUri(infoBitNode, width, height, exact);
+        if (thumbnailUri == null) {
+            Literal mediaTypeLiteral = null;
+            Lock readLock = infoBitNode.readLock();
+            readLock.lock();
+            try {
+                Iterator<Resource> mediaTypes = infoBitNode.getObjects(DISCOBITS.mediaType);
+                if (mediaTypes.hasNext()) {
+                    mediaTypeLiteral = (Literal) mediaTypes.next();
+                }
+            } finally {
+                readLock.unlock();
+            }
+            if (mediaTypeLiteral != null) {
+                MediaType mediaType = MediaType.valueOf(mediaTypeLiteral.getLexicalForm());
+                // if the infoBit is an image, create a thumbnail on the fly.
+                if (mediaType.getType().startsWith("image")) {
+                    try {
+                        thumbnailUri = altRepGen.generateAlternativeImage(infoBitNode, width,
+                                height, exact);
+                    } catch (Exception ex) {
+                        ex.printStackTrace();
+                        // Was worth a try. eLets go on
+                    }
+                }
+                if (thumbnailUri == null) {
+                    String iconUri = mediaTypeIconUriCache.get(mediaType);
+                    if (iconUri == null) {
+                        iconUri = getMediaTypeIconUri(mediaType);
+                        mediaTypeIconUriCache.put(mediaType, iconUri);
+                    }
+                    thumbnailUri = new UriRef(iconUri);
+                }
+            }
+        }
+        if (thumbnailUri == null) {
+            thumbnailUri = new UriRef(getDefaultIconUrl(getStyleBundle()));
+        }
+        return thumbnailUri;
+    }
+
+    private String getMediaTypeIconUri(MediaType mediaType) {
+        Bundle styleBundle = getStyleBundle();
+        if (styleBundle == null) {
+            throw new RuntimeException("no style bundle found");
+        }
+        String path = MEDIA_TYPE_BASE_PATH + mediaType.getType() + "/";
+        Enumeration entries = styleBundle.findEntries(path,
+                mediaType.getSubtype() + ".*", false);
+        String iconUri = createIconUri(entries);
+        if (iconUri != null) {
+            return iconUri;
+        }
+        entries = styleBundle.findEntries(path, "any.*", false);
+        iconUri = createIconUri(entries);
+        if (iconUri != null) {
+            return iconUri;
+        }
+        return getDefaultIconUrl(styleBundle);
+    }
+
+    private String getDefaultIconUrl(Bundle bundle) {
+        Enumeration entries = bundle.findEntries(MEDIA_TYPE_BASE_PATH, "any.*", false);
+        String iconUri = createIconUri(entries);
+        if (iconUri != null) {
+            return iconUri;
+        } else {
+            throw new RuntimeException("No default icon found");
+        }
+    }
+
+    private String createIconUri(Enumeration entries) {
+        if (entries != null && entries.hasMoreElements()) {
+            URL iconUrl = (URL) entries.nextElement();
+            return iconUrl.getPath().replace(STATICWEB_PATH, "style/");
+        }
+        return null;
+    }
+
+    private UriRef getGeneratedThumbnailUri(GraphNode infoBitNode,
+            Integer width, Integer height, boolean exact) {
+        if (isFittingImage(infoBitNode, width, height, exact)) {
+            return (UriRef) infoBitNode.getNode();
+        }
+        UriRef resultThumbnailUri = null;
+        int pixels = 0;
+        Lock readLock = infoBitNode.readLock();
+        readLock.lock();
+        try {
+            Iterator<Resource> thumbnails = infoBitNode.getObjects(DISCOBITS.thumbnail);
+            while (thumbnails.hasNext()) {
+                UriRef thumbnailUri = (UriRef) thumbnails.next();
+                GraphNode thumbnailNode = new GraphNode(thumbnailUri,
+                        cgProvider.getContentGraph());
+                int thumbnailPixels = getSurfaceSizeIfFitting(thumbnailNode, width, height, exact);
+                if (thumbnailPixels > pixels) {
+                    if (exact) {
+                        return thumbnailUri;
+                    }
+                    resultThumbnailUri = thumbnailUri;
+                    pixels = thumbnailPixels;
+                }
+            }
+        } finally {
+            readLock.unlock();
+        }
+        return resultThumbnailUri;
+    }
+
+    /**
+     * returns the surface in pixel if the image fits withing width and height,
+     * or -1 if it doesn't fit
+     */
+    private int getSurfaceSizeIfFitting(GraphNode infoBitNode, Integer width, Integer height,
+            boolean exact) {
+        Resource imageRes = infoBitNode.getNode();
+        if (imageRes instanceof UriRef) {
+            String imageUri = ((UriRef)imageRes).getUnicodeString();
+            if (!exact && imageUri.contains(AlternativeRepresentationGenerator.EXACT_APPENDIX)) {
+                return -1;
+            }
+        }        
+        Iterator<Resource> exifWidths = infoBitNode.getObjects(EXIF.width);
+        Iterator<Resource> exifHeights = infoBitNode.getObjects(EXIF.height);
+        if (!exifWidths.hasNext() || !exifHeights.hasNext()) {
+            log.warn(infoBitNode.getNode() + " doesn't have exif:width and exif:height");
+            return -1;
+        }
+        int thumbnailWidth = LiteralFactory.getInstance().createObject(
+                Integer.class, (TypedLiteral) exifWidths.next());
+        int thumbnailHeight = LiteralFactory.getInstance().createObject(
+                Integer.class, (TypedLiteral) exifHeights.next());
+        if (exact) {
+            if (thumbnailHeight == height && thumbnailWidth == width) {
+                return 1;
+            }
+        } else {
+            if (thumbnailHeight <= height && thumbnailWidth <= width) {
+                return thumbnailWidth * thumbnailHeight;
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * returns true if infoBitNode is an image and fits
+     */
+    private boolean isFittingImage(GraphNode infoBitNode, Integer width, Integer height,
+            boolean exact) {
+        Lock readLock = infoBitNode.readLock();
+        readLock.lock();
+        try {
+            final Iterator<Literal> mediaTypesIter = infoBitNode.getLiterals(DISCOBITS.mediaType);
+            if (!mediaTypesIter.hasNext()) {
+                return false;
+            }
+            if (mediaTypesIter.next().getLexicalForm().startsWith("image")) {
+                return getSurfaceSizeIfFitting(infoBitNode, width, height, exact) > -1;
+            } else {
+                return false;
+            }
+        } finally {
+            readLock.unlock();
+        }
+    }
+
+    private synchronized Bundle getStyleBundle() {
+        if (cachedStyleBundle != null) {
+            return cachedStyleBundle;
+        }
+        Bundle[] bundles = bundleContext.getBundles();
+        for (Bundle bundle : bundles) {
+            URL staticWebPathURL = bundle.getEntry(STATICWEB_PATH);
+            if (staticWebPathURL != null) {
+                cachedStyleBundle = bundle;
+                return bundle;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public synchronized void bundleChanged(BundleEvent be) {
+        if (be.getType() == BundleEvent.UNINSTALLED
+                && be.getBundle().equals(cachedStyleBundle)) {
+            cachedStyleBundle = null;
+            cachedStyleBundle = getStyleBundle();
+            mediaTypeIconUriCache.clear();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.ontologies/LICENSE b/platform/content.representations/platform.content.representations.ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.ontologies/pom.xml b/platform/content.representations/platform.content.representations.ontologies/pom.xml
new file mode 100644
index 0000000..41cfd94
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.ontologies/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.content.representations</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content.representations.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Content Representations Ontologies</name>
+    <description>
+        Representations Ontologies
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf
----------------------------------------------------------------------
diff --git a/platform/content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf b/platform/content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf
new file mode 100644
index 0000000..01e604d
--- /dev/null
+++ b/platform/content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+
+<rdf:RDF
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:skos="http://www.w3.org/2008/05/skos#"
+>
+
+<!-- Ontology -->
+
+<owl:Ontology rdf:about="http://clerezza.org/2009/12/representations#">
+	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
+	<dc:title xml:lang="en">
+		Clerezza Content Representations
+	</dc:title>
+</owl:Ontology>
+
+
+<!-- Properties -->
+
+<rdf:Property rdf:about="http://clerezza.org/2009/12/representations#isIconFor">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	<rdfs:label xml:lang="en">is icon for</rdfs:label>
+	<skos:definition xml:lang="en">Points to a string specifying the resource type for which the subject is an icon.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/12/representations#" />
+	<rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Image" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
+</rdf:Property>
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.representations/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content.representations/pom.xml b/platform/content.representations/pom.xml
new file mode 100644
index 0000000..0327c26
--- /dev/null
+++ b/platform/content.representations/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content.representations</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Content Representations</name>
+    <description>Provides services for creating and retrieving alternative representations of content.</description>
+    
+    <modules>
+        <module>platform.content.representations.ontologies</module>
+        <module>platform.content.representations.core</module>
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content/LICENSE b/platform/content/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content/pom.xml b/platform/content/pom.xml
new file mode 100644
index 0000000..0cb5e24
--- /dev/null
+++ b/platform/content/pom.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Clerezza - Platform Content</name>
+    <description>Clerezza CMS - A handler to manage and access data modeled using
+    the discobits ontology</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+             <artifactId>org.osgi.core</artifactId>
+         </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+             <artifactId>org.osgi.compendium</artifactId>
+         </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typehandlerspace</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphnodeprovider</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.seedsnipe</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javax.servlet</artifactId>
+                    <groupId>org.apache.felix</groupId>
+                </exclusion>
+            </exclusions>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wymiwyg</groupId>
+            <artifactId>wymiwyg-commons-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+    <!--    <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security</artifactId>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.metadata</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core.test</artifactId>
+            <scope>test</scope>
+            <version>0.15</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>slf4j-scala-api</artifactId>
+            <version>1.6.3</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>net.sf.alchim</groupId>
+                <artifactId>yuicompressor-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java
new file mode 100644
index 0000000..e605c40
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java
@@ -0,0 +1,151 @@
+/*
+ * 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;
+
+import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.platform.content.collections.CollectionCreator;
+
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author reto
+ */
+public abstract class AbstractDiscobitsHandler implements DiscobitsHandler {
+
+    private static final Logger logger = LoggerFactory.getLogger(AbstractDiscobitsHandler.class);
+
+    /**
+     *
+     * @return the MGraph to be used to retrieve and create discobits
+     */
+    protected abstract MGraph getMGraph();
+
+    /**
+     * A <code>Set</code> containing <code>MetaDataGenerator</code>s to be used
+     * to add meta data to data putted by the handler.
+     *
+     * @return a Set containing meta data generators
+     */
+    protected abstract Set<MetaDataGenerator> getMetaDataGenerators();
+
+    
+    @Override
+    public void put(UriRef infoDiscoBitUri, MediaType mediaType,
+            byte[] data) {
+
+        GraphNode infoDiscoBitNode;
+        final LockableMGraph mGraph = (LockableMGraph) getMGraph();
+        infoDiscoBitNode = new GraphNode(infoDiscoBitUri, mGraph);
+        CollectionCreator collectionCreator = new CollectionCreator(mGraph);
+        collectionCreator.createContainingCollections(infoDiscoBitUri);
+        Lock writeLock = mGraph.getLock().writeLock();
+        writeLock.lock();
+        try {
+            infoDiscoBitNode.addProperty(RDF.type, DISCOBITS.InfoDiscoBit);
+            TypedLiteral dataLiteral = LiteralFactory.getInstance().createTypedLiteral(data);
+            infoDiscoBitNode.deleteProperties(DISCOBITS.infoBit);
+            infoDiscoBitNode.addProperty(DISCOBITS.infoBit, dataLiteral);
+            TypedLiteral mediaTypeLiteral = LiteralFactory.getInstance().createTypedLiteral(mediaType.toString());
+            infoDiscoBitNode.deleteProperties(DISCOBITS.mediaType);
+            infoDiscoBitNode.addProperty(DISCOBITS.mediaType,mediaTypeLiteral);
+        } finally {
+            writeLock.unlock();
+        }
+        Set<MetaDataGenerator> metaDataGenerators = getMetaDataGenerators();
+        synchronized(metaDataGenerators) {
+            for(MetaDataGenerator generator : metaDataGenerators) {
+                try {
+                    generator.generate(infoDiscoBitNode, data, mediaType);
+                } catch (RuntimeException ex) {
+                    logger.error("Exception in MetaDataGenerator ", ex);
+                }
+            }
+        }
+    }
+
+    @Override
+    public  void remove(NonLiteral node) {
+        MGraph mGraph = getMGraph();        
+        Iterator<Triple> properties = mGraph.filter(node, null, null);
+        //copying properties to set, as we're modifying underlying graph
+        Set<Triple> propertiesSet = new HashSet<Triple>();
+        while (properties.hasNext()) {
+            propertiesSet.add(properties.next());
+        }
+        properties = propertiesSet.iterator();
+        while (properties.hasNext()) {
+            Triple triple = properties.next();
+            UriRef predicate = triple.getPredicate();
+            if (predicate.equals(DISCOBITS.contains)) {
+                try {
+                    GraphNode containedNode = new GraphNode((NonLiteral)triple.getObject(), mGraph);
+                    //The following includes triple
+                    containedNode.deleteNodeContext();
+                } catch (ClassCastException e) {
+                    throw new RuntimeException("The value of "+predicate+" is expected not to be a literal");
+                }
+                //as some other properties of node could have been in the context of the object
+                remove(node);
+                return;
+            }            
+        }
+        GraphNode graphNode = new GraphNode(node, mGraph);
+        graphNode.deleteNodeContext();
+    }
+
+    @Override
+    public byte[] getData(UriRef uriRef) {
+        MGraph mGraph = getMGraph();
+        GraphNode node = new GraphNode(uriRef, mGraph);
+        final InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(node);
+        if (infoDiscobit == null) {
+            return null;
+        }
+        return infoDiscobit.getData();
+    }
+
+    @Override
+    public MediaType getMediaType(UriRef uriRef) {
+        MGraph mGraph = getMGraph();
+        GraphNode node = new GraphNode(uriRef, mGraph);
+        final InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(node);
+        if (infoDiscobit == null) {
+            return null;
+        }
+        return MediaType.valueOf(infoDiscobit.getContentType());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java
new file mode 100644
index 0000000..5bcf1af
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland).
+ * 
+ * Licensed 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;
+
+import java.net.URL;
+import java.util.Map;
+import javax.ws.rs.GET;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.clerezza.platform.content.WebDavUtils.PropertyMap;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.clerezza.platform.content.webdav.COPY;
+import org.apache.clerezza.platform.content.webdav.LOCK;
+import org.apache.clerezza.platform.content.webdav.UNLOCK;
+import org.apache.clerezza.platform.typehandlerspace.SupportedTypes;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.ontologies.HIERARCHY;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * Provides HTTP Methods for WebDav
+ * 
+ * @author ali
+ */
+
+@Component
+@Services({
+    @Service(Object.class),
+    @Service(CollectionTypeHandler.class)
+})
+@Property(name = "org.apache.clerezza.platform.typehandler", boolValue = true)
+@SupportedTypes(types = { "http://clerezza.org/2009/09/hierarchy#Collection" }, prioritize = true)
+public class CollectionTypeHandler extends DiscobitsTypeHandler{
+
+    private Logger logger = LoggerFactory.getLogger(CollectionTypeHandler.class);
+    
+    @Reference
+    private RenderletManager renderletManager;
+
+    /**
+     * The activate method is called when SCR activates the component configuration.
+     * This method gets the system graph or create a new one if it doesn't exist.
+     *
+     * @param componentContext
+     */
+    protected void activate(ComponentContext componentContext) {
+        URL templateURL = getClass().getResource("collection.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(templateURL.toString()), HIERARCHY.Collection,
+                "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        logger.info("CollectionTypeHandler activated.");
+    }
+
+    /**
+     * Returns a GraphNode of the requested collection
+     * @return 
+     */
+    @GET
+    @Override
+    public GraphNode getResource(@Context UriInfo uriInfo) {
+        final MGraph contentGraph = cgProvider.getContentGraph();
+        final String uriString = uriInfo.getAbsolutePath().toString();
+        final UriRef indexUri = new UriRef(uriString+"index");
+        if (contentGraph.filter(indexUri, null, null).hasNext()) {
+            return new GraphNode(indexUri, contentGraph);
+        }
+        final UriRef uri = new UriRef(uriString);
+        MGraph mGraph = new UnionMGraph(new SimpleMGraph(), contentGraph);
+        final GraphNode graphNode = new GraphNode(uri, mGraph);
+        graphNode.addProperty(RDF.type, PLATFORM.HeadedPage);
+
+        UriRef collectionUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        return graphNode;
+    }
+
+    @Override
+    Map<UriRef, PropertyMap> getPropNames(GraphNode node, String depthHeader) {
+        return WebDavUtils.getCollectionProps(null, null, null, node,
+                            depthHeader, false /* doesNotIncludeValues */);
+    }
+
+    @Override
+    Map<UriRef, PropertyMap> getPropsByName(Node requestNode, GraphNode node,
+            String depthHeader) {
+        Map<UriRef, PropertyMap> result;
+        NodeList children = requestNode.getChildNodes();
+        result = WebDavUtils.getPropsByName(children, node, depthHeader,
+                true /* includeValues */);
+        return result;
+    }
+
+    @Override
+    Map<UriRef, PropertyMap> getAllProps(GraphNode node, String depthHeader) {
+        return WebDavUtils.getCollectionProps(null, null, null, node,
+                            depthHeader, true /* includeValues */);
+    }
+
+    /*-----------------------*
+     * Not Supported Methods * 
+     *-----------------------*/
+    
+    /**
+     * Locks a resource
+     *
+     * @return returns a 501 Not Implemented response
+     */
+    @LOCK
+    public Object lock() {
+        return Response.status(501/* Not Implemented */).build();
+    }
+
+    /**
+     * Unlocks a resource
+     *
+     * @return returns a 501 Not Implemented response
+     */
+    @UNLOCK
+    public Object unlock() {
+        return Response.status(501/* Not Implemented */).build();
+    }
+
+    /**
+     * Copies a resource
+     *
+     * @return returns a 501 Not Implemented response
+     */
+    @COPY
+    public Object copy() {
+        return Response.status(501/* Not Implemented */).build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java
new file mode 100644
index 0000000..6a7db15
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java
@@ -0,0 +1,98 @@
+/*
+ * 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;
+
+
+import java.net.URI;
+import java.util.concurrent.locks.Lock;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.clerezza.jaxrs.utils.form.FormFile;
+import org.apache.clerezza.jaxrs.utils.form.MultiPartBody;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ * This Jax-rs root resource provides a method to post content to the content
+ * graph
+ *
+ * @author mir
+ */
+@Component
+@Service(Object.class)
+@Property(name="javax.ws.rs", boolValue=true)
+@Path("content")
+public class ContentPostSupport {
+    
+    @Reference
+    private DiscobitsHandler handler;
+
+    @Reference
+    private ContentGraphProvider cgProvider;
+
+    /**
+     * Creates an InfoDiscoBt (aka Binary Content) in the content graph.<br/>
+     * This JAX-RS method is available under the path "content". It requires
+     * a multipart/form-data with two fields: "content", which is the content of the
+     * InfoDiscobit to be created and "uri" which is the uri of the new
+     * InfoDiscoBit.
+     *
+     * @param form
+     * @return Returns a Created (201) response, if the info bit was successfully
+     * uploaded. Returns Bad Request (400) response, if required form fields are
+     * missing. Returns a Conflict (409) response, if at the specified URI a
+     * resource already exists.
+     */
+    @POST
+    @Consumes("multipart/form-data")
+    public Response postContent(MultiPartBody form) {
+        FormFile formFile = form.getFormFileParameterValues("content")[0];
+        String uri = form.getTextParameterValues("uri")[0];
+        byte[] content = formFile.getContent();
+        if (content == null || uri == null) {
+            return Response.status(400).entity("Required form field is missing").
+                    type(MediaType.TEXT_PLAIN_TYPE).build();
+        }
+        LockableMGraph contentGraph = cgProvider.getContentGraph();
+        Lock readLock = contentGraph.getLock().readLock();
+        readLock.lock();
+        try {
+            if (contentGraph.filter(new UriRef(uri), RDF.type, null).hasNext()) {
+                return Response.status(Response.Status.CONFLICT).
+                        entity("A resource with the specified URI already exists").
+                        type(MediaType.TEXT_PLAIN_TYPE).build();
+            }
+        } finally {
+            readLock.unlock();
+        }
+        handler.put(new UriRef(uri), formFile.getMediaType(), content);
+        return Response.created(URI.create(uri)).build();
+    }    
+    
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java
new file mode 100644
index 0000000..3b45d62
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java
@@ -0,0 +1,77 @@
+/*
+ * 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;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+
+
+import javax.ws.rs.core.MediaType;
+
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.platform.typerendering.seedsnipe.SeedsnipeRenderlet;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+
+/**
+ *
+ * @author tio
+ */
+@Component(immediate = true)
+public class DiscobitTemplating {
+
+    @Reference
+    RenderletManager renderletManager;
+
+    protected void activate(ComponentContext context) {
+
+        // register seedsnipe renderlets
+        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
+                new UriRef(getClass().getResource("Resource.xhtml").toString()),
+                RDFS.Resource, null, MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
+                new UriRef(getClass().getResource("Resource_naked.xhtml").toString()),
+                RDFS.Resource, "(naked|.*-naked)", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
+                new UriRef(getClass().getResource("XHTML_InfoDiscoBit_naked.xhtml").toString()),
+                DISCOBITS.XHTMLInfoDiscoBit, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
+                new UriRef(getClass().getResource("OrderedContent_naked.xhtml").toString()),
+                DISCOBITS.OrderedContent, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
+                new UriRef(getClass().getResource("TitledContent.xhtml").toString()),
+                DISCOBITS.TitledContent, null, MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        renderletManager.registerRenderlet(TitledContentRenderlet.class.getName(),
+                null, DISCOBITS.TitledContent, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        // registre renderlet for XMLLiteral datatype.
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(getClass().getResource("XmlLiteral.ssp").toString()),
+                new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"), null,
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java
new file mode 100644
index 0000000..2e3e441
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java
@@ -0,0 +1,70 @@
+/*
+ * 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;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+
+/**
+ * Provides utility methods to create, retrieve and remove binary contents.
+ * Binary contents are modeled as InfoDiscoBit from the discobit ontology at
+ * http://discobits.org/ontology
+ *
+ * @author rbn
+ */
+public interface DiscobitsHandler {
+
+    /**
+     * Creates an InfoDiscoBit
+     * 
+     * @param infoDiscoBitUri
+     * @param mediaType
+     * @param data
+     */
+    public abstract void put(UriRef infoDiscoBitUri, MediaType mediaType,
+            byte[] data);
+
+    /**
+     * Removes InfoDiscoBits (aka binary contents), other DiscoBits and
+     * the context of the specified node. If it is in a hierarchy then it
+     * will be removed also form its container.
+     * 
+     * @param node
+     */
+    public abstract void remove(NonLiteral node);
+
+    /**
+     * 
+     * @param uriRef
+     * @return the media type of the InfoDiscoBit with the specified URI or null
+     *         if no MediaType for that URI is known
+     */
+    public MediaType getMediaType(UriRef uriRef);
+
+    /**
+     * 
+     * @param uriRef
+     * @return a byte[] with the data of the InfoDiscoBit with the specified URI
+     *         or null if no data for that URI is known
+     */
+    public byte[] getData(UriRef uriRef);
+
+}
\ No newline at end of file


[09/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/LICENSE b/platform/platform.concepts/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.concepts/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/README.txt
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/README.txt b/platform/platform.concepts/README.txt
deleted file mode 100644
index 9edd812..0000000
--- a/platform/platform.concepts/README.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-JAX-RS resource called GenericResourcePage can be used to retrieve a resource and its associated concepts. 
-Go to http://[your.server]/concepts/generic-resource?uri=[resource] where [resource] 
-specifies the UriRef of the resource. Furthermore there is a JAX-RS resource called ResourceTagger
- for associating concepts with resources. POST to http://[your.server]/concepts/tagger/set a form 
-with form parameter uri which specifies the UriRef of the resource and a form parameter 
-concepts which contains the UriRefs of the concepts.
-
-JAX-RS resource called ConceptManipulator can be used to add concept into the content graph
-The resource path is "/concepts/manipulator/add-concept" and the form parameters are
-pref-label, lang, and comment.
-
-On the client side there is a ConceptManipulator widget to add free concepts to the content graph
-and there is also a ConceptFinder widget to find exisiting concepts to be suggested for a specified search term.
- 
-In ConceptManipulator widget and ConceptFinder widget a developer can register a callback function
-which is called when a concept is added to the list of selected concept.
-
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/LICENSE b/platform/platform.concepts/platform.concepts.core/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.concepts/platform.concepts.core/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/pom.xml b/platform/platform.concepts/platform.concepts.core/pom.xml
deleted file mode 100644
index 579930a..0000000
--- a/platform/platform.concepts/platform.concepts.core/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
-
- 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.
-
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>platform.concepts</artifactId>
-        <version>0.2</version>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.concepts.core</artifactId>
-    <packaging>bundle</packaging>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Clerezza - Platform Concepts Core</name>
-    <description>The core part of Platform Concepts</description>
-    <dependencies>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.ontologies</artifactId>
-            <version>0.12</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.utils</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.concepts.ontologies</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.graphprovider.content</artifactId>
-            <version>0.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.core</artifactId>
-            <version>0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.scalaserverpages</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>jaxrs.utils</artifactId>
-            <version>0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.config</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.globalmenu.api</artifactId>
-            <version>0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>permissiondescriptions</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>web.fileserver</artifactId>
-            <scope>compile</scope>
-            <version>0.10</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.wink</groupId>
-            <artifactId>wink-common</artifactId>
-            <version>1.2.1-incubating</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java
deleted file mode 100644
index 25409bc..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptCache.java
+++ /dev/null
@@ -1,285 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.util.Date;
-import java.util.Iterator;
-import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.DC;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.ontologies.SKOS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-/**
- * This class manages caches of SPARQL query results against a specific EndPoint
- * and Graph.
- *
- * @author hasan
- */
-class ConceptCache {
-    private UriRef sparqlEndPoint;
-    private UriRef defaultGraph;
-    private UriRef CONCEPT_CACHE_MGRAPH = new UriRef("urn:x-localinstance:/concept.cache");
-
-    /**
-     * Constructs a {@link ConceptCache} for the specified SPARQL EndPoint and
-     * Graph.
-     *
-     * @param sparqlEndPoint
-     *        the SPARQL EndPoint used in the query.
-     * @param defaultGraph
-     *        the Graph against which the query was executed.
-     *
-     */
-    public ConceptCache(UriRef sparqlEndPoint, UriRef defaultGraph) {
-        this.sparqlEndPoint = sparqlEndPoint;
-        this.defaultGraph = defaultGraph;
-    }
-
-    /**
-     * Caches the query results available in the specified Graph under a
-     * particular search term.
-     *
-     * @param searchTerm
-     *        the term used for querying concepts.
-     * @param parsedGraph
-     *        the Graph which contains query results.
-     */
-    void cache(String searchTerm, Graph parsedGraph) {
-        MGraph conceptCacheMGraph = getConceptCacheMGraph();
-        NonLiteral conceptCacheNode = getConceptCacheNode(conceptCacheMGraph);
-        if (conceptCacheNode != null) {
-            removeCachedConcepts(searchTerm, conceptCacheNode, conceptCacheMGraph);
-        }
-        addCacheEntry(searchTerm, conceptCacheNode, conceptCacheMGraph,
-                parsedGraph);
-    }
-
-    private MGraph getConceptCacheMGraph() {
-        MGraph conceptCacheMGraph = null;
-        TcManager tcManager = TcManager.getInstance();
-        try {
-            conceptCacheMGraph = tcManager.getMGraph(CONCEPT_CACHE_MGRAPH);
-        } catch (NoSuchEntityException nsee) {
-            conceptCacheMGraph = tcManager.createMGraph(CONCEPT_CACHE_MGRAPH);
-        }
-        return conceptCacheMGraph;
-    }
-
-    private NonLiteral getConceptCacheNode(MGraph conceptCacheMGraph) {
-        Iterator<Triple> conceptCaches = conceptCacheMGraph.filter(
-                null, RDF.type, CONCEPTS.ConceptCache);
-        while (conceptCaches.hasNext()) {
-            NonLiteral conceptCacheNode = conceptCaches.next().getSubject();
-            if (!conceptCacheMGraph.filter(conceptCacheNode,
-                    CONCEPTS.sparqlEndPoint, sparqlEndPoint).hasNext()) {
-                continue;
-            }
-            if (defaultGraph != null) {
-                if (!conceptCacheMGraph.filter(conceptCacheNode,
-                        CONCEPTS.defaultGraph, defaultGraph).hasNext()) {
-                    continue;
-                }
-            }
-            return conceptCacheNode;
-        }
-        return null;
-    }
-
-    private void removeCachedConcepts(String searchTerm,
-            NonLiteral conceptCacheNode, MGraph conceptCacheMGraph) {
-        NonLiteral conceptCacheEntryNode = getConceptCacheEntryNode(
-                searchTerm, conceptCacheNode, conceptCacheMGraph);
-        if (conceptCacheEntryNode == null) {
-            return;
-        }
-        GraphNode conceptCacheEntryGraphNode = new GraphNode(
-                conceptCacheEntryNode, conceptCacheMGraph);
-        removeCachedConcepts(conceptCacheEntryGraphNode);
-        conceptCacheMGraph.remove(new TripleImpl(conceptCacheNode,
-                CONCEPTS.cacheEntry, conceptCacheEntryNode));
-    }
-
-    private NonLiteral getConceptCacheEntryNode(String searchTerm,
-            NonLiteral conceptCacheNode, MGraph conceptCacheMGraph) {
-        TypedLiteral searchLiteral = LiteralFactory.getInstance()
-                .createTypedLiteral(searchTerm);
-        Iterator<Triple> cacheEntries = conceptCacheMGraph.filter(
-                conceptCacheNode, CONCEPTS.cacheEntry, null);
-        while (cacheEntries.hasNext()) {
-            NonLiteral conceptCacheEntryNode = (NonLiteral) cacheEntries.next()
-                    .getObject();
-            if (!conceptCacheMGraph.filter(conceptCacheEntryNode,
-                    CONCEPTS.searchTerm, searchLiteral).hasNext()) {
-                continue;
-            }
-            return conceptCacheEntryNode;
-        }
-        return null;
-    }
-
-    private void removeCachedConcepts(GraphNode conceptCacheEntryGraphNode) {
-        Iterator<Resource> searchResults =
-                conceptCacheEntryGraphNode.getObjects(CONCEPTS.searchResult);
-        while (searchResults.hasNext()) {
-            Resource concept = searchResults.next();
-            GraphNode conceptGraphNode = new GraphNode(concept,
-                    conceptCacheEntryGraphNode.getGraph());
-            conceptGraphNode.deleteProperties(OWL.sameAs);
-            conceptGraphNode.deleteProperties(RDFS.comment);
-            conceptGraphNode.deleteProperties(SKOS.prefLabel);
-            conceptGraphNode.deleteProperties(RDF.type);
-        }
-        conceptCacheEntryGraphNode.deleteProperties(CONCEPTS.searchResult);
-        conceptCacheEntryGraphNode.deleteProperties(DC.date);
-        conceptCacheEntryGraphNode.deleteProperties(CONCEPTS.searchTerm);
-        conceptCacheEntryGraphNode.deleteProperties(RDF.type);
-    }
-
-    private void addCacheEntry(String searchTerm, NonLiteral conceptCacheNode,
-            MGraph conceptCacheMGraph, Graph parsedGraph) {
-        GraphNode conceptCacheGraphNode = null;
-        if (conceptCacheNode == null) {
-            conceptCacheGraphNode = addConceptCacheNode(conceptCacheMGraph);
-        } else {
-            conceptCacheGraphNode = new GraphNode(conceptCacheNode,
-                    conceptCacheMGraph);
-        }
-        GraphNode conceptCacheEntryGraphNode = new GraphNode(new BNode(),
-                conceptCacheMGraph);
-        conceptCacheGraphNode.addProperty(CONCEPTS.cacheEntry,
-                conceptCacheEntryGraphNode.getNode());
-        conceptCacheEntryGraphNode.addProperty(RDF.type, CONCEPTS.SearchTerm);
-        conceptCacheEntryGraphNode.addProperty(CONCEPTS.searchTerm,
-                LiteralFactory.getInstance().createTypedLiteral(searchTerm));
-        conceptCacheEntryGraphNode.addProperty(DC.date,
-                LiteralFactory.getInstance().createTypedLiteral(new Date()));
-
-        Iterator<Triple> concepts = parsedGraph.filter(null, RDF.type, SKOS.Concept);
-        while (concepts.hasNext()) {
-            conceptCacheEntryGraphNode.addProperty(CONCEPTS.searchResult,
-                    concepts.next().getSubject());
-        }
-        conceptCacheMGraph.addAll(parsedGraph);
-    }
-
-    private GraphNode addConceptCacheNode(MGraph conceptCacheMGraph) {
-        GraphNode conceptCacheGraphNode = new GraphNode(new BNode(),
-                conceptCacheMGraph);
-        conceptCacheGraphNode.addProperty(RDF.type, CONCEPTS.ConceptCache);
-        conceptCacheGraphNode.addProperty(CONCEPTS.sparqlEndPoint,
-                sparqlEndPoint);
-        if (defaultGraph != null) {
-            conceptCacheGraphNode.addProperty(CONCEPTS.defaultGraph,
-                    defaultGraph);
-        }
-        return     conceptCacheGraphNode;
-    }
-
-    /**
-     * Retrieves concepts from the cache stored under the specified search term.
-     * Cache entries are invalid if they are older than the specified date.
-     *
-     * @param searchTerm
-     *        the search term under which the concepts are cached.
-     * @param acceptableOldestCachingDate
-     *        the Date before which a cache entry is considered invalid.
-     * @return
-     *        an {@link MGraph} containing the valid cached concepts.
-     */
-    MGraph retrieve(String searchTerm, Date acceptableOldestCachingDate) {
-        MGraph conceptCacheMGraph = getConceptCacheMGraph();
-
-        NonLiteral conceptCacheNode = getConceptCacheNode(conceptCacheMGraph);
-        if (conceptCacheNode == null) {
-            return null;
-        }
-        NonLiteral conceptCacheEntryNode = getConceptCacheEntryNode(searchTerm,
-                conceptCacheNode, conceptCacheMGraph);
-        if (conceptCacheEntryNode == null) {
-            return null;
-        }
-        GraphNode conceptCacheEntryGraphNode = new GraphNode(
-                conceptCacheEntryNode, conceptCacheMGraph);
-        Date cachingDate = getCachingDate(conceptCacheEntryGraphNode);
-        if (cachingDate == null || cachingDate.before(acceptableOldestCachingDate)) {
-            removeCachedConcepts(conceptCacheEntryGraphNode);
-            conceptCacheMGraph.remove(new TripleImpl(conceptCacheNode,
-                    CONCEPTS.cacheEntry, conceptCacheEntryNode));
-            return null;
-        }
-        return getCachedConcepts(conceptCacheEntryGraphNode);
-    }
-
-    private Date getCachingDate(GraphNode conceptCacheEntryGraphNode) {
-        Iterator<Literal> cachingDates = conceptCacheEntryGraphNode.getLiterals(
-                DC.date);
-        if (cachingDates.hasNext()) {
-            return LiteralFactory.getInstance().createObject(Date.class,
-                    (TypedLiteral) cachingDates.next());
-        }
-        return null;
-    }
-
-    private MGraph getCachedConcepts(GraphNode conceptCacheEntryGraphNode) {
-        MGraph resultMGraph = new SimpleMGraph();
-        MGraph conceptCacheMGraph = (MGraph) conceptCacheEntryGraphNode.getGraph();
-        NonLiteral conceptCacheNode = (NonLiteral) conceptCacheEntryGraphNode.getNode();
-        Iterator<Triple> triples = conceptCacheMGraph.filter(
-                conceptCacheNode, CONCEPTS.searchResult, null);
-        while (triples.hasNext()) {
-            UriRef concept = (UriRef) triples.next().getObject();
-            GraphNode graphNode = new GraphNode(concept, conceptCacheMGraph);
-            resultMGraph.add(new TripleImpl(concept, RDF.type, SKOS.Concept));
-
-            Iterator<Literal> prefLabelStatements = graphNode.getLiterals(SKOS.prefLabel);
-            while (prefLabelStatements.hasNext()) {
-                resultMGraph.add(new TripleImpl(concept, SKOS.prefLabel,
-                        prefLabelStatements.next()));
-            }
-            Iterator<Literal> commentStatements = graphNode.getLiterals(RDFS.comment);
-            while (commentStatements.hasNext()) {
-                resultMGraph.add(new TripleImpl(concept, RDFS.comment,
-                        commentStatements.next()));
-            }
-            Iterator<UriRef> sameAsStatements = graphNode.getUriRefObjects(OWL.sameAs);
-            while (sameAsStatements.hasNext()) {
-                resultMGraph.add(new TripleImpl(concept, OWL.sameAs,
-                        sameAsStatements.next()));
-            }
-        }
-        return resultMGraph;
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java
deleted file mode 100644
index 18b1e6c..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptManipulator.java
+++ /dev/null
@@ -1,124 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import org.apache.clerezza.platform.config.PlatformConfig;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.Language;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.PlainLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.ontologies.SKOS;
-import org.apache.clerezza.rdf.utils.UriRefUtil;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-
-/**
- * This JAX-RS resource can be used to add free concepts to the content graph.
- * The URI path of this resource is /concepts/manipulator.
- * 
- * @author hasan
- */
-@Component
-@Service(Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/manipulator")
-public class ConceptManipulator {
-
-    public static String FREE_CONCEPT_SCHEME = "concept-scheme/free-concepts";
-
-    @Reference
-    protected ContentGraphProvider cgProvider;
-
-    @Reference
-    private PlatformConfig platformConfig;
-
-    /**
-     * Creates and stores a concept with the specified prefLabel and comment
-     * into the content graph if a concept with this prefLabel does not already
-     * exist in the graph.
-     *
-     * @param prefLabel
-     *        if it is an empty string no concept is generated
-     * @param lang
-     *        the language of the prefLabel
-     * @param comment
-     *        is a human-readable description of the concept
-     * @return
-     *        - BAD REQUEST response if prefLabel is undefined or empty
-     *        - CONFLICT response if a concept with the same prefLabel and lang exists
-     *        - CREATED if everything is ok
-     */
-    @POST
-    @Path("add-concept")
-    public Response addConcept(@FormParam("pref-label") String prefLabel,
-            @FormParam("lang") String lang,
-            @FormParam("comment") String comment) {
-
-        if ((prefLabel == null) || (prefLabel.isEmpty())) {
-            return Response.status(Status.BAD_REQUEST)
-                    .entity("A concept must have a label!")
-                    .build();
-        }
-        MGraph contentGraph = cgProvider.getContentGraph();
-        PlainLiteral preferredLabel = new PlainLiteralImpl(prefLabel,
-                new Language(lang));
-
-        if (contentGraph.filter(null, SKOS.prefLabel, preferredLabel).hasNext()) {
-            return Response.status(Status.CONFLICT)
-                    .entity("A concept with the same label and language already exists!")
-                    .build();
-        }
-        
-        UriRef concept = getConceptUriRef(platformConfig, prefLabel);
-        contentGraph.add(new TripleImpl(concept, RDF.type,
-                SKOS.Concept));
-        String baseUri = platformConfig.getDefaultBaseUri().getUnicodeString();
-        contentGraph.add(new TripleImpl(concept, SKOS.inScheme,
-                new UriRef(baseUri + FREE_CONCEPT_SCHEME)));
-        contentGraph.add(new TripleImpl(concept, SKOS.prefLabel, preferredLabel));
-        if (!comment.isEmpty()) {
-            contentGraph.add(new TripleImpl(concept, RDFS.comment,
-                    new PlainLiteralImpl(comment, new Language(lang))));
-        }
-        return Response.status(Status.CREATED).entity(concept.getUnicodeString())
-                .build();
-    }
-
-    static UriRef getConceptUriRef(PlatformConfig platformConfig, String prefLabel) {
-        String baseUri = platformConfig.getDefaultBaseUri().getUnicodeString();
-        return new UriRef(baseUri + "concept/" +
-                UriRefUtil.stripNonUriRefChars(prefLabel));
-    }
-}
-
-
-
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java
deleted file mode 100644
index cedd350..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProvider.java
+++ /dev/null
@@ -1,40 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import org.apache.clerezza.rdf.core.Graph;
-
-/**
- * An implementation of this interface provides a function to retrieve
- * concepts based on a search term.
- * 
- * @author hasan
- */
-public interface ConceptProvider {
-    /**
-     * Returns a graph containing all concepts whose SKOS:prefLabels
-     * or SKOS:altLabels contain the search term.
-     *
-     * @param searchTerm a filter condition that specifies the term that must
-     *        be contained within SKOS:prefLabels or SKOS:altLabels of a concept.
-     * @return a Graph containing all concepts that meet the filter condition.
-     *
-     */
-    public Graph retrieveConcepts(String searchTerm);
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java
deleted file mode 100644
index a7b39ec..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManager.java
+++ /dev/null
@@ -1,39 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.util.List;
-
-/**
- * An implementation of this class manages {@link ConceptProvider}s.
- *
- * @author hasan
- */
-public interface ConceptProviderManager {
-
-    /**
-     * Returns a list of {@link ConceptProvider}s. The list order determines
-     * the priority of a {@link ConceptProvider}. The meaning of the priority
-     * is left to the implementation and application.
-     * 
-     * @return
-     *        a list of managed {@link ConceptProvider}s.
-     */
-    public List<ConceptProvider> getConceptProviders();
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java
deleted file mode 100644
index c346a12..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptProviderManagerAppPermission.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  Copyright 2010 reto.
- * 
- *  Licensed 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.
- *  under the License.
- */
-
-package org.apache.clerezza.platform.concepts.core;
-
-import java.security.Permission;
-import org.apache.clerezza.permissiondescriptions.PermissionInfo;
-
-/**
- * Permssion to use an application to Manage Concept-Providers. Note that the
- * user additionally need the respecitive rights on the underlying graphs.
- *
- * @author reto
- */
-@PermissionInfo(value="Concept Provider Manager Access Permission", description="Grants access " +
-    "to the Concept Provider Manager page")
-public class ConceptProviderManagerAppPermission extends Permission {
-
-    public ConceptProviderManagerAppPermission() {
-        super("Graph Management permission");
-    }
-
-    /**
-     *
-     * @param target ignored
-     * @param action ignored
-     */
-    public ConceptProviderManagerAppPermission(String target, String actions) {
-        super("Graph Management permission");
-    }
-
-    @Override
-    public boolean implies(Permission permission) {
-        return equals(permission);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return getClass().equals(obj.getClass());
-    }
-
-    @Override
-    public int hashCode() {
-        return 77985;
-    }
-
-    @Override
-    public String getActions() {
-        return "";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java
deleted file mode 100644
index f3ac14e..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ConceptsFinder.java
+++ /dev/null
@@ -1,266 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.clerezza.platform.concepts.ontologies.QUERYRESULT;
-import org.apache.clerezza.platform.config.PlatformConfig;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.ontologies.SKOS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * This JAX-RS resource can be used to search concepts accessible through
- * registered {@link ConceptProvider}s. If no {@link LocalConceptProvider} is
- * registered for {@link ConceptManipulator.FREE_CONCEPT_SCHEME}, then one is
- * created to find free concepts in the content graph.
- * Concept providers are prioritized.
- * The URI, SKOS:prefLabel and RDFS:comment of a concept from a provider of a 
- * higher priority will be used instead of those concepts having an OWL:sameAs
- * relation with this concept, but from a provider of lower priority.
- * Implicitly created {@link LocalConceptProvider} for free concepts has the
- * lowest priority.
- * 
- * The URI path of this service is /concepts/find.
- * 
- * @author hasan
- */
-@Component
-@Service(Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/find")
-public class ConceptsFinder {
-
-    @Reference
-    private RenderletManager renderletManager;
-
-    @Reference
-    protected ConceptProviderManager conceptProviderManager;
-
-    @Reference
-    private TcManager tcManager;
-
-    @Reference
-    private ContentGraphProvider cgProvider;
-
-    @Reference
-    private PlatformConfig platformConfig;
-
-    private LocalConceptProvider freeConceptProvider = null;
-
-    private UriRef freeConceptScheme = null;
-
-    protected void activate(ComponentContext context) throws URISyntaxException {
-        URL template = getClass().getResource("skos-collection-json.ssp");
-        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
-                new UriRef(template.toURI().toString()),
-                SKOS.Collection, null,
-                MediaType.APPLICATION_JSON_TYPE, true);
-
-        freeConceptScheme =
-                new UriRef(platformConfig.getDefaultBaseUri().getUnicodeString()
-                + ConceptManipulator.FREE_CONCEPT_SCHEME);
-        freeConceptProvider = new LocalConceptProvider(tcManager, cgProvider,
-                freeConceptScheme);
-    }
-
-    /**
-     * Searches concepts for a specified search term. The actual search task
-     * is delegated to each {@link ConceptProvider} instance. The results from
-     * each {@link ConceptProvider} are merged into a single result graph.
-     * However, concepts from providers of lower priority are only considered if
-     * they are not staying in an OWL:sameAs relation with concepts from
-     * providers of higher priority.
-     * 
-     * @param searchTerm
-     *            The search term in form of a String.
-     * @return
-     *        A GraphNode containing the search results.
-     */
-    @GET
-    @Produces("application/rdf+json")
-    public GraphNode findConcepts(@QueryParam(value="searchTerm")
-            String searchTerm) {
-
-        boolean freeConceptProviderFound = false;
-
-        List<ConceptProvider> conceptProviderList = conceptProviderManager
-                .getConceptProviders();
-
-        MGraph resultMGraph = new SimpleMGraph();
-        GraphNode resultNode = new GraphNode(new BNode(), resultMGraph);
-        boolean first = true;
-        for (ConceptProvider cp : conceptProviderList) {
-            if (!freeConceptProviderFound) {
-                if (cp instanceof LocalConceptProvider) {
-                    if (((LocalConceptProvider) cp).getSelectedScheme().equals(
-                            freeConceptScheme)) {
-                        freeConceptProviderFound = true;
-                    }
-                }
-            }
-            retrieveConcepts(cp, first, resultNode, searchTerm);
-            if (first) {
-                first = false;
-            }
-        }
-        if (!freeConceptProviderFound && freeConceptProvider != null) {
-            retrieveConcepts(freeConceptProvider, first, resultNode, searchTerm);
-        }
-        addCreationOfNewFreeConceptSuggested(resultNode, searchTerm);
-        resultNode.addProperty(RDF.type, QUERYRESULT.QueryResult);
-        return resultNode;
-    }
-
-    /**
-     * Adds a boolean value that answers whether the UI shall suggest to create
-     * a new free concept. A new free concept may not be added if the has the
-     * same base uri and search term. Therefore the consumer shall be suggested
-     * not to propose creation.
-     * 
-     * @param resultNode
-     *            the result node to add the property to
-     * @param searchTerm
-     *            the search term the data was searched for
-     */
-    private void addCreationOfNewFreeConceptSuggested(GraphNode resultNode,
-            String searchTerm) {
-        UriRef conceptUriRef = ConceptManipulator.getConceptUriRef(
-                platformConfig, searchTerm);
-        resultNode.addProperty(QUERYRESULT.creationOfNewFreeConceptSuggested,
-                LiteralFactory.getInstance().createTypedLiteral(
-                        !cgProvider.getContentGraph().contains(
-                                new TripleImpl(conceptUriRef, RDF.type,
-                                        SKOS.Concept))));
-    }
-
-    /**
-     * Retrieve concepts for the given search term.
-     * 
-     * @param conceptProvider
-     *            the provider delivers concepts
-     * @param first
-     *            is this the first execution
-     * @param resultNode
-     *            the node to attach the concepts to
-     * @param searchTerm
-     *            the search term that the concepts have to match against
-     */
-    private void retrieveConcepts(ConceptProvider conceptProvider,
-            boolean first, GraphNode resultNode, String searchTerm) {
-        MGraph resultMGraph = (MGraph) resultNode.getGraph();
-        Graph graph = conceptProvider.retrieveConcepts(searchTerm);
-        Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
-        if (first) {
-            while (concepts.hasNext()) {
-                resultNode.addProperty(QUERYRESULT.concept, concepts.next()
-                        .getSubject());
-            }
-            resultMGraph.addAll(graph);
-        } else {
-            while (concepts.hasNext()) {
-                NonLiteral concept = concepts.next().getSubject();
-                GraphNode conceptGraphNode = new GraphNode(concept, graph);
-                Iterator<Resource> sameAsConcepts = conceptGraphNode
-                        .getObjects(OWL.sameAs);
-                if (!(hasSameAs(resultMGraph, concept) || hasAnyConcept(
-                        resultMGraph, sameAsConcepts))) {
-                    resultNode.addProperty(QUERYRESULT.concept, concept);
-                    addConceptToResultMGraph(resultMGraph, conceptGraphNode);
-                }
-
-            }
-        }
-    }
-
-    private boolean hasSameAs(MGraph graph, NonLiteral sameAsConcept) {
-        Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
-        while (concepts.hasNext()) {
-            NonLiteral concept = concepts.next().getSubject();
-            if (graph.filter(concept, OWL.sameAs, sameAsConcept).hasNext()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean hasAnyConcept(MGraph graph, Iterator<Resource> concepts) {
-        while (concepts.hasNext()) {
-            NonLiteral concept = (NonLiteral) concepts.next();
-            if (graph.filter(concept, RDF.type, SKOS.Concept).hasNext()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private void addConceptToResultMGraph(MGraph resultMGraph,
-            GraphNode graphNode) {
-        NonLiteral concept = (NonLiteral) graphNode.getNode();
-        resultMGraph.add(new TripleImpl(concept, RDF.type, SKOS.Concept));
-
-        Iterator<Literal> prefLabelStatements = graphNode.getLiterals(SKOS.prefLabel);
-        while (prefLabelStatements.hasNext()) {
-            resultMGraph.add(new TripleImpl(concept, SKOS.prefLabel,
-                    prefLabelStatements.next()));
-        }
-        Iterator<Literal> commentStatements = graphNode.getLiterals(RDFS.comment);
-        while (commentStatements.hasNext()) {
-            resultMGraph.add(new TripleImpl(concept, RDFS.comment,
-                    commentStatements.next()));
-        }
-        Iterator<UriRef> sameAsStatements = graphNode.getUriRefObjects(OWL.sameAs);
-        while (sameAsStatements.hasNext()) {
-            resultMGraph.add(new TripleImpl(concept, OWL.sameAs,
-                    sameAsStatements.next()));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java
deleted file mode 100644
index e96069e..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/GenericResourcePage.java
+++ /dev/null
@@ -1,111 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Response.Status;
-
-import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.ontologies.PLATFORM;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.utils.UnionMGraph;
-import org.apache.clerezza.utils.UriException;
-import org.apache.clerezza.web.fileserver.FileServer;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * This JAX-RS resource can be used to show selected concepts of a resource.
- * The URI path of this service is /concepts/generic-resource.
- * 
- * @author tio
- */
-@Component
-@Service(Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/generic-resource")
-public class GenericResourcePage extends FileServer {
-
-    @Reference
-    protected ContentGraphProvider cgProvider;
-    @Reference
-    private RenderletManager renderletManager;
-
-    private RemoteConceptsDescriptionManager remoteConceptsDescriptionManager = null;
-
-    protected void activate(ComponentContext context)
-            throws URISyntaxException {
-        
-        configure(context.getBundleContext());
-        
-        URL template = getClass().getResource("generic-resource-page.ssp");
-        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
-                new UriRef(template.toURI().toString()),
-                CONCEPTS.GenericResourcePage, "naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        remoteConceptsDescriptionManager = new RemoteConceptsDescriptionManager();
-    }
-
-    /**
-     * Retrieves a resource and its associated concepts to be rendered with a template
-     * registered for CONCEPTS.GenericResourcePage.
-     * 
-     * @param uri specifies the uri of a resource
-     * 
-     * @return GraphNode
-     */
-    @GET
-    public GraphNode GenericResourcePage(@QueryParam("uri") UriRef uri,
-            @Context UriInfo uriInfo) {
-
-        GraphNode node = new GraphNode(new BNode(), new UnionMGraph(new SimpleMGraph(),
-                cgProvider.getContentGraph(),
-                remoteConceptsDescriptionManager.getRemoteConceptsDescriptionMGraph()));
-        node.addProperty(RDF.type, PLATFORM.HeadedPage);
-        node.addProperty(RDF.type, CONCEPTS.GenericResourcePage);
-        if (uri != null) {
-            node.addProperty(CONCEPTS.resource, uri);
-        } else {
-            throw new WebApplicationException(Response.status(Status.BAD_REQUEST)
-                    .entity("No resource uri defined.").build());
-        }
-        return node;
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java
deleted file mode 100644
index 4b96110..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/LocalConceptProvider.java
+++ /dev/null
@@ -1,90 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.sparql.ParseException;
-import org.apache.clerezza.rdf.core.sparql.QueryParser;
-import org.apache.clerezza.rdf.core.sparql.query.ConstructQuery;
-
-/**
- * This {@link ConceptProvider} operates on concepts available in the localhost.
- *
- * @author tio, hasan
- */
-public class LocalConceptProvider implements ConceptProvider {
-
-    private TcManager tcManager = null;
-    private ContentGraphProvider contentGraphProvider = null;
-    private UriRef selectedScheme = null;
-
-    /**
-     * Constructs a {@link LocalConceptProvider} with the specified parameters.
-     *
-     * @param tcManager
-     *        Reference to the {@link TcManager}
-     * @param contentGraphProvider
-     *        Reference to a {@link ContentGraphProvider}
-     * @param selectedScheme
-     *        The scheme in which concepts are to be searched.
-     */
-    public LocalConceptProvider(TcManager tcManager,
-            ContentGraphProvider contentGraphProvider, UriRef selectedScheme) {
-        this.tcManager = tcManager;
-        this.contentGraphProvider = contentGraphProvider;
-        this.selectedScheme = selectedScheme;
-    }
-
-    public UriRef getSelectedScheme() {
-        return this.selectedScheme;
-    }
-
-    @Override
-    public Graph retrieveConcepts(String searchTerm) {
-        QueryParser queryParser = QueryParser.getInstance();
-
-        String query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> " +
-                "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " +
-                "PREFIX skos: <http://www.w3.org/2008/05/skos#> " +
-                "CONSTRUCT {?concept a skos:Concept; skos:prefLabel ?prefLabel; " +
-                "rdfs:comment ?comment; owl:sameAs ?sameConcept .} " +
-                "WHERE {?concept skos:inScheme " + selectedScheme.toString() +
-                "; skos:prefLabel ?prefLabel . " +
-                "OPTIONAL { ?concept skos:altLabel ?altLabel .} " +
-                "OPTIONAL { ?concept rdfs:comment ?comment .} " +
-                "OPTIONAL { ?concept owl:sameAs ?sameConcept .} " +
-                "FILTER (REGEX(STR(?prefLabel), '" +
-                searchTerm + "', 'i') || REGEX(STR(?altLabel), '" +
-                searchTerm + "', 'i'))}";
-
-        ConstructQuery constructQuery;
-        try {
-            constructQuery = (ConstructQuery) queryParser.parse(query);
-        } catch (ParseException ex) {
-            throw new RuntimeException(ex);
-        }
-
-        MGraph defaultGraph = contentGraphProvider.getContentGraph();
-        return tcManager.executeSparqlQuery(constructQuery, defaultGraph);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java
deleted file mode 100644
index f933a53..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptProvider.java
+++ /dev/null
@@ -1,134 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.ProtocolException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.Calendar;
-import java.util.Date;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.serializedform.Parser;
-import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
-
-/**
- * This implementation of {@link ConceptProvider} provides a functionality
- * to query a SPARQL End Point for a given search term. The query is to be
- * generated from a template by replacing the place holder for the search term
- * with the specified search term.
- *
- * @author tio, hasan
- */
-public class RemoteConceptProvider implements ConceptProvider {
-
-    private UriRef sparqlEndPoint = null;
-    private UriRef defaultGraph = null;
-    private String queryTemplate = null;
-    private ConceptCache conceptCache = null;
-    private RemoteConceptsDescriptionManager remoteConceptsDescriptionManager = null;
-
-    /**
-     * Constructs a {@link RemoteConceptProvider} with the specified parameters.
-     * 
-     * @param sparqlEndPoint
-     *        the SPARQL End Point to connect to
-     * @param defaultGraph
-     *        the Graph to query for concepts
-     * @param queryTemplate
-     *        the template for query containing place holders for the search term.
-     */
-    public RemoteConceptProvider(
-            UriRef sparqlEndPoint, UriRef defaultGraph, String queryTemplate) {
-        this.sparqlEndPoint = sparqlEndPoint;
-        this.defaultGraph = defaultGraph;
-        this.queryTemplate = queryTemplate;
-        this.conceptCache = new ConceptCache(sparqlEndPoint, defaultGraph);
-        this.remoteConceptsDescriptionManager = new RemoteConceptsDescriptionManager();
-    }
-
-    @Override
-    public Graph retrieveConcepts(String searchTerm) {
-
-        Calendar calendar = Calendar.getInstance();
-        calendar.add(Calendar.DAY_OF_MONTH, -30);
-        Date acceptableOldestCachingDate = calendar.getTime();
-        MGraph cachedConcepts = conceptCache.retrieve(searchTerm.toLowerCase(),
-                acceptableOldestCachingDate);
-        if (cachedConcepts != null) {
-            return cachedConcepts.getGraph();
-        } else {
-            final int connectionTimeout = 4000;
-            String query = queryTemplate.replace("${searchTerm}", searchTerm);
-            try {
-                String param = "query=" + URLEncoder.encode(query, "UTF-8");
-                if (defaultGraph != null) {
-                    param += "&default-graph-uri=" + defaultGraph.getUnicodeString();
-                }
-                final URL url = new URL(sparqlEndPoint.getUnicodeString());
-                final HttpURLConnection con =
-                        (HttpURLConnection) url.openConnection();
-                con.setRequestProperty("Accept", "application/rdf+xml");
-                con.setRequestMethod("POST");
-                con.setDoOutput(true);
-                con.setDoInput(true);
-                con.setUseCaches(false);
-                con.setConnectTimeout(connectionTimeout);
-
-                final OutputStream os = con.getOutputStream();
-                os.write(param.getBytes());
-                os.close();
-
-                if (con.getResponseCode() < 400) {
-                    final InputStream is = con.getInputStream();
-                    Graph parsedGraph = Parser.getInstance().parse(is,
-                            SupportedFormat.RDF_XML);
-                    is.close();
-                    conceptCache.cache(searchTerm.toLowerCase(), parsedGraph);
-                    remoteConceptsDescriptionManager.storeConceptsDescription(parsedGraph);
-                    return parsedGraph;
-                } else {
-                    final InputStream es = con.getErrorStream();
-                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                    for (int ch = es.read(); ch != -1; ch = es.read()) {
-                        baos.write(ch);
-                    }
-                    es.close();
-                    throw new RuntimeException(baos.toString());
-                }
-            } catch (ProtocolException ex) {
-                throw new RuntimeException(ex);
-            } catch (MalformedURLException ex) {
-                throw new RuntimeException(ex);
-            } catch (UnsupportedEncodingException ex) {
-                throw new RuntimeException(ex);
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-}


[36/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/form.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/form.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/form.rng
new file mode 100755
index 0000000..1c47382
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/form.rng
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Checks exclusions applying to form and basic-form modules.
+  This schema is intended to be used in addition to xhtml.rng.
+-->
+<grammar ns="http://www.w3.org/1999/xhtml" xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="normalElement"/>
+  </start>
+  <define name="normalElement">
+    <element>
+      <anyName>
+        <except>
+          <name>form</name>
+          <name>label</name>
+          <name>button</name>
+        </except>
+      </anyName>
+      <ref name="normalContent"/>
+    </element>
+  </define>
+  <define name="normalContent">
+    <zeroOrMore>
+      <choice>
+        <ref name="normalElement"/>
+        <ref name="formElement"/>
+        <ref name="labelElement"/>
+        <ref name="buttonElement"/>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="formElement">
+    <element name="form">
+      <ref name="formContent"/>
+    </element>
+  </define>
+  <define name="formContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>form</name>
+              <name>label</name>
+              <name>button</name>
+            </except>
+          </anyName>
+          <ref name="formContent"/>
+        </element>
+        <ref name="labelElement"/>
+        <ref name="buttonElement"/>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="labelElement">
+    <element name="label">
+      <ref name="labelContent"/>
+    </element>
+  </define>
+  <define name="labelContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>form</name>
+              <name>label</name>
+              <name>button</name>
+            </except>
+          </anyName>
+          <ref name="labelContent"/>
+        </element>
+        <ref name="buttonElement"/>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="buttonElement">
+    <element name="button">
+      <ref name="buttonContent"/>
+    </element>
+  </define>
+  <define name="buttonContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>a</name>
+              <name>input</name>
+              <name>select</name>
+              <name>textarea</name>
+              <name>label</name>
+              <name>button</name>
+              <name>form</name>
+              <name>isindex</name>
+              <name>fieldset</name>
+              <name>iframe</name>
+            </except>
+          </anyName>
+          <ref name="buttonContent"/>
+        </element>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="anyAttribute">
+    <attribute>
+      <anyName/>
+    </attribute>
+  </define>
+</grammar>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/index.html
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/index.html b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/index.html
new file mode 100644
index 0000000..bf61574
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/index.html
@@ -0,0 +1,129 @@
+<!--
+
+ 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 xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Modularization of XHTML in RELAX NG</title>
+</head>
+<body>
+<h1>Modularization of XHTML in RELAX NG</h1>
+
+<p>This directory contains an implementataion in RELAX NG of the
+modularization of XHTML specified by the <a
+href="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410"
+>Modularization of XHTML Recommendation</a>.</p>
+
+<p>The RELAX NG schema has not been mechanically derived from the DTDs.
+Rather, it has been hand-crafted so as to produce a good quality RELAX NG
+schema.  However, it may well contain bugs.</p>
+
+<p>The <a href="modules"><code>modules</code></a> directory contains
+all the modules; <a
+href="xhtml-basic.rng"><code>xhtml-basic.rng</code></a> uses the
+modules to implement <a href="http://www.w3.org/TR/xhtml-basic/">XHTML
+Basic</a>; <a
+href="xhtml-strict.rng"><code>xhtml-strict.rng</code></a> uses the
+modules to implement <a href="http://www.w3.org/TR/xhtml1/">XHTML
+1.0</a> strict; <a href="xhtml.rng"><code>xhtml.rng</code></a> uses
+the modules to implement the union of <a
+href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> transitional and <a
+href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> frameset.  You can
+<a href="http://www.thaiopensource.com/download">download</a>
+everything as part of the main Jing distribution.  To create a custom
+version of XHTML, simply copy <code>xhtml.rng</code> and delete the
+inclusions of the modules that you do not want.</p>
+
+<p>The biggest difference between the RELAX NG implementation and the
+DTD implementation is that the RELAX NG implementation does not
+require you to create a model module specific to the combination of
+XHTML modules you are using. Instead, simply include the modules you
+want. The modules take care of redefining the content models
+appropriately.</p>
+
+<p>Note also the following differences:</p>
+
+<ul>
+
+<li>The frames module is used instead of the struct module, rather
+than in addition to it.</li>
+
+<li>In the frames module, the <code>frameset</code> element does not
+restrict the optional <code>noframes</code> element to follow all the
+other child elements. XHTML Modularization is inconsistent with both
+HTML 4.0 and XHTML 1.0 here.</li>
+
+<li>In the basic tables abstract module, the <code>table</code>
+element does not have a <code>width</code> attribute.  The XHTML Rec is
+ambiguous here: the abstract module has the attribute, but the DTD
+does not.</li>
+
+<li>The object and applet modules takes advantage of RELAX NG's
+absence of restrictions on mixed content to enforce the requirement
+that <code>param</code>s precede other content.</li>
+
+<li>The forms module takes advantage of RELAX NG's absence of
+restrictions on mixed content to enforce the requirement that any
+<code>legend</code> precedes other content.</li>
+
+<li>The RELAX NG schema does not enforce exclusions. The HTML 4 DTD
+uses exclusions in several places, for example, to disallow an
+<code>a</code> element from having an <code>a</code> element as a
+descendant. It is not possible to represent this constraint in XML
+DTDs. XHTML Modularization takes the approach of partially
+representing this restriction by, for example, disallowing an
+<code>a</code> element from having an <code>a</code> element as a
+<em>child</em>, without disallowing it from having an <code>a</code>
+element as a non-immediate descendant.  This partial restriction has a
+substantial cost in increasing the complexity and reducing the
+modularity of the schemas. This implementation adopts a different
+approach. The <a href="exclude"><code>exclude</code></a> directory
+contains separate, independent RELAX NG schemas that enforce
+exclusions.  To check use of exclusions, a document should be
+validated against each of these schemas that is applicable <strong>in
+addition to</strong> being validated against the RELAX NG XHTML schema
+proper. The available schemas are as follows:
+
+<dl>
+
+<dt><a href="exclude/basic.rng"><code>exclude/basic.rng</code></a></dt>
+<dd>checks the exclusions relating to <code>a</code> and
+<code>pre</code> elements</dd>
+
+<dt><a
+href="exclude/basic-table.rng"><code>exclude/basic-table.rng</code></a></dt>
+
+<dd>checks the exclusions relating to basic tables module (i.e.
+checks that <code>table</code> elements are not nested)</dd>
+
+<dt><a href="exclude/form.rng"><code>exclude/form.rng</code></a></dt>
+
+<dd>checks the exclusions relating to forms and basic forms modules</dd>
+
+</dl>
+
+</li>
+
+</ul>
+
+<address><a href="mailto:jjc@jclark.com">James Clark</a></address>
+
+</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/mozile/lib/xhtml/modules/applet.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/applet.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/applet.rng
new file mode 100755
index 0000000..22baa50
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/applet.rng
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Applet Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="applet">
+  <element name="applet">
+    <ref name="applet.attlist"/>
+    <!-- No restrictions on mixed content in TREX. -->
+    <zeroOrMore>
+      <ref name="param"/>
+    </zeroOrMore>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="applet.attlist">
+  <ref name="Core.attrib"/>
+  <attribute name="alt">
+    <ref name="Text.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="archive"/>
+  </optional>
+  <optional>
+    <attribute name="code"/>
+  </optional>
+  <optional>
+    <attribute name="codebase">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="object"/>
+  </optional>
+  <attribute name="height">
+    <ref name="Length.datatype"/>
+  </attribute>
+  <attribute name="width">
+    <ref name="Length.datatype"/>
+  </attribute>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="applet"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/attribs.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/attribs.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/attribs.rng
new file mode 100755
index 0000000..5fa3bfa
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/attribs.rng
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Common Attributes Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="id.attrib">
+  <optional>
+    <attribute name="id">
+      <ref name="ID.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="class.attrib">
+  <optional>
+    <attribute name="class">
+      <ref name="NMTOKENS.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="title.attrib">
+  <optional>
+    <attribute name="title">
+      <ref name="Text.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Core.attrib">
+  <ref name="id.attrib"/>
+  <ref name="class.attrib"/>
+  <ref name="title.attrib"/>
+</define>
+
+<define name="lang.attrib">
+  <optional>
+    <attribute name="xml:lang">
+      <ref name="LanguageCode.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="I18n.attrib">
+  <ref name="lang.attrib"/>
+</define>
+
+<define name="Common.attrib">
+  <ref name="Core.attrib"/>
+  <ref name="I18n.attrib"/>
+</define>
+
+<define name="CommonIdRequired.attrib">
+  <attribute name="id">
+    <ref name="ID.datatype"/>
+  </attribute>
+  <ref name="class.attrib"/>
+  <ref name="title.attrib"/>
+  <ref name="I18n.attrib"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/base.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/base.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/base.rng
new file mode 100755
index 0000000..c9ade45
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/base.rng
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Base Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="base">
+  <element name="base">
+    <ref name="base.attlist"/>
+  </element>
+</define>
+
+<define name="base.attlist">
+  <attribute name="href">
+    <ref name="URI.datatype"/>
+  </attribute>
+</define>
+
+<define name="head.content" combine="interleave">
+  <optional>
+    <ref name="base"/>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-form.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-form.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-form.rng
new file mode 100755
index 0000000..b8f8afb
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-form.rng
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Simplified Forms Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="form">
+  <element name="form">
+    <ref name="form.attlist"/>
+    <!-- Don't use Block.model, because this gets redefined by the
+	 legacy module. -->
+    <oneOrMore>
+      <ref name="Block.class"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="form.attlist">
+  <ref name="Common.attrib"/>
+  <attribute name="action">
+    <ref name="URI.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="method">
+      <choice>
+	<value>get</value>
+	<value>post</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="enctype">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="label">
+  <element name="label">
+    <ref name="label.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="label.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="for">
+      <ref name="IDREF.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="input">
+  <element name="input">
+    <ref name="input.attlist"/>
+  </element>
+</define>
+
+<define name="input.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="type">
+      <ref name="InputType.class"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="name"/>
+  </optional>
+  <optional>
+    <attribute name="value"/>
+  </optional>
+  <optional>
+    <attribute name="checked">
+      <value>checked</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="size"/>
+  </optional>
+  <optional>
+    <attribute name="maxlength">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="src">
+       <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="InputType.class">
+  <choice>
+    <value>text</value>
+    <value>password</value>
+    <value>checkbox</value>
+    <value>radio</value>
+    <value>submit</value>
+    <value>reset</value>
+    <value>hidden</value>
+  </choice>
+</define>
+
+<define name="select">
+  <element name="select">
+    <ref name="select.attlist"/>
+    <oneOrMore>
+      <ref name="option"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="select.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="name"/>
+  </optional>
+  <optional>
+    <attribute name="size">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="multiple">
+      <value>multiple</value>
+    </attribute>
+  </optional>
+</define>
+   
+<define name="option">
+  <element name="option">
+    <ref name="Common.attrib"/>
+    <optional>
+      <attribute name="selected">
+        <value>selected</value>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="value"/>
+    </optional>
+    <text/>
+  </element>
+</define>
+
+<define name="textarea">
+  <element name="textarea">
+    <ref name="textarea.attlist"/>
+  </element>
+</define>
+
+<define name="textarea.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="name"/>
+  </optional>
+  <attribute name="rows">
+    <ref name="Number.datatype"/>
+  </attribute>
+  <attribute name="cols">
+    <ref name="Number.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+  <text/>
+</define>
+
+<define name="Form.class">
+  <ref name="form"/>
+</define>
+
+<define name="Formctrl.class">
+  <choice>
+    <ref name="input"/>
+    <ref name="label"/>
+    <ref name="select"/>
+    <ref name="textarea"/>
+  </choice>
+</define>
+
+<define name="Block.class" combine="choice">
+  <ref name="Form.class"/>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="Formctrl.class"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-table.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-table.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-table.rng
new file mode 100755
index 0000000..db9a534
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/basic-table.rng
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Basic Tables Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="table">
+  <element name="table">
+    <ref name="table.attlist"/>
+    <optional>
+      <ref name="caption"/>
+    </optional>
+    <oneOrMore>
+      <ref name="tr"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="table.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="summary">
+      <ref name="Text.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="caption">
+  <element name="caption">
+    <ref name="caption.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="caption.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="tr">
+  <element name="tr">
+    <ref name="tr.attlist"/>
+    <oneOrMore>
+      <choice>
+        <ref name="th"/>
+        <ref name="td"/>
+      </choice>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="tr.attlist">
+  <ref name="Common.attrib"/>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="th">
+  <element name="th">
+    <ref name="th.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="th.attlist">
+  <ref name="Cell.attrib"/>
+</define>
+
+<define name="td">
+  <element name="td">
+    <ref name="td.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="td.attlist">
+  <ref name="Cell.attrib"/>
+</define>
+
+<define name="Cell.attrib">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="abbr">
+      <ref name="Text.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="axis"/>
+  </optional>
+  <optional>
+    <attribute name="headers">
+      <ref name="IDREFS.datatype"/>
+    </attribute>
+  </optional>
+  <ref name="scope.attrib"/>
+  <optional>
+    <attribute name="rowspan">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="colspan">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="CellHAlign.attrib">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>left</value>
+	<value>center</value>
+	<value>right</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="CellVAlign.attrib">
+  <optional>
+    <attribute name="valign">
+      <choice>
+	<value>top</value>
+	<value>middle</value>
+	<value>bottom</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="scope.attrib">
+  <optional>
+    <attribute name="scope">
+      <choice>
+	<value>row</value>
+	<value>col</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Block.class" combine="choice">
+  <ref name="table"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/bdo.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/bdo.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/bdo.rng
new file mode 100755
index 0000000..2742f3a
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/bdo.rng
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Bi-directional Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="bdo">
+  <element name="bdo">
+    <ref name="bdo.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="bdo.attlist">
+  <ref name="Core.attrib"/>
+  <ref name="lang.attrib"/>
+  <ref name="dir.attrib"/>
+</define>
+
+<define name="dir.attrib">
+  <attribute name="dir">
+    <choice>
+      <value>ltr</value>
+      <value>rtl</value>
+    </choice>
+  </attribute>
+</define>
+
+<define name="I18n.attrib" combine="interleave">
+  <optional>
+    <ref name="dir.attrib"/>
+  </optional>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="bdo"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/csismap.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/csismap.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/csismap.rng
new file mode 100755
index 0000000..7ad9833
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/csismap.rng
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Client-side Image Map Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="area">
+  <element name="area">
+    <ref name="area.attlist"/>
+  </element>
+</define>
+
+<define name="area.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="href">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <ref name="shape.attrib"/>
+  <ref name="coords.attrib"/>
+  <optional>
+    <attribute name="nohref">
+      <value>nohref</value>
+    </attribute>
+  </optional>
+  <attribute name="alt">
+    <ref name="Text.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="map">
+  <element name="map">
+    <ref name="map.attlist"/>
+    <oneOrMore>
+      <choice>
+        <!-- This does not use Block.mix
+             because loose.dtd doesn't use %Flow; -->
+        <ref name="Block.class"/>
+        <ref name="area"/>
+      </choice>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="map.attlist">
+  <ref name="CommonIdRequired.attrib"/>
+</define>
+
+<define name="a.attlist" combine="interleave">
+  <ref name="shape.attrib"/>
+  <ref name="coords.attrib"/>
+</define>
+
+<define name="img.attlist" combine="interleave">
+  <ref name="usemap.attlist"/>
+</define>
+
+<define name="object.attlist" combine="interleave">
+  <ref name="usemap.attlist"/>
+</define>
+
+<define name="usemap.attlist">
+  <optional>
+    <attribute name="usemap">
+      <ref name="IDREF.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="shape.attrib">
+  <optional>
+    <attribute name="shape">
+      <choice>
+        <value>rect</value>
+        <value>circle</value>
+        <value>poly</value>
+        <value>default</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="coords.attrib">
+  <optional>
+    <attribute name="coords"/>
+  </optional>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="map"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/datatypes.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/datatypes.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/datatypes.rng
new file mode 100755
index 0000000..d62631a
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/datatypes.rng
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Datatypes Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<define name="Length.datatype">
+  <text/>
+</define>
+
+<!-- space-separated list of link types -->
+<define name="LinkTypes.datatype">
+  <ref name="NMTOKENS.datatype"/>
+</define>
+
+<!-- single or comma-separated list of media descriptors -->
+<define name="MediaDesc.datatype">
+  <text/>
+</define>
+
+<!-- pixel, percentage, or relative -->
+<define name="MultiLength.datatype">
+  <text/>
+</define>
+
+<!-- one or more digits (NUMBER) -->
+<define name="Number.datatype">
+  <text/>
+</define>
+
+<!-- integer representing length in pixels -->
+<define name="Pixels.datatype">
+  <text/>
+</define>
+
+<!-- script expression -->
+<define name="Script.datatype">
+  <text/>
+</define>
+
+<!-- textual content -->
+<define name="Text.datatype">
+  <text/>
+</define>
+
+<!-- Imported Datatypes ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<define name="Character.datatype">
+  <text/>
+</define>
+
+<!-- a character encoding, as per [RFC2045] -->
+<define name="Charset.datatype">
+  <text/>
+</define>
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<define name="Charsets.datatype">
+  <text/>
+</define>
+
+<!-- media type, as per [RFC2045] -->
+<define name="ContentType.datatype">
+  <text/>
+</define>
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<define name="ContentTypes.datatype">
+  <text/>
+</define>
+
+<!-- date and time information. ISO date format -->
+<define name="Datetime.datatype">
+  <text/>
+</define>
+
+<!-- formal public identifier, as per [ISO8879] -->
+<define name="FPI.datatype">
+  <text/>
+</define>
+
+<!-- a language code, as per [RFC1766] -->
+<define name="LanguageCode.datatype">
+  <data type="language"/>
+</define>
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<define name="URI.datatype">
+  <data type="anyURI"/>
+</define>
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<define name="URIs.datatype">
+  <text/>
+</define>
+
+<define name="NMTOKEN.datatype">
+  <data type="NMTOKEN"/>
+</define>
+
+<define name="NMTOKENS.datatype">
+  <data type="NMTOKENS"/>
+</define>
+
+<define name="ID.datatype">
+  <data type="ID"/>
+</define>
+
+<define name="IDREF.datatype">
+  <data type="IDREF"/>
+</define>
+
+<define name="IDREFS.datatype">
+  <data type="IDREFS"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/edit.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/edit.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/edit.rng
new file mode 100755
index 0000000..ad98c89
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/edit.rng
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Edit Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="del">
+  <element name="del">
+    <ref name="del.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="del.attlist">
+  <ref name="Edit.attrib"/>
+</define>
+
+<define name="ins">
+  <element name="ins">
+    <ref name="ins.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="ins.attlist">
+  <ref name="Edit.attrib"/>
+</define>
+
+<define name="Edit.attrib">
+  <optional>
+    <attribute name="cite">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="datetime">
+      <ref name="Datetime.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Edit.class">
+  <choice>
+    <ref name="del"/>
+    <ref name="ins"/>
+  </choice>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="Edit.class"/>
+</define>
+
+<define name="Block.class" combine="choice">
+  <ref name="Edit.class"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/events.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/events.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/events.rng
new file mode 100755
index 0000000..e13432f
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/events.rng
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Events Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="a.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="area.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="form.attlist" combine="interleave">
+  <optional>
+    <attribute name="onreset">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onsubmit">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="body.attlist" combine="interleave">
+  <optional>
+    <attribute name="onload">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onunload">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="label.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="input.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onchange">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onselect">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="select.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onchange">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="textarea.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onchange">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onselect">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="button.attlist" combine="interleave">
+  <optional>
+    <attribute name="onblur">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onfocus">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Events.attrib">
+  <optional>
+    <attribute name="onclick">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="ondblclick">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onmousedown">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onmouseup">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onmouseover">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onmousemove">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onmouseout">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onkeypress">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onkeydown">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="onkeyup">
+      <ref name="Script.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Common.attrib" combine="interleave">
+  <ref name="Events.attrib"/>
+</define>
+
+<define name="CommonIdRequired.attrib" combine="interleave">
+  <ref name="Events.attrib"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/form.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/form.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/form.rng
new file mode 100755
index 0000000..3189678
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/form.rng
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Forms Module -->
+<!-- Unlike the DTD implementation, this builds on the basic-form module --><grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<include href="basic-form.rng">
+
+  <define name="select">
+    <element name="select">
+      <ref name="select.attlist"/>
+      <oneOrMore>
+	<choice>
+	  <ref name="option"/>
+	  <ref name="optgroup"/>
+	</choice>
+      </oneOrMore>
+    </element>
+  </define>
+
+</include>
+
+<define name="form.attlist" combine="interleave">
+  <optional>
+    <attribute name="accept-charset">
+      <ref name="Charsets.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accept">
+      <ref name="ContentTypes.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="input.attlist" combine="interleave">
+  <optional>
+    <attribute name="disabled">
+      <value>disabled</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="readonly">
+      <value>readonly</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="alt"/>
+  </optional>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accept">
+      <ref name="ContentTypes.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="InputType.class" combine="choice">
+  <choice>
+    <value>image</value>
+    <value>button</value>
+  </choice>
+</define>
+
+<define name="select.attlist" combine="interleave">
+  <optional>
+    <attribute name="disabled">
+      <value>disabled</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="option.attlist" combine="interleave">
+  <optional>
+    <attribute name="disabled">
+      <value>disabled</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="label">
+      <ref name="Text.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="optgroup">
+  <element name="optgroup">
+    <ref name="optgroup.attlist"/>
+    <oneOrMore>
+      <ref name="option"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="optgroup.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="disabled">
+      <value>disabled</value>
+    </attribute>
+  </optional>
+  <attribute name="label">
+    <ref name="Text.datatype"/>
+  </attribute>
+</define>
+
+<define name="textarea.attlist" combine="interleave">
+  <optional>
+    <attribute name="disabled">
+      <value>disabled</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="readonly">
+      <value>readonly</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="fieldset">
+  <element name="fieldset">
+    <ref name="fieldset.attlist"/>
+    <ref name="legend"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="fieldset.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="button">
+  <element name="button">
+    <ref name="button.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="button.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="name"/>
+  </optional>
+  <optional>
+    <attribute name="value"/>
+  </optional>
+  <optional>
+    <attribute name="type">
+      <choice>
+        <value>button</value>
+        <value>submit</value>
+        <value>reset</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="disabled">
+      <value>disabled</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="legend">
+  <element name="legend">
+    <ref name="legend.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="legend.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Form.class" combine="choice">
+  <ref name="fieldset"/>
+</define>
+
+<define name="Formctrl.class" combine="choice">
+  <ref name="button"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/frames.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/frames.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/frames.rng
new file mode 100755
index 0000000..7b97353
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/frames.rng
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Frames Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<include href="struct.rng">
+
+  <define name="html">
+    <element name="html">
+      <ref name="html.attlist"/>
+      <ref name="head"/>
+      <ref name="frameset"/>
+    </element>
+  </define>
+
+</include>
+
+<define name="frameset">
+  <element name="frameset">
+    <ref name="frameset.attlist"/>
+    <interleave>
+      <oneOrMore>
+	<choice>
+	  <ref name="frameset"/>
+	  <ref name="frame"/>
+	</choice>
+      </oneOrMore>
+      <optional>
+	<ref name="noframes"/>
+      </optional>
+    </interleave>
+  </element>
+</define>
+
+<define name="frameset.attlist">
+  <ref name="Core.attrib"/>
+  <optional>
+    <attribute name="cols">
+      <ref name="MultiLength.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="rows">
+      <ref name="MultiLength.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="frame">
+  <element name="frame">
+    <ref name="frame.attlist"/>
+  </element>
+</define>
+
+<define name="frame.attlist">
+  <ref name="Core.attrib"/>
+  <optional>
+    <attribute name="longdesc">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="src">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="frameborder">
+      <choice>
+        <value>1</value>
+        <value>0</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="marginwidth">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="marginheight">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="noresize">
+      <value>noresize</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="scrolling">
+      <choice>
+        <value>yes</value>
+        <value>no</value>
+        <value>auto</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="noframes">
+  <element name="noframes">
+    <ref name="noframes.attlist"/>
+    <ref name="body"/>
+  </element>
+</define>
+
+<define name="noframes.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/hypertext.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/hypertext.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/hypertext.rng
new file mode 100755
index 0000000..fb90d95
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/hypertext.rng
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Hypertext Module -->
+<!-- Depends on text module. -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="a">
+  <element name="a">
+    <ref name="a.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="a.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="href">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="charset">
+      <ref name="Charset.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="type">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="hreflang">
+      <ref name="LanguageCode.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="rel">
+      <ref name="LinkTypes.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="rev">
+      <ref name="LinkTypes.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="accesskey">
+      <ref name="Character.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="a"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/iframe.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/iframe.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/iframe.rng
new file mode 100755
index 0000000..3763854
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/iframe.rng
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Iframe Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="iframe">
+  <element name="iframe">
+    <ref name="iframe.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="iframe.attlist">
+  <ref name="Core.attrib"/>
+  <optional>
+    <attribute name="longdesc">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="src">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="frameborder">
+      <choice>
+        <value>1</value>
+        <value>0</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="height">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="marginwidth">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="marginheight">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="scrolling">
+      <choice>
+        <value>yes</value>
+        <value>no</value>
+        <value>auto</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="iframe"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/image.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/image.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/image.rng
new file mode 100755
index 0000000..1f313f6
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/image.rng
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Image Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="img">
+  <element name="img">
+    <ref name="img.attlist"/>
+  </element>
+</define>
+
+<define name="img.attlist">
+  <ref name="Common.attrib"/>
+  <attribute name="src">
+    <ref name="URI.datatype"/>
+  </attribute>
+  <attribute name="alt">
+    <ref name="Text.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="longdesc">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="height">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="img"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/inlstyle.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/inlstyle.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/inlstyle.rng
new file mode 100755
index 0000000..70d728a
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/inlstyle.rng
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Inline Style Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="Core.attrib" combine="interleave">
+  <optional>
+    <attribute name="style"/>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/legacy.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/legacy.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/legacy.rng
new file mode 100755
index 0000000..87a7205
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/legacy.rng
@@ -0,0 +1,502 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Legacy Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="lang.attrib" combine="interleave">
+  <optional>
+    <attribute name="lang">
+      <ref name="LanguageCode.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="basefont">
+  <element name="basefont">
+    <ref name="basefont.attlist"/>
+  </element>
+</define>
+
+<define name="basefont.attlist">
+  <ref name="id.attrib"/>
+  <ref name="Font.attrib"/>
+</define>
+
+<define name="center">
+  <element name="center">
+    <ref name="center.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="center.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="font">
+  <element name="font">
+    <ref name="font.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="font.attlist">
+  <ref name="Core.attrib"/>
+  <ref name="I18n.attrib"/>
+  <ref name="Font.attrib"/>
+</define>
+
+<define name="Font.attrib">
+  <optional>
+    <attribute name="size"/>
+  </optional>
+  <optional>
+    <attribute name="color">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="face"/>
+  </optional>
+</define>
+
+<define name="s">
+  <element name="s">
+    <ref name="s.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="s.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="strike">
+  <element name="strike">
+    <ref name="strike.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="strike.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="u">
+  <element name="u">
+    <ref name="u.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="u.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="dir">
+  <element name="dir">
+    <ref name="dir.attlist"/>
+    <oneOrMore>
+      <ref name="li.noblock"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="dir.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="compact">
+      <value>compact</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="menu">
+  <element name="menu">
+    <ref name="menu.attlist"/>
+    <oneOrMore>
+      <ref name="li.noblock"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="menu.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="compact">
+      <value>compact</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="li.noblock">
+  <element name="li">
+    <ref name="li.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="isindex">
+  <element name="isindex">
+    <ref name="isindex.attlist"/>
+  </element>
+</define>
+
+<define name="isindex.attlist">
+  <ref name="Core.attrib"/>
+  <ref name="I18n.attrib"/>
+  <optional>
+    <attribute name="prompt">
+      <ref name="Text.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="applet.attlist" combine="interleave">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>top</value>
+	<value>middle</value>
+	<value>bottom</value>
+	<value>left</value>
+	<value>right</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="hspace">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="vspace">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="body.attlist" combine="interleave">
+  <optional>
+    <attribute name="background">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="bgcolor">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="text">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="link">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="vlink">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="alink">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="br.attlist" combine="interleave">
+  <optional>
+    <attribute name="clear">
+      <choice>
+	<value>left</value>
+	<value>all</value>
+	<value>right</value>
+	<value>none</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="caption.attlist" combine="interleave">
+  <ref name="align.attrib"/>
+</define>
+
+<define name="div.attlist" combine="interleave">
+  <ref name="align.attrib"/>
+</define>
+
+<!-- Not in the CR, but surely an error. -->
+
+<define name="dl.attlist" combine="interleave">
+  <optional>
+    <attribute name="compact">
+      <value>compact</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Heading.attrib" combine="interleave">
+  <ref name="align.attrib"/>
+</define>
+
+<define name="hr.attlist" combine="interleave">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>left</value>
+	<value>center</value>
+	<value>right</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="noshade">
+      <value>noshade</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="size">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="img.attlist" combine="interleave">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>top</value>
+	<value>middle</value>
+	<value>bottom</value>
+	<value>left</value>
+	<value>right</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="border">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="hspace">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="vspace">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="input.attlist" combine="interleave">
+  <ref name="align.attrib"/>
+</define>
+
+<define name="legend.attlist" combine="interleave">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>top</value>
+	<value>bottom</value>
+	<value>left</value>
+	<value>right</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="li.attlist" combine="interleave">
+  <optional>
+    <attribute name="type"/>
+  </optional>
+  <optional>
+    <attribute name="value"/>
+  </optional>
+</define>
+
+<define name="object.attlist" combine="interleave">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>top</value>
+	<value>middle</value>
+	<value>bottom</value>
+	<value>left</value>
+	<value>right</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="border">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="hspace">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="vspace">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="ol.attlist" combine="interleave">
+  <optional>
+    <attribute name="type"/>
+  </optional>
+  <optional>
+    <attribute name="compact">
+      <value>compact</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="start"/>
+  </optional>
+</define>
+
+<define name="p.attlist" combine="interleave">
+  <ref name="align.attrib"/>
+</define>
+
+<define name="pre.attlist" combine="interleave">
+  <optional>
+    <attribute name="width">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="script.attlist" combine="interleave">
+  <optional>
+    <attribute name="language">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="table.attlist" combine="interleave">
+  <ref name="align.attrib"/>
+  <optional>
+    <attribute name="bgcolor">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="tr.attlist" combine="interleave">
+  <optional>
+    <attribute name="bgcolor">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Cell.attrib" combine="interleave">
+  <optional>
+    <attribute name="nowrap">
+      <value>nowrap</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="bgcolor">
+      <ref name="Color.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="height">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="ul.attlist" combine="interleave">
+  <optional>
+    <attribute name="type"/>
+  </optional>
+  <optional>
+    <attribute name="compact">
+      <value>compact</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="align.attrib">
+  <optional>
+    <attribute name="align">
+      <choice>
+	<value>left</value>
+	<value>all</value>
+	<value>right</value>
+	<value>none</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Color.datatype">
+  <text/>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <choice>
+    <ref name="font"/>
+    <ref name="basefont"/>
+    <ref name="s"/>
+    <ref name="strike"/>
+    <ref name="u"/>
+  </choice>
+</define>
+
+<define name="Block.class" combine="choice">
+  <choice>
+    <ref name="center"/>
+    <ref name="isindex"/>
+  </choice>
+</define>
+
+<define name="List.class" combine="choice">
+  <choice>
+    <ref name="dir"/>
+    <ref name="menu"/>
+  </choice>
+</define>
+
+<define name="head.content" combine="interleave">
+  <optional>
+    <ref name="isindex"/>
+  </optional>
+</define>
+
+<define name="Block.mix" combine="choice">
+  <choice>
+    <text/>
+    <ref name="Inline.class"/>
+  </choice>
+</define>
+
+<!-- With the legacy module and the frames modules, the html
+     element can contain either body or frameset. -->
+<define name="frameset" combine="choice">
+  <ref name="body"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/link.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/link.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/link.rng
new file mode 100755
index 0000000..3cce22d
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/link.rng
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Link Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="link">
+  <element name="link">
+    <ref name="link.attlist"/>
+  </element>
+</define>
+
+<define name="link.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="charset">
+      <ref name="Charset.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="href">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="hreflang">
+      <ref name="LanguageCode.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="type">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="rel">
+      <ref name="LinkTypes.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="rev">
+      <ref name="LinkTypes.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="media">
+      <ref name="MediaDesc.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="head.content" combine="interleave">
+  <zeroOrMore>
+    <ref name="link"/>
+  </zeroOrMore>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/list.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/list.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/list.rng
new file mode 100755
index 0000000..eb81c1c
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/list.rng
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- List Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="dl">
+  <element name="dl">
+    <ref name="dl.attlist"/>
+    <oneOrMore>
+      <choice>
+	<ref name="dt"/>
+	<ref name="dd"/>
+      </choice>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="dl.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="dt">
+  <element name="dt">
+    <ref name="dt.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="dt.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="dd">
+  <element name="dd">
+    <ref name="dd.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="dd.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="ol">
+  <element name="ol">
+    <ref name="ol.attlist"/>
+    <oneOrMore>
+      <ref name="li"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="ol.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="ul">
+  <element name="ul">
+    <ref name="ul.attlist"/>
+    <oneOrMore>
+      <ref name="li"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="ul.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="li">
+  <element name="li">
+    <ref name="li.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>  
+
+<define name="li.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="List.class">
+  <choice>
+    <ref name="ul"/>
+    <ref name="ol"/>
+    <ref name="dl"/>
+  </choice>
+</define>
+
+<define name="Block.class" combine="choice">
+  <ref name="List.class"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/meta.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/meta.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/meta.rng
new file mode 100755
index 0000000..fbccc94
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/meta.rng
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Meta Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="meta">
+  <element name="meta">
+    <ref name="meta.attlist"/>
+  </element>
+</define>
+
+<define name="meta.attlist">
+  <ref name="I18n.attrib"/>
+  <optional>
+    <attribute name="http-equiv">
+      <ref name="NMTOKEN.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="name">
+      <ref name="NMTOKEN.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="content"/>
+  </optional>
+  <optional>
+    <attribute name="scheme"/>
+  </optional>
+</define>
+
+<define name="head.content" combine="interleave">
+  <zeroOrMore>
+    <ref name="meta"/>
+  </zeroOrMore>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/nameident.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/nameident.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/nameident.rng
new file mode 100755
index 0000000..dcd8633
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/nameident.rng
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Name Identification Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="a.attlist" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="applet.attlist" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="form.attlist" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="frame.attrib" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="iframe.attlist" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="img.attlist" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="map.attlist" combine="interleave">
+  <ref name="name.attlist"/>
+</define>
+
+<define name="name.attlist">
+  <optional>
+    <attribute name="name"/>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/object.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/object.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/object.rng
new file mode 100755
index 0000000..3f5ef9a
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/object.rng
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Object Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="object">
+  <element name="object">
+    <ref name="object.attlist"/>
+    <!-- No restrictions on mixed content in TREX. -->
+    <zeroOrMore>
+      <ref name="param"/>
+    </zeroOrMore>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="object.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="declare">
+      <value>declare</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="classid">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="codebase">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="data">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="type">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="codetype">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="archive">
+      <ref name="URIs.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="standby">
+      <ref name="Text.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="height">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="name"/>
+  </optional>
+  <optional>
+    <attribute name="tabindex">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="object"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/param.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/param.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/param.rng
new file mode 100755
index 0000000..20a7a82
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/param.rng
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Param Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="param">
+  <element name="param">
+    <ref name="param.attlist"/>
+  </element>
+</define>
+
+<define name="param.attlist">
+  <ref name="id.attrib"/>
+  <attribute name="name"/>
+  <optional>
+    <attribute name="value"/>
+  </optional>
+  <optional>
+    <attribute name="valuetype">
+      <choice>
+	<value>data</value>
+	<value>ref</value>
+	<value>object</value>
+      </choice>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="type">
+      <ref name="ContentType.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/pres.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/pres.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/pres.rng
new file mode 100755
index 0000000..8526d16
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/pres.rng
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="hr">
+  <element name="hr">
+    <ref name="hr.attlist"/>
+  </element>
+</define>
+
+<define name="hr.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="Block.class" combine="choice">
+  <ref name="hr"/>
+</define>
+
+<define name="b">
+  <element name="b">
+    <ref name="b.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="b.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="big">
+  <element name="big">
+    <ref name="big.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="big.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="i">
+  <element name="i">
+    <ref name="i.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="i.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="small">
+  <element name="small">
+    <ref name="small.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="small.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="sub">
+  <element name="sub">
+    <ref name="sub.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="sub.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="sup">
+  <element name="sup">
+    <ref name="sup.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="sup.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="tt">
+  <element name="tt">
+    <ref name="tt.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="tt.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <choice>
+    <ref name="b"/>
+    <ref name="big"/>
+    <ref name="i"/>
+    <ref name="small"/>
+    <ref name="sub"/>
+    <ref name="sup"/>
+    <ref name="tt"/>
+  </choice>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ruby.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ruby.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ruby.rng
new file mode 100755
index 0000000..cc154a5
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ruby.rng
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="ruby">
+  <element name="ruby">
+    <ref name="ruby.attlist"/>
+    <choice>
+      <group>
+        <ref name="rb"/>
+        <choice>
+          <ref name="rt"/>
+          <group>
+            <ref name="rp"/>
+            <ref name="rt"/>
+            <ref name="rp"/>
+          </group>
+        </choice>
+      </group>
+      <group>
+        <ref name="rbc"/>
+        <ref name="rtc"/>
+        <optional>
+          <ref name="rtc"/>
+        </optional>
+      </group>
+    </choice>
+  </element>
+</define>
+
+<define name="ruby.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="rbc">
+  <element name="rbc">
+    <ref name="rbc.attlist"/>
+    <oneOrMore>
+      <ref name="rb"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="rbc.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="rtc">
+  <element name="rtc">
+    <ref name="rtc.attlist"/>
+    <oneOrMore>
+      <ref name="rt"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="rtc.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="rb">
+  <element name="rb">
+    <ref name="rb.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="rb.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="rt">
+  <element name="rt">
+    <ref name="rt.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="rt.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="rt">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="rp">
+  <element name="rp">
+    <ref name="rp.attlist"/>
+    <text/>
+  </element>
+</define>
+
+<define name="rp.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="ruby"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/script.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/script.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/script.rng
new file mode 100755
index 0000000..16c200a
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/script.rng
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Script Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="script">
+  <element name="script">
+    <ref name="script.attlist"/>
+    <text/>
+  </element>
+</define>
+
+<define name="script.attlist">
+  <optional>
+    <attribute name="charset">
+      <ref name="Charset.datatype"/>
+    </attribute>
+  </optional>
+  <attribute name="type">
+    <ref name="ContentType.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="src">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="defer">
+      <value>defer</value>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="xml:space">
+      <value>preserve</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="noscript">
+  <element name="noscript">
+    <ref name="noscript.attlist"/>
+    <ref name="Block.model"/>
+  </element>
+</define>
+
+<define name="noscript.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="head.content" combine="interleave">
+  <zeroOrMore>
+    <ref name="script"/>
+  </zeroOrMore>
+</define>
+
+<define name="Script.class">
+  <choice>
+    <ref name="noscript"/>
+    <ref name="script"/>
+  </choice>
+</define>
+
+<define name="Inline.class" combine="choice">
+  <ref name="Script.class"/>
+</define>
+
+<define name="Block.class" combine="choice">
+  <ref name="Script.class"/>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ssismap.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ssismap.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ssismap.rng
new file mode 100755
index 0000000..3aa9fce
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/ssismap.rng
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Server-side Image Map Module -->
+<!-- Depends on image module. -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="img.attlist" combine="interleave">
+  <optional>
+    <attribute name="ismap">
+      <value>ismap</value>
+    </attribute>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/struct.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/struct.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/struct.rng
new file mode 100755
index 0000000..98ff167
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/struct.rng
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Structure Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<start>
+  <ref name="html"/>
+</start>
+
+<define name="title">
+  <element name="title">
+    <ref name="title.attlist"/>
+    <text/>
+  </element>
+</define>
+
+<define name="title.attlist">
+  <ref name="I18n.attrib"/>
+</define>
+
+<define name="head">
+  <element name="head">
+    <ref name="head.attlist"/>
+    <ref name="head.content"/>
+  </element>
+</define>
+
+<define name="head.attlist">
+  <ref name="I18n.attrib"/>
+  <ref name="profile.attlist"/>
+</define>
+
+<define name="head.content">
+  <ref name="title"/>
+</define>
+
+<define name="profile.attlist">
+  <optional>
+    <attribute name="profile">
+      <ref name="URI.datatype"/>
+    </attribute>     
+  </optional>
+</define>
+
+<define name="body">
+  <element name="body">
+    <ref name="body.attlist"/>
+    <ref name="Block.model"/>
+  </element>
+</define>
+
+<define name="body.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="html">
+  <element name="html">
+    <ref name="html.attlist"/>
+    <ref name="head"/>
+    <ref name="body"/>
+  </element>
+</define>
+
+<define name="html.attlist">
+  <ref name="XHTML.version.attrib"/>
+  <ref name="I18n.attrib"/>
+</define>
+
+<define name="XHTML.version.attrib">
+  <optional>
+    <attribute name="version">
+      <ref name="FPI.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file


[21/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphnodeprovider/LICENSE
----------------------------------------------------------------------
diff --git a/platform/graphnodeprovider/LICENSE b/platform/graphnodeprovider/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/graphnodeprovider/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphnodeprovider/pom.xml
----------------------------------------------------------------------
diff --git a/platform/graphnodeprovider/pom.xml b/platform/graphnodeprovider/pom.xml
new file mode 100644
index 0000000..6bdc520
--- /dev/null
+++ b/platform/graphnodeprovider/pom.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <artifactId>platform.graphnodeprovider</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform GraphNodeProvider</name>
+    <description>A service that provided GraphNodes for URIs with as underlying BaseGraph sources considered
+    authoritative for that resource.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.users.core</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.usermanager</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.scala.utils</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>osgi.services</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.clerezza.ext</groupId>
+          <artifactId>slf4j-scala-api</artifactId>
+            <version>1.6.3</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <sourceDirectory>src/main/scala</sourceDirectory>
+        <testSourceDirectory>src/test/scala</testSourceDirectory>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
+                        <Export-Package>${project.groupId}.${project.artifactId}</Export-Package>
+                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <configuration>
+                    <downloadSources>true</downloadSources>
+                    <downloadJavadocs>true</downloadJavadocs>
+                    <buildcommands>
+                        <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
+                    </buildcommands>
+                    <additionalProjectnatures>
+                        <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
+                    </additionalProjectnatures>
+                    <classpathContainers>
+                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+                        </classpathContainer>
+                        <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER
+                        </classpathContainer>
+                    </classpathContainers>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.scala-tools</groupId>
+                <artifactId>maven-scala-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphnodeprovider/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/graphnodeprovider/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/graphnodeprovider/src/main/resources/OSGI-INF/serviceComponents.xml
new file mode 100644
index 0000000..7494186
--- /dev/null
+++ b/platform/graphnodeprovider/src/main/resources/OSGI-INF/serviceComponents.xml
@@ -0,0 +1,42 @@
+<?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.
+
+-->
+
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+
+    <scr:component enabled="true" name="org.apache.clerezza.platform.graphnodeprovider.PlatformGraphNodeProvider">
+        <implementation class="org.apache.clerezza.platform.graphnodeprovider.PlatformGraphNodeProvider"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider"/>
+        </service>
+        <reference name="tcManager" interface="org.apache.clerezza.rdf.core.access.TcManager"
+        cardinality="1..1" policy="static" bind="bindTcManager" unbind="unbindTcManager"/>
+        <reference name="platformConfig" interface="org.apache.clerezza.platform.config.PlatformConfig"
+        cardinality="1..1" policy="static" bind="bindPlatformConfig" unbind="unbindPlatformConfig"/>
+        <reference name="cggProvider" interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider"
+        cardinality="1..1" policy="static" bind="bindCgProvider" unbind="unbindCgProvider"/>
+        <reference name="webIdGraphsService" interface="org.apache.clerezza.platform.users.WebIdGraphsService"
+        cardinality="1..1" policy="static" bind="bindWebIdGraphsService" unbind="unbindWebIdGraphsService"/>
+        <reference name="userManager" interface="org.apache.clerezza.platform.usermanager.UserManager"
+        cardinality="1..1" policy="static" bind="bindUserManager" unbind="unbindUserManager"/>
+    </scr:component>
+
+</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphnodeprovider/src/main/scala/org/apache/clerezza/platform/graphnodeprovider/PlatformGraphNodeProvider.scala
----------------------------------------------------------------------
diff --git a/platform/graphnodeprovider/src/main/scala/org/apache/clerezza/platform/graphnodeprovider/PlatformGraphNodeProvider.scala b/platform/graphnodeprovider/src/main/scala/org/apache/clerezza/platform/graphnodeprovider/PlatformGraphNodeProvider.scala
new file mode 100644
index 0000000..e1b4630
--- /dev/null
+++ b/platform/graphnodeprovider/src/main/scala/org/apache/clerezza/platform/graphnodeprovider/PlatformGraphNodeProvider.scala
@@ -0,0 +1,245 @@
+package org.apache.clerezza.platform.graphnodeprovider
+
+/*
+ * 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 java.net.{HttpURLConnection, URL}
+import org.slf4j.scala._
+import org.apache.clerezza.rdf.core.access._
+import org.apache.clerezza.rdf.core._
+import org.apache.clerezza.platform.config.PlatformConfig
+import org.apache.clerezza.platform.Constants
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
+import org.apache.clerezza.platform.users.WebIdGraphsService
+import org.apache.clerezza.rdf.utils.{UnionMGraph, UriMutatingTripleCollection, GraphNode}
+import java.util.concurrent.locks.Lock
+import org.apache.clerezza.platform.usermanager.UserManager
+import java.security.{PrivilegedAction, AccessController}
+import org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider
+
+/**
+ * A service that returns a GraphNode for a specified named resource, the returned GraphNode has
+ * as BaseGraph the ContentGraph provided by the ContentGraphProvider and the for remote uris the
+ * Graphs they dereference to and for local URIs with a path-section starting with /user/{username}/
+ * the local-public-graph of that user.
+ */
+class PlatformGraphNodeProvider extends GraphNodeProvider with Logging {
+
+  /**
+   * Get a GraphNode for the specified resource, see class comments for details.
+   */
+  def get(uriRef: UriRef): GraphNode = {
+    val uriString = uriRef.getUnicodeString
+    val isLocal: Boolean = {
+      import scala.collection.JavaConversions._
+      //we assume all non http* uris to be local
+      !uriString.toLowerCase.startsWith("http") || platformConfig.getBaseUris.exists(baseUri => uriString.startsWith(baseUri.getUnicodeString))
+    }
+    get(uriRef, isLocal)
+  }
+
+  /**
+   * Get a GraphNode for the specified resource, The resource is assumed to be local, i.e. the method behaves like
+   * get(UriRef) for a Uri with an authority section contained in the Set retuned by
+   * <code>org.apache.clerezza.platform.config.PlatformConfig#getBaseUris()</code>
+   */
+  def getLocal(uriRef: UriRef): GraphNode = {
+    get(uriRef, true)
+  }
+    
+    
+    /**
+     *return true iff getLocal(uriRef).getNodeContext.size > 0
+     */
+    def existsLocal(uriRef: UriRef): Boolean = {
+        val cgGraph = cgProvider.getContentGraph
+        lazy val localInstanceUri = {
+            val uri = new java.net.URI(uriRef.getUnicodeString)
+      new UriRef(Constants.URN_LOCAL_INSTANCE + uri.getPath)
+    }
+        //TODO handle /user/
+        existsInGraph(uriRef,cgGraph) || existsInGraph(localInstanceUri, cgGraph)
+    }
+  
+    private[this] def existsInGraph(nodeUri: UriRef, tc: LockableMGraph): Boolean = {
+        var readLock: Lock = tc.getLock.readLock
+        readLock.lock
+        try {
+            return tc.filter(nodeUri, null, null).hasNext || tc.filter(null, null, nodeUri).hasNext
+        }
+        finally {
+            readLock.unlock
+        }
+    }
+    
+  
+  private def get(uriRef: UriRef, isLocal: Boolean): GraphNode = {
+    val uriString = uriRef.getUnicodeString
+    
+
+    val uriPath = {
+      val uri = new java.net.URI(uriString)
+      uri.getPath
+    }
+
+    lazy val uriPrefix = {
+      val uri = new java.net.URI(uriString)
+      uri.getScheme+"://"+uri.getAuthority
+    }
+
+    val anyHostUri = new UriRef(Constants.URN_LOCAL_INSTANCE + uriPath)
+
+    var mGraphs: List[TripleCollection] = Nil
+
+    def addToUnion(mGraph: LockableMGraph) {
+      //adding uncondinionately if (existsInGraph(uriRef, mGraph)) {
+      mGraphs ::= mGraph
+      //}
+      if (isLocal) {
+        if (existsInGraph(anyHostUri, mGraph)) {
+          mGraphs ::= new UriMutatingTripleCollection(mGraph, Constants.URN_LOCAL_INSTANCE, uriPrefix)
+        }
+      }
+    }
+
+    val cgGraph = cgProvider.getContentGraph
+
+    addToUnion(cgGraph)
+
+    if (isLocal && (uriPath != null) && uriPath.startsWith("/user/")) {
+      val nextSlash = uriPath.indexOf('/',6)    
+      if (nextSlash != -1) {
+        val userName = uriPath.substring(6, nextSlash)
+        val webIdOption = AccessController.doPrivileged(new PrivilegedAction[Option[UriRef]]() {
+            def run(): Option[UriRef] = {
+              val userNode: GraphNode = userManager.getUserInSystemGraph(userName)
+              if (userNode != null) {
+                userNode.getNode match {
+                  case u: UriRef => Some(u)
+                  case _ => None
+                }
+              } else {
+                None
+              }
+            }
+          }
+        )
+        webIdOption match {
+          case Some(u) => {
+            val webIdInfo = webIdGraphsService.getWebIdInfo(u)
+            addToUnion(webIdInfo.localPublicUserData)
+          }
+          case None => ;
+        }
+      }
+    }
+
+    if (!isLocal) {
+      /**
+       * As the resource might identify something other than a document we use this to find the redirect location
+       */
+      lazy val redirectLocationString = {
+        val acceptHeader = "application/rdf+xml,*/*;q.1"
+        val url = new URL(uriString)
+        val connection = url.openConnection()
+        connection match {
+          case hc : HttpURLConnection => {
+              hc.setRequestMethod("HEAD");
+              hc.setInstanceFollowRedirects(false)
+              hc.addRequestProperty("Accept",  acceptHeader)
+              hc.getResponseCode match {
+                case HttpURLConnection.HTTP_SEE_OTHER  => {
+                    val location = hc.getHeaderField("Location")
+                    if (location == null) {
+                      throw new RuntimeException("No Location Headers in 303 response")
+                    }
+                    location
+                  }
+                case _ => uriString
+              }
+            }
+          case _ => uriString
+        }
+      }
+
+      //TODO add method to WebProxy to get the graph location location
+      val graphUriString = {
+        val hashPos = uriString.indexOf('#')
+        if (hashPos != -1) {
+          uriString.substring(0, hashPos)
+        } else {
+          redirectLocationString
+        }
+      }
+      
+      addToUnion(tcManager.getMGraph(new UriRef(graphUriString)))
+    }
+
+    val unionMGraph = new UnionMGraph(mGraphs:_*);
+    new GraphNode(uriRef, unionMGraph)
+  }
+
+  private var tcManager: TcManager = null;
+
+  protected def bindTcManager(tcManager: TcManager) = {
+    this.tcManager = tcManager
+  }
+
+  protected def unbindTcManager(tcManager: TcManager) = {
+    this.tcManager = null
+  }
+
+  private var platformConfig: PlatformConfig = null;
+
+  protected def bindPlatformConfig(c: PlatformConfig) = {
+    this.platformConfig = c
+  }
+
+  protected def unbindPlatformConfig(c: PlatformConfig) = {
+    this.platformConfig = null
+  }
+
+  private var cgProvider: ContentGraphProvider = null
+  protected def bindCgProvider(p: ContentGraphProvider) {
+    this.cgProvider = p
+  }
+  protected def unbindCgProvider(p: ContentGraphProvider) {
+    this.cgProvider = null
+  }
+
+  private var webIdGraphsService: WebIdGraphsService = null
+  protected def bindWebIdGraphsService(webIdGraphsService: WebIdGraphsService): Unit = {
+    this.webIdGraphsService = webIdGraphsService
+  }
+
+  protected def unbindWebIdGraphsService(webIdGraphsService: WebIdGraphsService): Unit = {
+    this.webIdGraphsService = null
+  }
+
+  private var userManager: UserManager = null
+
+  protected def bindUserManager(userManager: UserManager): Unit = {
+    this.userManager = userManager
+  }
+
+  protected def unbindUserManager(userManager: UserManager): Unit = {
+    this.userManager = null
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphprovider.content/LICENSE
----------------------------------------------------------------------
diff --git a/platform/graphprovider.content/LICENSE b/platform/graphprovider.content/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/graphprovider.content/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphprovider.content/pom.xml
----------------------------------------------------------------------
diff --git a/platform/graphprovider.content/pom.xml b/platform/graphprovider.content/pom.xml
new file mode 100644
index 0000000..75daca2
--- /dev/null
+++ b/platform/graphprovider.content/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>clerezza</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.graphprovider.content</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Content-Graph Provider</name>
+    <description>A service that provides the content-graph</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <version>0.2</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/ContentGraphProvider.java
----------------------------------------------------------------------
diff --git a/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/ContentGraphProvider.java b/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/ContentGraphProvider.java
new file mode 100644
index 0000000..09c1d95
--- /dev/null
+++ b/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/ContentGraphProvider.java
@@ -0,0 +1,133 @@
+/*
+ * 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.graphprovider.content;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.apache.clerezza.platform.Constants;
+
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+
+/**
+ * A service providing a method to retrieve a <code>UnionGraph</code> containing
+ * the ContentGraph and additional graphs.
+ * 
+ * Over the Configuration Admin Service additional graphs can be added
+ * permanently. With the methods <code>addTemporaryAdditionGraph</code> and
+ * <code>removeTemporaryAdditionGraph</code> graphs can be added temporarily.
+ * Temporarily means that after restarting the org.apache.clerezza.platform.graphprovider.content
+ * bundle, these graphs will no longer be returned in the <code>UnionGraph</code>.
+ * 
+ * @scr.component
+ * @scr.service interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider"
+ * 
+ * @author rbn, mir
+ */
+public class ContentGraphProvider {
+
+
+    /**
+     * Service property header, which contains the URIs of additional
+     * <code>TripleCollection</code>s that are united as read-only to the Graph
+     * returned by <code>getContentGraph</code>
+     * 
+     * @scr.property name="additions" values.name="" description="Contains
+     *               additional TripleCollections that are added to the content
+     *               graph for reading"
+     */
+    public static final String CONTENT_ADDITIONS = "additions";
+
+    /**
+     * @scr.reference
+     */
+    private TcManager tcManager;
+
+
+
+    /**
+     * The URIs of the read-only addition-<code>TripleCollection</code>s
+     */
+    private UriRef[] additions;
+
+    private ReentrantReadWriteLock configLock = new ReentrantReadWriteLock();
+
+    protected void activate(ComponentContext context) {
+        GraphNameTransitioner.renameGraphsWithOldNames(tcManager);
+        try {
+            tcManager.getMGraph(Constants.CONTENT_GRAPH_URI);
+        } catch (NoSuchEntityException nsee) {
+            tcManager.createMGraph(Constants.CONTENT_GRAPH_URI);
+        }
+        String[] additionUriStrings = (String[]) context.getProperties().get(
+                CONTENT_ADDITIONS);
+        additions = new UriRef[additionUriStrings.length];
+        for (int i = 0; i < additionUriStrings.length; i++) {
+            additions[i] = new UriRef(additionUriStrings[i]);
+
+        }
+    }
+
+    public LockableMGraph getContentGraph() {
+        configLock.readLock().lock();
+        try {
+            TripleCollection[] united = new TripleCollection[additions.length + 1];
+            int i = 0;
+            united[i++] = tcManager.getMGraph(Constants.CONTENT_GRAPH_URI);
+            for (UriRef uriRef : additions) {
+                united[i++] = tcManager.getTriples(uriRef);
+            }
+            return new UnionMGraph(united);
+        } finally {
+            configLock.readLock().unlock();
+        }
+    }
+
+    public void addTemporaryAdditionGraph(UriRef graphName) {
+        configLock.writeLock().lock();
+        try {
+            Set<UriRef> additionsSet = new HashSet<UriRef>(Arrays
+                    .asList(additions));
+            additionsSet.add(graphName);
+            additions = additionsSet.toArray(new UriRef[additionsSet.size()]);
+        } finally {
+            configLock.writeLock().unlock();
+        }
+    }
+
+    public void removeTemporaryAdditionGraph(UriRef graphName) {
+        configLock.writeLock().lock();
+        try {
+            Set<UriRef> additionsSet = new HashSet<UriRef>(Arrays
+                    .asList(additions));
+            additionsSet.remove(graphName);
+            additions = additionsSet.toArray(new UriRef[additionsSet.size()]);
+        } finally {
+            configLock.writeLock().unlock();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/GraphNameTransitioner.java
----------------------------------------------------------------------
diff --git a/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/GraphNameTransitioner.java b/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/GraphNameTransitioner.java
new file mode 100644
index 0000000..80b904c
--- /dev/null
+++ b/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/GraphNameTransitioner.java
@@ -0,0 +1,95 @@
+/*
+ * 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.graphprovider.content;
+
+import org.apache.clerezza.platform.Constants;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * A utility class to rename used in snapshot versions to the naming in the first released version
+ *
+ * @author reto
+ */
+public class GraphNameTransitioner {
+
+    private final static Logger logger = LoggerFactory.getLogger(GraphNameTransitioner.class);
+
+    /**
+     * a hack to prevent double execution on the same start up process
+     */
+    private static boolean alreadyExecuted = false;
+
+    synchronized static public void renameGraphsWithOldNames(TcManager tcManager) {
+        if (alreadyExecuted) {
+            return;
+        } else {
+            alreadyExecuted = true;
+        }
+
+        /*try {
+            //just to see that nothing bad happens
+            Thread.sleep(20*1000);
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }*/
+
+        final String OLD_SYSTEM_GRAPH_URI_STRING =
+                "http://tpf.localhost/system.graph";
+        final UriRef OLD_SYSTEM_GRAPH_URI =
+                new UriRef(OLD_SYSTEM_GRAPH_URI_STRING);
+
+        final String OLD_CONFIG_GRAPH_URI_STRING =
+                "http://tpf.localhost/config.graph";
+        final UriRef OLD_CONFIG_GRAPH_URI =
+                new UriRef(OLD_CONFIG_GRAPH_URI_STRING);
+
+        final String OLD_CONTENT_GRAPH_URI_STRING =
+                "http://tpf.localhost/content.graph";
+        final UriRef OLD_CONTENT_GRAPH_URI =
+                new UriRef(OLD_CONTENT_GRAPH_URI_STRING);
+
+        renameGraphs(tcManager, OLD_SYSTEM_GRAPH_URI, Constants.SYSTEM_GRAPH_URI);
+        renameGraphs(tcManager, OLD_CONFIG_GRAPH_URI, Constants.CONFIG_GRAPH_URI);
+        renameGraphs(tcManager, OLD_CONTENT_GRAPH_URI, Constants.CONTENT_GRAPH_URI);
+        renameGraphs(tcManager, new UriRef("http://zz.localhost/graph-access.graph"),
+                new UriRef(Constants.URN_LOCAL_INSTANCE+"/graph-access.graph"));
+
+    }
+
+    private static void renameGraphs(TcManager tcManager, UriRef oldGraphUri, UriRef graphUri) {
+        try {
+            MGraph oldMGraph = tcManager.getMGraph(oldGraphUri);
+            MGraph newMGraph = tcManager.createMGraph(graphUri);
+            logger.info("renaming "+oldGraphUri+" to "+graphUri);
+            newMGraph.addAll(oldMGraph);
+            tcManager.deleteTripleCollection(oldGraphUri);
+        } catch (NoSuchEntityException ex) {
+        } catch (EntityAlreadyExistsException ex) {
+            logger.warn("could not rename " + oldGraphUri + " to " + 
+                    graphUri + " because target graph already exists", ex);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/TcPermissionDescriptionsProvider.java
----------------------------------------------------------------------
diff --git a/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/TcPermissionDescriptionsProvider.java b/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/TcPermissionDescriptionsProvider.java
new file mode 100644
index 0000000..9c6c85e
--- /dev/null
+++ b/platform/graphprovider.content/src/main/java/org/apache/clerezza/platform/graphprovider/content/TcPermissionDescriptionsProvider.java
@@ -0,0 +1,58 @@
+/*
+ * 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.graphprovider.content;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider;
+import org.apache.clerezza.permissiondescriptions.PermissionDescripton;
+import org.apache.clerezza.rdf.core.access.security.TcPermission;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ * <code>PermissionDescriptionsProvider</code> implementation that provides
+ * <code>PermissionDescripton</code>s of the <code>TcPermission</code>s used to
+ * access the content graph.
+ *
+ * @author mir
+ */
+@Component
+@Service(PermissionDescriptionsProvider.class)
+public class TcPermissionDescriptionsProvider implements PermissionDescriptionsProvider {
+
+    private static final Set<PermissionDescripton> GRAPH_ACCESS_PERMISSION_DESCRIPTIONS =
+            new HashSet<PermissionDescripton>();
+    static {
+        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Content Graph Read Permission",
+                "Grants permission to the user to read the content graph", null, TcPermission.class,
+                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/content.graph\" \"read\")"));
+
+        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Content Graph Read/Write Permission",
+                "Grants permission to the user to read and write the content graph", null, TcPermission.class,
+                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/content.graph\" \"readwrite\")"));
+
+    }
+
+    @Override
+    public Set<PermissionDescripton> getPermissionDescriptors() {
+        return GRAPH_ACCESS_PERMISSION_DESCRIPTIONS;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/LICENSE
----------------------------------------------------------------------
diff --git a/platform/language/LICENSE b/platform/language/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/language/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/LICENSE b/platform/language/platform.language.core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/language/platform.language.core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/pom.xml b/platform/language/platform.language.core/pom.xml
new file mode 100644
index 0000000..b1733f9
--- /dev/null
+++ b/platform/language/platform.language.core/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>platform.language</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.3</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.language.core</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Language Core</name>
+    <description>This bundles provides methods to manage languages in the Clerezza platform
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.language.ontologies</artifactId>
+            <version>0.3</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file


[03/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java b/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
deleted file mode 100644
index c58865c..0000000
--- a/platform/platform.content.representations/platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
+++ /dev/null
@@ -1,378 +0,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.
- */
-package org.apache.clerezza.platform.content.representations.core;
-
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.locks.Lock;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import org.apache.clerezza.jaxrs.utils.RedirectUtil;
-import org.apache.clerezza.platform.config.PlatformConfig;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.ontologies.DISCOBITS;
-import org.apache.clerezza.rdf.ontologies.EXIF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.felix.scr.annotations.Services;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This JAX-RS resource provides a method to retrieve the uri to
- * the thumbnail or a other small representation of a InfoDiscoBit.
- *
- * @author mir
- */
-@Component
-@Services({
-    @Service(Object.class),
-    @Service(ThumbnailService.class)
-})
-
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("thumbnail-service")
-public class ThumbnailService implements BundleListener {
-
-    @Reference
-    ContentGraphProvider cgProvider;
-    @Reference
-    PlatformConfig config;
-    @Reference
-    AlternativeRepresentationGenerator altRepGen;
-    private static final Logger log = LoggerFactory.getLogger(ThumbnailService.class);
-    private BundleContext bundleContext;
-    private String STATICWEB_PATH = "/CLEREZZA-INF/web-resources/style/";
-    private String MEDIA_TYPE_BASE_PATH = STATICWEB_PATH + "images/icons/mediatype/";
-    private Bundle cachedStyleBundle = null;
-    private Map<MediaType, String> mediaTypeIconUriCache =
-            Collections.synchronizedMap(new HashMap<MediaType, String>());
-
-    protected void activate(ComponentContext context) {
-        bundleContext = context.getBundleContext();
-        bundleContext.addBundleListener(this);
-    }
-
-    protected void deactivate(ComponentContext context) {
-        bundleContext.removeBundleListener(this);
-        bundleContext = null;
-        mediaTypeIconUriCache.clear();
-    }
-
-    /**
-     * Returns the thumbnail uri for a InfoDiscoBit which is located at the uri
-     * specified over the query parameter "uri". The thumbnails
-     * maximum width and height can optionally be specified over the query parameters
-     * "width" and "height". Futhermore there is the optional "exact" parameter,
-     * which specifies if the thumbnail must have the exact width and height as
-     * specified or not (default is "false"). If more than one acceptable thumbnail
-     * is available then the thumbnail uri of the thumbnail with the highest resolution
-     * (width * height) is returned. If no thumbnail is available and the logged
-     * in user has the write permission for the content graph, then an attempt is
-     * made to create the thumbnail on the fly. If this fails or the write permission
-     * is missing, then the uri of the icon representing the media type is returned.
-     * If also no media type icon is available the uri to default icon is returned.
-     *
-     * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail uri should
-     *        be returned
-     * @param height the maximum height that the thumbnail has
-     * @param width the maximum width that the thumbnail has
-     * @param exact boolean that specifies if the return thumbnail should have
-     *        the exact width and height.
-     * @return
-     */
-    @GET
-    public Response getThumbnailUri(@QueryParam("uri") UriRef infoBitUri,
-            @QueryParam("width") Integer width, @QueryParam("height") Integer height,
-            @DefaultValue("false") @QueryParam("exact") Boolean exact, @Context UriInfo uriInfo) {
-        return RedirectUtil.createSeeOtherResponse(
-                getThumbnailUri(infoBitUri, width, height, exact).getUnicodeString(), uriInfo);
-    }
-
-
-    /**
-     * Returns the thumbnail uri for a InfoDiscoBit which is located at the uri
-     * specified over the query parameter "uri". The thumbnails
-     * maximum width and height can optionally be specified over the query parameters
-     * "width" and "height". If more than one acceptable thumbnail is available
-     * then the thumbnail uri of the thumbnail with the highest resolution
-     * (width * height) is returned. If no thumbnail is available and the logged
-     * in user has the write permission for the content graph, then an attempt is
-     * made to create the thumbnail on the fly. If this fails or the write permission
-     * is missing, then the uri of the icon representing the media type is returned.
-     * If also no media type icon is available the uri to default icon is returned.
-     *
-     * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail uri should
-     *        be returned
-     * @param height the maximum height that the thumbnail has
-     * @param width the maximum width that the thumbnail has
-     * @return
-     */
-    public UriRef getThumbnailUri(UriRef infoBitUri, Integer width,  Integer height) {
-        return getThumbnailUri(infoBitUri, width, height, false);
-    }
-
-    /**
-     * Returns the thumbnail uri for a InfoDiscoBit which is located at the uri
-     * specified over the query parameter "uri". The thumbnails
-     * maximum width and height can optionally be specified over the query parameters
-     * "width" and "height". Futhermore there is the optional "exact" parameter,
-     * which specifies if the thumbnail must have the exact width and height as
-     * specified or not. If more than one acceptable thumbnail is available then
-     * the thumbnail uri of the thumbnail with the highest resolution (width * height)
-     * is returned. If no thumbnail is available and the logged in user has the write
-     * permission for the content graph, then an attempt is made to create the
-     * thumbnail on the fly. If this fails or the write permission is missing, then
-     * the uri of the icon representing the media type is returned. If also no
-     * media type icon is available the uri to default icon is returned.
-     *
-     * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail uri should
-     *        be returned
-     * @param height the maximum height that the thumbnail has
-     * @param width the maximum width that the thumbnail has
-     * @param exact boolean that specifies if the return thumbnail should have
-     *        the exact width and height.
-     * @return
-     */
-    public UriRef getThumbnailUri(UriRef infoBitUri, Integer width,  Integer height,
-            boolean exact) {
-        if ((width == null) && (height == null)) {
-            throw new IllegalArgumentException("height and/or width must be specified");
-        }
-        if (width == null) {
-            width = Integer.MAX_VALUE;
-        }
-        if (height == null) {
-            height = Integer.MAX_VALUE;
-        }
-        GraphNode infoBitNode = new GraphNode(infoBitUri, cgProvider.getContentGraph());
-        UriRef thumbnailUri = getGeneratedThumbnailUri(infoBitNode, width, height, exact);
-        if (thumbnailUri == null) {
-            Literal mediaTypeLiteral = null;
-            Lock readLock = infoBitNode.readLock();
-            readLock.lock();
-            try {
-                Iterator<Resource> mediaTypes = infoBitNode.getObjects(DISCOBITS.mediaType);
-                if (mediaTypes.hasNext()) {
-                    mediaTypeLiteral = (Literal) mediaTypes.next();
-                }
-            } finally {
-                readLock.unlock();
-            }
-            if (mediaTypeLiteral != null) {
-                MediaType mediaType = MediaType.valueOf(mediaTypeLiteral.getLexicalForm());
-                // if the infoBit is an image, create a thumbnail on the fly.
-                if (mediaType.getType().startsWith("image")) {
-                    try {
-                        thumbnailUri = altRepGen.generateAlternativeImage(infoBitNode, width,
-                                height, exact);
-                    } catch (Exception ex) {
-                        ex.printStackTrace();
-                        // Was worth a try. eLets go on
-                    }
-                }
-                if (thumbnailUri == null) {
-                    String iconUri = mediaTypeIconUriCache.get(mediaType);
-                    if (iconUri == null) {
-                        iconUri = getMediaTypeIconUri(mediaType);
-                        mediaTypeIconUriCache.put(mediaType, iconUri);
-                    }
-                    thumbnailUri = new UriRef(iconUri);
-                }
-            }
-        }
-        if (thumbnailUri == null) {
-            thumbnailUri = new UriRef(getDefaultIconUrl(getStyleBundle()));
-        }
-        return thumbnailUri;
-    }
-
-    private String getMediaTypeIconUri(MediaType mediaType) {
-        Bundle styleBundle = getStyleBundle();
-        if (styleBundle == null) {
-            throw new RuntimeException("no style bundle found");
-        }
-        String path = MEDIA_TYPE_BASE_PATH + mediaType.getType() + "/";
-        Enumeration entries = styleBundle.findEntries(path,
-                mediaType.getSubtype() + ".*", false);
-        String iconUri = createIconUri(entries);
-        if (iconUri != null) {
-            return iconUri;
-        }
-        entries = styleBundle.findEntries(path, "any.*", false);
-        iconUri = createIconUri(entries);
-        if (iconUri != null) {
-            return iconUri;
-        }
-        return getDefaultIconUrl(styleBundle);
-    }
-
-    private String getDefaultIconUrl(Bundle bundle) {
-        Enumeration entries = bundle.findEntries(MEDIA_TYPE_BASE_PATH, "any.*", false);
-        String iconUri = createIconUri(entries);
-        if (iconUri != null) {
-            return iconUri;
-        } else {
-            throw new RuntimeException("No default icon found");
-        }
-    }
-
-    private String createIconUri(Enumeration entries) {
-        if (entries != null && entries.hasMoreElements()) {
-            URL iconUrl = (URL) entries.nextElement();
-            return iconUrl.getPath().replace(STATICWEB_PATH, "style/");
-        }
-        return null;
-    }
-
-    private UriRef getGeneratedThumbnailUri(GraphNode infoBitNode,
-            Integer width, Integer height, boolean exact) {
-        if (isFittingImage(infoBitNode, width, height, exact)) {
-            return (UriRef) infoBitNode.getNode();
-        }
-        UriRef resultThumbnailUri = null;
-        int pixels = 0;
-        Lock readLock = infoBitNode.readLock();
-        readLock.lock();
-        try {
-            Iterator<Resource> thumbnails = infoBitNode.getObjects(DISCOBITS.thumbnail);
-            while (thumbnails.hasNext()) {
-                UriRef thumbnailUri = (UriRef) thumbnails.next();
-                GraphNode thumbnailNode = new GraphNode(thumbnailUri,
-                        cgProvider.getContentGraph());
-                int thumbnailPixels = getSurfaceSizeIfFitting(thumbnailNode, width, height, exact);
-                if (thumbnailPixels > pixels) {
-                    if (exact) {
-                        return thumbnailUri;
-                    }
-                    resultThumbnailUri = thumbnailUri;
-                    pixels = thumbnailPixels;
-                }
-            }
-        } finally {
-            readLock.unlock();
-        }
-        return resultThumbnailUri;
-    }
-
-    /**
-     * returns the surface in pixel if the image fits withing width and height,
-     * or -1 if it doesn't fit
-     */
-    private int getSurfaceSizeIfFitting(GraphNode infoBitNode, Integer width, Integer height,
-            boolean exact) {
-        Resource imageRes = infoBitNode.getNode();
-        if (imageRes instanceof UriRef) {
-            String imageUri = ((UriRef)imageRes).getUnicodeString();
-            if (!exact && imageUri.contains(AlternativeRepresentationGenerator.EXACT_APPENDIX)) {
-                return -1;
-            }
-        }        
-        Iterator<Resource> exifWidths = infoBitNode.getObjects(EXIF.width);
-        Iterator<Resource> exifHeights = infoBitNode.getObjects(EXIF.height);
-        if (!exifWidths.hasNext() || !exifHeights.hasNext()) {
-            log.warn(infoBitNode.getNode() + " doesn't have exif:width and exif:height");
-            return -1;
-        }
-        int thumbnailWidth = LiteralFactory.getInstance().createObject(
-                Integer.class, (TypedLiteral) exifWidths.next());
-        int thumbnailHeight = LiteralFactory.getInstance().createObject(
-                Integer.class, (TypedLiteral) exifHeights.next());
-        if (exact) {
-            if (thumbnailHeight == height && thumbnailWidth == width) {
-                return 1;
-            }
-        } else {
-            if (thumbnailHeight <= height && thumbnailWidth <= width) {
-                return thumbnailWidth * thumbnailHeight;
-            }
-        }
-        return -1;
-    }
-
-    /**
-     * returns true if infoBitNode is an image and fits
-     */
-    private boolean isFittingImage(GraphNode infoBitNode, Integer width, Integer height,
-            boolean exact) {
-        Lock readLock = infoBitNode.readLock();
-        readLock.lock();
-        try {
-            final Iterator<Literal> mediaTypesIter = infoBitNode.getLiterals(DISCOBITS.mediaType);
-            if (!mediaTypesIter.hasNext()) {
-                return false;
-            }
-            if (mediaTypesIter.next().getLexicalForm().startsWith("image")) {
-                return getSurfaceSizeIfFitting(infoBitNode, width, height, exact) > -1;
-            } else {
-                return false;
-            }
-        } finally {
-            readLock.unlock();
-        }
-    }
-
-    private synchronized Bundle getStyleBundle() {
-        if (cachedStyleBundle != null) {
-            return cachedStyleBundle;
-        }
-        Bundle[] bundles = bundleContext.getBundles();
-        for (Bundle bundle : bundles) {
-            URL staticWebPathURL = bundle.getEntry(STATICWEB_PATH);
-            if (staticWebPathURL != null) {
-                cachedStyleBundle = bundle;
-                return bundle;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public synchronized void bundleChanged(BundleEvent be) {
-        if (be.getType() == BundleEvent.UNINSTALLED
-                && be.getBundle().equals(cachedStyleBundle)) {
-            cachedStyleBundle = null;
-            cachedStyleBundle = getStyleBundle();
-            mediaTypeIconUriCache.clear();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.ontologies/LICENSE b/platform/platform.content.representations/platform.content.representations.ontologies/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content.representations/platform.content.representations.ontologies/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.ontologies/pom.xml b/platform/platform.content.representations/platform.content.representations.ontologies/pom.xml
deleted file mode 100644
index 41cfd94..0000000
--- a/platform/platform.content.representations/platform.content.representations.ontologies/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>platform.content.representations</artifactId>
-        <version>0.2</version>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content.representations.ontologies</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Content Representations Ontologies</name>
-    <description>
-        Representations Ontologies
-    </description>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.clerezza</groupId>
-                <artifactId>maven-ontologies-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>generate-sources</phase>
-                        <configuration>
-                            <resourcePath>${basedir}/src/main/resources</resourcePath>
-                            <sources>
-                                <source>${basedir}/target/generated-sources/main/java</source>
-                            </sources>
-                        </configuration>
-                        <goals>
-                            <goal>generate</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <version>0.4</version>
-        </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf b/platform/platform.content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf
deleted file mode 100644
index 01e604d..0000000
--- a/platform/platform.content.representations/platform.content.representations.ontologies/src/main/resources/org/apache/clerezza/platform/content/representations/ontologies/representations.rdf
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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.
-
--->
-
-<rdf:RDF
-	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-	xmlns:owl="http://www.w3.org/2002/07/owl#"
-	xmlns:dc="http://purl.org/dc/elements/1.1/"
-	xmlns:skos="http://www.w3.org/2008/05/skos#"
->
-
-<!-- Ontology -->
-
-<owl:Ontology rdf:about="http://clerezza.org/2009/12/representations#">
-	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
-	<dc:title xml:lang="en">
-		Clerezza Content Representations
-	</dc:title>
-</owl:Ontology>
-
-
-<!-- Properties -->
-
-<rdf:Property rdf:about="http://clerezza.org/2009/12/representations#isIconFor">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
-	<rdfs:label xml:lang="en">is icon for</rdfs:label>
-	<skos:definition xml:lang="en">Points to a string specifying the resource type for which the subject is an icon.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/12/representations#" />
-	<rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Image" />
-	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
-</rdf:Property>
-</rdf:RDF>
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content.representations/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content.representations/pom.xml b/platform/platform.content.representations/pom.xml
deleted file mode 100644
index 0327c26..0000000
--- a/platform/platform.content.representations/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content.representations</artifactId>
-    <packaging>pom</packaging>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Clerezza - Platform Content Representations</name>
-    <description>Provides services for creating and retrieving alternative representations of content.</description>
-    
-    <modules>
-        <module>platform.content.representations.ontologies</module>
-        <module>platform.content.representations.core</module>
-    </modules>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.content/LICENSE b/platform/platform.content/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.content/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.content/pom.xml b/platform/platform.content/pom.xml
deleted file mode 100644
index 0cb5e24..0000000
--- a/platform/platform.content/pom.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.content</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-
-    <name>Clerezza - Platform Content</name>
-    <description>Clerezza CMS - A handler to manage and access data modeled using
-    the discobits ontology</description>
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-             <artifactId>org.osgi.core</artifactId>
-         </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-             <artifactId>org.osgi.compendium</artifactId>
-         </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typehandlerspace</artifactId>
-            <version>0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.utils</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.ontologies</artifactId>
-            <version>0.12</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.graphprovider.content</artifactId>
-            <version>0.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.graphnodeprovider</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.seedsnipe</artifactId>
-            <version>0.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>web.fileserver</artifactId>
-            <exclusions>
-                <exclusion>
-                    <artifactId>javax.servlet</artifactId>
-                    <groupId>org.apache.felix</groupId>
-                </exclusion>
-            </exclusions>
-            <version>0.10</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wymiwyg</groupId>
-            <artifactId>wymiwyg-commons-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>jaxrs.utils</artifactId>
-            <version>0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.config</artifactId>
-            <version>0.4</version>
-        </dependency>
-    <!--    <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.security</artifactId>
-        </dependency> -->
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.scalaserverpages</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.metadata</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core.test</artifactId>
-            <scope>test</scope>
-            <version>0.15</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza.ext</groupId>
-            <artifactId>slf4j-scala-api</artifactId>
-            <version>1.6.3</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>net.sf.alchim</groupId>
-                <artifactId>yuicompressor-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java
deleted file mode 100644
index e605c40..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/AbstractDiscobitsHandler.java
+++ /dev/null
@@ -1,151 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import javax.ws.rs.core.MediaType;
-import org.apache.clerezza.platform.content.collections.CollectionCreator;
-
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.ontologies.DISCOBITS;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- * @author reto
- */
-public abstract class AbstractDiscobitsHandler implements DiscobitsHandler {
-
-    private static final Logger logger = LoggerFactory.getLogger(AbstractDiscobitsHandler.class);
-
-    /**
-     *
-     * @return the MGraph to be used to retrieve and create discobits
-     */
-    protected abstract MGraph getMGraph();
-
-    /**
-     * A <code>Set</code> containing <code>MetaDataGenerator</code>s to be used
-     * to add meta data to data putted by the handler.
-     *
-     * @return a Set containing meta data generators
-     */
-    protected abstract Set<MetaDataGenerator> getMetaDataGenerators();
-
-    
-    @Override
-    public void put(UriRef infoDiscoBitUri, MediaType mediaType,
-            byte[] data) {
-
-        GraphNode infoDiscoBitNode;
-        final LockableMGraph mGraph = (LockableMGraph) getMGraph();
-        infoDiscoBitNode = new GraphNode(infoDiscoBitUri, mGraph);
-        CollectionCreator collectionCreator = new CollectionCreator(mGraph);
-        collectionCreator.createContainingCollections(infoDiscoBitUri);
-        Lock writeLock = mGraph.getLock().writeLock();
-        writeLock.lock();
-        try {
-            infoDiscoBitNode.addProperty(RDF.type, DISCOBITS.InfoDiscoBit);
-            TypedLiteral dataLiteral = LiteralFactory.getInstance().createTypedLiteral(data);
-            infoDiscoBitNode.deleteProperties(DISCOBITS.infoBit);
-            infoDiscoBitNode.addProperty(DISCOBITS.infoBit, dataLiteral);
-            TypedLiteral mediaTypeLiteral = LiteralFactory.getInstance().createTypedLiteral(mediaType.toString());
-            infoDiscoBitNode.deleteProperties(DISCOBITS.mediaType);
-            infoDiscoBitNode.addProperty(DISCOBITS.mediaType,mediaTypeLiteral);
-        } finally {
-            writeLock.unlock();
-        }
-        Set<MetaDataGenerator> metaDataGenerators = getMetaDataGenerators();
-        synchronized(metaDataGenerators) {
-            for(MetaDataGenerator generator : metaDataGenerators) {
-                try {
-                    generator.generate(infoDiscoBitNode, data, mediaType);
-                } catch (RuntimeException ex) {
-                    logger.error("Exception in MetaDataGenerator ", ex);
-                }
-            }
-        }
-    }
-
-    @Override
-    public  void remove(NonLiteral node) {
-        MGraph mGraph = getMGraph();        
-        Iterator<Triple> properties = mGraph.filter(node, null, null);
-        //copying properties to set, as we're modifying underlying graph
-        Set<Triple> propertiesSet = new HashSet<Triple>();
-        while (properties.hasNext()) {
-            propertiesSet.add(properties.next());
-        }
-        properties = propertiesSet.iterator();
-        while (properties.hasNext()) {
-            Triple triple = properties.next();
-            UriRef predicate = triple.getPredicate();
-            if (predicate.equals(DISCOBITS.contains)) {
-                try {
-                    GraphNode containedNode = new GraphNode((NonLiteral)triple.getObject(), mGraph);
-                    //The following includes triple
-                    containedNode.deleteNodeContext();
-                } catch (ClassCastException e) {
-                    throw new RuntimeException("The value of "+predicate+" is expected not to be a literal");
-                }
-                //as some other properties of node could have been in the context of the object
-                remove(node);
-                return;
-            }            
-        }
-        GraphNode graphNode = new GraphNode(node, mGraph);
-        graphNode.deleteNodeContext();
-    }
-
-    @Override
-    public byte[] getData(UriRef uriRef) {
-        MGraph mGraph = getMGraph();
-        GraphNode node = new GraphNode(uriRef, mGraph);
-        final InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(node);
-        if (infoDiscobit == null) {
-            return null;
-        }
-        return infoDiscobit.getData();
-    }
-
-    @Override
-    public MediaType getMediaType(UriRef uriRef) {
-        MGraph mGraph = getMGraph();
-        GraphNode node = new GraphNode(uriRef, mGraph);
-        final InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(node);
-        if (infoDiscobit == null) {
-            return null;
-        }
-        return MediaType.valueOf(infoDiscobit.getContentType());
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java
deleted file mode 100644
index 5bcf1af..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/CollectionTypeHandler.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland).
- * 
- * Licensed 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;
-
-import java.net.URL;
-import java.util.Map;
-import javax.ws.rs.GET;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.clerezza.platform.content.WebDavUtils.PropertyMap;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.clerezza.platform.content.webdav.COPY;
-import org.apache.clerezza.platform.content.webdav.LOCK;
-import org.apache.clerezza.platform.content.webdav.UNLOCK;
-import org.apache.clerezza.platform.typehandlerspace.SupportedTypes;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.ontologies.HIERARCHY;
-import org.apache.clerezza.rdf.ontologies.PLATFORM;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.utils.UnionMGraph;
-import org.apache.felix.scr.annotations.Services;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * Provides HTTP Methods for WebDav
- * 
- * @author ali
- */
-
-@Component
-@Services({
-    @Service(Object.class),
-    @Service(CollectionTypeHandler.class)
-})
-@Property(name = "org.apache.clerezza.platform.typehandler", boolValue = true)
-@SupportedTypes(types = { "http://clerezza.org/2009/09/hierarchy#Collection" }, prioritize = true)
-public class CollectionTypeHandler extends DiscobitsTypeHandler{
-
-    private Logger logger = LoggerFactory.getLogger(CollectionTypeHandler.class);
-    
-    @Reference
-    private RenderletManager renderletManager;
-
-    /**
-     * The activate method is called when SCR activates the component configuration.
-     * This method gets the system graph or create a new one if it doesn't exist.
-     *
-     * @param componentContext
-     */
-    protected void activate(ComponentContext componentContext) {
-        URL templateURL = getClass().getResource("collection.ssp");
-        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
-                new UriRef(templateURL.toString()), HIERARCHY.Collection,
-                "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        logger.info("CollectionTypeHandler activated.");
-    }
-
-    /**
-     * Returns a GraphNode of the requested collection
-     * @return 
-     */
-    @GET
-    @Override
-    public GraphNode getResource(@Context UriInfo uriInfo) {
-        final MGraph contentGraph = cgProvider.getContentGraph();
-        final String uriString = uriInfo.getAbsolutePath().toString();
-        final UriRef indexUri = new UriRef(uriString+"index");
-        if (contentGraph.filter(indexUri, null, null).hasNext()) {
-            return new GraphNode(indexUri, contentGraph);
-        }
-        final UriRef uri = new UriRef(uriString);
-        MGraph mGraph = new UnionMGraph(new SimpleMGraph(), contentGraph);
-        final GraphNode graphNode = new GraphNode(uri, mGraph);
-        graphNode.addProperty(RDF.type, PLATFORM.HeadedPage);
-
-        UriRef collectionUri = new UriRef(uriInfo.getAbsolutePath().toString());
-        return graphNode;
-    }
-
-    @Override
-    Map<UriRef, PropertyMap> getPropNames(GraphNode node, String depthHeader) {
-        return WebDavUtils.getCollectionProps(null, null, null, node,
-                            depthHeader, false /* doesNotIncludeValues */);
-    }
-
-    @Override
-    Map<UriRef, PropertyMap> getPropsByName(Node requestNode, GraphNode node,
-            String depthHeader) {
-        Map<UriRef, PropertyMap> result;
-        NodeList children = requestNode.getChildNodes();
-        result = WebDavUtils.getPropsByName(children, node, depthHeader,
-                true /* includeValues */);
-        return result;
-    }
-
-    @Override
-    Map<UriRef, PropertyMap> getAllProps(GraphNode node, String depthHeader) {
-        return WebDavUtils.getCollectionProps(null, null, null, node,
-                            depthHeader, true /* includeValues */);
-    }
-
-    /*-----------------------*
-     * Not Supported Methods * 
-     *-----------------------*/
-    
-    /**
-     * Locks a resource
-     *
-     * @return returns a 501 Not Implemented response
-     */
-    @LOCK
-    public Object lock() {
-        return Response.status(501/* Not Implemented */).build();
-    }
-
-    /**
-     * Unlocks a resource
-     *
-     * @return returns a 501 Not Implemented response
-     */
-    @UNLOCK
-    public Object unlock() {
-        return Response.status(501/* Not Implemented */).build();
-    }
-
-    /**
-     * Copies a resource
-     *
-     * @return returns a 501 Not Implemented response
-     */
-    @COPY
-    public Object copy() {
-        return Response.status(501/* Not Implemented */).build();
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java
deleted file mode 100644
index 6a7db15..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/ContentPostSupport.java
+++ /dev/null
@@ -1,98 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-
-import java.net.URI;
-import java.util.concurrent.locks.Lock;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.clerezza.jaxrs.utils.form.FormFile;
-import org.apache.clerezza.jaxrs.utils.form.MultiPartBody;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-
-/**
- * This Jax-rs root resource provides a method to post content to the content
- * graph
- *
- * @author mir
- */
-@Component
-@Service(Object.class)
-@Property(name="javax.ws.rs", boolValue=true)
-@Path("content")
-public class ContentPostSupport {
-    
-    @Reference
-    private DiscobitsHandler handler;
-
-    @Reference
-    private ContentGraphProvider cgProvider;
-
-    /**
-     * Creates an InfoDiscoBt (aka Binary Content) in the content graph.<br/>
-     * This JAX-RS method is available under the path "content". It requires
-     * a multipart/form-data with two fields: "content", which is the content of the
-     * InfoDiscobit to be created and "uri" which is the uri of the new
-     * InfoDiscoBit.
-     *
-     * @param form
-     * @return Returns a Created (201) response, if the info bit was successfully
-     * uploaded. Returns Bad Request (400) response, if required form fields are
-     * missing. Returns a Conflict (409) response, if at the specified URI a
-     * resource already exists.
-     */
-    @POST
-    @Consumes("multipart/form-data")
-    public Response postContent(MultiPartBody form) {
-        FormFile formFile = form.getFormFileParameterValues("content")[0];
-        String uri = form.getTextParameterValues("uri")[0];
-        byte[] content = formFile.getContent();
-        if (content == null || uri == null) {
-            return Response.status(400).entity("Required form field is missing").
-                    type(MediaType.TEXT_PLAIN_TYPE).build();
-        }
-        LockableMGraph contentGraph = cgProvider.getContentGraph();
-        Lock readLock = contentGraph.getLock().readLock();
-        readLock.lock();
-        try {
-            if (contentGraph.filter(new UriRef(uri), RDF.type, null).hasNext()) {
-                return Response.status(Response.Status.CONFLICT).
-                        entity("A resource with the specified URI already exists").
-                        type(MediaType.TEXT_PLAIN_TYPE).build();
-            }
-        } finally {
-            readLock.unlock();
-        }
-        handler.put(new UriRef(uri), formFile.getMediaType(), content);
-        return Response.created(URI.create(uri)).build();
-    }    
-    
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java
deleted file mode 100644
index 3b45d62..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitTemplating.java
+++ /dev/null
@@ -1,77 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-
-
-import javax.ws.rs.core.MediaType;
-
-import org.osgi.service.component.ComponentContext;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.platform.typerendering.seedsnipe.SeedsnipeRenderlet;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.ontologies.DISCOBITS;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-
-/**
- *
- * @author tio
- */
-@Component(immediate = true)
-public class DiscobitTemplating {
-
-    @Reference
-    RenderletManager renderletManager;
-
-    protected void activate(ComponentContext context) {
-
-        // register seedsnipe renderlets
-        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
-                new UriRef(getClass().getResource("Resource.xhtml").toString()),
-                RDFS.Resource, null, MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
-                new UriRef(getClass().getResource("Resource_naked.xhtml").toString()),
-                RDFS.Resource, "(naked|.*-naked)", MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
-                new UriRef(getClass().getResource("XHTML_InfoDiscoBit_naked.xhtml").toString()),
-                DISCOBITS.XHTMLInfoDiscoBit, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
-                new UriRef(getClass().getResource("OrderedContent_naked.xhtml").toString()),
-                DISCOBITS.OrderedContent, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
-                new UriRef(getClass().getResource("TitledContent.xhtml").toString()),
-                DISCOBITS.TitledContent, null, MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        renderletManager.registerRenderlet(TitledContentRenderlet.class.getName(),
-                null, DISCOBITS.TitledContent, "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        // registre renderlet for XMLLiteral datatype.
-        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
-                new UriRef(getClass().getResource("XmlLiteral.ssp").toString()),
-                new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"), null,
-                MediaType.APPLICATION_XHTML_XML_TYPE, true);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java
----------------------------------------------------------------------
diff --git a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java b/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java
deleted file mode 100644
index 2e3e441..0000000
--- a/platform/platform.content/src/main/java/org/apache/clerezza/platform/content/DiscobitsHandler.java
+++ /dev/null
@@ -1,70 +0,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.
- */
-package org.apache.clerezza.platform.content;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-
-/**
- * Provides utility methods to create, retrieve and remove binary contents.
- * Binary contents are modeled as InfoDiscoBit from the discobit ontology at
- * http://discobits.org/ontology
- *
- * @author rbn
- */
-public interface DiscobitsHandler {
-
-    /**
-     * Creates an InfoDiscoBit
-     * 
-     * @param infoDiscoBitUri
-     * @param mediaType
-     * @param data
-     */
-    public abstract void put(UriRef infoDiscoBitUri, MediaType mediaType,
-            byte[] data);
-
-    /**
-     * Removes InfoDiscoBits (aka binary contents), other DiscoBits and
-     * the context of the specified node. If it is in a hierarchy then it
-     * will be removed also form its container.
-     * 
-     * @param node
-     */
-    public abstract void remove(NonLiteral node);
-
-    /**
-     * 
-     * @param uriRef
-     * @return the media type of the InfoDiscoBit with the specified URI or null
-     *         if no MediaType for that URI is known
-     */
-    public MediaType getMediaType(UriRef uriRef);
-
-    /**
-     * 
-     * @param uriRef
-     * @return a byte[] with the data of the InfoDiscoBit with the specified URI
-     *         or null if no data for that URI is known
-     */
-    public byte[] getData(UriRef uriRef);
-
-}
\ No newline at end of file


[08/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
deleted file mode 100644
index 7932829..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
+++ /dev/null
@@ -1,102 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.util.Iterator;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.ontologies.SKOS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-/**
- * This class stores description of concepts resulted from searches
- * performed by {@link RemoteConceptProvider}s.
- *
- * @author hasan
- */
-public class RemoteConceptsDescriptionManager {
-
-    private UriRef REMOTE_CONCEPTS_DESCRIPTION_MGRAPH =
-            new UriRef("urn:x-localinstance:/remote.concepts.description");
-
-    /**
-     * Stores SKOS:prefLabel and RDFS.comment of concepts available in the
-     * specified Graph.
-     *
-     * @param graph
-     *        the Graph which contains concepts and their descriptions.
-     */
-    void storeConceptsDescription(Graph graph) {
-        MGraph remoteConceptsDescriptionMGraph =
-                getRemoteConceptsDescriptionMGraph();
-
-        Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
-        while (concepts.hasNext()) {
-            UriRef concept = (UriRef) concepts.next().getSubject();
-            copyConceptDescription(new GraphNode(concept, graph),
-                    new GraphNode(concept, remoteConceptsDescriptionMGraph));
-        }
-    }
-
-    /**
-     * This method creates an {@link MGraph} to store concepts' descriptions
-     * if this graph does not already exist.
-     *
-     * @return
-     *        an {@link MGraph}
-     */
-    public MGraph getRemoteConceptsDescriptionMGraph() {
-        MGraph remoteConceptsDescriptionMGraph = null;
-        TcManager tcManager = TcManager.getInstance();
-        try {
-            remoteConceptsDescriptionMGraph =
-                    tcManager.getMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH);
-        } catch (NoSuchEntityException nsee) {
-            remoteConceptsDescriptionMGraph =
-                    tcManager.createMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH);
-        }
-        return remoteConceptsDescriptionMGraph;
-    }
-
-    private void copyConceptDescription(GraphNode sourceGraphNode,
-            GraphNode destinationGraphNode) {
-
-        destinationGraphNode.deleteNodeContext();
-
-        Iterator<Literal> prefLabelStatements =
-                sourceGraphNode.getLiterals(SKOS.prefLabel);
-        if (prefLabelStatements.hasNext()) {
-            destinationGraphNode.addProperty(SKOS.prefLabel,
-                    prefLabelStatements.next());
-        }
-        Iterator<Literal> commentStatements =
-                sourceGraphNode.getLiterals(RDFS.comment);
-        while (commentStatements.hasNext()) {
-            destinationGraphNode.addProperty(RDFS.comment,
-                    commentStatements.next());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
deleted file mode 100644
index 3bff348..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
+++ /dev/null
@@ -1,131 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.clerezza.jaxrs.utils.RedirectUtil;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesService;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.ontologies.DCTERMS;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * This JAX-RS resource can be used for adding concepts to a resource.
- *
- * The URI path of this service is /concepts/tagger.
- *
- * @author tio
- */
-@Component
-@Service(Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/tagger/")
-public class ResourceTagger {
-
-    @Reference
-    protected ContentGraphProvider cgProvider;
-    @Reference
-    private ScalaServerPagesService scalaServerPagesService;
-
-    protected void activate(ComponentContext context)
-            throws URISyntaxException {
-
-        BundleContext bundleContext = context.getBundleContext();
-        URL template = getClass().getResource("concept-existing-subjects.ssp");
-
-        scalaServerPagesService.registerScalaServerPage(
-                template,
-                RDFS.Resource, "concept-existing-subjects-naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-
-        template = getClass().getResource("concept-tagging.ssp");
-        scalaServerPagesService.registerScalaServerPage(
-                template,
-                RDFS.Resource, "concept-tagging-naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-
-        template = getClass().getResource("concept-find-create.ssp");
-        scalaServerPagesService.registerScalaServerPage(
-                template,
-                RDFS.Resource, "concept-find-create-naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-
-        template = getClass().getResource("selected-concepts.ssp");
-        scalaServerPagesService.registerScalaServerPage(
-                template,
-                RDFS.Resource, "selectedconcepts-naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-    }
-
-    /**
-     * Adds concepts to a resource. If parameters uri and
-     * concepts are not defined a response with code BAD_REQUEST is returned. If
-     * the relation is succefully added a redirect to /concepts/generic-resource with
-     * the UriRef of the resource as parameter.
-     *
-     * @param uri specifies the uri of a resource
-     * @param concepts specifies a list of concept uris.
-     *
-     * @return
-     *        A Response
-     */
-    @POST
-    @Path("set")
-    public Response updateConcepts(@FormParam("uri") UriRef uri,
-            @FormParam("concepts") List<String> concepts,
-            @Context UriInfo uriInfo) {
-
-        
-        if (uri != null) {
-            GraphNode node = new GraphNode(uri, cgProvider.getContentGraph());
-            node.deleteProperties(DCTERMS.subject);
-            if(concepts != null) {
-                for (String subject : concepts) {
-                    node.addProperty(DCTERMS.subject, new UriRef(subject));
-                }
-            }
-        } else {
-            throw new WebApplicationException(Response.status(
-                    Status.BAD_REQUEST).entity("No resource uri defined.").build());
-        }
-        return RedirectUtil.createSeeOtherResponse("/concepts/generic-resource?uri=" +
-                uri.getUnicodeString(), uriInfo);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
deleted file mode 100644
index 98ee7cc..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
+++ /dev/null
@@ -1,319 +0,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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.UriInfo;
-import org.apache.clerezza.jaxrs.utils.TrailingSlash;
-import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.access.security.TcPermission;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.PLATFORM;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.utils.RdfList;
-import org.apache.clerezza.rdf.utils.UnionMGraph;
-import org.apache.felix.scr.annotations.Services;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * This service manages concept providers. Concept providers are prioritized.
- *
- * The URI path of this service is /concepts/provider-manager.
- *
- * @author hasan, tio
- */
-@Component
-@Services({
-    @Service(Object.class),
-    @Service(ConceptProviderManager.class),
-    @Service(GlobalMenuItemsProvider.class)
-})
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/provider-manager")
-public class SimpleConceptProviderManager implements ConceptProviderManager,
-        GlobalMenuItemsProvider {
-
-    @Reference
-    private TcManager tcManager;
-
-    @Reference
-    protected ContentGraphProvider cgProvider;
-
-    @Reference
-    private RenderletManager renderletManager;
-
-    private List<ConceptProvider> conceptProviderList =
-            new ArrayList<ConceptProvider>();
-
-    /**
-     * The activate method is called when SCR activates the component
-     * configuration. 
-     * 
-     * @param context
-     * @throws IOException
-     * @throws URISyntaxException
-     */
-    protected void activate(ComponentContext context)
-            throws IOException,
-            URISyntaxException {
-
-        URL template = getClass().getResource("manage-concept-providers-page.ssp");
-        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
-                new UriRef(template.toURI().toString()),
-                CONCEPTS.ManageConceptProvidersPage, "naked",
-                MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
-        instantiateConceptProviders();
-    }
-
-    protected void deactivate(ComponentContext context) {
-        conceptProviderList.clear();
-    }
-
-    private void instantiateConceptProviders() {
-        conceptProviderList.clear();
-        MGraph contentGraph = cgProvider.getContentGraph();
-
-        NonLiteral cplNode = getConceptProviderListNode(contentGraph);
-        RdfList cpl = new RdfList(cplNode, contentGraph);
-        for (int i = 0; i < cpl.size(); i++) {
-            NonLiteral conceptProvider = (NonLiteral) cpl.get(i);
-            Iterator<Triple> conceptProviderTypes = contentGraph.filter(
-                    conceptProvider, RDF.type, null);
-            if (conceptProviderTypes.hasNext()) {
-                UriRef conceptProviderType = (UriRef) conceptProviderTypes.next().getObject();
-                if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
-                    instantiateLocalConceptProvider(contentGraph, conceptProvider);
-                } else {
-                    instantiateRemoteConceptProvider(contentGraph, conceptProvider);
-                }
-            }
-        }
-    }
-
-    private NonLiteral getConceptProviderListNode(MGraph contentGraph) {
-        Iterator<Triple> triples = contentGraph.filter(null, RDF.type,
-                CONCEPTS.ConceptProviderList);
-        if (triples.hasNext()) {
-            return triples.next().getSubject();
-        }
-        NonLiteral cplNode = new BNode();
-        new RdfList(cplNode, contentGraph);
-        contentGraph.add(new TripleImpl(cplNode, RDF.type,
-                CONCEPTS.ConceptProviderList));
-        return cplNode;
-    }
-
-    private void instantiateLocalConceptProvider(MGraph contentGraph,
-            NonLiteral conceptProvider) {
-        Iterator<Triple> selectedSchemes = contentGraph.filter(
-                conceptProvider, CONCEPTS.selectedScheme, null);
-        if (selectedSchemes.hasNext()) {
-            UriRef selectedScheme = (UriRef) selectedSchemes.next().getObject();
-            conceptProviderList.add(new LocalConceptProvider(tcManager,
-                    cgProvider, selectedScheme));
-        }
-    }
-
-    private void instantiateRemoteConceptProvider(MGraph contentGraph,
-            NonLiteral conceptProvider) {
-        Iterator<Triple> endPoints = contentGraph.filter(
-                conceptProvider, CONCEPTS.sparqlEndPoint, null);
-        if (endPoints.hasNext()) {
-            UriRef sparqlEndPoint = (UriRef) endPoints.next().getObject();
-            Iterator<Triple> defaultGraphs = contentGraph.filter(
-                    conceptProvider, CONCEPTS.defaultGraph, null);
-            UriRef defaultGraph = null;
-            if (defaultGraphs.hasNext()) {
-                defaultGraph = (UriRef) defaultGraphs.next().getObject();
-            }
-            Iterator<Triple> queryTemplates = contentGraph.filter(
-                    conceptProvider, CONCEPTS.queryTemplate, null);
-            if (queryTemplates.hasNext()) {
-                TypedLiteral queryTemplate =
-                        (TypedLiteral) queryTemplates.next().getObject();
-                conceptProviderList.add(
-                        new RemoteConceptProvider(sparqlEndPoint,
-                        defaultGraph, queryTemplate.getLexicalForm()));
-            }
-        }
-    }
-
-    /**
-     * Returns a GraphNode containing a list of {@link ConceptProvider}s stored
-     * in the content graph to be managed. The order in the list represents
-     * the priority of the providers.
-     * This resource is accessible through a GET request on the URI sub-path
-     * "edit-concept-provider-list".
-     *
-     */
-    @GET
-    @Path("edit-concept-provider-list")
-    public GraphNode getProviderList(@Context UriInfo uriInfo) {
-        AccessController.checkPermission(
-                new ConceptProviderManagerAppPermission());
-        TrailingSlash.enforceNotPresent(uriInfo);
-        MGraph contentGraph = cgProvider.getContentGraph();
-        MGraph resultGraph = new SimpleMGraph();
-
-        NonLiteral cplNode = getConceptProviderListNode(contentGraph);
-        GraphNode resultNode = new GraphNode(cplNode, resultGraph);
-
-        resultNode.addProperty(RDF.type, CONCEPTS.ManageConceptProvidersPage);
-        resultNode.addProperty(RDF.type, PLATFORM.HeadedPage);
-        return new GraphNode(resultNode.getNode(),
-                new UnionMGraph(resultGraph, contentGraph));
-    }
-
-    /**
-     * Allows the list of {@link ConceptProvider}s stored in the content graph
-     * to be updated with the list POSTed via the URI sub-path
-     * "update-concept-provider-list".
-     * The order in the list represents the priority of the providers.
-     *
-     * @param types
-     *        specify the type of each ConceptProvider: either a
-     *        LocalConceptProvider or a RemoteConceptProvider.
-     * @param sparqlEndPoints
-     *        the SPARQL EndPoint to connect to in case of a RemoteConceptProvider.
-     * @param defaultGraphs
-     *        the Graph to be queried in case of a RemoteConceptProvider.
-     * @param queryTemplates
-     *        the template for the query to be used in case of a RemoteConceptProvider.
-     * @param conceptSchemes
-     *        the concept scheme within which concepts are to be searched,
-     *        in case of a LocalConceptProvider.
-     * @return
-     *        - a 200 (OK) response if everything is fine.
-     *        - a 400 (BAD REQUEST) response if types parameter is undefined.
-     */
-    @POST
-    @Path("update-concept-provider-list")
-    public Response updateConceptProviders(
-            @FormParam("types") List<String> types,
-            @FormParam("sparqlEndPoints") List<String> sparqlEndPoints,
-            @FormParam("defaultGraphs") List<String> defaultGraphs,
-            @FormParam("queryTemplates") List<String> queryTemplates,
-            @FormParam("conceptSchemes") List<String> conceptSchemes) {
-
-        if (types == null) {
-            //types is null when all provider have been removed, processing empty list
-            types = new ArrayList<String>();
-        }
-        MGraph contentGraph = cgProvider.getContentGraph();
-        NonLiteral cplNode = getConceptProviderListNode(contentGraph);
-        GraphNode cplGraphNode = new GraphNode(cplNode, contentGraph);
-        cplGraphNode.deleteNodeContext();
-
-        cplNode = getConceptProviderListNode(contentGraph);
-        RdfList cpl = new RdfList(cplNode, contentGraph);
-
-        int length = types.size();
-        for (int i=0; i<length; i++) {
-            UriRef conceptProviderType = new UriRef(types.get(i));
-            BNode conceptProvider = new BNode();
-            contentGraph.add(new TripleImpl(conceptProvider, RDF.type,
-                    conceptProviderType));
-            if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
-                contentGraph.add(new TripleImpl(conceptProvider,
-                        CONCEPTS.selectedScheme,
-                        new UriRef(conceptSchemes.get(i))));
-            } else {
-                contentGraph.add(new TripleImpl(conceptProvider,
-                        CONCEPTS.sparqlEndPoint,
-                        new UriRef(sparqlEndPoints.get(i))));
-                String defaultGraph = defaultGraphs.get(i);
-                if (!defaultGraph.trim().isEmpty()) {
-                    contentGraph.add(new TripleImpl(conceptProvider,
-                            CONCEPTS.defaultGraph,
-                            new UriRef(defaultGraph)));
-                }
-                contentGraph.add(new TripleImpl(conceptProvider,
-                        CONCEPTS.queryTemplate,
-                        LiteralFactory.getInstance().createTypedLiteral(
-                        queryTemplates.get(i))));
-            }
-            cpl.add(i, conceptProvider);
-        }
-        instantiateConceptProviders();
-        return Response.status(Status.OK).build();
-    }
-
-    @Override
-    public List<ConceptProvider> getConceptProviders() {
-        return conceptProviderList;
-    }
-
-    @Override
-    public Set<GlobalMenuItem> getMenuItems() {
-        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
-        try {
-            AccessController.checkPermission(
-                    new TcPermission("urn:x-localinstance:/content.graph",
-                    TcPermission.READWRITE));
-        } catch (AccessControlException e) {
-            return items;
-        }
-        try {
-            AccessController.checkPermission(
-                    new ConceptProviderManagerAppPermission());
-        } catch (AccessControlException e) {
-            return items;
-        }
-        items.add(new GlobalMenuItem("/concepts/provider-manager/edit-concept-provider-list",
-                "CPM", "Concept Providers", 5, "Administration"));
-        return items;
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
+++ /dev/null
@@ -1,21 +0,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.
- *
-*/
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
+++ /dev/null
@@ -1,21 +0,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.
- *
-*/
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
+++ /dev/null
@@ -1,21 +0,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.
- *
-*/
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
+++ /dev/null
@@ -1,21 +0,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.
- *
-*/
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
deleted file mode 100644
index 823cb97..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
+++ /dev/null
@@ -1,29 +0,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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
-def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s);
-
-<form method="post" action="/concepts/tagger/set" id="selected-concepts-form">
-	<input type="hidden" name="uri" value={res/cpt("resource")*}></input>
-	{render(res/cpt("resource"), "selectedconcepts-naked")}
-</form>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
deleted file mode 100644
index c0436d8..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
+++ /dev/null
@@ -1,61 +0,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.
- *
-*/
-
-resultDocModifier.addScriptReference("/jquery/jquery-1.3.2.min.js");
-resultDocModifier.addScriptReference("/scripts/ajax-options.js");
-//resultDocModifier.addScriptReference("/scripts/modification-status.js");
-resultDocModifier.addScriptReference("/scripts/status-message.js");
-
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/concept-find-create.js");
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/jquery.rdfquery.core-1.0.js");
-
-resultDocModifier.addScriptReference("/scripts/alert-message.js");
-resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
-resultDocModifier.addScriptReference("/yui/2/element/element-min.js");
-resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
-resultDocModifier.addStyleSheet("/yui/2/container/assets/container-core.css");
-
-
-<div>Add Concepts</div>
-<form onsubmit="return ConceptFinder.search()" id="search-form">
-	<br/>
-	<input type="text" value="" name="search-term"/>
-	<a href="#" id="go-button" class="tx-icon tx-icon-search">Go</a>
-	<br/>
-	<br/>
-	<div id="system-found-concepts-area">
-		<div id="label-for-search-results">
-			Found Concepts:
-		</div>
-		<br/>
-		<div id="system-found-concepts"></div>
-	</div>
-	<br/>
-	<div id="user-defined-concept-area">
-		<div id="add-button-label"></div>
-		<div>Description (optional):</div>
-		<textarea rows="8" id="concept-description" name="comment"/>
-		<input type="hidden" value="en" name="lang"/>
-		<div>
-			<a href="#" class="tx-icon tx-icon-plus" id="add-user-defined-concept">Add</a>
-		</div>
-	</div>
-</form>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
deleted file mode 100644
index a81d5a2..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
+++ /dev/null
@@ -1,23 +0,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.
- *
-*/
-
-<div class="concept-tagging">{render(res,"concept-existing-subjects-naked")}
-{render(res,"concept-find-create-naked")}</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
deleted file mode 100644
index e27759b..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
+++ /dev/null
@@ -1,43 +0,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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
-def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s);
-
-resultDocModifier.setTitle("Generic Resource Page");
-resultDocModifier.addNodes2Elem("tx-module", <h1>Generic Resource Page</h1>);
-resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Resource</a></li>);
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="#">Save</a></li>);
-
-<div id="tx-content">
-	<script type="text/javascript">
-		$(document).ready(function() {{
-			$("#addButton").click(function() {{
-				$("#selected-concepts-form").submit();
-			}});
-		}});
-	</script>
-	<h4>About: {res/cpt("resource")*}</h4>
-	<div><object width="80%" data={res/cpt("resource")*}></object></div>
-	<br/>
-	{render(res,"concept-tagging-naked")}
-</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
deleted file mode 100644
index e0ef754..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
+++ /dev/null
@@ -1,128 +0,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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s)
-def lingvoj(s: Any) = new UriRef("http://www.lingvoj.org/ontology#"+s)
-def rdfs(s: Any) = new UriRef("http://www.w3.org/2000/01/rdf-schema#"+s)
-def rdf(s: Any) = new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#"+s)
-
-def createProvider(rdfType: String, selectedScheme: String, sparqlEndPoint: String, defaultGraph: String, query: String) =
-						<tr>
-							<td>
-								<input type="checkbox" value={rdfType}/>
-							</td>
-							<td>
-							<div>Provider:
-							</div>
-								{createSelection(!selectedScheme.equals(""))}
-							<br/>
-							<div>Concept Scheme:</div>
-							<input type="text" value={selectedScheme} name="conceptSchemes"/>
-							<div>SPARQL Endpoint:</div>
-							<input type="text" value={sparqlEndPoint} name="sparqlEndPoints"/>
-							<div>Default Graph:</div>
-							<input type="text" value={defaultGraph} name="defaultGraphs"/>
-							<div>Query Template:</div>
-							<textarea rows="8" name="queryTemplates">{query}</textarea>
-							<br/>
-							<br/>
-							</td>
-						</tr>
-
-
-def createSelection(isLocal: Boolean) = <select name="types">
-									{if(isLocal) {
-										<option value={cpt("LocalConceptProvider").getUnicodeString()} selected="selected">LocalConceptProvider</option>
-										<option value={cpt("RemoteConceptProvider").getUnicodeString()} >RemoteConceptProvider</option>
-									} else {
-										<option value={cpt("LocalConceptProvider").getUnicodeString()}>LocalConceptProvider</option>
-										<option value={cpt("RemoteConceptProvider").getUnicodeString()} selected="selected">RemoteConceptProvider</option>
-									}}
-						</select>
-
-resultDocModifier.addStyleSheet("/static/concepts/style/form.css");
-resultDocModifier.addScriptReference("/jquery/jquery.tooltip.pack.js");
-resultDocModifier.addScriptReference("/jquery/jquery.ajaxQueue.js");
-resultDocModifier.addScriptReference("/jquery/jquery.autocomplete.min.js");
-resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
-/*resultDocModifier.addScriptReference("/yui/2/container/assets/container-core.css");*/
-resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
-resultDocModifier.addScriptReference("/scripts/alert-message.js");
-resultDocModifier.addScriptReference("/scripts/ajax-options.js");
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/concept-provider-manipulation.js");
-resultDocModifier.setTitle("Resource Tagging");
-resultDocModifier.addNodes2Elem("tx-module", <h1>Resource Tagging</h1>);
-
-resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="">Concept Providers Manager</a></li>);
-
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="deleteButton" class="tx-button tx-button-remove" href="#">Remove</a></li>);
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="#">Save</a></li>);
-
-<div id="tx-content">
-	<div  class="tx-tree">
-		<form action="" id="providers" method="post">
-			<fieldset>
-				<table>
-					<thead>
-						<tr>
-							<th><a href="#"></a></th>
-							<th style="width: 95%"><a href="#"></a>Concept Providers</th>
-						</tr>
-					</thead>
-					<tbody>
-						{	for (provider <- (res!!)) yield {
-								if((provider/rdf("type")*).indexOf("LocalConceptProvider") != -1) {
-									createProvider((provider/rdf("type")*), provider/cpt("selectedScheme")*, "", "", "")
-								} else {
-									createProvider((provider/rdf("type")*), "", provider/cpt("sparqlEndPoint")*, provider/cpt("defaultGraph")*, provider/cpt("queryTemplate")*)
-								}
-							}
-						}
-						<tr id="last">
-							<td></td>
-							<td>
-								<div>Add Concept Provider:</div>
-								<select id="type">
-									<option value={cpt("LocalConceptProvider").getUnicodeString()}>LocalConceptProvider</option>
-									<option value={cpt("RemoteConceptProvider").getUnicodeString()}>RemoteConceptProvider</option>
-								</select>
-								<div>Concept Scheme:</div>
-								<input type="text" name="conceptScheme" id="conceptScheme"/>
-								<div>SPARQL Endpoint</div>
-								<input type="text" name="sparqlEndPoint" id="sparqlEndPoint" />
-								<div>Default Graph:</div>
-								<input type="text" name="defaultGraph" id="defaultGraph"/>
-								<div>Query Template:</div>
-								<textarea rows="8" id="query"/>
-								<br/>
-								<br/>
-								<div>
-									<a href="#" class="tx-icon tx-icon-ok" id="addProvider">Add</a>
-								</div>
-							</td>
-						</tr>
-					</tbody>
-				</table>
-			</fieldset>
-		</form>
-	</div>
-</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
deleted file mode 100644
index 707c11a..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
+++ /dev/null
@@ -1,41 +0,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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
-
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/selected-concepts.js");
-
-<div>
-	<div id="selected-concepts">
-		{for (concept <- (res/dct("subject"))) yield {
-		<div>
-			<div>PrefLabel: {concept/skos("prefLabel")*}</div>
-			<div>Uri: {concept*}</div>
-			<input type="hidden" name="concepts" value={concept*}></input>
-			<a href="#" class="tx-icon tx-icon-delete" >Remove</a>
-			<br />
-			<br />
-		</div>
-		}
-		}
-	</div>
-</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
deleted file mode 100644
index 5ee4663..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
+++ /dev/null
@@ -1,33 +0,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.
- *
-*/
-
-import org.json.simple.JSONObject
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-
-"{\"concepts\":" +
-	(for (concept <- (res/skos("member"))) yield {
-		"{" +
-			"\"prefLabel\":\"" + JSONObject.escape(concept/skos("prefLabel")*) + "\"," +
-			"\"uri\":\"" + JSONObject.escape(concept*) + "\"" +
-		"}"
-	}).mkString("[", ",", "]") +
-"}";

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
deleted file mode 100644
index e31bd88..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
+++ /dev/null
@@ -1,217 +0,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.
- * 
- * @author hasan, andre
- */
-function ConceptFinder(){
-};
-
-ConceptFinder.callback;
-
-ConceptFinder.setAddConceptCallback = function(callback){
-	this.callback = callback;
-}
-
-/**
- * Request the server concepts that match the search term in the input field "search-term"
- */
-ConceptFinder.search = function(){
-	$("#system-found-concepts").empty();
-	var queryResult = null;
-	var searchTerm = $(":text[name=\"search-term\"]").val();
-	if (searchTerm.length > 0) {
-		var options = new AjaxOptions("find-concepts", "finding concepts", function(data){
-			var databank = $.rdf.databank();
-			var store = databank.load(data, {});
-			var query = $.rdf({
-				databank: store
-			});
-			query.prefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
-			query.prefix('concepts', 'http://clerezza.org/2010/01/concepts#');
-			query.prefix('rdfs', 'http://www.w3.org/2000/01/rdf-schema#');
-			query.prefix('qr', 'http://clerezza.org/2010/04/queryresult#');
-			var resultSet = query.where('?subject rdf:type qr:QueryResult');
-			if (resultSet.size() != 1) {
-				AlertMessage.show(function(){
-				}, "The query results did not match what's expected: exactly 1 result");
-			}
-			var queryResult = query.node(resultSet.get(0).subject);
-			var conceptProperty = $.rdf.resource("<http://clerezza.org/2010/04/queryresult#concept>");
-			var conceptProperties = queryResult.get(conceptProperty);
-			if (conceptProperties) {
-				ConceptFinder.addFoundConcepts(conceptProperties);
-			}
-			$("#add-button-label").html("<div>Add '" + searchTerm + "' as new Free Concept</div>");
-			$("#system-found-concepts-area").show();
-			var newFreeConceptProperty = $.rdf.resource("<http://clerezza.org/2010/04/queryresult#creationOfNewFreeConceptSuggested>");
-			var creationOfNewFreeConceptSuggested = queryResult.get(newFreeConceptProperty)[0].value.toString() == "true";
-			if (creationOfNewFreeConceptSuggested) {
-				$("#user-defined-concept-area").show();
-			} else {
-				$("#user-defined-concept-area").hide();
-			}
-		});
-		options.url = "/concepts/find";
-		options.data = "searchTerm=" + encodeURIComponent(searchTerm) + "&xPropObj=http://clerezza.org/2010/04/queryresult%23concept";
-		options.dataType = "json";
-		options.beforeSend = function(req){
-			req.setRequestHeader("Accept", "application/rdf+json");
-		};
-		
-		$.ajax(options);
-	}
-	return false;
-}
-
-/**
- * Adds the given (array of) concepts to the UI (that's currently being displayed). Displays them by a 
- * +-button and labels (for each of them)
- *
- * @param Json array of concepts
- */
-ConceptFinder.addFoundConcepts = function(concepts){
-	var selectedConceptsExists = false;
-	if (typeof(SelectedConcepts) != "undefined") {
-		selectedConceptsExists = true;
-	}
-	var added = false;
-	for (var i = 0; i < concepts.length; i++) {
-		var concept = concepts[i];
-		if (!selectedConceptsExists || !SelectedConcepts.exists(concept.value)) {
-			added = true;
-			var prefLabelProperty = $.rdf.resource("<http://www.w3.org/2008/05/skos#prefLabel>"); 
-			var prefLabel = concept.get(prefLabelProperty).value;
-			var uri = concept.value;
-			ConceptFinder.createSystemFoundConcept(prefLabel, uri);
-		}
-	}
-	if (added) {
-		$("#label-for-search-results").text("Concepts found:");
-	}
-	else {
-		$("#label-for-search-results").text("No additional concepts found.");
-	}
-}
-
-/**
- * Creates the widget that show the user a concept that was found on the backend. Shows prefLabel, 
- * uri and a button to add the concept to the backend
- * 
- * @param {Object} prefLabel
- * @param {Object} uri
- */
-ConceptFinder.createSystemFoundConcept = function(prefLabel, uri) {
-	var div = $("<div/>");
-	ConceptFinder.createConceptWidgets(prefLabel, uri).appendTo(div)
-	$("<a/>").addClass("tx-icon tx-icon-plus").attr({
-		href: "#"
-	}).text("Add").click(ConceptFinder.onAddClicked(prefLabel, uri)).appendTo(div);
-	$("<br/>").appendTo(div);
-	$("<br/>").appendTo(div);
-	div.appendTo("#system-found-concepts")
-}
-
-ConceptFinder.onAddClicked = function(prefLabel, uri){
-	return function(){
-		if (typeof(SelectedConcepts) != "undefined") {
-			SelectedConcepts.addConcept(prefLabel, uri);
-		}
-		if (typeof(ConceptFinder.callback) == "function") {
-			ConceptFinder.callback(prefLabel, uri);
-		}
-		$(this).parent().remove();
-	};
-}
-
-/**
- * Creates html elements that show the given pref label and uri. Appends them to the given div.
- * 
- * @param {Object} prefLabel
- * @param {Object} uri
- * @param {Object} div
- */
-ConceptFinder.createConceptWidgets = function(prefLabel, uri) {
-	var div = $("<div/>");
-	if (prefLabel.substr(0,1) == "\"") {
-		prefLabel = prefLabel.substring(1, prefLabel.length - 1);
-	}
-	$("<div/>").text("PrefLabel: " + prefLabel).appendTo(div);
-	$("<div/>").text("Uri: " + uri).appendTo(div);
-	$("<input/>").attr({
-		"type": "hidden",
-		"name": "concepts"
-	}).val(uri).appendTo(div);
-	return div;
-}
-
-/**
- * Checks if a concept with the given uri already exists
- * @param {Object} uri
- */
-ConceptFinder.exists = function(uri){
-
-};
-
-function ConceptManipulator(){
-};
-
-ConceptManipulator.callback;
-
-ConceptManipulator.setAddConceptCallback = function(callback){
-	this.callback = callback;
-}
-
-/**
- * sends a new concept to the backend for addition. Uses the search term entered by the user (in the same form).
- */
-ConceptManipulator.addConcept = function(){
-	var searchTerm = $(":text[name='search-term']").val();
-	if (searchTerm.length > 0) {
-		var options = new AjaxOptions("add-concepts", "adding concepts", function(uri){
-			$("#concept-description").val("");
-			if (typeof(SelectedConcepts) != "undefined") {
-				SelectedConcepts.addConcept(searchTerm, uri);
-			}
-			if (typeof(this.callback) == "function") {
-				this.callback(searchTerm, uri);
-			}
-		});
-		options.type = "POST";
-		options.url = "/concepts/manipulator/add-concept";
-		options.data = {
-			"pref-label": searchTerm,
-			lang: $(":input[name='lang']").val(),
-			comment: $(":textarea[name='comment']").val()
-		}
-		
-		$.ajax(options);
-	}
-	return false;
-}
-
-$(document).ready(function(){
-	$("#go-button").click(function(){
-		ConceptFinder.search();
-	});
-	$("#add-user-defined-concept").click(function(){
-		ConceptManipulator.addConcept();
-		$("#user-defined-concept-area").hide();
-	});
-	$("#system-found-concepts-area").hide();
-	$("#user-defined-concept-area").hide();
-});

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
deleted file mode 100644
index fcab2c1..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
+++ /dev/null
@@ -1,213 +0,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.
- */
-function ConceptProviderGui(){};
-
-ConceptProviderGui.isModified = false;
-
-ConceptProviderGui.query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> \n" +
-	"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" +
-	"PREFIX skos08: <http://www.w3.org/2008/05/skos#> \n" +
-	"PREFIX skos04: <http://www.w3.org/2004/02/skos/core#> \n" +
-	"CONSTRUCT { ?concept a skos08:Concept; skos08:prefLabel ?prefLabel; " +
-		"rdfs:comment ?comment; owl:sameAs ?sameConcept . } \n" +
-	"WHERE { ?concept a skos04:Concept; skos04:prefLabel ?prefLabel . \n" +
-	"OPTIONAL { ?concept rdfs:comment ?comment . } \n" +
-	"OPTIONAL { ?concept owl:sameAs ?sameConcept . } \n" +
-	"FILTER (REGEX(STR(?prefLabel), '${searchTerm}', 'i'))}";
-
-ConceptProviderGui.initButtons = function() {
-
-	ConceptProviderGui.updateButtonState();
-
-	$("#deleteButton").click(function(event) {
-		$("input:checked").each(function() {
-			$(this).parent().parent().remove();
-		});
-		$(this).addClass("tx-inactive");
-		ConceptProviderGui.isModified = true;
-	});
-
-	$("#addProvider").click(function(event) {
-		ConceptProviderGui.addProvider($("#type").val(),
-					$("#conceptScheme").val(),
-					$("#sparqlEndPoint").val(),
-					$("#defaultGraph").val(),
-					$("#query").val());
-		$("#conceptScheme").val("");
-		$("#sparqlEndPoint").val("");
-		$("#defaultGraph").val("");
-		$("#query").val("");
-	});
-
-	$("#addButton").click(function(event) {
-		if($(this).text() == "Save") {
-			var options = new AjaxOptions("update-providers", "updating providers", function(obj) {
-			});
-			$("textarea[id!=query]").each(function() {
-				$(this).removeAttr("disabled");
-			});
-			options.type = "POST";
-			options.url = "update-concept-provider-list";
-			options.data = $("#providers").serialize();
-			$.ajax(options);
-		}
-	});
-}
-
-ConceptProviderGui.addProvider = function(rdfType, conceptScheme, sparqlEndPoint, defaultGraph, query) {
-	var tr = $("<tr/>").attr("id", "");
-	var td1 = $("<td/>");
-	var div = $("<div/>").text("Provider:");
-	var td2 = $("<td/>");
-
-	var selection = $("<select/>").attr("name","types");
-
-	$("#type > option:not(:selected)").each(function() {
-		selection.append($(this).clone());
-	});
-	$("#type > option:selected").each(function() {
-		var option = $(this).clone();
-		option.attr("selected", "selected");
-		selection.append(option);
-	});
-
-	td2.append(div);
-	td2.append(selection);
-	
-	var inputText = $("<input/>").attr({
-				"type":"text",
-				"name":"conceptSchemes",
-				"value": conceptScheme
-				});
-	
-	div = $("<div/>").text("Concept Scheme:");
-	td2.append(div);
-	td2.append(inputText);
-
-	inputText = $("<input/>").attr({
-				"type":"text",
-				"name":"sparqlEndPoints",
-				"value": sparqlEndPoint
-				});
-
-	div = $("<div/>").text("SPARQL End Point");
-	td2.append(div);
-	td2.append(inputText);
-
-	inputText = $("<input/>").attr({
-				"type":"text",
-				"name":"defaultGraphs",
-				"value": defaultGraph
-				});
-
-	div = $("<div/>").text("Default Graph:");
-	td2.append(div);
-	td2.append(inputText)
-	var inputCheckbox = $("<input/>").attr({
-				"type":"checkbox",
-				"value": rdfType
-				});
-
-	inputCheckbox.appendTo(td1);
-
-	td1.appendTo(tr);
-	
-	var textArea = $("<textarea/>").attr({
-				"rows":"8",
-				"name":"queryTemplates"
-				}).val(query);
-	div = $("<div/>").text("Query Template:");
-	td2.append(div);
-	td2.append(textArea);
-	td2.append($("<br/>"));
-	td2.append($("<br/>"));
-	td2.appendTo(tr);
-	tr.insertBefore("#last");
-	ConceptProviderGui.isModified = true;
-
-	$("select[name=types] > option:selected").each(function() {
-		ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
-	});
-}
-
-ConceptProviderGui.updateDropDown = function (obj, name) {
-	if(obj.val().indexOf("Local") != -1) {
-		obj.parent().parent().find("input[name!=" + name + "]").each(function() {
-			$(this).prev().hide();
-			$(this).hide();
-		});
-		obj.parent().parent().find("input[name=" + name + "]").each(function() {
-			$(this).prev().show();
-			$(this).show();
-		});
-		obj.parent().parent().find("textarea").each(function() {
-			$(this).prev().hide();
-			$(this).hide();
-		});
-	} else {
-		obj.parent().parent().find("input[name!=" + name + "]").each(function() {
-			$(this).prev().show();
-			$(this).show();
-		});
-		obj.parent().parent().find("input[name=" + name + "]").each(function() {
-			$(this).prev().hide();
-			$(this).hide();
-		});
-		obj.parent().parent().find("textarea").each(function() {
-			$(this).prev().show();
-			$(this).show();
-		});
-	}
-}
-
-ConceptProviderGui.updateButtonState = function() {
-	var counter = $("input:checked").length;
-	if(counter == 0) {
-		$("#deleteButton").addClass("tx-inactive");
-	} else {
-		$("#deleteButton").removeClass("tx-inactive");
-	}
-}
-
-$(document).ready(function () {
-
-	$("select[name=types]").live("change", function() {
-		$("select[name=types] > option:selected").each(function(){
-			ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
-		});
-	});
-	$("select[name=types] > option:selected").each(function() {
-		ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
-	});
-	$("#type").live("change", function() {
-		$("#type > option:selected").each(function(){
-			ConceptProviderGui.updateDropDown($(this), "conceptScheme");
-			$("#query").val(ConceptProviderGui.query);
-		});
-	});
-	$("#type > option:selected").each(function() {
-		ConceptProviderGui.updateDropDown($(this), "conceptScheme");
-		$("#query").val(ConceptProviderGui.query);
-	});
-	$("input:checkbox").live("change",function() {
-		ConceptProviderGui.updateButtonState();
-	});
-
-	ConceptProviderGui.initButtons();
-});


[15/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/pom.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/pom.xml b/platform/launcher.storageless.parent/pom.xml
new file mode 100644
index 0000000..1414762
--- /dev/null
+++ b/platform/launcher.storageless.parent/pom.xml
@@ -0,0 +1,927 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+    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.
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>clerezza</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.launcher.storageless.parent</artifactId>
+    <version>0.9-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <name>Clerezza - Platform Launcher Storageless Parent POM</name>
+    <description>A parent for Platform launchers, containing the platform bundlessca as runtime dependencies.
+    </description>
+    <modules>
+        <module>platform.launcher.storageless</module>
+    </modules>
+    
+    <dependencyManagement>
+      <dependencies>
+	<!-- Apache Stanbol Dependencies -->
+	<dependency>
+          <groupId>org.apache.stanbol</groupId>
+          <artifactId>org.apache.stanbol.commons.frameworkfragment</artifactId>
+          <version>${stanbol.version}</version>
+        </dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.web.resources</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.security.core</artifactId>
+      <version>1.0.0</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.authentication.basic</artifactId>
+	  <version>1.0.0</version>
+	</dependency>
+	<dependency>
+          <groupId>org.apache.stanbol</groupId>
+          <artifactId>org.apache.stanbol.commons.security.fexilwebconsole</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+    <!-- 0.12 version is incomaptible with 1.0.0 version of commons.security, so diabling till stanbol 1.0.0 is released
+	<dependency>
+          <groupId>org.apache.stanbol</groupId>
+          <artifactId>org.apache.stanbol.commons.security.usermanagement</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+    -->
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.ldpath.clerezza</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.ldpathtemplate</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.web.viewable</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.web.rdfviewable.writer</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.web.base</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.freemarker</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.indexedgraph</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.stanbol</groupId>
+	  <artifactId>org.apache.stanbol.commons.jsonld</artifactId>
+	  <version>${stanbol.version}</version>
+	</dependency>
+      </dependencies>
+    </dependencyManagement>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.stanbol</groupId>
+            <artifactId>org.apache.stanbol.commons.frameworkfragment</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <!--
+            Clerezza Dependencies
+        -->
+        <dependency>
+            <groupId>org.wymiwyg</groupId>
+            <artifactId>wymiwyg-commons-core</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-core</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-arq</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-iri</artifactId>
+            <scope>runtime</scope>
+            <version>1.0.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>com.ibm.icu</artifactId>
+            <scope>runtime</scope>
+            <version>0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.ops4j.pax.swissbox.tinybundles</artifactId>
+            <scope>runtime</scope>
+            <version>0.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>javax.mail</artifactId>
+            <scope>runtime</scope>
+            <version>0.5-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.json.simple</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-compiler</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-actors</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-reflect</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.scala</groupId>
+            <artifactId>script-engine</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <!-- <dependency>
+            <groupId>com.sun.script.jruby</groupId>
+            <artifactId>jruby-engine</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.jruby</artifactId>
+            <scope>runtime</scope>
+        </dependency> -->
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore-osgi</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jsslutils</groupId>
+            <artifactId>jsslutils</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <!-- these are now embeded as most recent version is not OSGi bundle
+        <dependency>
+            <groupId>net.rootdev</groupId>
+            <artifactId>java-rdfa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.rootdev</groupId>
+            <artifactId>java-rdfa-htmlparser</artifactId>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.mina</groupId>
+            <artifactId>mina-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sshd</groupId>
+            <artifactId>sshd-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sshd</groupId>
+            <artifactId>sshd-pam</artifactId>
+        </dependency>
+        <!--
+            Clerezza Bundles
+        -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.logging.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.logging.initializer</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.logging.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.enrichment</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphnodeprovider</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.usermanager</artifactId>
+            <scope>runtime</scope>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.usermanager.webinterface</artifactId>
+            <scope>runtime</scope>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils.customproperty</artifactId>
+            <scope>runtime</scope>
+            <version>0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.accountcontrolpanel.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.accountcontrolpanel.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.wink</groupId>
+            <artifactId>wink-osgi</artifactId>
+            <version>1.3.0</version>
+            <!-- this has to start early, because of the MediaType requiring RuntimeImpl in 
+            static initializer -->
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <scope>runtime</scope>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.enrichment</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.facade</artifactId>
+            <scope>runtime</scope>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.commons</artifactId>
+            <scope>runtime</scope>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.storage</artifactId>
+            <scope>runtime</scope>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.file.storage</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.sparql</artifactId>
+            <scope>runtime</scope>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.parser</artifactId>
+            <scope>runtime</scope>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.serializer</artifactId>
+            <scope>runtime</scope>
+            <version>0.11</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.rdfa</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.rdfjson</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.storage.web</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content</artifactId>
+            <scope>runtime</scope>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content.default404</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.editor</artifactId>
+            <scope>runtime</scope>
+            <version>0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content.fsadaptor</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content.imagemetadata</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content.representations.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content.representations.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <scope>runtime</scope>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.dashboard.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.dashboard.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.dashboard.webinterface</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.shellcustomizer</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>shell</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>shell.felixshellcommand</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>bundledevtool</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>sshshell</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <scope>runtime</scope>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.rdf.providers</artifactId>
+            <scope>runtime</scope>
+            <version>0.15</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.stanbol.fragments</artifactId>
+            <scope>runtime</scope>
+            <version>0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.web.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.web.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <!--<dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security</artifactId>
+            <scope>runtime</scope>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security.conditions</artifactId>
+            <scope>runtime</scope>
+            <version>0.6</version>
+        </dependency>
+        <!-- <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security.foafssl.core</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security.foafssl.test</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+	-->
+        <dependency>
+          <groupId>org.apache.clerezza</groupId>
+          <artifactId>platform.security.foafssl.ontologies</artifactId>
+	  <version>0.2</version>
+          <scope>runtime</scope>
+        </dependency>
+        
+	<dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>ssl.keygen.base</artifactId>
+	       <version>0.6</version>
+            <scope>runtime</scope>
+        </dependency>
+        <!--<dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security.auth.basic</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security.auth.cookie</artifactId>
+            <scope>runtime</scope>
+        </dependency> --> 
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.web.resources</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.security.core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.authentication.basic</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.stanbol</groupId>
+        <artifactId>org.apache.stanbol.commons.security.fexilwebconsole</artifactId>
+    </dependency>
+    <!-- 0.12 version is incomaptible with 1.0.0 version of commons.security, so diabling till stanbol 1.0.0 is released
+    <dependency>
+        <groupId>org.apache.stanbol</groupId>
+        <artifactId>org.apache.stanbol.commons.security.usermanagement</artifactId>
+    </dependency>
+	-->
+    <dependency> <!-- LD Path -->
+      <groupId>at.newmedialab.ldpath</groupId>
+      <artifactId>ldpath-api</artifactId>
+      <version>0.9.5</version>
+    </dependency>
+    <dependency>
+      <groupId>at.newmedialab.ldpath</groupId>
+      <artifactId>ldpath-core-bundle</artifactId>
+      <version>0.9.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.ldpath.clerezza</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.ldpathtemplate</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.web.viewable</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.web.rdfviewable.writer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.web.base</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.freemarker</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.indexedgraph</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.jsonld</artifactId>
+    </dependency>
+    <dependency> <!-- used also for all the other JSON parsing/writing in Stanbol -->
+      <groupId>org.codehaus.jettison</groupId>
+      <artifactId>jettison</artifactId>
+      <version>1.3.1</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.2.1</version>
+    </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typehandlerspace</artifactId>
+            <scope>runtime</scope>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typehandlerspace.wink</artifactId>
+            <scope>runtime</scope>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typepriority</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.mail</artifactId>
+            <scope>runtime</scope>
+            <version>0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>templating</artifactId>
+            <scope>runtime</scope>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>templating.seedsnipe</artifactId>
+            <scope>runtime</scope>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <scope>runtime</scope>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.extensions</artifactId>
+            <scope>runtime</scope>
+            <version>0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>osgi.services</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.gui</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.seedsnipe</artifactId>
+            <scope>runtime</scope>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.scripting</artifactId>
+            <scope>runtime</scope>
+            <version>0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.scripting.scriptmanager</artifactId>
+            <scope>runtime</scope>
+            <version>0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.xhtml2html</artifactId>
+            <scope>runtime</scope>
+            <version>0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.resources.jquery</artifactId>
+            <scope>runtime</scope>
+            <version>0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.resources.yui</artifactId>
+            <scope>runtime</scope>
+            <version>0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils.imageprocessing</artifactId>
+            <scope>runtime</scope>
+            <version>0.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.resources.scripts</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.style.default</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scala</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.scala.utils</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config.gui</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.documentation</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.documentation.viewer</artifactId>
+            <scope>runtime</scope>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.language.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.language.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.3</version>
+        </dependency>
+<!--
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.style.classic.webguiexamples</artifactId>
+            <scope>runtime</scope>
+        </dependency>wr
+-->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.concepts.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.concepts.ontologies</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.users.core</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.metadata</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <scope>runtime</scope>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk16</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <pluginManagement>
+            <plugins>
+                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+                <plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>
+                                            org.apache.maven.plugins
+                                        </groupId>
+                                        <artifactId>
+                                            maven-dependency-plugin
+                                        </artifactId>
+                                        <versionRange>
+                                            [2.1,)
+                                        </versionRange>
+                                        <goals>
+                                            <goal>
+                                                unpack-dependencies
+                                            </goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore/>
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/DISCLAIMER
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/DISCLAIMER b/platform/launcher.tdb/DISCLAIMER
new file mode 100644
index 0000000..ab24be4
--- /dev/null
+++ b/platform/launcher.tdb/DISCLAIMER
@@ -0,0 +1,11 @@
+Apache Clerezza is an effort undergoing incubation at The Apache Software 
+Foundation (ASF), sponsored by the Apache Incubator. 
+
+Incubation is required of all newly accepted projects until a further 
+review indicates that the infrastructure, communications, and decision 
+making process have stabilized in a manner consistent with other 
+successful ASF projects. 
+
+While incubation status is not necessarily a reflection of the 
+completeness or stability of the code, it does indicate that the 
+project has yet to be fully endorsed by the ASF.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/LICENSE
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/LICENSE b/platform/launcher.tdb/LICENSE
new file mode 100644
index 0000000..e8d41e4
--- /dev/null
+++ b/platform/launcher.tdb/LICENSE
@@ -0,0 +1,471 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+APACHE CLEREZZA TDB LAUNCHER SUBCOMPONENTS: 
+
+The Apache Clerezza TDB Launcher includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses. 
+
+For the yui javascript library:
+
+Copyright (c) 2009, Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * 	Redistributions of source code must retain the above copyright notice, this list of conditions and the
+     	following disclaimer.
+    * 	Redistributions in binary form must reproduce the above copyright notice, this 	list of conditions and the following disclaimer in the documentation and/or other 	materials provided with the distribution.
+    * 	Neither the name of Yahoo! Inc. nor the names of its contributors may be used 	to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the jQuery javascript library:
+
+Copyright (c) 2011 John Resig, http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For Asm:
+
+Copyright (c) 2000-2011 INRIA, France Telecom
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+For Bouncycastle:
+
+Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+For the RDFa parsing library:
+
+© Copyright 2009 University of Bristol
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS’’ AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+- For the jSSLutils library:
+  
+Copyright (c) 2008-2010, The University of Manchester, United Kingdom.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the The University of Manchester nor the names of 
+      its contributors may be used to endorse or promote products derived 
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+POSSIBILITY OF SUCH DAMAGE.
+
+
+For Jetty:
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+- For scala:
+
+Copyright (c) 2002-2012 EPFL, Lausanne, unless otherwise specified.
+All rights reserved.
+
+This software was developed by the Programming Methods Laboratory of the
+Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland.
+
+Permission to use, copy, modify, and distribute this software in source
+or binary form for any purpose with or without fee is hereby granted,
+provided that the following conditions are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+   3. Neither the name of the EPFL nor the names of its contributors
+      may be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/README.txt
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/README.txt b/platform/launcher.tdb/README.txt
new file mode 100644
index 0000000..6698c91
--- /dev/null
+++ b/platform/launcher.tdb/README.txt
@@ -0,0 +1,11 @@
+Apache Clerezza TDB Launcher
+
+The provided launcher jar is executable, however on most platform you must
+provide additional arguments to java so that Clerezza has enough memory to run.
+
+Start clerezza with:
+
+java -XX:MaxPermSize=400m -Dfile.encoding=utf-8 -Xss512k -Xmx2g -jar platform.launcher.tdb-*.jar
+
+Add the --help at the end of the line above to see possible argument for
+Clerezza

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/nb-configuration.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/nb-configuration.xml b/platform/launcher.tdb/nb-configuration.xml
new file mode 100644
index 0000000..ec4540c
--- /dev/null
+++ b/platform/launcher.tdb/nb-configuration.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
+    <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->
+    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+        <!--
+Properties that influence various parts of the IDE, especially code formatting and the like. 
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->
+        <netbeans.compile.on.save>none</netbeans.compile.on.save>
+    </properties>
+</project-shared-configuration>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/nbactions.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/nbactions.xml b/platform/launcher.tdb/nbactions.xml
new file mode 100644
index 0000000..3fc4ab5
--- /dev/null
+++ b/platform/launcher.tdb/nbactions.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+    <action>
+        <actionName>run</actionName>
+        <goals>
+            <goal>clean</goal>
+            <goal>package</goal>
+            <goal>antrun:run</goal>
+            <goal>-o</goal>
+        </goals>
+        <properties>
+            <vm.args>-Dclerezza.shell.disable=true</vm.args>
+        </properties>
+    </action>
+    <action>
+        <actionName>debug</actionName>
+        <goals>
+            <goal>clean</goal>
+            <goal>package</goal>
+            <goal>antrun:run</goal>
+            <goal>-o</goal>
+        </goals>
+        <properties>
+            <vm.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Dclerezza.shell.disable=true</vm.args>
+            <jpda.listen>true</jpda.listen>
+        </properties>
+    </action>
+    <action>
+        <actionName>profile</actionName>
+        <goals>
+            <goal>clean</goal>
+            <goal>package</goal>
+            <goal>antrun:run</goal>
+            <goal>-o</goal>
+        </goals>
+        <properties>
+            <vm.args>${profiler.args}</vm.args>
+            <!-- XXX <java jvm="${profiler.java}" ...> -->
+            <profiler.action>profile</profiler.action>
+        </properties>
+    </action>
+    <action>
+        <actionName>CUSTOM-resume-debug</actionName>
+        <displayName>Resume Debug</displayName>
+        <goals>
+            <goal>antrun:run</goal>
+            <goal>-o</goal>
+        </goals>
+        <properties>
+            <vm.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}</vm.args>
+            <jpda.listen>true</jpda.listen>
+        </properties>
+    </action>
+</actions>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/pom.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/pom.xml b/platform/launcher.tdb/pom.xml
new file mode 100644
index 0000000..911bc7e
--- /dev/null
+++ b/platform/launcher.tdb/pom.xml
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.launcher.tdb</artifactId>
+    <version>0.6-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Clerezza - Platform Launcher with Jena TDB</name>
+    <description>TDB variant of standalone java application for launching the clerezza.org platform. It is also a bundle, but there is no OSGi container known to support this (we are working on it :-) ).</description>
+    <build>
+        <plugins>
+             <plugin>
+                    <groupId>org.codehaus.xsite</groupId>
+                    <artifactId>xsite-maven-plugin</artifactId>
+                    <configuration>
+                            <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                            <sitemapPath>content/sitemap.xml</sitemapPath>
+                            <skinPath>templates/skin.html</skinPath>
+                            <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                    </configuration>
+                    <executions>
+                            <execution>
+                                    <phase>pre-site</phase>
+                                    <goals>
+                                            <goal>run</goal>
+                                    </goals>
+                            </execution>
+                    </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.1</version>
+                <executions>
+                    <execution>
+                        <id>inline-jars</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>
+                                platform.launcher.storageless
+                            </includeArtifactIds>
+                            <outputDirectory>target/extracted</outputDirectory>
+                            <includes>**</includes>
+                            <excludes>
+                                META-INF/**,**/org.apache.jena*
+                            </excludes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-platform-bundles</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-3</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeScope>runtime</includeScope>
+                            <excludeArtifactIds>slf4j-api</excludeArtifactIds>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.clerezza.platform.launcher.Main</mainClass>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Bundle-Name>Clerezza - Platform Launcher</Bundle-Name>
+                            <Bundle-SymbolicName>org.apache.clerezza.platform.launcher.tdb</Bundle-SymbolicName>
+                            <Bundle-Activator>org.apache.clerezza.platform.launcher.Main</Bundle-Activator>
+                            <Import-Package>org.osgi.framework,org.osgi.service.startlevel</Import-Package>
+                            <Private-Package>*</Private-Package>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.2.1</version>
+                <configuration>
+                    <finalName>clerezza-tdb</finalName>
+                    <descriptors>
+                        <descriptor>src/main/assembly/src.xml</descriptor>
+                    </descriptors>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
+                        <phase>package</phase> <!-- bind to the packaging phase -->
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.7</version>
+                <configuration>
+                    <target>
+                        <property name="vm.args" value=""/>
+                        <java fork="true" jar="${project.build.directory}/${project.build.finalName}.jar"
+                  dir="${project.build.directory}">
+                            <jvmarg line="-Xmx1024m -XX:MaxPermSize=256M -Dfile.encoding=utf-8 ${vm.args}"/>
+                        </java>
+                    </target>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>target/extracted/</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </resource>
+            <resource>
+                <targetPath>META-INF</targetPath>
+                <filtering>false</filtering>
+                <directory>${basedir}</directory>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.*</include>
+                </includes>
+            </resource>
+            <!-- the exclude rules are here because the maven-dependency-plugin
+            copies both -SNAPSHOT version as well as the one with the timestamp,
+            see http://jira.codehaus.org/browse/MDEP-209 -->
+            <resource>
+                <targetPath>bundles</targetPath>
+                <directory>target/bundles</directory>
+                <excludes>
+                    <exclude>**/*20*.*-*.jar</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.launcher.storageless</artifactId>
+            <scope>provided</scope>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
+        <!-- what makes this variant special -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.tdb.storage</artifactId>
+            <scope>runtime</scope>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-iri</artifactId>
+            <scope>runtime</scope>
+            <version>1.0.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.xerces</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.0_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.xmlresolver</artifactId>
+            <scope>runtime</scope>
+            <version>1.2_5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-core</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-arq</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-tdb</artifactId>
+            <scope>runtime</scope>
+            <version>1.0.1_1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>14.0</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/main/appended-resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/main/appended-resources/META-INF/NOTICE b/platform/launcher.tdb/src/main/appended-resources/META-INF/NOTICE
new file mode 100644
index 0000000..7d1928c
--- /dev/null
+++ b/platform/launcher.tdb/src/main/appended-resources/META-INF/NOTICE
@@ -0,0 +1,18 @@
+
+- Mort Bay Jetty Project (http://www.mortbay.org/jetty/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- WYMIWYG (http://wymiwyg.org/)
+- HP Labs Semantic Web Research (http://www.hpl.hp.com/semweb/)
+- The OSGi Alliance (http://www.osgi.org/)
+- Yahoo! Inc. (http://yahoo.com/)
+- Eclipse Foundation (http://eclipse.org/)
+- INRIA, France Telecom (http://asm.ow2.org/)
+- The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+- University of Bristol (http://stars.ilrt.bris.ac.uk/)
+- The University of Manchester (http://www.manchester.ac.uk/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- EPFL, Lausanne (http://www.epfl.ch/)
+
+This product includes JQuery and other javascript 
+files Licensed under the MIT License, see the individual
+files for their copyright notice.


[37/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/font.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/font.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/font.png
new file mode 100755
index 0000000..b7960db
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/font.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/help.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/help.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/help.png
new file mode 100755
index 0000000..5c87017
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/help.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/html.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/html.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/html.png
new file mode 100755
index 0000000..55d1072
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/html.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/information.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/information.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/information.png
new file mode 100755
index 0000000..12cd1ae
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/information.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_add.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_add.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_add.png
new file mode 100755
index 0000000..00be352
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_add.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_break.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_break.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_break.png
new file mode 100755
index 0000000..5235753
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/link_break.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_copy.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_copy.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_copy.png
new file mode 100755
index 0000000..195dc6d
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_copy.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_edit.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_edit.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_edit.png
new file mode 100755
index 0000000..046811e
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_edit.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_paste.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_paste.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_paste.png
new file mode 100755
index 0000000..968f073
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_paste.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_save.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_save.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_save.png
new file mode 100755
index 0000000..caea546
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/page_save.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintbrush.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintbrush.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintbrush.png
new file mode 100755
index 0000000..a3ecf87
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintbrush.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintcan.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintcan.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintcan.png
new file mode 100755
index 0000000..f82a886
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paintcan.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paste_plain.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paste_plain.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paste_plain.png
new file mode 100755
index 0000000..c0490eb
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/paste_plain.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/photo_add.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/photo_add.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/photo_add.png
new file mode 100755
index 0000000..63cc355
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/photo_add.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/pilcrow.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/pilcrow.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/pilcrow.png
new file mode 100755
index 0000000..95704fb
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/pilcrow.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/style.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/style.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/style.png
new file mode 100755
index 0000000..81e41de
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/style.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_center.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_center.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_center.png
new file mode 100755
index 0000000..57beb38
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_center.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_justify.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_justify.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_justify.png
new file mode 100755
index 0000000..2fbdd69
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_justify.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_left.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_left.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_left.png
new file mode 100755
index 0000000..6c8fcc1
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_left.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_right.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_right.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_right.png
new file mode 100755
index 0000000..a150257
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_align_right.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_bold.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_bold.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_bold.png
new file mode 100755
index 0000000..889ae80
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_bold.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_1.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_1.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_1.png
new file mode 100755
index 0000000..9c122e9
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_1.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_2.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_2.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_2.png
new file mode 100755
index 0000000..fbd8765
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_2.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_3.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_3.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_3.png
new file mode 100755
index 0000000..c7836cf
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_3.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_4.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_4.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_4.png
new file mode 100755
index 0000000..4e929ea
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_4.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_5.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_5.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_5.png
new file mode 100755
index 0000000..30cabeb
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_5.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_6.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_6.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_6.png
new file mode 100755
index 0000000..058170a
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_heading_6.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_horizontalrule.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_horizontalrule.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_horizontalrule.png
new file mode 100755
index 0000000..8dd1da1
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_horizontalrule.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent.png
new file mode 100755
index 0000000..9364532
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent_remove.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent_remove.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent_remove.png
new file mode 100755
index 0000000..1651b07
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_indent_remove.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_italic.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_italic.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_italic.png
new file mode 100755
index 0000000..8482ac8
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_italic.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_bullets.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_bullets.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_bullets.png
new file mode 100755
index 0000000..4a8672b
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_bullets.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_numbers.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_numbers.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_numbers.png
new file mode 100755
index 0000000..33b0b8d
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_list_numbers.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_strikethrough.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_strikethrough.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_strikethrough.png
new file mode 100755
index 0000000..612058a
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_strikethrough.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_subscript.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_subscript.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_subscript.png
new file mode 100755
index 0000000..1a2b010
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_subscript.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_superscript.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_superscript.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_superscript.png
new file mode 100755
index 0000000..2fb2a7c
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_superscript.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_underline.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_underline.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_underline.png
new file mode 100755
index 0000000..90d0df2
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/text_underline.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/tick.png
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/tick.png b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/tick.png
new file mode 100755
index 0000000..a9925a0
Binary files /dev/null and b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/images/silk/tick.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/docbook.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/docbook.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/docbook.rng
new file mode 100644
index 0000000..4d9dd78
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/docbook.rng
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook">
+
+	<start>
+		<ref name="db.book"/>
+  </start>
+	
+	<define name="db.attr.common">
+		<optional>
+			<attribute name="id"/>
+		</optional>
+	</define>
+  
+	<define name="db.book">
+		<element name="book">  
+			<ref name="db.book.info"/>
+			<oneOrMore>
+				<ref name="db.chapter"/>
+			</oneOrMore>
+		</element>
+	</define>
+	
+	<define name="db.book.info">
+		<ref name="db.title"/>
+		<optional>
+			<ref name="db.author"/>
+		</optional>
+  </define>
+	
+	<define name="db.title">
+		<element name="title">
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.author">
+		<element name="author">
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.chapter">
+		<element name="chapter">
+			<ref name="db.attr.common"/>
+			<ref name="db.title"/>
+			<oneOrMore>
+				<ref name="db.section"/>
+			</oneOrMore>
+		</element>
+	</define>
+	
+	<define name="db.section">
+		<element name="section">
+			<ref name="db.attr.common"/>
+			<ref name="db.title"/>
+			<oneOrMore>
+				<ref name="db.blocks"/>
+			</oneOrMore>
+		</element>
+	</define>
+	
+	<define name="db.para">
+		<element name="para">
+			<ref name="db.attr.common"/>
+			<ref name="db.inline"/>
+		</element>
+	</define>
+	
+	<define name="db.itemizedlist">
+		<element name="itemizedlist">
+			<ref name="db.attr.common"/>
+			<optional>
+				<attribute name="numeration"/>
+			</optional>
+			<optional>
+				<ref name="db.title"/>
+			</optional>
+			<oneOrMore>
+				<ref name="db.listitem"/>
+			</oneOrMore>
+		</element>
+	</define>
+	
+	<define name="db.listitem">
+		<element name="listitem">
+			<ref name="db.attr.common"/>
+			<ref name="db.inline"/>
+		</element>
+	</define>
+	
+	<define name="db.acronym">
+		<element name="acronym">
+			<ref name="db.attr.common"/>
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.code">
+		<element name="code">
+			<ref name="db.attr.common"/>
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.filename">
+		<element name="filename">
+			<ref name="db.attr.common"/>
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.emphasis">
+		<element name="emphasis">
+			<ref name="db.attr.common"/>
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.link">
+		<element name="link">
+			<ref name="db.attr.common"/>
+			<attribute name="href"/>
+			<text/>
+		</element>
+	</define>
+	
+	<define name="db.blocks">
+		<choice>
+			<ref name="db.section"/>
+			<ref name="db.para"/>
+			<ref name="db.itemizedlist"/>
+		</choice>
+	</define>
+	
+	<define name="db.inline">
+		<choice>
+			<text/>
+			<ref name="db.acronym"/>
+			<ref name="db.code"/>
+			<ref name="db.emphasis"/>
+			<ref name="db.filename"/>
+			<ref name="db.link"/>
+		</choice>
+	</define>
+  
+</grammar>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/local.conf
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/local.conf b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/local.conf
new file mode 100644
index 0000000..c9e1659
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/local.conf
@@ -0,0 +1,25 @@
+<?php
+
+// site branding
+$local_conf_no_wrap=ON;
+$local_conf_serve_as_is=ON;
+$local_conf_mime_types=ON;
+
+// toggle cvs commit view
+$local_conf_commits=OFF;
+
+// other configuration options
+// we need to set these with the correct defaults
+//
+// $local_conf_last_updated
+// $local_conf_serve_as_is
+// $local_conf_skin
+// $local_conf_nav_off
+//
+// $local_conf_use_local_error_pages // uses error/404.html unless $local_conf_error_page set
+// $local_conf_error_page = 'error/404.html'; // path relative to PROJECTNAME/www
+//
+// $local_conf_use_local_footer
+// $local_conf_auto_generate_memberlist
+
+?>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml-basic.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml-basic.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml-basic.rng
new file mode 100755
index 0000000..903f35d
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml-basic.rng
@@ -0,0 +1,727 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Test Schema -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+	xmlns:m="http://mozile.mozdev.org/ns/mes/1.0">
+
+<m:define name="Inline">
+	<m:command name="strong" class="Wrap" element="b" accel="Command-B"
+		label="Bold" image="silk/text_bold" tooltip="Make text bold"/>
+	<m:command name="em" class="Wrap" element="i" accel="Command-I"
+		label="Italic" image="silk/text_italic" tooltip="Italicize text"/>
+	<m:command name="underline" class="Wrap" accel="Command-U" element="u" 
+		label="Underline" image="silk/text_underline" tooltip="Underline text"/>
+	<m:command name="strikethrough" class="Wrap" element="strike"
+		label="Strikethrough" image="silk/text_strikethrough" tooltip="Strikethrough text"/>
+	<m:command name="superscript" class="Wrap" element="sup"
+		label="Superscript" image="silk/text_superscript" tooltip="Raise text"/>
+	<m:command name="subscript" class="Wrap" element="sub"
+		label="Subscript" image="silk/text_subscript" tooltip="Lower text"/>
+
+	<m:command name="link" class="Insert" element="a" remove="false"
+		label="Link" image="silk/link_add" tooltip="Create hyperlink">
+		<m:script>
+			<![CDATA[
+			this.prompt = function(event, state) {
+				if(!state || !state.element) return false;
+				var href = prompt("What is the URL for this link?", "");
+				if(!href) return false;
+				state.element.setAttribute("href", href);
+				return true;
+			}
+			]]>
+		</m:script>
+	</m:command>
+	<m:command name="unlink" class="Unwrap" target="localName a"
+		label="Remove Link" image="silk/link_break" tooltip="Remove hyperlinks"/>
+
+
+	<m:group name="formats"
+		label="Formats" image="silk/text_heading_1" tooltip="Select a format">
+
+		<m:command name="paragraph" class="Replace" element="p" target="block"
+			label="Paragraph" image="silk/pilcrow" tooltip="Use a paragraph"/>
+		<m:command name="h1" class="Replace" element="div" className="heading1" target="block" accel="Command-1"
+			label="Heading 1" image="silk/text_heading_1" tooltip="Use a first level heading"/>
+		<m:command name="h2" class="Replace" element="div" className="heading2" target="block" accel="Command-2"
+			label="Heading 2" image="silk/text_heading_2" tooltip="Use a second level heading"/>
+		<m:command name="h3" class="Replace" element="div" className="heading3" target="block" accel="Command-3"
+			label="Heading 3" image="silk/text_heading_3" tooltip="Use a third level heading"/>
+		<m:command name="nowiki" class="Replace" element="p" className="nowiki" target="block"
+			label="Nowiki" tooltip="Use a nowiki block"/>
+		<m:command name="pre" class="Replace" element="pre" target="block"
+			label="Pre-formatted" tooltip="Use pre-formatted text."/>
+		<m:command name="center" class="Replace" element="center" target="block"
+			label="Center" tooltip="Center the text."/>
+		<m:command name="blockquote" class="Replace" element="blockquote" target="block"
+			label="Blockquote" tooltip="Use a blockquote."/>
+		<m:command name="listitem" class="Replace" element="li" target="block"
+			label="List Item" tooltip="Use list item."/>
+		<m:command name="unformat" class="Unwrap" target="block"
+			label="Unformat" tooltip="Remove formatting"/>
+
+	</m:group>
+
+	<m:group name="insertion"
+		label="Insert Objects" image="silk/photo_add" tooltip="Insert objects">
+
+		<m:command name="image" class="Insert" element="img"
+			label="Image" image="silk/photo_add" tooltip="Insert an image">
+			<m:script>
+				<![CDATA[
+				this.prompt = function(event, state) {
+					if(!state || !state.element) return false;
+					var src = prompt("What is the URL for this image?", "");
+					if(!src) return false;
+					state.element.setAttribute("src", src);
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+
+		<m:command name="lineBreak" class="Insert" element="br" accel="Shift-Return"
+			label="Line-Break" tooltip="Insert a line-break"/>
+		<m:command name="hr" class="Insert" element="hr"
+			label="Horizontal Rule" image="silk/text_horizontalrule" tooltip="Insert a horizontal rule"/>
+		<m:command name="unorderedList" class="Insert"
+			label="Unordered List" image="silk/text_list_bullets" tooltip="Insert an unordered list">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("ul");
+				var li = mozile.dom.createElement("li");
+				li.appendChild(document.createTextNode(mozile.emptyToken));
+				this.element.appendChild(li);
+				]]>
+			</m:script>
+		</m:command>
+		<m:command name="orderedList" class="Insert"
+			label="Ordered List" image="silk/text_list_numbers" tooltip="Insert an ordered list">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("ol");
+				var li = mozile.dom.createElement("li");
+				li.appendChild(document.createTextNode(mozile.emptyToken));
+				this.element.appendChild(li);
+				]]>
+			</m:script>
+		</m:command>
+
+		<m:command name="style" class="Command"
+			label="Change Style" image="" tooltip="Change the element's style">
+			<m:script>
+				<![CDATA[  
+				// Find the target and get the new style.
+				this.prompt = function(event, state) {
+					var selection = mozile.dom.selection.get();
+					if(!selection) return false;
+					var range = selection.getRangeAt(0);
+					if(!range) return false;
+					var target = range.commonAncestorContainer;
+					if(!target) return false;
+					if(target.nodeType == mozile.dom.TEXT_NODE) target = target.parentNode;
+					state.target = target;
+					state.oldStyle = "";
+					if(mozile.browser.isIE) {
+						if(target.style.cssText) state.oldStyle = target.style.cssText;
+					}
+					else if(target.getAttribute("style")) {
+						state.oldStyle = target.getAttribute("style");
+					}
+					var style = prompt("What should the style of the element '"+ target.nodeName +"' be?", state.oldStyle);
+					if(style) {
+						state.newStyle = style;
+						return true;
+					}
+					return false;
+				}
+				this.execute = function(state, fresh) {
+					if(mozile.browser.isIE) {
+						state.target.style.cssText = state.newStyle;
+					}
+					else state.target.setAttribute("style", state.newStyle);
+					state.executed = true;
+					return state;
+				}
+				this.unexecute = function(state, fresh) {
+					if(mozile.browser.isIE) {
+						state.target.style.cssText = state.oldStyle;
+					}
+					else state.target.setAttribute("style", state.oldStyle);
+					state.executed = false;
+					return state;
+				}
+				]]>
+			</m:script>
+		</m:command>
+
+		<m:command name="attribute" class="Command" accel="Command-Shift-A"
+			label="Change an Attribute" image="" tooltip="Change an attribute of the element">
+			<m:script>
+				<![CDATA[  
+				// Find the target and get the new style.
+				this.prompt = function(event, state) {
+					var selection = mozile.dom.selection.get();
+					if(!selection) return false;
+					var range = selection.getRangeAt(0);
+					if(!range) return false;
+					var target = range.commonAncestorContainer;
+					if(!target) return false;
+					if(target.nodeType == mozile.dom.TEXT_NODE) target = target.parentNode;
+					state.target = target;
+					var attr = prompt("What attribute of the element '"+ target.nodeName +"' should be changed?", "");
+					if(!attr) return false;
+					state.attr = attr;
+					state.oldValue = "";
+					if(attr.toLowerCase() == "style" && mozile.browser.isIE) {
+						if(target.style.cssText) state.oldValue = target.style.cssText;
+					}
+					else if(target.getAttribute(attr)) {
+						state.oldValue = target.getAttribute(attr);
+					}
+					var value = prompt("What should the value of '"+ attr +"' be?", state.oldValue);
+					if(value) {
+						state.newValue = value;
+						return true;
+					}
+					return false;
+				}
+				this.execute = function(state, fresh) {
+					if(state.attr.toLowerCase() == "style" && mozile.browser.isIE) {
+						state.target.style.cssText = state.newValue;
+					}
+					else state.target.setAttribute(state.attr, state.newValue);
+					state.executed = true;
+					return state;
+				}
+				this.unexecute = function(state, fresh) {
+					if(state.attr.toLowerCase() == "style" && mozile.browser.isIE) {
+						state.target.style.cssText = state.oldValue;
+					}
+					else state.target.setAttribute(state.attr, state.oldValue);
+					state.executed = false;
+					return state;
+				}
+				]]>
+			</m:script>
+		</m:command>
+
+	</m:group>
+
+</m:define>
+
+
+<define name="Common.attrib">
+	<optional>
+		<attribute name="id"/>
+	</optional>
+	<!--<ref name="Core.attrib"/>
+	<ref name="I18n.attrib"/>-->
+</define>
+
+<define name="br">
+	<element name="br">
+		<!--<ref name="Core.attrib"/>-->
+		<ref name="Common.attrib"/>
+		<empty/>
+	</element>
+</define>
+
+<define name="span">
+	<element name="span">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="a">
+	<element name="a">
+		<ref name="a.attlist"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="a.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="href">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="charset">
+			<ref name="Charset.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="type">
+			<ref name="ContentType.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="hreflang">
+			<ref name="LanguageCode.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="rel">
+			<ref name="LinkTypes.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="rev">
+			<ref name="LinkTypes.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="accesskey">
+			<ref name="Character.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="tabindex">
+			<ref name="Number.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<!--
+<define name="abbr">
+	<element name="abbr">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="acronym">
+	<element name="acronym">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="cite">
+	<element name="cite">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="code">
+	<element name="code">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="dfn">
+	<element name="dfn">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="em">
+	<element name="em">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="i">
+	<element name="i">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="kbd">
+	<element name="kbd">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="q">
+	<element name="q">
+		<ref name="q.attlist"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="q.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="cite">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<define name="samp">
+	<element name="samp">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="strong">
+	<element name="strong">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="b">
+	<element name="b">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="u">
+	<element name="u">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="s">
+	<element name="s">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="sub">
+	<element name="sub">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="sup">
+	<element name="sup">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="var">
+	<element name="var">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="div">
+	<element name="div">
+		<ref name="Common.attrib"/>
+		<ref name="Flow.model"/>
+	</element>
+</define>
+
+<define name="p">
+	<element name="p">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="center">
+	<element name="center">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="address">
+	<element name="address">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="blockquote">
+	<element name="blockquote">
+		<ref name="blockquote.attlist"/>
+		<ref name="Block.model"/>
+	</element>
+</define>
+
+<define name="blockquote.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="cite">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<define name="pre">
+	<element name="pre">
+		<ref name="pre.attlist"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="pre.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="xml:space">
+			<value>preserve</value>
+		</attribute>
+	</optional>
+</define>
+
+<define name="h1">
+	<element name="h1">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h2">
+	<element name="h2">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h3">
+	<element name="h3">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h4">
+	<element name="h4">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h5">
+	<element name="h5">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+
+<define name="h6">
+	<element name="h6">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+
+<define name="Heading.attrib">
+	<ref name="Common.attrib"/>
+</define>
+ 
+<define name="Heading.content">
+	<ref name="Inline.model"/>
+</define>
+
+<define name="Heading.class">
+	<choice>
+		<ref name="h1"/>
+		<ref name="h2"/>
+		<ref name="h3"/>
+		<ref name="h4"/>
+		<ref name="h5"/>
+		<ref name="h6"/>
+	</choice>
+</define>
+
+<define name="Block.class">
+	<choice>
+		<!--<ref name="address"/>-->
+		<ref name="blockquote"/>
+		<ref name="center"/>
+		<ref name="div"/>
+		<ref name="p"/>
+		<ref name="pre"/>
+		<ref name="Heading.class"/>
+		<ref name="hr"/>
+		<ref name="br"/>
+	</choice>
+</define>
+
+<define name="Inline.class">
+	<choice>
+		<ref name="a"/>
+		<!--
+		<ref name="abbr"/>
+		<ref name="acronym"/>
+		-->
+		<ref name="br"/>
+		<!--
+		<ref name="cite"/>
+		-->
+		<ref name="code"/>
+		<!--
+		<ref name="dfn"/>
+		-->
+		<ref name="em"/>
+		<!--
+		<ref name="kbd"/>
+		<ref name="q"/>
+		<ref name="samp"/>
+		-->
+		<ref name="span"/>
+		<ref name="strong"/>
+		<ref name="sub"/>
+		<ref name="sup"/>
+		<!--
+		<ref name="var"/>
+		-->
+		<ref name="br"/>
+		<!-- Added -->
+		<ref name="img"/>
+	</choice>
+</define>
+
+<define name="Inline.model">
+	<m:ref name="Inline"/>
+	<zeroOrMore>
+		<choice>
+			<text/>
+			<ref name="Inline.class"/>
+		</choice>
+	</zeroOrMore>
+</define>
+
+<!-- This is redefined by the legacy module to include inlines. -->
+<define name="Block.mix">
+	<ref name="Block.class"/>
+</define>
+
+<define name="Block.model">
+	<oneOrMore>
+		<ref name="Block.mix"/>
+	</oneOrMore>
+</define>
+
+<define name="Flow.model">
+	<m:ref name="Inline"/>
+	<zeroOrMore>
+		<choice>
+			<!--<text/>-->
+			<ref name="Inline.class"/>
+			<ref name="Block.class"/>
+		</choice>
+	</zeroOrMore>
+</define>
+
+<define name="dl">
+	<element name="dl">
+		<ref name="Common.attrib"/>
+		<oneOrMore>
+			<choice>
+	<ref name="dt"/>
+	<ref name="dd"/>
+			</choice>
+		</oneOrMore>
+	</element>
+</define>
+
+<define name="dt">
+	<element name="dt">
+	<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="dd">
+	<element name="dd">
+		<ref name="Common.attrib"/>
+		<ref name="Flow.model"/>
+	</element>
+</define>
+
+<define name="ol">
+	<element name="ol">
+		<ref name="Common.attrib"/>
+		<oneOrMore>
+			<ref name="li"/>
+		</oneOrMore>
+	</element>
+</define>
+
+<define name="ul">
+	<element name="ul">
+		<ref name="Common.attrib"/>
+		<oneOrMore>
+			<ref name="li"/>
+		</oneOrMore>
+	</element>
+</define>
+
+<define name="li">
+	<element name="li">
+		<ref name="Common.attrib"/>
+		<!--<ref name="Flow.model"/>-->
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="List.class">
+	<choice>
+		<ref name="ul"/>
+		<ref name="ol"/>
+		<ref name="dl"/>
+	</choice>
+</define>
+
+<define name="Block.class" combine="choice">
+	<ref name="List.class"/>
+</define>
+
+<define name="img">
+	<element name="img">
+		<ref name="img.attlist"/>
+	</element>
+</define>
+
+<define name="img.attlist">
+	<ref name="Common.attrib"/>
+	<attribute name="src">
+		<ref name="URI.datatype"/>
+	</attribute>
+	<attribute name="alt">
+		<ref name="Text.datatype"/>
+	</attribute>
+	<optional>
+		<attribute name="longdesc">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="height">
+			<ref name="Length.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="width">
+			<ref name="Length.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<define name="hr">
+	<element name="hr">
+		<ref name="Common.attrib"/>
+	</element>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml.rng
new file mode 100755
index 0000000..6871001
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml.rng
@@ -0,0 +1,993 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Test Schema -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+	xmlns:m="http://mozile.mozdev.org/ns/mes/1.0">
+
+<m:define name="Inline">
+	<!-- Text commands -->
+	<m:command name="splitInline" class="Split" target="block" accel="Return Enter"/>
+	<m:command name="nonBreakingSpace" class="Insert" priority="11" text="&#x00A0;" accel="Shift-Space"/>
+	<m:command name="nextBlock" class="Navigate" direction="next" target="block" accel="Tab"/>
+	<m:command name="prevBlock" class="Navigate" direction="previous" target="block" accel="Shift-Tab"/>
+
+	<!-- Toolbar commands -->
+	<m:command name="strong" class="Wrap" element="strong" accel="Command-B"
+		label="Bold" image="silk/text_bold" tooltip="Make text bold"/>
+	<m:command name="em" class="Wrap" element="em" accel="Command-I"
+		label="Italic" image="silk/text_italic" tooltip="Italicize text"/>
+	<m:command name="underline" class="Wrap" accel="Command-U" 
+		element="span" styleName="text-decoration" styleValue="underline"
+		label="Underline" image="silk/text_underline" tooltip="Underline text"/>
+	<m:command name="strikethrough" class="Wrap"
+		element="span" styleName="text-decoration" styleValue="line-through"
+		label="Strikethrough" image="silk/text_strikethrough" tooltip="Strikethrough text"/>
+	<m:command name="superscript" class="Wrap" element="sup"
+		label="Superscript" image="silk/text_superscript" tooltip="Raise text"/>
+	<m:command name="subscript" class="Wrap" element="sub"
+		label="Subscript" image="silk/text_subscript" tooltip="Lower text"/>
+	<m:command name="indent" class="Style" target="block" styleName="text-indent"
+		label="Indent" image="silk/text_indent" tooltip="Indent text">
+		<m:script>
+			<![CDATA[
+			this.styleValue = function(event, state) {
+				if(!state.targetNode || !state.targetNode.style) return null;
+				var value = state.targetNode.style[state.styleName];
+				if(value) {
+					var match = value.match(/(\d+)pt/);
+					if(match && match[1]) {
+						value = Number(match[1]);
+						return (value + 12) +"pt";
+					}
+				}
+				return "12pt";
+			}
+			]]>
+		</m:script>
+	</m:command>
+	<m:command name="unindent" class="Style" target="block" styleName="text-indent"
+		label="Unindent" image="silk/text_indent_remove" tooltip="Unindent text">
+		<m:script>
+			<![CDATA[
+			this.styleValue = function(event, state) {
+				if(!state.targetNode || !state.targetNode.style) return null;
+				var value = state.targetNode.style[state.styleName];
+				if(value) {
+					var match = value.match(/(\d+)pt/);
+					if(match && match[1]) {
+						value = Number(match[1]);
+						if(value - 12 > 0) return (value - 12) +"pt";
+					}
+					return "";
+				}
+				return null;
+			}
+			]]>
+		</m:script>
+	</m:command>
+
+	<m:command name="link" class="Insert" element="a" remove="false"
+		label="Link" image="silk/link_add" tooltip="Create hyperlink">
+		<m:script>
+			<![CDATA[
+			this.prompt = function(event, state) {
+				if(!state || !state.element) return false;
+				var href = prompt("What is the URL for this link?", "");
+				if(!href) return false;
+				state.element.setAttribute("href", href);
+				return true;
+			}
+			]]>
+		</m:script>
+	</m:command>
+	<m:command name="unlink" class="Unwrap" target="localName a"
+		label="Remove Link" image="silk/link_break" tooltip="Remove hyperlinks"/>
+
+	<m:group name="fonts"
+		label="Fonts" image="silk/font" tooltip="Select a font">
+		<m:command name="setFont" class="Wrap" accel="Command-Shift-F"
+			label="Set Font" image="silk/font" tooltip="Set the font">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("span");
+				this.prompt = function(event, state) {
+					if(!state || !state.wrapper) return false;
+					var font = prompt("What font-family should be used?", "");
+					if(!font) return false;
+					mozile.dom.setStyle(state.wrapper, "font-family", font);
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		
+		<m:separator/>
+		
+		<m:command name="times" class="Wrap"
+			element="span" styleName="font-family" styleValue="smaller"
+			label="Times" tooltip="Use Times font"/>
+		<m:command name="arial" class="Wrap"
+			element="span" styleName="font-family" styleValue="arial, sans-serif"
+			label="Arial" tooltip="Use Arial font"/>
+		<m:command name="courier" class="Wrap"
+			element="span" styleName="font-family" styleValue="courier, monospace"
+			label="Courier" tooltip="Use courier font"/>
+		<m:separator/>
+		<m:command name="serif" class="Wrap"
+			element="span" styleName="font-family" styleValue="serif"
+			label="Serif" tooltip="Use serif font"/>
+		<m:command name="sans-serif" class="Wrap"
+			element="span" styleName="font-family" styleValue="sans-serif"
+			label="Sans-Serif" tooltip="Use sans-serif font"/>
+		<m:command name="monospace" class="Wrap"
+			element="span" styleName="font-family" styleValue="monospace"
+			label="Monospace" tooltip="Use monospace font"/>
+	</m:group>
+
+	<m:group name="sizes"
+		label="Sizes" image="silk/style" tooltip="Select a font size">
+		<m:command name="setSize" class="Wrap"
+			label="Set Size" image="silk/style" tooltip="Set the font size">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("span");
+				this.prompt = function(event, state) {
+					if(!state || !state.wrapper) return false;
+					var size = prompt("What should the font-size be?", "");
+					if(!size) return false;
+					mozile.dom.setStyle(state.wrapper, "font-size", size);
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		
+		<m:separator/>
+		
+		<m:command name="smaller" class="Wrap"
+			element="span" styleName="font-size" styleValue="smaller"
+			label="Smaller" tooltip="Make text smaller"/>
+		<m:command name="xx-small" class="Wrap"
+			element="span" styleName="font-size" styleValue="xx-small"
+			label="Extremely Small" tooltip="Make text extremely small"/>
+		<m:command name="x-small" class="Wrap"
+			element="span" styleName="font-size" styleValue="x-small"
+			label="Very Small" tooltip="Make text very small"/>
+		<m:command name="small" class="Wrap"
+			element="span" styleName="font-size" styleValue="small"
+			label="Small" tooltip="Make text small"/>
+		<m:command name="medium" class="Wrap"
+			element="span" styleName="font-size" styleValue="medium"
+			label="Medium" tooltip="Make text medium size"/>
+		<m:command name="large" class="Wrap"
+			element="span" styleName="font-size" styleValue="large"
+			label="Large" tooltip="Make text large"/>
+		<m:command name="x-large" class="Wrap"
+			element="span" styleName="font-size" styleValue="x-large"
+			label="Very Large" tooltip="Make text very large"/>
+		<m:command name="xx-large" class="Wrap"
+			element="span" styleName="font-size" styleValue="xx-large"
+			label="Extremely Large" tooltip="Make text extremely large"/>
+		<m:command name="larger" class="Wrap"
+			element="span" styleName="font-size" styleValue="larger"
+			label="Larger" tooltip="Make text larger"/>
+	</m:group>
+
+	<m:group name="formats"
+		label="Formats" image="silk/text_heading_1" tooltip="Select a format">
+
+		<m:command name="paragraph" class="Replace" element="p" target="block"
+			label="Paragraph" image="silk/pilcrow" tooltip="Use a paragraph"/>
+		<m:command name="h1" class="Replace" element="h1" target="block" accel="Command-1"
+			label="Heading 1" image="silk/text_heading_1" tooltip="Use a first level heading"/>
+		<m:command name="h2" class="Replace" element="h2" target="block" accel="Command-2"
+			label="Heading 2" image="silk/text_heading_2" tooltip="Use a second level heading"/>
+		<m:command name="h3" class="Replace" element="h3" target="block" accel="Command-3"
+			label="Heading 3" image="silk/text_heading_3" tooltip="Use a third level heading"/>
+		<m:command name="h4" class="Replace" element="h4" target="block" accel="Command-4"
+			label="Heading 4" image="silk/text_heading_4" tooltip="Use a fourth level heading"/>
+		<m:command name="h5" class="Replace" element="h5" target="block" accel="Command-5"
+			label="Heading 5" image="silk/text_heading_5" tooltip="Use a fifth level heading"/>
+		<m:command name="h6" class="Replace" element="h6" target="block" accel="Command-6"
+			label="Heading 6" image="silk/text_heading_6" tooltip="Use a sixth level heading"/>
+		<m:command name="pre" class="Replace" element="pre" target="block"
+			label="Pre-formatted" tooltip="Use pre-formatted text."/>
+		<m:command name="divison" class="Replace" element="div" target="block"
+			label="Division" tooltip="Use a division"/>
+		<m:command name="listitem" class="Replace" element="li" target="block"
+			label="List Item" tooltip="Use list item."/>
+		<m:command name="unformat" class="Unwrap" target="block"
+			label="Unformat" tooltip="Remove formatting"/>
+
+	</m:group>
+
+	<m:group name="justifications"
+		label="Justifications" image="silk/text_align_left" tooltip="Justify text">
+
+		<m:command name="left" class="Style" styleName="text-align" styleValue="left" target="block"
+			label="Align left" image="silk/text_align_left" tooltip="Align the text to the left margin"/>
+		<m:command name="right" class="Style" styleName="text-align" styleValue="right" target="block"
+			label="Align right" image="silk/text_align_right" tooltip="Align the text to the right margin"/>
+		<m:command name="center" class="Style" styleName="text-align" styleValue="center" target="block"
+			label="Center" image="silk/text_align_center" tooltip="Center the text"/>
+		<m:command name="justify" class="Style" styleName="text-align" styleValue="justify" target="block"
+			label="Justify" image="silk/text_align_justify" tooltip="Justify the text"/>
+
+	</m:group>
+
+	<m:group name="textColor"
+		label="Text Color" image="silk/paintbrush" tooltip="Choose text color">
+
+		<m:command name="setTextColor" class="Wrap"
+			label="Set Text Color" image="silk/paintbrush" tooltip="Set the text color">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("span");
+				this.prompt = function(event, state) {
+					if(!state || !state.wrapper) return false;
+					var color = prompt("What color should the text be?", "");
+					if(!color) return false;
+					mozile.dom.setStyle(state.wrapper, "color", color);
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		
+		<m:separator/>
+		
+		<m:command name="blackText" class="Wrap"
+			element="span" styleName="color" styleValue="black"
+			label="Black" tooltip="Make text black"/>
+		<m:command name="whiteText" class="Wrap"
+			element="span" styleName="color" styleValue="white"
+			label="White" tooltip="Make text white"/>
+		<m:command name="grayText" class="Wrap"
+			element="span" styleName="color" styleValue="gray"
+			label="Gray" tooltip="Make text gray"/>
+		<m:command name="redText" class="Wrap"
+			element="span" styleName="color" styleValue="red"
+			label="Red" tooltip="Make text red"/>
+		<m:command name="blueText" class="Wrap"
+			element="span" styleName="color" styleValue="blue"
+			label="Blue" tooltip="Make text blue"/>
+		<m:command name="greenText" class="Wrap"
+			element="span" styleName="color" styleValue="green"
+			label="Green" tooltip="Make text green"/>
+		<m:command name="yellowText" class="Wrap"
+			element="span" styleName="color" styleValue="yellow"
+			label="Yellow" tooltip="Make text yellow"/>
+		<m:command name="orangeText" class="Wrap"
+			element="span" styleName="color" styleValue="orange"
+			label="Orange" tooltip="Make text orange"/>
+		<m:command name="purpleText" class="Wrap"
+			element="span" styleName="color" styleValue="purple"
+			label="Purple" tooltip="Make text purple"/>
+	</m:group>
+
+	<m:group name="backgroundColor"
+		label="Background Color" image="silk/paintcan" tooltip="Choose background color">
+		<m:command name="setBackgroundColor" class="Wrap"
+			label="Set Background Color" image="silk/paintcan" tooltip="Set the background color">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("span");
+				this.prompt = function(event, state) {
+					if(!state || !state.wrapper) return false;
+					var color = prompt("What colour should the background be?", "");
+					if(!color) return false;
+					mozile.dom.setStyle(state.wrapper, "background-color", color);
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		
+		<m:separator/>
+		
+		<m:command name="blackBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="black"
+			label="Black" tooltip="Make background black"/>
+		<m:command name="whiteBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="white"
+			label="White" tooltip="Make background white"/>
+		<m:command name="grayBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="gray"
+			label="Gray" tooltip="Make background gray"/>
+		<m:command name="redBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="red"
+			label="Red" tooltip="Make background red"/>
+		<m:command name="blueBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="blue"
+			label="Blue" tooltip="Make background blue"/>
+		<m:command name="greenBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="green"
+			label="Green" tooltip="Make background green"/>
+		<m:command name="yellowBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="yellow"
+			label="Yellow" tooltip="Make background yellow"/>
+		<m:command name="orangeBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="orange"
+			label="Orange" tooltip="Make background orange"/>
+		<m:command name="purpleBackground" class="Wrap"
+			element="span" styleName="background-color" styleValue="purple"
+			label="Purple" tooltip="Make background purple"/>
+	</m:group>
+
+	<m:group name="insertion"
+		label="Insert Objects" image="silk/photo_add" tooltip="Insert objects">
+
+		<m:command name="image" class="Insert" element="img"
+			label="Image" image="silk/photo_add" tooltip="Insert an image">
+			<m:script>
+				<![CDATA[
+				this.prompt = function(event, state) {
+					if(!state || !state.element) return false;
+					var src = prompt("What is the URL for this image?", "");
+					if(!src) return false;
+					state.element.setAttribute("src", src);
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+
+		<m:command name="lineBreak" class="Insert" accel="Shift-Return Shift-Enter"
+			label="Line-Break" tooltip="Insert a line-break">			
+			<m:script>
+				<![CDATA[
+				this.prompt = function(event, state) {
+					var selection = mozile.dom.selection.get();
+					var whitespace = mozile.dom.getStyle(selection.focusNode, "white-space");
+					if(whitespace != "pre") state.element = mozile.dom.createElement("br");
+					else if(mozile.browser.isIE) state.text = "\r";
+					else state.text = "\n";
+					return true;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		<m:command name="hr" class="Insert" element="hr"
+			label="Horizontal Rule" image="silk/text_horizontalrule" tooltip="Insert a horizontal rule"/>
+		<m:command name="unorderedList" class="Insert"
+			label="Unordered List" image="silk/text_list_bullets" tooltip="Insert an unordered list">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("ul");
+				var li = mozile.dom.createElement("li");
+				li.appendChild(document.createTextNode(mozile.emptyToken));
+				this.element.appendChild(li);
+				]]>
+			</m:script>
+		</m:command>
+		<m:command name="orderedList" class="Insert"
+			label="Ordered List" image="silk/text_list_numbers" tooltip="Insert an ordered list">
+			<m:script>
+				<![CDATA[
+				this.element = mozile.dom.createElement("ol");
+				var li = mozile.dom.createElement("li");
+				li.appendChild(document.createTextNode(mozile.emptyToken));
+				this.element.appendChild(li);
+				]]>
+			</m:script>
+		</m:command>
+			
+		<m:command name="title" class="Command"
+			label="Change Title" image="" tooltip="Change document title">
+			<m:script>
+				<![CDATA[	 
+				// Find the title node and get the new title.
+				this.prompt = function(event, state) {
+					var titles = document.documentElement.getElementsByTagName("title");
+					if(titles && titles.length != 0) {
+						state.titleNode = titles[0];
+						state.oldTitle = document.title;
+						var title = prompt("What should the title be?", state.oldTitle);
+						if(title) {
+							state.newTitle = title;
+							return true;
+						}
+					}
+					else alert("Could not set title. Document does not have a title element.");
+					return false;
+				}
+				this.execute = function(state, fresh) {
+					if(mozile.browser.isMozilla) {
+						mozile.dom.removeChildNodes(state.titleNode);
+						state.titleNode.appendChild(document.createTextNode(state.newTitle));
+					}
+					document.title = state.newTitle;
+					state.executed = true;
+					return state;
+				}
+				this.unexecute = function(state, fresh) {
+					if(mozile.browser.isMozilla) {
+						mozile.dom.removeChildNodes(state.titleNode);
+						state.titleNode.appendChild(document.createTextNode(state.oldTitle));
+					}
+					document.title = state.oldTitle;
+					state.executed = false;
+					return state;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		<m:command name="style" class="Command"
+			label="Change Style" image="" tooltip="Change the element's style">
+			<m:script>
+				<![CDATA[	 
+				// Find the target and get the new style.
+				this.prompt = function(event, state) {
+					var selection = mozile.dom.selection.get();
+					if(!selection) return false;
+					var range = selection.getRangeAt(0);
+					if(!range) return false;
+					var target = range.commonAncestorContainer;
+					if(!target) return false;
+					if(target.nodeType == mozile.dom.TEXT_NODE) target = target.parentNode;
+					state.target = target;
+					state.oldStyle = "";
+					if(mozile.browser.isIE) {
+						if(target.style.cssText) state.oldStyle = target.style.cssText;
+					}
+					else if(target.getAttribute("style")) {
+						state.oldStyle = target.getAttribute("style");
+					}
+					var style = prompt("What should the style of the element '"+ target.nodeName +"' be?", state.oldStyle);
+					if(style) {
+						state.newStyle = style;
+						return true;
+					}
+					return false;
+				}
+				this.execute = function(state, fresh) {
+					if(mozile.browser.isIE) {
+						state.target.style.cssText = state.newStyle;
+					}
+					else state.target.setAttribute("style", state.newStyle);
+					state.executed = true;
+					return state;
+				}
+				this.unexecute = function(state, fresh) {
+					if(mozile.browser.isIE) {
+						state.target.style.cssText = state.oldStyle;
+					}
+					else state.target.setAttribute("style", state.oldStyle);
+					state.executed = false;
+					return state;
+				}
+				]]>
+			</m:script>
+		</m:command>
+		<m:command name="attribute" class="Command" accel="Command-Shift-A"
+			label="Change an Attribute" image="" tooltip="Change an attribute of the element">
+			<m:script>
+				<![CDATA[	 
+				// Find the target and get the new style.
+				this.prompt = function(event, state) {
+					var selection = mozile.dom.selection.get();
+					if(!selection) return false;
+					var range = selection.getRangeAt(0);
+					if(!range) return false;
+					var target = range.commonAncestorContainer;
+					if(!target) return false;
+					if(target.nodeType == mozile.dom.TEXT_NODE) target = target.parentNode;
+					state.target = target;
+					var attr = prompt("What attribute of the element '"+ target.nodeName +"' should be changed?", "");
+					if(!attr) return false;
+					state.attr = attr;
+					state.oldValue = "";
+					if(attr.toLowerCase() == "style" && mozile.browser.isIE) {
+						if(target.style.cssText) state.oldValue = target.style.cssText;
+					}
+					else if(target.getAttribute(attr)) {
+						state.oldValue = target.getAttribute(attr);
+					}
+					var value = prompt("What should the value of '"+ attr +"' be?", state.oldValue);
+					if(value) {
+						state.newValue = value;
+						return true;
+					}
+					return false;
+				}
+				this.execute = function(state, fresh) {
+					if(state.attr.toLowerCase() == "style" && mozile.browser.isIE) {
+						state.target.style.cssText = state.newValue;
+					}
+					else state.target.setAttribute(state.attr, state.newValue);
+					state.executed = true;
+					return state;
+				}
+				this.unexecute = function(state, fresh) {
+					if(state.attr.toLowerCase() == "style" && mozile.browser.isIE) {
+						state.target.style.cssText = state.oldValue;
+					}
+					else state.target.setAttribute(state.attr, state.oldValue);
+					state.executed = false;
+					return state;
+				}
+				]]>
+			</m:script>
+		</m:command>
+
+	</m:group>
+</m:define>
+
+
+<define name="Common.attrib">
+	<optional>
+		<attribute name="id"/>
+	</optional>
+	<!--<ref name="Core.attrib"/>
+	<ref name="I18n.attrib"/>-->
+</define>
+
+<define name="br">
+	<element name="br">
+		<!--<ref name="Core.attrib"/>-->
+		<ref name="Common.attrib"/>
+		<empty/>
+	</element>
+</define>
+
+<define name="span">
+	<element name="span">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="a">
+	<element name="a">
+		<ref name="a.attlist"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="a.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="href">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="charset">
+			<ref name="Charset.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="type">
+			<ref name="ContentType.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="hreflang">
+			<ref name="LanguageCode.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="rel">
+			<ref name="LinkTypes.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="rev">
+			<ref name="LinkTypes.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="accesskey">
+			<ref name="Character.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="tabindex">
+			<ref name="Number.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<!--
+<define name="abbr">
+	<element name="abbr">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="acronym">
+	<element name="acronym">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="cite">
+	<element name="cite">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="code">
+	<element name="code">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="dfn">
+	<element name="dfn">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="em">
+	<element name="em">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="kbd">
+	<element name="kbd">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="q">
+	<element name="q">
+		<ref name="q.attlist"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="q.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="cite">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<define name="samp">
+	<element name="samp">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="strong">
+	<element name="strong">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="sub">
+	<element name="sub">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="sup">
+	<element name="sup">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="var">
+	<element name="var">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+-->
+
+<define name="div">
+	<element name="div">
+		<ref name="Common.attrib"/>
+		<ref name="Flow.model"/>
+	</element>
+</define>
+
+<define name="p">
+	<element name="p">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<!--
+<define name="address">
+	<element name="address">
+		<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="blockquote">
+	<element name="blockquote">
+		<ref name="blockquote.attlist"/>
+		<ref name="Block.model"/>
+	</element>
+</define>
+
+<define name="blockquote.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="cite">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+</define>
+-->
+
+<define name="pre">
+	<element name="pre">
+		<ref name="pre.attlist"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="pre.attlist">
+	<ref name="Common.attrib"/>
+	<optional>
+		<attribute name="xml:space">
+			<value>preserve</value>
+		</attribute>
+	</optional>
+</define>
+
+<define name="h1">
+	<element name="h1">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h2">
+	<element name="h2">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h3">
+	<element name="h3">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h4">
+	<element name="h4">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+ 
+<define name="h5">
+	<element name="h5">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+
+<define name="h6">
+	<element name="h6">
+		<ref name="Heading.attrib"/>
+		<ref name="Heading.content"/>
+	</element>
+</define>
+
+<define name="Heading.attrib">
+	<ref name="Common.attrib"/>
+</define>
+ 
+<define name="Heading.content">
+	<ref name="Inline.model"/>
+</define>
+
+<define name="Heading.class">
+	<choice>
+		<ref name="h1"/>
+		<ref name="h2"/>
+		<ref name="h3"/>
+		<ref name="h4"/>
+		<ref name="h5"/>
+		<ref name="h6"/>
+	</choice>
+</define>
+
+<define name="Block.class">
+	<choice>
+		<!--<ref name="address"/>
+		<ref name="blockquote"/>-->
+		<ref name="div"/>
+		<ref name="p"/>
+		<ref name="pre"/>
+		<ref name="Heading.class"/>
+		<ref name="hr"/>
+		<ref name="br"/>
+	</choice>
+</define>
+
+<define name="Inline.class">
+	<choice>
+		<ref name="a"/>
+		<!--
+		<ref name="abbr"/>
+		<ref name="acronym"/>
+		-->
+		<ref name="br"/>
+		<!--
+		<ref name="cite"/>
+		-->
+		<ref name="code"/>
+		<!--
+		<ref name="dfn"/>
+		-->
+		<ref name="em"/>
+		<!--
+		<ref name="kbd"/>
+		<ref name="q"/>
+		<ref name="samp"/>
+		-->
+		<ref name="span"/>
+		<ref name="strong"/>
+		<ref name="sub"/>
+		<ref name="sup"/>
+		<!--
+		<ref name="var"/>
+		-->
+		<ref name="br"/>
+		<!-- Added -->
+		<ref name="img"/>
+	</choice>
+</define>
+
+<define name="Inline.model">
+	<m:ref name="Inline"/>
+	<zeroOrMore>
+		<choice>
+			<text/>
+			<ref name="Inline.class"/>
+		</choice>
+	</zeroOrMore>
+</define>
+
+<!-- This is redefined by the legacy module to include inlines. -->
+<define name="Block.mix">
+	<ref name="Block.class"/>
+</define>
+
+<define name="Block.model">
+	<oneOrMore>
+		<ref name="Block.mix"/>
+	</oneOrMore>
+</define>
+
+<define name="Flow.model">
+	<zeroOrMore>
+		<choice>
+			<!--<text/>-->
+			<ref name="Inline.class"/>
+			<ref name="Block.class"/>
+		</choice>
+	</zeroOrMore>
+</define>
+
+<define name="dl">
+	<element name="dl">
+		<ref name="Common.attrib"/>
+		<oneOrMore>
+			<choice>
+	<ref name="dt"/>
+	<ref name="dd"/>
+			</choice>
+		</oneOrMore>
+	</element>
+</define>
+
+<define name="dt">
+	<element name="dt">
+	<ref name="Common.attrib"/>
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="dd">
+	<element name="dd">
+		<ref name="Common.attrib"/>
+		<ref name="Flow.model"/>
+	</element>
+</define>
+
+<define name="ol">
+	<element name="ol">
+		<ref name="Common.attrib"/>
+		<oneOrMore>
+			<ref name="li"/>
+		</oneOrMore>
+	</element>
+</define>
+
+<define name="ul">
+	<element name="ul">
+		<ref name="Common.attrib"/>
+		<oneOrMore>
+			<ref name="li"/>
+		</oneOrMore>
+	</element>
+</define>
+
+<define name="li">
+	<element name="li">
+		<ref name="Common.attrib"/>
+		<!--<ref name="Flow.model"/>-->
+		<ref name="Inline.model"/>
+	</element>
+</define>
+
+<define name="List.class">
+	<choice>
+		<ref name="ul"/>
+		<ref name="ol"/>
+		<ref name="dl"/>
+	</choice>
+</define>
+
+<define name="Block.class" combine="choice">
+	<ref name="List.class"/>
+</define>
+
+<define name="img">
+	<element name="img">
+		<ref name="img.attlist"/>
+	</element>
+</define>
+
+<define name="img.attlist">
+	<ref name="Common.attrib"/>
+	<attribute name="src">
+		<ref name="URI.datatype"/>
+	</attribute>
+	<attribute name="alt">
+		<ref name="Text.datatype"/>
+	</attribute>
+	<optional>
+		<attribute name="longdesc">
+			<ref name="URI.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="height">
+			<ref name="Length.datatype"/>
+		</attribute>
+	</optional>
+	<optional>
+		<attribute name="width">
+			<ref name="Length.datatype"/>
+		</attribute>
+	</optional>
+</define>
+
+<define name="hr">
+	<element name="hr">
+		<ref name="Common.attrib"/>
+	</element>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic-table.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic-table.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic-table.rng
new file mode 100755
index 0000000..2fa9f50
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic-table.rng
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Checks exclusions applying to basic-table module.
+  This schema is intended to be used in addition to xhtml.rng.
+-->
+<grammar ns="http://www.w3.org/1999/xhtml" xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="normalElement"/>
+  </start>
+  <define name="normalElement">
+    <element>
+      <anyName>
+        <except>
+          <name>table</name>
+        </except>
+      </anyName>
+      <ref name="normalContent"/>
+    </element>
+  </define>
+  <define name="normalContent">
+    <zeroOrMore>
+      <choice>
+        <ref name="normalElement"/>
+        <ref name="tableElement"/>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="tableElement">
+    <element name="table">
+      <ref name="tableContent"/>
+    </element>
+  </define>
+  <define name="tableContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>table</name>
+            </except>
+          </anyName>
+          <ref name="tableContent"/>
+        </element>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="anyAttribute">
+    <attribute>
+      <anyName/>
+    </attribute>
+  </define>
+</grammar>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic.rng
new file mode 100755
index 0000000..a922fa2
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/exclude/basic.rng
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Checks exclusions applying to "a" and "pre" elements.
+  This schema is intended to be used in addition to xhtml.rng.
+-->
+<grammar ns="http://www.w3.org/1999/xhtml" xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <ref name="normalElement"/>
+  </start>
+  <define name="normalElement">
+    <element>
+      <anyName>
+        <except>
+          <name>a</name>
+          <name>pre</name>
+        </except>
+      </anyName>
+      <ref name="normalContent"/>
+    </element>
+  </define>
+  <define name="normalContent">
+    <zeroOrMore>
+      <choice>
+        <ref name="normalElement"/>
+        <ref name="aElement"/>
+        <ref name="preElement"/>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="aElement">
+    <element name="a">
+      <ref name="aContent"/>
+    </element>
+  </define>
+  <define name="aContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>a</name>
+              <name>pre</name>
+            </except>
+          </anyName>
+          <ref name="aContent"/>
+        </element>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="preElement">
+    <element name="pre">
+      <ref name="preContent"/>
+    </element>
+  </define>
+  <define name="preContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>a</name>
+              <name>pre</name>
+              <name>img</name>
+              <name>object</name>
+              <name>applet</name>
+              <name>big</name>
+              <name>small</name>
+              <name>sub</name>
+              <name>sup</name>
+              <name>font</name>
+              <name>basefont</name>
+            </except>
+          </anyName>
+          <ref name="preContent"/>
+        </element>
+        <ref name="aPreElement"/>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="aPreElement">
+    <element name="a">
+      <ref name="aPreContent"/>
+    </element>
+  </define>
+  <define name="aPreContent">
+    <zeroOrMore>
+      <choice>
+        <element>
+          <anyName>
+            <except>
+              <name>a</name>
+              <name>pre</name>
+              <name>img</name>
+              <name>object</name>
+              <name>applet</name>
+              <name>big</name>
+              <name>small</name>
+              <name>sub</name>
+              <name>sup</name>
+              <name>font</name>
+              <name>basefont</name>
+            </except>
+          </anyName>
+          <ref name="aPreContent"/>
+        </element>
+        <ref name="anyAttribute"/>
+        <text/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="anyAttribute">
+    <attribute>
+      <anyName/>
+    </attribute>
+  </define>
+</grammar>


[11/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml
deleted file mode 100644
index 7a7b7f9..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/pom.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
-
- 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.
-
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>platform.accountcontrolpanel</artifactId>
-        <version>0.10</version>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.accountcontrolpanel.core</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Account Control Panel Core</name>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.scala-tools</groupId>
-                <artifactId>maven-scala-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>compile</goal>
-                            <goal>testCompile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                                        <!-- <scalaVersion>${scala.version}</scalaVersion> -->
-                                        <!-- <args>
-                                                <arg>-target:jvm-1.5</arg>
-                                        </args> -->
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
-                        <Export-Package>org.apache.clerezza.platform.accountcontrolpanel.*</Export-Package>
-                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.xsite</groupId>
-                <artifactId>xsite-maven-plugin</artifactId>
-                <configuration>
-                    <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
-                    <sitemapPath>content/sitemap.xml</sitemapPath>
-                    <skinPath>templates/skin.html</skinPath>
-                    <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>pre-site</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>                 
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.scala.utils</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.ontologies</artifactId>
-            <version>0.12</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>jaxrs.utils</artifactId>
-            <version>0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.seedsnipe</artifactId>
-            <version>0.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.scalaserverpages</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.users.core</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.config</artifactId>
-            <version>0.4</version>
-        </dependency>
-        <dependency>
-          <groupId>org.scala-lang</groupId>
-          <artifactId>scala-library</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.typerendering.scala</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.globalmenu.api</artifactId>
-            <version>0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.accountcontrolpanel.ontologies</artifactId>
-            <version>0.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.usermanager</artifactId>
-            <version>0.14</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>web.fileserver</artifactId>
-            <version>0.10</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>permissiondescriptions</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>ssl.keygen.base</artifactId>
-            <version>0.6</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>platform.security.foafssl.ontologies</artifactId>
-            <version>0.2</version>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.clerezza.ext</groupId>
-          <artifactId>slf4j-scala-api</artifactId>
-            <version>1.6.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stanbol</groupId>
-            <artifactId>org.apache.stanbol.commons.security.core</artifactId>
-            <version>0.11.0</version>
-        </dependency>
-    </dependencies>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js
deleted file mode 100644
index 6d0803d..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/IEKeygen.js
+++ /dev/null
@@ -1,287 +0,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.
- *
-*/
-
-/**
- *
- * Copyright (c) 2008-2010, The University of Manchester, United Kingdom. All
- * rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. Neither the name of the The University of Manchester
- * nor the names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * Author........: Bruno Harbulot
- *
- */
-
-
-
-function createCsrCertEnroll(enrollFactObj, keylength) {
-	/*
-	 * Creates a CX509EnrollmentWebClassFactory (used to create all the other
-	 * objects).
-	 */
-	if (enrollFactObj == null) {
-		enrollFactObj = new ActiveXObject(
-			"X509Enrollment.CX509EnrollmentWebClassFactory");
-	}
-
-	/*
-	 * Load the information about the providers.
-	 */
-	var providerInfosObj = enrollFactObj
-	.CreateObject("X509Enrollment.CCspInformations");
-	providerInfosObj.AddAvailableCsps();
-
-	/*
-	 * Find the provider of RSA type (sufficient for this example). The type
-	 * numbers for this are 1, 2 and 24.
-	 * http://msdn.microsoft.com/en-us/library/aa379427%28VS.85%29.aspx
-	 */
-	var providerType = -1;
-	var providerName = null;
-	for ( var i = 0; i < providerInfosObj.Count; i++) {
-		var providerInfoObj = providerInfosObj.ItemByIndex(i);
-		switch (providerInfoObj.Type) {
-			case 1:
-			case 2:
-			case 24:
-				providerType = providerInfoObj.Type;
-				providerName = providerInfoObj.Name;
-				break;
-			default:
-		}
-	}
-
-	/*
-	 * Creates a 2048-bit key with this provider.
-	 */
-	var privKeyObj = enrollFactObj
-	.CreateObject("X509Enrollment.CX509PrivateKey");
-	privKeyObj.ProviderType = providerInfoObj.Type;
-	privKeyObj.KeySpec = 1;
-	privKeyObj.Length = keylength;
-	// http://msdn.microsoft.com/en-us/library/aa379024%28VS.85%29.aspx
-	privKeyObj.MachineContext = false;
-	// http://msdn.microsoft.com/en-us/library/aa379414%28VS.85%29.aspx
-	privKeyObj.KeyProtection = 2;
-	// http://msdn.microsoft.com/en-us/library/aa379002%28VS.85%29.aspx
-	privKeyObj.ExportPolicy = 1;
-
-	/*
-	 * Creates the PKCS#10 object and initialise as a user context.
-	 */
-	var pkcs10CsrObj = enrollFactObj
-	.CreateObject("X509Enrollment.CX509CertificateRequestPkcs10");
-	pkcs10CsrObj.InitializeFromPrivateKey(1, privKeyObj, "");
-
-	/*
-	 * Creates the enrolment object and exports the CSR.
-	 */
-	var enrollObj = enrollFactObj
-	.CreateObject("X509Enrollment.CX509Enrollment");
-	enrollObj.InitializeFromRequest(pkcs10CsrObj);
-	var csr = enrollObj.CreateRequest(1);
-	csr = "-----BEGIN CERTIFICATE REQUEST-----\r\n" + csr
-	+ "-----END CERTIFICATE REQUEST-----";
-
-	/*
-	 * Makes the request to the server.
-	 */
-    xmlHttpRequest = createRequest(csr);
-
-    /**
-	 * What to do on response
-	 */
-    xmlHttpRequest.onreadystatechange = function() {
-		if (xmlHttpRequest.readyState == 4) {
-			if (xmlHttpRequest.status == 200) {
-				/*
-				 * Installs the certificate.
-				 */
-				try {
-					enrollObj.InstallResponse(4, xmlHttpRequest.responseText,
-						0, "");
-					window.alert("A certificate has been installed.");
-				} catch (e1) {
-					try {
-						enrollObj.InstallResponse(0,
-							xmlHttpRequest.responseText, 0, "");
-						window.alert("A certificate has been installed.");
-					} catch (e2) {
-						window
-						.alert("You're probably using Vista without SP1 or above, in which case you need to add the certificate of this authority as a trusted root certificate (not recommended in general).");
-					}
-				}
-			} else {
-				window.alert("The server returned an error status: "
-					+ xmlHttpRequest.status);
-			}
-		}
-	}
-}
-
-
-function createRequest(csrString) {
-	var xmlHttpRequest = new XMLHttpRequest();
-
-	xmlHttpRequest.open("POST", kgnFloctn, true);
-
-	var params = "webId=" + encodeURIComponent(document.getElementById("webId").value);
-	params += "&cn=" + encodeURIComponent(document.getElementById("cn").value);
-	params += "&csr=" + encodeURIComponent(csrString);
-	params += "&days="+encodeURIComponent(document.getElementById("days").value);
-	params += "&hours="+encodeURIComponent(document.getElementById("hours").value);
-
-	xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-	xmlHttpRequest.setRequestHeader("Content-length", params.length);
-	xmlHttpRequest.setRequestHeader("Connection", "close");
-
-	xmlHttpRequest.send(params);
-
-	return xmlHttpRequest;
-
-}
-
-
-function createCsrXenroll(enrollObj, keylength) {
-	if (enrollObj == null) {
-		enrollObj = new ActiveXObject("CEnroll.CEnroll");
-	}
-
-	// http://msdn.microsoft.com/en-us/library/aa379941%28VS.85%29.aspx
-	// CRYPT_EXPORTABLE: 1?
-	enrollObj.GenKeyFlags = (keylength * 256 * 256) + 1;
-	enrollObj.KeySpec = 2;
-
-	var csr = enrollObj.createPKCS10("", "");
-	csr = "-----BEGIN CERTIFICATE REQUEST-----\r\n" + csr
-	+ "-----END CERTIFICATE REQUEST-----";
-
-	xmlHttpRequest = createRequest(csr);
-
-	xmlHttpRequest.onreadystatechange = function() {
-		if (xmlHttpRequest.readyState == 4) {
-			if (xmlHttpRequest.status == 200) {
-				enrollObj.acceptPKCS7(xmlHttpRequest.responseText);
-				window.alert("A certificate has been installed.");
-			} else {
-				window.alert("The server returned an error status: "
-					+ xmlHttpRequest.status);
-			}
-		}
-	}
-}
-
-function createCsr() {
-	var keystrengthSelectElem = document.getElementById("keylength");
-	var keylength = keystrengthSelectElem.value;
-
-	var enrollFactObj = null;
-	try {
-		enrollFactObj = new ActiveXObject(
-			"X509Enrollment.CX509EnrollmentWebClassFactory");
-	} catch (e) {
-	}
-
-	if (enrollFactObj != null) {
-		createCsrCertEnroll(enrollFactObj, keylength);
-	} else {
-		var enrollObj = null;
-		try {
-			enrollObj = new ActiveXObject("CEnroll.CEnroll");
-		} catch (e) {
-		}
-		if (enrollObj != null) {
-			createCsrXenroll(enrollObj, keylength);
-		} else {
-			window.alert("ActiveX certificate creation not supported or not enabled.");
-		}
-	}
-}
-// kgnFloctn needs to be calculated first
-var kgnFloctn = "errorKeyGenLoctn";
-function configurePage() {
-	kgnFloctn = document.getElementById("keygenform").getAttribute("action");
-
-	var keygenElem = document.getElementById("spkac");
-
-	if (navigator.appName == "Microsoft Internet Explorer") {
-		var keygenFormElem = document.getElementById("keygenform");
-		keygenFormElem.removeAttribute("action");
-		keygenFormElem.removeAttribute("method");
-
-		/*
-		 * Try the ActiveX approach, assume Internet Explorer.
-		 */
-
-		var iehelptextElem = document.getElementById("iehelptext");
-		iehelptextElem.style.display = "block";
-
-		var submitButtonElem = document.getElementById("keygensubmit");
-		var newSumbitButtonElem = document.createElement("input");
-		newSumbitButtonElem.setAttribute("type", "button");
-		newSumbitButtonElem.setAttribute("value", "Submit");
-		submitButtonElem.parentNode.replaceChild(newSumbitButtonElem,
-			submitButtonElem);
-		submitButtonElem = newSumbitButtonElem;
-
-		if (submitButtonElem.attachEvent) {
-			submitButtonElem.attachEvent("onclick", createCsr);
-		} else {
-			submitButtonElem.setAttribute("onclick", "createCsr()");
-		}
-
-		var keystrengthSelectElem = document.createElement("select");
-		keystrengthSelectElem.setAttribute("id", "keylength");
-		keystrengthSelectElem.setAttribute("name", "keylength");
-		var optionElem;
-		optionElem = document.createElement("option");
-		optionElem.setAttribute("value", "1024");
-		optionElem.appendChild(document.createTextNode("1024"));
-		keystrengthSelectElem.appendChild(optionElem);
-		optionElem = document.createElement("option");
-		optionElem.setAttribute("value", "2048");
-		optionElem.appendChild(document.createTextNode("2048"));
-		keystrengthSelectElem.appendChild(optionElem);
-		var keystrengthTdElem = document.getElementById("keystrenghtd");
-		keystrengthTdElem.appendChild(keystrengthSelectElem);
-	}
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js
deleted file mode 100644
index 6ad1db2..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/scripts/profile.js
+++ /dev/null
@@ -1,64 +0,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.
- *
-*/
-
-$(document).ready(function() {
-	$('#newWebIdButton').click(function() {
-		$("#newOrExistingSelection").css({display: "none"})
-		$("#createNewWebId").css({display: "block"})
-	});
-	$("#existingWebIdButton").click(function() {
-		$("#newOrExistingSelection").css({display: "none"})
-		$("#setExistingWebId").css({display: "block"})
-	});
-	$("#keygenform").submit(function() {
-		return spkacFix();
-	});
-});
-
-var crmfObject;
-function setCRMFRequest() {
-	var hiddenField = $("<input type=\"hidden\" name=\"crmf\" id=\"crmf\" \/>");
-	$("#keygenform").append(hiddenField)
-	//var formContents = $("#keygenform").serialize();
-	//var newContents = jQuery.extend({}, formContents);
-	hiddenField.val(crmfObject.request)
-	$("#keygenform").submit()
-}
-
-function spkacFix() {
-
-	if ($("#spkac").val()) {
-		return true;
-	} else {
-		if ($("#crmf").val()) {
-			return true;
-		}
-		//alert("fix needed by firefox in xhtml mode")
-		crmfObject = crypto.generateCRMFRequest(
-		'CN=Ignored',
-		"regToken", "authenticator", // not sure
-		null, // base-64 cert for key
-		// escrow. set this to null
-		"setCRMFRequest();", // callback
-		2048, null, "rsa-dual-use"); // key parameters
-		return false;
-	}
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css
deleted file mode 100644
index 64e52c4..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/CLEREZZA-INF/web-resources/account-control-panel/style/profile.css
+++ /dev/null
@@ -1,51 +0,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.
- *
-*/
-
-#associateSelection {
-	width: 80%
-}
-#createNewWebId {
-	display: none
-}
-#setExistingWebId {
-	display: none
-}
-/* we need to override a table td:first-child in /style/table.css */
-td.propvalue:first-child { 
-	text-align: right;
-}
-
-td.formlabel:first-child { 
-	width: 10em;
-	text-align: right;
-}
-
-td.multiline:first-child {
-    vertical-align: text-top;
-}
-
-img.mugshot {
-    width: 80px;
-}
-
-td.personInABox {
-    width: 100px;
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
deleted file mode 100644
index 8e50481..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/resources/OSGI-INF/serviceComponents.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?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.
-
--->
-
-<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider"/>
-        </service>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.AcpPermissionDescriptionsProvider"/>
-    </scr:component>
-
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.platform.dashboard.GlobalMenuItemsProvider"/>
-        </service>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.MenuItemProvider"/>
-    </scr:component>
-
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel"/>
-        <service servicefactory="false">
-            <provide interface="java.lang.Object"/>
-        </service>
-        <property name="javax.ws.rs" type="Boolean" value="true"/>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.SettingsPanel"/>
-        <reference name="configurationAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" cardinality="0..1" policy="dynamic" bind="bindConfigurationAdmin" unbind="unbindConfigurationAdmin"/>
-        <reference name="systemGraph" interface="org.apache.clerezza.rdf.core.MGraph" cardinality="1..1" policy="static" target="(name=urn:x-localinstance:/system.graph)" bind="bindSystemGraph" unbind="unbindSystemGraph"/>
-        <reference name="cgProvider" interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider" cardinality="1..1" policy="static" bind="bindCgProvider" unbind="unbindCgProvider"/>
-    </scr:component>
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.SettingsPanel">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.SettingsPanel"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
-        </service>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.SettingsPanel"/>
-    </scr:component>
-
-
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel"/>
-        <service servicefactory="false">
-            <provide interface="java.lang.Object"/>
-        </service>
-        <property name="javax.ws.rs" type="Boolean" value="true"/>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.ProfilePanel"/>
-        <reference name="userManager" interface="org.apache.clerezza.platform.usermanager.UserManager"
-                   cardinality="1..1" policy="static" bind="bindUserManager" unbind="unbindUserManager"/>
-        <reference name="graphNodeProvider" interface="org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider"
-                   cardinality="1..1" policy="static" bind="bindGraphNodeProvider" unbind="unbindGraphNodeProvider"/>
-        <reference name="keygenSrvc" interface="org.apache.clerezza.ssl.keygen.KeygenService"
-                   cardinality="1..1" policy="static" bind="bindKeygenSrvc" unbind="unbindKeygenSrvc"/>
-        <reference name="webIdGraphsService" interface="org.apache.clerezza.platform.users.WebIdGraphsService"
-                   cardinality="1..1" policy="static" bind="bindWebIdGraphsService" unbind="unbindWebIdGraphsService"/>
-        <reference name="platformConfig" interface="org.apache.clerezza.platform.config.PlatformConfig"
-                   cardinality="1..1" policy="static" bind="bindPlatformConfig" unbind="unbindPlatformConfig"/>
-        <reference name="tcManager" interface="org.apache.clerezza.rdf.core.access.TcManager"
-                   cardinality="1..1" policy="static" bind="bindTcManager" unbind="unbindTcManager"/>
-    </scr:component>
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.ProfilePanel">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.ProfilePanel"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
-        </service>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.ProfilePanel"/>
-    </scr:component>
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.ContactConfirmRenderlet">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.ContactConfirmRenderlet"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
-        </service>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.ContactConfirmRenderlet"/>
-    </scr:component>
-    <scr:component enabled="true" name="org.apache.clerezza.platform.accountcontrolpanel.html.PersonBox">
-        <implementation class="org.apache.clerezza.platform.accountcontrolpanel.html.PersonBox"/>
-        <service servicefactory="false">
-            <provide interface="org.apache.clerezza.platform.typerendering.TypeRenderlet"/>
-        </service>
-        <property name="service.pid" value="org.apache.clerezza.platform.accountcontrolpanel.html.PersonBox"/>
-    </scr:component>
-</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala
deleted file mode 100644
index 5d41410..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/AcpPermissionDescriptionsProvider.scala
+++ /dev/null
@@ -1,75 +0,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.
- */
-package org.apache.clerezza.platform.accountcontrolpanel
-
-import java.util.HashSet
-import java.util.Set
-import org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider
-import org.apache.clerezza.permissiondescriptions.PermissionDescripton
-import org.apache.felix.scr.annotations.Component
-import org.apache.felix.scr.annotations.Service
-
-/**
- * <code>PermissionDescriptionsProvider</code> implementation that provides
- * <code>PermissionDescripton</code>s of Account Control Panel permissions.
- * The following permissions are described:
- * <ul>
- *   <li>org.apache.clerezza.platform.accountcontrolpanel.AccountControlPanelAppPermission</li>
- *   <li>org.apache.clerezza.platform.accountcontrolpanel.ChangePasswordPermission</li>
- *   <li>org.apache.clerezza.platform.accountcontrolpanel.UserBundlePermission</li>
- * </ul>
- *
- * @author mir
- */
-object AcpPermissionDescriptionsProvider {
-  private  val ACP_PERMISSION_DESCRIPTIONS: Set[PermissionDescripton] = new HashSet[PermissionDescripton]
-  ACP_PERMISSION_DESCRIPTIONS.add(
-    new PermissionDescripton("Change Own Password Permission",
-      "Grants permission to the user to change its own password",
-      null, classOf[ChangePasswordPermission],
-      "(org.apache.clerezza.platform.accountcontrolpanel.ChangePasswordPermission \"{username}\" \"\")"
-    )
-  )
-
-  ACP_PERMISSION_DESCRIPTIONS.add(
-    new PermissionDescripton("Access Own Account Control Panel Permission",
-      "Grants permission to the user to access its own Account Control Panel",
-      null, classOf[AccountControlPanelAppPermission],
-      "(org.apache.clerezza.platform.accountcontrolpanel.AccountControlPanelAppPermission \"{username}\" \"\")"
-    )
-  )
-
-  ACP_PERMISSION_DESCRIPTIONS.add(
-    new PermissionDescripton("Bundle Upload Permission",
-      "Grants permission to the user to upload a bundle",
-      null, classOf[AccountControlPanelAppPermission],
-      "(org.apache.clerezza.platform.accountcontrolpanel.UserBundlePermission \"{username}\" \"\")"
-    )
-  )
-
-}
-
-class AcpPermissionDescriptionsProvider extends PermissionDescriptionsProvider {
-
-  import AcpPermissionDescriptionsProvider._
-
-  def getPermissionDescriptors: Set[PermissionDescripton] = {
-    return ACP_PERMISSION_DESCRIPTIONS
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala
deleted file mode 100644
index ce09780..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/MenuItemProvider.scala
+++ /dev/null
@@ -1,71 +0,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.
- */
-package org.apache.clerezza.platform.accountcontrolpanel
-
-import java.io.UnsupportedEncodingException
-import java.net.URLEncoder
-import java.security.AccessControlContext
-import java.security.AccessControlException
-import java.security.AccessController
-import java.security.Principal
-import java.security.PrivilegedActionException
-import java.security.PrivilegedExceptionAction
-import java.util.HashSet
-import java.util.Iterator
-import java.util.Set
-import javax.security.auth.Subject
-import org.apache.felix.scr.annotations.Component
-import org.apache.felix.scr.annotations.Service
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItem
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider
-import org.apache.stanbol.commons.security.UserUtil
-
-/**
- *
- * Provides menu-item to profile or settings-panel or none depending on user
- * permissions.
- *
- * @author reto
- */
-class MenuItemProvider extends GlobalMenuItemsProvider {
-  def getMenuItems: Set[GlobalMenuItem] = {
-    var items: Set[GlobalMenuItem] = new HashSet[GlobalMenuItem]
-    var userName: String = UserUtil.getCurrentUserName
-    if (userName != null) {
-      try {
-        AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
-      }
-      catch {
-        case e: AccessControlException => {
-          return items
-        }
-      }
-      try {
-        var path: String = "/user/" + URLEncoder.encode(userName, "utf-8") + "/control-panel"
-        items.add(new GlobalMenuItem(path, "ACP", "Account Control Panel", 5, "Administration"))
-      }
-      catch {
-        case e: UnsupportedEncodingException => {
-          throw new RuntimeException(e)
-        }
-      }
-    }
-    return items
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala
deleted file mode 100644
index d46f9f1..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/ProfilePanel.scala
+++ /dev/null
@@ -1,466 +0,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.
- */
-package org.apache.clerezza.platform.accountcontrolpanel
-
-import java.util.List
-import java.util.Arrays
-import java.util.Collections
-import java.util.Iterator
-import ontologies.CONTROLPANEL
-import org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider
-import org.apache.clerezza.ssl.keygen.CertSerialisation
-import org.apache.clerezza.ssl.keygen.Certificate
-import org.apache.clerezza.foafssl.ontologies.CERT
-import org.apache.clerezza.foafssl.ontologies.RSA
-import org.apache.clerezza.jaxrs.utils.RedirectUtil
-import org.apache.clerezza.jaxrs.utils.TrailingSlash
-import org.apache.clerezza.platform.config.PlatformConfig
-import org.apache.clerezza.platform.usermanager.UserManager
-import org.apache.clerezza.rdf.core._
-import org.apache.clerezza.platform.Constants
-import access.TcManager
-import impl.{SimpleMGraph, TripleImpl}
-import org.apache.clerezza.rdf.utils.GraphNode
-import org.apache.clerezza.rdf.utils.UnionMGraph
-import org.osgi.service.component.ComponentContext
-import javax.ws.rs._
-import javax.ws.rs.core.Context
-import javax.ws.rs.core.MediaType
-import javax.ws.rs.core.Response
-import javax.ws.rs.core.UriInfo
-import java.math.BigInteger
-import java.security.AccessController
-import java.security.PrivilegedAction
-import java.security.interfaces.RSAPublicKey
-import org.apache.clerezza.ssl.keygen.KeygenService
-import java.net.URI
-import org.apache.clerezza.rdf.core.access.security.TcPermission
-import org.apache.clerezza.rdf.ontologies._
-import org.slf4j.scala.Logging
-import org.apache.clerezza.platform.users.{WebIdInfo, WebIdGraphsService}
-import org.apache.clerezza.rdf.scala.utils._
-
-/**
- * Presents a panel where the user can create a webid and edit her profile.
- *
- * @author reto
- */
-
-@Path("/user/{id}/profile")
-class ProfilePanel extends Logging {
-
-  import collection.JavaConversions._
-  import Preamble._
-
-  /**
-   * Returns a GraphNode describing a ProfilePage for the user identified by
-   * the specified UserName. A ProfilePage resourcve is retuned for any user
-   * disregarding if they have a WebId and if this is local. The renderlet
-   * may provide instrcutions on how a WebId is created for users that do
-   * not have a WebId and redirect them to their WebId provider if they have
-   * a remote WebId.
-   */
-  @GET
-  def getPersonalProfilePage(@Context uriInfo: UriInfo,
-                             @PathParam(value = "id") userName: String): GraphNode = {
-    TrailingSlash.enforceNotPresent(uriInfo)
-    //not checking as public profile must be public, more selective access control TBD
-    //AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
-    val resultNode= getPersonalProfile(userName, uriInfo)
-    return resultNode
-  }
-
-  private def getPersonalProfile(userName: String, info: UriInfo): GraphNode = {
-    lazy val suggestedPPDUri = getSuggestedPPDUri(userName)
-
-    val profile = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
-      def run: GraphNode = {
-        val userInSysGraph = userManager.getUserInSystemGraph(userName)
-        val userResource = userInSysGraph.getNode
-        val profile: GraphNode = userResource match {
-          case blank: BNode => {
-            //user does not have a webId yet
-            val g = new EzMGraph()
-            import g._
-            val profile = bnode
-            (profile -- CONTROLPANEL.isLocalProfile --> bool2lit(true)
-            -- CONTROLPANEL.suggestedPPDUri --> suggestedPPDUri
-            -- FOAF.primaryTopic --> (bnode -- PLATFORM.userName --> userName))
-            profile
-          }
-          case webid: UriRef => {
-            var webIDInfo = webIdGraphsService.getWebIdInfo(webid)
-            var res = new GraphNode(suggestedPPDUri, new UnionMGraph(new SimpleMGraph, webIDInfo.localPublicUserData))
-            (res -- CONTROLPANEL.isLocalProfile --> bool2lit(webIDInfo.isLocal)
-              -- FOAF.primaryTopic --> webid)
-            res
-          }
-        }
-        /*val friendInfo:Iterator[TripleCollection] = for (kn: Triple <- profile.getGraph.filter(userResource.asInstanceOf[NonLiteral], FOAF.knows, null)
-                              if kn.getObject.isInstanceOf[UriRef];
-                              friend = kn.getObject.asInstanceOf[UriRef]
-                              if (friend != suggestedPPDUri)
-        ) yield {
-          try {
-            val friendGraph = tcManager.getGraph(FoafBrowser.removeHash(friend))
-            new RichGraphNode(friend, friendGraph).getNodeContext
-          } catch {
-            case e => {
-              logger.warn("cought exception trying to fetch graph - these graphs should already be in store " + friend, e)
-              new EzMGraph() {
-                friend -- SKOS.note --> ("problem with fetching this node: " + e)
-              }
-            }
-          }
-        }
-        //vera bad: mixing data from different sources
-        for (g <- friendInfo) profile.getGraph.addAll(g) */
-        profile
-      }
-    })
-
-
-    (profile a   PLATFORM.HeadedPage
-             a  CONTROLPANEL.ProfilePage)
-  }
-
-  /**
-   * @param userName
-   * @return the suggested Personal Profile Document URI
-   */
-  def getSuggestedPPDUri(userName: String): UriRef = {
-    return new UriRef(platformConfig.getDefaultBaseUri.getUnicodeString + "user/" + userName + "/profile")
-  }
-
-  @POST
-  @Path("set-existing-webid")
-  def setExistingWebId(@Context uriInfo: UriInfo,
-                       @FormParam("webid") webId: UriRef,
-                       @PathParam(value = "id") userName: String): Response = {
-    AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
-    return AccessController.doPrivileged(new PrivilegedAction[Response] {
-      def run: Response = {
-        var userInSystemGraph: GraphNode = userManager.getUserInSystemGraph(userName)
-        userInSystemGraph.replaceWith(webId)
-        return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
-      }
-    })
-  }
-
-  @POST
-  @Path("create-new-web-id")
-  def createNewWebId(@Context uriInfo: UriInfo,
-                     @PathParam(value = "id") userName: String): Response = {
-    val ppd: UriRef = getSuggestedPPDUri(userName)
-    val webId: UriRef = new UriRef(ppd.getUnicodeString + "#me")
-    AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
-    return AccessController.doPrivileged(new PrivilegedAction[Response] {
-      def run: Response = {
-        userManager.assignPermissionsToUser(userName, java.util.Collections.singletonList(new TcPermission(
-            webId.getUnicodeString, TcPermission.READWRITE).toString))
-        tcManager.getTcAccessController.setRequiredReadPermissionStrings(
-          ppd, Collections.singleton(new TcPermission(
-              Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ).toString))
-        tcManager.createMGraph(ppd)
-        val webIDInfo = webIdGraphsService.getWebIdInfo(webId)
-        webIDInfo.localPublicUserData.addAll(
-          Arrays.asList(
-            new TripleImpl(ppd, RDF.`type`, FOAF.PersonalProfileDocument),
-            new TripleImpl(ppd, FOAF.primaryTopic, webId))
-        )
-        var userInSystemGraph: GraphNode = userManager.getUserInSystemGraph(userName)
-        userInSystemGraph.replaceWith(webId)
-        return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
-      }
-    })
-  }
-
-  /**
-   * Presents a confirmation form for adding a contact
-   */
-  @GET
-  @Path("addContact")
-  def addContactConfirm(@PathParam(value = "id") userName: String,
-    @QueryParam("contactWebId") contactWebId: UriRef): GraphNode = {
-    AccessController.checkPermission(new AccountControlPanelAppPermission(userName, ""))
-    val contactNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
-      def run = {
-        graphNodeProvider.get(contactWebId);
-      }
-    })
-    val resultGraph = new EzMGraph(new UnionMGraph(new SimpleMGraph, contactNode.getGraph))
-    import resultGraph._
-    val result: GraphNode = bnode
-    result a CONTROLPANEL.ContactConfirmPage
-    result -- FOAF.primaryTopic --> contactNode
-  }
-
-  @POST
-  @Path("addContact")
-  def addContact(@PathParam(value = "id") userName: String, @Context uriInfo: UriInfo,
-                 @FormParam("webId") newContacts: java.util.List[UriRef]): Response = {
-    import collection.JavaConversions._
-    if (newContacts.size > 0) {
-      var me: GraphNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
-        def run: GraphNode = {
-          return userManager.getUserGraphNode(userName)
-        }
-      })
-      for (contactWebID <- newContacts) {
-        val webIdGraphs = webIdGraphsService.getWebIdInfo(me.getNode.asInstanceOf[UriRef])
-        var meGrph: GraphNode = new GraphNode(me.getNode, webIdGraphs.localPublicUserData)
-        meGrph.addProperty(FOAF.knows, contactWebID)
-      } //todo: one should catch errors here (bad uris sent for ex
-    }
-    return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
-  }
-
-  /**
-   * Removes a contact
-   */
-  @POST
-  @Path("deleteContact")
-  def deleteContact(@PathParam(value = "id") userName: String, @Context uriInfo: UriInfo,
-                 @FormParam("contactWebId") contactWebId: UriRef): Response = {
-    import collection.JavaConversions._
-    var me: GraphNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
-      def run: GraphNode = {
-        return userManager.getUserGraphNode(userName)
-      }
-    })
-    val webIdGraphs = webIdGraphsService.getWebIdInfo(me.getNode.asInstanceOf[UriRef])
-    var meGrph: GraphNode = new GraphNode(me.getNode, webIdGraphs.localPublicUserData)
-    meGrph.deleteProperty(FOAF.knows, contactWebId)
-    return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
-  }
-
-  /**
-   * @parm webId: A list of WebIDs to be added as Subject Alternative Names
-   * @param cn Common Name, the name that usually appears in the certificate selection box
-   * @param spkac key request in format generated by  Netscape, Safari, Opera
-   * @param crmf hey request in format generated by M$ Explorer
-   * @param csr key request as generated by Javascript of Netscape
-   * @param hours the certificate should last  (hours and days add up)
-   * @param days the certificate should last
-   * @param comment a comment to be attached to the public key in the database
-   */
-  @POST
-  @Path("keygen")
-  def createCert(@FormParam("webId") webIds: java.util.List[URI],
-                 @FormParam("cn") commonName: String,
-                 @FormParam("spkac") spkac: String,
-                 @FormParam("crmf") crmf: String,
-                 @FormParam("csr") csr: String,
-                 @FormParam("hours") hours: String,
-                 @FormParam("days") days: String,
-                 @FormParam("comment") comment: String): Response = {
-    import scala.collection.JavaConversions._
-    var cert: Certificate = null
-    if (spkac != null && spkac.length > 0) {
-      cert = keygenSrvc.createFromSpkac(spkac)
-      if (cert == null) {
-        logger.warn("unable to create certificate from spkac request")
-      }
-    }
-    if (cert == null && crmf != null && crmf.length > 0) {
-      cert = keygenSrvc.createFromCRMF(crmf)
-      if (cert == null) {
-        logger.warn("unable to create certificate from crmf requrest :" + crmf)
-      }
-    }
-    if (cert == null && csr != null && csr.length > 0) {
-      cert = keygenSrvc.createFromPEM(csr)
-      if (cert == null) {
-        logger.warn("unable to create certificate from csr request :" + csr)
-      }
-    }
-    if (cert == null) {
-      throw new RuntimeException("The server was unable to create a certificate")
-    }
-    cert.setSubjectCommonName(commonName)
-    cert.addDurationInHours(hours)
-    cert.addDurationInDays(days)
-    cert.startEarlier("2")
-    for(san: URI<-webIds) {
-      cert.addSubjectAlternativeName(san.toString)
-    }
-    var ser: CertSerialisation = null
-    try {
-      ser = cert.getSerialisation
-    }
-    catch {
-      case ex: Exception => {
-        throw new RuntimeException(ex)
-      }
-    }
-    var pubKey: RSAPublicKey = cert.getSubjectPublicKey.getPublicKey.asInstanceOf[RSAPublicKey]
-    var publicExponent: BigInteger = pubKey.getPublicExponent
-    var modulus: BigInteger = pubKey.getModulus
-
-    for (webid: URI<-webIds
-         if (webid.getScheme=="https"||webid.getScheme=="http");
-          val webidRef = new UriRef(webid.toString);
-         val webIdInfo = webIdGraphsService.getWebIdInfo(webidRef);
-         if (webIdInfo.isLocal)
-    ) {
-      val certGraph = new EzMGraph(webIdInfo.localPublicUserData)
-      import certGraph._
-      val certNode = certGraph.bnode
-      ( (certNode a  RSA.RSAPublicKey)
-         -- CERT.identity -->  webidRef
-         -- RSA.modulus -->  modulus
-         -- RSA.public_exponent -->  publicExponent
-         -- DC.date -->  cert.getStartDate )
-      if (comment != null && comment.length > 0) {
-        certNode --  RDFS.comment -->  comment
-      }
-    }
-    var resBuild: Response.ResponseBuilder = Response.ok(ser.getContent, MediaType.valueOf(ser.getMimeType))
-    return resBuild.build
-  }
-
-  @POST
-  @Path("deletekey")
-  def deleteKey(@Context uriInfo: UriInfo,
-                @FormParam("webId") webId: UriRef,
-                @FormParam("keyhash") keys: List[String]): Response = {
-    val webIDInfo = webIdGraphsService.getWebIdInfo(webId)
-    val agent: GraphNode = new GraphNode(webId, webIDInfo.localPublicUserData)
-    var subjects: Iterator[GraphNode] = agent.getSubjectNodes(CERT.identity)
-    import scala.util.control.Breaks._
-    breakable {
-      import scala.collection.JavaConversions._
-      //to for loop through iterators
-      for (nl <- subjects) {
-        var modulusIt: Iterator[Resource] = nl.getObjects(RSA.modulus)
-        if (!modulusIt.hasNext) break
-        var modLit: Resource = modulusIt.next
-        if (modulusIt.hasNext) logger.warn("data error, a modulus too many in cert for " + webId)
-        if (!(modLit.isInstanceOf[TypedLiteral])) {
-          logger.warn("a public key has a modulus that is not a literal for " + webId)
-          break
-        }
-        var modulus: BigInteger = LiteralFactory.getInstance.createObject(classOf[BigInteger], modLit.asInstanceOf[TypedLiteral])
-        for (key <- keys) {
-          if (modulus.hashCode == Integer.decode(key)) {
-            nl.deleteNodeContext
-            break
-          }
-        }
-      }
-    }
-    return RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
-  }
-
-  @POST
-  @Path("modify")
-  def modifyProfile(@Context uriInfo: UriInfo,
-                    @PathParam("id") userName: String,
-                    @FormParam("webId") webId: UriRef,
-                    @FormParam("name") name: String,
-                    @FormParam("description") description: String): Response = {
-    val webIDInfo = AccessController.doPrivileged(new PrivilegedAction[WebIdInfo] {
-      def run = {
-        webIdGraphsService.getWebIdInfo(webId)
-      }
-    })
-    val agent: GraphNode = new GraphNode(webId, webIDInfo.localPublicUserData)
-    agent.deleteProperties(FOAF.name)
-    agent.addPropertyValue(FOAF.name, name)
-    agent.deleteProperties(DC.description)
-    agent.addPropertyValue(DC.description, description)
-    logger.debug("local graph (uri: {}) is now of size {}".format(webIDInfo.webId, webIDInfo.localPublicUserData.size))
-    RedirectUtil.createSeeOtherResponse("../profile", uriInfo)
-  }
-
-  protected def bindUserManager(usermanager: UserManager): Unit = {
-    userManager = usermanager
-  }
-
-  protected def unbindUserManager(usermanager: UserManager): Unit = {
-    if (userManager == usermanager) {
-      userManager = null
-    }
-  }
-
-  protected def bindGraphNodeProvider(graphNodeProvider: GraphNodeProvider): Unit = {
-    this.graphNodeProvider = graphNodeProvider
-  }
-
-  protected def unbindGraphNodeProvider(graphNodeProvider: GraphNodeProvider): Unit = {
-    this.graphNodeProvider = null
-  }
-
-  protected def bindKeygenSrvc(keygenservice: KeygenService): Unit = {
-    keygenSrvc = keygenservice
-  }
-
-  protected def unbindKeygenSrvc(keygenservice: KeygenService): Unit = {
-    if (keygenSrvc == keygenservice) {
-      keygenSrvc = null
-    }
-  }
-
-
-  protected def bindWebIdGraphsService(webidgraphsservice: WebIdGraphsService): Unit = {
-    webIdGraphsService = webidgraphsservice
-  }
-
-  protected def unbindWebIdGraphsService(webidgraphsservice: WebIdGraphsService): Unit = {
-    webIdGraphsService = null
-  }
-
-  protected def bindPlatformConfig(platformconfig: PlatformConfig): Unit = {
-    platformConfig = platformconfig
-  }
-
-  protected def unbindPlatformConfig(platformconfig: PlatformConfig): Unit = {
-    if (platformConfig == platformconfig) {
-      platformConfig = null
-    }
-  }
-
-  protected def bindTcManager(tcManager: TcManager) = {
-    this.tcManager = tcManager
-  }
-
-  protected def unbindTcManager(tcManager: TcManager) = {
-    this.tcManager = null
-  }
-
-  protected def activate(componentContext: ComponentContext): Unit = {
-    this.componentContext = componentContext
-  }
-
-
-  private var userManager: UserManager = null
-
-  private var graphNodeProvider: GraphNodeProvider = null
-
-  private var webIdGraphsService: WebIdGraphsService = null
-
-  private var keygenSrvc: KeygenService = null
-  private var platformConfig: PlatformConfig = null
-
-
-  private var componentContext: ComponentContext = null
-
-  private var tcManager: TcManager = null;
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala
deleted file mode 100644
index 3d8d929..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/SettingsPanel.scala
+++ /dev/null
@@ -1,646 +0,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.
- */
-package org.apache.clerezza.platform.accountcontrolpanel
-
-import java.io.ByteArrayInputStream
-import java.io.IOException
-import java.io.InputStream
-import java.io.UnsupportedEncodingException
-import java.net.URL
-import java.security.AccessControlException
-import java.security.AccessController
-import java.security.MessageDigest
-import java.security.NoSuchAlgorithmException
-import java.security.PrivilegedAction
-import java.util.Dictionary
-import java.util.HashMap
-import java.util.HashSet
-import java.util.Hashtable
-import java.util.Iterator
-import java.util.Map
-import java.util.Set
-import javax.ws.rs.Consumes
-import javax.ws.rs.FormParam
-import javax.ws.rs.GET
-import javax.ws.rs.POST
-import javax.ws.rs.Path
-import javax.ws.rs.PathParam
-import javax.ws.rs.QueryParam
-import javax.ws.rs.WebApplicationException
-import javax.ws.rs.core.Context
-import javax.ws.rs.core.MediaType
-import javax.ws.rs.core.Response
-import javax.ws.rs.core.Response.ResponseBuilder
-import javax.ws.rs.core.UriInfo
-import org.apache.felix.scr.annotations.Component
-import org.apache.felix.scr.annotations.Property
-import org.apache.felix.scr.annotations.Reference
-import org.apache.felix.scr.annotations.ReferenceCardinality
-import org.apache.felix.scr.annotations.ReferencePolicy
-import org.apache.felix.scr.annotations.Service
-import org.osgi.framework.Bundle
-import org.osgi.framework.BundleException
-import org.osgi.service.cm.Configuration
-import org.osgi.service.cm.ConfigurationAdmin
-import org.osgi.service.component.ComponentContext
-import org.slf4j.Logger
-import org.slf4j.LoggerFactory
-import org.apache.clerezza.jaxrs.utils.TrailingSlash
-import org.apache.clerezza.jaxrs.utils.RedirectUtil
-import org.apache.clerezza.jaxrs.utils.form.FormFile
-import org.apache.clerezza.jaxrs.utils.form.MultiPartBody
-import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
-import org.apache.clerezza.platform.config.SystemConfig
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
-import org.apache.clerezza.platform.typerendering.RenderletManager
-import org.apache.clerezza.platform.typerendering.scala.PageRenderlet
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet
-import org.apache.clerezza.rdf.core.BNode
-import org.apache.clerezza.rdf.core.Graph
-import org.apache.clerezza.rdf.core.Literal
-import org.apache.clerezza.rdf.core.LiteralFactory
-import org.apache.clerezza.rdf.core.MGraph
-import org.apache.clerezza.rdf.core.NonLiteral
-import org.apache.clerezza.rdf.core.Triple
-import org.apache.clerezza.rdf.core.TypedLiteral
-import org.apache.clerezza.rdf.core.UriRef
-import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl
-import org.apache.clerezza.rdf.core.impl.SimpleLiteralFactory
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph
-import org.apache.clerezza.rdf.core.impl.TripleImpl
-import org.apache.clerezza.rdf.ontologies.OSGI
-import org.apache.clerezza.rdf.ontologies.PERMISSION
-import org.apache.clerezza.rdf.ontologies.PLATFORM
-import org.apache.clerezza.rdf.ontologies.RDF
-import org.apache.clerezza.rdf.utils.GraphNode
-import org.apache.clerezza.rdf.utils.UnionMGraph
-
-object SettingPanel {
-  val logger: Logger = LoggerFactory.getLogger(classOf[SettingsPanel])
-}
-
-/**
- *
- * Account control panel
- *
- * @author mir, hasan
- */
-@Path("/user/{id}/control-panel")
-class SettingsPanel {
-
-  import SettingPanel.logger
-
-  /**
-   * Mainpage
-   *
-   * @param id is the username as given in the URL
-   * @return an array of installed {@link Bundle}s to be managed
-   *
-   */
-  @GET
-  def settingsPage(@PathParam(value = "id") idP: String,
-              @QueryParam("changedPassword") changedPassword: String,
-              @Context uriInfo: UriInfo): GraphNode = {
-    TrailingSlash.enforceNotPresent(uriInfo)
-    val id: String = idP
-    var graphNode: GraphNode = null
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    try {
-      AccessController.checkPermission(new UserBundlePermission(id, ""))
-      graphNode = AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
-        def run: GraphNode = {
-          var bundles: Array[Bundle] = userBundles(getAgent(id))
-          return asGraphNode(id, bundles)
-        }
-      })
-    }
-    catch {
-      case e: AccessControlException => {
-        graphNode = new GraphNode(new BNode, new SimpleMGraph)
-        graphNode.addProperty(CONTROLPANEL.userBundlePermission, LiteralFactory.getInstance.createTypedLiteral(false))
-      }
-    }
-    try {
-      AccessController.checkPermission(new ChangePasswordPermission(id, ""))
-      graphNode.addProperty(CONTROLPANEL.changePasswordPermission, LiteralFactory.getInstance.createTypedLiteral(true))
-    }
-    catch {
-      case e: AccessControlException => {
-        graphNode.addProperty(CONTROLPANEL.changePasswordPermission, LiteralFactory.getInstance.createTypedLiteral(false))
-      }
-    }
-    if (changedPassword != null && changedPassword.equals("false")) {
-      graphNode.addProperty(CONTROLPANEL.changedPassword, new PlainLiteralImpl("false"))
-    }
-    graphNode.addProperty(RDF.`type`, CONTROLPANEL.SettingsPage)
-    graphNode.addProperty(RDF.`type`, PLATFORM.HeadedPage)
-    return graphNode
-  }
-
-  private def addBundleDescriptionToGraph(responseGraph: MGraph, bundle: Bundle): Unit = {
-    var status: TypedLiteral = LiteralFactory.getInstance.createTypedLiteral(bundle.getState)
-    var bundleUri: UriRef = new UriRef(bundle.getLocation)
-    var triple: Triple = new TripleImpl(bundleUri, OSGI.status, status)
-    responseGraph.add(triple)
-    var bundleId: TypedLiteral = LiteralFactory.getInstance.createTypedLiteral(bundle.getBundleId)
-    triple = new TripleImpl(bundleUri, OSGI.bundle_id, bundleId)
-    responseGraph.add(triple)
-  }
-
-  private def asGraphNode(userId: String, bundles: Array[Bundle]): GraphNode = {
-    val responseGraph: MGraph = new SimpleMGraph
-    for (bundle <- bundles) {
-      addBundleDescriptionToGraph(responseGraph, bundle)
-    }
-    return AccessController.doPrivileged(new PrivilegedAction[GraphNode] {
-      def run: GraphNode = {
-        var userDescriptionGraph: Graph = new GraphNode(getAgent(userId), systemGraph).getNodeContext
-        var unionGraph: UnionMGraph = new UnionMGraph(responseGraph, userDescriptionGraph)
-        var graphNode: GraphNode = new GraphNode(getAgent(userId), unionGraph)
-        graphNode.addProperty(CONTROLPANEL.userBundlePermission, LiteralFactory.getInstance.createTypedLiteral(true))
-        return graphNode
-      }
-    })
-  }
-
-  /**
-   * Retrieves all bundles owned by a user represented by agent
-   *
-   * @param agent represents the user who owns bundles to be returned
-   * @return an array of {@link Bundle}s owned by the user
-   *
-   */
-  private def userBundles(agent: NonLiteral): Array[Bundle] = {
-    logger.debug("Retrieve all bundles from user: {}", agent)
-    var installedBundles: Array[Bundle] = componentContext.getBundleContext.getBundles
-    val locationMapper: Map[String, Long] = new HashMap[String, Long]
-    for (b <- installedBundles) {
-      locationMapper.put(b.getLocation, b.getBundleId)
-    }
-    return AccessController.doPrivileged(new PrivilegedAction[Array[Bundle]] {
-      def run: Array[Bundle] = {
-        var bundles: Set[Bundle] = new HashSet[Bundle]
-        var agentBundles: Iterator[Triple] = systemGraph.filter(null, OSGI.owner, agent)
-        while (agentBundles.hasNext) {
-          val location: String = (agentBundles.next.getSubject.asInstanceOf[UriRef]).getUnicodeString
-          try {
-            val id: Long = locationMapper.get(location)
-            bundles.add(componentContext.getBundleContext.getBundle(id))
-          } catch {
-            case _:NumberFormatException => None
-          }
-        }
-        return bundles.toArray(new Array[Bundle](bundles.size))
-      }
-    })
-  }
-
-  private def getAgent(id: String): NonLiteral = {
-    logger.debug("Get agent with id {}", id)
-    var agents: Iterator[Triple] = systemGraph.filter(null, PLATFORM.userName, new PlainLiteralImpl(id))
-    if (agents.hasNext) {
-      return agents.next.getSubject
-    }
-    else {
-      logger.debug("System graph does not contain user: {}", id)
-      var responseBuilder: Response.ResponseBuilder = Response.ok("<html><body>User does not exist</body></html>")
-      throw new WebApplicationException(responseBuilder.build)
-    }
-  }
-
-  private def getAgentPathPrefix(agent: NonLiteral): PlainLiteralImpl = {
-    return AccessController.doPrivileged(new PrivilegedAction[PlainLiteralImpl] {
-      def run: PlainLiteralImpl = {
-        var pathPrefixes: Iterator[Triple] = systemGraph.filter(agent, OSGI.agent_path_prefix, null)
-        if (pathPrefixes.hasNext) {
-          return pathPrefixes.next.getObject.asInstanceOf[PlainLiteralImpl]
-        }
-        return null
-      }
-    })
-  }
-
-  /**
-   * Installs a bundle from the specified location.
-   *
-   * @param id is the username as given in the URL
-   * @param location specifies the URL of the bundle to be installed
-   * @return an array of installed {@link Bundle}s to be managed
-   *
-   */
-  @POST
-  @Path("install-bundle")
-  @Consumes def installBundle(@PathParam(value = "id") id: String, multiForm: MultiPartBody, @Context uriInfo: UriInfo): Response = {
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    AccessController.checkPermission(new UserBundlePermission(id, ""))
-    var formFiles: Array[FormFile] = multiForm.getFormFileParameterValues("bundle")
-    var filename: String = formFiles(0).getFileName
-    var bundleBytes: Array[Byte] = formFiles(0).getContent
-    if (bundleBytes.length == 0) {
-      var message: String = null
-      if (filename.equals("")) {
-        message = "No bundle specified"
-      }
-      else {
-        message = "Bundle has length 0"
-      }
-      var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(message)
-      throw new WebApplicationException(responseBuilder.build)
-    }
-    val bundleInputStream: InputStream = new ByteArrayInputStream(bundleBytes)
-    val location: String = "userbundle:" + id + "/" + filename
-    logger.info("Install bundle {} to location {}", id, location)
-    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
-      def run: Array[Bundle] = {
-        val agent: NonLiteral = getAgent(id)
-        val triple: Triple = new TripleImpl(new UriRef(location), OSGI.owner, agent)
-        try {
-          systemGraph.add(triple)
-          var bundle: Bundle = componentContext.getBundleContext.installBundle(location, bundleInputStream)
-          var prefix: PlainLiteralImpl = getAgentPathPrefix(agent)
-          if (prefix != null) {
-            addBundlePrefix(bundle, prefix.getLexicalForm)
-          }
-          return null
-        }
-        catch {
-          case ex: BundleException => {
-            systemGraph.remove(triple)
-            logger.debug("Failed to install a bundle from: {}", location)
-            logger.error("Exception during install bundle: {}", ex)
-            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ex.getMessage)
-            throw new WebApplicationException(responseBuilder.build)
-          }
-        }
-      }
-    })
-    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
-  }
-
-  private def addBundlePrefix(bundle: Bundle, prefix: String): Unit = {
-    var symbolicName: String = bundle.getSymbolicName
-    /*if (configAdmin != null) {
-      try {
-        var configuration: Configuration = configAdmin.getConfiguration(classOf[TriaxrsPrefixManager].getName)
-        val properties = configuration.getProperties match {
-          case null => new Hashtable[String, AnyRef]()
-          case dict: Dictionary[String, AnyRef] => dict
-        }
-        var mappings = TriaxrsPrefixManager.parseMappings(properties.get(TriaxrsPrefixManager.TRIAXRS_MAPPINGS).asInstanceOf[Array[String]])
-        logger.debug("Prefix {} added to bundle {}", prefix, symbolicName)
-        mappings.put(symbolicName, prefix)
-        var newMappings: Array[String] = TriaxrsPrefixManager.unparseMappings(mappings)
-        properties.put(TriaxrsPrefixManager.TRIAXRS_MAPPINGS, newMappings)
-        configuration.update(properties)
-      }
-      catch {
-        case e: IOException => {
-          logger.warn("Unable to update configuration: {}", e.toString)
-        }
-      }
-    }
-    else {
-      logger.warn("Cannot add prefix mapping. Configuration Admin is missing")
-    }*/
-  }
-
-  private[accountcontrolpanel] def removeBundlePrefix(bundle: Bundle): Unit = {
-    var symbolicName: String = bundle.getSymbolicName
-    /*if ((this.configAdmin != null) && (symbolicName != null)) {
-      try {
-        val configuration: Configuration = configAdmin.getConfiguration(classOf[TriaxrsPrefixManager].getName)
-        val properties = configuration.getProperties match {
-          case null => new Hashtable[String, AnyRef]()
-          case dict: Dictionary[String, AnyRef] => dict
-        }
-        val mappings = TriaxrsPrefixManager.parseMappings(properties.get(TriaxrsPrefixManager.TRIAXRS_MAPPINGS).asInstanceOf[Array[String]])
-        mappings.remove(symbolicName)
-        val newMappings: Array[String] = TriaxrsPrefixManager.unparseMappings(mappings)
-        properties.put(TriaxrsPrefixManager.TRIAXRS_MAPPINGS, newMappings)
-        configuration.update(properties)
-      }
-      catch {
-        case e: IOException => {
-          logger.warn("Unable to update configuration: {}", e.toString)
-        }
-      }
-    }
-    else {
-      logger.warn("Cannot add prefix mapping. Configuration Admin is missing")
-    }*/
-  }
-
-  /**
-   * Starts the bundle with the specified bundle id.
-   *
-   * @param id is the username as given in the URL
-   * @param bundleIdString specifies the id of the bundle to be started
-   * @return an array of installed {@link Bundle}s to be managed
-   *
-   */
-  @POST
-  @Path("start-bundle")
-  def startBundle(@PathParam(value = "id") idP: String,
-             @FormParam("bundleId") bundleIdStringP: String,
-             @Context uriInfo: UriInfo): Response = {
-    val id: String = idP
-    val bundleIdString: String = bundleIdStringP
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    AccessController.checkPermission(new UserBundlePermission(id, ""))
-    logger.info("Start bundle {} ", id)
-    val bundleId: Long = bundleIdString.toLong
-    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
-      def run: Array[Bundle] = {
-        try {
-          val bundle: Bundle = componentContext.getBundleContext.getBundle(bundleId)
-          bundle.start
-        }
-        catch {
-          case e: BundleException => {
-            logger.debug("Failed to start bundle {}", bundleIdString)
-            logger.error("Exception during start bundle: {}", e)
-            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage)
-            throw new WebApplicationException(responseBuilder.build)
-          }
-        }
-        return null
-      }
-    })
-    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
-  }
-
-  /**
-   * Stops the bundle with the specified bundle id.
-   *
-   * @param id is the username as given in the URL
-   * @param bundleIdString specifies the id of the bundle to be stopped
-   * @return an array of installed {@link Bundle}s to be managed
-   *
-   */
-  @POST
-  @Path("stop-bundle") def stopBundle(@PathParam(value = "id") idP: String,
-                          @FormParam("bundleId") bundleIdStringP: String,
-                          @Context uriInfo: UriInfo): Response = {
-    val id: String = idP
-    val bundleIdString: String = bundleIdStringP
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    AccessController.checkPermission(new UserBundlePermission(id, ""))
-    logger.info("Stop bundle {}", id)
-    val bundleId: Long = bundleIdString.toLong
-    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
-      def run: Array[Bundle] = {
-        try {
-          var bundle: Bundle = componentContext.getBundleContext.getBundle(bundleId)
-          bundle.stop
-        }
-        catch {
-          case e: BundleException => {
-            logger.debug("Failed to stop bundle ", bundleIdString)
-            logger.error("Exception during stop bundle: {}", e)
-            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage)
-            throw new WebApplicationException(responseBuilder.build)
-          }
-        }
-        return null
-      }
-    })
-    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
-  }
-
-  /**
-   * Uninstalls the bundle with the specified bundle id.
-   *
-   * @param id is the username as given in the URL
-   * @param bundleIdString specifies the id of the bundle to be uninstalled
-   * @return an array of installed {@link Bundle}s to be managed
-   *
-   */
-  @POST
-  @Path("uninstall-bundle")
-  def uninstallBundle(@PathParam(value = "id") idP: String,
-                @FormParam("bundleId") bundleIdStringP: String,
-                @Context uriInfo: UriInfo): Response = {
-    val id: String = idP
-    val bundleIdString: String = bundleIdStringP
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    AccessController.checkPermission(new UserBundlePermission(id, ""))
-    logger.info("Uninstall bundle {}", id)
-    val bundleId: Long = bundleIdString.toLong
-    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
-      def run: Array[Bundle] = {
-        val agent: NonLiteral = getAgent(id)
-        try {
-          var bundle: Bundle = componentContext.getBundleContext.getBundle(bundleId)
-          bundle.uninstall
-          val triple: Triple = new TripleImpl(new UriRef(bundle.getLocation), OSGI.owner, agent)
-          systemGraph.remove(triple)
-          removeBundlePrefix(bundle)
-        }
-        catch {
-          case e: BundleException => {
-            logger.debug("Failed to uninstall bundle {}", bundleIdString)
-            logger.error("Exception during uninstall bundle: {}", e)
-            var responseBuilder: Response.ResponseBuilder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage)
-            throw new WebApplicationException(responseBuilder.build)
-          }
-        }
-        return null
-      }
-    })
-    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
-  }
-
-  /**
-   * changes the password of an user
-   *
-   * @param idP id is the username as given in the URL
-   * @param lang represents the user's new standard language.
-   * @return
-   */
-  @POST
-  @Path("change-language")
-  def changeUserLanguage(@PathParam(value = "id") idP: String,
-                  @FormParam("availablelanguages") lang: String,
-                  @Context uriInfo: UriInfo): Response = {
-    val id: String = idP
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    AccessController.doPrivileged(new PrivilegedAction[AnyRef] {
-      def run: AnyRef = {
-        var userNode: GraphNode = new GraphNode(getAgent(id), systemGraph)
-        userNode.deleteProperties(PLATFORM.preferredLangInISOCode)
-        userNode.addProperty(PLATFORM.preferredLangInISOCode, LiteralFactory.getInstance.createTypedLiteral(lang))
-        return null
-      }
-    })
-    return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
-  }
-
-  /**
-   * changes the password of an user
-   *
-   * @param idP id is the username as given in the URL
-   * @param oldPW the current user password
-   * @param newPW the new password
-   * @param confirmNewPW the new password
-   * @return
-   */
-  @POST
-  @Path("change-password")
-  def changePassword(@PathParam(value = "id") idP: String,
-               @FormParam("oldPW") oldPW: String,
-               @FormParam("newPW") newPW: String,
-               @FormParam("confirmNewPW") confirmNewPW: String,
-               @Context uriInfo: UriInfo): Response = {
-    val id: String = idP
-    AccessController.checkPermission(new AccountControlPanelAppPermission(id, ""))
-    AccessController.checkPermission(new ChangePasswordPermission(id, ""))
-    var changedPassword: Boolean = false
-    if (newPW.trim.equals(confirmNewPW.trim) && checkPWStrings(oldPW, newPW)) {
-      changedPassword = AccessController.doPrivileged(new PrivilegedAction[Boolean] {
-        private def getCurrentPassword(agent: NonLiteral): String = {
-          var currentPassword: String = null
-          var oldPWTriple: Iterator[Triple] = systemGraph.filter(agent, PERMISSION.passwordSha1, null)
-          if (oldPWTriple.hasNext) {
-            var currentPWLiteral: Literal = oldPWTriple.next.getObject.asInstanceOf[Literal]
-            currentPassword = currentPWLiteral.getLexicalForm
-          }
-          return currentPassword
-        }
-
-        def run: Boolean = {
-          val agent: NonLiteral = getAgent(id)
-          var encodedOlpPW: String = getEncodedPW(oldPW)
-          var currentPassword: String = getCurrentPassword(agent)
-          if ((currentPassword != null) && !currentPassword.equals(encodedOlpPW)) {
-            logger.info("Typed wrong current password!")
-            return false
-          }
-          else {
-            removeOldPwAndAddNewPW(agent, currentPassword, newPW)
-            return true
-          }
-        }
-
-        private def removeOldPwAndAddNewPW(agent: NonLiteral, currentPassword: String, newPW: String): Unit = {
-          var newPWTriple: Triple = new TripleImpl(agent, PERMISSION.passwordSha1, new PlainLiteralImpl(getEncodedPW(newPW)))
-          if (currentPassword != null) {
-            var oldPWTriple: Triple = new TripleImpl(agent, PERMISSION.passwordSha1, new PlainLiteralImpl(currentPassword))
-            systemGraph.remove(oldPWTriple)
-            logger.debug("removed old password from systemgraph")
-          }
-          systemGraph.add(newPWTriple)
-          logger.debug("user " + id + " changed password")
-        }
-
-        private def getEncodedPW(password: String): String = {
-          if (password == null) {
-            return null
-          }
-          try {
-            return bytes2HexString(MessageDigest.getInstance("SHA1").digest(password.getBytes("UTF-8")))
-          }
-          catch {
-            case e: NoSuchAlgorithmException => {
-              throw new RuntimeException(e)
-            }
-            case e: UnsupportedEncodingException => {
-              throw new RuntimeException(e)
-            }
-          }
-        }
-
-        private def bytes2HexString(bytes: Array[Byte]): String = {
-          val HEXDIGITS: Array[Char] = "0123456789abcdef".toCharArray
-          val result = new Array[Char](bytes.length << 1)
-          var j: Int = 0
-          for (i <- 0 to bytes.length - 1) {
-            result(j) = HEXDIGITS(bytes(i) >> 4 & 0xF)
-            result(j + 1) = HEXDIGITS(bytes(i) & 0xF)
-            j += 2
-          }
-          return new String(result)
-        }
-      })
-    }
-    else {
-      logger.info("Changing password failed!")
-      changedPassword = false
-    }
-    if (changedPassword) {
-      return RedirectUtil.createSeeOtherResponse("../control-panel", uriInfo)
-    }
-    else {
-      return RedirectUtil.createSeeOtherResponse("../control-panel?changedPassword=false", uriInfo)
-    }
-  }
-
-  /**
-   * checks if the typed strings are valid
-   */
-  private def checkPWStrings(oldPW: String, newPW: String): Boolean = {
-    if (newPW.length == 0) {
-      return false
-    }
-    return true
-  }
-
-  /**
-   * The activate method is called when SCR activates the component configuration.
-   *
-   * @param componentContext
-   */
-  protected def activate(componentContext: ComponentContext): Unit = {
-    this.componentContext = componentContext
-  }
-
-  protected def bindConfigurationAdmin(configAdmin: ConfigurationAdmin): Unit = {
-    logger.debug("Binding configuration admin")
-    this.configAdmin = configAdmin
-  }
-
-  protected def unbindConfigurationAdmin(configAdmin: ConfigurationAdmin): Unit = {
-    logger.debug("Unbinding configuration admin")
-    this.configAdmin = null
-  }
-
-  protected def bindSystemGraph(mgraph: MGraph): Unit = {
-    systemGraph = mgraph
-  }
-
-  protected def unbindSystemGraph(mgraph: MGraph): Unit = {
-    if (systemGraph == mgraph) {
-      systemGraph = null
-    }
-  }
-
-  protected def bindCgProvider(contentgraphprovider: ContentGraphProvider): Unit = {
-    cgProvider = contentgraphprovider
-  }
-
-  protected def unbindCgProvider(contentgraphprovider: ContentGraphProvider): Unit = {
-    if (cgProvider == contentgraphprovider) {
-      cgProvider = null
-    }
-  }
-
-  private var componentContext: ComponentContext = null
-  private var systemGraph: MGraph = null
-  private var cgProvider: ContentGraphProvider = null
-  private var configAdmin: ConfigurationAdmin = null
-}
\ No newline at end of file


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

Posted by re...@apache.org.
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


[10/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala
deleted file mode 100644
index bb306aa..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ContactConfirmRenderlet.scala
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.apache.clerezza.platform.accountcontrolpanel.html
-
-/*
- * 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 org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
-import org.apache.clerezza.rdf.core._
-import org.apache.clerezza.rdf.scala.utils._
-import org.apache.clerezza.rdf.ontologies.FOAF
-import org.apache.clerezza.rdf.ontologies.RDF
-import org.apache.clerezza.rdf.scala.utils.Preamble._
-import org.apache.clerezza.platform.typerendering.scala._
-
-
-
-/**
- * Metadata class for the person panel
- */
-class ContactConfirmRenderlet extends SRenderlet {
-  def getRdfType() = CONTROLPANEL.ContactConfirmPage
-
-
-  override def renderedPage(arguments: XmlResult.Arguments) = new XmlPerson(arguments)
-
-  /**
-   * Content class for the Person Panel
-   */
-  class XmlPerson(args: XmlResult.Arguments) extends XmlResult(args) {
-
-    import RenderingUtility._
-    
-    //
-    // the content itself.
-    // This is the piece that is closest to a pure ssp, though there is still too much code in it
-    //
-
-    override def content = {
-      val primarySubject = res/FOAF.primaryTopic
-      <div id="tx-content">
-        {
-        if (primarySubject.hasProperty(RDF.`type`, FOAF.Person)) {
-          <form action="addContact" method="post">
-            {render(primarySubject, "box-naked")}
-            <input type="hidden" name="webId" value={primarySubject*} />
-            <input type="submit" value="Add this contact" />
-          </form>
-        } else {
-          <div>
-          <span>The resource {primarySubject!} of type {primarySubject/RDF.`type`} is not known to be a Person</span>
-          {
-            import collection.JavaConversions._
-            val otherPersons = (for (t <- primarySubject.getNodeContext.filter(null, RDF.`type`, FOAF.Person))
-              yield t.getSubject).toList
-            val personsWithUri: List[UriRef] = for (otherPerson <- otherPersons;
-                if otherPerson.isInstanceOf[UriRef]) yield otherPerson.asInstanceOf[UriRef]
-            if (personsWithUri.isEmpty) {
-              <span>No person could be found</span>
-            } else {
-              <div>
-                Maybe you want to add {
-                  if (personsWithUri.size > 1) {
-                    "one of the following "+personsWithUri.size+" persons:"
-                  } else {
-                    "the person"
-                  }
-                }
-                {
-                  for (otherPerson <- personsWithUri) yield {
-                    <form action="addContact" method="post">
-                      <span>{otherPerson}</span>
-                      {render(otherPerson, "box-naked")}
-                      <input type="hidden" name="webId" value={otherPerson.getUnicodeString} />
-                      <input type="submit" value="Add this contact" />
-                    </form>
-                  }
-                }
-              </div>
-            }
-          }
-          {
-            <form action="addContact" method="post">
-            You can add {primarySubject} as contact even though it does not seem to be a person.
-            <input type="hidden" name="webId" value={primarySubject*} />
-            <input type="submit" value="Add anyway" />
-          </form>
-          } </div>
-        }
-      }
-      <a href="../profile" onclick="history.go(-1)">Cancel</a>
-      </div>
-    }
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala
deleted file mode 100644
index 2b9913c..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/PersonBox.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.clerezza.platform.accountcontrolpanel.html
-
-/*
- * 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 org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
-import org.apache.clerezza.rdf.core._
-import org.apache.clerezza.rdf.scala.utils._
-import org.apache.clerezza.rdf.ontologies.FOAF
-import org.apache.clerezza.rdf.scala.utils.Preamble._
-import org.apache.clerezza.platform.typerendering.scala._
-import scala.xml.Text
-
-
-
-/**
- * Metadata class for the person panel
- */
-class PersonBox extends SRenderlet {
-  def getRdfType() = FOAF.Person
-
-  override def getModePattern = "box-naked"
-
-  override def renderedPage(arguments: XmlResult.Arguments) = new XmlPerson(arguments)
-
-  /**
-   * Content class for the Person Panel
-   */
-  class XmlPerson(args: XmlResult.Arguments) extends XmlResult(args) {
-
-    import RenderingUtility._
-    
-    //
-    // the content itself.
-    // This is the piece that is closest to a pure ssp, though there is still too much code in it
-    //
-
-    override def content = {
-      val pixml= getAgentPix(res)
-      <div class="personInABox">
-        <table><tr><td>{pixml}</td></tr>
-        <tr><td>{new Text(getName(res))}</td></tr>
-        </table>
-      </div>
-    }
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala
deleted file mode 100644
index 7d65dff..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/ProfilePanel.scala
+++ /dev/null
@@ -1,295 +0,0 @@
-package org.apache.clerezza.platform.accountcontrolpanel.html
-
-/*
- * 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 org.apache.clerezza.rdf.core._
-import org.apache.clerezza.rdf.scala.utils._
-import org.apache.clerezza.rdf.scala.utils.Preamble._
-import org.apache.clerezza.foafssl.ontologies.CERT
-import org.apache.clerezza.foafssl.ontologies.RSA
-import org.apache.clerezza.platform.typerendering.scala._
-import java.math.BigInteger
-import java.util.Date
-import java.text._
-import org.apache.clerezza.rdf.core.UriRef
-import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
-import org.apache.clerezza.rdf.ontologies.{RDFS, DC, FOAF}
-
-class ProfilePanel extends SRenderlet {
-
-  override def getRdfType() = CONTROLPANEL.ProfilePage
-
-  override def renderedPage(arguments: XmlResult.Arguments) = new ProfilePanelXHTML(arguments)
-
-  class ProfilePanelXHTML(arguments: XmlResult.Arguments) extends XmlResult(arguments ) {
-
-    //set header properties
-
-    resultDocModifier.addStyleSheet("/account-control-panel/style/profile.css");
-    resultDocModifier.addScriptReference("/account-control-panel/scripts/profile.js");
-    resultDocModifier.addScriptReference("/account-control-panel/scripts/IEKeygen.js");
-    resultDocModifier.setTitle("Account Control Panel");
-    resultDocModifier.addNodes2Elem("tx-module", <h1>Account Control Panel</h1>);
-    resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Profile</a></li>);
-    resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li><a href="control-panel">Settings</a></li>);
-
-    //constants and variables
-
-    lazy val agent: RichGraphNode = res / FOAF.primaryTopic
-
-
-    // the content itself
-    // clearly in this case there is so much more in the the methods, that one could hesitate to call this an ssp
-
-    override def content = {
-      <div id="tx-content">
-        <h2>Personal Profile</h2>{agent ! match {
-          case _: BNode => createWebId()
-          case _: UriRef => existingWebId()
-         }}
-      </div>
-
-    }
-
-    //methods used to create content
-
-    def cp(s: Any) =  new UriRef("http://clerezza.org/2009/03/controlpanel#" + s)
-    def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
-
-
-    def createWebId() = {
-      <h3>Associate Profile to WebID</h3>
-      <div id="newOrExistingSelection">
-      <p>Your profile is not currently associated to a WebID. A WebID allows you
-        to link your friends as well as to log-in to many sites (supporting foaf+ssl
-        or open-id).
-      </p>
-      <p>You may either create a new WebID or associate your account to an
-        existing WebID. Only creating a WebID here will allow you to manage your
-        profile here.
-      </p>
-      <form action="#" id="associateSelection">
-        <button type="button" id="newWebIdButton">Create a new Web-Id</button>
-        <button type="button" id="existingWebIdButton">I already have a Web-ID and want to use it</button>
-      </form>
-      </div>
-      <div id="createNewWebId">
-      <p>You have chosen to create a new Web-Id.</p>
-      <p>The Web-ID will be created as follows:
-        <br/>
-        <ol>
-        <li>Web-Id:
-          {var webId = res / cp("suggestedPPDUri") *;
-          webId += "#me";
-          webId}
-        </li>
-        <li>Personal-Profile Document: {res/cp("suggestedPPDUri")*}</li>
-        </ol>
-      </p>
-      <form method="post" action="profile/create-new-web-id">
-        <input value="Create it!" type="submit"/>
-      </form>
-      </div>
-      <div id="setExistingWebId">
-      <p>Please enter your Web-Id, if your Web-Id supports Foaf+SSL you will
-        be able to use it to log in to this site.</p>
-      <form method="post" action="profile/set-existing-webid">
-        <label for="webid">WebID</label> <input type="text" name="webid" size="80" title="Web-ID"/>
-        <br/>
-        <input value="Associate Profile to Web-Id" type="submit"/>
-        <p/>
-      </form>
-      </div>
-
-    }
-
-    def existingWebId() = {
-      if ((res / cp("isLocalProfile")).as[Boolean]) {
-      existingLocalWebId()
-      } else {
-      roamingUser()
-      }
-    }
-
-
-    def existingLocalWebId() = {
-      <h3>Manage your profile</h3>
-       <p>Here you can change your public profile.</p>
-
-      <form method="post" action="profile/modify">
-      <input type="hidden" name="webId" value={agent *}/>
-      <table>
-        <tr><td class="formlabel">Name:</td>
-        <td><input type="text" name="name" value={agent / FOAF.name *}/></td>
-        </tr>
-        <tr><td class="formlabel multiline">Description:</td>
-        <td><textarea name="description" rows="3" cols="80">{agent / DC.description *}</textarea></td>
-        </tr>
-        <tr><td class="formlabel"><input value="Modify" type="submit"/></td><td/></tr>
-      </table>
-
-      <p/>
-      </form>
-
-      <h3>Contacts</h3>
-      
-      <table>{ var i =0
-        val friends = for (friend <- agent/FOAF.knows) yield {
-          <td><form method="post" action="profile/deleteContact">
-            {
-              friend! match {
-                case webId: UriRef => render(webId, "box-naked")
-                case _ => render(friend, "box-naked")
-              }
-            }
-            <br/>
-            <input type="hidden" name="contactWebId" value={friend*}/>
-            <input type="submit" value="remove contact" />
-          </form></td>
-        /*render(friend!.asInstanceOf[UriRef])
-              import PersonPanel._
-        <td class="personInABox">{personInABox(friend)}</td>*/
-       }
-       for (row <- friends.grouped(5)) yield <tr>{row}</tr>
-      }</table>
-      <form id="addContact" method="get" action="profile/addContact">
-      <label for="contactWebId">Add contact bei WebId:<br/></label>
-      <input type="text" name="contactWebId" size="80"/><input type="submit" value="add contact" />
-      </form>
-
-      <h3>Key and Certificate Creation</h3>
-
-      <script type="text/javascript"> <![CDATA[$(document).ready(  function() { configurePage(); }   ); ]]> </script>
-
-      <div id="iehelptext" style="display: none;">
-      <p>Using Internet Explorer under Windows Vista or above or Windows
-        Server 2008, you need to configure the following for this to work:</p>
-      <ul>
-        <li>Add this site to the <i>Trusted Sites</i> list: in Internet
-        Options -&gt; Security -&gt; Trusted Sites -&gt; Sites -&gt; Add ...</li>
-        <li>You may need to configure the trust level (in this tab), using
-        <i>Custom Level...</i>: enable <i>Initialize and script ActiveX
-          controls not marked as safe for scripting</i>.</li>
-        <li>If you are using Windows Vista without SP1 or above, you will
-        probably need to install <a href="cacert.crt">this certificate</a> as a
-        Trusted Root Certification Authority Certificate for your own
-        certificate installation to succeed. You should probably remove that
-        trusted root CA certificate afterwards.</li>
-      </ul>
-      </div>
-      <form id="keygenform" method="post" action="profile/keygen">
-      <input name="webId" id="webId" type="hidden" value={agent*} />
-      <table>
-        <colgroup><col width="1*"/><col/></colgroup>
-        <tr>
-        <td class="formlabel">Certificate Name:</td>
-        <td>
-          <input alt="create a certificate name that will help you distinguish it from others you may have" name="cn"
-              size="35" id="cn" type="text" value={ ((agent/FOAF.name*)+"@clerezza")}/>
-        </td>
-        </tr>
-        <tr>
-        <td class="formlabel">Key strength:</td>
-        <td id="keystrenghtd">
-          <keygen id="spkac" name="spkac" challenge="TheChallenge1"/>
-        </td>
-        </tr>
-        <tr>
-        <td class="formlabel">Valid for:</td>
-        <td>
-          <input type="text" name="days" value="365" size="4"/>
-          days <input type="text" name="hours" value="0.0" size="4"/> hours</td>
-        </tr>
-        <tr>
-        <td class="formlabel">Comment:</td>
-        <td><input type="text" name="comment" value="" size="80"/></td>
-        </tr>
-        <tr><td class="formlabel"><input id="keygensubmit" type="submit" value="create certificate" /></td><td/></tr>
-      </table>
-      </form>
-      <h3>Existing Certificates</h3>
-      <form method="post" action="profile/deletekey">
-      <table>
-        <tr><th>Delete</th><th>Certificate Details</th></tr>
-        <input name="webId" id="webId" type="hidden" value={agent*} />
-        <tbody>{
-          for (key <- agent/-CERT.identity )
-          yield { val modulus = (key/RSA.modulus).as[BigInteger]
-              if (modulus == null)  <span/> //todo: broken public key, should delete it
-              else <tr><td><input type="checkbox" name="keyhash" value={modulus.hashCode().toString()}/></td>
-            <td><table>
-              <tr><td class="propvalue">Created:</td><td>{beautifyDate(key/DC.date )}</td></tr>
-              <tr><td class="propvalue">Comment:</td><td>{ key/RDFS.comment* }</td></tr>
-              <tr><td class="propvalue multiline">Modulus:</td><td><code>{ beautifyHex(key/RSA.modulus) }</code></td></tr>
-              <tr><td class="propvalue">Exponent:</td><td><code>{ beautifyInt(key/RSA.public_exponent) }</code></td></tr>
-              </table>
-            </td>
-                </tr>}
-        }</tbody>
-      </table>
-      <input type="submit" value="Disable Keys"/>
-      </form>
-      <p></p>
-
-    }
-
-    def roamingUser() = {
-      <h3>Using remote profile</h3>
-       <p>
-      {agent / FOAF.nick *}, you have accessed this site using your WebID
-        {"<" + (agent *) + ">"}
-        which has not been
-        created on this site.To edit your profile you should visit the site issuing the
-        profile.</p>
-    }
-
-
-
-
-    def beautifyDate(dtIt: CollectedIter[RichGraphNode]) {
-      if (0 == dtIt.size) return "_"
-      DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.FULL).format(dtIt.as[Date])
-    }
-
-
-    def beautifyHex(dtIt: CollectedIter[RichGraphNode]): String = {
-      if (0 == dtIt.size) return "warning! missing. Key invalid"
-      //this is a problem, it should always be here or it is invalid, and key should be removed
-      val bigint: BigInteger = dtIt.as[BigInteger]
-      val bstr = bigint.toString(16).toUpperCase;
-      val sbuf = new StringBuffer(bstr.size + (bstr.size/2)+10)
-      var cnt = 0
-      for (c <- bstr.toCharArray) {
-      if ((cnt % 2) == 0) sbuf.append(' ')
-      sbuf.append(c)
-      cnt += 1
-      }
-      sbuf.toString
-    }
-
-
-
-    def beautifyInt(dtIt: CollectedIter[RichGraphNode] ) :String = {
-      if (0 == dtIt.size) return "warning! missing. Key invalid"
-      else return dtIt.as[BigInteger].toString
-    }
-  }
-}
-
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala
deleted file mode 100644
index 735aee0..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/RenderingUtility.scala
+++ /dev/null
@@ -1,94 +0,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.
- */
-
-package org.apache.clerezza.platform.accountcontrolpanel.html
-
-
-import scala.xml.Node
-import scala.xml.NodeSeq
-import scala.xml.Text
-import java.net.URLEncoder
-import org.apache.clerezza._
-import org.apache.clerezza.rdf.core.UriRef
-import org.apache.clerezza.rdf.ontologies.FOAF
-import org.apache.clerezza.rdf.ontologies.RDFS
-import rdf.scala.utils.CollectedIter
-import rdf.scala.utils.RichGraphNode
-import rdf.scala.utils.Preamble._
-/**
- * Some utility methods for the renderlets
- */
-object RenderingUtility {
-  val emptyText = new Text("")
-
-  def ifE[T](arg:T)(template: T=>Node ):NodeSeq = {
-    def isEmpty(arg: Any): Boolean = {
-      arg match {
-        case prod: Product => prod.productIterator.forall(isEmpty(_))
-        case str: String => (str.size == 0)
-        case it: CollectedIter[RichGraphNode] => (it.size == 0)
-        case node: RichGraphNode => (null == node)
-        case other: AnyRef => (null == other)
-        case _ => false //literals can't be empty
-      }
-    }
-    if (isEmpty(arg)) return emptyText else template(arg)
-  }
-
-  def firstOf(node: RichGraphNode, uris: UriRef*):CollectedIter[RichGraphNode] = {
-    for (uri <- uris) {
-      val res : CollectedIter[RichGraphNode] = node/uri
-      if (res.size>0) return res
-    }
-    return new CollectedIter[RichGraphNode]()
-  }
-
-
-
-  /**
-   * Show a person: a picture, a link to their local profile and their name
-   * Different default icons should be shown if the agent is a person, company, group, robot...
-   *
-   * assumes the p is WebID node (can change later)
-   */
-  def getAgentPix(p: RichGraphNode) = {
-    val pix = firstOf(p, FOAF.depiction, FOAF.logo, FOAF.img).getNode match {
-      case uri: UriRef => uri.getUnicodeString
-      case _ => "http://upload.wikimedia.org/wikipedia/commons/0/0a/Gnome-stock_person.svg"
-    }
-    <a href={"/browse/person?uri="+encode(p*)}><img class="mugshot" src={pix}/></a>
-  }
-
-  private def encode(url: String): String =  URLEncoder.encode(url,"UTF8")
-
-  /**
-   * get a usable name from the properties available including nick
-   */
-  def getName(p: RichGraphNode): String =  {
-     val name = p/FOAF.name*;
-     if ("" != name ) { return name }
-     val firstNm: String = p/FOAF.firstName*;
-     val fmlyNm :String = firstOf(p, FOAF.family_name,FOAF.familyName)*;
-       if ("" != firstNm || "" != fmlyNm) { return firstNm+" "+fmlyNm }
-     return p*
-
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala
deleted file mode 100644
index a2a58e6..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/html/SettingsPanel.scala
+++ /dev/null
@@ -1,163 +0,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.
- */
-
-package org.apache.clerezza.platform.accountcontrolpanel.html
-
-import org.apache.clerezza.rdf.scala.utils.Preamble._
-import org.apache.clerezza.platform.accountcontrolpanel.ontologies.CONTROLPANEL
-import org.apache.clerezza.platform.typerendering.scala._
-
-
-class SettingsPanel extends SRenderlet {
-
-  val getRdfType = CONTROLPANEL.SettingsPage
-
-    override def renderedPage(arguments: XmlResult.Arguments) = new XmlResult(arguments ) {
-    override def content = {
-import org.apache.clerezza.rdf.core.UriRef
-import scala.xml.NodeBuffer
-import scala.collection.mutable.ListBuffer
-def cp(s: Any) = new UriRef("http://clerezza.org/2009/03/controlpanel#"+s)
-def osgi(s: Any) = new UriRef("http://clerezza.org/2008/11/osgi#"+s)
-def platform(s: Any) = new UriRef("http://clerezza.org/2009/08/platform#" + s)
-val nodeBuff = new ListBuffer[NodeBuffer]
-resultDocModifier.setTitle("Account Control Panel");
-resultDocModifier.addNodes2Elem("tx-module", <h1>Account Control Panel</h1>);
-resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li><a href="profile">Profile</a></li>);
-resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Settings</a></li>);
-
-if ((res/cp("userBundlePermission")*) == "true") {
-  nodeBuff +=(<h2>Bundle Control Panel</h2>
-  <h3>Install Bundle</h3>
-
-  <form method="post" action="control-panel/install-bundle" enctype="multipart/form-data">
-    <input type="file" class="FieldText" name="bundle" size="30" title="bundle path"/><br/><br/>
-    <input style="width: 5em;" value="Install" type="submit"/><p />
-  </form>
-  <br/><br/>
-  <h3>User Bundles</h3>
-  <table border="1">
-  <tbody>
-    <tr>
-      <th>Location</th>
-      <th>Status</th>
-      <th colspan="4">Action</th>
-    </tr>
-
-    {for (renderlet <- (res/-osgi("owner")).sort((a,b) => ((a*)<(b*)))) yield
-    <tr>
-      <td>{renderlet*}</td>
-      <td>{renderlet/osgi("status")* match {
-        case "2" => "Installed"
-        case "4" => "Resolved"
-        case "8" => "Starting"
-        case "16" => "Stopping"
-        case "32" => "Active"
-        }}
-      </td>
-      {if (((renderlet/osgi("bundle_id")).length) > 0)
-      <td>
-      <form method="post" action="control-panel/start-bundle">
-      <input name="bundleId" value={(renderlet/osgi("bundle_id"))*} type="hidden"/>
-      <input value="start" type="submit"/>
-      </form>
-      </td>
-      <td>
-      <form method="post" action="control-panel/stop-bundle">
-      <input name="bundleId" value={(renderlet/osgi("bundle_id"))*} type="hidden"/>
-      <input value="stop" type="submit"/>
-      </form>
-      </td>
-      <td>
-      <form method="post" action="control-panel/uninstall-bundle">
-      <input name="bundleId" value={(renderlet/osgi("bundle_id"))*} type="hidden"/>
-      <input value="uninstall" type="submit"/>
-      </form>
-      </td>
-      else
-      <td colspan="3">Not registered as bundle</td>}
-      </tr>
-      }
-    </tbody>
-  </table>
-  <br/>)
-}
-
-if((res/cp("changePasswordPermission")*) == "true") {
-  nodeBuff +=(<h2>Change Password</h2>
-
-
-  <form action="control-panel/change-password" method="post">
-    <fieldset>
-      <ol style="display: block;">
-        <li class="tx-line" style="background-image: none;">
-          <label>Current Password:</label>
-          <span class="tx-item">
-            <input type="password" name="oldPW"/>
-          </span>
-        </li>
-        <li class="tx-line" style="background-image: none;">
-          <label>New Password:</label>
-          <span class="tx-item">
-            <input type="password" name="newPW"/>
-          </span>
-        </li>
-        <li class="tx-line" style="background-image: none;">
-          <label>Confirm new Password:</label>
-          <span class="tx-item">
-            <input type="password" name="confirmNewPW"/>
-          </span>
-        </li>
-        <br />
-        <input style="width: 5em;" type="submit" name="submit" value="Submit"/>
-      </ol>
-      <br/>
-    </fieldset>
-  </form>)
-
-
-}
-
-if((res/cp("changedPassword")).length > 0) {
-  nodeBuff +=(<br /><span>Password has not changed, either wrong current password or the
-        new password and the confirmation didn't match!<br /><br /></span>)
-}
-
-
-nodeBuff +=(<h2>Change user's default language</h2>
-  <form method="post" action="control-panel/change-language">
-    {render(context/platform("instance")/platform("languages"), "naked")}
-    <br/><br/>
-    <script type="text/javascript">$("#availablelanguages").val({"'" + (context/platform("user")/platform("preferredLangInISOCode")*) + "'"})</script>
-    <input style="width: 5em;" type="submit" name="submit" value="Submit"/>
-    <br/><br/>
-  </form>)
-
-<div id="tx-content">
-  <div class="tx-edit" style="margin-left: 0.5em;">
-  {if(nodeBuff.isEmpty)
-    <span>There are no settings you can configure for this account!</span>
-  else
-    nodeBuff
-  }
-  </div>
-</div>
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala
deleted file mode 100644
index ae7953f..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/main/scala/org/apache/clerezza/platform/accountcontrolpanel/permissions.scala
+++ /dev/null
@@ -1,103 +0,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.
- */
-
-package org.apache.clerezza.platform.accountcontrolpanel
-
-import java.security.Permission
-import org.slf4j.scala.Logging
-
-//note: file has lower class name, as it contains many classes
-
-
-/**
- * superclass for the permission classes, to avoid a lot of boilerplate code
- *
- * @author bblfish, reto
- */
-abstract
-class AbstractPermission(val accountName: String, val actions: String ="")
-  extends Permission(accountName) with Logging  {
-
-  if (actions != "") {
-    throw new RuntimeException(getClass.getName+": actions must be an empty String "+
-      "(second argument only in constructor for supporting building from canonical form")
-  }
-
-  def getActions: String = actions
-
-  /**
-   * A subclass implies another permission if and only if they are equals
-   */
-   override
-  def implies(permission: Permission): Boolean = {
-    logger.debug("checking for "+permission+" is implied by "+ this)
-    var result: Boolean = equals(permission)
-    return result
-  }
-
-  override
-  def equals(other: Any): Boolean =
-      other match {
-      case that:  AbstractPermission  =>  
-        (that eq this ) || ((this.getClass == that.getClass) && accountName == that.accountName )
-      case _ => false
-      }
-
-  /**
-   * For the hashCode the class and the accountName is considered
-   */
-  override
-  def hashCode: Int = {
-    return  getClass.hashCode + (if (accountName != null) accountName.hashCode else 0)
-  }
-}
-
-/**
- * Permission to change the password
- * @author ali
- *
- */
-class ChangePasswordPermission(accountName: String, actions: String ="")
-  extends AbstractPermission(accountName, actions) {
-
-}
-
-/**
- * Permission to access the account control panel
- *
- * @author ali
- *
- */
-class AccountControlPanelAppPermission(accountName: String, actions: String ="")
-  extends AbstractPermission(accountName)  {
-
-
-}
-
-/**
- * Permission for user to have own bundles
- *
- * @author mir
- *
- */
-class UserBundlePermission( accountName: String, actions: String ="")
-  extends AbstractPermission(accountName)  {
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css
deleted file mode 100644
index ff49a4d..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/documentation/style/style.css
+++ /dev/null
@@ -1,421 +0,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.
- *
-*/
-
-/*---------------------------------------------------------------------------
- *  Two- and three-column layout
- */
-
-#banner {
-    top: 0px;
-    left: 0px;
-    right: 0px;
-    height: 116px;
-}
-
-#left {
-    position: absolute;
-    z-index: 2;
-    left: 8px;
-    width: 184px;
-    top: 125px;
-    bottom: 8px;
-    margin: 0px;
-    padding: 0px;
-}
-
-#right {
-    position: absolute;
-    z-index: 1;
-    right: 8px;
-    width: 184px;
-    top: 125px;
-    bottom: 8px;
-    margin: 0px;
-    padding: 0px;
-}
-
-.Content3Column {
-    position: absolute;
-    top: 125px;
-    bottom: 8px;
-    left: 208px;
-    right: 216px;
-}
-
-.Content2Column {
-    position: absolute;
-    top: 125px;
-    bottom: 8px;
-    left: 208px;
-    right: 16px;
-}
-
-#center {
-    z-index: 3;
-    margin: 0px;
-    border: none;
-    padding-bottom: 8px;
-}
-
-
-/*---------------------------------------------------------------------------
- *  Default element styles
- */
-
-body {
-    padding: 0px;
-    margin: 0px;
-    border: 0px;
-
-    font-family: helvetica, arial, sans-serif;
-    font-size: 12px;
-
-    background-color: white;
-    color: black;
-}
-
-h1, h2, h3, h4, h5, h6 {
-    margin: 0px;
-    border: 0px;
-    padding: 0px;
-    font-weight: normal;
-}
-
-a:link { color: #008DA8; }
-a:active { color: #FE5400; }
-a:hover { color: #FE5400; }
-a:visited { color: black; }
-
-iframe {
-    width:100%;
-    height: 800px;
-    border: 0px;
-}
-
-img {
-    border: 0px;
-    padding: 0px;
-    margin: 0px;
-}
-
-p {
-    border: 0px;
-    padding: 0px;
-    margin: 0px;
-    margin-bottom: 10px;
-}
-
-blockquote {
-    margin-bottom: 10px;
-}
-
-td {
-    font-size: 12px;
-    padding: 2px;
-}
-
-tr.a {
-    background-color:  #e0e0e0;
-}
-tr.b {
-    background-color: #ffffff;
-}
-
-th {
-    font-size: 12px;
-    font-weight: bold;
-    white-space: nowrap;
-    padding: 2px;
-}
-
-th.Row {
-    text-align: left;
-    vertical-align: top;
-}
-
-ul, ol {
-    border: 0px;
-    padding: 0px;
-    margin-top: 0px;
-    margin-bottom: 12px;
-    margin-left: 20px;
-}
-
-
-/*---------------------------------------------------------------------------
- *  Page banner
- */
-
-#banner {
-    margin: 0px;
-    border: 0px;
-    border-bottom: 1px solid #008DA8;
-    padding: 0px;
-    background-color: #e0e0e0;
-    color: #008DA8;
-    vertical-align: bottom;
-}
-
-#banner a { text-decoration: none; }
-#banner a:visited { color: #008DA8; }
-#banner a:hover { color: #FE5400; }
-#banner a:active { color: #FE5400; }
-
-#logo {
-    position: absolute;
-    top: 5px;
-    left: 8px;
-}
-
-#versions {
-    position: absolute;
-    width: auto;
-    right: 0px;
-    top: 0px;
-    margin: 8px;
-    font-weight: normal;
-}
-
-/*---------------------------------------------------------------------------
- *  Page content
- */
-
-#content {
-    margin: 0px;
-    background-color: white;
-    color: black;
-    height: 100%;
-}
-
-#content h1 {
-    width: 100%;
-    font-size: 18px;
-    background-color: #008DA8;
-    color: white;
-    padding: 2px;
-    padding-left: 6px;
-    margin-top: 24px;
-    margin-bottom: 12px;
-}
-
-#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
-    margin-top: 0px;
-}
-
-#content a { text-decoration: underline; }
-#content a:link { color: #008DA8; }
-#content a:visited { color: #008DA8; }
-#content a:active { color: #FE5400; }
-#content a:hover { color: #FE5400; }
-
-#content h2 {
-    margin-top: 24px;
-    border-top: 1px solid #008DA8;
-    margin-bottom: 16px;
-    font-size: 15px;
-    font-weight: bold;
-    background-color:  #e0e0e0;;
-    padding: 2px;
-}
-
-#content li {
-    margin-bottom: 6px;
-}
-
-#content th {
-    background-color:  #e0e0e0;
-}
-
-#content td {
-    
-}
-
-.Source pre {
-    padding: 4px;
-    font-family: courier new, monospace;
-    font-size: 11px;
-    border: 1px solid #008DA8;
-    background-color:  #e0e0e0;
-    color: black;
-}
-
-.Source:before {
-    margin: 0px;
-    padding: 0px;
-    border: 0px;
-    font-size: inherit;
-    line-spacing: 100%;
-}
-
-.highlight {
-    background-color:  #e0e0e0;
-    border: 1px dotted #008DA8;
-    padding: 5px;
-}
-
-/* The following are for images, but can also apply to div's containing images. */
-
-#content .Float {
-    float: right;
-    margin-left: 8px;
-    margin-right: 0px;
-    margin-top: 8px;
-    margin-bottom: 8px;
-}
-
-#content .Diagram {
-    display: block;
-    margin-left: auto;
-    margin-right: auto;
-    margin-top: 8px;
-    margin-bottom: 8px;
-}
-
-
-#content .Inline {
-    display: inline;
-}
-
-.RuleOfThumb {
-    font-weight: bold;
-}
-
-/*---------------------------------------------------------------------------
- *  Side panels
- */
-
-.SidePanel {
-    background-color: white;
-    padding: 0px;
-    font-size: 11px;
-}
-
-.SidePanel h1 {
-    margin: 0px;
-    border: 0px;
-    padding: 4px;
-
-    color: #008DA8;
-
-    font-size: 12px;
-    font-weight: bold;
-}
-
-
-.SidePanel a { text-decoration: none; }
-.SidePanel a:link { color: #000000; }
-.SidePanel a:visited { color: #000000; }
-.SidePanel a:active { color: #FE5400; }
-.SidePanel a:hover { color: #FE5400; }
-
-/*---------------------------------------------------------------------------
- *  Menus
- */
-
-.MenuGroup {
-    border-left: 1px solid #A3DAE6;
-    border-top: 1px solid #A3DAE6;
-    border-bottom: 1px solid white; /* IE work-around */
-
-    margin-bottom: 8px;
-    background-color: white;
-    color: #008DA8;
-}
-
-.MenuGroup ul {
-    margin: 0px;
-    padding-left: 4px;
-    list-style-type: none;
-}
-
-.MenuGroup li {
-    padding: 2px;
-}
-
-.MenuGroup .currentLink {
-/*    background-color: #060;*/
-    background-color:  #e0e0e0;
-    color: #008DA8;
-}
-
-
-/*---------------------------------------------------------------------------
- *  News panel
- */
-
-.NewsGroup {
-    border-left: 1px solid #A3DAE6;
-    border-top: 1px solid #A3DAE6;
-    border-bottom: 1px solid white; /* IE workaround */
-    margin-bottom: 8px;
-
-    color: #008DA8;
-}
-
-.NewsItem {
-    margin: 4px;
-}
-
-.NewsDate {
-    font-weight: bold;
-    margin: 0px;
-    padding: 0px;
-}
-
-.NewsText {
-    padding: 0px;
-    margin: 0px;
-    margin-bottom: 8px;
-}
-
-.NewsText a { text-decoration: underline; }
-.NewsText a:link { color: #008DA8; }
-.NewsText a:visited { color: #008DA8; }
-.NewsText a:active { color: #FE5400; }
-.NewsText a:hover { color: #FE5400; }
-
-.NewsMore {
-    font-size: smaller;
-    margin: 4px;
-    margin-top: 8px;
-    text-align: left;
-}
-
-.NewsGroup td {
-    font-size: 12px;
-}
-
-/*---------------------------------------------------------------------------
- *  Document meta-information
- */
-
-.Meta {
-    margin-top: 64px;
-    font-size: smaller;
-    color: #008DA8;
-    text-align: right;
-}
-
-.Meta a { text-decoration: underline; }
-.Meta a:link { color: #008DA8; }
-.Meta a:visited { color: #008DA8; }
-.Meta a:active { color: #FE5400; }
-.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png
deleted file mode 100644
index cb0efb0..0000000
Binary files a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/resources/images/clerezza.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml
deleted file mode 100644
index 8d5a4cb..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/site.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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.
- */
--->
-
-<project>
-    <body>
-        <menu name="Documentation">
-            <item name="Usage" href="documentation/usage.xhtml"/>
-        </menu>
-    </body>
-</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml
deleted file mode 100644
index 38be885..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/sitemap.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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.
-
--->
-
-<sitemap>
-    <section>
-        <name>Documentation</name>
-        <page>usage.xhtml</page>
-    </section>
-</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml
deleted file mode 100644
index 6c22c93..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/content/usage.xhtml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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.
- */
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
-	<head>
-		<title>Usage: How to use the Account Control Panel</title>
-	</head>
-	<body>
-		<h1>Usage: How to use the Account Control Panel</h1>
-		<p>Author: Tsuyoshi Ito - clerezza.org</p>
-		<p>Date: January 27, 2009</p>
-		<h2 id="list">1. List installed bundles</h2>
-		<p>
-			Each user can upload and install bundles into the platform. Users and permissions can be created via <a href="http://localhost:8282/admin/user-manager" target="_blank">http://localhost:8282/admin/user-manager</a> and <a href="http://localhost:8282/admin/role-manager" target="_blank">http://localhost:8282/admin/role-manager</a>. <br />
-			Enter the following URL: <a href="http://localhost:8282/user/admin/control-panel" target="_blank">http://localhost:8282/user/admin/control-panel</a> to list all bundles from the user "admin" (when asked to authenticate use username "admin" and password "admin). If you want to list installed bundles from another user, replace "admin" in the URL with the username of the other user.
-		</p>
-		<h2 id="install">2. Install a bundle</h2>
-		<p>
-            You can upload a bundle by clicking on the link <a href="http://localhost:8282/user/admin/control-panel/install-bundle-form">Install Bundle</a> on <a href="http://localhost:8282/user/admin/control-panel" target="_blank">http://localhost:8282/user/admin/control-panel</a>. Enter the URL of your bundle (e.g. Location: http://localhost/mybundle-1.0.jar) and click on the button "install". The uploaded and installed bundles have the same permission as you have. 
-        </p>
-		<h2 id="start">3. Start, Stop and Uninstall a bundle</h2>
-        <p>
-            A user can start, stop and  uninstall a bundle on <a href="http://localhost:8282/user/admin/control-panel" target="_blank">http://localhost:8282/user/admin/control-panel</a>, whereas "admin" can be replaced by another username. Click on the appropriate button for start , stop or uninstall a bundle.
-        </p>
-        <p>
-            That's all. Enjoy.
-        </p>
-    </body>
-</html>
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html
deleted file mode 100644
index 4b10edb..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/src/site/xsite/templates/skin.html
+++ /dev/null
@@ -1,71 +0,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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>clerezza.org - ${title}</title>
-        <link rel="stylesheet" type="text/css" href="style/style.css"/>
-        ${head}
-    </head>
-    <body>
-
-        <div id="banner">
-            <a href="http://clerezza.org/">
-              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
-            </a><br />
-        </div>
-
-        <div id="center" class="${centerClass}">
-            <div id="content">
-                <!-- <h1 class="FirstChild">${title}</h1> -->
-                ${body}
-                <p>Copyright (c) 2008 trialox.org (trialox AG, Switzerland)</p>
-                <br /><br />
-            </div>
-        </div>
-
-        <div class="SidePanel" id="left">
-            <#list sitemap.sections as section>
-                <div class="MenuGroup">
-                    <h1>${section.name}</h1>
-                    <ul>
-                        <#list section.entries as entry>
-                            <#if entry = page>
-                                <li class="currentLink">${entry.title}</li>
-                            <#else>
-                                <li><a href="${entry.href}">${entry.title}</a></li>
-                            </#if>
-                        </#list>
-                    </ul>
-                </div>
-            </#list>
-            <div class="MenuGroup">
-                  <h1>Project Site</h1>
-                  <ul>
-
-                              <li><a href="../index.html">Back to project site</a></li>
-                  </ul>
-              </div>
-        </div>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml
deleted file mode 100644
index 023237b..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>platform.accountcontrolpanel</artifactId>
-        <version>0.10</version>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.accountcontrolpanel.ontologies</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-    <name>Clerezza - Platform Account Contral Panel Ontologies</name>
-    <description>
-        Ontologies of the Account Control Panel
-    </description>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.clerezza</groupId>
-            <artifactId>rdf.core</artifactId>
-            <version>0.14</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.clerezza</groupId>
-                <artifactId>maven-ontologies-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>generate-sources</phase>
-                        <configuration>
-                            <resourcePath>${basedir}/src/main/resources</resourcePath>
-                            <sources>
-                                <source>${basedir}/target/generated-sources/main/java</source>
-                            </sources>
-                        </configuration>
-                        <goals>
-                            <goal>generate</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <version>0.4</version>
-        </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf
deleted file mode 100644
index e6c76a8..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.ontologies/src/main/resources/org/apache/clerezza/platform/accountcontrolpanel/ontologies/controlpanel.rdf
+++ /dev/null
@@ -1,120 +0,0 @@
-<?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.
-
--->
-
-<rdf:RDF
-	xml:base="http://clerezza.org/2009/03/controlpanel#"
-	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
-	xmlns:owl="http://www.w3.org/2002/07/owl#"
-	xmlns:dc="http://purl.org/dc/elements/1.1/"
-	xmlns:skos="http://www.w3.org/2008/05/skos#"
->
-
-<!-- Ontology -->
-
-<owl:Ontology rdf:about="http://clerezza.org/2009/03/controlpanel#">
-	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
-	<dc:title xml:lang="en">
-		Clerezza Concept Manager
-	</dc:title>
-</owl:Ontology>
-
-<!-- Classes -->
-
-<rdfs:Class rdf:about="#SettingsPage">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
-	<rdfs:label xml:lang="en">account settings Page</rdfs:label>
-	<skos:definition xml:lang="en">A web page containing a list of bundles of a user. Over the page
-		bundles can be managed.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#ProfilePage">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
-	<rdfs:label xml:lang="en">personal profile management page</rdfs:label>
-	<skos:definition xml:lang="en">A web page allowing users to change  
-	their profile.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-</rdfs:Class>
-
-<rdfs:Class rdf:about="#ContactConfirmPage">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
-	<rdfs:label xml:lang="en">ContactConfirmPage</rdfs:label>
-	<skos:definition xml:lang="en">page for confiming a new contact
-	</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-</rdfs:Class>
-
-<!-- Properties -->
-
-<rdf:Property rdf:about="#userBundlePermission">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
-	<rdfs:label xml:lang="en">User Bundle Permission</rdfs:label>
-	<skos:definition xml:lang="en">Points to a boolean indicating if the user has
-		the permission to install bundles over his/her account control page, which is the subject.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-	<rdfs:domain rdf:resource="#SettingsPage" />
-	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#changePasswordPermission">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
-	<rdfs:label xml:lang="en">Change Password Permission</rdfs:label>
-	<skos:definition xml:lang="en">Points to a boolean indicating if the user has
-		the permission to change the password over his/her account control page, which is the subject.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-	<rdfs:domain rdf:resource="#SettingsPage" />
-	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#changedPassword">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
-	<rdfs:label xml:lang="en">change password</rdfs:label>
-	<skos:definition xml:lang="en">Points from a settings page over which an attempt was made to change the password of the user owning it
-		to a boolean indicating if an attempt succeeded.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-	<rdfs:domain rdf:resource="#SettingsPage" />
-	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#isLocalProfile">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
-	<rdfs:label xml:lang="en">profile local</rdfs:label>
-	<skos:definition xml:lang="en">Points from a profile page to a boolean 
-indicating if the server considers itself as authoritative for that profile.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-	<rdfs:domain rdf:resource="#SettingsPage" />
-	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
-</rdf:Property>
-
-<rdf:Property rdf:about="#suggestedPPDUri">
-	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
-	<rdfs:label xml:lang="en">Suggested PPD URI</rdfs:label>
-	<skos:definition xml:lang="en">Points to a uri suggested for a new local 
-	personal profile document of the subject.</skos:definition>
-	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/03/controlpanel#" />
-	<rdfs:domain rdf:resource="#SettingsPage" />
-	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI"/>
-</rdf:Property>
-
-</rdf:RDF>
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/pom.xml
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/pom.xml b/platform/platform.accountcontrolpanel/pom.xml
deleted file mode 100644
index a23edbd..0000000
--- a/platform/platform.accountcontrolpanel/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.clerezza</groupId>
-        <artifactId>clerezza</artifactId>
-        <version>0.5</version>
-        <relativePath>../parent</relativePath>
-    </parent>
-    <groupId>org.apache.clerezza</groupId>
-    <artifactId>platform.accountcontrolpanel</artifactId>
-    <packaging>pom</packaging>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Clerezza - Platform Account Control Panel</name>
-    <description>A web interface that provides functions to configure the account of a platform user.</description>
-    
-    <modules>
-        <module>platform.accountcontrolpanel.ontologies</module>
-        <module>platform.accountcontrolpanel.core</module>
-    </modules>
-</project>
\ No newline at end of file


[07/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js
deleted file mode 100644
index 745a2cf..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/jquery.rdfquery.core-1.0.js
+++ /dev/null
@@ -1,4040 +0,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.
- *
-*/
-
-/*
- * $ URIs @VERSION
- * 
- * Copyright (c) 2008,2009 Jeni Tennison
- * Licensed under the MIT (MIT-LICENSE.txt)
- *
- */
-/**
- * @fileOverview $ URIs
- * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
- * @copyright (c) 2008,2009 Jeni Tennison
- * @license MIT license (MIT-LICENSE.txt)
- * @version 1.0
- */
-/**
- * @class
- * @name jQuery
- * @exports $ as jQuery
- * @description rdfQuery is a <a href="http://jquery.com/">jQuery</a> plugin. The only fields and methods listed here are those that come as part of the rdfQuery library.
- */
-(function ($) {
-
-  var
-    mem = {},
-    uriRegex = /^(([a-z][\-a-z0-9+\.]*):)?(\/\/([^\/?#]+))?([^?#]*)?(\?([^#]*))?(#(.*))?$/i,
-    docURI,
-
-    parseURI = function (u) {
-      var m = u.match(uriRegex);
-      if (m === null) {
-        throw "Malformed URI: " + u;
-      }
-      return {
-        scheme: m[1] ? m[2].toLowerCase() : undefined,
-        authority: m[3] ? m[4] : undefined,
-        path: m[5] || '',
-        query: m[6] ? m[7] : undefined,
-        fragment: m[8] ? m[9] : undefined
-      };
-    },
-
-    removeDotSegments = function (u) {
-      var r = '', m = [];
-      if (/\./.test(u)) {
-        while (u !== undefined && u !== '') {
-          if (u === '.' || u === '..') {
-            u = '';
-          } else if (/^\.\.\//.test(u)) { // starts with ../
-            u = u.substring(3);
-          } else if (/^\.\//.test(u)) { // starts with ./
-            u = u.substring(2);
-          } else if (/^\/\.(\/|$)/.test(u)) { // starts with /./ or consists of /.
-            u = '/' + u.substring(3);
-          } else if (/^\/\.\.(\/|$)/.test(u)) { // starts with /../ or consists of /..
-            u = '/' + u.substring(4);
-            r = r.replace(/\/?[^\/]+$/, '');
-          } else {
-            m = u.match(/^(\/?[^\/]*)(\/.*)?$/);
-            u = m[2];
-            r = r + m[1];
-          }
-        }
-        return r;
-      } else {
-        return u;
-      }
-    },
-
-    merge = function (b, r) {
-      if (b.authority !== '' && (b.path === undefined || b.path === '')) {
-        return '/' + r;
-      } else {
-        return b.path.replace(/[^\/]+$/, '') + r;
-      }
-    };
-
-  /**
-   * Creates a new jQuery.uri object. This should be invoked as a method rather than constructed using new.
-   * @class Represents a URI
-   * @param {String} [relative='']
-   * @param {String|jQuery.uri} [base] Defaults to the base URI of the page
-   * @returns {jQuery.uri} The new jQuery.uri object.
-   * @example uri = jQuery.uri('/my/file.html');
-   */
-  $.uri = function (relative, base) {
-    var uri;
-    relative = relative || '';
-    if (mem[relative]) {
-      return mem[relative];
-    }
-    base = base || $.uri.base();
-    if (typeof base === 'string') {
-      base = $.uri.absolute(base);
-    }
-    uri = new $.uri.fn.init(relative, base);
-    if (mem[uri]) {
-      return mem[uri];
-    } else {
-      mem[uri] = uri;
-      return uri;
-    }
-  };
-
-  $.uri.fn = $.uri.prototype = {
-    /**
-     * The scheme used in the URI
-     * @type String
-     */
-    scheme: undefined,
-    /**
-     * The authority used in the URI
-     * @type String
-     */
-    authority: undefined,
-    /**
-     * The path used in the URI
-     * @type String
-     */
-    path: undefined,
-    /**
-     * The query part of the URI
-     * @type String
-     */
-    query: undefined,
-    /**
-     * The fragment part of the URI
-     * @type String
-     */
-    fragment: undefined,
-    
-    init: function (relative, base) {
-      var r = {};
-      base = base || {};
-      $.extend(this, parseURI(relative));
-      if (this.scheme === undefined) {
-        this.scheme = base.scheme;
-        if (this.authority !== undefined) {
-          this.path = removeDotSegments(this.path);
-        } else {
-          this.authority = base.authority;
-          if (this.path === '') {
-            this.path = base.path;
-            if (this.query === undefined) {
-              this.query = base.query;
-            }
-          } else {
-            if (!/^\//.test(this.path)) {
-              this.path = merge(base, this.path);
-            }
-            this.path = removeDotSegments(this.path);
-          }
-        }
-      }
-      if (this.scheme === undefined) {
-        throw "Malformed URI: URI is not an absolute URI and no base supplied: " + relative;
-      }
-      return this;
-    },
-  
-    /**
-     * Resolves a relative URI relative to this URI
-     * @param {String} relative
-     * @returns jQuery.uri
-     */
-    resolve: function (relative) {
-      return $.uri(relative, this);
-    },
-    
-    /**
-     * Creates a relative URI giving the path from this URI to the absolute URI passed as a parameter
-     * @param {String|jQuery.uri} absolute
-     * @returns String
-     */
-    relative: function (absolute) {
-      var aPath, bPath, i = 0, j, resultPath = [], result = '';
-      if (typeof absolute === 'string') {
-        absolute = $.uri(absolute, {});
-      }
-      if (absolute.scheme !== this.scheme || 
-          absolute.authority !== this.authority) {
-        return absolute.toString();
-      }
-      if (absolute.path !== this.path) {
-        aPath = absolute.path.split('/');
-        bPath = this.path.split('/');
-        if (aPath[1] !== bPath[1]) {
-          result = absolute.path;
-        } else {
-          while (aPath[i] === bPath[i]) {
-            i += 1;
-          }
-          j = i;
-          for (; i < bPath.length - 1; i += 1) {
-            resultPath.push('..');
-          }
-          for (; j < aPath.length; j += 1) {
-            resultPath.push(aPath[j]);
-          }
-          result = resultPath.join('/');
-        }
-        result = absolute.query === undefined ? result : result + '?' + absolute.query;
-        result = absolute.fragment === undefined ? result : result + '#' + absolute.fragment;
-        return result;
-      }
-      if (absolute.query !== undefined && absolute.query !== this.query) {
-        return '?' + absolute.query + (absolute.fragment === undefined ? '' : '#' + absolute.fragment);
-      }
-      if (absolute.fragment !== undefined && absolute.fragment !== this.fragment) {
-        return '#' + absolute.fragment;
-      }
-      return '';
-    },
-  
-    /**
-     * Returns the URI as an absolute string
-     * @returns String
-     */
-    toString: function () {
-      var result = '';
-      if (this._string) {
-        return this._string;
-      } else {
-        result = this.scheme === undefined ? result : (result + this.scheme + ':');
-        result = this.authority === undefined ? result : (result + '//' + this.authority);
-        result = result + this.path;
-        result = this.query === undefined ? result : (result + '?' + this.query);
-        result = this.fragment === undefined ? result : (result + '#' + this.fragment);
-        this._string = result;
-        return result;
-      }
-    }
-  
-  };
-
-  $.uri.fn.init.prototype = $.uri.fn;
-
-  /**
-   * Creates a {@link jQuery.uri} from a known-to-be-absolute URI
-   * @param {String}
-   * @returns {jQuery.uri}
-   */
-  $.uri.absolute = function (uri) {
-    return $.uri(uri, {});
-  };
-
-  /**
-   * Creates a {@link jQuery.uri} from a relative URI and an optional base URI
-   * @returns {jQuery.uri}
-   * @see jQuery.uri
-   */
-  $.uri.resolve = function (relative, base) {
-    return $.uri(relative, base);
-  };
-  
-  /**
-   * Creates a string giving the relative path from a base URI to an absolute URI
-   * @param {String} absolute
-   * @param {String} base
-   * @returns {String}
-   */
-  $.uri.relative = function (absolute, base) {
-    return $.uri(base, {}).relative(absolute);
-  };
-  
-  /**
-   * Returns the base URI of the page
-   * @returns {jQuery.uri}
-   */
-  $.uri.base = function () {
-    return $(document).base();
-  };
-  
-  /**
-   * Returns the base URI in scope for the first selected element
-   * @methodOf jQuery#
-   * @name jQuery#base
-   * @returns {jQuery.uri}
-   * @example baseURI = $('img').base();
-   */
-  $.fn.base = function () {
-    var base = $(this).parents().andSelf().find('base').attr('href'),
-      doc = $(this)[0].ownerDocument || document,
-      docURI = $.uri.absolute(doc.location === null ? document.location.href : doc.location.href);
-    return base === undefined ? docURI : $.uri(base, docURI);
-  };
-
-})(jQuery);
-/*
- * jQuery CURIE @VERSION
- * 
- * Copyright (c) 2008,2009 Jeni Tennison
- * Licensed under the MIT (MIT-LICENSE.txt)
- *
- * Depends:
- *  jquery.uri.js
- */
-/**
- * @fileOverview XML Namespace processing
- * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
- * @copyright (c) 2008,2009 Jeni Tennison
- * @license MIT license (MIT-LICENSE.txt)
- * @version 1.0
- * @requires jquery.uri.js
- */
-
-/*global jQuery */
-(function ($) {
-
-  var 
-    xmlNs = 'http://www.w3.org/XML/1998/namespace',
-    xmlnsNs = 'http://www.w3.org/2000/xmlns/',
-    
-    xmlnsRegex = /\sxmlns(?::([^ =]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g,
-    
-    ncNameChar = '[-A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF\.0-9\u00B7\u0300-\u036F\u203F-\u2040]',
-    ncNameStartChar = '[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B10\u0B1
 3-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F
 18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]',
-    ncNameRegex = new RegExp('^' + ncNameStartChar + ncNameChar + '*$');
-    
-
-/**
- * Returns the namespaces declared in the scope of the first selected element, or
- * adds a namespace declaration to all selected elements. Pass in no parameters
- * to return all namespaces bindings on the first selected element. If only 
- * the prefix parameter is specified, this method will return the namespace
- * URI that is bound to the specified prefix on the first element in the selection
- * If the prefix and uri parameters are both specified, this method will
- * add the binding of the specified prefix and namespace URI to all elements
- * in the selection.
- * @methodOf jQuery#
- * @name jQuery#xmlns
- * @param {String} [prefix] Restricts the namespaces returned to only the namespace with the specified namespace prefix.
- * @param {String|jQuery.uri} [uri] Adds a namespace declaration to the selected elements that maps the specified prefix to the specified namespace.
- * @param {Object} [inherited] A map of inherited namespace bindings.
- * @returns {Object|jQuery.uri|jQuery}
- * @example 
- * // Retrieve all of the namespace bindings on the HTML document element
- * var nsMap = $('html').xmlns();
- * @example
- * // Retrieve the namespace URI mapped to the 'dc' prefix on the HTML document element
- * var dcNamespace = $('html').xmlns('dc');
- * @example
- * // Create a namespace declaration that binds the 'dc' prefix to the URI 'http://purl.org/dc/elements/1.1/'
- * $('html').xmlns('dc', 'http://purl.org/dc/elements/1.1/');
- */
-  $.fn.xmlns = function (prefix, uri, inherited) {
-    var 
-      elem = this.eq(0),
-      ns = elem.data('xmlns'),
-      e = elem[0], a, p, i,
-      decl = prefix ? 'xmlns:' + prefix : 'xmlns',
-      value,
-      tag, found = false;
-    if (uri === undefined) {
-      if (prefix === undefined) { // get the in-scope declarations on the first element
-        if (ns === undefined) {
-          ns = {
-//            xml: $.uri(xmlNs)
-          };
-          if (e.attributes && e.attributes.getNamedItemNS) {
-            for (i = 0; i < e.attributes.length; i += 1) {
-              a = e.attributes[i];
-              if (/^xmlns(:(.+))?$/.test(a.nodeName)) {
-                prefix = /^xmlns(:(.+))?$/.exec(a.nodeName)[2] || '';
-                value = a.nodeValue;
-                if (prefix === '' || (value !== '' && value !== xmlNs && value !== xmlnsNs && ncNameRegex.test(prefix) && prefix !== 'xml' && prefix !== 'xmlns')) {
-                  ns[prefix] = $.uri(a.nodeValue);
-                  found = true;
-                }
-              }
-            }
-          } else {
-            tag = /<[^>]+>/.exec(e.outerHTML);
-            a = xmlnsRegex.exec(tag);
-            while (a !== null) {
-              prefix = a[1] || '';
-              value = a[2] || a[3];
-              if (prefix === '' || (value !== '' && value !== xmlNs && value !== xmlnsNs && ncNameRegex.test(prefix) && prefix !== 'xml' && prefix !== 'xmlns')) {
-                ns[prefix] = $.uri(a[2] || a[3]);
-                found = true;
-              }
-              a = xmlnsRegex.exec(tag);
-            }
-            xmlnsRegex.lastIndex = 0;
-          }
-          inherited = inherited || (e.parentNode.nodeType === 1 ? elem.parent().xmlns() : {});
-          ns = found ? $.extend({}, inherited, ns) : inherited;
-          elem.data('xmlns', ns);
-        }
-        return ns;
-      } else if (typeof prefix === 'object') { // set the prefix mappings defined in the object
-        for (p in prefix) {
-          if (typeof prefix[p] === 'string' && ncNameRegex.test(p)) {
-            this.xmlns(p, prefix[p]);
-          }
-        }
-        this.find('*').andSelf().removeData('xmlns');
-        return this;
-      } else { // get the in-scope declaration associated with this prefix on the first element
-        if (ns === undefined) {
-          ns = elem.xmlns();
-        }
-        return ns[prefix];
-      }
-    } else { // set
-      this.find('*').andSelf().removeData('xmlns');
-      return this.attr(decl, uri);
-    }
-  };
-
-/**
- * Removes one or more XML namespace bindings from the selected elements.
- * @methodOf jQuery#
- * @name jQuery#removeXmlns
- * @param {String|Object|String[]} prefix The prefix(es) of the XML namespace bindings that are to be removed from the selected elements.
- * @returns {jQuery} The original jQuery object.
- * @example
- * // Remove the foaf namespace declaration from the body element:
- * $('body').removeXmlns('foaf');
- * @example
- * // Remove the foo and bar namespace declarations from all h2 elements
- * $('h2').removeXmlns(['foo', 'bar']);
- * @example
- * // Remove the foo and bar namespace declarations from all h2 elements
- * var namespaces = { foo : 'http://www.example.org/foo', bar : 'http://www.example.org/bar' };
- * $('h2').removeXmlns(namespaces);
- */
-  $.fn.removeXmlns = function (prefix) {
-    var decl, p, i;
-    if (typeof prefix === 'object') {
-      if (prefix.length === undefined) { // assume an object representing namespaces
-        for (p in prefix) {
-          if (typeof prefix[p] === 'string') {
-            this.removeXmlns(p);
-          }
-        }
-      } else { // it's an array
-        for (i = 0; i < prefix.length; i += 1) {
-          this.removeXmlns(prefix[i]);
-        }
-      }
-    } else {
-      decl = prefix ? 'xmlns:' + prefix : 'xmlns';
-      this.removeAttr(decl);
-    }
-    this.find('*').andSelf().removeData('xmlns');
-    return this;
-  };
-
-  $.fn.qname = function (name) {
-    var m, prefix, namespace;
-    if (name === undefined) {
-      if (this[0].outerHTML === undefined) {
-        name = this[0].nodeName.toLowerCase();
-      } else {
-        name = /<([^ >]+)/.exec(this[0].outerHTML)[1].toLowerCase();
-      }
-    }
-    if (name === '?xml:namespace') {
-      // there's a prefix on the name, but we can't get at it
-      throw "XMLinHTML: Unable to get the prefix to resolve the name of this element";
-    }
-    m = /^(([^:]+):)?([^:]+)$/.exec(name);
-    prefix = m[2] || '';
-    namespace = this.xmlns(prefix);
-    if (namespace === undefined && prefix !== '') {
-      throw "MalformedQName: The prefix " + prefix + " is not declared";
-    }
-    return {
-      namespace: namespace,
-      localPart: m[3],
-      prefix: prefix,
-      name: name
-    };
-  };
-
-})(jQuery);
-/*
- * jQuery CURIE @VERSION
- *
- * Copyright (c) 2008,2009 Jeni Tennison
- * Licensed under the MIT (MIT-LICENSE.txt)
- *
- * Depends:
- *  jquery.uri.js
- */
-/**
- * @fileOverview XML Schema datatype handling
- * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
- * @copyright (c) 2008,2009 Jeni Tennison
- * @license MIT license (MIT-LICENSE.txt)
- * @version 1.0
- * @requires jquery.uri.js
- */
-
-(function ($) {
-
-  var strip = function (value) {
-    return value.replace(/[ \t\n\r]+/, ' ').replace(/^ +/, '').replace(/ +$/, '');
-  };
-
-  /**
-   * Creates a new jQuery.typedValue object. This should be invoked as a method
-   * rather than constructed using new.
-   * @class Represents a value with an XML Schema datatype
-   * @param {String} value The string representation of the value
-   * @param {String} datatype The XML Schema datatype URI
-   * @returns {jQuery.typedValue}
-   * @example intValue = jQuery.typedValue('42', 'http://www.w3.org/2001/XMLSchema#integer');
-   */
-  $.typedValue = function (value, datatype) {
-    return $.typedValue.fn.init(value, datatype);
-  };
-
-  $.typedValue.fn = $.typedValue.prototype = {
-    /**
-     * The string representation of the value
-     * @memberOf jQuery.typedValue#
-     */
-    representation: undefined,
-    /**
-     * The value as an object. The type of the object will
-     * depend on the XML Schema datatype URI specified
-     * in the constructor. The following table lists the mappings
-     * currently supported:
-     * <table>
-     *   <tr>
-     *   <th>XML Schema Datatype</th>
-     *   <th>Value type</th>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#string</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#token</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#NCName</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#boolean</td>
-     *     <td>bool</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#decimal</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#integer</td>
-     *     <td>int</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#int</td>
-     *     <td>int</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#float</td>
-     *     <td>float</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#double</td>
-     *     <td>float</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#dateTime</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#date</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#gYear</td>
-     *     <td>int</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#gMonthDay</td>
-     *     <td>string</td>
-     *   </tr>
-     *   <tr>
-     *     <td>http://www.w3.org/2001/XMLSchema#anyURI</td>
-     *     <td>{@link jQuery.uri}</td>
-     *   </tr>
-     * </table>
-     * @memberOf jQuery.typedValue#
-     */
-    value: undefined,
-    /**
-     * The XML Schema datatype URI for the value's datatype
-     * @memberOf jQuery.typedValue#
-     */
-    datatype: undefined,
-
-    init: function (value, datatype) {
-      var d = $.typedValue.types[datatype];
-      if ($.typedValue.valid(value, datatype)) {
-        this.representation = value;
-        this.datatype = datatype;
-        this.value = d === undefined ? strip(value) : d.value(d.strip ? strip(value) : value);
-        return this;
-      } else {
-        throw {
-          name: 'InvalidValue',
-          message: value + ' is not a valid ' + datatype + ' value'
-        };
-      }
-    }
-  };
-
-  $.typedValue.fn.init.prototype = $.typedValue.fn;
-
-  /**
-   * An object that holds the datatypes supported by the script. The properties of this object are the URIs of the datatypes, and each datatype has four properties:
-   * <dl>
-   *   <dt>strip</dt>
-   *   <dd>A boolean value that indicates whether whitespace should be stripped from the value prior to testing against the regular expression or passing to the value function.</dd>
-   *   <dt>regex</dt>
-   *   <dd>A regular expression that valid values of the type must match.</dd>
-   *   <dt>validate</dt>
-   *   <dd>Optional. A function that performs further testing on the value.</dd>
-   *   <dt>value</dt>
-   *   <dd>A function that returns a Javascript object equivalent for the value.</dd>
-   * </dl>
-   * You can add to this object as necessary for your own datatypes, and {@link jQuery.typedValue} and {@link jQuery.typedValue.valid} will work with them.
-   * @see jQuery.typedValue
-   * @see jQuery.typedValue.valid
-   */
-  $.typedValue.types = {};
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#string'] = {
-    regex: /^.*$/,
-    strip: false,
-    /** @ignore */
-    value: function (v) {
-      return v;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#token'] = {
-    regex: /^.*$/,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return strip(v);
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#NCName'] = {
-    regex: /^[a-z_][-\.a-z0-9]+$/i,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return strip(v);
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#boolean'] = {
-    regex: /^(?:true|false|1|0)$/,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return v === 'true' || v === '1';
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#decimal'] = {
-    regex: /^[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)$/,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return v;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#integer'] = {
-    regex: /^[\-\+]?[0-9]+$/,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return parseInt(v, 10);
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#int'] = {
-    regex: /^[\-\+]?[0-9]+$/,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return parseInt(v, 10);
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'] = {
-    regex: /^(?:[\-\+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)(?:[eE][\-\+]?[0-9]+)?|[\-\+]?INF|NaN)$/,
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      if (v === '-INF') {
-        return -1 / 0;
-      } else if (v === 'INF' || v === '+INF') {
-        return 1 / 0;
-      } else {
-        return parseFloat(v);
-      }
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#double'] = {
-    regex: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].regex,
-    strip: true,
-    value: $.typedValue.types['http://www.w3.org/2001/XMLSchema#float'].value
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#duration'] = {
-    regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\.[0-9]+))?S)?)$/,
-    /** @ignore */
-    validate: function (v) {
-      var m = this.regex.exec(v);
-      return m[2] || m[3] || m[4] || m[5] || m[6] || m[7];
-    },
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return v;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#yearMonthDuration'] = {
-    regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?$/,
-    /** @ignore */
-    validate: function (v) {
-      var m = this.regex.exec(v);
-      return m[2] || m[3];
-    },
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      var m = this.regex.exec(v),
-        years = m[2] || 0,
-        months = m[3] || 0;
-      months += years * 12;
-      return m[1] === '-' ? -1 * months : months;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#dateTime'] = {
-    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):(([0-9]{2})(\.([0-9]+))?)((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
-    /** @ignore */
-    validate: function (v) {
-      var
-        m = this.regex.exec(v),
-        year = parseInt(m[1], 10),
-        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, ''),
-        date;
-      if (year === 0 ||
-          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
-        return false;
-      }
-      try {
-        year = year < 100 ? Math.abs(year) + 1000 : year;
-        month = parseInt(m[2], 10);
-        day = parseInt(m[3], 10);
-        if (day > 31) {
-          return false;
-        } else if (day > 30 && !(month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12)) {
-          return false;
-        } else if (month === 2) {
-          if (day > 29) {
-            return false;
-          } else if (day === 29 && (year % 4 !== 0 || (year % 100 === 0 && year % 400 !== 0))) {
-            return false;
-          }
-        }
-        date = '' + year + '/' + m[2] + '/' + m[3] + ' ' + m[4] + ':' + m[5] + ':' + m[7] + ' ' + tz;
-        date = new Date(date);
-        return true;
-      } catch (e) {
-        return false;
-      }
-    },
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return v;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#date'] = {
-    regex: /^(-?[0-9]{4,})-([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
-    /** @ignore */
-    validate: function (v) {
-      var
-        m = this.regex.exec(v),
-        year = parseInt(m[1], 10),
-        month = parseInt(m[2], 10),
-        day = parseInt(m[3], 10),
-        tz = m[10] === undefined || m[10] === 'Z' ? '+0000' : m[10].replace(/:/, '');
-      if (year === 0 ||
-          month > 12 ||
-          day > 31 ||
-          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
-        return false;
-      } else {
-        return true;
-      }
-    },
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return v;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gYear'] = {
-    regex: /^-?([0-9]{4,})$/,
-    /** @ignore */
-    validate: function (v) {
-      var i = parseInt(v, 10);
-      return i !== 0;
-    },
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return parseInt(v, 10);
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#gMonthDay'] = {
-    regex: /^--([0-9]{2})-([0-9]{2})((?:[\-\+]([0-9]{2}):([0-9]{2}))|Z)?$/,
-    /** @ignore */
-    validate: function (v) {
-      var
-        m = this.regex.exec(v),
-        month = parseInt(m[1], 10),
-        day = parseInt(m[2], 10),
-        tz = m[3] === undefined || m[3] === 'Z' ? '+0000' : m[3].replace(/:/, '');
-      if (month > 12 ||
-          day > 31 ||
-          parseInt(tz, 10) < -1400 || parseInt(tz, 10) > 1400) {
-        return false;
-      } else if (month === 2 && day > 29) {
-        return false;
-      } else if ((month === 4 || month === 6 || month === 9 || month === 11) && day > 30) {
-        return false;
-      } else {
-        return true;
-      }
-    },
-    strip: true,
-    /** @ignore */
-    value: function (v) {
-      return v;
-    }
-  };
-
-  $.typedValue.types['http://www.w3.org/2001/XMLSchema#anyURI'] = {
-    regex: /^.*$/,
-    strip: true,
-    /** @ignore */
-    value: function (v, options) {
-      var opts = $.extend({}, $.typedValue.defaults, options);
-      return $.uri.resolve(v, opts.base);
-    }
-  };
-
-  $.typedValue.defaults = {
-    base: $.uri.base(),
-    namespaces: {}
-  };
-
-  /**
-   * Checks whether a value is valid according to a given datatype. The datatype must be held in the {@link jQuery.typedValue.types} object.
-   * @param {String} value The value to validate.
-   * @param {String} datatype The URI for the datatype against which the value will be validated.
-   * @returns {boolean} True if the value is valid or the datatype is not recognised.
-   * @example validDate = $.typedValue.valid(date, 'http://www.w3.org/2001/XMLSchema#date');
-   */
-  $.typedValue.valid = function (value, datatype) {
-    var d = $.typedValue.types[datatype];
-    if (d === undefined) {
-      return true;
-    } else {
-      value = d.strip ? strip(value) : value;
-      if (d.regex.test(value)) {
-        return d.validate === undefined ? true : d.validate(value);
-      } else {
-        return false;
-      }
-    }
-  };
-
-})(jQuery);
-/*
- * jQuery CURIE @VERSION
- *
- * Copyright (c) 2008,2009 Jeni Tennison
- * Licensed under the MIT (MIT-LICENSE.txt)
- *
- * Depends:
- *  jquery.uri.js
- *  jquery.xmlns.js
- */
-
-/**
- * @fileOverview jQuery CURIE handling
- * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
- * @copyright (c) 2008,2009 Jeni Tennison
- * @license MIT license (MIT-LICENSE.txt)
- * @version 1.0
- * @requires jquery.uri.js
- * @requires jquery.xmlns.js
- */
-(function ($) {
-
-   /**
-    * Creates a {@link jQuery.uri} object by parsing a CURIE.
-    * @methodOf jQuery
-    * @param {String} curie The CURIE to be parsed
-    * @param {String} uri The URI string to be converted to a CURIE.
-    * @param {Object} [options] CURIE parsing options
-    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
-    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
-    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
-    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright', 'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next', 'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']] A list of local names that will always be mapped to the URI specified by reservedNamespace.
-    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
-    * <dl>
-    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>
-    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>
-    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
-    * </dl>
-    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
-    */
-  $.curie = function (curie, options) {
-    var
-      opts = $.extend({}, $.curie.defaults, options || {}),
-      m = /^(([^:]*):)?(.+)$/.exec(curie),
-      prefix = m[2],
-      local = m[3],
-      ns = opts.namespaces[prefix];
-    if (/^:.+/.test(curie)) { // This is the case of a CURIE like ":test"
-      if (opts.reservedNamespace === undefined || opts.reservedNamespace === null) {
-        throw "Malformed CURIE: No prefix and no default namespace for unprefixed CURIE " + curie;
-      } else {
-        ns = opts.reservedNamespace;
-      }
-    } else if (prefix) {
-      if (ns === undefined) {
-        throw "Malformed CURIE: No namespace binding for " + prefix + " in CURIE " + curie;
-      }
-    } else {
-      if (opts.charcase === 'lower') {
-        curie = curie.toLowerCase();
-      } else if (opts.charcase === 'upper') {
-        curie = curie.toUpperCase();
-      }
-      if (opts.reserved.length && $.inArray(curie, opts.reserved) >= 0) {
-        ns = opts.reservedNamespace;
-        local = curie;
-      } else if (opts.defaultNamespace === undefined || opts.defaultNamespace === null) {
-        // the default namespace is provided by the application; it's not clear whether
-        // the default XML namespace should be used if there's a colon but no prefix
-        throw "Malformed CURIE: No prefix and no default namespace for unprefixed CURIE " + curie;
-      } else {
-        ns = opts.defaultNamespace;
-      }
-    }
-    return $.uri(ns + local);
-  };
-
-  $.curie.defaults = {
-    namespaces: {},
-    reserved: [],
-    reservedNamespace: undefined,
-    defaultNamespace: undefined,
-    charcase: 'preserve'
-  };
-
-   /**
-    * Creates a {@link jQuery.uri} object by parsing a safe CURIE string (a CURIE
-    * contained within square brackets). If the input safeCurie string does not
-    * start with '[' and end with ']', the entire string content will be interpreted
-    * as a URI string.
-    * @methodOf jQuery
-    * @param {String} safeCurie The safe CURIE string to be parsed.
-    * @param {Object} [options] CURIE parsing options
-    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#'] The namespace to apply to a CURIE that has no prefix and either starts with a colon or is in the list of reserved local names
-    * @param {string} [options.defaultNamespace]  The namespace to apply to a CURIE with no prefix which is not mapped to the reserved namespace by the rules given above.
-    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
-    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
-      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
-      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]
-                        A list of local names that will always be mapped to the URI specified by reservedNamespace.
-    * @param {string} [options.charcase='lower'] Specifies whether the curie's case is altered before it's interpreted. Acceptable values are:
-    * <dl>
-    * <dt>lower</dt><dd>Force the CURIE string to lower case.</dd>
-    * <dt>upper</dt><dd>Force the CURIE string to upper case.</dd>
-    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
-    * </dl>
-    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
-    */
-  $.safeCurie = function (safeCurie, options) {
-    var m = /^\[([^\]]+)\]$/.exec(safeCurie);
-    return m ? $.curie(m[1], options) : $.uri(safeCurie);
-  };
-
-   /**
-    * Creates a CURIE string from a URI string.
-    * @methodOf jQuery
-    * @param {String} uri The URI string to be converted to a CURIE.
-    * @param {Object} [options] CURIE parsing options
-    * @param {string} [options.reservedNamespace='http://www.w3.org/1999/xhtml/vocab#']
-    *        If the input URI starts with this value, the generated CURIE will
-    *        have no namespace prefix and will start with a colon character (:),
-    *        unless the local part of the CURIE is one of the reserved names specified
-    *        by the reservedNames option (see below), in which case the generated
-    *        CURIE will have no namespace prefix and will not start with a colon
-    *        character.
-    * @param {string} [options.defaultNamespace]  If the input URI starts with this value, the generated CURIE will have no namespace prefix and will not start with a colon.
-    * @param {Object} [options.namespaces] A map of namespace bindings used to map CURIE prefixes to URIs.
-    * @param {string[]} [options.reserved=['alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
-      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
-      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up']]
-                        A list of local names that will always be mapped to the URI specified by reservedNamespace.
-    * @param {string} [options.charcase='lower'] Specifies the case normalisation done to the CURIE. Acceptable values are:
-    * <dl>
-    * <dt>lower</dt><dd>Normalise the CURIE to lower case.</dd>
-    * <dt>upper</dt><dd>Normalise the CURIE to upper case.</dd>
-    * <dt>preserve</dt><dd>Preserve the original case of the CURIE. Note that this might not be possible if the CURIE has been taken from an HTML attribute value because of the case conversions performed automatically by browsers. For this reason, it's a good idea to avoid mixed-case CURIEs within RDFa.</dd>
-    * </dl>
-    * @returns {jQuery.uri} A new {@link jQuery.uri} object representing the full absolute URI specified by the CURIE.
-    */
-  $.createCurie = function (uri, options) {
-    var opts = $.extend({}, $.curie.defaults, options || {}),
-      ns = opts.namespaces,
-      curie;
-    uri = $.uri(uri).toString();
-    if (opts.reservedNamespace !== undefined && 
-        uri.substring(0, opts.reservedNamespace.toString().length) === opts.reservedNamespace.toString()) {
-      curie = uri.substring(opts.reservedNamespace.toString().length);
-      if ($.inArray(curie, opts.reserved) === -1) {
-        curie = ':' + curie;
-      }
-    } else {
-      $.each(ns, function (prefix, namespace) {
-        if (uri.substring(0, namespace.toString().length) === namespace.toString()) {
-          curie = prefix + ':' + uri.substring(namespace.toString().length);
-          return null;
-        }
-      });
-    }
-    if (curie === undefined) {
-      throw "No Namespace Binding: There's no appropriate namespace binding for generating a CURIE from " + uri;
-    } else {
-      return curie;
-    }
-  };
-
-   /**
-    * Creates a {@link jQuery.uri} object by parsing the specified
-    * CURIE string in the context of the namespaces defined by the
-    * jQuery selection.
-    * @methodOf jQuery#
-    * @name jQuery#curie
-    * @param {String} curie The CURIE string to be parsed
-    * @param {Object} options The CURIE parsing options.
-    *        See {@link jQuery.curie} for details of the supported options.
-    *        The namespace declarations declared on the current jQuery
-    *        selection (and inherited from any ancestor elements) will automatically
-    *        be included in the options.namespaces property.
-    * @returns {jQuery.uri}
-    * @see jQuery.curie
-    */
-  $.fn.curie = function (curie, options) {
-    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
-    return $.curie(curie, opts);
-  };
-
-   /**
-    * Creates a {@link jQuery.uri} object by parsing the specified
-    * safe CURIE string in the context of the namespaces defined by
-    * the jQuery selection.
-    *
-    * @methodOf jQuery#
-    * @name jQuery#safeCurie
-    * @param {String} safeCurie The safe CURIE string to be parsed. See {@link jQuery.safeCurie} for details on how safe CURIE strings are processed.
-    * @param {Object} options   The CURIE parsing options.
-    *        See {@link jQuery.safeCurie} for details of the supported options.
-    *        The namespace declarations declared on the current jQuery
-    *        selection (and inherited from any ancestor elements) will automatically
-    *        be included in the options.namespaces property.
-    * @returns {jQuery.uri}
-    * @see jQuery.safeCurie
-    */
-  $.fn.safeCurie = function (safeCurie, options) {
-    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
-    return $.safeCurie(safeCurie, opts);
-  };
-
-   /**
-    * Creates a CURIE string from a URI string using the namespace
-    * bindings in the context of the current jQuery selection.
-    *
-    * @methodOf jQuery#
-    * @name jQuery#createCurie
-    * @param {String|jQuery.uri} uri The URI string to be converted to a CURIE
-    * @param {Object} options the CURIE parsing options.
-    *        See {@link jQuery.createCurie} for details of the supported options.
-    *        The namespace declarations declared on the current jQuery
-    *        selection (and inherited from any ancestor elements) will automatically
-    *        be included in the options.namespaces property.
-    * @returns {String}
-    * @see jQuery.createCurie
-    */
-  $.fn.createCurie = function (uri, options) {
-    var opts = $.extend({}, $.fn.curie.defaults, { namespaces: this.xmlns() }, options || {});
-    return $.createCurie(uri, opts);
-  };
-
-  $.fn.curie.defaults = {
-    reserved: [
-      'alternate', 'appendix', 'bookmark', 'cite', 'chapter', 'contents', 'copyright',
-      'first', 'glossary', 'help', 'icon', 'index', 'last', 'license', 'meta', 'next',
-      'p3pv1', 'prev', 'role', 'section', 'stylesheet', 'subsection', 'start', 'top', 'up'
-    ],
-    reservedNamespace: 'http://www.w3.org/1999/xhtml/vocab#',
-    defaultNamespace: undefined,
-    charcase: 'lower'
-  };
-
-})(jQuery);
-/*
- * jQuery RDF @VERSION
- *
- * Copyright (c) 2008,2009 Jeni Tennison
- * Licensed under the MIT (MIT-LICENSE.txt)
- *
- * Depends:
- *  jquery.uri.js
- *  jquery.xmlns.js
- *  jquery.datatype.js
- *  jquery.curie.js
- *  jquery.json.js
- */
-/**
- * @fileOverview jQuery RDF
- * @author <a href="mailto:jeni@jenitennison.com">Jeni Tennison</a>
- * @copyright (c) 2008,2009 Jeni Tennison
- * @license MIT license (MIT-LICENSE.txt)
- * @version 1.0
- */
-/**
- * @exports $ as jQuery
- */
-/**
- * @ignore
- */
-(function ($) {
-  var
-    memResource = {},
-    memBlank = {},
-    memLiteral = {},
-    memTriple = {},
-    memPattern = {},
-    
-    xsdNs = "http://www.w3.org/2001/XMLSchema#",
-    rdfNs = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-    rdfsNs = "http://www.w3.org/2000/01/rdf-schema#",
-    
-    uriRegex = /^<(([^>]|\\>)*)>$/,
-    literalRegex = /^("""((\\"|[^"])*)"""|"((\\"|[^"])*)")(@([a-z]+(-[a-z0-9]+)*)|\^\^(.+))?$/,
-    tripleRegex = /(("""((\\"|[^"])*)""")|("(\\"|[^"]|)*")|(<(\\>|[^>])*>)|\S)+/g,
-
-    blankNodeSeed = databankSeed = new Date().getTime() % 1000,
-    blankNodeID = function () {
-      blankNodeSeed += 1;
-      return 'b' + blankNodeSeed.toString(16);
-    },
-
-    databankID = function () {
-      databankSeed += 1;
-      return 'data' + databankSeed.toString(16);
-    },
-    databanks = {},
-
-    documentQueue = {},
-
-    subject = function (subject, opts) {
-      if (typeof subject === 'string') {
-        try {
-          return $.rdf.resource(subject, opts);
-        } catch (e) {
-          try {
-            return $.rdf.blank(subject, opts);
-          } catch (f) {
-            throw "Bad Triple: Subject " + subject + " is not a resource: " + f;
-          }
-        }
-      } else {
-        return subject;
-      }
-    },
-
-    property = function (property, opts) {
-      if (property === 'a') {
-        return $.rdf.type;
-      } else if (typeof property === 'string') {
-        try {
-          return $.rdf.resource(property, opts);
-        } catch (e) {
-          throw "Bad Triple: Property " + property + " is not a resource: " + e;
-        }
-      } else {
-        return property;
-      }
-    },
-
-    object = function (object, opts) {
-      if (typeof object === 'string') {
-        try {
-          return $.rdf.resource(object, opts);
-        } catch (e) {
-          try {
-            return $.rdf.blank(object, opts);
-          } catch (f) {
-            try {
-              return $.rdf.literal(object, opts);
-            } catch (g) {
-              throw "Bad Triple: Object " + object + " is not a resource or a literal " + g;
-            }
-          }
-        }
-      } else {
-        return object;
-      }
-    },
-
-    testResource = function (resource, filter, existing) {
-      var variable;
-      if (typeof filter === 'string') {
-        variable = filter.substring(1);
-        if (existing[variable] && existing[variable] !== resource) {
-          return null;
-        } else {
-          existing[variable] = resource;
-          return existing;
-        }
-      } else if (filter === resource) {
-        return existing;
-      } else {
-        return null;
-      }
-    },
-
-    findMatches = function (databank, pattern) {
-      if (databank.union === undefined) {
-        if (pattern.subject.type !== undefined) {
-          if (databank.subjectIndex[pattern.subject] === undefined) {
-            return [];
-          }
-          return $.map(databank.subjectIndex[pattern.subject], function (triple) {
-            var bindings = pattern.exec(triple);
-            return bindings === null ? null : { bindings: bindings, triples: [triple] };
-          });
-        } else if (pattern.object.type === 'uri' || pattern.object.type === 'bnode') {
-          if (databank.objectIndex[pattern.object] === undefined) {
-            return [];
-          }
-          return $.map(databank.objectIndex[pattern.object], function (triple) {
-            var bindings = pattern.exec(triple);
-            return bindings === null ? null : { bindings: bindings, triples: [triple] };
-          });
-        } else if (pattern.property.type !== undefined) {
-          if (databank.propertyIndex[pattern.property] === undefined) {
-            return [];
-          }
-          return $.map(databank.propertyIndex[pattern.property], function (triple) {
-            var bindings = pattern.exec(triple);
-            return bindings === null ? null : { bindings: bindings, triples: [triple] };
-          });
-        }
-      }
-      return $.map(databank.triples(), function (triple) {
-        var bindings = pattern.exec(triple);
-        return bindings === null ? null : { bindings: bindings, triples: [triple] };
-      });
-    },
-
-    mergeMatches = function (existingMs, newMs, optional) {
-      return $.map(existingMs, function (existingM, i) {
-        var compatibleMs = $.map(newMs, function (newM) {
-          // For newM to be compatible with existingM, all the bindings
-          // in newM must either be the same as in existingM, or not
-          // exist in existingM
-          var k, b, isCompatible = true;
-          for (k in newM.bindings) {
-            b = newM.bindings[k];
-            if (!(existingM.bindings[k] === undefined ||
-                  existingM.bindings[k] === b)) {
-              isCompatible = false;
-              break;
-            }
-          }
-          return isCompatible ? newM : null;
-        });
-        if (compatibleMs.length > 0) {
-          return $.map(compatibleMs, function (compatibleM) {
-            return {
-              bindings: $.extend({}, existingM.bindings, compatibleM.bindings),
-              triples: $.unique(existingM.triples.concat(compatibleM.triples))
-            };
-          });
-        } else {
-          return optional ? existingM : null;
-        }
-      });
-    },
-
-    registerQuery = function (databank, query) {
-      var s, p, o;
-      if (query.filterExp !== undefined && !$.isFunction(query.filterExp)) {
-        if (databank.union === undefined) {
-          s = typeof query.filterExp.subject === 'string' ? '' : query.filterExp.subject;
-          p = typeof query.filterExp.property === 'string' ? '' : query.filterExp.property;
-          o = typeof query.filterExp.object === 'string' ? '' : query.filterExp.object;
-          if (databank.queries[s] === undefined) {
-            databank.queries[s] = {};
-          }
-          if (databank.queries[s][p] === undefined) {
-            databank.queries[s][p] = {};
-          }
-          if (databank.queries[s][p][o] === undefined) {
-            databank.queries[s][p][o] = [];
-          }
-          databank.queries[s][p][o].push(query);
-        } else {
-          $.each(databank.union, function (i, databank) {
-            registerQuery(databank, query);
-          });
-        }
-      }
-    },
-
-    resetQuery = function (query) {
-      query.length = 0;
-      query.matches = [];
-      $.each(query.children, function (i, child) {
-        resetQuery(child);
-      });
-      $.each(query.partOf, function (i, union) {
-        resetQuery(union);
-      });
-    },
-
-    updateQuery = function (query, matches) {
-      if (matches.length > 0) {
-        $.each(query.children, function (i, child) {
-          leftActivate(child, matches);
-        });
-        $.each(query.partOf, function (i, union) {
-          updateQuery(union, matches);
-        });
-        $.each(matches, function (i, match) {
-          query.matches.push(match);
-          Array.prototype.push.call(query, match.bindings);
-        });
-      }
-    },
-
-    leftActivate = function (query, matches) {
-      var newMatches;
-      if (query.union === undefined) {
-        if (query.top || query.parent.top) {
-          newMatches = query.alphaMemory;
-        } else {
-          matches = matches || query.parent.matches;
-          if ($.isFunction(query.filterExp)) {
-            newMatches = $.map(matches, function (match, i) {
-              return query.filterExp.call(match.bindings, i, match.bindings, match.triples) ? match : null;
-            });
-          } else {
-            newMatches = mergeMatches(matches, query.alphaMemory, query.filterExp.optional);
-          }
-        }
-      } else {
-        newMatches = $.map(query.union, function (q) {
-          return q.matches;
-        });
-      }
-      updateQuery(query, newMatches);
-    },
-
-    rightActivate = function (query, match) {
-      var newMatches;
-      if (query.filterExp.optional) {
-        resetQuery(query);
-        leftActivate(query);
-      } else {
-        if (query.top || query.parent.top) {
-          newMatches = [match];
-        } else {
-          newMatches = mergeMatches(query.parent.matches, [match], false);
-        }
-        updateQuery(query, newMatches);
-      }
-    },
-
-    addToQuery = function (query, triple) {
-      var match,
-        bindings = query.filterExp.exec(triple);
-      if (bindings !== null) {
-        match = { triples: [triple], bindings: bindings };
-        query.alphaMemory.push(match);
-        rightActivate(query, match);
-      }
-    },
-
-    removeFromQuery = function (query, triple) {
-      query.alphaMemory.splice($.inArray(triple, query.alphaMemory), 1);
-      resetQuery(query);
-      leftActivate(query);
-    },
-
-    addToQueries = function (queries, triple) {
-      $.each(queries, function (i, query) {
-        addToQuery(query, triple);
-      });
-    },
-
-    removeFromQueries = function (queries, triple) {
-      $.each(queries, function (i, query) {
-        removeFromQuery(query, triple);
-      });
-    },
-
-    addToDatabankQueries = function (databank, triple) {
-      var s = triple.subject,
-        p = triple.property,
-        o = triple.object;
-      if (databank.union === undefined) {
-        if (databank.queries[s] !== undefined) {
-          if (databank.queries[s][p] !== undefined) {
-            if (databank.queries[s][p][o] !== undefined) {
-              addToQueries(databank.queries[s][p][o], triple);
-            }
-            if (databank.queries[s][p][''] !== undefined) {
-              addToQueries(databank.queries[s][p][''], triple);
-            }
-          }
-          if (databank.queries[s][''] !== undefined) {
-            if (databank.queries[s][''][o] !== undefined) {
-              addToQueries(databank.queries[s][''][o], triple);
-            }
-            if (databank.queries[s][''][''] !== undefined) {
-              addToQueries(databank.queries[s][''][''], triple);
-            }
-          }
-        }
-        if (databank.queries[''] !== undefined) {
-          if (databank.queries[''][p] !== undefined) {
-            if (databank.queries[''][p][o] !== undefined) {
-              addToQueries(databank.queries[''][p][o], triple);
-            }
-            if (databank.queries[''][p][''] !== undefined) {
-              addToQueries(databank.queries[''][p][''], triple);
-            }
-          }
-          if (databank.queries[''][''] !== undefined) {
-            if (databank.queries[''][''][o] !== undefined) {
-              addToQueries(databank.queries[''][''][o], triple);
-            }
-            if (databank.queries[''][''][''] !== undefined) {
-              addToQueries(databank.queries[''][''][''], triple);
-            }
-          }
-        }
-      } else {
-        $.each(databank.union, function (i, databank) {
-          addToDatabankQueries(databank, triple);
-        });
-      }
-    },
-
-    removeFromDatabankQueries = function (databank, triple) {
-      var s = triple.subject,
-        p = triple.property,
-        o = triple.object;
-      if (databank.union === undefined) {
-        if (databank.queries[s] !== undefined) {
-          if (databank.queries[s][p] !== undefined) {
-            if (databank.queries[s][p][o] !== undefined) {
-              removeFromQueries(databank.queries[s][p][o], triple);
-            }
-            if (databank.queries[s][p][''] !== undefined) {
-              removeFromQueries(databank.queries[s][p][''], triple);
-            }
-          }
-          if (databank.queries[s][''] !== undefined) {
-            if (databank.queries[s][''][o] !== undefined) {
-              removeFromQueries(databank.queries[s][''][o], triple);
-            }
-            if (databank.queries[s][''][''] !== undefined) {
-              removeFromQueries(databank.queries[s][''][''], triple);
-            }
-          }
-        }
-        if (databank.queries[''] !== undefined) {
-          if (databank.queries[''][p] !== undefined) {
-            if (databank.queries[''][p][o] !== undefined) {
-              removeFromQueries(databank.queries[''][p][o], triple);
-            }
-            if (databank.queries[''][p][''] !== undefined) {
-              removeFromQueries(databank.queries[''][p][''], triple);
-            }
-          }
-          if (databank.queries[''][''] !== undefined) {
-            if (databank.queries[''][''][o] !== undefined) {
-              removeFromQueries(databank.queries[''][''][o], triple);
-            }
-            if (databank.queries[''][''][''] !== undefined) {
-              removeFromQueries(databank.queries[''][''][''], triple);
-            }
-          }
-        }
-      } else {
-        $.each(databank.union, function (i, databank) {
-          removeFromDatabankQueries(databank, triple);
-        });
-      }
-    },
-
-    createJson = function (triples) {
-      var e = {},
-        i, t, s, p;
-      for (i = 0; i < triples.length; i += 1) {
-        t = triples[i];
-        s = t.subject.value.toString();
-        p = t.property.value.toString();
-        if (e[s] === undefined) {
-          e[s] = {};
-        }
-        if (e[s][p] === undefined) {
-          e[s][p] = [];
-        }
-        e[s][p].push(t.object.dump());
-      }
-      return e;
-    },
-
-    parseJson = function (data) {
-      var s, subject, p, property, o, object, i, opts, triples = [];
-      for (s in data) {
-        subject = (s.substring(0, 2) === '_:') ? $.rdf.blank(s) : $.rdf.resource('<' + s + '>');
-        for (p in data[s]) {
-          property = $.rdf.resource('<' + p + '>');
-          for (i = 0; i < data[s][p].length; i += 1) {
-            o = data[s][p][i];
-            if (o.type === 'uri') {
-              object = $.rdf.resource('<' + o.value + '>');
-            } else if (o.type === 'bnode') {
-              object = $.rdf.blank(o.value);
-            } else {
-              // o.type === 'literal'
-              if (o.datatype !== undefined) {
-                object = $.rdf.literal(o.value, { datatype: o.datatype });
-              } else {
-                opts = {};
-                if (o.lang !== undefined) {
-                  opts.lang = o.lang;
-                }
-                object = $.rdf.literal('"' + o.value + '"', opts);
-              }
-            }
-            triples.push($.rdf.triple(subject, property, object));
-          }
-        }
-      }
-      return triples;
-    },
-
-    addAttribute = function (parent, namespace, name, value) {
-      var doc = parent.ownerDocument,
-        a;
-      if (namespace !== undefined && namespace !== null) {
-        if (doc.createAttributeNS) {
-          a = doc.createAttributeNS(namespace, name);
-          a.nodeValue = value;
-          parent.attributes.setNamedItemNS(a);
-        } else {
-          a = doc.createNode(2, name, namespace);
-          a.nodeValue = value;
-          parent.attributes.setNamedItem(a);
-        }
-      } else {
-        a = doc.createAttribute(name);
-        a.nodeValue = value;
-        parent.attributes.setNamedItem(a);
-      }
-      return parent;
-    },
-
-    createXmlnsAtt = function (parent, namespace, prefix) {
-      if (prefix) {
-        addAttribute(parent, 'http://www.w3.org/2000/xmlns/', 'xmlns:' + prefix, namespace);
-      } else {
-        addAttribute(parent, undefined, 'xmlns', namespace);
-      }
-      return parent;
-    },
-
-    createDocument = function (namespace, name) {
-      var doc, xmlns = '', prefix, addAttribute = false;
-      if (namespace !== undefined && namespace !== null) {
-        if (/:/.test(name)) {
-          prefix = /([^:]+):/.exec(name)[1];
-        }
-        addAttribute = true;
-      }
-      if (document.implementation &&
-          document.implementation.createDocument) {
-        doc = document.implementation.createDocument(namespace, name, null);
-        if (addAttribute) {
-          createXmlnsAtt(doc.documentElement, namespace, prefix);
-        }
-        return doc;
-      } else {
-        doc = new ActiveXObject("Microsoft.XMLDOM");
-        doc.async = "false";
-        if (prefix === undefined) {
-          xmlns = ' xmlns="' + namespace + '"';
-        } else {
-          xmlns = ' xmlns:' + prefix + '="' + namespace + '"';
-        }
-        doc.loadXML('<' + name + xmlns + '/>');
-        return doc;
-      }
-    },
-
-    appendElement = function (parent, namespace, name) {
-      var doc = parent.ownerDocument,
-        e;
-      if (namespace !== undefined && namespace !== null) {
-        e = doc.createElementNS ? doc.createElementNS(namespace, name) : doc.createNode(1, name, namespace);
-      } else {
-        e = doc.createElement(name);
-      }
-      parent.appendChild(e);
-      return e;
-    },
-
-    appendText = function (parent, text) {
-      var doc = parent.ownerDocument,
-        t;
-      t = doc.createTextNode(text);
-      parent.appendChild(t);
-      return parent;
-    },
-
-    appendXML = function (parent, xml) {
-      var parser, doc, i, child;
-      try {
-        doc = new ActiveXObject('Microsoft.XMLDOM');
-        doc.async = "false";
-        doc.loadXML('<temp>' + xml + '</temp>');
-      } catch(e) {
-        parser = new DOMParser();
-        doc = parser.parseFromString('<temp>' + xml + '</temp>', 'text/xml');
-      }
-      for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {
-        parent.appendChild(doc.documentElement.childNodes[i].cloneNode(true));
-      }
-      return parent;
-    },
-
-    createRdfXml = function (triples, options) {
-      var doc = createDocument(rdfNs, 'rdf:RDF'),
-        dump = createJson(triples),
-        namespaces = options.namespaces || {},
-        n, s, se, p, pe, i, v,
-        m, local, ns, prefix;
-      for (n in namespaces) {
-        createXmlnsAtt(doc.documentElement, namespaces[n], n);
-      }
-      for (s in dump) {
-        if (dump[s][$.rdf.type.value] !== undefined) {
-          m = /(.+[#\/])([^#\/]+)/.exec(dump[s][$.rdf.type.value][0].value);
-          ns = m[1];
-          local = m[2];
-          for (n in namespaces) {
-            if (namespaces[n].toString() === ns) {
-              prefix = n;
-              break;
-            }
-          }
-          se = appendElement(doc.documentElement, ns, prefix + ':' + local);
-        } else {
-          se = appendElement(doc.documentElement, rdfNs, 'rdf:Description');
-        }
-        if (/^_:/.test(s)) {
-          addAttribute(se, rdfNs, 'rdf:nodeID', s.substring(2));
-        } else {
-          addAttribute(se, rdfNs, 'rdf:about', s);
-        }
-        for (p in dump[s]) {
-          if (p !== $.rdf.type.value.toString() || dump[s][p].length > 1) {
-            m = /(.+[#\/])([^#\/]+)/.exec(p);
-            ns = m[1];
-            local = m[2];
-            for (n in namespaces) {
-              if (namespaces[n].toString() === ns) {
-                prefix = n;
-                break;
-              }
-            }
-            for (i = (p === $.rdf.type.value.toString() ? 1 : 0); i < dump[s][p].length; i += 1) {
-              v = dump[s][p][i];
-              pe = appendElement(se, ns, prefix + ':' + local);
-              if (v.type === 'uri') {
-                addAttribute(pe, rdfNs, 'rdf:resource', v.value);
-              } else if (v.type === 'literal') {
-                if (v.datatype !== undefined) {
-                  if (v.datatype === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') {
-                    addAttribute(pe, rdfNs, 'rdf:parseType', 'Literal');
-                    appendXML(pe, v.value);
-                  } else {
-                    addAttribute(pe, rdfNs, 'rdf:datatype', v.datatype);
-                    appendText(pe, v.value);
-                  }
-                } else if (v.lang !== undefined) {
-                  addAttribute(pe, 'http://www.w3.org/XML/1998/namespace', 'xml:lang', v.lang);
-                  appendText(pe, v.value);
-                } else {
-                  appendText(pe, v.value);
-                }
-              } else {
-                // blank node
-                addAttribute(pe, rdfNs, 'rdf:nodeID', v.value.substring(2));
-              }
-            }
-          }
-        }
-      }
-      return doc;
-    },
-
-    getDefaultNamespacePrefix = function (namespaceUri) {
-      switch (namespaceUri) {
-        case 'http://www.w3.org/1999/02/22-rdf-syntax-ns':
-          return 'rdf';
-        case 'http://www.w3.org/XML/1998/namespace':
-          return 'xml';
-        case 'http://www.w3.org/2000/xmlns/':
-          return 'xmlns';
-        default:
-          throw ('No default prefix mapped for namespace ' + namespaceUri);
-      }
-    },
-
-    hasAttributeNS  = function(elem, namespace, name){
-      var basename;
-      if (elem.hasAttributeNS) {
-        return elem.hasAttributeNS(namespace, name);
-      } else {
-        try {
-          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;
-          return elem.attributes.getQualifiedItem(basename, namespace) !== null;
-        } catch (e) {
-          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name) !== null;
-        }
-      }
-    },
-
-    getAttributeNS = function(elem, namespace, name){
-      var basename;
-      if (elem.getAttributeNS) {
-        return elem.getAttributeNS(namespace, name);
-      } else {
-        try {
-          basename = /:/.test(name) ? /:(.+)$/.exec(name)[1] : name;
-          return elem.attributes.getQualifiedItem(basename, namespace).nodeValue;
-        } catch (e) {
-          return elem.getAttribute(getDefaultNamespacePrefix(namespace) + ':' + name);
-        }
-      }
-    },
-
-    getLocalName = function(elem){
-      return elem.localName || elem.baseName;
-    },
-
-    parseRdfXmlSubject = function (elem, base) {
-      var s, subject;
-      if (hasAttributeNS(elem, rdfNs, 'about')) {
-        s = getAttributeNS(elem, rdfNs, 'about');
-        subject = $.rdf.resource('<' + s + '>', { base: base });
-      } else if (hasAttributeNS(elem, rdfNs, 'ID')) {
-        s = getAttributeNS(elem, rdfNs, 'ID');
-        subject = $.rdf.resource('<#' + s + '>', { base: base });
-      } else if (hasAttributeNS(elem, rdfNs, 'nodeID')) {
-        s = getAttributeNS(elem, rdfNs, 'nodeID');
-        subject = $.rdf.blank('_:' + s);
-      } else {
-        subject = $.rdf.blank('[]');
-      }
-      return subject;
-    },
-
-    parseRdfXmlDescription = function (elem, isDescription, base, lang) {
-      var subject, p, property, o, object, reified, lang, i, j, li = 1,
-        collection1, collection2, collectionItem, collectionItems = [],
-        parseType, serializer, literalOpts = {}, oTriples, triples = [];
-      lang = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;
-      base = getAttributeNS(elem, 'http://www.w3.org/XML/1998/namespace', 'base') || base;
-      if (lang !== null && lang !== undefined && lang !== '') {
-        literalOpts = { lang: lang };
-      }
-      subject = parseRdfXmlSubject(elem, base);
-      if (isDescription && (elem.namespaceURI !== rdfNs || getLocalName(elem) !== 'Description')) {
-        property = $.rdf.type;
-        object = $.rdf.resource('<' + elem.namespaceURI + getLocalName(elem) + '>');
-        triples.push($.rdf.triple(subject, property, object));
-      }
-      for (i = 0; i < elem.attributes.length; i += 1) {
-        p = elem.attributes.item(i);
-        if (p.namespaceURI !== undefined &&
-            p.namespaceURI !== 'http://www.w3.org/2000/xmlns/' &&
-            p.namespaceURI !== 'http://www.w3.org/XML/1998/namespace' &&
-            p.prefix !== 'xmlns' &&
-            p.prefix !== 'xml') {
-          if (p.namespaceURI !== rdfNs) {
-            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');
-            object = $.rdf.literal(literalOpts.lang ? p.nodeValue : '"' + p.nodeValue + '"', literalOpts);
-            triples.push($.rdf.triple(subject, property, object));
-          } else if (getLocalName(p) === 'type') {
-            property = $.rdf.type;
-            object = $.rdf.resource('<' + p.nodeValue + '>', { base: base });
-            triples.push($.rdf.triple(subject, property, object));
-          }
-        }
-      }
-      for (i = 0; i < elem.childNodes.length; i += 1) {
-        p = elem.childNodes[i];
-        if (p.nodeType === 1) {
-          if (p.namespaceURI === rdfNs && getLocalName(p) === 'li') {
-            property = $.rdf.resource('<' + rdfNs + '_' + li + '>');
-            li += 1;
-          } else {
-            property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>');
-          }
-          lang = getAttributeNS(p, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang;
-          if (lang !== null && lang !== undefined && lang !== '') {
-            literalOpts = { lang: lang };
-          }
-          if (hasAttributeNS(p, rdfNs, 'resource')) {
-            o = getAttributeNS(p, rdfNs, 'resource');
-            object = $.rdf.resource('<' + o + '>', { base: base });
-          } else if (hasAttributeNS(p, rdfNs, 'nodeID')) {
-            o = getAttributeNS(p, rdfNs, 'nodeID');
-            object = $.rdf.blank('_:' + o);
-          } else if (hasAttributeNS(p, rdfNs, 'parseType')) {
-            parseType = getAttributeNS(p, rdfNs, 'parseType');
-            if (parseType === 'Literal') {
-              try {
-                serializer = new XMLSerializer();
-                o = serializer.serializeToString(p.getElementsByTagName('*')[0]);
-              } catch (e) {
-                o = "";
-                for (j = 0; j < p.childNodes.length; j += 1) {
-                  o += p.childNodes[j].xml;
-                }
-              }
-              object = $.rdf.literal(o, { datatype: rdfNs + 'XMLLiteral' });
-            } else if (parseType === 'Resource') {
-              oTriples = parseRdfXmlDescription(p, false, base, lang);
-              if (oTriples.length > 0) {
-                object = oTriples[oTriples.length - 1].subject;
-                triples = triples.concat(oTriples);
-              } else {
-                object = $.rdf.blank('[]');
-              }
-            } else if (parseType === 'Collection') {
-              if (p.getElementsByTagName('*').length > 0) {
-                for (j = 0; j < p.childNodes.length; j += 1) {
-                  o = p.childNodes[j];
-                  if (o.nodeType === 1) {
-                    collectionItems.push(o);
-                  }
-                }
-                collection1 = $.rdf.blank('[]');
-                object = collection1;
-                for (j = 0; j < collectionItems.length; j += 1) {
-                  o = collectionItems[j];
-                  oTriples = parseRdfXmlDescription(o, true, base, lang);
-                  if (oTriples.length > 0) {
-                    collectionItem = oTriples[oTriples.length - 1].subject;
-                    triples = triples.concat(oTriples);
-                  } else {
-                    collectionItem = parseRdfXmlSubject(o);
-                  }
-                  triples.push($.rdf.triple(collection1, $.rdf.first, collectionItem));
-                  if (j === collectionItems.length - 1) {
-                    triples.push($.rdf.triple(collection1, $.rdf.rest, $.rdf.nil));
-                  } else {
-                    collection2 = $.rdf.blank('[]');
-                    triples.push($.rdf.triple(collection1, $.rdf.rest, collection2));
-                    collection1 = collection2;
-                  }
-                }
-              } else {
-                object = $.rdf.nil;
-              }
-            }
-          } else if (hasAttributeNS(p, rdfNs, 'datatype')) {
-            o = p.childNodes[0].nodeValue;
-            object = $.rdf.literal(o, { datatype: getAttributeNS(p, rdfNs, 'datatype') });
-          } else if (p.getElementsByTagName('*').length > 0) {
-            for (j = 0; j < p.childNodes.length; j += 1) {
-              o = p.childNodes[j];
-              if (o.nodeType === 1) {
-                oTriples = parseRdfXmlDescription(o, true, base, lang);
-                if (oTriples.length > 0) {
-                  object = oTriples[oTriples.length - 1].subject;
-                  triples = triples.concat(oTriples);
-                } else {
-                  object = parseRdfXmlSubject(o);
-                }
-              }
-            }
-          } else if (p.childNodes.length > 0) {
-            o = p.childNodes[0].nodeValue;
-            object = $.rdf.literal(literalOpts.lang ? o : '"' + o + '"', literalOpts);
-          } else {
-            oTriples = parseRdfXmlDescription(p, false, base, lang);
-            if (oTriples.length > 0) {
-              object = oTriples[oTriples.length - 1].subject;
-              triples = triples.concat(oTriples);
-            } else {
-              object = $.rdf.blank('[]');
-            }
-          }
-          triples.push($.rdf.triple(subject, property, object));
-          if (hasAttributeNS(p, rdfNs, 'ID')) {
-            reified = $.rdf.resource('<#' + getAttributeNS(p, rdfNs, 'ID') + '>', { base: base });
-            triples.push($.rdf.triple(reified, $.rdf.subject, subject));
-            triples.push($.rdf.triple(reified, $.rdf.property, property));
-            triples.push($.rdf.triple(reified, $.rdf.object, object));
-          }
-        }
-      }
-      return triples;
-    },
-
-    parseRdfXml = function (doc) {
-      var i, lang, d, triples = [];
-      if (doc.documentElement.namespaceURI === rdfNs && getLocalName(doc.documentElement) === 'RDF') {
-        lang = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'lang');
-        base = getAttributeNS(doc.documentElement, 'http://www.w3.org/XML/1998/namespace', 'base') || $.uri.base();
-        triples = $.map(doc.documentElement.childNodes, function (d) {
-          if (d.nodeType === 1) {
-            return parseRdfXmlDescription(d, true, base, lang);
-          } else {
-            return null;
-          }
-        });
-        /*
-        for (i = 0; i < doc.documentElement.childNodes.length; i += 1) {
-          d = doc.documentElement.childNodes[i];
-          if (d.nodeType === 1) {
-            triples = triples.concat(parseRdfXmlDescription(d, true, base, lang));
-          }
-        }
-        */
-      } else {
-        triples = parseRdfXmlDescription(doc.documentElement, true);
-      }
-      return triples;
-    },
-    
-    group = function (bindings, variables, base) {
-      var variable = variables[0], grouped = {}, results = [], i, newbase;
-      base = base || {};
-      if (variables.length === 0) {
-        for (i = 0; i < bindings.length; i += 1) {
-          for (v in bindings[i]) {
-            if (base[v] === undefined) {
-              base[v] = [];
-            }
-            if ($.isArray(base[v])) {
-              base[v].push(bindings[i][v]);
-            }
-          }
-        }
-        return [base];
-      }
-      // collect together the grouped results
-      for (i = 0; i < bindings.length; i += 1) {
-        key = bindings[i][variable];
-        if (grouped[key] === undefined) {
-          grouped[key] = [];
-        }
-        grouped[key].push(bindings[i]);
-      }
-      // call recursively on each group
-      variables = variables.splice(1, 1);
-      for (v in grouped) {
-        newbase = $.extend({}, base);
-        newbase[variable] = grouped[v][0][variable];
-        results = results.concat(group(grouped[v], variables, newbase));
-      }
-      return results;
-    },
-    
-    queue = function (databank, url, callbacks) {
-      if (documentQueue[databank.id] === undefined) {
-        documentQueue[databank.id] = {};
-      }
-      if (documentQueue[databank.id][url] === undefined) {
-        documentQueue[databank.id][url] = callbacks;
-        return false;
-      }
-      return true;
-    }
-    
-    dequeue = function (databank, url, result, args) {
-      var callbacks = documentQueue[databank.id][url];
-      if ($.isFunction(callbacks[result])) {
-        callbacks[result].call(databank, args);
-      }
-      documentQueue[databank.id][url] = undefined;
-    };
-
-  $.typedValue.types['http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'] = {
-    regex: /^.*$/m,
-    strip: false,
-    value: function (v) {
-      return v;
-    }
-  };
-
-  /**
-   * <p>Creates a new jQuery.rdf object. This should be invoked as a method rather than constructed using new; indeed you will usually want to generate these objects using a method such as {@link jQuery#rdf} or {@link jQuery.rdf#where}.</p>
-   * @class <p>A jQuery.rdf object represents the results of a query over its {@link jQuery.rdf#databank}. The results of a query are a sequence of objects which represent the bindings of values to the variables used in filter expressions specified using {@link jQuery.rdf#where} or {@link jQuery.rdf#optional}. Each of the objects in this sequence has associated with it a set of triples that are the sources for the variable bindings, which you can get at using {@link jQuery.rdf#sources}.</p>
-    * <p>The {@link jQuery.rdf} object itself is a lot like a {@link jQuery} object. It has a {@link jQuery.rdf#length} and the individual matches can be accessed using <code>[<var>n</var>]</code>, but you can also iterate through the matches using {@link jQuery.rdf#map} or {@link jQuery.rdf#each}.</p>
-    * <p>{@link jQuery.rdf} is designed to mirror the functionality of <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> while providing an interface that's familiar and easy to use for jQuery programmers.</p>
-   * @param {Object} [options]
-   * @param {jQuery.rdf.databank} [options.databank] The databank that this query should operate over.
-   * @param {jQuery.rdf.triple[]} [options.triples] A set of triples over which the query operates; this is only used if options.databank isn't specified, in which case a new databank with these triples is generated.
-   * @param {Object} [options.namespaces] An object representing a set of namespace bindings. Rather than passing this in when you construct the {@link jQuery.rdf} instance, you will usually want to use the {@link jQuery.rdf#prefix} method.
-   * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the query.
-   * @returns {jQuery.rdf}
-   * @example rdf = jQuery.rdf();
-   * @see jQuery#rdf
-   */
-  $.rdf = function (options) {
-    return new $.rdf.fn.init(options);
-  };
-
-  $.rdf.fn = $.rdf.prototype = {
-    /**
-     * The version of rdfQuery.
-     * @type String
-     */
-    rdfquery: '1.1',
-
-    init: function (options) {
-      var databanks;
-      options = options || {};
-      /* must specify either a parent or a union, otherwise it's the top */
-      this.parent = options.parent;
-      this.union = options.union;
-      this.top = this.parent === undefined && this.union === undefined;
-      if (this.union === undefined) {
-        if (options.databank === undefined) {
-          /**
-           * The databank over which this query operates.
-           * @type jQuery.rdf.databank
-           */
-          this.databank = this.parent === undefined ? $.rdf.databank(options.triples, options) : this.parent.databank;
-        } else {
-          this.databank = options.databank;
-        }
-      } else {
-        databanks = $.map(this.union, function (query) {
-          return query.databank;
-        });
-        databanks = $.unique(databanks);
-        if (databanks[1] !== undefined) {
-          this.databank = $.rdf.databank(undefined, { union: databanks });
-        } else {
-          this.databank = databanks[0];
-        }
-      }
-      this.children = [];
-      this.partOf = [];
-      this.filterExp = options.filter;
-      this.alphaMemory = [];
-      this.matches = [];
-      /**
-       * The number of matches represented by the {@link jQuery.rdf} object.
-       * @type Integer
-       */
-      this.length = 0;
-      if (this.filterExp !== undefined) {
-        if (!$.isFunction(this.filterExp)) {
-          registerQuery(this.databank, this);
-          this.alphaMemory = findMatches(this.databank, this.filterExp);
-        }
-      }
-      leftActivate(this);
-      return this;
-    },
-
-    /**
-     * Sets or returns the base URI of the {@link jQuery.rdf#databank}.
-     * @param {String|jQuery.uri} [base]
-     * @returns A {@link jQuery.uri} if no base URI is specified, otherwise returns this {@link jQuery.rdf} object.
-     * @example baseURI = jQuery('html').rdf().base();
-     * @example jQuery('html').rdf().base('http://www.example.org/');
-     * @see jQuery.rdf.databank#base
-     */
-    base: function (base) {
-      if (base === undefined) {
-        return this.databank.base();
-      } else {
-        this.databank.base(base);
-        return this;
-      }
-    },
-
-    /**
-     * Sets or returns a namespace binding on the {@link jQuery.rdf#databank}.
-     * @param {String} [prefix]
-     * @param {String} [namespace]
-     * @returns {Object|jQuery.uri|jQuery.rdf} If no prefix or namespace is specified, returns an object providing all namespace bindings on the {@link jQuery.rdf.databank}. If a prefix is specified without a namespace, returns the {@link jQuery.uri} associated with that prefix. Otherwise returns this {@link jQuery.rdf} object after setting the namespace binding.
-     * @example namespace = jQuery('html').rdf().prefix('foaf');
-     * @example jQuery('html').rdf().prefix('foaf', 'http://xmlns.com/foaf/0.1/');
-     * @see jQuery.rdf.databank#prefix
-     */
-    prefix: function (prefix, namespace) {
-      if (namespace === undefined) {
-        return this.databank.prefix(prefix);
-      } else {
-        this.databank.prefix(prefix, namespace);
-        return this;
-      }
-    },
-
-    /**
-     * Adds a triple to the {@link jQuery.rdf#databank} or another {@link jQuery.rdf} object to create a union.
-     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern|jQuery.rdf} triple The triple, {@link jQuery.rdf.pattern} or {@link jQuery.rdf} object to be added to this one. If the triple is a {@link jQuery.rdf} object, the two queries are unioned together. If the triple is a string, it's parsed as a {@link jQuery.rdf.pattern}. The pattern will be completed using the current matches on the {@link jQuery.rdf} object to create multiple triples, one for each set of bindings.
-     * @param {Object} [options]
-     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret CURIEs within the triple. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
-     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
-     * @returns {jQuery.rdf} This {@link jQuery.rdf} object.
-     * @example
-     * var rdf = $.rdf()
-     *   .prefix('dc', ns.dc)
-     *   .prefix('foaf', ns.foaf)
-     *   .add('&lt;photo1.jpg> dc:creator &lt;http://www.blogger.com/profile/1109404> .')
-     *   .add('&lt;http://www.blogger.com/profile/1109404> foaf:img &lt;photo1.jpg> .');
-     * @example
-     * var rdfA = $.rdf()
-     *   .prefix('dc', ns.dc)
-     *   .add('&lt;photo1.jpg> dc:creator "Jane"');
-     * var rdfB = $.rdf()
-     *   .prefix('foaf', ns.foaf)
-     *   .add('&lt;photo1.jpg> foaf:depicts "Jane"');
-     * var rdf = rdfA.add(rdfB);
-     * @see jQuery.rdf.databank#add
-     */
-    add: function (triple, options) {
-      var query, databank;
-      if (triple.rdfquery !== undefined) {
-        if (triple.top) {
-          databank = this.databank.add(triple.databank);
-          query = $.rdf({ parent: this.parent, databank: databank });
-          return query;
-        } else if (this.top) {
-          databank = triple.databank.add(this.databank);
-          query = $.rdf({ parent: triple.parent, databank: databank });
-          return query;
-        } else if (this.union === undefined) {
-          query = $.rdf({ union: [this, triple] });
-          this.partOf.push(query);
-          triple.partOf.push(query);
-          return query;
-        } else {
-          this.union.push(triple);
-          triple.partOf.push(this);
-        }
-      } else {
-        if (typeof triple === 'string') {
-          options = $.extend({}, { base: this.base(), namespaces: this.prefix(), source: triple }, options);
-          triple = $.rdf.pattern(triple, options);
-        }
-        if (triple.isFixed()) {
-          this.databank.add(triple.triple(), options);
-        } else {
-          query = this;
-          this.each(function (i, data) {
-            var t = triple.triple(data);
-            if (t !== null) {
-              query.databank.add(t, options);
-            }
-          });
-        }
-      }
-      return this;
-    },
-
-    /**
-     * Removes a triple or several triples from the {@link jQuery.rdf#databank}.
-     * @param {String|jQuery.rdf.triple|jQuery.rdf.pattern} triple The triple to be removed, or a {@link jQuery.rdf.pattern} that matches the triples that should be removed.
-     * @param {Object} [options]
-     * @param {Object} [options.namespaces] An object representing a set of namespace bindings used to interpret any CURIEs within the triple or pattern. Defaults to the namespace bindings defined on the {@link jQuery.rdf#databank}.
-     * @param {String|jQuery.uri} [options.base] The base URI used to interpret any relative URIs used within the triple or pattern. Defaults to the base URI defined on the {@link jQuery.rdf#databank}.
-     * @returns {jQuery.rdf} The {@link jQuery.rdf} object itself.
-     * @example
-     * var rdf = $('html').rdf()
-     *   .prefix('foaf', ns.foaf)
-     *   .where('?person foaf:givenname ?gname')
-     *   .where('?person foaf:family_name ?fname')
-     *   .remove('?person foaf:family_name ?fname');
-     * @see jQuery.rdf.databank#remove
-     */
-    remove: function (triple, options) {
-      if (typeof triple === 'string') {
-        options = $.extend({}, { base: this.base(), namespaces: this.prefix() }, options);
-        triple = $.rdf.pattern(triple, options);
-      }
-      if (triple.isFixed()) {
-        this.databank.remove(triple.triple(), options);
-      } else {
-        query = this;
-        this.each(function (i, data) {
-          var t = triple.triple(data);
-          if (t !== null) {
-            query.databank.remove(t, options);
-          }
-        });
-      }
-      return this;
-    },
-
-    /**
-     * Loads some data into the {@link jQuery.rdf#databank}
-     * @param data
-     * @param {Object} [options]
-     * @see jQuery.rdf.databank#load
-     */
-    load: function (data, options) {
-      var rdf = this, success = options.success;
-      if (success !== undefined) {
-        options.success = function () {
-          success.call(rdf);
-        }
-      }
-      this.databank.load(data, options);
-      return this;
-    },
-
-    /**
-     * Creates a new {@link jQuery.rdf} object whose databank c

<TRUNCATED>

[14/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/main/assembly/src.xml b/platform/launcher.tdb/src/main/assembly/src.xml
new file mode 100644
index 0000000..d146357
--- /dev/null
+++ b/platform/launcher.tdb/src/main/assembly/src.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>distribution</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <files>
+    <file>
+      <source>README.txt</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <!-- <file>
+        <source>target/platform.launcher.tdb-*-SNAPSHOT.jar</source>
+        <outputDirectory>/</outputDirectory>
+    </file> -->
+    <file>
+      <source>LICENSE</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <file>
+      <source>target/classes/META-INF/NOTICE</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <file>
+      <source>DISCLAIMER</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+  </files>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>LICENSE*</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>target</directory>
+            <includes>
+                <include>platform.launcher.tdb-*.jar</include>
+            </includes>
+            <excludes>
+                <exclude>*sources.jar</exclude>
+            </excludes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/resources/documentation/images/tut_1_class_diagram.png
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/resources/documentation/images/tut_1_class_diagram.png b/platform/launcher.tdb/src/site/resources/documentation/images/tut_1_class_diagram.png
new file mode 100644
index 0000000..0bd04f4
Binary files /dev/null and b/platform/launcher.tdb/src/site/resources/documentation/images/tut_1_class_diagram.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/resources/documentation/style/style.css b/platform/launcher.tdb/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..ff49a4d
--- /dev/null
+++ b/platform/launcher.tdb/src/site/resources/documentation/style/style.css
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/resources/images/clerezza.png b/platform/launcher.tdb/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/launcher.tdb/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/site.xml b/platform/launcher.tdb/src/site/site.xml
new file mode 100644
index 0000000..62c8fd3
--- /dev/null
+++ b/platform/launcher.tdb/src/site/site.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland).
+ * 
+ * Licensed 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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Information" href="documentation/information.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/xsite/content/information.xhtml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/xsite/content/information.xhtml b/platform/launcher.tdb/src/site/xsite/content/information.xhtml
new file mode 100644
index 0000000..358d672
--- /dev/null
+++ b/platform/launcher.tdb/src/site/xsite/content/information.xhtml
@@ -0,0 +1,41 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Clerezza platform launcher with Jena TDB storage</title>
+	</head>
+	<body>
+		<h1>Clerezza platform launcher with Jena TDB storage</h1>
+		<p>Author: Manuel Innerhofer - clerezza.org</p>
+		<p>Date: June 24, 2009</p>
+		<h2 id="information">Information</h2>
+		<p>
+			This is a launcher for the clerezza platform. It uses Jena TDB as
+			rdf storage. For further information on how to use this launcher read
+			the documentation of the storageless launcher under
+            <br />
+			<a href="http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/</a>
+		</p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/xsite/content/sitemap.xml b/platform/launcher.tdb/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..289f795
--- /dev/null
+++ b/platform/launcher.tdb/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>information.xhtml</page>
+    </section>
+</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.tdb/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/launcher.tdb/src/site/xsite/templates/skin.html b/platform/launcher.tdb/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..bb1b45d
--- /dev/null
+++ b/platform/launcher.tdb/src/site/xsite/templates/skin.html
@@ -0,0 +1,71 @@
+<!--
+
+ 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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/DISCLAIMER
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/DISCLAIMER b/platform/launcher.virtuoso/DISCLAIMER
new file mode 100644
index 0000000..ab24be4
--- /dev/null
+++ b/platform/launcher.virtuoso/DISCLAIMER
@@ -0,0 +1,11 @@
+Apache Clerezza is an effort undergoing incubation at The Apache Software 
+Foundation (ASF), sponsored by the Apache Incubator. 
+
+Incubation is required of all newly accepted projects until a further 
+review indicates that the infrastructure, communications, and decision 
+making process have stabilized in a manner consistent with other 
+successful ASF projects. 
+
+While incubation status is not necessarily a reflection of the 
+completeness or stability of the code, it does indicate that the 
+project has yet to be fully endorsed by the ASF.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/LICENSE
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/LICENSE b/platform/launcher.virtuoso/LICENSE
new file mode 100644
index 0000000..e8d41e4
--- /dev/null
+++ b/platform/launcher.virtuoso/LICENSE
@@ -0,0 +1,471 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+APACHE CLEREZZA TDB LAUNCHER SUBCOMPONENTS: 
+
+The Apache Clerezza TDB Launcher includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses. 
+
+For the yui javascript library:
+
+Copyright (c) 2009, Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * 	Redistributions of source code must retain the above copyright notice, this list of conditions and the
+     	following disclaimer.
+    * 	Redistributions in binary form must reproduce the above copyright notice, this 	list of conditions and the following disclaimer in the documentation and/or other 	materials provided with the distribution.
+    * 	Neither the name of Yahoo! Inc. nor the names of its contributors may be used 	to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the jQuery javascript library:
+
+Copyright (c) 2011 John Resig, http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For Asm:
+
+Copyright (c) 2000-2011 INRIA, France Telecom
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+For Bouncycastle:
+
+Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+For the RDFa parsing library:
+
+© Copyright 2009 University of Bristol
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS’’ AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+- For the jSSLutils library:
+  
+Copyright (c) 2008-2010, The University of Manchester, United Kingdom.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the The University of Manchester nor the names of 
+      its contributors may be used to endorse or promote products derived 
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+POSSIBILITY OF SUCH DAMAGE.
+
+
+For Jetty:
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+- For scala:
+
+Copyright (c) 2002-2012 EPFL, Lausanne, unless otherwise specified.
+All rights reserved.
+
+This software was developed by the Programming Methods Laboratory of the
+Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland.
+
+Permission to use, copy, modify, and distribute this software in source
+or binary form for any purpose with or without fee is hereby granted,
+provided that the following conditions are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+   3. Neither the name of the EPFL nor the names of its contributors
+      may be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/README.txt
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/README.txt b/platform/launcher.virtuoso/README.txt
new file mode 100644
index 0000000..2367061
--- /dev/null
+++ b/platform/launcher.virtuoso/README.txt
@@ -0,0 +1,24 @@
+Apache Clerezza Virtuoso Launcher
+
+The provided launcher jar is executable, however on most platform you must
+provide additional arguments to java so that Clerezza has enough memory to run.
+
+Start clerezza with:
+
+  java -XX:MaxPermSize=400m -Dfile.encoding=utf-8 -Xss512k -Xmx2g -jar platform.launcher.virtuoso-*.jar
+
+Add the --help at the end of the line above to see possible argument for Clerezza
+
+How to configure Virtuoso JDBC connection?
+
+To provide the initial configuration you can use the following parameters as system properties:
+ - virtuoso.host (default localhost)
+ - virtuoso.port (default 1111)
+ - virtuoso.user (default dba)
+ - virtuoso.password (default dba)
+
+for example
+
+  java -XX:MaxPermSize=400m -Dfile.encoding=utf-8 -Xss512k -Xmx2g -Dvirtuoso.password=mysecret -Dvirtuoso.user=clerezza -jar platform.launcher.virtuoso-*.jar
+
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/pom.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/pom.xml b/platform/launcher.virtuoso/pom.xml
new file mode 100644
index 0000000..b4805da
--- /dev/null
+++ b/platform/launcher.virtuoso/pom.xml
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5-SNAPSHOT</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.launcher.virtuoso</artifactId>
+    <version>0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Clerezza - Platform Launcher with Virtuoso</name>
+    <description>Virtuoso variant of standalone java application for launching the clerezza.org platform. It is also a bundle, but there is no OSGi container known to support this (we are working on it :-) ).</description>
+    <build>
+        <plugins>
+             <plugin>
+                    <groupId>org.codehaus.xsite</groupId>
+                    <artifactId>xsite-maven-plugin</artifactId>
+                    <configuration>
+                            <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                            <sitemapPath>content/sitemap.xml</sitemapPath>
+                            <skinPath>templates/skin.html</skinPath>
+                            <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                    </configuration>
+                    <executions>
+                            <execution>
+                                    <phase>pre-site</phase>
+                                    <goals>
+                                            <goal>run</goal>
+                                    </goals>
+                            </execution>
+                    </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.1</version>
+                <executions>
+                    <execution>
+                        <id>inline-jars</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>
+                                platform.launcher.storageless
+                            </includeArtifactIds>
+                            <outputDirectory>target/extracted</outputDirectory>
+                            <includes>**</includes>
+                            <excludes>
+                                META-INF/**,**/org.apache.jena*
+                            </excludes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-platform-bundles</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-3</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeScope>runtime</includeScope>
+                            <excludeArtifactIds>slf4j-api</excludeArtifactIds>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.clerezza.platform.launcher.Main</mainClass>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Bundle-Name>Clerezza - Platform Launcher (Virtuoso variant)</Bundle-Name>
+                            <Bundle-SymbolicName>org.apache.clerezza.platform.launcher.virtuoso</Bundle-SymbolicName>
+                            <Bundle-Activator>org.apache.clerezza.platform.launcher.Main</Bundle-Activator>
+                            <Import-Package>org.osgi.framework,org.osgi.service.startlevel</Import-Package>
+                            <Private-Package>*</Private-Package>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.2.1</version>
+                <configuration>
+                    <finalName>clerezza-virtuoso</finalName>
+                    <descriptors>
+                        <descriptor>src/main/assembly/src.xml</descriptor>
+                    </descriptors>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
+                        <phase>package</phase> <!-- bind to the packaging phase -->
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.7</version>
+                <configuration>
+                    <target>
+                        <property name="vm.args" value=""/>
+                        <java fork="true" jar="${project.build.directory}/${project.build.finalName}.jar"
+                  dir="${project.build.directory}">
+                            <jvmarg line="-Xmx1024m -XX:MaxPermSize=256M -Dfile.encoding=utf-8 ${vm.args}"/>
+                        </java>
+                    </target>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>target/extracted/</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </resource>
+            <resource>
+                <targetPath>META-INF</targetPath>
+                <filtering>false</filtering>
+                <directory>${basedir}</directory>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.*</include>
+                </includes>
+            </resource>
+            <!-- the exclude rules are here because the maven-dependency-plugin
+            copies both -SNAPSHOT version as well as the one with the timestamp,
+            see http://jira.codehaus.org/browse/MDEP-209 -->
+            <resource>
+                <targetPath>bundles</targetPath>
+                <directory>target/bundles</directory>
+                <excludes>
+                    <exclude>**/*20*.*-*.jar</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.launcher.storageless</artifactId>
+            <scope>provided</scope>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
+        <!-- what makes this variant special -->
+	<dependency>
+		<groupId>org.jboss.spec.javax.transaction</groupId>
+		<artifactId>jboss-transaction-api_1.1_spec</artifactId>
+        	<scope>runtime</scope>
+		<version>1.0.1.Final</version>
+	</dependency>    
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>ext.virtuoso.jdbc</artifactId>
+            <scope>runtime</scope>
+            <version>0.3-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.virtuoso.storage</artifactId>
+            <scope>runtime</scope>
+            <version>0.3-SNAPSHOT</version>
+        </dependency>
+<!--
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.jena.tdb.storage</artifactId>
+            <scope>runtime</scope>
+            <version>0.7-SNAPSHOT</version>
+        </dependency>
+-->     <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-iri</artifactId>
+            <scope>runtime</scope>
+            <version>1.0.0_1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.xerces</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.0_1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.xmlresolver</artifactId>
+            <scope>runtime</scope>
+            <version>1.2_5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-core</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.0_1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-arq</artifactId>
+            <scope>runtime</scope>
+            <version>2.11.0_1-SNAPSHOT</version>
+        </dependency>
+<!--
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.apache.jena.jena-tdb</artifactId>
+            <scope>runtime</scope>
+            <version>1.0.0_1-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>14.0</version>
+        </dependency>
+-->
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/main/appended-resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/main/appended-resources/META-INF/NOTICE b/platform/launcher.virtuoso/src/main/appended-resources/META-INF/NOTICE
new file mode 100644
index 0000000..7d1928c
--- /dev/null
+++ b/platform/launcher.virtuoso/src/main/appended-resources/META-INF/NOTICE
@@ -0,0 +1,18 @@
+
+- Mort Bay Jetty Project (http://www.mortbay.org/jetty/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- WYMIWYG (http://wymiwyg.org/)
+- HP Labs Semantic Web Research (http://www.hpl.hp.com/semweb/)
+- The OSGi Alliance (http://www.osgi.org/)
+- Yahoo! Inc. (http://yahoo.com/)
+- Eclipse Foundation (http://eclipse.org/)
+- INRIA, France Telecom (http://asm.ow2.org/)
+- The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+- University of Bristol (http://stars.ilrt.bris.ac.uk/)
+- The University of Manchester (http://www.manchester.ac.uk/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- EPFL, Lausanne (http://www.epfl.ch/)
+
+This product includes JQuery and other javascript 
+files Licensed under the MIT License, see the individual
+files for their copyright notice.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/main/assembly/src.xml b/platform/launcher.virtuoso/src/main/assembly/src.xml
new file mode 100644
index 0000000..bb27993
--- /dev/null
+++ b/platform/launcher.virtuoso/src/main/assembly/src.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>distribution</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <files>
+    <file>
+      <source>README.txt</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <!-- <file>
+        <source>target/platform.launcher.tdb-*-SNAPSHOT.jar</source>
+        <outputDirectory>/</outputDirectory>
+    </file> -->
+    <file>
+      <source>LICENSE</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <file>
+      <source>target/classes/META-INF/NOTICE</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+    <file>
+      <source>DISCLAIMER</source>
+      <outputDirectory>/</outputDirectory>
+    </file>
+  </files>
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>LICENSE*</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>target</directory>
+            <includes>
+                <include>platform.launcher.virtuoso-*.jar</include>
+            </includes>
+            <excludes>
+                <exclude>*sources.jar</exclude>
+            </excludes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/resources/documentation/images/tut_1_class_diagram.png
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/resources/documentation/images/tut_1_class_diagram.png b/platform/launcher.virtuoso/src/site/resources/documentation/images/tut_1_class_diagram.png
new file mode 100644
index 0000000..0bd04f4
Binary files /dev/null and b/platform/launcher.virtuoso/src/site/resources/documentation/images/tut_1_class_diagram.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/resources/documentation/style/style.css b/platform/launcher.virtuoso/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..ff49a4d
--- /dev/null
+++ b/platform/launcher.virtuoso/src/site/resources/documentation/style/style.css
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/resources/images/clerezza.png b/platform/launcher.virtuoso/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/launcher.virtuoso/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/site.xml b/platform/launcher.virtuoso/src/site/site.xml
new file mode 100644
index 0000000..62c8fd3
--- /dev/null
+++ b/platform/launcher.virtuoso/src/site/site.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland).
+ * 
+ * Licensed 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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Information" href="documentation/information.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/xsite/content/information.xhtml
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/xsite/content/information.xhtml b/platform/launcher.virtuoso/src/site/xsite/content/information.xhtml
new file mode 100644
index 0000000..8ec375c
--- /dev/null
+++ b/platform/launcher.virtuoso/src/site/xsite/content/information.xhtml
@@ -0,0 +1,41 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Clerezza platform launcher for Virtuoso storage</title>
+	</head>
+	<body>
+		<h1>Clerezza platform launcher for Virtuoso storage</h1>
+		<p>Author: Enrico Daga - clerezza.org</p>
+		<p>Date: March 28, 2014</p>
+		<h2 id="information">Information</h2>
+		<p>
+			This is a launcher for the clerezza platform. It is meant to use Virtuoso as
+			rdf storage. For further information on how to use this launcher read
+			the documentation of the storageless launcher under
+            <br />
+			<a href="http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/</a>
+		</p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/xsite/content/sitemap.xml b/platform/launcher.virtuoso/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..289f795
--- /dev/null
+++ b/platform/launcher.virtuoso/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ 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.
+
+-->
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>information.xhtml</page>
+    </section>
+</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.virtuoso/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/launcher.virtuoso/src/site/xsite/templates/skin.html b/platform/launcher.virtuoso/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..bb1b45d
--- /dev/null
+++ b/platform/launcher.virtuoso/src/site/xsite/templates/skin.html
@@ -0,0 +1,71 @@
+<!--
+
+ 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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>


[12/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/LICENSE
----------------------------------------------------------------------
diff --git a/platform/mail/LICENSE b/platform/mail/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/mail/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/pom.xml
----------------------------------------------------------------------
diff --git a/platform/mail/pom.xml b/platform/mail/pom.xml
new file mode 100644
index 0000000..97cbcee
--- /dev/null
+++ b/platform/mail/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>clerezza</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.mail</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Mail Deliverly</name>
+    <description>Provides services for mail deliverly</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <artifactId>mail</artifactId>
+            <groupId>javax.mail</groupId>
+            <version>1.4.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stanbol</groupId>
+            <artifactId>org.apache.stanbol.commons.security.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <version>0.2</version>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/main/java/org/apache/clerezza/platform/mail/GraphNodeDataHandler.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/main/java/org/apache/clerezza/platform/mail/GraphNodeDataHandler.java b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/GraphNodeDataHandler.java
new file mode 100644
index 0000000..6e23e9e
--- /dev/null
+++ b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/GraphNodeDataHandler.java
@@ -0,0 +1,131 @@
+/*
+ * 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.mail;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+
+import javax.activation.CommandInfo;
+import javax.activation.CommandMap;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import org.apache.clerezza.platform.typerendering.Renderer;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+/**
+ * 
+ * @author mir
+ */
+public class GraphNodeDataHandler extends DataHandler{
+
+    private GraphNode graphNode;
+    private Renderer renderer;
+    
+    
+    public GraphNodeDataHandler(GraphNode graphNode,
+            Renderer renderer) {
+        super(null, null);
+        this.graphNode = graphNode;
+        this.renderer = renderer;
+    }
+    
+
+    @Override
+    public CommandInfo[] getAllCommands() {
+        throw new UnsupportedOperationException("Operation not supported 1");
+    }
+
+    @Override
+    public Object getBean(CommandInfo arg0) {
+        throw new UnsupportedOperationException("Operation not supported 2");
+    }
+
+    @Override
+    public CommandInfo getCommand(String arg0) {
+        throw new UnsupportedOperationException("Operation not supported 3");
+    }
+
+    @Override
+    public Object getContent() throws IOException {
+        throw new UnsupportedOperationException("Operation not supported 4");
+    }
+
+    @Override
+    public String getContentType() {
+        return renderer.getMediaType().toString();
+    }
+
+    @Override
+    public DataSource getDataSource() {
+        throw new UnsupportedOperationException("Operation not supported 6");
+    }
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        throw new UnsupportedOperationException("Operation not supported 7");
+    }
+
+    @Override
+    public String getName() {
+        return null;
+    }
+
+    @Override
+    public OutputStream getOutputStream() throws IOException {
+        throw new UnsupportedOperationException("Operation not supported 9");
+    }
+
+    @Override
+    public CommandInfo[] getPreferredCommands() {
+        throw new UnsupportedOperationException("Operation not supported 10");
+    }
+
+    @Override
+    public Object getTransferData(DataFlavor arg0)
+            throws UnsupportedFlavorException, IOException {
+        throw new UnsupportedOperationException("Operation not supported 11");
+    }
+
+    @Override
+    public synchronized DataFlavor[] getTransferDataFlavors() {
+        throw new UnsupportedOperationException("Operation not supported 12");
+    }
+
+    @Override
+    public boolean isDataFlavorSupported(DataFlavor arg0) {
+        throw new UnsupportedOperationException("Operation not supported 13");
+    }
+
+    @Override
+    public synchronized void setCommandMap(CommandMap arg0) {
+        throw new UnsupportedOperationException("Operation not supported 14");
+    }
+
+    @Override
+    public void writeTo(OutputStream os) throws IOException {
+        renderer.render(graphNode, null, null, null, null, null, new HashMap<String, Object>(), os);
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailMan.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailMan.java b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailMan.java
new file mode 100644
index 0000000..4699c4d
--- /dev/null
+++ b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailMan.java
@@ -0,0 +1,177 @@
+/*
+ * 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.mail;
+
+import java.util.List;
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetAddress;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+
+/**
+ * Implementations provide methods for sending emails, in particular to platform
+ * users.
+ * 
+ * @author mir
+ */
+public interface MailMan {
+
+    /**
+     * Sends the specified message to the email address of the specified platform
+     * user toUser. As sender address the email address of the fromUser is used.
+     * The subject of the email will be the specified subject.
+     * @param fromUser the user, which email address will be used as sender address ("from")
+     * @param toUser the user to whose email address the message will be sent ("to")
+     * @param subject the subject of the email
+     * @param message the message of the email
+     */
+    public void sendEmailToUser(String fromUser, String toUser, String subject,
+            String message) throws MessagingException;
+
+    /**
+     * Sends the rendered <code>GraphNode</code> to the email address of the specified platform
+     * user toUser. As sender address the email address of the fromUser is used.
+     * The subject of the email will be the specified subject.
+     * An appropriate renderer for the <code>GraphNode</code> is selected on the
+     * basis of the specified <code>mode</code>, <code>acceptableMediaTypes</code> 
+     * and the rdf-type of the graph node itself.
+     * The <code>acceptableMediaTypes</code> list represent the media
+     * types that are acceptable for the rendered <code>GraphNode</code>. The list has a
+     * order where the most desirable media type is at the beginning of the list.
+     * The media type of the rendered <code>GraphNode</code> will be compatible to at least one
+     * media types in the list. <code>acceptableMediaTypes</code> and <code>mode</code> can
+     * be null. <code>acceptableMediaTypes = null</code> is equivalent to a list containing
+     * the media type "*\/*".
+     * @param fromUser the user, which email address will be used as sender address ("from")
+     * @param toUser the user to whose email address the message will be sent ("to")
+     * @param subject the subject of the email
+     * @param message the message of the email
+     */
+    public void sendEmailToUser(String fromUser, String toUser, String subject,
+            GraphNode graphNode, List<MediaType> acceptableMediaTypes, String mode)
+            throws MessagingException ;
+
+    /**
+     * Sends the specified message to the email addresses of the specified platform
+     * users toUsers. As sender address the email address of the fromUser is used.
+     * The subject of the email will be the specified subject. A recipient wont
+     * see the addresses or names of other recipients.
+     * @param fromUser the user, which email address will be used as sender address ("from")
+     * @param toUsers the users to whose email addresses the message will be sent ("to")
+     * @param subject the subject of the email
+     * @param graphNode will be rendered and sent as message body
+     * @param acceptableMediaTypes acceptable media types for the rendered output
+     * @param mode the rendering mode
+     */
+    public void sendEmailToUsers(String fromUser, String[] toUsers,String subject,
+            String message) throws MessagingException;
+
+    /**
+     * Sends the rendered <code>GraphNode</code> to the email addresses of the specified platform
+     * users toUsers. As sender address the email address of the fromUser is used.
+     * The subject of the email will be the specified subject. A recipient wont
+     * see the addresses or names of other recipients.
+     * An appropriate renderer for the <code>GraphNode</code> is selected on the
+     * basis of the specified <code>mode</code>, <code>acceptableMediaTypes</code>
+     * and the rdf-type of the graph node itself.
+     * The <code>acceptableMediaTypes</code> list represent the media
+     * types that are acceptable for the rendered <code>GraphNode</code>. The list has a
+     * order where the most desirable media type is at the beginning of the list.
+     * The media type of the rendered <code>GraphNode</code> will be compatible to at least one
+     * media types in the list. <code>acceptableMediaTypes</code> and <code>mode</code> can
+     * be null. <code>acceptableMediaTypes = null</code> is equivalent to a list containing
+     * the media type "*\/*".
+     * @param fromUser the user, which email address will be used as sender address ("from")
+     * @param toUser the user to whose email address the message will be sent ("to")
+     * @param subject the subject of the email
+     * @param graphNode will be rendered and sent as message body
+     * @param acceptableMediaTypes acceptable media types for the rendered output
+     * @param mode the rendering mode
+     */
+    public void sendEmailToUsers(String fromUser, String[] toUsers, String subject,
+            GraphNode graphNode, List<MediaType> acceptableMediaTypes, String mode)
+            throws MessagingException ;
+
+    /**
+     * Sends an message with the specified subject to the specified
+     * <code>Adress</code> to and carbon copies to the <code>Adress<code>es
+     * cc and bcc (Not visible to other recipients). Cc and bcc can be null, all
+     * other parameter has to be specified.
+     * @param from sender address
+     * @param to recipient address
+     * @param cc addresess to which copies of the message will be sent to
+     * @param bcc addreses to which copies of the message will be sent to,
+     * but not visible to other recipients.
+     * @param subject the subject of the message
+     * @param message the message to be sent
+     * @deprecated use javax.mail with the session returned by MailSessionFactory
+     */
+    @Deprecated
+    public void sendEmail(InternetAddress from, InternetAddress to,
+            InternetAddress[] cc, InternetAddress[] bcc, String subject,
+            String message) throws MessagingException;
+
+    /**
+     * Sends an message with the specified subject to the specified
+     * <code>Adress</code> to and carbon copies to the <code>Adress<code>es
+     * cc and bcc (Not visible to other recipients). Cc and bcc can be null, all
+     * other parameter has to be specified.
+     * @author oliver straesser
+     * @param from sender address
+     * @param to recipient address
+     * @param cc addresess to which copies of the message will be sent to
+     * @param bcc addreses to which copies of the message will be sent to,
+     * but not visible to other recipients.
+     * @param subject the subject of the message
+     * @param message the message to be sent
+     * @deprecated use javax.mail with the session returned by MailSessionFactory
+     */
+    @Deprecated
+    public void sendEmail(InternetAddress from, InternetAddress to,
+            InternetAddress[] cc, InternetAddress[] bcc, String subject,
+            String message, String mediaType) throws MessagingException;
+
+    /**
+     * Sends the rendered <code>GraphNode</code> with the specified subject to the specified
+     * <code>Adress</code> to and carbon copies to the <code>Adress<code>es
+     * cc and bcc (Not visible to other recipients). Cc and bcc can be null.
+     * The <code>acceptableMediaTypes</code> list represent the media
+     * types that are acceptable for the rendered <code>GraphNode</code>. The list has a
+     * order where the most desirable media type is at the beginning of the list.
+     * The media type of the rendered <code>GraphNode</code> will be compatible to at least one
+     * media types in the list. <code>acceptableMediaTypes</code> and <code>mode</code> can
+     * be null. <code>acceptableMediaTypes = null</code> is equivalent to a list containing
+     * the media type "*\/*".
+     * @param from sender address
+     * @param to recipient address
+     * @param cc addresess to which copies of the message will be sent to
+     * @param bcc addreses to which copies of the message will be sent to,
+     * but not visible to other recipients.
+     * @param subject the subject of the message
+     * @param graphNode will be rendered and sent as message body
+     * @param acceptableMediaTypes acceptable media types for the rendered output
+     * @param mode the rendering mode
+     */
+    public void sendEmail(InternetAddress from, InternetAddress to,
+            InternetAddress[] cc, InternetAddress[] bcc, String subject,
+            GraphNode graphNode, List<MediaType> acceptableMediaTypes, String mode)
+            throws MessagingException;
+    
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
new file mode 100644
index 0000000..827c39c
--- /dev/null
+++ b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManImpl.java
@@ -0,0 +1,291 @@
+/*
+ * 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.mail;
+
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.platform.typerendering.Renderer;
+import org.apache.clerezza.platform.typerendering.RendererFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.sparql.ParseException;
+import org.apache.clerezza.rdf.core.sparql.QueryParser;
+import org.apache.clerezza.rdf.core.sparql.ResultSet;
+import org.apache.clerezza.rdf.core.sparql.query.SelectQuery;
+import org.apache.clerezza.rdf.ontologies.FOAF;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ *
+ * Implementation of <code>MailMan</code> providing  utility methods to send
+ * emails rendering GraphNodes
+ *
+ * @author mir, daniel
+ */
+@Component
+@Service(MailMan.class)
+public class MailManImpl implements MailMan {
+
+    @Reference
+    private TcManager tcManager;
+
+    @Reference
+    RendererFactory rendererFactory;
+
+    @Reference
+    MailSessionFactory mailSessionFactory;
+
+
+    private static String SYSTEM_GRAPH_URI = "urn:x-localinstance:/system.graph";
+    private UriRef systemGraphUri = new UriRef(SYSTEM_GRAPH_URI);
+
+    @Override
+    public void sendEmailToUser(final String fromUser, final String toUser,
+            final String subject, final String message) throws MessagingException {
+        try {
+            AccessController.checkPermission(new MailManPermission(fromUser, MailManPermission.SEND_FROM));
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+
+                @Override
+                public Object run() throws MessagingException {
+                    InternetAddress fromAddress = getUserAddress(fromUser);
+                    InternetAddress toAddress = getUserAddress(toUser);
+                    sendEmail(fromAddress, toAddress, null, null, subject, message);
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException ex) {
+            if (ex.getException() instanceof MessagingException) {
+                throw (MessagingException) ex.getException();
+            } else {
+                throw new RuntimeException(ex.getException());
+            }
+
+        }
+    }
+
+    @Override
+    public void sendEmailToUser(final String fromUser, final String toUser,
+            final String subject, final GraphNode graphNode,
+            final List<MediaType> acceptableMediaTypes, final String mode)
+            throws MessagingException {
+        try {
+            AccessController.checkPermission(
+                    new MailManPermission(fromUser, MailManPermission.SEND_FROM));
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+
+                @Override
+                public Object run() throws MessagingException {
+                    InternetAddress fromAddress = getUserAddress(fromUser);
+                    InternetAddress toAddress = getUserAddress(toUser);
+                    sendEmail(fromAddress, toAddress, null, null, subject, graphNode,
+                            acceptableMediaTypes, mode);
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException ex) {
+            if (ex.getException() instanceof MessagingException) {
+                throw (MessagingException) ex.getException();
+            } else {
+                throw new RuntimeException(ex.getException());
+            }
+        }
+    }
+
+    @Override
+    public void sendEmailToUsers(final String fromUser, final String[] toUsers,
+            final String subject, final String message) throws MessagingException {
+
+        try {
+            AccessController.checkPermission(
+                    new MailManPermission(fromUser, MailManPermission.SEND_FROM));
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+
+                @Override
+                public Object run() throws MessagingException {
+                    for (int i = 0; i < toUsers.length; i++) {
+                        String toUser = toUsers[i];
+                        sendEmailToUser(fromUser, toUser, subject, message);
+                    }
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException ex) {
+            if (ex.getException() instanceof MessagingException) {
+                throw (MessagingException) ex.getException();
+            } else {
+                throw new RuntimeException(ex.getException());
+            }
+        }
+    }
+
+    @Override
+    public void sendEmailToUsers(final String fromUser, final String[] toUsers,
+            final String subject, final GraphNode graphNode,
+            final List<MediaType> acceptableMediaTypes, final String mode)
+            throws MessagingException {
+        try {
+            AccessController.checkPermission(
+                    new MailManPermission(fromUser, MailManPermission.SEND_FROM));
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+
+                @Override
+                public Object run() throws MessagingException {
+                    for (int i = 0; i < toUsers.length; i++) {
+                        String toUser = toUsers[i];
+                        sendEmailToUser(fromUser, toUser, subject, graphNode,
+                                acceptableMediaTypes, mode);
+                    }
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException ex) {
+            if (ex.getException() instanceof MessagingException) {
+                throw (MessagingException) ex.getException();
+            } else {
+                throw new RuntimeException(ex.getException());
+            }
+        }
+    }
+
+    @Override
+    public void sendEmail(InternetAddress from, InternetAddress to,
+            InternetAddress[] cc, InternetAddress[] bcc, String subject,
+            GraphNode graphNode, List<MediaType> acceptableMediaTypes,
+            String mode) throws MessagingException {
+        AccessController.checkPermission(
+                new MailManPermission("", MailManPermission.SEND_MAIL));
+        sendEmail(from, to, cc, bcc, subject, graphNode, null, acceptableMediaTypes,
+                mode);
+    }
+
+    @Override
+    public void sendEmail(InternetAddress from, InternetAddress to,
+            InternetAddress[] cc, InternetAddress[] bcc, String subject,
+            String message) throws MessagingException {
+        AccessController.checkPermission(
+                new MailManPermission("", MailManPermission.SEND_MAIL));
+        sendEmail(from, to, cc, bcc, subject, message, "text/plain", null, null);
+    }
+
+    @Override
+    public void sendEmail(InternetAddress from, InternetAddress to,
+            InternetAddress[] cc, InternetAddress[] bcc, String subject,
+            String message, String mediaType) throws MessagingException {
+        AccessController.checkPermission(
+                new MailManPermission("", MailManPermission.SEND_MAIL));
+        sendEmail(from, to, cc, bcc, subject, message, mediaType, null, null);
+    }
+
+    private void sendEmail(final InternetAddress from, final InternetAddress to,
+            final InternetAddress[] cc, final InternetAddress[] bcc,
+            final String subject, final Object content, final String mediaType,
+            final List<MediaType> acceptableMediaTypes, final String mode)
+            throws MessagingException {
+        final Session session = mailSessionFactory.getSession();
+        try {
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+
+                @Override
+                public Object run() throws MessagingException {
+                    MimeMessage mimeMessage = new MimeMessage(session);
+                    Date date = new Date();
+                    mimeMessage.setSentDate(date);
+                    mimeMessage.setSubject(subject);
+                    if (content instanceof GraphNode) {
+                        GraphNode graphNode = (GraphNode) content;
+                        Renderer renderer = rendererFactory.createRenderer(graphNode, mode,
+                                acceptableMediaTypes == null ? Collections.singletonList(
+                                MediaType.WILDCARD_TYPE) : acceptableMediaTypes);
+                        if (renderer == null) {
+                            throw new MessagingException("No renderer appropriate found");
+                        }
+                        mimeMessage.setDataHandler(
+                                new GraphNodeDataHandler(graphNode, renderer));
+                    } else {
+                        mimeMessage.setContent(content, mediaType);
+                    }
+                    mimeMessage.setFrom(from);
+                    if (to != null) {
+                        mimeMessage.addRecipient(Message.RecipientType.TO, to);
+                    }
+                    if (cc != null) {
+                        mimeMessage.addRecipients(Message.RecipientType.CC, cc);
+                    }
+                    if (bcc != null) {
+                        mimeMessage.addRecipients(Message.RecipientType.BCC, bcc);
+                    }
+                    Transport.send(mimeMessage);
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException ex) {
+            if (ex.getException() instanceof MessagingException) {
+                throw (MessagingException) ex.getException();
+            } else {
+                throw new RuntimeException(ex.getException());
+            }
+        }
+
+    }
+
+
+    private InternetAddress getUserAddress(String user) throws MessagingException {
+        MGraph systemGraph = tcManager.getMGraph(systemGraphUri);
+
+        final String queryString = "SELECT ?email WHERE { "
+                + "?x " + FOAF.mbox + " ?email . "
+                + "?x " + PLATFORM.userName + " \"" + user + "\" . "
+                + "}";
+        try {
+            SelectQuery selectQuery = (SelectQuery) QueryParser.getInstance().parse(queryString);
+            ResultSet result = tcManager.executeSparqlQuery(selectQuery, systemGraph);
+            if (result.hasNext()) {
+                Resource email = result.next().get("email");
+                String emailString = ((UriRef) email).getUnicodeString();
+                //TODO should add personal name (if available) as well
+                return new InternetAddress(emailString.substring("mailto:".length()));
+            }
+        } catch (ParseException ex) {
+            throw new RuntimeException(ex);
+        } catch (AddressException ex) {
+            throw new RuntimeException(ex);
+        }
+        throw new MessagingException("No address found for user " + user);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManPermission.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManPermission.java b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManPermission.java
new file mode 100644
index 0000000..42db6b6
--- /dev/null
+++ b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailManPermission.java
@@ -0,0 +1,135 @@
+/*
+ * 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.mail;
+
+import java.security.Permission;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import org.apache.stanbol.commons.security.UserUtil;
+
+/**
+ * A permission to send e-mails as a specific user.
+ *
+ * @author mir
+ */
+public class MailManPermission extends Permission {
+    private String namePattern;
+    private SortedSet<String> actions;
+    
+    public static final String SEND_FROM = "send from";
+    public static final String SEND_MAIL = "send mail";
+    
+    public static final String SELF_ACTION = "<self>";
+
+    public MailManPermission(String namePattern, String actions)  {
+        super(namePattern);
+        this.namePattern = namePattern;
+        this.actions = new TreeSet<String>(Arrays.asList(actions.split(",")));
+    }
+
+    @Override
+    public boolean implies(Permission permission) {
+        if (permission instanceof MailManPermission) {
+            MailManPermission other = (MailManPermission) permission;
+
+            if(other.actions.contains(SEND_FROM)) {
+                if (!patternImplies(other.namePattern)) {
+                    return false;
+                }
+            }
+            if (!actionsImplies(other.actions)) {
+                return false;
+            }
+            return true;
+            
+            
+        }
+        return false;
+    }
+
+    private boolean actionsImplies(Set<String> actionsOther) {
+        return actions.containsAll(actionsOther);
+        
+        
+    }
+
+    private boolean patternImplies(String namePatternOther) {
+        if (namePattern.equals(namePatternOther)) {
+            return true;
+        }
+
+        if (namePattern.equals(SELF_ACTION)) {
+            String userName = UserUtil.getCurrentUserName();
+            if (userName == null) {
+                return false;
+            }
+            return userName.equals(namePatternOther);
+        }
+        return namePatternOther.matches(namePattern);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final MailManPermission other = (MailManPermission) obj;
+        if (this.namePattern != other.namePattern 
+                && (this.namePattern == null
+                || !this.namePattern.equals(other.namePattern))) {
+            return false;
+        }
+        if (this.actions != other.actions 
+                && (this.actions == null
+                || !this.actions.equals(other.actions))) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 5;
+        hash = 97 * hash + (this.namePattern != null ?
+            this.namePattern.hashCode() : 0);
+        return hash;
+    }
+
+    
+
+    @Override
+    public String getActions() {
+        StringBuffer sb = new StringBuffer();
+        Iterator<String> it = actions.iterator();
+        while(it.hasNext()) {
+            String action = it.next();
+            sb.append(action);
+            if (it.hasNext()) {
+                sb.append(",");    
+            }                    
+        }
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailPermissionDescriptionsProvider.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailPermissionDescriptionsProvider.java b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailPermissionDescriptionsProvider.java
new file mode 100644
index 0000000..7ed61c2
--- /dev/null
+++ b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailPermissionDescriptionsProvider.java
@@ -0,0 +1,59 @@
+/*
+ * 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.mail;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider;
+import org.apache.clerezza.permissiondescriptions.PermissionDescripton;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ * <code>PermissionDescriptionsProvider</code> implementation that provides
+ * <code>PermissionDescripton</code>s for the most common <code>MailManPermission<code>s
+ * used.
+ * 
+ * @author mir
+ */
+@Component
+@Service(PermissionDescriptionsProvider.class)
+public class MailPermissionDescriptionsProvider implements PermissionDescriptionsProvider {
+
+    private static final Set<PermissionDescripton> MAIL_PERMISSION_DESCRIPTIONS = new HashSet<PermissionDescripton>();
+    static {
+        MAIL_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Send Mails From Account Permission",
+                "Grants permission to the user to send emails from his/her account. The sender email address will" +
+                " be the address associated to the user account.", null, MailManPermission.class,
+                "(org.apache.clerezza.platform.mail.MailManPermission \"" + MailManPermission.SELF_ACTION +
+                "\" \"" + MailManPermission.SEND_FROM + "\")"));
+
+        MAIL_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Send Mails Permission",
+                "Grants permission to send emails. The sender email address can be freely specified. " +
+                "This permission does not grant permission to send emails from any accounts.", null, MailManPermission.class,
+                "(org.apache.clerezza.platform.mail.MailManPermission \"\" \"" + MailManPermission.SEND_MAIL + "\")"));
+    }
+
+    @Override
+    public Set<PermissionDescripton> getPermissionDescriptors() {
+        return MAIL_PERMISSION_DESCRIPTIONS;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailSessionFactory.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailSessionFactory.java b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailSessionFactory.java
new file mode 100644
index 0000000..a2b5f5c
--- /dev/null
+++ b/platform/mail/src/main/java/org/apache/clerezza/platform/mail/MailSessionFactory.java
@@ -0,0 +1,99 @@
+/*
+ * 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.mail;
+
+
+import java.util.Properties;
+import javax.mail.Authenticator;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * Provides an isntance of javax.mail.Session matching the configuration of this 
+ * service.
+ *
+ * @author reto
+ */
+@Component(metatype=true)
+@Service(MailSessionFactory.class)
+public class MailSessionFactory {
+    /**
+     * Service property
+     *
+     */
+    @Property(value="false", description="Specifies if TLS (SSL) encryption is used.")
+    public static final String MAIL_USE_TLS = "useTLS";
+    /**
+     * Service property
+     *
+     */
+    @Property(value="localhost", description="Specifies the SMTP host.")
+    public static final String MAIL_SMTP_HOST = "smtpHost";
+    /**
+     * Service property
+     */
+    @Property(value="25", description="Specifies the SMTP port.")
+    public static final String MAIL_SMTP_PORT = "smtpPort";
+    /**
+     * Service property
+     *
+     */
+    @Property(value="myPassword", description="Specifies the authentication password for SMTP.")
+    public static final String MAIL_SMTP_PASSWORD = "smtpPassword";
+    /**
+     * Service property
+     *
+     */
+    @Property(value="myUserName", description="Specifies the User to authenticate for SMTP.")
+    public static final String MAIL_SMTP_USER = "smtpUser";
+
+    private Properties properties;
+
+    protected void activate(ComponentContext componentContext) {
+        properties = new Properties();
+        properties.setProperty("mail.debug", "false");
+        if (((String) componentContext.getProperties().get(MAIL_USE_TLS)).equals("true")) {
+            properties.setProperty("mail.smtp.starttls.enable", "true");
+            properties.setProperty("mail.smtp.auth", "true");
+            properties.setProperty("mail.smtp.socketFactory.fallback", "false");
+        }
+        properties.setProperty("mail.transport.protocol", "smtp");
+        properties.setProperty("mail.smtp.port", (String) componentContext.getProperties().get(MAIL_SMTP_PORT));
+        properties.setProperty("mail.smtp.host", (String) componentContext.getProperties().get(MAIL_SMTP_HOST));
+        properties.setProperty("smtpUser", (String) componentContext.getProperties().get(MAIL_SMTP_USER));
+        properties.setProperty("smtpPassword", (String) componentContext.getProperties().get(MAIL_SMTP_PASSWORD));
+    }
+
+    public Session getSession() {
+        Authenticator auth = new Authenticator() {
+            @Override
+            public PasswordAuthentication getPasswordAuthentication() {
+                return new PasswordAuthentication(properties.
+                        getProperty("smtpUser"),
+                        properties.getProperty("smtpPassword"));
+            }
+        };
+        return Session.getInstance(properties, auth);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/mail/src/test/java/org/apache/clerezza/platform/mail/MailManPermissionTest.java
----------------------------------------------------------------------
diff --git a/platform/mail/src/test/java/org/apache/clerezza/platform/mail/MailManPermissionTest.java b/platform/mail/src/test/java/org/apache/clerezza/platform/mail/MailManPermissionTest.java
new file mode 100644
index 0000000..b998c75
--- /dev/null
+++ b/platform/mail/src/test/java/org/apache/clerezza/platform/mail/MailManPermissionTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.mail;
+
+import java.security.Permission;
+import java.security.PrivilegedAction;
+import java.util.Collections;
+import javax.security.auth.Subject;
+import org.junit.Test;
+import org.apache.stanbol.commons.security.auth.PrincipalImpl;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+/**
+ *
+ * @author mir
+ */
+public class MailManPermissionTest  {
+
+    @Test
+    public void testImpliesSendFrom() {
+        Permission userX1 = new MailManPermission("userNameX", MailManPermission.SEND_FROM);
+        Permission userX2 = new MailManPermission("userNameX", MailManPermission.SEND_FROM);
+        Permission userY = new MailManPermission("userNameY", MailManPermission.SEND_FROM);
+        Permission userAll = new MailManPermission("userName[A-Z]", MailManPermission.SEND_FROM);
+
+        assertTrue(userX1.implies(userX2));
+        assertTrue(userX1.equals(userX2));
+        assertFalse(userX1.implies(userY));
+        assertTrue(userAll.implies(userX1));
+        assertTrue(userAll.implies(userY));
+        assertFalse(userY.implies(userAll));
+    }
+    
+    @Test
+    public void testImpliesSelf() {
+        final Permission userX = new MailManPermission("userNameX", MailManPermission.SEND_FROM);
+        final Permission self = new MailManPermission(MailManPermission.SELF_ACTION, MailManPermission.SEND_FROM);
+
+        Subject subject = new Subject(true,
+                Collections.singleton(new PrincipalImpl("userNameX")),
+                Collections.EMPTY_SET,
+                Collections.EMPTY_SET);
+        Subject.doAs(subject, new PrivilegedAction<Object>() {
+            @Override
+            public Object run() {
+                assertTrue(self.implies(userX));
+                return null;
+            }
+
+        });
+        assertFalse(self.implies(userX));
+    }
+
+    @Test
+    public void testImpliesSendMail() {
+        Permission sendMail1 = new MailManPermission("userNameX", MailManPermission.SEND_MAIL);
+        Permission sendMail2 = new MailManPermission("", MailManPermission.SEND_MAIL);
+        Permission sendMailFrom = new MailManPermission("userNameY", MailManPermission.SEND_FROM +
+                "," + MailManPermission.SEND_MAIL);
+        Permission userY = new MailManPermission("userNameY", MailManPermission.SEND_FROM);
+        assertTrue(sendMail1.implies(sendMail2));
+        assertTrue(sendMailFrom.implies(sendMail1));
+        assertFalse(sendMail1.implies(sendMailFrom));
+        assertTrue(sendMailFrom.implies(userY));
+    }
+
+    @Test
+    public void testGetActions() {
+        Permission sendMailFrom1 = new MailManPermission("userNameY", MailManPermission.SEND_FROM +
+                "," + MailManPermission.SEND_MAIL);
+        Permission sendMailFrom2 = new MailManPermission("userNameY", MailManPermission.SEND_MAIL +
+                "," + MailManPermission.SEND_FROM);
+
+        assertEquals(sendMailFrom1.getActions(), sendMailFrom2.getActions());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/LICENSE b/platform/platform.accountcontrolpanel/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.accountcontrolpanel/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE b/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform/platform.accountcontrolpanel/platform.accountcontrolpanel.core/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.


[20/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageDescription.java
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageDescription.java b/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageDescription.java
new file mode 100644
index 0000000..498dbbb
--- /dev/null
+++ b/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageDescription.java
@@ -0,0 +1,115 @@
+/*
+ * 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.language;
+
+import java.util.Iterator;
+import java.util.concurrent.locks.Lock;
+import org.apache.clerezza.rdf.core.Language;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.PlainLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.ontologies.LINGVOJ;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+/**
+ * An object of this class keeps information about a language.
+ *
+ * @author mir
+ */
+public class LanguageDescription {
+
+    private GraphNode resource;
+    private Language language;
+
+    LanguageDescription(GraphNode resource) {
+        this.resource = resource;
+        Literal iso1Literal = null;
+        TripleCollection configGraph = resource.getGraph();
+        if (configGraph instanceof LockableMGraph) {
+            LockableMGraph lockableConfigGraph = (LockableMGraph)configGraph;
+            Lock readLock = lockableConfigGraph.getLock().readLock();
+            readLock.lock();
+            try {
+                iso1Literal = (Literal) resource.getObjects(LINGVOJ.iso1).next();
+            } finally {
+                readLock.unlock();
+            }
+        } else {
+            iso1Literal = (Literal) resource.getObjects(LINGVOJ.iso1).next();
+        }
+        if (iso1Literal == null) {
+            throw new RuntimeException("No iso1 code for " +resource.getNode());
+        }
+        String iso1 = iso1Literal.getLexicalForm();
+        this.language = new Language(iso1);
+    }
+
+    /**
+     * Returns a <code>Language</code> object which represents the language
+     * described by this object.
+     * @return the described language
+     */
+    public Language getLanguage() {
+        return language;
+    }
+
+    /**
+     * Returns a graph node in the content graph which leads to further
+     * information about the language described by this object.
+     * The information are those provided by http://www.lingvoj.org/lingvoj.rdf.
+     * @return the graph node leading to further information about the described
+     *        language
+     */
+    public GraphNode getResource() {
+        return resource;
+    }
+
+    /**
+     * Returns the label of the language described by this object in the
+     * specified language, or null if no lable is available in that language
+     * @param lang the language in which the label should be.
+     * @return
+     */
+    public String getLabel(Language lang) {
+        Lock readLock = null;
+        TripleCollection configGraph = resource.getGraph();
+        if (configGraph instanceof LockableMGraph) {
+            LockableMGraph lockableConfigGraph = (LockableMGraph)configGraph;
+            readLock = lockableConfigGraph.getLock().readLock();
+            readLock.lock();
+        }
+        try {
+            Iterator<Resource> labels = resource.getObjects(RDFS.label);
+            while (labels.hasNext()) {
+                PlainLiteral label = (PlainLiteral) labels.next();
+                if (label.getLanguage().equals(lang)) {
+                    return label.getLexicalForm();
+                }
+            }
+            return null;
+        } finally {
+            if (readLock != null) {
+                readLock.unlock();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageService.java
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageService.java b/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageService.java
new file mode 100644
index 0000000..883a9c9
--- /dev/null
+++ b/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageService.java
@@ -0,0 +1,328 @@
+/*
+ * 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.language;
+
+import java.io.IOException;
+import java.lang.ref.SoftReference;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import org.apache.clerezza.platform.config.PlatformConfig;
+import org.apache.clerezza.platform.config.SystemConfig;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.Language;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.PlainLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.SecuredMGraph;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.core.serializedform.ParsingProvider;
+import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
+import org.apache.clerezza.rdf.ontologies.LINGVOJ;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.RdfList;
+
+/**
+ * This class provides a OSGi service for managing languages in the Clerezza
+ * platform.
+ * 
+ * @author mir
+ */
+@Component(immediate=true, enabled= true)
+@Service(LanguageService.class)
+public class LanguageService {    
+
+    @Reference
+    private TcManager tcManager;
+
+    /**
+     * this is linked to the system-graph, accessing requires respective
+     * permission
+     */
+    private List<Resource> languageList;
+    /**
+     * no permission on the system graph required to access this
+     */
+    private List<Resource> languageListCache;
+
+    private static final String PARSER_FILTER =
+            "(supportedFormat=" + SupportedFormat.RDF_XML +")";
+
+    @Reference(target=PARSER_FILTER)
+    private ParsingProvider parser;
+
+    @Reference(target = SystemConfig.SYSTEM_GRAPH_FILTER)
+    private MGraph securedSystemGraph;
+
+    @Reference(target = PlatformConfig.CONFIG_GRAPH_FILTER)
+    private MGraph securedConfigGraph;
+    
+    private SoftReference<Graph> softLingvojGraph = new SoftReference<Graph>(null);
+
+
+    private LockableMGraph getSystemGraph() {
+        return ((SecuredMGraph) securedSystemGraph).getUnsecuredMGraph();
+    }
+
+    private LockableMGraph getConfigGraph() {
+        return ((SecuredMGraph) securedConfigGraph).getUnsecuredMGraph();
+    }
+
+    /**
+     * Returns a <code>List</code> of <code>LanguageDescription</code>s which
+     * describe the languages which are supported by the platform. The first
+     * entry describes the default language of the platform.
+     * @return a list containing all language descriptions.
+     */
+    public List<LanguageDescription> getLanguages() {
+        List<LanguageDescription> langList = new ArrayList<LanguageDescription>();
+        Iterator<Resource> languages = languageListCache.iterator();
+        while (languages.hasNext()) {
+            UriRef language = (UriRef) languages.next();
+            langList.add(new LanguageDescription(new GraphNode(language, getConfigGraph())));
+        }
+        return langList;
+    }
+
+    /**
+     * Returns the <code>LanguageDescription</code> of the default language
+     * of the platform.
+     * @return the language description of the default language.
+     */
+    public LanguageDescription getDefaultLanguage() {
+        return new LanguageDescription(
+                new GraphNode(languageListCache.get(0), getConfigGraph()));
+    }
+
+    /**
+     * Returns a set containg all language uris which are in the
+     * <http://www.lingvoj.org/lingvoj> graph which is included in this bundle.
+     * @return a set containing all language uris. This uris can be used to 
+     * add the language to Clerezza over the addLanguage()-method in this class.
+     */
+    public Set<UriRef> getAllLanguages() {
+        Set<UriRef> result = new HashSet<UriRef>();
+        Graph lingvojGraph = getLingvojGraph();
+        Iterator<Triple> languages = lingvojGraph.filter(null, RDFS.isDefinedBy,
+                null);
+        while (languages.hasNext()) {
+            UriRef languageUri = (UriRef) languages.next().getSubject();
+            result.add(languageUri);
+        }
+        return result;
+    }
+
+    /**
+     * Returns a language uri of a language which has a label containing the
+     * specified languageName. The label itself is in the language specified through
+     * inLanguage. If inLanguage is null, then all labels of a language of searched.
+     * If no language was found in the <http://www.lingvoj.org/lingvoj>
+     * graph, then null is returned. The returned uri can be used to
+     * add the language to Clerezza over the addLanguage()-method in this class.
+     * @return a language uris
+     */
+    public UriRef getLanguage(String languageName, Language inLanguage) {
+        Graph lingvojGraph = getLingvojGraph();
+        Iterator<Triple> languages = lingvojGraph.filter(null, RDFS.isDefinedBy, null);
+        while (languages.hasNext()) {
+            GraphNode languageNode = new GraphNode((UriRef) languages.next().getSubject(), lingvojGraph);
+            Iterator<Resource> labels = languageNode.getObjects(RDFS.label);
+            while (labels.hasNext()) {
+                PlainLiteral label = (PlainLiteral) labels.next();
+                if (label.getLanguage().equals(inLanguage) || inLanguage == null) {
+                    if (label.getLexicalForm().contains(languageName)) {
+                        return (UriRef) languageNode.getNode();
+                    }
+                }
+            }
+        }
+        return null;
+    }
+    
+    /**
+     * Get the language as <code>GraphNode</code> specified through languageUri. 
+     * The languageUri has to be a <http://www.lingvoj.org/ontology#Lingvo>
+     * according to the graph <http://www.lingvoj.org/lingvoj> included in this
+     * bundle., e.g. "http://www.lingvoj.org/lang/de".
+     *
+     * @param languageUri The language uri which specifies the language 
+     */
+    public GraphNode getLanguageNode(NonLiteral langUri) {
+        Graph lingvojRdf = getLingvojGraph();
+        return new GraphNode(langUri, lingvojRdf);
+    }
+
+    /**
+     * Adds the language specified through languageUri to the Clerezza
+     * platform. The languageUri has to be a <http://www.lingvoj.org/ontology#Lingvo>
+     * according to the graph <http://www.lingvoj.org/lingvoj> included in this
+     * bundle., e.g. "http://www.lingvoj.org/lang/de" adds German.
+     * The uri is added to the system graph and its context to the config graph.
+     * The context added is the context provided by lingvoj.rdf.
+     * @param languageUri The language uri which specifies the language to be
+     *        added to the platform.
+     */
+    public void addLanguage(UriRef languageUri) {
+        if (!languageListCache.contains(languageUri)) {
+            LockableMGraph systemGraph = getSystemGraph();
+            Lock writeLock = systemGraph.getLock().writeLock();
+            writeLock.lock();
+            try {
+                if (languageList.add(languageUri)) {
+                    addToLanguageConfigGraph(languageUri);
+                }
+            } finally {
+                writeLock.unlock();
+            }
+            languageListCache.add(languageUri);
+        }
+    }
+
+    private void synchronizeContentGraph() {
+        for (Resource resource : languageListCache) {
+            addToLanguageConfigGraph((UriRef)resource);
+        }
+    }
+    /**
+     * Adds the language information of the language specified through
+     * languageUri to the config graph. The languageUri has to be of type 
+     * <http://www.lingvoj.org/ontology#Lingvo> according to the graph 
+     * <http://www.lingvoj.org/lingvoj> included in this
+     * bundle., e.g. "http://www.lingvoj.org/lang/de" adds German.
+     * 
+     * The added language will not be a platform language.
+     *
+     * @param languageUri
+     */
+    public void addToLanguageConfigGraph(NonLiteral languageUri) {
+        LockableMGraph configGraph = getConfigGraph();
+        Lock writeLock = configGraph.getLock().writeLock();
+        writeLock.lock();
+        try {
+            if (!configGraph.filter(languageUri, LINGVOJ.iso1, null).hasNext()) {
+                configGraph.addAll(getLanguageContext(languageUri));
+            }
+        } finally {
+            writeLock.unlock();
+        }
+    }
+
+    private Graph getLanguageContext(NonLiteral langUri) {
+        Graph lingvojRdf = getLingvojGraph();
+        GraphNode languageNode = new GraphNode(langUri, lingvojRdf);
+        return languageNode.getNodeContext();
+    }
+    
+    private Graph getLingvojGraph() {
+        Graph lingvojGraph = softLingvojGraph.get();
+        if (lingvojGraph != null) {
+            return lingvojGraph;
+        }
+        URL config = getClass().getResource("lingvoj.rdf");
+        if (config == null) {
+            throw new RuntimeException("no file found");
+        }
+        try {
+            MGraph lingvojMGraph = new SimpleMGraph();
+            parser.parse(lingvojMGraph, config.openStream(), SupportedFormat.RDF_XML, null);
+            lingvojGraph = lingvojMGraph.getGraph();
+            softLingvojGraph = new SoftReference<Graph>(lingvojGraph);
+            return lingvojGraph;
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    /**
+     * The activate method is called when SCR activates the component configuration.
+     * 
+     * @param componentContext
+     */
+    protected void activate(ComponentContext componentContext) {
+        LockableMGraph systemGraph = getSystemGraph();
+        NonLiteral listNode = getListNode(systemGraph);
+
+        Lock writeLock = systemGraph.getLock().writeLock();
+        writeLock.lock();
+        try {
+            // the constructor of RdfList might write to the graph! => requires a write lock
+            final RdfList rdfList = new RdfList(listNode, systemGraph);
+            languageList = Collections.synchronizedList(rdfList);
+            //access to languages should not require access to system graph,
+            //so copying the resources to an ArrayList
+            languageListCache = Collections.synchronizedList(
+                    new ArrayList<Resource>(rdfList));
+            if (languageListCache.size() == 0) {
+                addLanguage(new UriRef("http://www.lingvoj.org/lang/en"));
+            }
+            //this is to make sure the content graph contains the relevant data
+            synchronizeContentGraph();
+        } finally {
+            writeLock.unlock();
+        }
+    }
+
+    private NonLiteral getListNode(LockableMGraph systemGraph) {
+        NonLiteral instance = null;
+        Lock readLock = systemGraph.getLock().readLock();
+        readLock.lock();
+        try {
+            Iterator<Triple> instances = systemGraph.filter(null, RDF.type, PLATFORM.Instance);
+            if (!instances.hasNext()) {
+                throw new RuntimeException("No Platform:Instance in system graph.");
+            }
+            instance = instances.next().getSubject();
+            Iterator<Triple> langListIter = systemGraph.filter(instance,
+                    PLATFORM.languages, null);
+            if (langListIter.hasNext()) {
+                return (NonLiteral) langListIter.next().getObject();
+            }
+        } finally {
+            readLock.unlock();
+        }
+        BNode listNode = new BNode();
+        Lock writeLock = systemGraph.getLock().writeLock();
+        writeLock.lock();
+        try {
+            systemGraph.add(new TripleImpl(instance, PLATFORM.languages, listNode));
+        } finally {
+            writeLock.unlock();
+        }
+        return listNode;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageWidget.java
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageWidget.java b/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageWidget.java
new file mode 100644
index 0000000..a403a08
--- /dev/null
+++ b/platform/language/platform.language.core/src/main/java/org/apache/clerezza/platform/language/LanguageWidget.java
@@ -0,0 +1,185 @@
+/*
+ * 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.language;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.platform.Constants;
+import org.apache.clerezza.platform.config.PlatformConfig;
+
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.platform.language.ontologies.LANGUAGE;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.UserContextProvider;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.RdfList;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.clerezza.web.fileserver.BundlePathNode;
+import org.apache.clerezza.web.fileserver.FileServer;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.framework.Bundle;
+import org.wymiwyg.commons.util.dirbrowser.PathNode;
+
+/**
+ * Use the LanguageWidget service to store an RDF list of
+ * languages in a triple collection and retrieve the root node of the list. The widget
+ * can be rendered by using the render method. Via javascript function
+ * LanguageList.getLanguage() the currently selected language can be retrieved.
+ *
+ * @author tio
+ */
+@Component(enabled=true, immediate=true)
+@Services({
+    @Service(Object.class),
+    @Service(UserContextProvider.class)
+})
+@Property(name = "javax.ws.rs", boolValue = true)
+
+@Path("/language-widget")
+public class LanguageWidget implements UserContextProvider {
+
+    private FileServer fileServer;
+
+    @Reference
+    private TcManager tcManager;
+
+    @Reference
+    private PlatformConfig platformConfig;
+
+    @Reference
+    private RenderletManager renderletManager;
+
+    @Reference
+    private LanguageService languageService;
+    
+    protected void activate(ComponentContext context) throws IOException, URISyntaxException {
+        Bundle bundle = context.getBundleContext().getBundle();
+        URL resourceDir = getClass().getResource("staticweb");
+        PathNode pathNode = new BundlePathNode(bundle, resourceDir.getPath());
+
+        fileServer = new FileServer(pathNode);
+
+        URL template = getClass().getResource("language-list.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(template.toURI().toString()),
+                LANGUAGE.LanguageList, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+    }
+
+    private LockableMGraph getConfigGraph() {
+        return tcManager.getMGraph(Constants.CONFIG_GRAPH_URI);
+    }
+
+    /**
+     *
+     * @param node  The graph of the specified GraphNode will not be locked, neither for reading nor writing.
+     *        It is the responsibility of the calling function to set the write lock, if necessary.
+     * @return
+     */
+    @Override
+    public GraphNode addUserContext(final GraphNode node) {    
+        final NonLiteral platformInstance = AccessController.doPrivileged(
+            new PrivilegedAction<NonLiteral>() {
+                @Override
+                public NonLiteral run() {
+                    return (NonLiteral) platformConfig.getPlatformInstance().getNode();
+                }
+            });
+        try {
+            return addLanguages(node, platformInstance, languageService.getLanguages(), false);
+             
+        } catch (AccessControlException ex) {
+            return AccessController.doPrivileged(
+                new PrivilegedAction<GraphNode>() {
+                    @Override
+                    public GraphNode run() {
+                        return addLanguages(node, platformInstance, languageService.getLanguages(), true);
+                    }
+                });
+        }        
+    }
+
+    private GraphNode addLanguages(GraphNode node, NonLiteral platformInstance, List<LanguageDescription> languages,
+            boolean copyToNode) {
+        TripleCollection graph = node.getGraph();
+        BNode listNode = new BNode();        
+        RdfList list = new RdfList(listNode, graph);
+        LockableMGraph configGraph = getConfigGraph();
+        Lock readLock = configGraph.getLock().readLock();
+        for (LanguageDescription languageDescription : languages) {
+            NonLiteral languageUri = (NonLiteral) languageDescription.getResource().getNode();
+            list.add(languageUri);
+            if (copyToNode) {
+                readLock.lock();
+                try {
+                    graph.addAll(new GraphNode(languageUri, configGraph).getNodeContext());
+                } finally {
+                    readLock.unlock();
+                }
+            }
+        }
+        node.addProperty(PLATFORM.instance, platformInstance);
+        graph.add(new TripleImpl(platformInstance, RDF.type, PLATFORM.Instance));
+        graph.add(new TripleImpl(platformInstance, PLATFORM.languages, listNode));
+        graph.add(new TripleImpl(listNode, RDF.type, LANGUAGE.LanguageList));
+        if (!copyToNode) {
+            node = new GraphNode(node.getNode(), new UnionMGraph(graph, configGraph));
+        }
+        return node;
+    }
+
+    /**
+     * Returns a PathNode of a static file from the staticweb folder.
+     *
+     * @param path specifies the path param of a URI
+     *
+     * @return {@link PathNode}
+     */
+    @GET
+    @Path("{path:.+}")
+    public PathNode getStaticFile(@PathParam("path") String path) {
+        return fileServer.getNode(path);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/language-list.ssp
----------------------------------------------------------------------
diff --git a/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/language-list.ssp b/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/language-list.ssp
new file mode 100644
index 0000000..362009b
--- /dev/null
+++ b/platform/language/platform.language.core/src/main/resources/org/apache/clerezza/platform/language/language-list.ssp
@@ -0,0 +1,50 @@
+/*
+ *
+ * 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 org.apache.clerezza.rdf.scala.utils.RichGraphNode
+def lingvoj(s: Any) = new UriRef("http://www.lingvoj.org/ontology#"+s)
+def rdfs(s: Any) = new UriRef("http://www.w3.org/2000/01/rdf-schema#"+s)
+def getLabel(language:Language, node:RichGraphNode) : String = {
+	val matchingLabels = for (label <- node/rdfs("label");
+		val labelLiteral = label.getNode.asInstanceOf[PlainLiteral];
+		if (labelLiteral.getLanguage.equals(language))
+	) yield {
+		label*
+	}
+	if (matchingLabels.length == 0) {
+		"no label"
+	} else {
+		matchingLabels.apply(0)
+	}
+}
+resultDocModifier.addScriptReference("/language-widget/scripts/language-list.js")
+val defaultLanguage:Language = new Language(res%!!(0)/lingvoj("iso1")*)
+
+<select name="availablelanguages" id="availablelanguages">
+	<option value={defaultLanguage.toString} selected="selected">{getLabel(defaultLanguage, res%!!(0))}</option>
+	{
+		for(language <- res!!;
+			val iso1 = language/lingvoj("iso1")*;
+			if (!iso1.equals(defaultLanguage.toString))) yield {
+			<option value={iso1}>{getLabel(defaultLanguage,language)}</option>
+		}
+	}
+</select>


[25/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone-min.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone-min.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone-min.js
new file mode 100644
index 0000000..3541019
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone-min.js
@@ -0,0 +1,4 @@
+(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.0.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o<u;o++){t=a[o];if(n=this._events[t]){this._events[t]=r=[
 ];if(e||i){for(c=0,f=n.length;c<f;c++){s=n[c];if(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context){r.push(s)}}}if(!r.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)c(i,e);if(r)c(r,arguments);return this},stopListening:function(t,e,i){var r=this._listeners;if(!r)return this;var s=!e&&!i;if(typeof e==="object")i=this;if(t)(r={})[t._listenerId]=t;for(var n in r){r[n].off(e,i,this);if(s)delete this._listeners[n]}return this}};var u=/\s+/;var l=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(u.test(i)){var n=i.split(u);for(var a=0,h=n.length;a<h;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var c=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],h=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;ca
 se 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,h);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e)}};var f={listenTo:"on",listenToOnce:"once"};h.each(f,function(t,e){o[e]=function(e,i,r){var s=this._listeners||(this._listeners={});var n=e._listenerId||(e._listenerId=h.uniqueId("l"));s[n]=e;if(typeof i==="object")r=this;e[t](i,r,this);return this}});o.bind=o.on;o.unbind=o.off;h.extend(a,o);var d=a.Model=function(t,e){var i;var r=t||{};e||(e={});this.cid=h.uniqueId("c");this.attributes={};h.extend(this,h.pick(e,p));if(e.parse)r=this.parse(r,e)||{};if(i=h.result(this,"defaults")){r=h.defaults({},r,i)}this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};var p=["url","urlRoot","collection"];h.extend(d.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return h.clone(this.attributes)},syn
 c:function(){return a.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return h.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,i){var r,s,n,a,o,u,l,c;if(t==null)return this;if(typeof t==="object"){s=t;i=e}else{(s={})[t]=e}i||(i={});if(!this._validate(s,i))return false;n=i.unset;o=i.silent;a=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=h.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in s)this.id=s[this.idAttribute];for(r in s){e=s[r];if(!h.isEqual(c[r],e))a.push(r);if(!h.isEqual(l[r],e)){this.changed[r]=e}else{delete this.changed[r]}n?delete c[r]:c[r]=e}if(!o){if(a.length)this._pending=true;for(var f=0,d=a.length;f<d;f++){this.trigger("change:"+a[f],this,c[a[f]],i)}}if(u)return this;if(!o){while(this._pending){this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function
 (t,e){return this.set(t,void 0,h.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,h.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!h.isEmpty(this.changed);return h.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?h.clone(this.changed):false;var e,i=false;var r=this._changing?this._previousAttributes:this.attributes;for(var s in t){if(h.isEqual(r[s],e=t[s]))continue;(i||(i={}))[s]=e}return i},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var i=t.success;t.success=function(r){if(!e.set(e.parse(r,t),t))return false;if(i)i(e,r,t);e.trigger("sync",e,r,t)};R(this,t);return this.sync("read",this,t)},save:function(t,e,i){var r,s,n,a=this.attributes;if(t==null||typ
 eof t==="object"){r=t;i=e}else{(r={})[t]=e}if(r&&(!i||!i.wait)&&!this.set(r,i))return false;i=h.extend({validate:true},i);if(!this._validate(r,i))return false;if(r&&i.wait){this.attributes=h.extend({},a,r)}if(i.parse===void 0)i.parse=true;var o=this;var u=i.success;i.success=function(t){o.attributes=a;var e=o.parse(t,i);if(i.wait)e=h.extend(r||{},e);if(h.isObject(e)&&!o.set(e,i)){return false}if(u)u(o,t,i);o.trigger("sync",o,t,i)};R(this,i);s=this.isNew()?"create":i.patch?"patch":"update";if(s==="patch")i.attrs=r;n=this.sync(s,this,i);if(r&&i.wait)this.attributes=a;return n},destroy:function(t){t=t?h.clone(t):{};var e=this;var i=t.success;var r=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(s){if(t.wait||e.isNew())r();if(i)i(e,s,t);if(!e.isNew())e.trigger("sync",e,s,t)};if(this.isNew()){t.success();return false}R(this,t);var s=this.sync("delete",this,t);if(!t.wait)r();return s},url:function(){var t=h.result(this,"urlRoot")||h.result(this.collection,"url")||U();
 if(this.isNew())return t;return t+(t.charAt(t.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(t){return this._validate({},h.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=h.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;if(!i)return true;this.trigger("invalid",this,i,h.extend(e||{},{validationError:i}));return false}});var v=["keys","values","pairs","invert","pick","omit"];h.each(v,function(t){d.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.attributes);return h[t].apply(h,e)}});var g=a.Collection=function(t,e){e||(e={});if(e.url)this.url=e.url;if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,h.extend({silent:true},e))};var m=
 {add:true,remove:true,merge:true};var y={add:true,merge:false,remove:false};h.extend(g.prototype,o,{model:d,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return a.sync.apply(this,arguments)},add:function(t,e){return this.set(t,h.defaults(e||{},y))},remove:function(t,e){t=h.isArray(t)?t.slice():[t];e||(e={});var i,r,s,n;for(i=0,r=t.length;i<r;i++){n=this.get(t[i]);if(!n)continue;delete this._byId[n.id];delete this._byId[n.cid];s=this.indexOf(n);this.models.splice(s,1);this.length--;if(!e.silent){e.index=s;n.trigger("remove",n,this,e)}this._removeReference(n)}return this},set:function(t,e){e=h.defaults(e||{},m);if(e.parse)t=this.parse(t,e);if(!h.isArray(t))t=t?[t]:[];var i,s,a,o,u,l;var c=e.at;var f=this.comparator&&c==null&&e.sort!==false;var d=h.isString(this.comparator)?this.comparator:null;var p=[],v=[],g={};for(i=0,s=t.length;i<s;i++){if(!(a=this._prepareModel(t[i],e)))continue;if(u=this.get(a)){if(e.remove)g[u.cid]=t
 rue;if(e.merge){u.set(a.attributes,e);if(f&&!l&&u.hasChanged(d))l=true}}else if(e.add){p.push(a);a.on("all",this._onModelEvent,this);this._byId[a.cid]=a;if(a.id!=null)this._byId[a.id]=a}}if(e.remove){for(i=0,s=this.length;i<s;++i){if(!g[(a=this.models[i]).cid])v.push(a)}if(v.length)this.remove(v,e)}if(p.length){if(f)l=true;this.length+=p.length;if(c!=null){n.apply(this.models,[c,0].concat(p))}else{r.apply(this.models,p)}}if(l)this.sort({silent:true});if(e.silent)return this;for(i=0,s=p.length;i<s;i++){(a=p[i]).trigger("add",a,this,e)}if(l)this.trigger("sort",this,e);return this},reset:function(t,e){e||(e={});for(var i=0,r=this.models.length;i<r;i++){this._removeReference(this.models[i])}e.previousModels=this.models;this._reset();this.add(t,h.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return this},push:function(t,e){t=this._prepareModel(t,e);this.add(t,h.extend({at:this.length},e));return t},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return 
 e},unshift:function(t,e){t=this._prepareModel(t,e);this.add(t,h.extend({at:0},e));return t},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(t,e){return this.models.slice(t,e)},get:function(t){if(t==null)return void 0;return this._byId[t.id!=null?t.id:t.cid||t]},at:function(t){return this.models[t]},where:function(t,e){if(h.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(h.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(h.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},sortedIndex:function(t,e,i){e||(e=this.comparator);var r=h.isFunction(e)?e:function(t){return t.get(e)};return h.sortedIndex(this.models,t,r,
 i)},pluck:function(t){return h.invoke(this.models,"get",t)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var i=this;t.success=function(r){var s=t.reset?"reset":"set";i[s](r,t);if(e)e(i,r,t);i.trigger("sync",i,r,t)};R(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?h.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var i=this;var r=e.success;e.success=function(s){if(e.wait)i.add(t,e);if(r)r(t,s,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof d){if(!t.collection)t.collection=this;return t}e||(e={});e.collection=this;var i=new this.model(t,e);if(!i._validate(t,e)){this.trigger("invalid",this,t,e);return false}return i},_removeReference:function(t){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,thi
 s)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];h.each(_,function(t){g.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.models);return h[t].apply(h,e)}});var w=["groupBy","countBy","sortBy"];h.each(w,function(t){g.prototype[t]=function(e,i){var r=h.isFunction(e)?e:function(t){return t.get(e)};return h[t](this.models,r,i)}});var b=a.View=function(t){this.cid=h.uniqueId("view");this._configure(t||{});this._ensureElement();
 this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];h.extend(b.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,e){if(this.$el)this.undelegateEvents();this.$el=t instanceof a.$?t:a.$(t);this.el=this.$el[0];if(e!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=h.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(!h.isFunction(i))i=this[t[e]];if(!i)continue;var r=e.match(x);var s=r[1],n=r[2];i=h.bind(i,this);s+=".delegateEvents"+this.cid;if(n===""){this.$el.on(s,i)}else{this.$el.on(s,n,i)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_configure:function(t){if(this.options)t=h.extend({},h.resu
 lt(this,"options"),t);h.extend(this,h.pick(t,E));this.options=t},_ensureElement:function(){if(!this.el){var t=h.extend({},h.result(this,"attributes"));if(this.id)t.id=h.result(this,"id");if(this.className)t["class"]=h.result(this,"className");var e=a.$("<"+h.result(this,"tagName")+">").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=k[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)re
 turn n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var S=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var $=/\((.*?)\)/g;var T=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(S.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history
 .trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace($,"(?:$1)?").replace(T,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var P=/^\/+|\/+$/g;var O=/msie [\w.]+/;var C=/\/$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._w
 antsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.substr(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({},{root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=O.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(P,"/");if(r&&this._wantsHashChange){this.iframe=a.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;this.navigate(e)}if(this._hasPushState){a.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!r){a.$(window).on("hashchange",this.ch
 eckUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=e;var s=this.location;var n=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!n){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._wantsPushState&&this._hasPushState&&n&&s.hash){this.fragment=this.getHash().replace(N,"");this.history.replaceState({},document.title,this.root+this.fragment+s.search)}if(!this.options.silent)return this.loadUrl()},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);I.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(thi
 s.iframe)this.navigate(e);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(t){var e=this.fragment=this.getFragment(t);var i=h.any(this.handlers,function(t){if(t.route.test(e)){t.callback(e);return true}});return i},navigate:function(t,e){if(!I.started)return false;if(!e||e===true)e={trigger:e};t=this.getFragment(t||"");if(this.fragment===t)return;this.fragment=t;var i=this.root+t;if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});a.history=new I;var j=function(t,e){var i=this;var r;if(t&&h.has(t,"construc
 tor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}h.extend(r,i,e);var s=function(){this.constructor=r};s.prototype=i.prototype;r.prototype=new s;if(t)h.extend(r.prototype,t);r.__super__=i.prototype;return r};d.extend=g.extend=S.extend=b.extend=I.extend=j;var U=function(){throw new Error('A "url" property or function must be specified')};var R=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}}}).call(this);
+/*
+//@ sourceMappingURL=backbone-min.map
+*/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone.stickit.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone.stickit.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone.stickit.js
new file mode 100644
index 0000000..aa5112b
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/backbone.stickit.js
@@ -0,0 +1,468 @@
+//
+// backbone.stickit - v0.6.3
+// The MIT License
+// Copyright (c) 2012 The New York Times, CMS Group, Matthew DeLambo <de...@gmail.com> 
+//
+(function($) {
+
+  // Backbone.Stickit Namespace
+  // --------------------------
+
+  Backbone.Stickit = {
+
+    _handlers: [],
+
+    addHandler: function(handlers) {
+      // Fill-in default values.
+      handlers = _.map(_.flatten([handlers]), function(handler) {
+        return _.extend({
+          updateModel: true,
+          updateView: true,
+          updateMethod: 'text'
+        }, handler);
+      });
+      this._handlers = this._handlers.concat(handlers);
+    }
+  };
+
+  // Backbone.View Mixins
+  // --------------------
+
+  _.extend(Backbone.View.prototype, {
+
+    // Collection of model event bindings.
+    //   [{model,event,fn}, ...]
+    _modelBindings: null,
+
+    // Unbind the model and event bindings from `this._modelBindings` and
+    // `this.$el`. If the optional `model` parameter is defined, then only
+    // delete bindings for the given `model` and its corresponding view events.
+    unstickit: function(model) {
+      _.each(this._modelBindings, _.bind(function(binding, i) {
+        if (model && binding.model !== model) return false;
+        binding.model.off(binding.event, binding.fn);
+        delete this._modelBindings[i];
+      }, this));
+      this._modelBindings = _.compact(this._modelBindings);
+
+      this.$el.off('.stickit' + (model ? '.' + model.cid : ''));
+    },
+
+    // Using `this.bindings` configuration or the `optionalBindingsConfig`, binds `this.model`
+    // or the `optionalModel` to elements in the view.
+    stickit: function(optionalModel, optionalBindingsConfig) {
+      var self = this,
+        model = optionalModel || this.model,
+        namespace = '.stickit.' + model.cid,
+        bindings = optionalBindingsConfig || this.bindings || {};
+
+      this._modelBindings || (this._modelBindings = []);
+      this.unstickit(model);
+
+      // Iterate through the selectors in the bindings configuration and configure
+      // the various options for each field.
+      _.each(_.keys(bindings), function(selector) {
+        var $el, options, modelAttr, config,
+          binding = bindings[selector] || {},
+          bindKey = _.uniqueId();
+
+        // Support ':el' selector - special case selector for the view managed delegate.
+        if (selector != ':el') $el = self.$(selector);
+        else {
+          $el = self.$el;
+          selector = '';
+        }
+
+        // Fail fast if the selector didn't match an element.
+        if (!$el.length) return;
+
+        // Allow shorthand setting of model attributes - `'selector':'observe'`.
+        if (_.isString(binding)) binding = {observe:binding};
+
+        config = getConfiguration($el, binding);
+
+        modelAttr = config.observe;
+
+        // Create the model set options with a unique `bindKey` so that we
+        // can avoid double-binding in the `change:attribute` event handler.
+        options = _.extend({bindKey:bindKey}, config.setOptions || {});
+
+        initializeAttributes(self, $el, config, model, modelAttr);
+
+        initializeVisible(self, $el, config, model, modelAttr);
+
+        if (modelAttr) {
+          // Setup one-way, form element to model, bindings.
+          _.each(config.events || [], function(type) {
+            var event = type + namespace;
+            var method = function(event) {
+              var val = config.getVal.call(self, $el, event, config);
+              // Don't update the model if false is returned from the `updateModel` configuration.
+              if (evaluateBoolean(self, config.updateModel, val, config))
+                setAttr(model, modelAttr, val, options, self, config);
+            };
+            if (selector === '') self.$el.on(event, method);
+            else self.$el.on(event, selector, method);
+          });
+
+          // Setup a `change:modelAttr` observer to keep the view element in sync.
+          // `modelAttr` may be an array of attributes or a single string value.
+          _.each(_.flatten([modelAttr]), function(attr) {
+            observeModelEvent(model, self, 'change:'+attr, function(model, val, options) {
+              if (options == null || options.bindKey != bindKey)
+                updateViewBindEl(self, $el, config, getAttr(model, modelAttr, config, self), model);
+            });
+          });
+
+          updateViewBindEl(self, $el, config, getAttr(model, modelAttr, config, self), model, true);
+        }
+
+        // After each binding is setup, call the `initialize` callback.
+        applyViewFn(self, config.initialize, $el, model, config);
+      });
+
+      // Wrap `view.remove` to unbind stickit model and dom events.
+      this.remove = _.wrap(this.remove, function(oldRemove) {
+        self.unstickit();
+        if (oldRemove) oldRemove.call(self);
+      });
+    }
+  });
+
+  // Helpers
+  // -------
+
+  // Evaluates the given `path` (in object/dot-notation) relative to the given
+  // `obj`. If the path is null/undefined, then the given `obj` is returned.
+  var evaluatePath = function(obj, path) {
+    var parts = (path || '').split('.');
+    var result = _.reduce(parts, function(memo, i) { return memo[i]; }, obj);
+    return result == null ? obj : result;
+  };
+
+  // If the given `fn` is a string, then view[fn] is called, otherwise it is
+  // a function that should be executed.
+  var applyViewFn = function(view, fn) {
+    if (fn) return (_.isString(fn) ? view[fn] : fn).apply(view, _.toArray(arguments).slice(2));
+  };
+
+  var getSelectedOption = function($select) { return $select.find('option').not(function(){ return !this.selected; }); };
+
+  // Given a function, string (view function reference), or a boolean
+  // value, returns the truthy result. Any other types evaluate as false.
+  var evaluateBoolean = function(view, reference) {
+    if (_.isBoolean(reference)) return reference;
+    else if (_.isFunction(reference) || _.isString(reference))
+      return applyViewFn.apply(this, _.toArray(arguments));
+    return false;
+  };
+
+  // Setup a model event binding with the given function, and track the event
+  // in the view's _modelBindings.
+  var observeModelEvent = function(model, view, event, fn) {
+    model.on(event, fn, view);
+    view._modelBindings.push({model:model, event:event, fn:fn});
+  };
+
+  // Prepares the given `val`ue and sets it into the `model`.
+  var setAttr = function(model, attr, val, options, context, config) {
+    if (config.onSet) val = applyViewFn(context, config.onSet, val, config);
+    model.set(attr, val, options);
+  };
+
+  // Returns the given `attr`'s value from the `model`, escaping and
+  // formatting if necessary. If `attr` is an array, then an array of
+  // respective values will be returned.
+  var getAttr = function(model, attr, config, context) {
+    var val, retrieveVal = function(field) {
+      var retrieved = config.escape ? model.escape(field) : model.get(field);
+      return _.isUndefined(retrieved) ? '' : retrieved;
+    };
+    val = _.isArray(attr) ? _.map(attr, retrieveVal) : retrieveVal(attr);
+    return config.onGet ? applyViewFn(context, config.onGet, val, config) : val;
+  };
+
+  // Find handlers in `Backbone.Stickit._handlers` with selectors that match
+  // `$el` and generate a configuration by mixing them in the order that they
+  // were found with the with the givne `binding`.
+  var getConfiguration = function($el, binding) {
+    var handlers = [{
+      updateModel: false,
+      updateView: true,
+      updateMethod: 'text',
+      update: function($el, val, m, opts) { $el[opts.updateMethod](val); },
+      getVal: function($el, e, opts) { return $el[opts.updateMethod](); }
+    }];
+    _.each(Backbone.Stickit._handlers, function(handler) {
+      if ($el.is(handler.selector)) handlers.push(handler);
+    });
+    handlers.push(binding);
+    var config = _.extend.apply(_, handlers);
+    delete config.selector;
+    return config;
+  };
+
+  // Setup the attributes configuration - a list that maps an attribute or
+  // property `name`, to an `observe`d model attribute, using an optional
+  // `onGet` formatter.
+  //
+  //     attributes: [{
+  //       name: 'attributeOrPropertyName',
+  //       observe: 'modelAttrName'
+  //       onGet: function(modelAttrVal, modelAttrName) { ... }
+  //     }, ...]
+  //
+  var initializeAttributes = function(view, $el, config, model, modelAttr) {
+    var props = ['autofocus', 'autoplay', 'async', 'checked', 'controls', 'defer', 'disabled', 'hidden', 'loop', 'multiple', 'open', 'readonly', 'required', 'scoped', 'selected'];
+
+    _.each(config.attributes || [], function(attrConfig) {
+      var lastClass = '',
+        observed = attrConfig.observe || (attrConfig.observe = modelAttr),
+        updateAttr = function() {
+          var updateType = _.indexOf(props, attrConfig.name, true) > -1 ? 'prop' : 'attr',
+            val = getAttr(model, observed, attrConfig, view);
+          // If it is a class then we need to remove the last value and add the new.
+          if (attrConfig.name == 'class') {
+            $el.removeClass(lastClass).addClass(val);
+            lastClass = val;
+          }
+          else $el[updateType](attrConfig.name, val);
+        };
+      _.each(_.flatten([observed]), function(attr) {
+        observeModelEvent(model, view, 'change:' + attr, updateAttr);
+      });
+      updateAttr();
+    });
+  };
+
+  // If `visible` is configured, then the view element will be shown/hidden
+  // based on the truthiness of the modelattr's value or the result of the
+  // given callback. If a `visibleFn` is also supplied, then that callback
+  // will be executed to manually handle showing/hiding the view element.
+  //
+  //     observe: 'isRight',
+  //     visible: true, // or function(val, options) {}
+  //     visibleFn: function($el, isVisible, options) {} // optional handler
+  //
+  var initializeVisible = function(view, $el, config, model, modelAttr) {
+    if (config.visible == null) return;
+    var visibleCb = function() {
+      var visible = config.visible,
+          visibleFn = config.visibleFn,
+          val = getAttr(model, modelAttr, config, view),
+          isVisible = !!val;
+      // If `visible` is a function then it should return a boolean result to show/hide.
+      if (_.isFunction(visible) || _.isString(visible)) isVisible = applyViewFn(view, visible, val, config);
+      // Either use the custom `visibleFn`, if provided, or execute the standard show/hide.
+      if (visibleFn) applyViewFn(view, visibleFn, $el, isVisible, config);
+      else {
+        if (isVisible) $el.show();
+        else $el.hide();
+      }
+    };
+    _.each(_.flatten([modelAttr]), function(attr) {
+      observeModelEvent(model, view, 'change:' + attr, visibleCb);
+    });
+    visibleCb();
+  };
+
+  // Update the value of `$el` using the given configuration and trigger the
+  // `afterUpdate` callback. This action may be blocked by `config.updateView`.
+  //
+  //     update: function($el, val, model, options) {},  // handler for updating
+  //     updateView: true, // defaults to true
+  //     afterUpdate: function($el, val, options) {} // optional callback
+  //
+  var updateViewBindEl = function(view, $el, config, val, model, isInitializing) {
+    if (!evaluateBoolean(view, config.updateView, val, config)) return;
+    config.update.call(view, $el, val, model, config);
+    if (!isInitializing) applyViewFn(view, config.afterUpdate, $el, val, config);
+  };
+
+  // Default Handlers
+  // ----------------
+
+  Backbone.Stickit.addHandler([{
+    selector: '[contenteditable="true"]',
+    updateMethod: 'html',
+    events: ['keyup', 'change', 'paste', 'cut']
+  }, {
+    selector: 'input',
+    events: ['keyup', 'change', 'paste', 'cut'],
+    update: function($el, val) { $el.val(val); },
+    getVal: function($el) {
+      var val = $el.val();
+      if ($el.is('[type="number"]')) return val == null ? val : Number(val);
+      else return val;
+    }
+  }, {
+    selector: 'textarea',
+    events: ['keyup', 'change', 'paste', 'cut'],
+    update: function($el, val) { $el.val(val); },
+    getVal: function($el) { return $el.val(); }
+  }, {
+    selector: 'input[type="radio"]',
+    events: ['change'],
+    update: function($el, val) {
+      $el.filter('[value="'+val+'"]').prop('checked', true);
+    },
+    getVal: function($el) {
+      return $el.filter(':checked').val();
+    }
+  }, {
+    selector: 'input[type="checkbox"]',
+    events: ['change'],
+    update: function($el, val, model, options) {
+      if ($el.length > 1) {
+        // There are multiple checkboxes so we need to go through them and check
+        // any that have value attributes that match what's in the array of `val`s.
+        val || (val = []);
+        _.each($el, function(el) {
+          if (_.indexOf(val, $(el).val()) > -1) $(el).prop('checked', true);
+          else $(el).prop('checked', false);
+        });
+      } else {
+        if (_.isBoolean(val)) $el.prop('checked', val);
+        else $el.prop('checked', val == $el.val());
+      }
+    },
+    getVal: function($el) {
+      var val;
+      if ($el.length > 1) {
+        val = _.reduce($el, function(memo, el) {
+          if ($(el).prop('checked')) memo.push($(el).val());
+          return memo;
+        }, []);
+      } else {
+        val = $el.prop('checked');
+        // If the checkbox has a value attribute defined, then
+        // use that value. Most browsers use "on" as a default.
+        var boxval = $el.val();
+        if (boxval != 'on' && boxval != null) {
+          if (val) val = $el.val();
+          else val = null;
+        }
+      }
+      return val;
+    }
+  }, {
+    selector: 'select',
+    events: ['change'],
+    update: function($el, val, model, options) {
+      var optList,
+        selectConfig = options.selectOptions,
+        list = selectConfig && selectConfig.collection || undefined,
+        isMultiple = $el.prop('multiple');
+
+      // If there are no `selectOptions` then we assume that the `<select>`
+      // is pre-rendered and that we need to generate the collection.
+      if (!selectConfig) {
+        selectConfig = {};
+        var getList = function($el) {
+          return $el.find('option').map(function() {
+            return {value:this.value, label:this.text};
+          }).get();
+        };
+        if ($el.find('optgroup').length) {
+          list = {opt_labels:[]};
+          _.each($el.find('optgroup'), function(el) {
+            var label = $(el).attr('label');
+            list.opt_labels.push(label);
+            list[label] = getList($(el));
+          });
+        } else {
+          list = getList($el);
+        }
+      }
+
+      // Fill in default label and path values.
+      selectConfig.valuePath = selectConfig.valuePath || 'value';
+      selectConfig.labelPath = selectConfig.labelPath || 'label';
+
+      var addSelectOptions = function(optList, $el, fieldVal) {
+        // Add a flag for default option at the beginning of the list.
+        if (selectConfig.defaultOption) {
+          optList = _.clone(optList);
+          optList.unshift('__default__');
+        }
+        _.each(optList, function(obj) {
+          var option = $('<option/>'), optionVal = obj;
+
+          var fillOption = function(text, val) {
+            option.text(text);
+            optionVal = val;
+            // Save the option value as data so that we can reference it later.
+            option.data('stickit_bind_val', optionVal);
+            if (!_.isArray(optionVal) && !_.isObject(optionVal)) option.val(optionVal);
+          };
+
+          if (obj === '__default__')
+            fillOption(selectConfig.defaultOption.label, selectConfig.defaultOption.value);
+          else
+            fillOption(evaluatePath(obj, selectConfig.labelPath), evaluatePath(obj, selectConfig.valuePath));
+
+          // Determine if this option is selected.
+          if (!isMultiple && optionVal != null && fieldVal != null && optionVal == fieldVal || (_.isObject(fieldVal) && _.isEqual(optionVal, fieldVal)))
+            option.prop('selected', true);
+          else if (isMultiple && _.isArray(fieldVal)) {
+            _.each(fieldVal, function(val) {
+              if (_.isObject(val)) val = evaluatePath(val, selectConfig.valuePath);
+              if (val == optionVal || (_.isObject(val) && _.isEqual(optionVal, val)))
+                option.prop('selected', true);
+            });
+          }
+
+          $el.append(option);
+        });
+      };
+
+      $el.html('');
+
+      // The `list` configuration is a function that returns the options list or a string
+      // which represents the path to the list relative to `window` or the view/`this`.
+      var evaluate = function(view, list) {
+        var context = window;
+        if (list.indexOf('this.') === 0) context = view;
+        list = list.replace(/^[a-z]*\.(.+)$/, '$1');
+        return evaluatePath(context, list);
+      };
+      if (_.isString(list)) optList = evaluate(this, list);
+      else if (_.isFunction(list)) optList = applyViewFn(this, list, $el, options);
+      else optList = list;
+
+      // Support Backbone.Collection and deserialize.
+      if (optList instanceof Backbone.Collection) optList = optList.toJSON();
+
+      if (_.isArray(optList)) {
+        addSelectOptions(optList, $el, val);
+      } else {
+        // If the optList is an object, then it should be used to define an optgroup. An
+        // optgroup object configuration looks like the following:
+        //
+        //     {
+        //       'opt_labels': ['Looney Tunes', 'Three Stooges'],
+        //       'Looney Tunes': [{id: 1, name: 'Bugs Bunny'}, {id: 2, name: 'Donald Duck'}],
+        //       'Three Stooges': [{id: 3, name : 'moe'}, {id: 4, name : 'larry'}, {id: 5, name : 'curly'}]
+        //     }
+        //
+        _.each(optList.opt_labels, function(label) {
+          var $group = $('<optgroup/>').attr('label', label);
+          addSelectOptions(optList[label], $group, val);
+          $el.append($group);
+        });
+      }
+    },
+    getVal: function($el) {
+      var val;
+      if ($el.prop('multiple')) {
+        val = $(getSelectedOption($el).map(function() {
+          return $(this).data('stickit_bind_val');
+        })).get();
+      } else {
+        val = getSelectedOption($el).data('stickit_bind_val');
+      }
+      return val;
+    }
+  }]);
+
+})(window.jQuery || window.Zepto);

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/etch.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/etch.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/etch.js
new file mode 100644
index 0000000..a0402e9
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/etch.js
@@ -0,0 +1,366 @@
+(function() {
+  'use strict';
+    
+  var models = {},
+    views = {},
+    collections = {},
+    etch = {};
+	
+  // versioning as per semver.org
+  etch.VERSION = '0.6.2';
+
+  etch.config = {
+    // selector to specify editable elements   
+    selector: '.editable',
+      
+    // Named sets of buttons to be specified on the editable element
+    // in the markup as "data-button-class"   
+    buttonClasses: {
+      'default': ['save'],
+      'all': ['bold', 'italic', 'underline', 'unordered-list', 'ordered-list', 'link', 'clear-formatting', 'save'],
+      'title': ['bold', 'italic', 'underline', 'save']
+    }
+  };
+
+  models.Editor = Backbone.Model;
+
+  views.Editor = Backbone.View.extend({
+    initialize: function() {
+      this.$el = $(this.el);
+            
+      // Model attribute event listeners:
+      _.bindAll(this, 'changeButtons', 'changePosition', 'changeEditable', 'insertImage');
+      this.model.bind('change:buttons', this.changeButtons);
+      this.model.bind('change:position', this.changePosition);
+      this.model.bind('change:editable', this.changeEditable);
+
+      // Init Routines:
+      this.changeEditable();
+    },
+
+    events: {
+      'click .etch-bold': 'toggleBold',
+      'click .etch-italic': 'toggleItalic',
+      'click .etch-underline': 'toggleUnderline',
+      'click .etch-heading': 'toggleHeading',
+      'click .etch-unordered-list': 'toggleUnorderedList',
+      'click .etch-justify-left': 'justifyLeft',
+      'click .etch-justify-center': 'justifyCenter',
+      'click .etch-justify-right': 'justifyRight',
+      'click .etch-ordered-list': 'toggleOrderedList',
+      'click .etch-link': 'toggleLink',
+      'click .etch-image': 'getImage',
+      'click .etch-save': 'save',
+      'click .etch-clear-formatting': 'clearFormatting'
+    },
+        
+    changeEditable: function() {
+      this.setButtonClass();
+      // Im assuming that Ill add more functionality here
+    },
+
+    setButtonClass: function() {
+      // check the button class of the element being edited and set the associated buttons on the model
+      var editorModel = this.model;
+      var buttonClass = editorModel.get('editable').attr('data-button-class') || 'default';
+      editorModel.set({ buttons: etch.config.buttonClasses[buttonClass] });
+    },
+
+    changeButtons: function() {
+      // render the buttons into the editor-panel
+      this.$el.empty();
+      var view = this;
+      var buttons = this.model.get('buttons');
+            
+      // hide editor panel if there are no buttons in it and exit early
+      if (!buttons.length) { $(this.el).hide(); return; }
+            
+      _.each(this.model.get('buttons'), function(button){
+        var $buttonEl = $('<a href="#" class="etch-editor-button etch-'+ button +'" title="'+ button.replace('-', ' ') +'"><span></span></a>');
+        view.$el.append($buttonEl);
+      });
+            
+      $(this.el).show('fast');
+    },
+
+    changePosition: function() {
+      // animate editor-panel to new position
+      var pos = this.model.get('position');
+      this.$el.animate({'top': pos.y, 'left': pos.x}, { queue: false });
+    },
+        
+    wrapSelection: function(selectionOrRange, elString, cb) {
+      // wrap current selection with elString tag
+      var range = selectionOrRange === Range ? selectionOrRange : selectionOrRange.getRangeAt(0);
+      var el = document.createElement(elString);
+      range.surroundContents(el);
+    },
+        
+    clearFormatting: function(e) {
+      e.preventDefault();
+      document.execCommand('removeFormat', false, null);
+    },
+        
+    toggleBold: function(e) {
+      e.preventDefault();
+      document.execCommand('bold', false, null);
+    },
+
+    toggleItalic: function(e) {
+      e.preventDefault();
+      document.execCommand('italic', false, null);
+    },
+
+    toggleUnderline: function(e) {
+      e.preventDefault();
+      document.execCommand('underline', false, null);
+    },
+        
+    toggleHeading: function(e) {
+      e.preventDefault();
+      var range = window.getSelection().getRangeAt(0);
+      var wrapper = range.commonAncestorContainer.parentElement
+      if ($(wrapper).is('h3')) {
+        $(wrapper).replaceWith(wrapper.textContent)
+        return;
+      }
+      var h3 = document.createElement('h3');
+      range.surroundContents(h3);
+    },
+
+    urlPrompt: function(callback) {
+      // This uses the default browser UI prompt to get a url.
+      // Override this function if you want to implement a custom UI.
+        
+      var url = prompt('Enter a url', 'http://');
+        
+      // Ensure a new link URL starts with http:// or https:// 
+      // before it's added to the DOM.
+      //
+      // NOTE: This implementation will disallow relative URLs from being added
+      // but will make it easier for users typing external URLs.
+      if (/^((http|https)...)/.test(url)) {
+        callback(url);
+      } else {
+        callback("http://" + url);
+      }
+    },
+    
+    toggleLink: function(e) {
+      e.preventDefault();
+      var range = window.getSelection().getRangeAt(0);
+
+      // are we in an anchor element?
+      if (range.startContainer.parentNode.tagName === 'A' || range.endContainer.parentNode.tagName === 'A') {
+        // unlink anchor
+        document.execCommand('unlink', false, null);
+      } else {
+        // promt for url and create link
+        this.urlPrompt(function(url) {
+          document.execCommand('createLink', false, url);
+        });
+      }
+    },
+
+    toggleUnorderedList: function(e) {
+      e.preventDefault();
+      document.execCommand('insertUnorderedList', false, null);
+    },
+
+    toggleOrderedList: function(e){
+      e.preventDefault();
+      document.execCommand('insertOrderedList', false, null);
+    },
+        
+    justifyLeft: function(e) {
+      e.preventDefault();
+      document.execCommand('justifyLeft', false, null);
+    },
+
+    justifyCenter: function(e) {
+      e.preventDefault();
+      document.execCommand('justifyCenter', false, null);
+    },
+
+    justifyRight: function(e) {
+      e.preventDefault();
+      document.execCommand('justifyRight', false, null);
+    },
+
+    getImage: function(e) {
+      e.preventDefault();
+
+      // call startUploader with callback to handle inserting it once it is uploded/cropped
+      this.startUploader(this.insertImage);
+    },
+        
+    startUploader: function(cb) {
+      // initialize Image Uploader
+      var model = new models.ImageUploader();
+      var view = new views.ImageUploader({model: model});
+            
+      // stash a reference to the callback to be called after image is uploaded
+      model._imageCallback = function(image) {
+        view.startCropper(image, cb);
+      };
+
+
+      // stash reference to saved range for inserting the image once its 
+      this._savedRange = window.getSelection().getRangeAt(0);
+
+      // insert uploader html into DOM
+      $('body').append(view.render().el);
+    },
+        
+    insertImage: function(image) {
+      // insert image - passed as a callback to startUploader
+      var sel = window.getSelection();
+      sel.removeAllRanges();
+      sel.addRange(this._savedRange);
+            
+      var attrs = {
+        'editable': this.model.get('editable'),
+        'editableModel': this.model.get('editableModel')
+      };
+            
+      _.extend(attrs, image);
+
+      var model = new models.EditableImage(attrs);
+      var view = new views.EditableImage({model: model});
+      this._savedRange.insertNode($(view.render().el).addClass('etch-float-left')[0]);
+    },
+        
+    save: function(e) {
+      e.preventDefault();
+      var editableModel = this.model.get('editableModel');
+      editableModel.trigger('save');
+    }
+  });
+
+  // tack on models, views, etc... as well as init function
+  _.extend(etch, {
+    models: models,
+    views: views,
+    collections: collections,
+
+    // This function is to be used as callback to whatever event
+    // you use to initialize editing 
+    editableInit: function(e) {
+      e.stopPropagation();
+      var target = e.target || e.srcElement;
+      var $editable = $(target).etchFindEditable();
+      $editable.attr('contenteditable', true);
+
+      // if the editor isn't already built, build it
+      var $editor = $('.etch-editor-panel');
+      var editorModel = $editor.data('model');
+      if (!$editor.size()) {
+        $editor = $('<div class="etch-editor-panel">');
+        var editorAttrs = { editable: $editable, editableModel: this.model };
+        document.body.appendChild($editor[0]);
+        $editor.etchInstantiate({classType: 'Editor', attrs: editorAttrs});
+        editorModel = $editor.data('model');
+
+      // check if we are on a new editable
+      } else if ($editable[0] !== editorModel.get('editable')[0]) {
+        // set new editable
+        editorModel.set({
+          editable: $editable,
+          editableModel: this.model
+        });
+      }
+      
+      // Firefox seems to be only browser that defaults to `StyleWithCSS == true`
+      // so we turn it off here. Plus a try..catch to avoid an error being thrown in IE8.
+      try {
+        document.execCommand('StyleWithCSS', false, false);
+      }
+      catch (err) {
+        // expecting to just eat IE8 error, but if different error, rethrow
+        if (err.message !== "Invalid argument.") {
+          throw err;
+        }
+      }
+
+      if (models.EditableImage) {
+        // instantiate any images that may be in the editable
+        var $imgs = $editable.find('img');
+        if ($imgs.size()) {
+          var attrs = { editable: $editable, editableModel: this.model };
+          $imgs.each(function() {
+            var $this = $(this);
+            if (!$this.data('editableImageModel')) {
+              var editableImageModel =  new models.EditableImage(attrs);
+              var editableImageView = new views.EditableImage({model: editableImageModel, el: this, tagName: this.tagName});
+              $this.data('editableImageModel', editableImageModel);
+            }
+          });
+        }
+      }
+
+      // listen for mousedowns that are not coming from the editor
+      // and close the editor
+      $('body').bind('mousedown.editor', function(e) {
+        // check to see if the click was in an etch tool
+        var target = e.target || e.srcElement;
+        if ($(target).not('.etch-editor-panel, .etch-editor-panel *, .etch-image-tools, .etch-image-tools *').size()) {
+          // remove editor
+          $editor.remove();
+                    
+                    
+          if (models.EditableImage) {
+            // unblind the image-tools if the editor isn't active
+            $editable.find('img').unbind('mouseenter');
+
+            // remove any latent image tool model references
+            $(etch.config.selector+' img').data('editableImageModel', false)
+          }
+                    
+          // once the editor is removed, remove the body binding for it
+          $(this).unbind('mousedown.editor');
+        }
+      });
+
+      editorModel.set({position: {x: e.pageX - 15, y: e.pageY - 80}});
+    }
+  });
+
+  // jquery helper functions
+  $.fn.etchInstantiate = function(options, cb) {
+    return this.each(function() {
+      var $el = $(this);
+      options || (options = {});
+
+      var settings = {
+        el: this,
+        attrs: {}
+      }
+
+      _.extend(settings, options);
+
+      var model = new models[settings.classType](settings.attrs, settings);
+
+      // initialize a view is there is one
+      if (_.isFunction(views[settings.classType])) {
+        var view = new views[settings.classType]({model: model, el: this, tagName: this.tagName});
+      }
+           
+      // stash the model and view on the elements data object
+      $el.data({model: model});
+      $el.data({view: view});
+
+      if (_.isFunction(cb)) {
+        cb({model: model, view: view});
+      }
+    });
+  }
+
+  $.fn.etchFindEditable = function() {
+    // function that looks for the editable selector on itself or its parents
+    // and returns that el when it is found
+    var $el = $(this);
+    return $el.is(etch.config.selector) ? $el : $el.closest(etch.config.selector);
+  }
+    
+  window.etch = etch;
+})();

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/greenrdfstore.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/greenrdfstore.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/greenrdfstore.js
new file mode 100644
index 0000000..eef998f
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/greenrdfstore.js
@@ -0,0 +1,78 @@
+/*
+ * functions to read RDFa to an rdfstore-js graph
+ */
+
+function GreenRdfStore() {
+}
+
+GreenRdfStore.getGraph = function(element, callback) {
+    var store = rdfstore.create();
+    store.graph(function(success,graph) {
+        var env = store.rdf;
+        CallbackProcessor.prototype = new RDFaProcessor();
+        CallbackProcessor.prototype.constructor=RDFaProcessor;
+        function CallbackProcessor() {
+           RDFaProcessor.call(this);
+        }
+        var bNodeTable = {};
+        CallbackProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+            function convertNonLiteral(node) { 
+                if (node.startsWith("_:")) {
+                    if (!bNodeTable[node]) {
+                        bNodeTable[node] = env.createBlankNode(node);
+                    }
+                    return bNodeTable[node];
+                } else {
+                    return env.createNamedNode(node);s
+                }
+            }
+            function serializeNodeList(nodeList) {
+                //code taken from Greenturtle's GraphRDFaProcessor
+                var serializer = new XMLSerializer();
+                var value = "";
+                for (var x=0; x<nodeList.length; x++) {
+                   if (nodeList[x].nodeType==Node.ELEMENT_NODE) {
+                      var prefixMap = RDFaPredicate.getPrefixMap(nodeList[x]);
+                      var prefixes = [];
+                      for (var prefix in prefixMap) {
+                         prefixes.push(prefix);
+                      }
+                      prefixes.sort();
+                      var e = nodeList[x].cloneNode(true);
+                      for (var p=0; p<prefixes.length; p++) {
+                         e.setAttributeNS("http://www.w3.org/2000/xmlns/",prefixes[p].length==0 ? "xmlns" : "xmlns:"+prefixes[p],prefixMap[prefixes[p]]);
+                      }
+                      value += serializer.serializeToString(e);
+                   } else if (nodeList[x].nodeType==Node.TEXT_NODE) {
+                      value += nodeList[x].nodeValue;
+                   }
+                }
+                return value;
+            }
+            //alert("New triple: "+subject+", predicate "+predicate+", object "+object.value+", "+object.language+", "+object.type);
+            var subjectRS = convertNonLiteral(subject);
+            
+            var predicateRS = env.createNamedNode(predicate);
+            if (object.type === "http://www.w3.org/1999/02/22-rdf-syntax-ns#object") {
+                var objectRS = convertNonLiteral(object.value);
+            } else {
+                if (origin.getAttribute("content")) {
+                    //according to the spec this attribute should be ignored for xmlLiterals, we don't
+                    var value = origin.getAttribute("content");
+                } else {
+                    if (object.value.length) {
+                        var value = serializeNodeList(object.value);
+                    } else {
+                        var value = object.value;
+                    }
+                }
+                var objectRS = env.createLiteral(value.toString(), object.language, object.type);
+            }
+            graph.add(env.createTriple(subjectRS, predicateRS, objectRS));
+        };
+        var gp = new CallbackProcessor();
+                    //gp.target.graph = new RDFaGraph();
+        gp.process(element);
+        callback(graph)
+    });
+};
\ No newline at end of file


[46/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
----------------------------------------------------------------------
diff --git a/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
new file mode 100644
index 0000000..fcab2c1
--- /dev/null
+++ b/platform/concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
@@ -0,0 +1,213 @@
+/*
+ * 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.
+ */
+function ConceptProviderGui(){};
+
+ConceptProviderGui.isModified = false;
+
+ConceptProviderGui.query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> \n" +
+	"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" +
+	"PREFIX skos08: <http://www.w3.org/2008/05/skos#> \n" +
+	"PREFIX skos04: <http://www.w3.org/2004/02/skos/core#> \n" +
+	"CONSTRUCT { ?concept a skos08:Concept; skos08:prefLabel ?prefLabel; " +
+		"rdfs:comment ?comment; owl:sameAs ?sameConcept . } \n" +
+	"WHERE { ?concept a skos04:Concept; skos04:prefLabel ?prefLabel . \n" +
+	"OPTIONAL { ?concept rdfs:comment ?comment . } \n" +
+	"OPTIONAL { ?concept owl:sameAs ?sameConcept . } \n" +
+	"FILTER (REGEX(STR(?prefLabel), '${searchTerm}', 'i'))}";
+
+ConceptProviderGui.initButtons = function() {
+
+	ConceptProviderGui.updateButtonState();
+
+	$("#deleteButton").click(function(event) {
+		$("input:checked").each(function() {
+			$(this).parent().parent().remove();
+		});
+		$(this).addClass("tx-inactive");
+		ConceptProviderGui.isModified = true;
+	});
+
+	$("#addProvider").click(function(event) {
+		ConceptProviderGui.addProvider($("#type").val(),
+					$("#conceptScheme").val(),
+					$("#sparqlEndPoint").val(),
+					$("#defaultGraph").val(),
+					$("#query").val());
+		$("#conceptScheme").val("");
+		$("#sparqlEndPoint").val("");
+		$("#defaultGraph").val("");
+		$("#query").val("");
+	});
+
+	$("#addButton").click(function(event) {
+		if($(this).text() == "Save") {
+			var options = new AjaxOptions("update-providers", "updating providers", function(obj) {
+			});
+			$("textarea[id!=query]").each(function() {
+				$(this).removeAttr("disabled");
+			});
+			options.type = "POST";
+			options.url = "update-concept-provider-list";
+			options.data = $("#providers").serialize();
+			$.ajax(options);
+		}
+	});
+}
+
+ConceptProviderGui.addProvider = function(rdfType, conceptScheme, sparqlEndPoint, defaultGraph, query) {
+	var tr = $("<tr/>").attr("id", "");
+	var td1 = $("<td/>");
+	var div = $("<div/>").text("Provider:");
+	var td2 = $("<td/>");
+
+	var selection = $("<select/>").attr("name","types");
+
+	$("#type > option:not(:selected)").each(function() {
+		selection.append($(this).clone());
+	});
+	$("#type > option:selected").each(function() {
+		var option = $(this).clone();
+		option.attr("selected", "selected");
+		selection.append(option);
+	});
+
+	td2.append(div);
+	td2.append(selection);
+	
+	var inputText = $("<input/>").attr({
+				"type":"text",
+				"name":"conceptSchemes",
+				"value": conceptScheme
+				});
+	
+	div = $("<div/>").text("Concept Scheme:");
+	td2.append(div);
+	td2.append(inputText);
+
+	inputText = $("<input/>").attr({
+				"type":"text",
+				"name":"sparqlEndPoints",
+				"value": sparqlEndPoint
+				});
+
+	div = $("<div/>").text("SPARQL End Point");
+	td2.append(div);
+	td2.append(inputText);
+
+	inputText = $("<input/>").attr({
+				"type":"text",
+				"name":"defaultGraphs",
+				"value": defaultGraph
+				});
+
+	div = $("<div/>").text("Default Graph:");
+	td2.append(div);
+	td2.append(inputText)
+	var inputCheckbox = $("<input/>").attr({
+				"type":"checkbox",
+				"value": rdfType
+				});
+
+	inputCheckbox.appendTo(td1);
+
+	td1.appendTo(tr);
+	
+	var textArea = $("<textarea/>").attr({
+				"rows":"8",
+				"name":"queryTemplates"
+				}).val(query);
+	div = $("<div/>").text("Query Template:");
+	td2.append(div);
+	td2.append(textArea);
+	td2.append($("<br/>"));
+	td2.append($("<br/>"));
+	td2.appendTo(tr);
+	tr.insertBefore("#last");
+	ConceptProviderGui.isModified = true;
+
+	$("select[name=types] > option:selected").each(function() {
+		ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
+	});
+}
+
+ConceptProviderGui.updateDropDown = function (obj, name) {
+	if(obj.val().indexOf("Local") != -1) {
+		obj.parent().parent().find("input[name!=" + name + "]").each(function() {
+			$(this).prev().hide();
+			$(this).hide();
+		});
+		obj.parent().parent().find("input[name=" + name + "]").each(function() {
+			$(this).prev().show();
+			$(this).show();
+		});
+		obj.parent().parent().find("textarea").each(function() {
+			$(this).prev().hide();
+			$(this).hide();
+		});
+	} else {
+		obj.parent().parent().find("input[name!=" + name + "]").each(function() {
+			$(this).prev().show();
+			$(this).show();
+		});
+		obj.parent().parent().find("input[name=" + name + "]").each(function() {
+			$(this).prev().hide();
+			$(this).hide();
+		});
+		obj.parent().parent().find("textarea").each(function() {
+			$(this).prev().show();
+			$(this).show();
+		});
+	}
+}
+
+ConceptProviderGui.updateButtonState = function() {
+	var counter = $("input:checked").length;
+	if(counter == 0) {
+		$("#deleteButton").addClass("tx-inactive");
+	} else {
+		$("#deleteButton").removeClass("tx-inactive");
+	}
+}
+
+$(document).ready(function () {
+
+	$("select[name=types]").live("change", function() {
+		$("select[name=types] > option:selected").each(function(){
+			ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
+		});
+	});
+	$("select[name=types] > option:selected").each(function() {
+		ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
+	});
+	$("#type").live("change", function() {
+		$("#type > option:selected").each(function(){
+			ConceptProviderGui.updateDropDown($(this), "conceptScheme");
+			$("#query").val(ConceptProviderGui.query);
+		});
+	});
+	$("#type > option:selected").each(function() {
+		ConceptProviderGui.updateDropDown($(this), "conceptScheme");
+		$("#query").val(ConceptProviderGui.query);
+	});
+	$("input:checkbox").live("change",function() {
+		ConceptProviderGui.updateButtonState();
+	});
+
+	ConceptProviderGui.initButtons();
+});


[43/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config/pom.xml
----------------------------------------------------------------------
diff --git a/platform/config/pom.xml b/platform/config/pom.xml
new file mode 100644
index 0000000..111680c
--- /dev/null
+++ b/platform/config/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.config</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Configuration</name>
+    <description>This bundles initializes the system graph with default values,
+    provides a service to access configuration default values, and a GUI to
+    edit such values.
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.file.storage</artifactId>
+            <version>0.4</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java
----------------------------------------------------------------------
diff --git a/platform/config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java b/platform/config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java
new file mode 100644
index 0000000..ebc0bf9
--- /dev/null
+++ b/platform/config/src/main/java/org/apache/clerezza/platform/config/PlatformConfig.java
@@ -0,0 +1,191 @@
+/*
+ * 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.config;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import org.apache.clerezza.platform.Constants;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+/**
+ * This class provides a OSGi service for getting system properties from
+ * the sytem graph.
+ * 
+ * @author mir
+ */
+@Component
+@Service(PlatformConfig.class)
+public class PlatformConfig {
+
+    @Reference(target = SystemConfig.SYSTEM_GRAPH_FILTER)
+    private LockableMGraph systemGraph;
+    private BundleContext context;
+    private static String DEFAULT_PORT = "8080";
+
+    /**
+     * @deprecated use org.apache.clerezza.platform.Contants instead
+     */
+    @Deprecated
+    public static final UriRef CONFIG_GRAPH_URI = Constants.CONFIG_GRAPH_URI;
+
+    /**
+     * A filter that can be used to get the config graph as OSGi service,
+     * that is provided by <code>org.apache.clerezza.rdf.core.access.TcManager</code>.
+     */
+    public static final String CONFIG_GRAPH_FILTER =
+            "(name="+ Constants.CONFIG_GRAPH_URI_STRING +")";
+
+    @Reference
+    private TcManager tcManager;
+
+
+    /**
+     * Returns the default base URI of the Clerezza platform instance.
+     * @return the base URI of the Clerezza platform
+     */
+    public UriRef getDefaultBaseUri() {
+        return AccessController.doPrivileged(new PrivilegedAction<UriRef>() {
+
+            @Override
+            public UriRef run() {
+                GraphNode platformInstance = getPlatformInstance();
+                Lock l = platformInstance.readLock();
+                l.lock();
+                try {
+                    Iterator<Resource> triples = platformInstance.getObjects(PLATFORM.defaultBaseUri);
+                    if (triples.hasNext()) {
+                        return (UriRef) triples.next();
+                    } else {
+                        String port = context.getProperty("org.osgi.service.http.port");
+                        if (port == null) {
+                            port = DEFAULT_PORT;
+                        }
+                        if (port.equals("80")) {
+                            return new UriRef("http://localhost/");
+                        }
+                        return new UriRef("http://localhost:" + port + "/");
+                    }
+                } finally {
+                    l.unlock();
+                }
+            }
+        });
+    }
+
+    /**
+     * Returns the platforminstance as <code>GraphNode</code> of the system
+     * graph (a LockableMGraph). Access controls applies to the system graph
+     * instance underlying the <code>GraphNode</code>.
+     *
+     * @return
+     */
+    public GraphNode getPlatformInstance() {
+        return new GraphNode(getPlatformInstanceResource(), systemGraph);
+    }
+
+    private NonLiteral getPlatformInstanceResource() {
+        Lock l = systemGraph.getLock().readLock();
+        l.lock();
+        try {
+            Iterator<Triple> instances = systemGraph.filter(null, RDF.type, PLATFORM.Instance);
+            if (!instances.hasNext()) {
+                throw new RuntimeException("No Platform:Instance in system graph.");
+            }
+            return instances.next().getSubject();
+        } finally {
+            l.unlock();
+        }
+    }
+
+    /**
+     * Returns the base URIs of the Clerezza platform instance.
+     * A base Uri is the shortest URI of a URI-Hierarhy the platform handles.
+     * @return the base URI of the Clerezza platform
+     */
+    //todo: if this is the only class that sets and reads base uris then getBaseURIs should keep a cache
+    public Set<UriRef> getBaseUris() {
+
+        return AccessController.doPrivileged(new PrivilegedAction<Set<UriRef>>() {
+
+            @Override
+            public Set<UriRef> run() {
+                Iterator<Resource> baseUrisIter = getPlatformInstance().
+                        getObjects(PLATFORM.baseUri);
+                Set<UriRef> baseUris = new HashSet<UriRef>();
+                while (baseUrisIter.hasNext()) {
+                    UriRef baseUri = (UriRef) baseUrisIter.next();
+                    baseUris.add(baseUri);
+                }
+                baseUris.add(getDefaultBaseUri());
+                return baseUris;
+            }
+        });
+
+    }
+
+    /**
+     * Adds a base URI to the Clerezza platform instance.
+     *
+     * @param baseUri The base URI which will be added to the platform instance
+     */
+    public void addBaseUri(UriRef baseUri) {
+        systemGraph.add(new TripleImpl(getPlatformInstanceResource(), PLATFORM.baseUri, baseUri));
+    }
+
+    /**
+     * Removes a base URI from the Clerezza platform instance.
+     *
+     * @param baseUri The base URI which will be removed from the platform instance
+     */
+    public void removeBaseUri(UriRef baseUri) {
+        systemGraph.remove(new TripleImpl(getPlatformInstanceResource(), PLATFORM.baseUri, baseUri));
+    }
+
+    protected void activate(ComponentContext componentContext) {
+        this.context = componentContext.getBundleContext();
+        try {
+            tcManager.getMGraph(Constants.CONFIG_GRAPH_URI);
+        } catch (NoSuchEntityException nsee) {
+            tcManager.createMGraph(Constants.CONFIG_GRAPH_URI);            
+        }
+    }
+    
+    protected void deactivate(ComponentContext componentContext) {
+        this.context = null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java
----------------------------------------------------------------------
diff --git a/platform/config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java b/platform/config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java
new file mode 100644
index 0000000..285300d
--- /dev/null
+++ b/platform/config/src/main/java/org/apache/clerezza/platform/config/SystemConfig.java
@@ -0,0 +1,186 @@
+/*
+ * 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.config;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Set;
+import org.apache.clerezza.platform.Constants;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.osgi.service.component.ComponentContext;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
+import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.serializedform.Parser;
+import org.apache.clerezza.rdf.core.serializedform.SupportedFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.rdf.core.serializedform.ParsingProvider;
+import org.apache.clerezza.rdf.core.serializedform.Serializer;
+import org.apache.clerezza.rdf.file.storage.FileMGraph;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Deactivate;
+
+/**
+ * When the
+ * <code>SystemConfig</code> component is activated it checks if the system
+ * graph exists, in case it does not exist then it creates the system graph and
+ * writes the default platform configuration into it.
+ *
+ * @author mir
+ */
+@Component(immediate = true)
+@Service(WeightedTcProvider.class)
+public class SystemConfig implements WeightedTcProvider {
+
+    public static final String DEFAULT_SYSTEM_GRAPH = "default-system-graph.rdf";
+    private static final String DATA_FILE_SYSTEM_GRAPH = "system-graph.nt";
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+    /**
+     *
+     * @deprecated use org.apache.clerezza.platform.Contants instead
+     */
+    @Deprecated
+    public static final UriRef SYSTEM_GRAPH_URI = Constants.SYSTEM_GRAPH_URI;
+    /**
+     * A filter that can be used to get the system graph as OSGi service, that
+     * is provided by
+     * <code>org.apache.clerezza.rdf.core.access.TcManager</code>.
+     */
+    public static final String SYSTEM_GRAPH_FILTER =
+            "(name=" + Constants.SYSTEM_GRAPH_URI_STRING + ")";
+    
+    public static final String PARSER_FILTER =
+            "(&("+SupportedFormat.supportedFormat+"=" + SupportedFormat.RDF_XML + ") "+
+            "("+SupportedFormat.supportedFormat+"=" + SupportedFormat.N_TRIPLE + "))";
+    @Reference(target = PARSER_FILTER)
+    private Parser parser;
+    
+    public static final String SERIALIZER_FILTER =
+            "("+SupportedFormat.supportedFormat+"=" + SupportedFormat.N_TRIPLE + ")";
+    @Reference(target = SERIALIZER_FILTER)
+    private Serializer serializer;
+    private MGraph systemGraph;
+
+    @Activate
+    protected void activate(ComponentContext componentContext) {
+        final BundleContext bundleContext = componentContext.getBundleContext();
+        File systemGraphFile = bundleContext.getDataFile(DATA_FILE_SYSTEM_GRAPH);
+        boolean dataFileExisted = systemGraphFile.exists();
+        //yould be good to use IndexedMGraph to be faster
+        systemGraph = new FileMGraph(systemGraphFile, parser, serializer);
+        if (!dataFileExisted) {
+            readConfigGraphFile(systemGraph);
+            logger.info("Add initial configuration to system graph");
+        }
+    }
+
+    @Deactivate
+    protected void deactivate(ComponentContext componentContext) {
+        systemGraph = null;
+    }
+
+    private void readConfigGraphFile(MGraph mGraph) {
+        URL config = getClass().getResource(DEFAULT_SYSTEM_GRAPH);
+        if (config == null) {
+            throw new RuntimeException("no config file found");
+        }
+        try {
+            parser.parse(mGraph, config.openStream(),
+                    SupportedFormat.RDF_XML, null);
+        } catch (IOException ex) {
+            logger.warn("Cannot parse coniguration at URL: {}", config);
+            throw new RuntimeException(ex);
+        }
+    }
+
+    /*
+     * Reason to be high: don't allow overwriting of system graph (by accident or as an attack)
+     * Reason to be low: avoid that TcManager always first tries to create TripleCollections using this provider
+     */
+    @Override
+    public int getWeight() {
+        return Integer.MAX_VALUE;
+    }
+
+    @Override
+    public Graph getGraph(UriRef name) throws NoSuchEntityException {
+        throw new NoSuchEntityException(name);
+    }
+
+    @Override
+    public MGraph getMGraph(UriRef name) throws NoSuchEntityException {
+        if (name.equals(Constants.SYSTEM_GRAPH_URI)) {
+            return systemGraph;
+        } else {
+            throw new NoSuchEntityException(name);
+        }
+    }
+
+    @Override
+    public TripleCollection getTriples(UriRef name) throws NoSuchEntityException {
+        return getMGraph(name);
+    }
+
+    @Override
+    public Set<UriRef> listGraphs() {
+        return Collections.emptySet();
+    }
+
+    @Override
+    public Set<UriRef> listMGraphs() {
+        return Collections.singleton(Constants.SYSTEM_GRAPH_URI);
+    }
+
+    @Override
+    public Set<UriRef> listTripleCollections() {
+        return listMGraphs();
+    }
+
+    @Override
+    public MGraph createMGraph(UriRef name) throws UnsupportedOperationException, EntityAlreadyExistsException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Graph createGraph(UriRef name, TripleCollection triples) throws UnsupportedOperationException, EntityAlreadyExistsException {
+        throw new UnsupportedOperationException("Not supported yet."); 
+    }
+
+    @Override
+    public void deleteTripleCollection(UriRef name) throws UnsupportedOperationException, NoSuchEntityException, EntityUndeletableException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
+    public Set<UriRef> getNames(Graph graph) {
+        return Collections.emptySet();
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java
----------------------------------------------------------------------
diff --git a/platform/config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java b/platform/config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java
new file mode 100644
index 0000000..dd5199f
--- /dev/null
+++ b/platform/config/src/main/java/org/apache/clerezza/platform/config/TcPermissionDescriptionsProvider.java
@@ -0,0 +1,70 @@
+/*
+ * 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.config;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.clerezza.permissiondescriptions.PermissionDescriptionsProvider;
+import org.apache.clerezza.permissiondescriptions.PermissionDescripton;
+import org.apache.clerezza.rdf.core.access.security.TcPermission;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+
+/**
+ * <code>PermissionDescriptionsProvider</code> implementation that provides
+ * <code>PermissionDescripton</code>s of the graph access permissions for
+ * the graphs used by the platform.
+ * The access permissions for the following graphs are described:
+ * <ul>
+ *    <li>system graph</li>
+ *    <li>config graph</li>
+ * </ul>
+ *
+ * @author mir
+ */
+@Component
+@Service(PermissionDescriptionsProvider.class)
+public class TcPermissionDescriptionsProvider implements PermissionDescriptionsProvider {
+
+    private static final Set<PermissionDescripton> GRAPH_ACCESS_PERMISSION_DESCRIPTIONS =
+            new HashSet<PermissionDescripton>();
+    static {
+        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("System Graph Read Permission",
+                "Grants permission to the user to read the system graph", null, TcPermission.class,
+                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/system.graph\" \"read\")"));
+
+        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("System Graph Read/Write Permission",
+                "Grants permission to the user to read and write the system graph", null, TcPermission.class,
+                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/system.graph\" \"readwrite\")"));
+
+        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Configuration Graph Read Permission",
+                "Grants permission to the user to read the configuration graph", null, TcPermission.class,
+                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/config.graph\" \"read\")"));
+
+        GRAPH_ACCESS_PERMISSION_DESCRIPTIONS.add(new PermissionDescripton("Configuration Graph Read/Write Permission",
+                "Grants permission to the user to read and write the configuration graph", null, TcPermission.class,
+                "(org.apache.clerezza.rdf.core.access.security.TcPermission \"urn:x-localinstance:/config.graph\" \"readwrite\")"));
+    }
+
+    @Override
+    public Set<PermissionDescripton> getPermissionDescriptors() {
+        return GRAPH_ACCESS_PERMISSION_DESCRIPTIONS;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf
----------------------------------------------------------------------
diff --git a/platform/config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf b/platform/config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf
new file mode 100644
index 0000000..f530afd
--- /dev/null
+++ b/platform/config/src/main/resources/org/apache/clerezza/platform/config/default-system-graph.rdf
@@ -0,0 +1,103 @@
+<?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.
+
+-->
+
+<rdf:RDF
+		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+		xmlns:perm="http://clerezza.org/2008/10/permission#"
+		xmlns:foaf="http://xmlns.com/foaf/0.1/"
+		xmlns:dc="http://purl.org/dc/elements/1.1/"
+		xmlns:sioc="http://rdfs.org/sioc/ns#"
+		xmlns:plat="http://clerezza.org/2009/08/platform#"
+		xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+	<perm:Role>
+		<dc:title>CommunityUser</dc:title>
+		<perm:hasPermission rdf:parseType="Resource">
+			<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/user/{username}/*" "readwrite")</perm:javaPermissionEntry>
+		</perm:hasPermission>
+		<perm:hasPermission rdf:parseType="Resource">
+			<perm:javaPermissionEntry>(org.apache.clerezza.platform.accountcontrolpanel.UserBundlePermission "{username}" "")</perm:javaPermissionEntry>
+		</perm:hasPermission>
+	</perm:Role>
+	<plat:Instance></plat:Instance>
+	<foaf:Agent>
+		<plat:userName>anonymous</plat:userName>
+		<sioc:has_function>
+			<perm:Role>
+				<dc:title>BasePermissionsRole</dc:title>
+				<rdfs:comment>Every user implicitely has this role as this is a perm:BaseRole</rdfs:comment>
+				<rdf:type rdf:resource="http://clerezza.org/2008/10/permission#BaseRole"/>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(java.util.PropertyPermission "*" "read")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(org.osgi.framework.AdminPermission "*" "resource")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(org.osgi.framework.ServicePermission "*" "get")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(java.lang.RuntimePermission "accessDeclaredMembers" "")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+                                <perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(java.lang.RuntimePermission "getClassLoader" "")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<!-- it seems pax-logger impl needs this, see comment to https://issues.apache.org/jira/browse/CLEREZZA-205 -->
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(org.osgi.framework.AdminPermission "*" "metadata")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/content.graph" "read")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/documentation.graph" "read")</perm:javaPermissionEntry>
+				</perm:hasPermission>
+				<perm:hasPermission rdf:parseType="Resource">
+					<perm:javaPermissionEntry>(org.apache.clerezza.rdf.core.access.security.TcPermission "urn:x-localinstance:/config.graph" "read")</perm:javaPermissionEntry>
+				</perm:hasPermission>				
+			</perm:Role>
+		</sioc:has_function>
+	</foaf:Agent>
+	<perm:Role>
+		<dc:title>DefaultRole</dc:title>
+		<rdfs:comment>A role regular users typically have</rdfs:comment>
+		<perm:hasPermission rdf:parseType="Resource">
+			<perm:javaPermissionEntry>(org.apache.clerezza.platform.accountcontrolpanel.AccountControlPanelAppPermission "{username}" "")</perm:javaPermissionEntry>
+		</perm:hasPermission>
+		<perm:hasPermission rdf:parseType="Resource">
+			<perm:javaPermissionEntry>(org.apache.clerezza.platform.accountcontrolpanel.ChangePasswordPermission "{username}" "")</perm:javaPermissionEntry>
+		</perm:hasPermission>
+	</perm:Role>
+	<rdf:Description rdf:about="urn:x-localinstance:/typePriorityList">
+		<rdf:rest rdf:parseType="Collection">
+			<rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#Resource"/>
+		</rdf:rest>
+		<rdf:first rdf:resource="http://clerezza.org/2009/07/script#ScriptGeneratedResource"/>
+	</rdf:Description>
+	<foaf:Agent>
+		<perm:hasPermission rdf:parseType="Resource">
+			<perm:javaPermissionEntry>(java.security.AllPermission "" "")</perm:javaPermissionEntry>
+		</perm:hasPermission>
+		<plat:userName>admin</plat:userName>
+		<foaf:mbox rdf:resource="mailto:noreply@clerezza.org"/>
+		<perm:passwordSha1>d033e22ae348aeb5660fc2140aec35850c4da997</perm:passwordSha1>
+	</foaf:Agent>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.default404/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content.default404/LICENSE b/platform/content.default404/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content.default404/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.default404/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content.default404/pom.xml b/platform/content.default404/pom.xml
new file mode 100644
index 0000000..0cedbc1
--- /dev/null
+++ b/platform/content.default404/pom.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content.default404</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Content Default 404 response provider</name>
+    <description>
+        Provides a default implementation of PageNotFoundService
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.content</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src/main/scala</sourceDirectory>
+        <testSourceDirectory>src/test/scala</testSourceDirectory>
+        <plugins>
+            <plugin>
+                <groupId>org.scala-tools</groupId>
+                <artifactId>maven-scala-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>testCompile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!-- <scalaVersion>${scala.version}</scalaVersion> -->
+                    <!-- <args>
+                        <arg>-target:jvm-1.5</arg>
+                    </args> -->
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
+                        <Export-Package>org.apache.clerezza.platform.content.default404</Export-Package>
+                        <!-- <Bundle-SymbolicName>org.apache.clerezza.platform.users.core</Bundle-SymbolicName> -->
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.default404/src/main/resources/META-INF/documentation.nt
----------------------------------------------------------------------
diff --git a/platform/content.default404/src/main/resources/META-INF/documentation.nt b/platform/content.default404/src/main/resources/META-INF/documentation.nt
new file mode 100644
index 0000000..d5a8a00
--- /dev/null
+++ b/platform/content.default404/src/main/resources/META-INF/documentation.nt
@@ -0,0 +1,35 @@
+<bundle:///intro-content-el/0> <http://discobits.org/ontology#infoBit> "The default 404 Response Provider budle with id org.apache.clerezza.platform.content.default404 provides an implementation of the PageNotFoundService (package/bundle: org.apache.clerezza.platform.content) that the delivers the response retrieved from the uri with the same protocol and host and the /page-not-found. For example if 404 is to be generated for http://example.org/foo/bar the entity obtained by dereferencing http://example.org/page-not-found will be returned."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/1-content> <http://discobits.org/ontology#infoBit> "example: curl -u admin:admin -H \"Content-type: text/html\" -T tmp.html http://127.0.0.1:8080/page-not-found"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/1-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/1-title> <http://discobits.org/ontology#infoBit> "Uploading 404 response page with curl"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-content-el/1-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro-content-el/1> <http://discobits.org/ontology#contains> _:6a610bd3bb246f2a6afd9624eeb843581 . 
+<bundle:///intro-content-el/1> <http://discobits.org/ontology#contains> _:e696a99dc91ebddcf13b5a4fd83e55991 . 
+<bundle:///intro-content-el/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:86e4309edd82a6d415338546caff2d551 . 
+<bundle:///intro-content> <http://discobits.org/ontology#contains> _:8ced329518dac9ef741f4099548bb8451 . 
+<bundle:///intro-content> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#OrderedContent> .
+<bundle:///intro-title> <http://discobits.org/ontology#infoBit> "Default 404 Response Provider "^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<bundle:///intro-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#XHTMLInfoDiscoBit> .
+<bundle:///intro> <http://discobits.org/ontology#contains> _:566a75916142ac411441d067f09a49f71 . 
+<bundle:///intro> <http://discobits.org/ontology#contains> _:eb4272f6f47656ae428d834bb170dfe81 . 
+<bundle:///intro> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#TitledContent> .
+_:566a75916142ac411441d067f09a49f71 <http://discobits.org/ontology#holds> <bundle:///intro-content> . 
+_:566a75916142ac411441d067f09a49f71 <http://discobits.org/ontology#pos> "1" . 
+_:566a75916142ac411441d067f09a49f71 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:6a610bd3bb246f2a6afd9624eeb843581 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1-title> . 
+_:6a610bd3bb246f2a6afd9624eeb843581 <http://discobits.org/ontology#pos> "0" . 
+_:6a610bd3bb246f2a6afd9624eeb843581 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:86e4309edd82a6d415338546caff2d551 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1> . 
+_:86e4309edd82a6d415338546caff2d551 <http://discobits.org/ontology#pos> "1" . 
+_:86e4309edd82a6d415338546caff2d551 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:8ced329518dac9ef741f4099548bb8451 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/0> . 
+_:8ced329518dac9ef741f4099548bb8451 <http://discobits.org/ontology#pos> "0" . 
+_:8ced329518dac9ef741f4099548bb8451 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:e696a99dc91ebddcf13b5a4fd83e55991 <http://discobits.org/ontology#holds> <bundle:///intro-content-el/1-content> . 
+_:e696a99dc91ebddcf13b5a4fd83e55991 <http://discobits.org/ontology#pos> "1" . 
+_:e696a99dc91ebddcf13b5a4fd83e55991 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 
+_:eb4272f6f47656ae428d834bb170dfe81 <http://discobits.org/ontology#holds> <bundle:///intro-title> . 
+_:eb4272f6f47656ae428d834bb170dfe81 <http://discobits.org/ontology#pos> "0" . 
+_:eb4272f6f47656ae428d834bb170dfe81 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://discobits.org/ontology#Entry> . 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.default404/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/content.default404/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/content.default404/src/main/resources/OSGI-INF/serviceComponents.xml
new file mode 100644
index 0000000..71c9b2b
--- /dev/null
+++ b/platform/content.default404/src/main/resources/OSGI-INF/serviceComponents.xml
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <scr:component enabled="true" immediate="true" name="org.apache.clerezza.platform.content.default404.DefaultPageNotFoundService">
+        <implementation class="org.apache.clerezza.platform.content.default404.DefaultPageNotFoundService"/>
+        <service>
+            <provide interface="org.apache.clerezza.platform.content.PageNotFoundService" />
+        </service>
+    </scr:component>
+</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala
----------------------------------------------------------------------
diff --git a/platform/content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala b/platform/content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala
new file mode 100644
index 0000000..a0c4ab6
--- /dev/null
+++ b/platform/content.default404/src/main/scala/org/apache/clerezza/platform/content/default404/DefaultPageNotFoundService.scala
@@ -0,0 +1,64 @@
+/*
+ * 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.default404
+
+import org.apache.clerezza.platform.content.PageNotFoundService
+import javax.ws.rs.core.UriInfo
+import java.io.FileNotFoundException
+import java.io.InputStream
+import java.net.URL
+import java.security.AccessController
+import java.security.PrivilegedAction
+import javax.ws.rs.core.Response
+import javax.ws.rs.core.Response.Status
+
+/**
+ * This returns the content of the resource /page-not-found dereferenced as uri
+ * with the same authority section as the request.
+ */
+class DefaultPageNotFoundService extends PageNotFoundService {
+
+  private val notFoundPagePath = "/page-not-found"
+
+  override def createResponse(uriInfo: UriInfo) = {
+    if (uriInfo.getPath == notFoundPagePath) {
+      Response.status(Status.NOT_FOUND).build();
+    } else {
+      val pageNotFoundUrl = new URL(uriInfo.getBaseUri.toURL, notFoundPagePath)
+      AccessController.doPrivileged(
+        new PrivilegedAction[Option[(String, InputStream)]] {
+          def run() = {
+            val connection = pageNotFoundUrl.openConnection()
+            try {
+              Some(connection.getContentType, connection.getInputStream)
+            } catch {
+              case _: FileNotFoundException => None
+            }
+          }
+        }
+      ) match {
+        case Some((mediaTypeString, in)) => Response.status(Status.NOT_FOUND).`type`(mediaTypeString).entity(in).build();
+        case None => Response.status(Status.NOT_FOUND).build();
+      }
+
+    }
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/LICENSE
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/LICENSE b/platform/content.fsadaptor/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/content.fsadaptor/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/pom.xml
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/pom.xml b/platform/content.fsadaptor/pom.xml
new file mode 100644
index 0000000..1097fb9
--- /dev/null
+++ b/platform/content.fsadaptor/pom.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.content.fsadaptor</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Content Filesystem Adaptor</name>
+    <description>
+        Makes directories appear as a graph describing the files and theits
+        contents with the discobits ontology.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.scala.utils</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src/main/scala</sourceDirectory>
+        <testSourceDirectory>src/test/scala</testSourceDirectory>
+        <plugins>
+            <plugin>
+                <groupId>org.scala-tools</groupId>
+                <artifactId>maven-scala-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>testCompile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!-- <scalaVersion>${scala.version}</scalaVersion> -->
+                    <!-- <args>
+                        <arg>-target:jvm-1.5</arg>
+                    </args> -->
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Service-Component>OSGI-INF/serviceComponents.xml</Service-Component>
+                        <Export-Package>org.apache.clerezza.platform.content.fsadaptor</Export-Package>
+                        <!-- <Bundle-SymbolicName>org.apache.clerezza.platform.users.core</Bundle-SymbolicName> -->
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml b/platform/content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml
new file mode 100644
index 0000000..75b5938
--- /dev/null
+++ b/platform/content.fsadaptor/src/main/resources/OSGI-INF/serviceComponents.xml
@@ -0,0 +1,38 @@
+<?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.
+
+-->
+
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <scr:component enabled="true" immediate="true" name="org.apache.clerezza.platform.content.fsadaptor.BundleFsLoader">
+        <implementation class="org.apache.clerezza.platform.content.fsadaptor.BundleFsLoader"/>
+        <service servicefactory="false">
+            <provide interface="org.apache.clerezza.rdf.core.access.WeightedTcProvider"/>
+        </service>
+        <reference name="tcManager" interface="org.apache.clerezza.rdf.core.access.TcManager"
+        cardinality="1..1" policy="static" bind="bindTcManager" unbind="unbindTcManager"/>
+        <reference name="cgProvider" interface="org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider"
+        cardinality="1..1" policy="static" bind="bindContentGraphProvider" unbind="unbindContentGraphProvider"/>
+        <reference name="startLevel" interface="org.osgi.service.startlevel.StartLevel"
+        cardinality="1..1" policy="static" bind="bindStartLevel" unbind="unbindStartLevel"/>
+        <reference name="pathNode" interface="org.wymiwyg.commons.util.dirbrowser.PathNode"
+        cardinality="0..n" policy="dynamic" bind="bindPathNode" unbind="unbindPathNode"/>
+    </scr:component>
+</components>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
----------------------------------------------------------------------
diff --git a/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
new file mode 100644
index 0000000..645dab1
--- /dev/null
+++ b/platform/content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
@@ -0,0 +1,301 @@
+/*
+ * 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.fsadaptor
+
+import java.util.Collections
+import org.apache.clerezza.platform.Constants
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
+import org.apache.clerezza.rdf.core.Graph
+import org.apache.clerezza.rdf.core.MGraph
+import org.apache.clerezza.rdf.core.NonLiteral
+import org.apache.clerezza.rdf.core.Resource
+import org.apache.clerezza.rdf.core.TripleCollection
+import org.apache.clerezza.rdf.core.Triple
+import org.apache.clerezza.rdf.core.UriRef
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException
+import org.apache.clerezza.rdf.core.access.TcManager
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider
+import org.apache.clerezza.rdf.core.access.security.TcPermission
+import org.apache.clerezza.rdf.core.impl.AbstractMGraph
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph
+import org.apache.clerezza.utils.osgi.BundlePathNode
+import org.osgi.framework.Bundle
+import org.osgi.framework.BundleEvent
+import org.osgi.framework.BundleListener
+import org.osgi.service.component.ComponentContext
+import org.osgi.service.startlevel.StartLevel
+import org.slf4j.LoggerFactory
+import org.wymiwyg.commons.util.dirbrowser.MultiPathNode
+import org.wymiwyg.commons.util.dirbrowser.PathNode
+import scala.util._
+
+/**
+ * This weighted TcProvider provides a graph named urn:x-localinstance/web-resources.graph which contains descriptions
+ * of the files below the CLEREZZA-INF/web-resources directory in every bundles. The
+ * name of these descriptions (i.e. the rdf resources) use the urn:x-localinstance uri scheme to indicate that
+ * they are local to the instance and they will thus be returned as description
+ * for all uris with a local authority and the specified path-section.
+ */
+class BundleFsLoader extends BundleListener with Logger with WeightedTcProvider {
+
+  private val RESOURCE_MGRAPH_URI = new UriRef(Constants.URN_LOCAL_INSTANCE+"/web-resources.graph")
+  private val cacheGraphPrefix = Constants.URN_LOCAL_INSTANCE+"/web-resources-cache.graph"
+  private var currentCacheUri: UriRef = null
+
+  private var tcManager: TcManager = null
+  private var cgProvider: ContentGraphProvider = null
+  private var startLevel: StartLevel = null
+  private var pathNodes: List[PathNode] = Nil 
+  private var bundleList = List[Bundle]()
+  private var currentCacheMGraph: MGraph = null
+  
+  private var frequentUpdateDirectory: Option[PathNode] = None
+
+  private val virtualMGraph: MGraph = new AbstractMGraph() {
+    
+    private def baseGraph: TripleCollection = frequentUpdateDirectory match {
+        case Some(p) => new DirectoryOverlay(p, currentCacheMGraph)
+        case None => currentCacheMGraph
+    }
+    
+    override def performFilter(s: NonLiteral, p: UriRef,
+                      o: Resource): java.util.Iterator[Triple] = {
+      val baseIter = baseGraph.filter(s,p,o)
+      new java.util.Iterator[Triple]() {
+        override def next = {
+          baseIter.next
+        }
+        override def hasNext = baseIter.hasNext
+        override def remove = throw new UnsupportedOperationException
+      }
+    }
+
+    override def size = baseGraph.size
+    
+    override def toString = "BundleFsLoader virtual graph"
+    
+  }
+
+  class UpdateThread extends Thread {
+
+    private var updateRequested = false;
+
+    start()
+
+    override def run() {
+      try {
+        while (!isInterrupted) {
+          synchronized {
+            while (!updateRequested) wait();
+          }
+          updateRequested = false
+          updateCache()
+        }
+      } catch {
+        case e: InterruptedException => BundleFsLoader.log.debug("Update thread interrupted");
+      }
+    }
+
+    def update() = {
+      synchronized {
+        updateRequested = true
+        notify();
+      }
+    }
+  }
+  
+  private var updateThread: UpdateThread = null
+
+
+  private def deleteCacheGraphs() {
+    import collection.JavaConversions._
+    for(mGraphUri <- tcManager.listMGraphs) {
+      if(mGraphUri.getUnicodeString.startsWith(cacheGraphPrefix)) {
+        tcManager.deleteTripleCollection(mGraphUri);
+      }
+    }
+  }
+
+  protected def activate(context: ComponentContext) {
+    synchronized {
+      deleteCacheGraphs()
+      for (bundle <- context.getBundleContext().getBundles();
+          if bundle.getState == Bundle.ACTIVE) {
+        bundleList ::= bundle
+      }
+      updateCache
+      tcManager.getTcAccessController.setRequiredReadPermissions(
+          RESOURCE_MGRAPH_URI, Collections.singleton(new TcPermission(Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ)))
+      cgProvider.addTemporaryAdditionGraph(RESOURCE_MGRAPH_URI)
+      updateThread = new UpdateThread()
+      context.getBundleContext().addBundleListener(this);
+    }
+  }
+  protected def deactivate(context: ComponentContext) {
+    synchronized {
+      context.getBundleContext().removeBundleListener(this);
+      updateThread.interrupt()
+      cgProvider.removeTemporaryAdditionGraph(RESOURCE_MGRAPH_URI)
+      tcManager.deleteTripleCollection(currentCacheUri);
+      updateThread == null;
+    }
+  }
+
+  private def updateCache() = {
+    def getVirtualTripleCollection(bundles: Seq[Bundle]): TripleCollection = {
+      if (bundles.isEmpty) {
+        new SimpleMGraph()
+      } else {
+        val pathNode = new BundlePathNode(bundles.head, "CLEREZZA-INF/web-resources");
+        if (pathNode.isDirectory) {
+          BundleFsLoader.log.debug("Creating directory overlay for "+bundles.head)
+          new DirectoryOverlay(pathNode, getVirtualTripleCollection(bundles.tail))
+        } else {
+          getVirtualTripleCollection(bundles.tail)
+        }
+      }
+    }
+    synchronized {
+      val sortedList = Sorting.stableSort(bundleList, (b:Bundle) => -startLevel.getBundleStartLevel(b))
+      val newCacheUri = new UriRef(cacheGraphPrefix+System.currentTimeMillis)
+      val newChacheMGraph = tcManager.createMGraph(newCacheUri);
+      tcManager.getTcAccessController.setRequiredReadPermissions(
+          newCacheUri, Collections.singleton(new TcPermission(Constants.CONTENT_GRAPH_URI_STRING, TcPermission.READ)))
+      newChacheMGraph.addAll(getVirtualTripleCollection(sortedList))
+      currentCacheMGraph = newChacheMGraph
+      val oldCacheUri = currentCacheUri
+      currentCacheUri = newCacheUri
+      if (oldCacheUri != null) tcManager.deleteTripleCollection(oldCacheUri);
+      BundleFsLoader.log.debug("updated web-resource cache")
+    }
+  }
+
+  
+
+  override def getWeight() = 30
+
+  override def getMGraph(name: UriRef) = {
+    if (name.equals(RESOURCE_MGRAPH_URI)) {
+      virtualMGraph
+    } else {
+      throw new NoSuchEntityException(name);
+    }
+  }
+
+  override def getTriples(name: UriRef) = {
+    getMGraph(name);
+  }
+
+  override def getGraph(name: UriRef) = {
+    throw new NoSuchEntityException(name);
+  }
+
+
+  override def listMGraphs(): java.util.Set[UriRef] = {
+    java.util.Collections.singleton(RESOURCE_MGRAPH_URI);
+  }
+
+  override def listGraphs() = {
+    new java.util.HashSet[UriRef]();
+  }
+
+  override def listTripleCollections() = {
+    Collections.singleton(RESOURCE_MGRAPH_URI);
+  }
+
+  override def createMGraph(name: UriRef) =  {
+    throw new UnsupportedOperationException("Not supported.");
+  }
+
+  override def createGraph(name: UriRef, triples: TripleCollection): Graph = {
+    throw new UnsupportedOperationException("Not supported.");
+  }
+
+  override def deleteTripleCollection(name: UriRef) {
+    throw new UnsupportedOperationException("Not supported.");
+  }
+
+  override def getNames(graph: Graph) = {
+    val result = new java.util.HashSet[UriRef]();
+    result;
+  }
+
+
+  def bundleChanged(event: BundleEvent) {
+    val updateThread = this.updateThread
+    if (updateThread == null) {
+      BundleFsLoader.log.error("UpdateThread is null, yet we get bundle Events")
+    }
+    val bundle = event.getBundle();
+    event.getType() match  {
+      case BundleEvent.STARTED => {
+        bundleList ::= bundle
+        updateThread.update()
+      }
+      case BundleEvent.STOPPED => {
+        bundleList = bundleList.filterNot(b => b == bundle)
+        updateThread.update()
+      }
+      case _ => BundleFsLoader.log.debug("only reacting on bundle start and stop")
+    }
+  }
+
+
+  def bindTcManager(tcManager: TcManager) {
+    this.tcManager = tcManager;
+  }
+
+  def unbindTcManager(tcManager: TcManager) {
+    this.tcManager = null;
+  }
+
+  def bindContentGraphProvider(p: ContentGraphProvider) {
+    cgProvider = p
+  }
+
+  def unbindContentGraphProvider(p: ContentGraphProvider) {
+    cgProvider = null
+  }
+
+  def bindStartLevel(startLevel: StartLevel) {
+    this.startLevel = startLevel;
+  }
+
+  def unbindStartLevel(startLevel: StartLevel) {
+    this.startLevel = null;
+  }
+  
+  def bindPathNode(pathNode: PathNode) {
+    this.pathNodes ::= pathNode;
+    frequentUpdateDirectory = Some(new MultiPathNode(pathNodes: _*))
+  }
+  
+  def unbindPathNode(pathNode: PathNode) {
+    this.pathNodes = this.pathNodes.filter(_ != pathNode);
+    frequentUpdateDirectory = pathNodes match {
+      case Nil => None
+      case _ => Some(new MultiPathNode(pathNodes: _*))
+    }
+  }
+  
+}
+object BundleFsLoader {
+  private val log = LoggerFactory.getLogger(classOf[BundleFsLoader])
+}
\ No newline at end of file


[17/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/resources/documentation/style/style.css b/platform/launcher.sesame/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..f49a186
--- /dev/null
+++ b/platform/launcher.sesame/src/site/resources/documentation/style/style.css
@@ -0,0 +1,419 @@
+/*
+ * 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.
+ */
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/resources/images/clerezza.png b/platform/launcher.sesame/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/launcher.sesame/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/site.xml b/platform/launcher.sesame/src/site/site.xml
new file mode 100644
index 0000000..62c8fd3
--- /dev/null
+++ b/platform/launcher.sesame/src/site/site.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland).
+ * 
+ * Licensed 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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Information" href="documentation/information.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/xsite/content/information.xhtml
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/xsite/content/information.xhtml b/platform/launcher.sesame/src/site/xsite/content/information.xhtml
new file mode 100644
index 0000000..29649bf
--- /dev/null
+++ b/platform/launcher.sesame/src/site/xsite/content/information.xhtml
@@ -0,0 +1,41 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Clerezza platform launcher with Sesame storage</title>
+	</head>
+	<body>
+		<h1>Clerezza platform launcher with Sesame storage</h1>
+		<p>Author: Manuel Innerhofer - clerezza.org</p>
+		<p>Date: June 24, 2009</p>
+		<h2 id="information">Information</h2>
+		<p>
+			This is a launcher for the clerezza platform. It uses Sesame as
+			rdf storage. For further information on how to use this launcher read
+			the documentation of the storageless launcher under
+            <br />
+			<a href="http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/" target="_blank">http://clerezza.org/projects/org.apache.clerezza.platform.launcher.storageless/</a>
+		</p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/xsite/content/sitemap.xml b/platform/launcher.sesame/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..2c8f86d
--- /dev/null
+++ b/platform/launcher.sesame/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,26 @@
+<!--
+
+ 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.
+
+-->
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>information.xhtml</page>
+    </section>
+</sitemap>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.sesame/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/launcher.sesame/src/site/xsite/templates/skin.html b/platform/launcher.sesame/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..8dc930d
--- /dev/null
+++ b/platform/launcher.sesame/src/site/xsite/templates/skin.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+
+ 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 xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2008-2009 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/LICENSE
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/LICENSE b/platform/launcher.storageless.parent/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/launcher.storageless.parent/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/LICENSE
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/LICENSE b/platform/launcher.storageless.parent/platform.launcher.storageless/LICENSE
new file mode 100644
index 0000000..e8d41e4
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/LICENSE
@@ -0,0 +1,471 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+APACHE CLEREZZA TDB LAUNCHER SUBCOMPONENTS: 
+
+The Apache Clerezza TDB Launcher includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses. 
+
+For the yui javascript library:
+
+Copyright (c) 2009, Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * 	Redistributions of source code must retain the above copyright notice, this list of conditions and the
+     	following disclaimer.
+    * 	Redistributions in binary form must reproduce the above copyright notice, this 	list of conditions and the following disclaimer in the documentation and/or other 	materials provided with the distribution.
+    * 	Neither the name of Yahoo! Inc. nor the names of its contributors may be used 	to endorse or promote products derived from this software without specific prior written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the jQuery javascript library:
+
+Copyright (c) 2011 John Resig, http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For Asm:
+
+Copyright (c) 2000-2011 INRIA, France Telecom
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+For Bouncycastle:
+
+Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+For the RDFa parsing library:
+
+© Copyright 2009 University of Bristol
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS’’ AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+- For the jSSLutils library:
+  
+Copyright (c) 2008-2010, The University of Manchester, United Kingdom.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the The University of Manchester nor the names of 
+      its contributors may be used to endorse or promote products derived 
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+POSSIBILITY OF SUCH DAMAGE.
+
+
+For Jetty:
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+- For scala:
+
+Copyright (c) 2002-2012 EPFL, Lausanne, unless otherwise specified.
+All rights reserved.
+
+This software was developed by the Programming Methods Laboratory of the
+Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland.
+
+Permission to use, copy, modify, and distribute this software in source
+or binary form for any purpose with or without fee is hereby granted,
+provided that the following conditions are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+   3. Neither the name of the EPFL nor the names of its contributors
+      may be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/pom.xml
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/pom.xml b/platform/launcher.storageless.parent/platform.launcher.storageless/pom.xml
new file mode 100644
index 0000000..3ca6aa1
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/pom.xml
@@ -0,0 +1,417 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.launcher.storageless.parent</artifactId>
+        <version>0.9-SNAPSHOT</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.launcher.storageless</artifactId>
+    <version>0.9-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Clerezza - Platform Launcher Storageless</name>
+    <description>A standalone java application for launching the clerezza.org platform. It is also a bundle, but there is no OSGi container known to support this (we are working on it :-) ).
+    </description>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.xsite</groupId>
+                <artifactId>xsite-maven-plugin</artifactId>
+                <configuration>
+                    <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                    <sitemapPath>content/sitemap.xml</sitemapPath>
+                    <skinPath>templates/skin.html</skinPath>
+                    <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>pre-site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-scr-scrdescriptor</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Bundles to list in the installer properties file -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-shell</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-4</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeScope>runtime</includeScope>
+                            <includeArtifactIds>shell</includeArtifactIds>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-rdf-core</id>
+                        <!-- the tc-manager should be activated after the provider -->
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-4</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeArtifactIds>rdf.core</includeArtifactIds>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-platform-bundles</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-3</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeScope>runtime</includeScope>
+                            <excludeArtifactIds>rdf.core,slf4j-api,platform.security,platform.security.conditions,shell,org.apache.stanbol.commons.frameworkfragment</excludeArtifactIds>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <id>copy-framework-bundles</id>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-2</outputDirectory>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <excludeTransitive>true</excludeTransitive>
+                            <!-- <excludeScope>compile</excludeScope> -->
+                            <includeScope>provided</includeScope>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <!-- this is a temporary hack to make sure the system-graph gets created -->
+                        <id>copy-security-as-framework-bundles</id>
+                        <configuration>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-2</outputDirectory>
+                            <includeArtifactIds>platform.security</includeArtifactIds>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <!-- After the security fragment is loaded other fragments 
+                        are no longer accepted, so having them here  -->
+                        <id>copy-extension-bundles</id>
+                        <configuration>
+                            <useRepositoryLayout>true</useRepositoryLayout>
+                            <outputDirectory>${basedir}/target/bundles/startlevel-1</outputDirectory>
+                            <includeArtifactIds>platform.security.conditions,org.apache.stanbol.commons.frameworkfragment</includeArtifactIds>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>inline-jars</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>
+                                commons-logging-api,wymiwyg-commons-core,org.apache.felix.main,org.apache.felix.framework.security
+                            </includeArtifactIds>
+                            <outputDirectory>target/extracted</outputDirectory>
+                            <includes>**</includes>
+                            <excludes>
+                                META-INF/**
+                            </excludes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.clerezza.platform.launcher.Main</mainClass>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Bundle-Name>Clerezza - Platform Launcher</Bundle-Name>
+                            <Bundle-SymbolicName>org.apache.clerezza.platform.launcher.storageless</Bundle-SymbolicName>
+                            <Bundle-Activator>org.apache.clerezza.platform.launcher.ClerezzaActivator</Bundle-Activator>
+                            <Import-Package>org.osgi.framework,org.osgi.service.startlevel</Import-Package>
+                            <Private-Package>*</Private-Package>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <targetPath>META-INF</targetPath>
+                <filtering>false</filtering>
+                <directory>${basedir}</directory>
+                <includes>
+                    <include>NOTICE.txt</include>
+                    <include>LICENSE.*</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <!-- the exclude rules are here because the maven-dependency-plugin
+            copies both -SNAPSHOT version as well as the one with the timestamp,
+            see http://jira.codehaus.org/browse/MDEP-209 -->
+            <resource>
+                <targetPath>bundles</targetPath>
+                <directory>target/bundles</directory>
+                <excludes>
+                    <exclude>**/*20*.*-*.jar</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <targetPath>org</targetPath>
+                <directory>target/extracted/org</directory>
+            </resource>
+            <resource>
+                <directory>target/extracted/</directory>
+                <includes>
+                    <include>default.properties</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+    <dependencies>
+        <!-- the most important bundle after the framework: logging -->
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <scope>provided</scope>
+            <version>1.6.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <scope>provided</scope>
+            <version>1.6.2</version>
+            <!-- <exclusions>
+                <exclusion>
+                    <artifactId>jmxri</artifactId>
+                    <groupId>com.sun.jmx</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>jmxtools</artifactId>
+                    <groupId>com.sun.jdmk</groupId>
+                </exclusion>
+            </exclusions> -->
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>slf4j-scala-api</artifactId>
+            <scope>provided</scope>
+            <version>1.6.3</version>
+        </dependency>
+          <!-- Core Felix. -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.main</artifactId>
+            <scope>provided</scope>
+            <version>4.4.1</version>
+        </dependency>
+        <!-- framework bundles -->
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.webconsole</artifactId>
+            <scope>provided</scope>
+            <version>4.0.0</version>
+        </dependency>
+        <!-- needed by webconsole -->
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.2.2</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.bundles</groupId>
+            <artifactId>json</artifactId>
+            <version>20090211_1</version>
+        </dependency>
+        <!-- <dependency>
+            <groupId>org.ops4j.pax.web</groupId>
+            <artifactId>pax-web-jetty-bundle</artifactId>
+            <scope>provided</scope>
+            <version>0.7.2</version>
+        </dependency> -->
+        <!-- <dependency>
+            <groupId>org.wymiwyg</groupId>
+            <artifactId>jetty-osgi-httpservice</artifactId>
+            <scope>provided</scope>
+            <version>0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.equinox.http</groupId>
+            <artifactId>servlet</artifactId>
+            <scope>provided</scope>
+            <version>1.0.0-v20070606</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlet</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-util</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-io</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-continuation</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-http</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-security</artifactId>
+            <scope>provided</scope>
+            <version>8.0.0.M2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+            <version>3.0.20100224</version>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.http.jetty</artifactId>
+            <version>2.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.http.whiteboard</artifactId>
+            <version>2.2.0</version>
+        </dependency>
+        <!-- Apache Felix framework bundles -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.bundlerepository</artifactId>
+            <scope>provided</scope>
+            <version>1.6.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.eventadmin</artifactId>
+            <scope>provided</scope>
+            <version>1.3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr</artifactId>
+            <scope>provided</scope>
+            <version>1.6.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <scope>provided</scope>
+            <version>1.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.metatype</artifactId>
+            <scope>provided</scope>
+            <version>1.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.shell</artifactId>
+            <scope>provided</scope>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework.security</artifactId>
+            <scope>provided</scope>
+            <version>2.4.0</version>
+        </dependency>
+        <!-- support for parameterhandling, etc -->
+        <dependency>
+            <groupId>org.wymiwyg</groupId>
+            <artifactId>wymiwyg-commons-core</artifactId>
+            <!-- runtime only in parent -->
+        </dependency>
+
+        <!-- support for mvn URIs (to make updating easier -->
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-mvn</artifactId>
+            <version>1.3.2</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/appended-resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/appended-resources/META-INF/NOTICE b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/appended-resources/META-INF/NOTICE
new file mode 100644
index 0000000..7d1928c
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/appended-resources/META-INF/NOTICE
@@ -0,0 +1,18 @@
+
+- Mort Bay Jetty Project (http://www.mortbay.org/jetty/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- WYMIWYG (http://wymiwyg.org/)
+- HP Labs Semantic Web Research (http://www.hpl.hp.com/semweb/)
+- The OSGi Alliance (http://www.osgi.org/)
+- Yahoo! Inc. (http://yahoo.com/)
+- Eclipse Foundation (http://eclipse.org/)
+- INRIA, France Telecom (http://asm.ow2.org/)
+- The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+- University of Bristol (http://stars.ilrt.bris.ac.uk/)
+- The University of Manchester (http://www.manchester.ac.uk/)
+- Open Participation Software for Java (http://www.ops4j.org/)
+- EPFL, Lausanne (http://www.epfl.ch/)
+
+This product includes JQuery and other javascript 
+files Licensed under the MIT License, see the individual
+files for their copyright notice.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaActivator.java
----------------------------------------------------------------------
diff --git a/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaActivator.java b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaActivator.java
new file mode 100644
index 0000000..c6b529c
--- /dev/null
+++ b/platform/launcher.storageless.parent/platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/ClerezzaActivator.java
@@ -0,0 +1,73 @@
+/*
+ * 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.launcher;
+
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.startlevel.StartLevel;
+
+/**
+ * OSGi Clerezza Launcher Bundle Activator.
+ *
+ * @author daniel
+ */
+public class ClerezzaActivator implements BundleActivator {
+
+    @Override
+    public void start(BundleContext context) throws Exception {
+        System.out.println("starting platform launcher");
+        ServiceReference startLevelRef =
+                context.getServiceReference(StartLevel.class.getName());
+        StartLevel startLevel = (StartLevel) context.getService(startLevelRef);
+        final int currentBundleStartLevel =
+                startLevel.getBundleStartLevel(context.getBundle());
+        startLevel.setStartLevel(currentBundleStartLevel);
+        final int originalStartLevel = startLevel.getStartLevel();
+        int nextLevel = currentBundleStartLevel + 1;
+        Enumeration<URL> bundleJars =
+                context.getBundle().findEntries("platform-bundles", "*.jar", true);
+        Set<MavenArtifactDesc> artDescs = new HashSet<MavenArtifactDesc>();
+
+        while (bundleJars.hasMoreElements()) {
+            MavenArtifactDesc artDesc =
+                    MavenArtifactDesc.parseFromURL(bundleJars.nextElement());
+            artDescs.add(artDesc);
+        }
+        ClerezzaApp.installBundles(context, artDescs, nextLevel);
+
+        final int newStartLevel =
+                originalStartLevel > nextLevel + 1 ? originalStartLevel : nextLevel + 1;
+        startLevel.setStartLevel(newStartLevel);
+        if (startLevel.getInitialBundleStartLevel() < nextLevel + 1) {
+            startLevel.setInitialBundleStartLevel(nextLevel + 1);
+        }
+        System.out.println("uninstalling platform launcher");
+        context.getBundle().uninstall();
+    }
+
+    @Override
+    public void stop(BundleContext context) throws Exception {
+    }
+}


[30/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/site/resources/documentation/style/style.css
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/site/resources/documentation/style/style.css b/platform/dashboard/platform.dashboard.core/src/site/resources/documentation/style/style.css
new file mode 100644
index 0000000..ff49a4d
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/site/resources/documentation/style/style.css
@@ -0,0 +1,421 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*---------------------------------------------------------------------------
+ *  Two- and three-column layout
+ */
+
+#banner {
+    top: 0px;
+    left: 0px;
+    right: 0px;
+    height: 116px;
+}
+
+#left {
+    position: absolute;
+    z-index: 2;
+    left: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+#right {
+    position: absolute;
+    z-index: 1;
+    right: 8px;
+    width: 184px;
+    top: 125px;
+    bottom: 8px;
+    margin: 0px;
+    padding: 0px;
+}
+
+.Content3Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 216px;
+}
+
+.Content2Column {
+    position: absolute;
+    top: 125px;
+    bottom: 8px;
+    left: 208px;
+    right: 16px;
+}
+
+#center {
+    z-index: 3;
+    margin: 0px;
+    border: none;
+    padding-bottom: 8px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Default element styles
+ */
+
+body {
+    padding: 0px;
+    margin: 0px;
+    border: 0px;
+
+    font-family: helvetica, arial, sans-serif;
+    font-size: 12px;
+
+    background-color: white;
+    color: black;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    margin: 0px;
+    border: 0px;
+    padding: 0px;
+    font-weight: normal;
+}
+
+a:link { color: #008DA8; }
+a:active { color: #FE5400; }
+a:hover { color: #FE5400; }
+a:visited { color: black; }
+
+iframe {
+    width:100%;
+    height: 800px;
+    border: 0px;
+}
+
+img {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+}
+
+p {
+    border: 0px;
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 10px;
+}
+
+blockquote {
+    margin-bottom: 10px;
+}
+
+td {
+    font-size: 12px;
+    padding: 2px;
+}
+
+tr.a {
+    background-color:  #e0e0e0;
+}
+tr.b {
+    background-color: #ffffff;
+}
+
+th {
+    font-size: 12px;
+    font-weight: bold;
+    white-space: nowrap;
+    padding: 2px;
+}
+
+th.Row {
+    text-align: left;
+    vertical-align: top;
+}
+
+ul, ol {
+    border: 0px;
+    padding: 0px;
+    margin-top: 0px;
+    margin-bottom: 12px;
+    margin-left: 20px;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  Page banner
+ */
+
+#banner {
+    margin: 0px;
+    border: 0px;
+    border-bottom: 1px solid #008DA8;
+    padding: 0px;
+    background-color: #e0e0e0;
+    color: #008DA8;
+    vertical-align: bottom;
+}
+
+#banner a { text-decoration: none; }
+#banner a:visited { color: #008DA8; }
+#banner a:hover { color: #FE5400; }
+#banner a:active { color: #FE5400; }
+
+#logo {
+    position: absolute;
+    top: 5px;
+    left: 8px;
+}
+
+#versions {
+    position: absolute;
+    width: auto;
+    right: 0px;
+    top: 0px;
+    margin: 8px;
+    font-weight: normal;
+}
+
+/*---------------------------------------------------------------------------
+ *  Page content
+ */
+
+#content {
+    margin: 0px;
+    background-color: white;
+    color: black;
+    height: 100%;
+}
+
+#content h1 {
+    width: 100%;
+    font-size: 18px;
+    background-color: #008DA8;
+    color: white;
+    padding: 2px;
+    padding-left: 6px;
+    margin-top: 24px;
+    margin-bottom: 12px;
+}
+
+#content .FirstChild {  /* IE doesn't understand first-child pseudoelement */
+    margin-top: 0px;
+}
+
+#content a { text-decoration: underline; }
+#content a:link { color: #008DA8; }
+#content a:visited { color: #008DA8; }
+#content a:active { color: #FE5400; }
+#content a:hover { color: #FE5400; }
+
+#content h2 {
+    margin-top: 24px;
+    border-top: 1px solid #008DA8;
+    margin-bottom: 16px;
+    font-size: 15px;
+    font-weight: bold;
+    background-color:  #e0e0e0;;
+    padding: 2px;
+}
+
+#content li {
+    margin-bottom: 6px;
+}
+
+#content th {
+    background-color:  #e0e0e0;
+}
+
+#content td {
+    
+}
+
+.Source pre {
+    padding: 4px;
+    font-family: courier new, monospace;
+    font-size: 11px;
+    border: 1px solid #008DA8;
+    background-color:  #e0e0e0;
+    color: black;
+}
+
+.Source:before {
+    margin: 0px;
+    padding: 0px;
+    border: 0px;
+    font-size: inherit;
+    line-spacing: 100%;
+}
+
+.highlight {
+    background-color:  #e0e0e0;
+    border: 1px dotted #008DA8;
+    padding: 5px;
+}
+
+/* The following are for images, but can also apply to div's containing images. */
+
+#content .Float {
+    float: right;
+    margin-left: 8px;
+    margin-right: 0px;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+#content .Diagram {
+    display: block;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 8px;
+    margin-bottom: 8px;
+}
+
+
+#content .Inline {
+    display: inline;
+}
+
+.RuleOfThumb {
+    font-weight: bold;
+}
+
+/*---------------------------------------------------------------------------
+ *  Side panels
+ */
+
+.SidePanel {
+    background-color: white;
+    padding: 0px;
+    font-size: 11px;
+}
+
+.SidePanel h1 {
+    margin: 0px;
+    border: 0px;
+    padding: 4px;
+
+    color: #008DA8;
+
+    font-size: 12px;
+    font-weight: bold;
+}
+
+
+.SidePanel a { text-decoration: none; }
+.SidePanel a:link { color: #000000; }
+.SidePanel a:visited { color: #000000; }
+.SidePanel a:active { color: #FE5400; }
+.SidePanel a:hover { color: #FE5400; }
+
+/*---------------------------------------------------------------------------
+ *  Menus
+ */
+
+.MenuGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE work-around */
+
+    margin-bottom: 8px;
+    background-color: white;
+    color: #008DA8;
+}
+
+.MenuGroup ul {
+    margin: 0px;
+    padding-left: 4px;
+    list-style-type: none;
+}
+
+.MenuGroup li {
+    padding: 2px;
+}
+
+.MenuGroup .currentLink {
+/*    background-color: #060;*/
+    background-color:  #e0e0e0;
+    color: #008DA8;
+}
+
+
+/*---------------------------------------------------------------------------
+ *  News panel
+ */
+
+.NewsGroup {
+    border-left: 1px solid #A3DAE6;
+    border-top: 1px solid #A3DAE6;
+    border-bottom: 1px solid white; /* IE workaround */
+    margin-bottom: 8px;
+
+    color: #008DA8;
+}
+
+.NewsItem {
+    margin: 4px;
+}
+
+.NewsDate {
+    font-weight: bold;
+    margin: 0px;
+    padding: 0px;
+}
+
+.NewsText {
+    padding: 0px;
+    margin: 0px;
+    margin-bottom: 8px;
+}
+
+.NewsText a { text-decoration: underline; }
+.NewsText a:link { color: #008DA8; }
+.NewsText a:visited { color: #008DA8; }
+.NewsText a:active { color: #FE5400; }
+.NewsText a:hover { color: #FE5400; }
+
+.NewsMore {
+    font-size: smaller;
+    margin: 4px;
+    margin-top: 8px;
+    text-align: left;
+}
+
+.NewsGroup td {
+    font-size: 12px;
+}
+
+/*---------------------------------------------------------------------------
+ *  Document meta-information
+ */
+
+.Meta {
+    margin-top: 64px;
+    font-size: smaller;
+    color: #008DA8;
+    text-align: right;
+}
+
+.Meta a { text-decoration: underline; }
+.Meta a:link { color: #008DA8; }
+.Meta a:visited { color: #008DA8; }
+.Meta a:active { color: #FE5400; }
+.Meta a:hover { color: #FE5400; }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/site/resources/images/clerezza.png
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/site/resources/images/clerezza.png b/platform/dashboard/platform.dashboard.core/src/site/resources/images/clerezza.png
new file mode 100644
index 0000000..cb0efb0
Binary files /dev/null and b/platform/dashboard/platform.dashboard.core/src/site/resources/images/clerezza.png differ

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/site/site.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/site/site.xml b/platform/dashboard/platform.dashboard.core/src/site/site.xml
new file mode 100644
index 0000000..8d5a4cb
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/site/site.xml
@@ -0,0 +1,30 @@
+<?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.
+ */
+-->
+
+<project>
+    <body>
+        <menu name="Documentation">
+            <item name="Usage" href="documentation/usage.xhtml"/>
+        </menu>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/site/xsite/content/sitemap.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/site/xsite/content/sitemap.xml b/platform/dashboard/platform.dashboard.core/src/site/xsite/content/sitemap.xml
new file mode 100644
index 0000000..1df89fc
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/site/xsite/content/sitemap.xml
@@ -0,0 +1,26 @@
+<!--
+
+ 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.
+
+-->
+<sitemap>
+    <section>
+        <name>Documentation</name>
+        <page>usage.xhtml</page>
+    </section>
+</sitemap>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/site/xsite/content/usage.xhtml
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/site/xsite/content/usage.xhtml b/platform/dashboard/platform.dashboard.core/src/site/xsite/content/usage.xhtml
new file mode 100644
index 0000000..f7fee85
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/site/xsite/content/usage.xhtml
@@ -0,0 +1,70 @@
+<?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.
+ */
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
+	<head>
+		<title>Usage: How to use the dashboard service</title>
+	</head>
+	<body>
+		<h1>Usage: How to use the dashboard service</h1>
+		<p>Author: Tsuyoshi Ito - clerezza.org</p>
+		<p>Date: June 7, 2009</p>
+		<h2 id="access">Using the service</h2>
+		<p>
+			A JaxRs resource can reference the service <code>org.apache.clerezza.platform.dashboard.DashBoard</code> and 
+			can use the Method createGraphNodeWithDashBoardMenu to add the dashboard menu to a created graph 
+			of the JaxRs Resource. 
+			<br />
+            <br />
+			JaxRs resources can register themselves to  the dashboard by adding the service properties: 
+            <ul> 
+            <li><code>@scr.property name="org.apache.clerezza.platform.dashboard.visible" type="Boolean" value="true""org.apache.clerezza.platform.dashboard.visible" type="Boolean" value="true", </code></li>
+            <li><code>@scr.property type="String" value="Name of module/bundle" description="Specifies the label of the menu entry."</code>,</li>    
+            <li><code>@scr.property type="String" value="XY" description="Specifies the the group label"</code>, and </li>
+            <li><code>@scr.property type="Integer" value="0" description="Specifies the index of the entry in the menu"</code>.  </li>         
+            </ul>
+            <br />, 
+            <br />
+            
+		</p>
+        <h2 id="access">Add dashboard to seedsnipe template</h2>
+		<p>
+			 Insert the following javascript references <code>/jquery/jquery-1.3.2.min.js</code> and <code>/jquery/jquery.menu.js</code>.             
+             
+             After the tag &lt;body> of your template insert the follwing code:
+         	&lt;div id="header">
+			
+			${render(dhb:includeDashBoardMenu, "naked")}
+            
+			
+			&lt;h1>Titel of Bundle&lt;/h1>
+			
+			&lt;/div>
+			<br />
+            <br />
+		</p>
+        <p>
+            That's all. Enjoy.
+        </p>
+    </body>
+</html>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/site/xsite/templates/skin.html
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/site/xsite/templates/skin.html b/platform/dashboard/platform.dashboard.core/src/site/xsite/templates/skin.html
new file mode 100644
index 0000000..6ce9762
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/site/xsite/templates/skin.html
@@ -0,0 +1,71 @@
+<!--
+
+ 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.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>clerezza.org - ${title}</title>
+        <link rel="stylesheet" type="text/css" href="style/style.css"/>
+        ${head}
+    </head>
+    <body>
+
+        <div id="banner">
+            <a href="http://clerezza.org/">
+              <img id="logo" src="../images/clerezza.png" alt="clerezza.org"/>
+            </a><br />
+        </div>
+
+        <div id="center" class="${centerClass}">
+            <div id="content">
+                <!-- <h1 class="FirstChild">${title}</h1> -->
+                ${body}
+                <p>Copyright (c) 2009 trialox.org (trialox AG, Switzerland)</p>
+                <br /><br />
+            </div>
+        </div>
+
+        <div class="SidePanel" id="left">
+            <#list sitemap.sections as section>
+                <div class="MenuGroup">
+                    <h1>${section.name}</h1>
+                    <ul>
+                        <#list section.entries as entry>
+                            <#if entry = page>
+                                <li class="currentLink">${entry.title}</li>
+                            <#else>
+                                <li><a href="${entry.href}">${entry.title}</a></li>
+                            </#if>
+                        </#list>
+                    </ul>
+                </div>
+            </#list>
+            <div class="MenuGroup">
+                  <h1>Project Site</h1>
+                  <ul>
+
+                              <li><a href="../index.html">Back to project site</a></li>
+                  </ul>
+              </div>
+        </div>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.ontologies/LICENSE b/platform/dashboard/platform.dashboard.ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.ontologies/pom.xml b/platform/dashboard/platform.dashboard.ontologies/pom.xml
new file mode 100644
index 0000000..037753d
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.ontologies/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.dashboard</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.dashboard.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Dashboard Ontologies</name>
+    <description>
+        Dashboard Ontologies
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/dashboard.rdf
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/dashboard.rdf b/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/dashboard.rdf
new file mode 100644
index 0000000..a1077c6
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/dashboard.rdf
@@ -0,0 +1,50 @@
+<?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.
+
+-->
+
+<rdf:RDF
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:skos="http://www.w3.org/2008/05/skos#"
+>
+
+<!-- Ontology -->
+
+<owl:Ontology rdf:about="http://clerezza.org/2009/06/dashboard#">
+	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
+	<dc:title xml:lang="en">
+		Clerezza Dashboard
+	</dc:title>
+</owl:Ontology>
+
+
+<!-- Classes -->
+
+<rdfs:Class rdf:about="http://clerezza.org/2009/06/dashboard#DashBoard">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+	<rdfs:label xml:lang="en">Dashboard</rdfs:label>
+	<skos:definition xml:lang="en">A page containing information of the dashboard.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/06/dashboard#" />
+</rdfs:Class>
+
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/globalmenu.rdf
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/globalmenu.rdf b/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/globalmenu.rdf
new file mode 100644
index 0000000..846af57
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.ontologies/src/main/resources/org/apache/clerezza/platform/dashboard/ontologies/globalmenu.rdf
@@ -0,0 +1,87 @@
+<?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.
+
+-->
+
+<rdf:RDF
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:skos="http://www.w3.org/2008/05/skos#"
+>
+
+<!-- Ontology -->
+
+<owl:Ontology rdf:about="http://clerezza.org/2009/11/global-menu#">
+	<owl:versionInfo>Revision: 0.1</owl:versionInfo>
+	<dc:title xml:lang="en">
+		Clerezza Global Menu
+	</dc:title>
+</owl:Ontology>
+
+
+<!-- Classes -->
+
+<rdfs:Class rdf:about="http://clerezza.org/2009/11/global-menu#MenuItem">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+	<rdfs:label xml:lang="en">MenuItem</rdfs:label>
+	<skos:definition xml:lang="en">An item within a menu</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/11/globalMenu#" />
+</rdfs:Class>
+
+<rdfs:Class rdf:about="http://clerezza.org/2009/11/global-menu#Menu">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+	<rdfs:label xml:lang="en">Menu</rdfs:label>
+	<skos:definition xml:lang="en">A labled menu with menu items and/or other
+		menus as children.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/11/globalMenu#" />
+</rdfs:Class>
+
+<!-- Properties -->
+
+<rdf:Property rdf:about="http://clerezza.org/2009/11/global-menu#globalMenu">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty" />
+	<rdfs:label xml:lang="en">globalMenu</rdfs:label>
+	<skos:definition xml:lang="en">Points to the rdf list containing menu items
+	and/or menus.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/11/globalMenu#" />
+	<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List" />
+</rdf:Property>
+
+<rdf:Property rdf:about="http://clerezza.org/2009/11/global-menu#children">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty" />
+	<rdfs:label xml:lang="en">globalMenu</rdfs:label>
+	<skos:definition xml:lang="en">Points to an rdf list containing
+		the children of the subject.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/11/globalMenu#" />
+	<rdfs:domain rdf:resource="http://clerezza.org/2009/11/global-menu#Menu" />
+	<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List" />
+</rdf:Property>
+<rdf:Property rdf:about="http://clerezza.org/2009/11/global-menu#path">
+	<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty" />
+	<rdfs:label xml:lang="en">path</rdfs:label>
+	<skos:definition xml:lang="en">Points to the URI path of the subject.</skos:definition>
+	<rdfs:isDefinedBy rdf:resource="http://clerezza.org/2009/11/globalMenu#" />
+	<rdfs:domain rdf:resource="http://clerezza.org/2009/11/global-menu#MenuItem" />
+	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
+</rdf:Property>
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.tests/LICENSE
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.tests/LICENSE b/platform/dashboard/platform.dashboard.tests/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.tests/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.tests/pom.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.tests/pom.xml b/platform/dashboard/platform.dashboard.tests/pom.xml
new file mode 100644
index 0000000..6e2a418
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.tests/pom.xml
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>platform.dashboard</artifactId>
+        <groupId>org.apache.clerezza</groupId>
+        <version>0.4-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.dashboard.tests</artifactId>
+    <version>0.2-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Clerezza - Platform Dashboard Tests</name>
+    <description>Tests for Dashboard in an OSGi container.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <scope>provided</scope>
+            <version>0.13-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <scope>provided</scope>
+            <version>0.7-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <scope>provided</scope>
+            <version>0.3-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.ontologies</artifactId>
+            <scope>provided</scope>
+            <version>0.3-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <scope>provided</scope>
+            <version>0.4-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>                              
+            <artifactId>platform.typerendering.scala</artifactId>
+            <scope>provided</scope>
+            <version>0.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.scala.utils</artifactId>
+            <scope>provided</scope>
+            <version>0.4-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <scope>provided</scope>
+            <version>0.7-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <scope>provided</scope>
+            <version>0.14-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>permissiondescriptions</artifactId>
+            <scope>provided</scope>
+            <version>0.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils</artifactId>
+            <scope>provided</scope>
+            <version>0.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>org.json.simple</artifactId>
+            <scope>provided</scope>
+            <version>0.4-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <scope>provided</scope>
+            <version>0.3-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.dashboard.ontologies</artifactId>
+            <scope>provided</scope>
+            <version>0.3-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <scope>provided</scope>
+            <version>0.12-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>templating</artifactId>
+            <scope>provided</scope>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>templating.seedsnipe</artifactId>
+            <scope>provided</scope>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.extensions</artifactId>
+            <scope>provided</scope>
+            <version>0.6-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.wymiwyg</groupId>
+            <artifactId>wymiwyg-commons-core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>utils</artifactId>
+            <scope>provided</scope>
+            <version>0.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore-osgi</artifactId>
+            <scope>provided</scope>
+        </dependency>
+<!-- pax exam related stuff -->
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-default</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>servlet-api-2.5</artifactId>
+            <version>6.1.12</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>com.ibm.icu</artifactId>
+            <scope>provided</scope>
+            <version>0.6-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <!-- <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient-osgi</artifactId>
+            <version>4.0.1</version>
+            <scope>provided</scope>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.clerezza.scala</groupId>
+            <artifactId>scala-library-osgi</artifactId>
+            <scope>provided</scope>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.scala</groupId>
+            <artifactId>scala-compiler-osgi</artifactId>
+            <scope>provided</scope>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.scala</groupId>
+            <artifactId>script-engine</artifactId>
+            <scope>provided</scope>
+            <version>0.2-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <!-- no sources here, preventing failing invocation -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase/>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>maven-paxexam-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+    <!-- <repositories>
+        <repository>
+            <id>codehaus-repository</id>
+            <name>Codehaus Repository</name>
+            <url>http://repository.codehaus.org</url>
+        </repository>
+    </repositories> -->
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/FelixContextualMenuGeneratorTest.java
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/FelixContextualMenuGeneratorTest.java b/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/FelixContextualMenuGeneratorTest.java
new file mode 100644
index 0000000..808f567
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/FelixContextualMenuGeneratorTest.java
@@ -0,0 +1,195 @@
+/*
+ * 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.dashboard.blackbox.osgi;
+
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.*;
+import static org.ops4j.pax.exam.junit.JUnitOptions.*;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import junit.framework.Assert;
+import org.apache.clerezza.platform.dashboard.GlobalMenuItemsProvider;
+import org.apache.clerezza.platform.dashboard.ontologies.GLOBALMENU;
+import org.apache.clerezza.platform.typerendering.UserContextProvider;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.RdfList;
+import org.junit.Before;
+import org.junit.Test;
+import org.ops4j.pax.exam.Inject;
+import org.osgi.framework.BundleContext;
+
+import org.osgi.util.tracker.ServiceTracker;
+import org.wymiwyg.wrhapi.Handler;
+
+/**
+ *
+ * @author mir, reto
+ */
+@RunWith(JUnit4TestRunner.class)
+public class FelixContextualMenuGeneratorTest {
+    
+    @Configuration
+    public static Option[] configuration() {
+        return options(
+                mavenConfiguration(),
+                dsProfile(),
+                configProfile(),
+                webProfile(),
+                junitBundles(),
+                frameworks(
+                felix()),
+                systemProperty("org.osgi.service.http.port").value(
+                Integer.toString(testHttpPort)));
+    }
+
+
+    protected final static int testHttpPort = 8976;
+    @Inject
+    private BundleContext bundleContext;
+    
+    private boolean webServerExist;
+
+    @Before
+    public void registerServices() throws Exception {
+        System.out.println("@Before");
+        webServerExist = waitForWebserver();
+        if (webServerExist) {
+            waitFor(Handler.class, 10000);
+            bundleContext.registerService(GlobalMenuItemsProvider.class.getName(),
+                    new GlobalMenuItemsProviderA(), null);
+            Thread.sleep(10000);
+        }
+    }
+
+    @Test
+    public void checkMenu() throws Exception {
+        Assert.assertTrue(webServerExist);
+        UserContextProvider contextProvider = (UserContextProvider)
+                waitFor(UserContextProvider.class, 300000);
+        Assert.assertTrue(contextProvider != null);
+        GraphNode node = new GraphNode(new BNode(), new SimpleMGraph());
+        contextProvider.addUserContext(node);
+        Iterator<Resource> iter = node.getObjects(GLOBALMENU.globalMenu);
+        Assert.assertTrue(iter.hasNext());
+        TripleCollection graph = node.getGraph();
+        RdfList list = new RdfList((NonLiteral)iter.next(), graph);
+        Assert.assertEquals(3, list.size());
+        Assert.assertEquals(GlobalMenuItemsProviderA.groupALabel,
+                getLabel(graph, list.get(0)));
+        Assert.assertEquals(GlobalMenuItemsProviderA.groupCLabel,
+                getLabel(graph, list.get(1)));
+        Assert.assertEquals(GlobalMenuItemsProviderA.implicitGroupBLabel,
+                getLabel(graph, list.get(2)));        
+        Assert.assertEquals(GLOBALMENU.Menu, getRdfType(graph, list.get(0)));
+        Assert.assertEquals(GLOBALMENU.MenuItem, getRdfType(graph, list.get(1)));        
+        Assert.assertEquals(GlobalMenuItemsProviderA.groupAPath,
+                getPath(graph, list.get(0)));
+        RdfList children = getChildren(graph, list.get(0));
+        Assert.assertEquals(2, children.size());
+        Assert.assertEquals(GlobalMenuItemsProviderA.itemA2Label,
+                getLabel(graph, children.get(0)));
+        Assert.assertEquals(GlobalMenuItemsProviderA.itemA1Label,
+                getLabel(graph, children.get(1)));
+        Assert.assertEquals(GlobalMenuItemsProviderA.itemA2Path,
+                getPath(graph, children.get(0)));
+    }
+
+    private String getLabel(TripleCollection graph, Resource res) {
+        Iterator<Triple> labels = graph.filter((NonLiteral) res, RDFS.label, null);
+        if (labels.hasNext()) {
+            return ((Literal) labels.next().getObject()).getLexicalForm();
+        } else {
+            return null;
+        }
+    }
+
+    private String getPath(TripleCollection graph, Resource res) {
+        Resource path = graph.filter((NonLiteral) res,
+                GLOBALMENU.path, null).next().getObject();
+        return ((Literal) path).getLexicalForm();
+    }
+
+    private RdfList getChildren(TripleCollection graph, Resource res) {
+        NonLiteral children = (NonLiteral) graph.filter((NonLiteral) res,
+                GLOBALMENU.children, null).next().getObject();
+        return new RdfList(children, graph);
+    }
+
+    private UriRef getRdfType(TripleCollection graph, Resource res) {
+        return (UriRef) graph.filter((NonLiteral) res, RDF.type, null).next().
+                getObject();
+    }
+
+    private Object waitFor(Class<?> aClass, long timeout)
+            throws InterruptedException {
+        System.out.println("waiting for a " + aClass);
+        ServiceTracker tracker = new ServiceTracker(bundleContext,
+                aClass.getName(), null);
+        tracker.open();
+        Object service = tracker.waitForService(timeout);
+        return service;
+    }
+
+    private boolean waitForWebserver() throws InterruptedException {
+        int j = 0;
+        try {
+            URL serverURL = new URL("http://localhost:" + testHttpPort + "/");
+            boolean succeded = false;
+            while (!succeded) {
+                try {
+                    serverURL.openConnection().getInputStream();
+                } catch (FileNotFoundException ex) {
+                    break;
+                } catch (IOException ex) {
+                    System.out.println("waiting ("+ex+")");
+                    Thread.sleep(3000);
+                    if (j++ < 100) {
+                        continue;
+                    }
+                }
+                succeded = true;
+            }
+        } catch (MalformedURLException ex) {
+            Logger.getLogger(FelixContextualMenuGeneratorTest.class.getName())
+                    .log(Level.SEVERE, null, ex);
+        }
+        return j < 100;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/GlobalMenuItemsProviderA.java
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/GlobalMenuItemsProviderA.java b/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/GlobalMenuItemsProviderA.java
new file mode 100644
index 0000000..1ac96ab
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.tests/src/test/java/org/apache/clerezza/platform/dashboard/blackbox/osgi/GlobalMenuItemsProviderA.java
@@ -0,0 +1,52 @@
+    /*
+ * 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.dashboard.blackbox.osgi;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.clerezza.platform.dashboard.GlobalMenuItem;
+import org.apache.clerezza.platform.dashboard.GlobalMenuItemsProvider;
+
+/**
+ *
+ * @author mir
+ */
+public class GlobalMenuItemsProviderA implements GlobalMenuItemsProvider{
+    public static String groupALabel = "MyGroupA";
+    public static String groupAPath = "test/pathA/";
+    public static String groupAId = "idGroupA";
+    public static String implicitGroupBLabel = "idGroupB";
+    public static String groupCLabel = "MyGroupC";        
+    public static String itemA1Label = "MyLabelA1";
+    public static String itemA2Label = "MyLabelA2";
+    public static String itemA2Path = "test/pathA2/";
+    
+
+    @Override
+    public Set<GlobalMenuItem> getMenuItems() {
+        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
+        items.add(new GlobalMenuItem(groupAPath, groupAId, groupALabel, 5, null));
+        items.add(new GlobalMenuItem("test/pathC/", "idGroupC", groupCLabel, 5, null));
+        items.add(new GlobalMenuItem("test/pathA1/", "idLabelA1", itemA1Label, 2, groupAId));
+        items.add(new GlobalMenuItem(itemA2Path, "idLabelA2", itemA2Label, 7, groupAId));
+        items.add(new GlobalMenuItem("test/pathB1/", "idLabelB1", "MyLabelB1", 1, "idGroupB"));
+        items.add(new GlobalMenuItem("test/pathB2/", "idLabelB2", "MyLabelB2", 2, "idGroupB"));
+        return items;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/pom.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard/pom.xml b/platform/dashboard/pom.xml
new file mode 100644
index 0000000..c55db94
--- /dev/null
+++ b/platform/dashboard/pom.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.dashboard</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Dashboard</name>
+    <description>Provides a global contextual menu.</description>
+    
+    <modules>
+        <module>platform.dashboard.ontologies</module>
+        <module>platform.dashboard.core</module>
+        <!-- disabled because of problems with pax-exam: <module>platform.dashboard.tests</module> -->
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/documentation.viewer/LICENSE
----------------------------------------------------------------------
diff --git a/platform/documentation.viewer/LICENSE b/platform/documentation.viewer/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/documentation.viewer/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.


[28/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/pom.xml
----------------------------------------------------------------------
diff --git a/platform/editor/pom.xml b/platform/editor/pom.xml
new file mode 100644
index 0000000..76cdb57
--- /dev/null
+++ b/platform/editor/pom.xml
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>    
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.editor</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Clerezza - Platform Editor</name>
+    <description>An editor for discobits content on the platform.</description>
+    <dependencies>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typehandlerspace</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scala</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphnodeprovider</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.seedsnipe</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>javax.servlet</artifactId>
+                    <groupId>org.apache.felix</groupId>
+                </exclusion>
+            </exclusions>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wymiwyg</groupId>
+            <artifactId>wymiwyg-commons-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.9.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.config</artifactId>
+            <version>0.4</version>
+        </dependency>
+    <!--    <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.security</artifactId>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.metadata</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core.test</artifactId>
+            <scope>test</scope>
+            <version>0.15</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.ext</groupId>
+            <artifactId>slf4j-scala-api</artifactId>
+            <version>1.6.3</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>${project.build.directory}/generated-resources</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+				<groupId>org.scala-tools</groupId>
+				<artifactId>maven-scala-plugin</artifactId>
+			</plugin>
+            <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <version>2.4.0</version>
+          <extensions>true</extensions>
+          <configuration>
+            <instructions>
+              <Import-Package>org.osgi.*; version="[1,2)",javax.ws.rs.*; version="[1,3)",
+                                            org.apache.stanbol.commons.security.*; version="[0,3)",
+                  !org.apache.felix.scr.annotations.*,*</Import-Package>
+              <Bundle-SymbolicName>org.apache.clerezza.platform.editor</Bundle-SymbolicName>
+              <_nodefaultversion />
+            </instructions>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-scr-plugin</artifactId>
+          <version>1.14.0</version>
+          <executions>
+            <execution>
+              <id>generate-scr-scrdescriptor</id>
+              <goals>
+                <goal>scr</goal>
+              </goals>
+            </execution>
+          </executions>
+          <configuration>
+              <scanClasses>true</scanClasses> 
+          </configuration>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file


[40/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java
new file mode 100644
index 0000000..a92ff01
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/DiscobitsTypeHandler.java
@@ -0,0 +1,556 @@
+/*
+ * 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;
+
+import org.apache.clerezza.rdf.utils.graphnodeprovider.GraphNodeProvider;
+import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.Response.Status;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import org.apache.clerezza.jaxrs.utils.RedirectUtil;
+import org.apache.clerezza.platform.Constants;
+import org.apache.clerezza.platform.content.WebDavUtils.PropertyMap;
+import org.apache.clerezza.platform.content.collections.CollectionCreator;
+import org.apache.clerezza.platform.content.webdav.MKCOL;
+import org.apache.clerezza.platform.content.webdav.MOVE;
+import org.apache.clerezza.platform.content.webdav.PROPFIND;
+import org.apache.clerezza.platform.content.webdav.PROPPATCH;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Services;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.platform.typehandlerspace.OPTIONS;
+import org.apache.clerezza.platform.typehandlerspace.SupportedTypes;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.LockableMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.HIERARCHY;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.clerezza.rdf.utils.UriMutatingTripleCollection;
+import org.apache.clerezza.web.fileserver.util.MediaTypeGuesser;
+import org.osgi.service.component.ComponentContext;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * This Class allows getting and putting content structured using the
+ * Discobits ontology.
+ *
+ * Is an implementation of DiscobitsHandler and additionally registers as
+ * TypeHanlder to allow HTTP GET and PUT.
+ *
+ * @author reto, tho, agron, mir
+ */
+@Component(metatype=true)
+@Service({
+    Object.class,
+    DiscobitsHandler.class
+})
+@Property(name="org.apache.clerezza.platform.typehandler", boolValue=true)
+@Reference(name="metaDataGenerator",
+    policy=ReferencePolicy.DYNAMIC,
+    cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
+    referenceInterface=MetaDataGenerator.class
+)
+@SupportedTypes(types = { "http://www.w3.org/2000/01/rdf-schema#Resource" }, prioritize = false)
+public class DiscobitsTypeHandler extends AbstractDiscobitsHandler
+        implements DiscobitsHandler {
+@Property(value="600", label="Max-Age", description="Specifies the value of the max-age field"
+        + "set in the cache-control header of InfoDiscoBit-Responses, as per RFC 2616 this is a number of "
+        + "seconds")
+    public static final String MAX_AGE = "max-age";
+
+    @Reference
+    protected ContentGraphProvider cgProvider;
+
+    @Reference
+    PageNotFoundService notFoundPageService;
+
+    @Reference
+    GraphNodeProvider graphNodeProvider;
+
+    private static final Logger logger = LoggerFactory.getLogger(DiscobitsTypeHandler.class);
+
+    private final Set<MetaDataGenerator> metaDataGenerators =
+            Collections.synchronizedSet(new HashSet<MetaDataGenerator>());
+
+    private String cacheControlHeaderValue;
+
+    protected void activate(ComponentContext context) {
+        cacheControlHeaderValue = "max-age="+(String) context.getProperties().get(MAX_AGE);
+    }
+
+    /**
+     * TypeHandle method for rdf types "TitledContext", "InfoDiscoBit",
+     * "OrderedContent" and "XHTMLInfoDiscoBit".
+     * 
+     * @param uriInfo
+     * @return
+     */
+    @GET
+    @Produces({"*/*"})
+    public Object getResource(@Context UriInfo uriInfo) {
+        final UriRef uri = new UriRef(uriInfo.getAbsolutePath().toString());
+            final GraphNode graphNode = getResourceAsGraphNode(uriInfo);
+        if (graphNode == null) {
+            return resourceUnavailable(uri, uriInfo);
+        }
+        InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(graphNode);
+        if (infoDiscobit != null) {
+            Response response = Response.ok().
+                    header(HttpHeaders.CACHE_CONTROL, cacheControlHeaderValue).
+                    entity(infoDiscobit).
+                    build();
+            return response;
+        } else {
+            return graphNode;
+        }
+    }
+
+    private GraphNode getResourceAsGraphNode(UriInfo uriInfo) {
+        final UriRef uri = new UriRef(uriInfo.getAbsolutePath().toString());
+        GraphNode result = graphNodeProvider.getLocal(uri);
+        //could chck if nodeContext > 0, but this would be less efficient
+        TripleCollection tc = result.getGraph();
+        if (tc.filter(uri, null, null).hasNext()) {
+            return result;
+        }
+        if (tc.filter(null, null, uri).hasNext()) {
+            return result;
+        }
+        return null;
+    }
+
+
+    
+    /**
+     * Creates an <code>InfoDiscoBit</code> at the specified location
+     *
+     * @param uriInfo the uri of the InforDiscoBit to be created
+     * @param data the content of the upload
+     */
+    @PUT
+    public Response putInfoDiscobit(@Context UriInfo uriInfo, @Context HttpHeaders headers, byte[] data) {
+        final String contentType;
+        {
+            final List<String> contentTypeHeaders = headers.getRequestHeader(HttpHeaders.CONTENT_TYPE);
+            if (contentTypeHeaders == null) {
+                logger.warn("Content-Type not specified");
+                final MediaType guessTypeForName = MediaTypeGuesser.getInstance().
+                        guessTypeForName(uriInfo.getAbsolutePath().toString());
+                contentType = guessTypeForName == null ?
+                    MediaType.APPLICATION_OCTET_STREAM : guessTypeForName.toString();
+            } else {
+                contentType = contentTypeHeaders.get(0);
+            }
+            
+        }    
+        final UriRef infoDiscoBitUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        put(infoDiscoBitUri, MediaType.valueOf(contentType), data);
+        return Response.status(Status.CREATED).build();
+    }
+
+    /**
+     * Creates a new collection at the specified uri
+     *
+     * @param uriInfo
+     * @return
+     * <ul>
+     *    <li>201 "Created" response if method succeeded
+     *    <li>405 "Method Not Allowed" response if collection already exists
+     * </ul>
+     */
+    @MKCOL
+    public Object mkcol(@Context UriInfo uriInfo) {
+        String uriString = uriInfo.getAbsolutePath().toString();
+        if (uriString.charAt(uriString.length()-1) != '/') {
+            uriString += '/';
+        }
+        UriRef nodeUri = new UriRef(uriString);
+        final MGraph mGraph = cgProvider.getContentGraph();
+        Triple typeTriple = new TripleImpl(nodeUri, RDF.type, HIERARCHY.Collection);
+        if (mGraph.contains(typeTriple)) {
+            return Response.status(405) // Method Not Allowed
+                    .entity("Collection \"" + nodeUri.getUnicodeString()
+                    + "\" already exists.").build();
+        }
+        new CollectionCreator(mGraph).createContainingCollections(nodeUri);
+        return Response.created(uriInfo.getAbsolutePath()).build();
+    }
+
+    /**
+     * Finds all properties of a hierarchy node and returns them in a
+     * {@link DOMSource}
+     *
+     * @param uriInfo
+     * @param headers {@link HttpHeaders}
+     * @param body {@link DOMSource} containing the requested properties, can be null
+     * @return
+     * <ul>
+     *    <li>207 "Multistatus" response if method succeeded
+     *    <li>404 "Not Found" response if the hierarchy node was not found
+     *    <li>400 "Bad Request" response if the body is malformed
+     * </ul>
+     */
+    @PROPFIND
+    @Consumes({"application/xml", "text/xml", "*/*"})
+    @Produces({"application/xml", "text/xml", "*/*"})
+    public Response propfind(@Context UriInfo uriInfo,
+            @Context HttpHeaders headers, DOMSource body) {
+        final UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        if (!nodeAtUriExists(nodeUri)) {
+            return resourceUnavailable(nodeUri, uriInfo);
+        }
+            Map<UriRef, PropertyMap> result;
+        try {
+            String depthHeader = WebDavUtils.getHeaderAsString(headers, "Depth");
+            if (depthHeader == null) {
+                depthHeader = WebDavUtils.infinite;
+            }
+            final MGraph mGraph = cgProvider.getContentGraph();
+            GraphNode node = new GraphNode(nodeUri, mGraph);
+            if (body != null) {
+                Document requestDoc = WebDavUtils.sourceToDocument(body);
+                Node propfindNode = WebDavUtils.getNode(requestDoc, WebDavUtils.propfind);
+                Node requestNode = WebDavUtils.getFirstChild(propfindNode);
+                String requestType = requestNode.getLocalName();
+                if (requestType.equalsIgnoreCase(WebDavUtils.allprop)) {
+                    result = getAllProps(node, depthHeader);
+                } else if (requestType.equalsIgnoreCase(WebDavUtils.prop)) {
+                    result = getPropsByName(requestNode, node, depthHeader);
+                } else if (requestType.equalsIgnoreCase(WebDavUtils.propname)) {
+                    result = getPropNames(node, depthHeader);
+                } else {
+                    return Response.status(Status.BAD_REQUEST).build();
+                }
+            } else {
+                // returns all properties
+                result = getAllProps(node, depthHeader);
+            }
+            Document responseDoc = WebDavUtils.createResponseDoc(result);
+            return Response.status(207).entity(new DOMSource(responseDoc)).type(
+                    MediaType.APPLICATION_XML_TYPE).build();
+        } catch (TransformerFactoryConfigurationError e) {
+            return Response.status(Status.BAD_REQUEST).build();
+        } catch (TransformerException e) {
+            return Response.status(Status.BAD_REQUEST).build();
+        } catch (ParserConfigurationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    Map<UriRef, PropertyMap> getPropNames(GraphNode node, String depthHeader) {
+        Map<UriRef, PropertyMap> result = new HashMap<UriRef, PropertyMap>();
+        WebDavUtils.addNodeProperties(result, null, null, node, false);
+        return result;
+    }
+
+    Map<UriRef, PropertyMap> getPropsByName(Node requestNode, GraphNode node,
+            String depthHeader) {
+        Map<UriRef, PropertyMap> result;
+        NodeList children = requestNode.getChildNodes();
+        result = WebDavUtils.getPropsByName(children, node, "0", true);
+        return result;
+    }
+
+    Map<UriRef, PropertyMap> getAllProps(GraphNode node, String depthHeader) {
+        HashMap<UriRef, PropertyMap> result = new HashMap<UriRef, PropertyMap>();
+        WebDavUtils.addNodeProperties(result, null, null, node, true);
+        return result;
+    }
+
+    /**
+     * @param uriInfo
+     * @param body {@link DOMSource} containing properties which should be set
+     * or deleted
+     * @return
+     * <ul>
+     *    <li>207 "Multistatus" response if method succeeded
+     *    <li>404 "Not Found" response if the hierarchy node was not found
+     *    <li>400 "Bad Request" response if the body is malformed
+     * </ul>
+     */
+    @PROPPATCH
+    @Consumes({"application/xml", "text/xml", "*/*"})
+    @Produces({"application/xml", "text/xml", "*/*"})
+    public Response proppatch(@Context UriInfo uriInfo, DOMSource body) {
+        UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        if (!nodeAtUriExists(nodeUri)) {
+            return resourceUnavailable(nodeUri, uriInfo);
+        }
+        try {
+            Document requestDoc = WebDavUtils.sourceToDocument(body);
+            final MGraph mGraph = cgProvider.getContentGraph();
+            GraphNode node = new GraphNode(nodeUri, mGraph);
+            NodeList propsToSet = null;
+            NodeList propsToRemove = null;
+            Node proppatchNode = WebDavUtils.getNode(requestDoc, WebDavUtils.proppatch);
+            NodeList childNodes = proppatchNode.getChildNodes();
+            for (int i = 0; i < childNodes.getLength(); i++) {
+                Node child = childNodes.item(i);
+                String localName = child.getLocalName();
+                if (localName != null) {
+                    if (localName.equals(WebDavUtils.set)) {
+                        propsToSet = child.getFirstChild().getChildNodes();
+                    } else if (localName.equals(WebDavUtils.remove)) {
+                        propsToRemove = child.getFirstChild().getChildNodes();
+                    }
+                }
+            }
+            Document responseDoc = WebDavUtils.modifyProperties(node, propsToSet, propsToRemove);
+            return Response.status(207).entity(new DOMSource(responseDoc)).type(
+                    MediaType.APPLICATION_XML_TYPE).build();
+        } catch (ParserConfigurationException ex) {
+            throw new RuntimeException(ex);
+        } catch (TransformerFactoryConfigurationError ex) {
+            return Response.status(Status.BAD_REQUEST).build();
+        } catch (TransformerException ex) {
+            return Response.status(Status.BAD_REQUEST).build();
+        } 
+    }
+
+    /**
+     * Moves or renames a hierarchy node
+     *
+     * @param uriInfo
+     * @param headers
+     * @return
+     * <ul>
+     *  <li>201 "Created" response if method succeeded
+     *  <li>412 "Precondition Failed" response if the destination URL is already
+     *    mapped to a resource
+     *  <li>404 "Not Found" response if the hierarchy node was not found
+     *  <li>403 "Forbidden" response if the source and destination resources are the same
+     *  <li>400 "Bad Request" if no "Destination" header was found
+     * </ul>
+     */
+    @MOVE
+    public Response move(@Context UriInfo uriInfo, @Context HttpHeaders headers) {
+        UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        final LockableMGraph mGraph = cgProvider.getContentGraph();
+        GraphNode node = new GraphNode(nodeUri, mGraph);
+        String targetString = WebDavUtils.getHeaderAsString(headers,
+                    "Destination");
+        UriRef targetUri = new UriRef(targetString);
+        String overwriteHeader = WebDavUtils.getHeaderAsString(headers, "Overwrite");
+        boolean overwriteTarget = "T".equalsIgnoreCase(overwriteHeader);
+        if (nodeAtUriExists(targetUri)) {
+            if (overwriteTarget) {
+                new GraphNode(targetUri, mGraph).deleteNodeContext();
+            } else {
+                return Response.status(Status.PRECONDITION_FAILED).build();
+            }
+        }
+        Lock l = mGraph.getLock().writeLock();
+        l.lock();
+        try {
+            Iterator<Triple> oldParentTripleIter
+                    = mGraph.filter(nodeUri, HIERARCHY.parent, null);
+            if (oldParentTripleIter.hasNext()) {
+                oldParentTripleIter.next();
+                oldParentTripleIter.remove();
+            }
+            while (oldParentTripleIter.hasNext()) {
+                logger.error("more than one parent statement: "+oldParentTripleIter.next());
+                oldParentTripleIter.remove();
+            }
+            Lock writeLock = node.writeLock();
+            writeLock.lock();
+            try {
+                node.replaceWith(targetUri);
+            } finally {
+                writeLock.unlock();
+            }
+            new CollectionCreator(mGraph).createContainingCollections(targetUri);
+            try {
+                return Response.created(new java.net.URI(targetUri.getUnicodeString())).build();
+            } catch (URISyntaxException ex) {
+                throw new IllegalArgumentException(ex);
+            }
+        } finally {
+            l.unlock();
+        }
+    }
+
+    /**
+     * Deletes a hierarchy node
+     *
+     * @param uriInfo
+     * @return
+     * <ul>
+     *    <li>200 "OK" response if method succeeded
+     *    <li>404 "Not Found" response if the hierarchy node was not found
+     * </ul>
+     */
+    @DELETE
+    public Response delete(@Context UriInfo uriInfo) {
+        UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        if (!nodeAtUriExists(nodeUri)) {
+            return Response.status(Status.NOT_FOUND).entity(
+                    uriInfo.getAbsolutePath()).type(MediaType.TEXT_PLAIN).build();
+        }
+        final LockableMGraph mGraph = cgProvider.getContentGraph();
+        GraphNode node = new GraphNode(nodeUri, mGraph);
+        node.deleteNodeContext();
+        return Response.ok().build();
+    }
+
+    /**
+     * @param uriInfo
+     * @return
+     * <ul>
+     *    <li>200 "OK" response with an "Allow" and a "DAV" header. The "Allow"
+     * header contains all the possible HTTP methods that can be executed on the
+     * resource and the "DAV" header shows if the resource is WebDAV enabled
+     *    <li>404 "Not Found" response if the resource was not found
+     * </ul>
+     */
+    @OPTIONS
+    public Response options(@Context UriInfo uriInfo) {
+        final UriRef nodeUri = new UriRef(uriInfo.getAbsolutePath().toString());
+        if (!nodeAtUriExists(nodeUri)) {
+            return resourceUnavailable(nodeUri, uriInfo);
+        }
+            Response.ResponseBuilder builder = Response.ok();
+            builder.header("Dav", "1");
+            Set<String> allow = new HashSet<String>();
+            Method[] methods = this.getClass().getMethods();
+            for (Method method : methods) {
+                for (Annotation annotation : method.getAnnotations()) {
+                    HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
+                    if (httpMethod != null) {
+                        allow.add(httpMethod.value());
+                    }
+                }
+            }
+            if (allow.isEmpty()) {
+                builder.header("Allow", "");
+            } else {
+                final Iterator<String> iterator = allow.iterator();
+                final StringBuffer buffer = new StringBuffer(iterator.next());
+                while (iterator.hasNext()) {
+                    buffer.append(", ");
+                    buffer.append(iterator.next());
+                }
+                builder.header("Allow", buffer.toString());
+            }
+        return builder.build();
+    }
+
+    protected void bindMetaDataGenerator(MetaDataGenerator generator) {
+        metaDataGenerators.add(generator);
+    }
+
+    protected void unbindMetaDataGenerator(MetaDataGenerator generator) {
+        metaDataGenerators.remove(generator);
+    }
+
+    @Override
+    protected MGraph getMGraph() {
+        return cgProvider.getContentGraph();
+    }
+
+    @Override
+    protected Set<MetaDataGenerator> getMetaDataGenerators() {
+        return metaDataGenerators;
+    }
+
+    
+
+    private boolean nodeAtUriExists(UriRef nodeUri) {
+        LockableMGraph mGraph = (LockableMGraph) getMGraph();
+        Lock readLock = mGraph.getLock().readLock();
+        readLock.lock();
+        try {
+            return mGraph.filter(nodeUri, null, null).hasNext()
+                    || mGraph.filter(null, null, nodeUri).hasNext();
+        } finally {
+            readLock.unlock();
+        }
+    }
+
+    private Response resourceUnavailable(UriRef nodeUri,
+            UriInfo uriInfo) {
+        UriRef oppositUri = makeOppositeUriRef(nodeUri);
+        if (nodeAtUriExists(oppositUri)) {
+            return RedirectUtil.createSeeOtherResponse(
+                    oppositUri.getUnicodeString(), uriInfo);
+        } else {
+            return notFoundPageService.createResponse(uriInfo);
+        }
+        //return Response.status(Status.NOT_FOUND).build();
+    }
+    /**
+     * add trailing slash if none present, remove otherwise
+     *
+     * @param uri
+     * @return
+     */
+    private static UriRef makeOppositeUriRef(UriRef uri) {
+        String uriString = uri.getUnicodeString();
+        if (uriString.endsWith("/")) {
+            return new UriRef(uriString.substring(0, uriString.length() - 1));
+        } else {
+            return new UriRef(uriString + "/");
+        }
+    }
+
+    private UriRef createAnyHostUri(UriInfo uriInfo) {
+        return new UriRef(Constants.ALL_HOSTS_URI_PREFIX+uriInfo.getPath());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/Editor.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/Editor.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/Editor.java
new file mode 100644
index 0000000..5e7940d
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/Editor.java
@@ -0,0 +1,177 @@
+/*
+ * 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;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.Providers;
+import org.apache.clerezza.rdf.utils.MGraphUtils.NoSuchSubGraphException;
+
+import org.osgi.framework.Bundle;
+import org.osgi.service.component.ComponentContext;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.serializedform.Serializer;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.MGraphUtils;
+import org.apache.clerezza.web.fileserver.BundlePathNode;
+import org.apache.clerezza.web.fileserver.FileServer;
+import org.wymiwyg.commons.util.dirbrowser.PathNode;
+
+/**
+ * This Jax-rs root resource provides an ajax edito ro edit content structured
+ * using the Discobits ontology
+ *
+ * @author rbn
+ *
+ */
+@Component
+@Service(Object.class)
+@Property(name="javax.ws.rs", boolValue=true)
+@Path("tools/editor")
+public class Editor extends FileServer {
+
+    @Reference
+    private ContentGraphProvider cgProvider;
+
+    @Reference
+    private TcManager tcManager;
+    
+    @Reference
+    private Serializer serializer;
+
+    
+    private static final Logger logger = LoggerFactory.getLogger(Editor.class);
+
+    private Providers providers;
+    private final String rdfXml = "application/rdf+xml";
+    
+    
+    
+    /**
+     * On activation the {@link FileServer} is prepared
+     *
+     * @param context
+     */
+    protected void activate(ComponentContext context) {
+        configure(context.getBundleContext());
+    }
+
+    
+    /**
+     * The providers are injected by the Jax-rs implementation and used to
+     * locate readers for the RDF content of the body
+     *
+     * @param providers
+     */
+    @Context
+    public void setProviders(Providers providers) {
+        this.providers = providers;
+    }
+
+
+    @GET
+    @Path("get")
+    public GraphNode getDiscobit(@QueryParam("resource") UriRef uri,
+            @QueryParam("graph") UriRef graphUri) {
+        final MGraph mGraph = graphUri == null ? cgProvider.getContentGraph() :
+            tcManager.getMGraph(graphUri);
+        return new GraphNode(uri, mGraph);
+    }
+
+    /**
+     * replaces the subgraph serialized with RDF/XML in <code>revokedString
+     * </code> with the one from <code>assertedString</code>.
+     *
+     * @param graphUri the graph within which the replacement has to take place or null
+     * for the content graph
+     * @param assertedString the asserted Graph as RDF/XML
+     * @param revokedString the revoked Graph as RDF/XML
+     */
+    @POST
+    @Path("post")
+    public void postDiscobit(@QueryParam("graph") UriRef graphUri,
+            @FormParam("assert") String assertedString,
+            @FormParam("revoke") String revokedString,
+            @FormParam("rdfFormat") String rdfFormat) {
+        if (rdfFormat == null) {
+            rdfFormat = rdfXml;
+        }
+        MediaType mediaType = MediaType.valueOf(rdfFormat);
+        MessageBodyReader<Graph> graphReader = providers.getMessageBodyReader(Graph.class, Graph.class, null,mediaType);
+        final Graph assertedGraph;
+        final Graph revokedGraph;
+        try {
+            assertedGraph = graphReader.readFrom(Graph.class, Graph.class, new Annotation[0], mediaType, null, new ByteArrayInputStream(assertedString.getBytes()));
+            revokedGraph = graphReader.readFrom(Graph.class, Graph.class, new Annotation[0], mediaType, null, new ByteArrayInputStream(revokedString.getBytes()));
+        } catch (IOException ex) {
+            logger.error("reading graph {}", ex);
+            throw new WebApplicationException(ex, 500);
+        }
+        final MGraph mGraph = graphUri == null ? cgProvider.getContentGraph() :
+            tcManager.getMGraph(graphUri);
+        try {
+            serializer.serialize(System.out, revokedGraph, "text/turtle");
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            serializer.serialize(baos, revokedGraph, "text/turtle");
+            System.out.println(new String(baos.toByteArray()).contains("\r"));
+            MGraphUtils.removeSubGraph(mGraph, revokedGraph);
+        } catch (NoSuchSubGraphException ex) {
+            throw new RuntimeException(ex);
+        }
+        mGraph.addAll(assertedGraph);
+    }
+
+    @GET
+    //this is to work around
+    @Produces(MediaType.APPLICATION_OCTET_STREAM)
+    public PathNode getStaticFile(@Context UriInfo uriInfo) {
+        TrailingSlash.enforcePresent(uriInfo);
+        final PathNode node = getNode("disco.xhtml");
+        logger.debug("serving static {}", node);
+        return node;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java
new file mode 100644
index 0000000..8693216
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobit.java
@@ -0,0 +1,105 @@
+/*
+ * 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;
+
+import java.util.Iterator;
+import java.util.concurrent.locks.Lock;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.ontologies.RDF;
+
+/**
+ * Represents an InfoDiscoBit
+ *
+ * @author reto
+ */
+public class InfoDiscobit {
+
+    private GraphNode infoBit;
+
+
+    /**
+     *
+     * @param infoBit
+     * @return an instance of InfoDiscobit or null if node is not an InfoDiscoBit
+     */
+    public static InfoDiscobit createInstance(GraphNode node) {
+        Lock l = node.readLock();
+        l.lock();
+        try {
+            Iterator<Resource> types = node.getObjects(RDF.type);
+            while(types.hasNext()) {
+                if (types.next().equals(DISCOBITS.InfoDiscoBit)){
+                    return new InfoDiscobit(node);
+                }
+            }
+            return null;
+        } finally {
+            l.unlock();
+        }
+    }
+
+    InfoDiscobit(GraphNode infoBit) {
+        this.infoBit = infoBit;
+    }
+
+    public String getContentType() {
+        Lock readLock = infoBit.readLock();
+        readLock.lock();
+        try {
+            Iterator<Literal> mediaTypeLits = infoBit.getLiterals(DISCOBITS.mediaType);
+            if (mediaTypeLits.hasNext()) {
+                return mediaTypeLits.next().getLexicalForm();
+            } else {
+                throw new RuntimeException("InfoDiscobit has no media type property");
+            }
+        } finally {
+            readLock.unlock();
+        }
+    }
+    
+    public byte[] getData() {
+        byte[] result;
+        Lock readLock = infoBit.readLock();
+        readLock.lock();
+        try {
+            Iterator<Literal> infoBitLits = infoBit.getLiterals(DISCOBITS.infoBit);
+            if (infoBitLits.hasNext()) {
+                final Literal literalValue = infoBitLits.next();
+                if (literalValue instanceof TypedLiteral) {
+                    result = LiteralFactory.getInstance().createObject(
+                            (new byte[0]).getClass(), (TypedLiteral) literalValue);
+                } else {
+                    throw new RuntimeException("InfoDiscobit has infoBit value which is not a TypedLiteral but "+literalValue);
+                }
+            } else {
+                throw new RuntimeException("InfoDiscobit has not infoBit property");
+            }
+        } finally {
+            readLock.unlock();
+        }        
+        return result;    
+    };
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java
new file mode 100644
index 0000000..e3a2aa4
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/InfoDiscobitWriter.java
@@ -0,0 +1,67 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+
+
+/**
+ * 
+ * @scr.component
+ * @scr.service interface="java.lang.Object"
+ * @scr.property name="javax.ws.rs" type="Boolean" value="true"
+ *
+ * @author reto
+ */
+@Provider
+@Produces("*/*")
+public class InfoDiscobitWriter implements MessageBodyWriter<InfoDiscobit> {
+
+    @Override
+    public boolean isWriteable(Class<?> type, Type genericType,
+            Annotation[] annotations, MediaType mediaType) {
+        return InfoDiscobit.class.isAssignableFrom(type);
+    }
+
+    @Override
+    public long getSize(InfoDiscobit t, Class<?> type, Type genericType,
+            Annotation[] annotations, MediaType mediaType) {
+        return t.getData().length;
+    }
+
+    @Override
+    public void writeTo(InfoDiscobit t, Class<?> type, Type genericType,
+            Annotation[] annotations, MediaType mediaType,
+            MultivaluedMap<String, Object> httpHeaders,
+            OutputStream entityStream) throws IOException,
+            WebApplicationException {
+        httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, t.getContentType());
+        entityStream.write(t.getData());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java
new file mode 100644
index 0000000..ccce889
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java
@@ -0,0 +1,40 @@
+/*
+ *  Copyright 2010 reto.
+ * 
+ *  Licensed 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.
+ *  under the License.
+ */
+
+package org.apache.clerezza.platform.content;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+/**
+ * An instance of this service is called by DiscoBitHandler if a resource
+ * is not found in the content graph.
+ *
+ * @author reto
+ */
+public interface PageNotFoundService {
+
+    /**
+     * Creates a response when a resource could not be found in the Content 
+     * Graph, this is a 404 response.
+     * 
+     * @param uriInfo
+     * @return
+     */
+    public Response createResponse(UriInfo uriInfo);
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java
new file mode 100644
index 0000000..69171ff
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/SimpleDiscobitsHandler.java
@@ -0,0 +1,49 @@
+/*
+ * 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;
+
+import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
+import java.util.Set;
+import org.apache.clerezza.rdf.core.MGraph;
+
+/**
+ *
+ * @author reto
+ */
+class SimpleDiscobitsHandler extends AbstractDiscobitsHandler {
+    
+    private final MGraph mGraph;
+
+    public SimpleDiscobitsHandler(MGraph mGraph) {
+        this.mGraph = mGraph;
+    }
+
+    @Override
+    protected MGraph getMGraph() {
+        return mGraph;
+    }
+
+    @Override
+    protected Set<MetaDataGenerator> getMetaDataGenerators() {
+        return null;
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java
new file mode 100644
index 0000000..094e773
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/TitledContentRenderlet.java
@@ -0,0 +1,142 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import javax.ws.rs.core.MediaType;
+import org.apache.clerezza.platform.typerendering.CallbackRenderer;
+import org.apache.clerezza.platform.typerendering.Renderlet;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.ontologies.DISCOBITS;
+import org.apache.clerezza.rdf.utils.GraphNode;
+
+/**
+ * A renderlet for rendering TitledContent. The contained elements are rendered
+ * calling back to the specified <code>Renderer</code>.
+ *
+ * This renderlet uses a thread-local variable to set the appropriate heading
+ * level (h1 - h6)
+ *
+ * @author rbn, mir
+ *
+ * @scr.component
+ * @scr.service interface="org.apache.clerezza.platform.typerendering.Renderlet"
+ */
+public class TitledContentRenderlet implements Renderlet {
+
+    private static ThreadLocal<Integer> headingLevel  = new ThreadLocal<Integer>() {
+
+        @Override
+        protected Integer initialValue() {
+            return 1;
+        }
+
+    };
+    @Override
+    public void render(GraphNode res, GraphNode context, Map<String, Object> sharedRenderingValues,
+            CallbackRenderer callbackRenderer,
+            URI renderingSpecification,
+            String mode,
+            MediaType mediaType, RequestProperties requestProperties,
+            OutputStream os) throws IOException {
+        PrintWriter writer = new PrintWriter(os);
+        List<GraphNode> containedNodes = getContainedNodes(res);
+        if (containedNodes.size() < 2) {
+            String nodeLabel = res.getNode() instanceof UriRef ?
+                ((UriRef)res.getNode()).getUnicodeString() : " Bnode";
+            writer.print(nodeLabel+": titled and/or content could not be found");
+            writer.flush();
+            return;
+        }
+        writer.print(getHeaderOpen());
+        writer.flush();
+        callbackRenderer.render(
+                containedNodes.get(0),
+                context, mode, os);
+        writer.println(getHeaderClose());
+        headingLevel.set(headingLevel.get()+1);
+        writer.print("<div class='tx-content'>");
+        writer.flush();
+        callbackRenderer.render(
+                containedNodes.get(1),
+                context, mode, os);
+        headingLevel.set(headingLevel.get()-1);
+        writer.println("</div>");
+        writer.flush();
+    }
+
+
+    private List<GraphNode> getContainedNodes(GraphNode titledContent) {
+        final SortedSet<GraphNode> entries = new TreeSet<GraphNode>(new Comparator<GraphNode>() {
+
+            @Override
+            public int compare(GraphNode o1, GraphNode o2) {
+                    int pos1 = getPos(o1);
+                    int pos2 = getPos(o2);
+                    return pos1 - pos2;
+            }
+            private int getPos(GraphNode o) {
+                try {
+                    return Integer.parseInt(o.getLiterals(DISCOBITS.pos).next().getLexicalForm());
+                } catch (NullPointerException e) {
+                    return -1;
+                }
+            }
+
+        });
+        final Iterator<Resource> entriesIter = titledContent.getObjects(DISCOBITS.contains);
+        while (entriesIter.hasNext()) {
+            Resource resource = entriesIter.next();
+            entries.add(new GraphNode((NonLiteral) resource,titledContent.getGraph()));
+        }
+        final List<GraphNode> result = new ArrayList<GraphNode>();
+        for (GraphNode graphNode : entries) {
+            Iterator<Resource> holded = graphNode.getObjects(DISCOBITS.holds);
+            if (!holded.hasNext()) {
+                throw new RuntimeException(
+                        "Titled Content must contain a first element: "+graphNode.getNodeContext());
+            }
+            result.add(new GraphNode(holded.next(),
+                    titledContent.getGraph()));
+        }
+        return result;
+    }
+
+    private String getHeaderOpen() {
+        final Integer level = headingLevel.get();
+        return level < 7 ? "<h"+level+">" : "<div class = \"heading\">";
+    }
+
+    private String getHeaderClose() {
+        final Integer level = headingLevel.get();
+        return level < 7 ? "</h"+level+">" : "</div>";
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java
new file mode 100644
index 0000000..aea5190
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/WebDavUtils.java
@@ -0,0 +1,703 @@
+/*
+ * 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;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMResult;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.Resource;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.DCTERMS;
+import org.apache.clerezza.rdf.ontologies.HIERARCHY;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * @author agron
+ */
+class WebDavUtils {
+
+    static final String infinite = "infinite";
+    static final String prop = "prop";
+    static final String allprop = "allprop";
+    static final String propname = "propname";
+    static final String propfind = "propfind";
+    static final String proppatch = "propertyupdate";
+    static final String set = "set";
+    static final String remove = "remove";
+    private static final String davUri = "DAV:";
+    private static final String multistat = "multistatus";
+    private static final String response = "response";
+    private static final String href = "href";
+    private static final String propstat = "propstat";
+    private static final String status = "status";
+
+    //WebDAV properties
+    private static final String creationdate = "creationdate";
+    private static final String displayname = "displayname";
+    private static final String getcontentlanguage = "getcontentlanguage";
+    private static final String getcontentlength = "getcontentlength";
+    private static final String getcontenttype = "getcontenttype";
+    private static final String getetag = "getetag";
+    private static final String getlastmodified = "getlastmodified";
+    private static final String lockdiscovery = "lockdiscovery";
+    private static final String resourcetype = "resourcetype";
+    private static final String supportedlock = "supportedlock";
+
+    private static final List<String> davProps = new ArrayList<String>(Arrays.asList(
+            creationdate, displayname, getcontentlanguage, getcontentlength,
+            getcontenttype, getetag, getlastmodified, lockdiscovery,
+            resourcetype, supportedlock));
+    
+    private static final List<String> protectedProps = new ArrayList<String>(Arrays.asList(
+            creationdate, getcontentlength, getetag, getlastmodified,
+            lockdiscovery, resourcetype, supportedlock));
+
+
+    /**
+     * Returns the {@link Node} from a given {@link Document}
+     * @param doc
+     * @param nodeName
+     * @return null if Node wasen't found
+     */
+    static Node getNode(Document doc, String nodeName){
+        NodeList nodes = doc.getElementsByTagNameNS(davUri, nodeName);
+        if(nodes.getLength() == 1){
+            return nodes.item(0);
+        }
+        return null;
+    }
+
+    /**
+     * @param node
+     * @return returns the first non Text node or null
+     */
+    static Node getFirstChild(Node node){
+        NodeList nodeList = node.getChildNodes();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            if(nodeList.item(i).getLocalName() != null){
+                return nodeList.item(i);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Converts a {@link Source} to a {@link Document}
+     *
+     * @throws ParserConfigurationException
+     * @throws TransformerFactoryConfigurationError
+     * @throws TransformerException
+     */
+    static Document sourceToDocument(Source body)
+            throws ParserConfigurationException,
+            TransformerFactoryConfigurationError, TransformerException {
+        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
+                .newDocument();
+        Transformer transformer = TransformerFactory.newInstance().newTransformer();
+        DOMResult result = new DOMResult(doc);
+        transformer.transform(body, result);
+        return (Document) result.getNode();
+    }
+
+    /**
+     * Returns the content of a requested header as a {@link String}
+     *
+     * @param headers
+     * @param header
+     *            header to be returned
+     * @return returns <code>null</code> if the requested header is empty
+     */
+    static String getHeaderAsString(HttpHeaders headers, String header) {
+        List<String> requestedHeader = headers.getRequestHeader(header);
+        if(requestedHeader == null){
+            return null;
+        }
+        Iterator<String> headerIterator = requestedHeader.iterator();
+        if (headerIterator.hasNext()) {
+            return headerIterator.next();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * @param clazz
+     * @return returns an ok Response with a DAV: and an ALLOW: header
+     */
+    static Response options(Class<?> clazz){
+        Response.ResponseBuilder builder = Response.ok();
+        builder.header("Dav", "1");
+        Set<String> allow = new HashSet<String>();
+        Method[] methods = clazz.getMethods();
+        for (Method method : methods){
+            for (Annotation annotation : method.getAnnotations()){
+                HttpMethod httpMethod = annotation.annotationType()
+                        .getAnnotation(HttpMethod.class);
+                if(httpMethod != null){
+                    allow.add(httpMethod.value());
+                }
+            }
+        }
+        if (allow.isEmpty()) {
+            builder.header("Allow", "");
+        } else {
+            final Iterator<String> iterator = allow.iterator();
+            final StringBuffer buffer = new StringBuffer(iterator.next());
+            while (iterator.hasNext()) {
+                buffer.append(", ");
+                buffer.append(iterator.next());
+            }
+            builder.header("Allow", buffer.toString());
+        }
+        return builder.build();
+    }
+
+    /*------------------------------------------*
+     * Putting the properties in a DOM Document *
+     *------------------------------------------*/
+
+    static Document createResponseDoc(Map<UriRef, PropertyMap> resultMap)
+            throws ParserConfigurationException {
+        Document responseDoc = DocumentBuilderFactory.newInstance().
+                newDocumentBuilder().newDocument();
+        Set<UriRef> nodeNameSet = resultMap.keySet();
+
+        Element multistatElement = responseDoc.createElementNS(davUri,"D:" + multistat);
+        // add multistat element to response
+        responseDoc.appendChild(multistatElement);
+        for (UriRef nodeName : nodeNameSet) {
+            Element responseElement = responseDoc.createElementNS(davUri, "D:" + response);
+            // add response element to response Document
+            multistatElement.appendChild(responseElement);
+            PropertyMap propertyMap = resultMap.get(nodeName);
+            addElementsToResponse(propertyMap, responseElement, responseDoc, nodeName);
+        }
+        return responseDoc;
+    }
+
+    private static void addElementsToResponse(PropertyMap propertyMap,
+            Element responseElement, Document responseDoc, UriRef nodeName) {
+        Element hrefElement = responseDoc.createElementNS(davUri, "D:" + href);
+        hrefElement.setTextContent(nodeName.getUnicodeString());
+        // add hrefElement element to responseElement
+        responseElement.appendChild(hrefElement);
+        addPropsToPropstat(responseElement, propertyMap, responseDoc);
+
+    }
+
+    private static void addPropsToPropstat(Element responseElement, PropertyMap propertyMap,
+            Document responseDoc) {
+        Set<Property> props = propertyMap.keySet();
+        Element propFoundElement = responseDoc.createElementNS(davUri, "D:" + prop);
+        Element propNotFoundElement = responseDoc.createElementNS(davUri, "D:" + prop);
+        for(Property propVal : props){
+            String propName = propVal.prop;
+            String ns = propVal.ns;
+            String prf = ns.equalsIgnoreCase(davUri) ? "D:":"R:";
+            String value = propertyMap.get(propVal);
+            Element resultElement = responseDoc.createElementNS(ns, prf + propName);
+            if(value != null){
+                if (!(value.isEmpty())){
+                    if (value.equals("collection")) {
+                        resultElement.appendChild(responseDoc.createElementNS(
+                                davUri, "D:collection"));
+                    } else {
+                        resultElement.setTextContent(value);
+                    }
+                }
+                propFoundElement.appendChild(resultElement);
+            } else {
+                propNotFoundElement.appendChild(resultElement);
+            }
+        }
+        Element propstatFoundElement = responseDoc.createElementNS(davUri,
+                "D:" + propstat);
+        Element statusFoundElement = responseDoc.createElementNS(davUri,
+                "D:" + status);
+        propstatFoundElement.appendChild(propFoundElement);
+        statusFoundElement.setTextContent("HTTP/1.1 200 OK");
+        propstatFoundElement.appendChild(statusFoundElement);
+        responseElement.appendChild(propstatFoundElement);
+        if(propNotFoundElement.hasChildNodes()){
+            Element propstatNotFoundElement = responseDoc.createElementNS(davUri,
+                    "D:" + propstat);
+            Element statusNotFoundElement = responseDoc.createElementNS(davUri,
+                    "D:" + status);
+            propstatNotFoundElement.appendChild(propNotFoundElement);
+            statusNotFoundElement.setTextContent("HTTP/1.1 404 Not Found");
+            propstatNotFoundElement.appendChild(statusNotFoundElement);
+            responseElement.appendChild(propstatNotFoundElement);
+        }
+
+    }
+
+    /*------------------------------------------------------------*
+     * Get the properties from the CollectionNode and its members *
+     *------------------------------------------------------------*/
+
+    static Map<UriRef, PropertyMap> getPropsByName(NodeList children,
+            GraphNode node, String depthHeader, boolean includeValues) {
+        List<Property> requestedUserProps = new ArrayList<Property>();
+        List<Property> requestedDavProps = new ArrayList<Property>();
+
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child = children.item(i);
+            String localName = child.getLocalName();
+            if(localName == null){
+                continue;
+            }
+            String nsUri = child.getNamespaceURI();
+            if (nsUri.equals(davUri)) {
+                requestedDavProps.add(new Property(nsUri, localName));
+            } else {
+                requestedUserProps.add(new Property(nsUri, localName));
+            }
+        }
+        Map<UriRef, PropertyMap> allprops = new HashMap<UriRef, PropertyMap>();
+
+        if (node.hasProperty(RDF.type, HIERARCHY.Collection)) {
+            return getCollectionProps(allprops, requestedUserProps, requestedDavProps,
+                    node, depthHeader, includeValues);
+        }else{
+            addNodeProperties(allprops, requestedUserProps, requestedDavProps,
+                    node, includeValues);
+            return allprops;
+        }
+
+    }
+    
+    static Map<UriRef, PropertyMap> getCollectionProps(Map<UriRef, PropertyMap> allprops,
+            List<Property> requestedUserProps, List<Property> requestedDavProps,
+            GraphNode collection, String depthHeader, boolean includeValues) {
+        if(allprops == null){
+            allprops = new HashMap<UriRef, PropertyMap>();
+        }
+        addNodeProperties(allprops, requestedUserProps, requestedDavProps, collection,
+                includeValues);
+        if (depthHeader.equals("1") || depthHeader.equals(infinite)) {
+            Iterator<GraphNode> membersIter = collection.getSubjectNodes(HIERARCHY.parent);
+            List<GraphNode> members = new ArrayList<GraphNode>();
+            while (membersIter.hasNext()) {
+                members.add(membersIter.next());
+            }
+            addMemberProps(allprops, requestedUserProps, requestedDavProps, members,
+                    depthHeader, includeValues);
+        }
+        return allprops;
+    }
+
+    private static void addMemberProps(Map<UriRef, PropertyMap> allprops,
+            List<Property> requestedUserProps, List<Property> requestedDavProps,
+            List<GraphNode> members, String depthHeader, boolean includeValues) {
+        for (GraphNode member : members) {
+            if (depthHeader.equals(infinite) && member.hasProperty(RDF.type, HIERARCHY.Collection)) {
+                getCollectionProps(allprops, requestedUserProps, requestedDavProps,
+                        member, depthHeader, includeValues);
+            } else {
+                addNodeProperties(allprops, requestedUserProps, requestedDavProps,
+                        member,    includeValues);
+            }
+        }
+    }
+
+    static void addNodeProperties(Map<UriRef, PropertyMap> allprops,
+            List<Property> requestedUserProps, List<Property> requestedDavProps,
+            GraphNode node,    boolean includeValues) {
+
+        if (requestedDavProps == null) {
+            requestedDavProps = new ArrayList<Property>();
+            for(String st : davProps){
+                requestedDavProps.add(new Property(davUri, st));
+            }
+        }
+        PropertyMap propertyMap = new PropertyMap();
+        if (includeValues) {
+            addDavProps(node, propertyMap, requestedDavProps);
+            addUserProps(node, propertyMap, requestedUserProps);
+        } else {
+            addDavPropsWithoutValues(propertyMap);
+            addUserPropsWithoutValues(node, propertyMap);
+        }
+        allprops.put((UriRef) node.getNode(), propertyMap);
+
+    }
+
+    private static void addUserProps(GraphNode node, PropertyMap propertyMap,
+            List<Property> requestedProps) {
+        Iterator<UriRef> userPropsIter;
+        Lock readLock = node.readLock();
+        readLock.lock(); 
+        try {
+            userPropsIter = node.getProperties();
+        } finally {
+            readLock.unlock();
+        }
+        Set<UriRef> userProps = new HashSet<UriRef>();
+        while (userPropsIter.hasNext()) {
+            userProps.add(userPropsIter.next());
+        }
+        userProps.remove(HIERARCHY.members);
+        if (requestedProps != null) {
+            for (Property requestedProp : requestedProps) {
+                UriRef predicate = new UriRef(requestedProp.value());
+                if (userProps.contains(predicate)) {
+                    readLock.lock();
+                    try {
+                        Iterator<Resource> value = node.getObjects(predicate);
+                        if (value.hasNext()) {
+                            propertyMap.put(requestedProp, getValue(value.next()));
+                        } else {
+                            propertyMap.put(requestedProp, "");
+                        }
+                    } finally {
+                        readLock.unlock();
+                    }
+                } else {
+                    propertyMap.put(requestedProp, null);
+                }
+            }
+        } else {
+            for (UriRef uri : userProps) {
+                String userProp = uri.getUnicodeString();
+                int index = userProp.lastIndexOf("#");
+                if (index == -1) {
+                    index = userProp.lastIndexOf("/");
+                }
+                Property property = new Property(userProp.substring(0, index + 1),
+                        userProp.substring(index + 1));
+
+                Iterator<Resource> value = node.getObjects(uri);
+                readLock.lock();
+                try {
+                    if (value.hasNext()) {
+                        propertyMap.put(property, getValue(value.next()));
+                    } else {
+                        propertyMap.put(property, "");
+                    }
+                } finally {
+                    readLock.unlock();
+                }
+            }
+        }
+    }
+
+    private static void addUserPropsWithoutValues(GraphNode node,
+            PropertyMap propertyMap) {
+        Iterator<UriRef> userPropsIter;
+        Lock readLock = node.readLock();
+        readLock.lock();
+        try {
+            userPropsIter = node.getProperties();
+        } finally {
+            readLock.unlock();
+        }
+        Set<UriRef> userProps = new HashSet<UriRef>();
+        while (userPropsIter.hasNext()) {
+            userProps.add(userPropsIter.next());
+        }
+        userProps.remove(HIERARCHY.members);
+        for (UriRef uri : userProps) {
+            String userProp = uri.getUnicodeString();
+            int index = userProp.lastIndexOf("#");
+            if (index == -1) {
+                index = userProp.lastIndexOf("/");
+            }
+            Property property = new Property(userProp.substring(0, index + 1),
+                    userProp.substring(index + 1));
+            propertyMap.put(property, "");
+        }
+    }
+
+    /**
+     * @param resource
+     * @return returns the unicode string of an UriRef or the lexical form of a
+     * Literal or the return value of a toString() on a BNode
+     */
+    private static String getValue(Resource resource){
+        if(resource instanceof UriRef){
+            return ((UriRef)resource).getUnicodeString();
+        }else if(resource instanceof Literal){
+            return ((Literal)resource).getLexicalForm();
+        }else {
+            return resource.toString();
+        }
+    }
+
+    /**
+     * FIXME find better implementation
+     * @param node
+     * @param propertyMap
+     * @param includeValues
+     * @param requestedProps
+     */
+    private static void addDavProps(GraphNode node, PropertyMap propertyMap,
+            List<Property> requestedProps) {
+        for (Property property : requestedProps) {
+            if (davProps.contains(property.prop)) {
+                if (property.prop.equalsIgnoreCase(displayname)) {
+                    propertyMap.put(property, getLastSection(((UriRef)node.getNode()).getUnicodeString()));
+                } else if (property.prop.equalsIgnoreCase(resourcetype)) {
+                    if (node.hasProperty(RDF.type, HIERARCHY.Collection)) {
+                        propertyMap.put(property, "collection");
+                    } else {
+                        propertyMap.put(property, "");
+                    }
+                } else if(property.prop.equalsIgnoreCase(creationdate)){
+                    Lock readLock = node.readLock();
+                    readLock.lock();
+                    try {
+                        Iterator<Resource> date = node.getObjects(DCTERMS.dateSubmitted);
+                        if (date.hasNext()) {
+                            String st = getValue(date.next());
+                            propertyMap.put(property, st);
+                        } else {
+                            propertyMap.put(property, "");
+                        }
+                    } finally {
+                        readLock.unlock();
+                    }
+                } else if(property.prop.equalsIgnoreCase(getlastmodified)){
+                    Lock readLock = node.readLock();
+                    readLock.lock();
+                    try {
+                        Iterator<Resource> date = node.getObjects(DCTERMS.modified);
+                        if (date.hasNext()) {
+                            String st = getValue(date.next());
+                            propertyMap.put(property, st);
+                        } else {
+                            propertyMap.put(property, "");
+                        }
+                    } finally {
+                        readLock.unlock();
+                    }
+                } else if(property.prop.equalsIgnoreCase(getcontenttype)){
+                    Lock readLock = node.readLock();
+                    readLock.lock();
+                    try {
+                        Iterator<Resource> mediaType = node.getObjects(DCTERMS.MediaType);
+                        if (mediaType.hasNext()) {
+                            String st = getValue(mediaType.next());
+                            propertyMap.put(property, st);
+                        } else {
+                            propertyMap.put(property, "");
+                        }
+                    } finally {
+                        readLock.unlock();
+                    }
+                } else {
+                    propertyMap.put(property, "");
+                }
+            } else {
+                propertyMap.put(property, null);
+            }
+        }
+    }
+
+    private static void addDavPropsWithoutValues(PropertyMap propertyMap) {
+        for (String property : davProps) {
+                propertyMap.put(new Property(davUri, property), "");
+        }
+    }
+
+    /*-------------------*
+     * Proppatch methods *
+     *-------------------*/
+
+    static Document modifyProperties(GraphNode hierarchyNode, NodeList propsToSet,
+            NodeList propsToRemove) throws ParserConfigurationException {
+        Document responseDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+        UriRef subject = (UriRef) hierarchyNode.getNode();
+        Element hrefElement = responseDoc.createElementNS(davUri, href);
+        hrefElement.setTextContent(subject.getUnicodeString());
+        Element multistatus = responseDoc.createElementNS(davUri, multistat);
+        Element responseElement = responseDoc.createElementNS(davUri, response);
+        Element propOk = responseDoc.createElementNS(davUri, prop);
+        Element propForbidden = responseDoc.createElementNS(davUri, prop);
+
+        responseDoc.appendChild(multistatus);
+        multistatus.appendChild(responseElement);
+        responseElement.appendChild(hrefElement);
+
+        Map<Property, String> setMap = getNodeListAsMap(propsToSet);
+        Map<Property, String> removeMap = getNodeListAsMap(propsToRemove);
+        TripleCollection contentGraph = hierarchyNode.getGraph();
+        for(Map.Entry<Property, String> entry : setMap.entrySet()){
+            Property property = entry.getKey();
+            if(property.ns.equalsIgnoreCase(davUri)){
+                if(protectedProps.contains(property.prop)){
+                    propForbidden.appendChild(responseDoc
+                            .createElementNS(davUri, property.prop));
+                } else {
+                    UriRef predicate = new UriRef(property.value());
+                    Lock writeLock = hierarchyNode.writeLock();
+                    writeLock.lock();
+                    try {
+                        Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
+                        replaceProp(subject, predicate, valIter, contentGraph, entry);
+                    } finally {
+                        writeLock.unlock();
+                    }
+                    propOk.appendChild(responseDoc.createElementNS(davUri, property.prop));
+                }
+            } else {
+                UriRef predicate = new UriRef(property.value());
+                Lock writeLock = hierarchyNode.writeLock();
+                writeLock.lock();
+                try {
+                    Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
+                    replaceProp(subject, predicate, valIter, contentGraph, entry);
+                } finally {
+                    writeLock.unlock();
+                }
+                propOk.appendChild(responseDoc.createElementNS(property.ns, "R:" + property.prop));
+            }
+        }
+
+        for(Map.Entry<Property, String> entry : removeMap.entrySet()){
+            Property property = entry.getKey();
+            if(davProps.contains(property.prop)){
+                propForbidden.appendChild(responseDoc
+                            .createElementNS(davUri, property.prop));
+            } else {
+                UriRef predicate = new UriRef(property.value());
+                Lock writeLock = hierarchyNode.writeLock();
+                writeLock.lock();
+                try {
+                    Iterator<Resource> valIter = hierarchyNode.getObjects(predicate);
+                    Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
+                    while (valIter.hasNext()) {
+                        triplesToBeRemoved.add(new TripleImpl(subject, predicate, valIter.next()));
+                    }
+                    contentGraph.removeAll(triplesToBeRemoved);
+                } finally {
+                    writeLock.unlock();
+                }
+                propOk.appendChild(responseDoc.createElementNS(property.ns, property.prop));
+
+            }
+        }
+
+        if(propOk.hasChildNodes()){
+            Element propstatOk = responseDoc.createElementNS(davUri, propstat);
+            Element statusOk = responseDoc.createElementNS(davUri, status);
+            responseElement.appendChild(propstatOk);
+            propstatOk.appendChild(propOk);
+            propstatOk.appendChild(statusOk);
+            statusOk.setTextContent("HTTP/1.1 200 OK");
+        }
+        if(propForbidden.hasChildNodes()){
+            Element propstatForbidden = responseDoc.createElementNS(davUri, propstat);
+            Element statusForbidden = responseDoc.createElementNS(davUri, status);
+            responseElement.appendChild(propstatForbidden);
+            propstatForbidden.appendChild(propForbidden);
+            propstatForbidden.appendChild(statusForbidden);
+            statusForbidden.setTextContent("HTTP/1.1 403 Forbidden");
+        }
+
+        return responseDoc;
+    }
+
+    private static Map<Property, String> getNodeListAsMap(NodeList nodeList) {
+        if (nodeList == null) {
+            return new HashMap<Property, String>();
+        }
+        Map<Property, String> result = new HashMap<Property, String>();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            Node node = nodeList.item(i);
+            String propName = node.getLocalName();
+            if (propName != null) {
+                String nsUri = node.getNamespaceURI();
+                result.put(new Property(nsUri, propName), node.getTextContent());
+            }
+        }
+        return result;
+    }
+
+    private static void replaceProp(UriRef subject, UriRef predicate,
+            Iterator<Resource> valIter, TripleCollection contentGraph,
+            Map.Entry<Property, String> entry) {
+        LiteralFactory fac = LiteralFactory.getInstance();
+        Set<Triple> triplesToBeRemoved = new HashSet<Triple>();
+        if (valIter.hasNext()) {
+            triplesToBeRemoved.add(new TripleImpl(subject, predicate, valIter.next()));
+        }
+        contentGraph.removeAll(triplesToBeRemoved);
+        contentGraph.add(new TripleImpl(subject, predicate,
+                fac.createTypedLiteral(entry.getValue())));
+    }
+
+    private static String getLastSection(String s) {
+        return s.substring(s.lastIndexOf('/', s.length()-2));
+    }
+
+    /**
+     * Helper class whicht is a {@link HashMap} that maps {@link Property} to a {@link String}
+     * @author ali
+     */
+    @SuppressWarnings("serial")
+    static class PropertyMap extends HashMap<Property, String> {
+    }
+
+    static class Property {
+        final String ns;
+        final String prop;
+
+        public Property(String ns, String prop) {
+            this.ns = ns;
+            this.prop = prop;
+        }
+
+        public String value(){
+            return ns+prop;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java
new file mode 100644
index 0000000..012d917
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/collections/CollectionCreator.java
@@ -0,0 +1,74 @@
+/*
+ * 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.collections;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.HIERARCHY;
+import org.apache.clerezza.rdf.ontologies.RDF;
+
+/**
+ * Creates the collections containing a resource in an underlying MGraph
+ *
+ * @author reto
+ */
+public class CollectionCreator {
+
+    private MGraph mGraph;
+
+    public CollectionCreator(MGraph mGraph) {
+        this.mGraph = mGraph;
+    }
+
+    public void createContainingCollections(UriRef uriRef) {
+        try {
+            URI uri = new URI(uriRef.getUnicodeString());
+            if (uri.getHost() == null) {
+                throw new IllegalArgumentException("Host name missing in " + uriRef);
+            }
+            String[] pathSections = uri.getRawPath().split("/");
+            for (int i = pathSections.length - 1; i >= 0 ; i--) {
+                String section = pathSections[i];
+                if (section.length() == 0) {
+                    if (i == 0) {
+                        return;
+                    } else {
+                        throw new IllegalArgumentException(
+                                uriRef+" contains consequtive slashes in path section");
+                    }
+                }
+                final String unicodeString = uriRef.getUnicodeString();
+                int lastIndexOf = unicodeString.lastIndexOf(section);
+                UriRef parentUriRef = new UriRef(unicodeString.substring(0, lastIndexOf));
+                mGraph.add(new TripleImpl(uriRef, HIERARCHY.parent, parentUriRef));
+                mGraph.add(new TripleImpl(parentUriRef, RDF.type, HIERARCHY.Collection));
+                uriRef = parentUriRef;
+
+            }
+        } catch (URISyntaxException ex) {
+            throw new IllegalArgumentException(ex);
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java
new file mode 100644
index 0000000..7881a34
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/genericmetadata/GenericMetaDataGenerator.java
@@ -0,0 +1,53 @@
+/*
+ * 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.genericmetadata;
+
+import java.util.Date;
+import javax.ws.rs.core.MediaType;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.TypedLiteral;
+import org.apache.clerezza.rdf.ontologies.DCTERMS;
+
+/**
+ * This class generates metadata about assets.
+ *
+ * @author tio
+ */
+@Component()
+@Service(MetaDataGenerator.class)
+public class GenericMetaDataGenerator implements MetaDataGenerator {
+
+    @Override
+    public void generate(GraphNode node, byte[] data, MediaType mediaType) {
+        TypedLiteral dateLiteral = LiteralFactory.getInstance()
+                    .createTypedLiteral(new Date());
+        if(node.getObjects(DCTERMS.dateSubmitted).hasNext()) {
+            if(node.getObjects(DCTERMS.modified).hasNext()) {
+                node.deleteProperties(DCTERMS.modified);
+            }
+            node.addProperty(DCTERMS.modified, dateLiteral);
+        } else {
+            node.addProperty(DCTERMS.dateSubmitted, dateLiteral);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.java
new file mode 100644
index 0000000..9b7c666
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/COPY.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 COPY requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("COPY")
+public @interface COPY {
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java
----------------------------------------------------------------------
diff --git a/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.java
new file mode 100644
index 0000000..8fb4630
--- /dev/null
+++ b/platform/content/src/main/java/org/apache/clerezza/platform/content/webdav/LOCK.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 LOCK requests
+ * @author ali
+ */
+
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@HttpMethod("LOCK")
+public @interface LOCK {
+
+}


[27/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFa.1.3.0.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFa.1.3.0.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFa.1.3.0.js
new file mode 100644
index 0000000..4cc83b4
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/RDFa.1.3.0.js
@@ -0,0 +1,3380 @@
+/** @preserve green-turtle version 1.3.0 Copyright (c) 2011-2013, R. Alexander Milowski <al...@milowski.com> All rights reserved. */
+/**         
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+if (typeof GreenTurtle == "undefined") {
+
+var GreenTurtle = (function() {
+
+var env = {};
+
+      env.version = "1.3.0";
+   function URIResolver() {
+}
+URIResolver.SCHEME = /^[A-Za-z][A-Za-z0-9\+\-\.]*\:/;
+
+URIResolver.prototype.parseURI = function(uri) {
+   var match = URIResolver.SCHEME.exec(uri);
+   if (!match) {
+      throw "Bad URI value, no scheme: "+uri;
+   }
+   var parsed = { spec: uri };
+   parsed.scheme = match[0].substring(0,match[0].length-1);
+   parsed.schemeSpecificPart = parsed.spec.substring(match[0].length);
+   if (parsed.schemeSpecificPart.charAt(0)=='/' && parsed.schemeSpecificPart.charAt(1)=='/') {
+      this.parseGeneric(parsed);
+   } else {
+      parsed.isGeneric = false;
+   }
+   parsed.normalize = function() {
+      if (!this.isGeneric) {
+         return;
+      }
+      if (this.segments.length==0) {
+         return;
+      }
+      // edge case of ending in "/."
+      if (this.path.length>1 && this.path.substring(this.path.length-2)=="/.") {
+         this.path = this.path.substring(0,this.path.length-1);
+         this.segments.splice(this.segments.length-1,1);
+         this.schemeSpecificPart = "//"+this.authority+this.path;
+         if (typeof this.query != "undefined") {
+            this.schemeSpecificPart += "?" + this.query;
+         }
+         if (typeof this.fragment != "undefined") {
+            this.schemeSpecificPart += "#" + this.fragment;
+         }
+         this.spec = this.scheme+":"+this.schemeSpecificPart;
+         return;
+      }
+      var end = this.path.charAt(this.path.length-1);
+      if (end!="/") {
+         end = "";
+      }
+      for (var i=0; i<this.segments.length; i++) {
+         if (i>0 && this.segments[i]=="..") {
+            this.segments.splice(i-1,2);
+            i -= 2;
+         }
+         if (this.segments[i]==".") {
+            this.segments.splice(i,1);
+            i--;
+         }
+      }
+      this.path = this.segments.length==0 ? "/" : "/"+this.segments.join("/")+end;
+      this.schemeSpecificPart = "//"+this.authority+this.path;
+      if (typeof this.query != "undefined") {
+         this.schemeSpecificPart += "?" + this.query;
+      }
+      if (typeof this.fragment != "undefined") {
+         this.schemeSpecificPart += "#" + this.fragment;
+      }
+      this.spec = this.scheme+":"+this.schemeSpecificPart;
+   }
+   parsed.resolve = function(href) {
+      if (!href) {
+         return this.spec;
+      }
+      if (href.charAt(0)=='#') {
+         var lastHash = this.spec.lastIndexOf('#');
+         return lastHash<0 ? this.spec+href : this.spec.substring(0,lastHash)+href;
+      }
+      if (!this.isGeneric) {
+         throw "Cannot resolve uri against non-generic URI: "+this.spec;
+      }
+      var colon = href.indexOf(':');
+      if (href.charAt(0)=='/') {
+         return this.scheme+"://"+this.authority+href;
+      } else if (href.charAt(0)=='.' && href.charAt(1)=='/') {
+         if (this.path.charAt(this.path.length-1)=='/') {
+            return this.scheme+"://"+this.authority+this.path+href.substring(2);
+         } else {
+            var last = this.path.lastIndexOf('/');
+            return this.scheme+"://"+this.authority+this.path.substring(0,last)+href.substring(1);
+         }
+      } else if (URIResolver.SCHEME.test(href)) {
+         return href;
+      } else if (href.charAt(0)=="?") {
+         return this.scheme+"://"+this.authority+this.path+href;
+      } else {
+         if (this.path.charAt(this.path.length-1)=='/') {
+            return this.scheme+"://"+this.authority+this.path+href;
+         } else {
+            var last = this.path.lastIndexOf('/');
+            return this.scheme+"://"+this.authority+this.path.substring(0,last+1)+href;
+         }
+      }
+   };
+   parsed.relativeTo = function(otherURI) {
+      if (otherURI.scheme!=this.scheme) {
+         return this.spec;
+      }
+      if (!this.isGeneric) {
+         throw "A non generic URI cannot be made relative: "+this.spec;
+      }
+      if (!otherURI.isGeneric) {
+         throw "Cannot make a relative URI against a non-generic URI: "+otherURI.spec;
+      }
+      if (otherURI.authority!=this.authority) {
+         return this.spec;
+      }
+      var i=0;
+      for (; i<this.segments.length && i<otherURI.segments.length; i++) {
+         if (this.segments[i]!=otherURI.segments[i]) {
+            //alert(this.path+" different from "+otherURI.path+" at '"+this.segments[i]+"' vs '"+otherURI.segments[i]+"'");
+            var relative = "";
+            for (var j=i; j<otherURI.segments.length; j++) {
+               relative += "../";
+            }
+            for (var j=i; j<this.segments.length; j++) {
+               relative += this.segments[j];
+               if ((j+1)<this.segments.length) {
+                  relative += "/";
+               }
+            }
+            if (this.path.charAt(this.path.length-1)=='/') {
+               relative += "/";
+            }
+            return relative;
+         }
+      }
+      if (this.segments.length==otherURI.segments.length) {
+         return this.hash ? this.hash : (this.query ? this.query : "");
+      } else if (i<this.segments.length) {
+         var relative = "";
+         for (var j=i; j<this.segments.length; j++) {
+            relative += this.segments[j];
+            if ((j+1)<this.segments.length) {
+               relative += "/";
+            }
+         }
+         if (this.path.charAt(this.path.length-1)=='/') {
+            relative += "/";
+         }
+         return relative;
+      } else {
+         throw "Cannot calculate a relative URI for "+this.spec+" against "+otherURI.spec;
+      } 
+   };
+   return parsed;
+}
+
+URIResolver.prototype.parseGeneric = function(parsed) {
+   if (parsed.schemeSpecificPart.charAt(0)!='/' || parsed.schemeSpecificPart.charAt(1)!='/') {
+      throw "Generic URI values should start with '//':"+parsed.spec;
+   }
+  
+   var work = parsed.schemeSpecificPart.substring(2);
+   var pathStart = work.indexOf("/");
+   parsed.authority = pathStart<0 ? work : work.substring(0,pathStart);
+   parsed.path = pathStart<0 ? "" : work.substring(pathStart);
+   var hash = parsed.path.indexOf('#');
+   if (hash>=0) {
+      parsed.fragment = parsed.path.substring(hash+1);
+      parsed.path = parsed.path.substring(0,hash);
+   }
+   var questionMark = parsed.path.indexOf('?');
+   if (questionMark>=0) {
+      parsed.query = parsed.path.substring(questionMark+1);
+      parsed.path = parsed.path.substring(0,questionMark);
+   }
+   if (parsed.path=="/" || parsed.path=="") {
+      parsed.segments = [];
+   } else {
+      parsed.segments = parsed.path.split(/\//);
+      if (parsed.segments.length>0 && parsed.segments[0]=='' && parsed.path.length>1 && parsed.path.charAt(1)!='/') {
+         // empty segment at the start, remove it
+         parsed.segments.shift();
+      }
+      if (parsed.segments.length>0 && parsed.path.length>0 && parsed.path.charAt(parsed.path.length-1)=='/' && parsed.segments[parsed.segments.length-1]=='') {
+         // we may have an empty the end
+         // check to see if it is legimate
+         if (parsed.path.length>1 && parsed.path.charAt(parsed.path.length-2)!='/') {
+            parsed.segments.pop();
+         }
+      }
+      // check for non-escaped characters
+      for (var i=0; i<parsed.segments.length; i++) {
+         var check = parsed.segments[i].split(/%[A-Za-z0-9][A-Za-z0-9]|[\ud800-\udfff][\ud800-\udfff]|[A-Za-z0-9\-\._~!$&'()*+,;=@:\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/);
+
+                 for (var j=0; j<check.length; j++) {
+            if (check[j].length>0) {
+               throw "Unecaped character "+check[j].charAt(0)+" ("+check[j].charCodeAt(0)+") in URI "+parsed.spec;
+            }
+         }
+      }
+   }
+   parsed.isGeneric = true;
+}
+
+RDFaProcessor.prototype = new URIResolver();
+RDFaProcessor.prototype.constructor=RDFaProcessor;
+function RDFaProcessor(targetObject) {
+   if (targetObject) {
+      this.target = targetObject;
+   } else {
+      this.target = {
+         graph: {
+            subjects: {},
+            prefixes: {},
+            terms: {}
+         }
+      };
+   }
+   this.theOne = "_:"+(new Date()).getTime();
+   this.language = null;
+   this.vocabulary = null;
+   this.blankCounter = 0;
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" } ];
+   this.inXHTMLMode = false;
+   this.absURIRE = /[\w\_\-]+:\S+/;
+   this.finishedHandlers = [];
+   this.init();
+}
+
+RDFaProcessor.prototype.newBlankNode = function() {
+   this.blankCounter++;
+   return "_:"+this.blankCounter;
+}
+
+RDFaProcessor.XMLLiteralURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"; 
+RDFaProcessor.HTMLLiteralURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"; 
+RDFaProcessor.PlainLiteralURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral";
+RDFaProcessor.objectURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#object";
+RDFaProcessor.typeURI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
+
+RDFaProcessor.nameChar = '[-A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF\.0-9\u00B7\u0300-\u036F\u203F-\u2040]';
+RDFaProcessor.nameStartChar = '[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0
 B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u
 1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]';
+RDFaProcessor.NCNAME = new RegExp('^' + RDFaProcessor.nameStartChar + RDFaProcessor.nameChar + '*$');
+
+RDFaProcessor.trim = function(str) {
+   return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+}
+
+RDFaProcessor.prototype.tokenize = function(str) {
+   return RDFaProcessor.trim(str).split(/\s+/);
+}
+
+
+RDFaProcessor.prototype.parseSafeCURIEOrCURIEOrURI = function(value,prefixes,base) {
+   value = RDFaProcessor.trim(value);
+   if (value.charAt(0)=='[' && value.charAt(value.length-1)==']') {
+      value = value.substring(1,value.length-1);
+      value = value.trim(value);
+      if (value.length==0) {
+         return null;
+      }
+      if (value=="_:") {
+         // the one node
+         return this.theOne;
+      }
+      return this.parseCURIE(value,prefixes,base);
+   } else {
+      return this.parseCURIEOrURI(value,prefixes,base);
+   }
+}
+
+RDFaProcessor.prototype.parseCURIE = function(value,prefixes,base) {
+   var colon = value.indexOf(":");
+   if (colon>=0) {
+      var prefix = value.substring(0,colon);
+      if (prefix=="") {
+         // default prefix
+         var uri = prefixes[""];
+         return uri ? uri+value.substring(colon+1) : null;
+      } else if (prefix=="_") {
+         // blank node
+         return "_:"+value.substring(colon+1);
+      } else if (RDFaProcessor.NCNAME.test(prefix)) {
+         var uri = prefixes[prefix];
+         if (uri) {
+            return uri+value.substring(colon+1);
+         }
+      }
+   }
+   return null;
+}
+
+RDFaProcessor.prototype.parseCURIEOrURI = function(value,prefixes,base) {
+   var curie = this.parseCURIE(value,prefixes,base);
+   if (curie) {
+      return curie;
+   }
+   return this.resolveAndNormalize(base,value);
+}
+
+RDFaProcessor.prototype.parsePredicate = function(value,defaultVocabulary,terms,prefixes,base,ignoreTerms) {
+   if (value=="") {
+      return null;
+   }
+   var predicate = this.parseTermOrCURIEOrAbsURI(value,defaultVocabulary,ignoreTerms ? null : terms,prefixes,base);
+   if (predicate && predicate.indexOf("_:")==0) {
+      return null;
+   }
+   return predicate;
+}
+
+RDFaProcessor.prototype.parseTermOrCURIEOrURI = function(value,defaultVocabulary,terms,prefixes,base) {
+   //alert("Parsing "+value+" with default vocab "+defaultVocabulary);
+   value = RDFaProcessor.trim(value);
+   var curie = this.parseCURIE(value,prefixes,base);
+   if (curie) {
+      return curie;
+   } else {
+       var term = terms[value];
+       if (term) {
+          return term;
+       }
+       var lcvalue = value.toLowerCase();
+       term = terms[lcvalue];
+       if (term) {
+          return term;
+       }
+       if (defaultVocabulary && !this.absURIRE.exec(value)) {
+          return defaultVocabulary+value
+       }
+   }
+   return this.resolveAndNormalize(base,value);
+}
+
+RDFaProcessor.prototype.parseTermOrCURIEOrAbsURI = function(value,defaultVocabulary,terms,prefixes,base) {
+   //alert("Parsing "+value+" with default vocab "+defaultVocabulary);
+   value = RDFaProcessor.trim(value);
+   var curie = this.parseCURIE(value,prefixes,base);
+   if (curie) {
+      return curie;
+   } else if (terms) {
+       if (defaultVocabulary && !this.absURIRE.exec(value)) {
+          return defaultVocabulary+value
+       }
+       var term = terms[value];
+       if (term) {
+          return term;
+       }
+       var lcvalue = value.toLowerCase();
+       term = terms[lcvalue];
+       if (term) {
+          return term;
+       }
+   }
+   if (this.absURIRE.exec(value)) {
+      return this.resolveAndNormalize(base,value);
+   }
+   return null;
+}
+
+RDFaProcessor.prototype.resolveAndNormalize = function(base,href) {
+   var u = base.resolve(href);
+   var parsed = this.parseURI(u);
+   parsed.normalize();
+   return parsed.spec;
+}
+
+RDFaProcessor.prototype.parsePrefixMappings = function(str,target) {
+   var values = this.tokenize(str);
+   var prefix = null;
+   var uri = null;
+   for (var i=0; i<values.length; i++) {
+      if (values[i][values[i].length-1]==':') {
+         prefix = values[i].substring(0,values[i].length-1);
+      } else if (prefix) {
+         target[prefix] = this.target.baseURI ? this.target.baseURI.resolve(values[i]) : values[i];
+         prefix = null;
+      }
+   }
+}
+
+RDFaProcessor.prototype.copyMappings = function(mappings) {
+   var newMappings = {};
+   for (var k in mappings) {
+      newMappings[k] = mappings[k];
+   }
+   return newMappings;
+}
+
+RDFaProcessor.prototype.ancestorPath = function(node) {
+   var path = "";
+   while (node && node.nodeType!=Node.DOCUMENT_NODE) {
+      path = "/"+node.localName+path;
+      node = node.parentNode;
+   }
+   return path;
+}
+
+RDFaProcessor.prototype.setContext = function(node) {
+
+   // We only recognized XHTML+RDFa 1.1 if the version is set propertyly
+   if (node.localName=="html" && node.getAttribute("version")=="XHTML+RDFa 1.1") {
+      this.setXHTMLContext();
+   } else if (node.localName=="html" || node.namespaceURI=="http://www.w3.org/1999/xhtml") {
+      if (document.doctype) {
+         if (document.doctype.publicId=="-//W3C//DTD XHTML+RDFa 1.0//EN" && document.doctype.systemId=="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd") {
+            console.log("WARNING: RDF 1.0 is not supported.  Defaulting to HTML5 mode.");
+            this.setHTMLContext();
+         } else if (document.doctype.publicId=="-//W3C//DTD XHTML+RDFa 1.1//EN" && document.doctype.systemId=="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd") {
+            this.setXHTMLContext();
+         } else {
+            this.setHTMLContext();
+         }
+      } else {
+         this.setHTMLContext();
+      }
+   } else {
+      this.setXMLContext();
+   }
+
+}
+
+RDFaProcessor.prototype.setInitialContext = function() {
+   this.vocabulary = null;
+   // By default, the prefixes are terms are loaded to the RDFa 1.1. standard within the graph constructor
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" } ];
+}
+
+RDFaProcessor.prototype.setXMLContext = function() {
+   this.setInitialContext();
+   this.inXHTMLMode = false;
+   this.inHTMLMode = false;
+}
+
+RDFaProcessor.prototype.setHTMLContext = function() {
+   this.setInitialContext();
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" },
+                           { namespaceURI: null, localName: "lang" }];
+   this.inXHTMLMode = false;
+   this.inHTMLMode = true;
+}
+
+RDFaProcessor.prototype.setXHTMLContext = function() {
+
+   this.setInitialContext();
+   
+   this.inXHTMLMode = true;
+   this.inHTMLMode = false;
+   
+   this.langAttributes = [ { namespaceURI: "http://www.w3.org/XML/1998/namespace", localName: "lang" },
+                           { namespaceURI: null, localName: "lang" }];
+
+   // From http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1
+   this.target.graph.terms["alternate"] = "http://www.w3.org/1999/xhtml/vocab#alternate";
+   this.target.graph.terms["appendix"] = "http://www.w3.org/1999/xhtml/vocab#appendix";
+   this.target.graph.terms["bookmark"] = "http://www.w3.org/1999/xhtml/vocab#bookmark";
+   this.target.graph.terms["cite"] = "http://www.w3.org/1999/xhtml/vocab#cite"
+   this.target.graph.terms["chapter"] = "http://www.w3.org/1999/xhtml/vocab#chapter";
+   this.target.graph.terms["contents"] = "http://www.w3.org/1999/xhtml/vocab#contents";
+   this.target.graph.terms["copyright"] = "http://www.w3.org/1999/xhtml/vocab#copyright";
+   this.target.graph.terms["first"] = "http://www.w3.org/1999/xhtml/vocab#first";
+   this.target.graph.terms["glossary"] = "http://www.w3.org/1999/xhtml/vocab#glossary";
+   this.target.graph.terms["help"] = "http://www.w3.org/1999/xhtml/vocab#help";
+   this.target.graph.terms["icon"] = "http://www.w3.org/1999/xhtml/vocab#icon";
+   this.target.graph.terms["index"] = "http://www.w3.org/1999/xhtml/vocab#index";
+   this.target.graph.terms["last"] = "http://www.w3.org/1999/xhtml/vocab#last";
+   this.target.graph.terms["license"] = "http://www.w3.org/1999/xhtml/vocab#license";
+   this.target.graph.terms["meta"] = "http://www.w3.org/1999/xhtml/vocab#meta";
+   this.target.graph.terms["next"] = "http://www.w3.org/1999/xhtml/vocab#next";
+   this.target.graph.terms["prev"] = "http://www.w3.org/1999/xhtml/vocab#prev";
+   this.target.graph.terms["previous"] = "http://www.w3.org/1999/xhtml/vocab#previous";
+   this.target.graph.terms["section"] = "http://www.w3.org/1999/xhtml/vocab#section";
+   this.target.graph.terms["stylesheet"] = "http://www.w3.org/1999/xhtml/vocab#stylesheet";
+   this.target.graph.terms["subsection"] = "http://www.w3.org/1999/xhtml/vocab#subsection";
+   this.target.graph.terms["start"] = "http://www.w3.org/1999/xhtml/vocab#start";
+   this.target.graph.terms["top"] = "http://www.w3.org/1999/xhtml/vocab#top";
+   this.target.graph.terms["up"] = "http://www.w3.org/1999/xhtml/vocab#up";
+   this.target.graph.terms["p3pv1"] = "http://www.w3.org/1999/xhtml/vocab#p3pv1";
+
+   // other
+   this.target.graph.terms["related"] = "http://www.w3.org/1999/xhtml/vocab#related";
+   this.target.graph.terms["role"] = "http://www.w3.org/1999/xhtml/vocab#role";
+   this.target.graph.terms["transformation"] = "http://www.w3.org/1999/xhtml/vocab#transformation";
+}
+
+RDFaProcessor.prototype.init = function() {
+}
+
+RDFaProcessor.prototype.newSubjectOrigin = function(origin,subject) {
+}
+
+RDFaProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+}
+
+RDFaProcessor.dateTimeTypes = [
+   { pattern: /-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,
+     type: "http://www.w3.org/2001/XMLSchema#duration" },
+   { pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,
+     type: "http://www.w3.org/2001/XMLSchema#dateTime" },
+   { pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,
+     type: "http://www.w3.org/2001/XMLSchema#date" },
+   { pattern: /(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,
+     type: "http://www.w3.org/2001/XMLSchema#time" },
+   { pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,
+     type: "http://www.w3.org/2001/XMLSchema#gYearMonth" },
+   { pattern: /-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,
+     type: "http://www.w3.org/2001/XMLSchema#gYear" }
+];
+
+RDFaProcessor.deriveDateTimeType = function(value) {
+   for (var i=0; i<RDFaProcessor.dateTimeTypes.length; i++) {
+      //console.log("Checking "+value+" against "+RDFaProcessor.dateTimeTypes[i].type);
+      var matched = RDFaProcessor.dateTimeTypes[i].pattern.exec(value);
+      if (matched && matched[0].length==value.length) {
+         //console.log("Matched!");
+         return RDFaProcessor.dateTimeTypes[i].type;
+      }
+   }
+   return null;
+}
+
+RDFaProcessor.prototype.process = function(node,options) {
+
+   /*
+   if (!window.console) {
+      window.console = { log: function() {} };
+   }*/
+   if (node.nodeType==Node.DOCUMENT_NODE) {
+      node = node.documentElement;
+      this.setContext(node);
+   } else if (node.parentNode.nodeType==Node.DOCUMENT_NODE) {
+      this.setContext(node);
+   } 
+   var queue = [];
+   // Fix for Firefox that includes the hash in the base URI
+   var removeHash = function(baseURI) {
+      var hash = baseURI.indexOf("#");
+      if (hash>=0) {
+         baseURI = baseURI.substring(0,hash);
+      }
+      if (options && options.baseURIMap) {
+         baseURI = options.baseURIMap(baseURI);
+      }
+      return baseURI;
+   }
+   queue.push({ current: node, context: this.push(null,removeHash(node.baseURI))});
+   while (queue.length>0) {
+      var item = queue.shift();
+      if (item.parent) {
+         // Sequence Step 14: list triple generation
+         if (item.context.parent && item.context.parent.listMapping==item.listMapping) {
+            // Skip a child context with exactly the same mapping
+            continue;
+         }
+         //console.log("Generating lists for "+item.subject+", tag "+item.parent.localName);
+         for (var predicate in item.listMapping) {
+            var list = item.listMapping[predicate];
+            if (list.length==0) {
+               this.addTriple(item.parent,item.subject,predicate,{ type: RDFaProcessor.objectURI, value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" });
+               continue;
+            }
+            var bnodes = [];
+            for (var i=0; i<list.length; i++) {
+               bnodes.push(this.newBlankNode());
+               //this.newSubject(item.parent,bnodes[i]);
+            }
+            for (var i=0; i<bnodes.length; i++) {
+               this.addTriple(item.parent,bnodes[i],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",list[i]);
+               this.addTriple(item.parent,bnodes[i],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{ type: RDFaProcessor.objectURI , value: (i+1)<bnodes.length ? bnodes[i+1] : "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" });
+            }
+            this.addTriple(item.parent,item.subject,predicate,{ type: RDFaProcessor.objectURI, value: bnodes[0] });
+         }
+         continue;
+      }
+      var current = item.current;
+      var context = item.context;
+
+      //console.log("Tag: "+current.localName+", listMapping="+JSON.stringify(context.listMapping));
+
+      // Sequence Step 1
+      var skip = false;
+      var newSubject = null;
+      var currentObjectResource = null;
+      var typedResource = null;
+      var prefixes = context.prefixes;
+      var prefixesCopied = false;
+      var incomplete = [];
+      var listMapping = context.listMapping;
+      var listMappingDifferent = context.parent ? false : true;
+      var language = context.language;
+      var vocabulary = context.vocabulary;
+
+      // TODO: the "base" element may be used for HTML+RDFa 1.1
+      var base = this.parseURI(removeHash(current.baseURI));
+      current.item = null;
+
+      // Sequence Step 2: set the default vocabulary
+      var vocabAtt = current.getAttributeNode("vocab");
+      if (vocabAtt) {
+         var value = RDFaProcessor.trim(vocabAtt.value);
+         if (value.length>0) {
+            vocabulary = value;
+            var baseSubject = base.spec;
+            //this.newSubject(current,baseSubject);
+            this.addTriple(current,baseSubject,"http://www.w3.org/ns/rdfa#usesVocabulary",{ type: RDFaProcessor.objectURI , value: vocabulary});
+         } else {
+            vocabulary = this.vocabulary;
+         }
+      }
+
+      // Sequence Step 3: IRI mappings
+      // handle xmlns attributes
+      for (var i=0; i<current.attributes.length; i++) {
+         var att = current.attributes[i];
+         //if (att.namespaceURI=="http://www.w3.org/2000/xmlns/") {
+         if (att.nodeName.charAt(0)=="x" && att.nodeName.indexOf("xmlns:")==0) {
+            if (!prefixesCopied) {
+               prefixes = this.copyMappings(prefixes);
+               prefixesCopied = true;
+            }
+            var prefix = att.nodeName.substring(6);
+            // TODO: resolve relative?
+            var ref = RDFaProcessor.trim(att.value);
+            prefixes[prefix] = this.target.baseURI ? this.target.baseURI.resolve(ref) : ref;
+         }
+      }
+      // Handle prefix mappings (@prefix)
+      var prefixAtt = current.getAttributeNode("prefix");
+      if (prefixAtt) {
+         if (!prefixesCopied) {
+            prefixes = this.copyMappings(prefixes);
+            prefixesCopied = true;
+         }
+         this.parsePrefixMappings(prefixAtt.value,prefixes);
+      }
+
+
+      // Sequence Step 4: language
+      var xmlLangAtt = null;
+      for (var i=0; !xmlLangAtt && i<this.langAttributes.length; i++) {
+         xmlLangAtt = current.getAttributeNodeNS(this.langAttributes[i].namespaceURI,this.langAttributes[i].localName);
+      }
+      if (xmlLangAtt) {
+         var value = RDFaProcessor.trim(xmlLangAtt.value);
+         if (value.length>0) {
+            language = value;
+         } else {
+            language = null;
+         }
+      }
+
+      var relAtt = current.getAttributeNode("rel");
+      var revAtt = current.getAttributeNode("rev");
+      var typeofAtt = current.getAttributeNode("typeof");
+      var propertyAtt = current.getAttributeNode("property");
+      var datatypeAtt = current.getAttributeNode("datatype");
+      var datetimeAtt = this.inHTMLMode ? current.getAttributeNode("datetime") : null;
+      var contentAtt = current.getAttributeNode("content");
+      var aboutAtt = current.getAttributeNode("about");
+      var srcAtt = current.getAttributeNode("src");
+      var resourceAtt = current.getAttributeNode("resource");
+      var hrefAtt = current.getAttributeNode("href");
+      var inlistAtt = current.getAttributeNode("inlist");
+      
+      var relAttPredicates = [];
+      if (relAtt) {
+         var values = this.tokenize(relAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var predicate = this.parsePredicate(values[i],vocabulary,context.terms,prefixes,base,this.inHTMLMode && propertyAtt!=null);
+            if (predicate) {
+               relAttPredicates.push(predicate);
+            }
+         }
+      }
+      var revAttPredicates = [];
+      if (revAtt) {
+         var values = this.tokenize(revAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var predicate = this.parsePredicate(values[i],vocabulary,context.terms,prefixes,base,this.inHTMLMode && propertyAtt!=null);
+            if (predicate) {
+               revAttPredicates.push(predicate);
+            }
+         }
+      }
+      
+      // Section 3.1, bullet 7
+      if (this.inHTMLMode && (relAtt!=null || revAtt!=null) && propertyAtt!=null) {
+         if (relAttPredicates.length==0) {
+            relAtt = null;
+         }
+         if (revAttPredicates.length==0) {
+            revAtt = null;
+         }
+      }
+
+      if (relAtt || revAtt) {
+         // Sequence Step 6: establish new subject and value
+         if (aboutAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value,prefixes,base);
+         }
+         if (typeofAtt) {
+            typedResource = newSubject;
+         }
+         if (!newSubject) {
+            if (current.parentNode.nodeType==Node.DOCUMENT_NODE) {
+               newSubject = removeHash(current.baseURI);
+            } else if (context.parentObject) {
+               // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
+               newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+            }
+         }
+         if (resourceAtt) {
+            currentObjectResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+         }
+         
+         if (!currentObjectResource) {
+            if (hrefAtt) {
+               currentObjectResource = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+            } else if (srcAtt) {
+               currentObjectResource = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+            } else if (typeofAtt && !aboutAtt && !(this.inXHTMLMode && (current.localName=="head" || current.localName=="body"))) {
+               currentObjectResource = this.newBlankNode();
+            }
+         }
+         if (typeofAtt && !aboutAtt && this.inXHTMLMode && (current.localName=="head" || current.localName=="body")) {
+            typedResource = newSubject;
+         } else if (typeofAtt && !aboutAtt) {
+            typedResource = currentObjectResource;
+         }
+
+      } else if (propertyAtt && !contentAtt && !datatypeAtt) {
+         // Sequence Step 5.1: establish a new subject
+         if (aboutAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value,prefixes,base);
+            if (typeofAtt) {
+               typedResource = newSubject;
+            }
+         }
+         if (!newSubject && current.parentNode.nodeType==Node.DOCUMENT_NODE) {
+            newSubject = removeHash(current.baseURI);
+            if (typeofAtt) {
+               typedResource = newSubject;
+            }
+         } else if (!newSubject && context.parentObject) {
+            // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
+            newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+         }
+         if (typeofAtt && !typedResource) {
+            if (resourceAtt) {
+               typedResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+            }
+            if (!typedResource &&hrefAtt) {
+               typedResource = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+            }
+            if (!typedResource && srcAtt) {
+               typedResource = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+            }
+            if (!typedResource && (this.inXHTMLMode || this.inHTMLMode) && (current.localName=="head" || current.localName=="body")) {
+               typedResource = newSubject;
+            }
+            if (!typedResource) {
+               typedResource = this.newBlankNode();
+            }
+            currentObjectResource = typedResource;
+         }
+         //console.log(current.localName+", newSubject="+newSubject+", typedResource="+typedResource+", currentObjectResource="+currentObjectResource);
+      } else {
+         // Sequence Step 5.2: establish a new subject
+         if (aboutAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value,prefixes,base);
+         }
+         if (!newSubject && resourceAtt) {
+            newSubject = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+         }
+         if (!newSubject && hrefAtt) {
+            newSubject = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+         }
+         if (!newSubject && srcAtt) {
+            newSubject = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+         }
+         if (!newSubject) {
+            if (current.parentNode.nodeType==Node.DOCUMENT_NODE) {
+               newSubject = removeHash(current.baseURI);
+            } else if ((this.inXHTMLMode || this.inHTMLMode) && (current.localName=="head" || current.localName=="body")) {
+               newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+            } else if (typeofAtt) {
+               newSubject = this.newBlankNode();
+            } else if (context.parentObject) {
+               // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI
+               newSubject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+               if (!propertyAtt) {
+                  skip = true;
+               }
+            }
+         }
+         if (typeofAtt) {
+            typedResource = newSubject;
+         }
+      }
+
+      //console.log(current.tagName+": newSubject="+newSubject+", currentObjectResource="+currentObjectResource+", typedResource="+typedResource+", skip="+skip);
+
+      var rdfaData = null;
+      if (newSubject) {
+         //this.newSubject(current,newSubject);
+         if (aboutAtt || resourceAtt || typedResource) {
+            var id = newSubject;
+            if (typeofAtt && !aboutAtt && !resourceAtt && currentObjectResource) {
+               id = currentObjectResource;
+            }
+            //console.log("Setting data attribute for "+current.localName+" for subject "+id);
+            this.newSubjectOrigin(current,id);
+         }
+      }
+      
+      // Sequence Step 7: generate type triple
+      if (typedResource) {
+         var values = this.tokenize(typeofAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var object = this.parseTermOrCURIEOrAbsURI(values[i],vocabulary,context.terms,prefixes,base);
+            if (object) {
+               this.addTriple(current,typedResource,RDFaProcessor.typeURI,{ type: RDFaProcessor.objectURI , value: object});
+            }
+         }
+      }
+
+      // Sequence Step 8: new list mappings if there is a new subject
+      //console.log("Step 8: newSubject="+newSubject+", context.parentObject="+context.parentObject);
+      if (newSubject && newSubject!=context.parentObject) {
+         //console.log("Generating new list mapping for "+newSubject);
+         listMapping = {};
+         listMappingDifferent = true;
+      }
+
+      // Sequence Step 9: generate object triple
+      if (currentObjectResource) {
+         if (relAtt && inlistAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               var list = listMapping[relAttPredicates[i]];
+               if (!list) {
+                  list = [];
+                  listMapping[relAttPredicates[i]] = list;
+               }
+               list.push({ type: RDFaProcessor.objectURI, value: currentObjectResource });
+            }
+         } else if (relAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               this.addTriple(current,newSubject,relAttPredicates[i],{ type: RDFaProcessor.objectURI, value: currentObjectResource});
+            }
+         }
+         if (revAtt) {
+            for (var i=0; i<revAttPredicates.length; i++) {
+               this.addTriple(current,currentObjectResource, revAttPredicates[i], { type: RDFaProcessor.objectURI, value: newSubject});
+            }
+         }
+      } else {
+         // Sequence Step 10: incomplete triples
+         if (newSubject && !currentObjectResource && (relAtt || revAtt)) {
+            currentObjectResource = this.newBlankNode();
+            //alert(current.tagName+": generated blank node, newSubject="+newSubject+" currentObjectResource="+currentObjectResource);
+         }
+         if (relAtt && inlistAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               var list = listMapping[relAttPredicates[i]];
+               if (!list) {
+                  list = [];
+                  listMapping[predicate] = list;
+               }
+               //console.log("Adding incomplete list for "+predicate);
+               incomplete.push({ predicate: relAttPredicates[i], list: list });
+            }
+         } else if (relAtt) {
+            for (var i=0; i<relAttPredicates.length; i++) {
+               incomplete.push({ predicate: relAttPredicates[i], forward: true });
+            }
+         }
+         if (revAtt) {
+            for (var i=0; i<revAttPredicates.length; i++) {
+               incomplete.push({ predicate: revAttPredicates[i], forward: false });
+            }
+         }
+      }
+
+      // Step 11: Current property values
+      if (propertyAtt) {
+         var datatype = null;
+         var content = null; 
+         if (datatypeAtt) {
+            datatype = datatypeAtt.value=="" ? RDFaProcessor.PlainLiteralURI : this.parseTermOrCURIEOrAbsURI(datatypeAtt.value,vocabulary,context.terms,prefixes,base);
+            if (datetimeAtt && !contentAtt) {
+               content = datetimeAtt.value;
+            } else {
+               content = datatype==RDFaProcessor.XMLLiteralURI || datatype==RDFaProcessor.HTMLLiteralURI ? null : (contentAtt ? contentAtt.value : current.textContent);
+            }
+         } else if (contentAtt) {
+            datatype = RDFaProcessor.PlainLiteralURI;
+            content = contentAtt.value;
+         } else if (datetimeAtt) {
+            content = datetimeAtt.value;
+            datatype = RDFaProcessor.deriveDateTimeType(content);
+            if (!datatype) {
+               datatype = RDFaProcessor.PlainLiteralURI;
+            }
+         } else if (!relAtt && !revAtt) {
+            if (resourceAtt) {
+               content = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value,prefixes,base);
+            }
+            if (!content && hrefAtt) {
+               content = this.resolveAndNormalize(base,encodeURI(hrefAtt.value));
+            } else if (!content && srcAtt) {
+               content = this.resolveAndNormalize(base,encodeURI(srcAtt.value));
+            }
+            if (content) {
+               datatype = RDFaProcessor.objectURI;
+            }
+         }
+         if (!datatype) {
+            if (typeofAtt && !aboutAtt) {
+               datatype = RDFaProcessor.objectURI;
+               content = typedResource;
+            } else {
+               content = current.textContent;
+               if (this.inHTMLMode && current.localName=="time") {
+                  datatype = RDFaProcessor.deriveDateTimeType(content);
+               }
+               if (!datatype) {
+                  datatype = RDFaProcessor.PlainLiteralURI;
+               }
+            }
+         }
+         var values = this.tokenize(propertyAtt.value);
+         for (var i=0; i<values.length; i++) {
+            var predicate = this.parsePredicate(values[i],vocabulary,context.terms,prefixes,base);
+            if (predicate) {
+               if (inlistAtt) {
+                  var list = listMapping[predicate];
+                  if (!list) {
+                     list = [];
+                     listMapping[predicate] = list;
+                  }
+                  list.push((datatype==RDFaProcessor.XMLLiteralURI || datatype==RDFaProcessor.HTMLLiteralURI) ? { type: datatype, value: current.childNodes} : { type: datatype ? datatype : RDFaProcessor.PlainLiteralURI, value: content, language: language});
+               } else {
+                  if (datatype==RDFaProcessor.XMLLiteralURI || datatype==RDFaProcessor.HTMLLiteralURI) {
+                     this.addTriple(current,newSubject,predicate,{ type: datatype, value: current.childNodes});
+                  } else {
+                     this.addTriple(current,newSubject,predicate,{ type: datatype ? datatype : RDFaProcessor.PlainLiteralURI, value: content, language: language});
+                     //console.log(newSubject+" "+predicate+"="+content);
+                  }
+               }
+            }
+         }
+      }
+
+      // Sequence Step 12: complete incomplete triples with new subject
+      if (newSubject && !skip) {
+         for (var i=0; i<context.incomplete.length; i++) {
+            if (context.incomplete[i].list) {
+               //console.log("Adding subject "+newSubject+" to list for "+context.incomplete[i].predicate);
+               // TODO: it is unclear what to do here
+               context.incomplete[i].list.push({ type: RDFaProcessor.objectURI, value: newSubject });
+            } else if (context.incomplete[i].forward) {
+               //console.log(current.tagName+": completing forward triple "+context.incomplete[i].predicate+" with object="+newSubject);
+               this.addTriple(current,context.subject,context.incomplete[i].predicate, { type: RDFaProcessor.objectURI, value: newSubject});
+            } else {
+               //console.log(current.tagName+": completing reverse triple with object="+context.subject);
+               this.addTriple(current,newSubject,context.incomplete[i].predicate,{ type: RDFaProcessor.objectURI, value: context.subject});
+            }
+         }
+      }
+
+      var childContext = null;
+      var listSubject = newSubject;
+      if (skip) {
+         // TODO: should subject be null?
+         childContext = this.push(context,context.subject);
+         // TODO: should the entObject be passed along?  If not, then intermediary children will keep properties from being associated with incomplete triples.
+         // TODO: Verify: if the current baseURI has changed and the parentObject is the parent's base URI, then the baseURI should change
+         childContext.parentObject = removeHash(current.parentNode.baseURI)==context.parentObject ? removeHash(current.baseURI) : context.parentObject;
+         childContext.incomplete = context.incomplete;
+         childContext.language = language;
+         childContext.prefixes = prefixes;
+         childContext.vocabulary = vocabulary;
+      } else {
+         childContext = this.push(context,newSubject);
+         childContext.parentObject = currentObjectResource ? currentObjectResource : (newSubject ? newSubject : context.subject);
+         childContext.prefixes = prefixes;
+         childContext.incomplete = incomplete;
+         if (currentObjectResource) {
+            //console.log("Generating new list mapping for "+currentObjectResource);
+            listSubject = currentObjectResource;
+            listMapping = {};
+            listMappingDifferent = true;
+         }
+         childContext.listMapping = listMapping;
+         childContext.language = language;
+         childContext.vocabulary = vocabulary;
+      }
+      if (listMappingDifferent) {
+         //console.log("Pushing list parent "+current.localName);
+         queue.unshift({ parent: current, context: context, subject: listSubject, listMapping: listMapping});
+      }
+      for (var child = current.lastChild; child; child = child.previousSibling) {
+         if (child.nodeType==Node.ELEMENT_NODE) {
+            //console.log("Pushing child "+child.localName);
+            queue.unshift({ current: child, context: childContext});
+         }
+      }
+   }
+   
+   if (this.inHTMLMode) {
+      this.copyProperties();
+   }
+
+   for (var i=0; i<this.finishedHandlers.length; i++) {
+      this.finishedHandlers[i](node);
+   }
+}
+
+RDFaProcessor.prototype.copyProperties = function() {
+}
+
+
+RDFaProcessor.prototype.push = function(parent,subject) {
+   return {
+      parent: parent,
+      subject: subject ? subject : (parent ? parent.subject : null),
+      parentObject: null,
+      incomplete: [],
+      listMapping: parent ? parent.listMapping : {},
+      language: parent ? parent.language : this.language,
+      prefixes: parent ? parent.prefixes : this.target.graph.prefixes,
+      terms: parent ? parent.terms : this.target.graph.terms,
+      vocabulary: parent ? parent.vocabulary : this.vocabulary
+   };
+};
+
+function RDFaGraph()
+{
+   var dataContext = this;
+   this.curieParser = {
+      trim: function(str) {
+         return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+      },
+      parse: function(value,resolve) {
+         value = this.trim(value);
+         if (value.charAt(0)=='[' && value.charAt(value.length-1)==']') {
+            value = value.substring(1,value.length-1);
+         }
+         var colon = value.indexOf(":");
+         if (colon>=0) {
+            var prefix = value.substring(0,colon);
+            if (prefix=="") {
+               // default prefix
+               var uri = dataContext.prefixes[""];
+               return uri ? uri+value.substring(colon+1) : null;
+            } else if (prefix=="_") {
+               // blank node
+               return "_:"+value.substring(colon+1);
+            } else if (DocumentData.NCNAME.test(prefix)) {
+               var uri = dataContext.prefixes[prefix];
+               if (uri) {
+                  return uri+value.substring(colon+1);
+               }
+            }
+         }
+
+         return resolve ? dataContext.baseURI.resolve(value) : value;
+      }
+   };
+   this.base =  null;
+   this.toString = function(requestOptions) {
+      var options = requestOptions && requestOptions.shorten ? { graph: this, shorten: true, prefixesUsed: {} } : null;
+      if (requestOptions && requestOptions.blankNodePrefix) {
+         options.filterBlankNode = function(id) {
+            return "_:"+requestOptions.blankNodePrefix+id.substring(2);
+         }
+      }
+      if (requestOptions && requestOptions.numericalBlankNodePrefix) {
+         var onlyNumbers = /^[0-9]+$/;
+         options.filterBlankNode = function(id) {
+            var label = id.substring(2);
+            return onlyNumbers.test(label) ? "_:"+requestOptions.numericalBlankNodePrefix+label : id;
+         }
+      }
+      s = "";
+      for (var subject in this.subjects) {
+         var snode = this.subjects[subject];
+         s += snode.toString(options);
+         s += "\n";
+      }
+      var prolog = requestOptions && requestOptions.baseURI ? "@base <"+baseURI+"> .\n" : "";
+      if (options && options.shorten) {
+         for (var prefix in options.prefixesUsed) {
+            prolog += "@prefix "+prefix+": <"+this.prefixes[prefix]+"> .\n";
+         }
+      }
+      return prolog.length==0 ? s : prolog+"\n"+s;
+   };
+   this.blankNodeCounter = 0;
+   this.clear = function() {
+      this.subjects = {};
+      this.prefixes = {};
+      this.terms = {};
+      this.blankNodeCounter = 0;
+   }
+   this.clear();
+   this.prefixes[""] = "http://www.w3.org/1999/xhtml/vocab#";
+
+   // w3c
+   this.prefixes["grddl"] = "http://www.w3.org/2003/g/data-view#";
+   this.prefixes["ma"] = "http://www.w3.org/ns/ma-ont#";
+   this.prefixes["owl"] = "http://www.w3.org/2002/07/owl#";
+   this.prefixes["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   this.prefixes["rdfa"] = "http://www.w3.org/ns/rdfa#";
+   this.prefixes["rdfs"] = "http://www.w3.org/2000/01/rdf-schema#";
+   this.prefixes["rif"] = "http://www.w3.org/2007/rif#";
+   this.prefixes["skos"] = "http://www.w3.org/2004/02/skos/core#";
+   this.prefixes["skosxl"] = "http://www.w3.org/2008/05/skos-xl#";
+   this.prefixes["wdr"] = "http://www.w3.org/2007/05/powder#";
+   this.prefixes["void"] = "http://rdfs.org/ns/void#";
+   this.prefixes["wdrs"] = "http://www.w3.org/2007/05/powder-s#";
+   this.prefixes["xhv"] = "http://www.w3.org/1999/xhtml/vocab#";
+   this.prefixes["xml"] = "http://www.w3.org/XML/1998/namespace";
+   this.prefixes["xsd"] = "http://www.w3.org/2001/XMLSchema#";
+   // non-rec w3c
+   this.prefixes["sd"] = "http://www.w3.org/ns/sparql-service-description#";
+   this.prefixes["org"] = "http://www.w3.org/ns/org#";
+   this.prefixes["gldp"] = "http://www.w3.org/ns/people#";
+   this.prefixes["cnt"] = "http://www.w3.org/2008/content#";
+   this.prefixes["dcat"] = "http://www.w3.org/ns/dcat#";
+   this.prefixes["earl"] = "http://www.w3.org/ns/earl#";
+   this.prefixes["ht"] = "http://www.w3.org/2006/http#";
+   this.prefixes["ptr"] = "http://www.w3.org/2009/pointers#";
+   // widely used
+   this.prefixes["cc"] = "http://creativecommons.org/ns#";
+   this.prefixes["ctag"] = "http://commontag.org/ns#";
+   this.prefixes["dc"] = "http://purl.org/dc/terms/";
+   this.prefixes["dcterms"] = "http://purl.org/dc/terms/";
+   this.prefixes["foaf"] = "http://xmlns.com/foaf/0.1/";
+   this.prefixes["gr"] = "http://purl.org/goodrelations/v1#";
+   this.prefixes["ical"] = "http://www.w3.org/2002/12/cal/icaltzd#";
+   this.prefixes["og"] = "http://ogp.me/ns#";
+   this.prefixes["rev"] = "http://purl.org/stuff/rev#";
+   this.prefixes["sioc"] = "http://rdfs.org/sioc/ns#";
+   this.prefixes["v"] = "http://rdf.data-vocabulary.org/#";
+   this.prefixes["vcard"] = "http://www.w3.org/2006/vcard/ns#";
+   this.prefixes["schema"] = "http://schema.org/";
+   
+   // terms
+   this.terms["describedby"] = "http://www.w3.org/2007/05/powder-s#describedby";
+   this.terms["license"] = "http://www.w3.org/1999/xhtml/vocab#license";
+   this.terms["role"] = "http://www.w3.org/1999/xhtml/vocab#role";
+
+   Object.defineProperty(this,"tripleCount",{
+      enumerable: true,
+      configurable: false,
+      get: function() {
+         var count = 0;
+         for (var s in this.subjects) {
+            var snode = this.subjects[s];
+            for (var p in snode.predicates) {
+               count += snode.predicates[p].objects.length;
+            }
+         }
+         return count;
+      }
+   });
+}
+
+RDFaGraph.prototype.newBlankNode = function() {
+   this.blankNodeCounter++;
+   return "_:"+this.blankNodeCounter;
+}
+
+RDFaGraph.prototype.expand = function(curie) {
+   return this.curieParser.parse(curie,true);  
+}
+
+RDFaGraph.prototype.shorten = function(uri,prefixesUsed) {
+   for (prefix in this.prefixes) {
+      var mapped = this.prefixes[prefix];
+      if (uri.indexOf(mapped)==0) {
+         if (prefixesUsed) {
+            prefixesUsed[prefix] = mapped;
+         }
+         return prefix+":"+uri.substring(mapped.length);
+      }
+   }
+   return null;
+}
+
+RDFaGraph.prototype.add = function(subject,predicate,object,options) {
+   if (!subject || !predicate || !object) {
+      return;
+   }
+   subject = this.expand(subject);
+   predicate = this.expand(predicate);
+   var snode = this.subjects[subject];
+   if (!snode) {
+      snode = new RDFaSubject(this,subject);
+      this.subjects[subject] = snode;
+   }
+   if (options && options.origin) {
+      snode.origins.push(options.origin);
+   }
+   if (predicate=="http://www.w3.org/1999/02/22-rdf-syntax-ns#type") {
+      snode.types.push(object);
+   }
+   var pnode = snode.predicates[predicate];
+   if (!pnode) {
+      pnode = new RDFaPredicate(predicate);
+      snode.predicates[predicate] = pnode;
+   }
+   
+   if (typeof object == "string") {
+      pnode.objects.push({
+         type: RDFaProcessor.PlainLiteralURI,
+         value: object
+      });
+   } else {
+      pnode.objects.push({
+         type: object.type ? this.expand(object.type) : RDFaProcessor.PlainLiteralURI,
+         value: object.value ? object.value : "",
+         origin: object.origin,
+         language: object.language
+      });
+   }
+   
+}
+
+RDFaGraph.prototype.addCollection = function(subject,predicate,objectList,options) {
+   if (!subject || !predicate || !objectList) {
+      return;
+   }
+   
+   var lastSubject = subject;
+   var lastPredicate = predicate;
+   for (var i=0; i<objectList.length; i++) {
+      var object = { type: options && options.type ? options.type : "rdf:PlainLiteral"};
+      if (options && options.language) {
+         object.language = options.language;
+      }
+      if (options && options.datatype) {
+         object.datatype = options.datatype;
+      }
+      if (typeof objectList[i] == "object") {
+         object.value = objectList[i].value ?  objectList[i].value : "";
+         if (objectList[i].type) {
+            object.type = objectList[i].type;
+         }
+         if (objectList[i].language) {
+            object.language = objectList[i].language;
+         }
+         if (objectList[i].datatype) {
+            object.datatype = objectList[i].datatype;
+         }
+      } else {
+         object.value = objectList[i]
+      }
+      var bnode = this.newBlankNode();
+      this.add(lastSubject,lastPredicate,{ type: "rdf:object", value: bnode});
+      this.add(bnode,"rdf:first",object);
+      lastSubject = bnode;
+      lastPredicate = "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";
+   }
+   this.add(lastSubject,lastPredicate,{ type: "rdf:object", value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});
+}
+
+RDFaGraph.prototype.remove = function(subject,predicate) {
+   if (!subject) {
+      this.subjects = {};
+      return;
+   }
+   subject = this.expand(subject);
+   var snode = this.subjects[snode];
+   if (!snode) {
+      return;
+   }
+   if (!predicate) {
+      delete this.subjects[subject];
+      return;
+   }
+   predicate = this.expand(predicate);
+   delete snode.predicates[predicate];
+}
+
+function RDFaSubject(graph,subject) {
+   this.graph = graph;
+   // TODO: subject or id?
+   this.subject = subject
+   this.id = subject;
+   this.predicates =  {};
+   this.origins = [];
+   this.types = [];
+}
+
+RDFaSubject.prototype.toString = function(options) {
+   var s = null;
+   if (this.subject.substring(0,2)=="_:") {
+      if (options && options.filterBlankNode) {
+         s = options.filterBlankNode(this.subject);
+      } else {
+         s = this.subject;
+      }
+   } else if (options && options.shorten) {
+      s = this.graph.shorten(this.subject,options.prefixesUsed);
+      if (!s) {
+         s = "<" + this.subject + ">";
+      }
+   } else {
+      s = "<" + this.subject + ">";
+   }
+   var first = true;
+   for (var predicate in this.predicates) {
+      if (!first) {
+         s += ";\n";
+      } else {
+         first = false;
+      }
+      s += " " + this.predicates[predicate].toString(options);
+   }
+   s += " .";
+   return s;
+}
+
+RDFaSubject.prototype.toObject = function() {
+   var o = { subject: this.subject, predicates: {} };
+   for (var predicate in this.predicates) {
+      var pnode = this.predicates[predicate];
+      var p = { predicate: predicate, objects: [] };
+      o.predicates[predicate] = p;
+      for (var i=0; i<pnode.objects.length; i++) {
+         var object = pnode.objects[i];
+         if (object.type==RDFaProcessor.XMLLiteralURI) {
+            var serializer = new XMLSerializer();
+            var value = "";
+            for (var x=0; x<object.value.length; x++) {
+               if (object.value[x].nodeType==Node.ELEMENT_NODE) {
+                  value += serializer.serializeToString(object.value[x]);
+               } else if (object.value[x].nodeType==Node.TEXT_NODE) {
+                  value += object.value[x].nodeValue;
+               }
+            } 
+            p.objects.push({ type: object.type, value: value, language: object.language });
+         } else {
+            p.objects.push({ type: object.type, value: object.value, language: object.language });
+         }
+      }
+   }
+   return o;
+   
+}
+
+RDFaSubject.prototype.getValues = function() {
+   var values = [];
+   for (var i=0; i<arguments.length; i++) {
+      var property = this.graph.curieParser.parse(arguments[i],true)
+      var pnode = this.predicates[property];
+      if (pnode) {
+         for (var j=0; j<pnode.objects.length; j++) {
+            values.push(pnode.objects[j].value);
+         }
+      }
+   }
+   return values;
+}
+
+function RDFaPredicate(predicate) {
+   this.id = predicate;
+   this.predicate = predicate;
+   this.objects = [];
+}
+
+RDFaPredicate.getPrefixMap = function(e) {
+   var prefixMap = {};
+   while (e.attributes) {
+      for (var i=0; i<e.attributes.length; i++) {
+         if (e.attributes[i].namespaceURI=="http://www.w3.org/2000/xmlns/") {
+            var prefix = e.attributes[i].localName;
+            if (e.attributes[i].localName=="xmlns") {
+               prefix = "";
+            }
+            if (!(prefix in prefixMap)) {
+               prefixMap[prefix] = e.attributes[i].nodeValue;
+            }
+         }
+      }
+      e = e.parentNode;
+   }
+   return prefixMap;
+}
+
+RDFaPredicate.prototype.toString = function(options) {
+   var s = null;
+   if (options && options.shorten && options.graph) {
+      s = options.graph.shorten(this.predicate,options.prefixesUsed);
+      if (!s) {
+         s = "<" + this.predicate + ">"
+      }
+   } else {
+      s = "<" + this.predicate + ">"
+   }
+   s += " ";
+   for (var i=0; i<this.objects.length; i++) {
+      if (i>0) {
+         s += ", ";
+      }
+      // TODO: handle HTML literal
+      if (this.objects[i].type=="http://www.w3.org/1999/02/22-rdf-syntax-ns#object") {
+         if (this.objects[i].value.substring(0,2)=="_:") {
+            if (options && options.filterBlankNode) {
+               s += options.filterBlankNode(this.objects[i].value);
+            } else {
+               s += this.objects[i].value;
+            }
+         } else if (options && options.shorten && options.graph) {
+            u = options.graph.shorten(this.objects[i].value,options.prefixesUsed);
+            if (u) {
+               s += u;
+            } else {
+               s += "<" + this.objects[i].value + ">";
+            }
+         } else {
+            s += "<" + this.objects[i].value + ">";
+         }
+      } else if (this.objects[i].type=="http://www.w3.org/2001/XMLSchema#integer" ||
+                 this.objects[i].type=="http://www.w3.org/2001/XMLSchema#decimal" ||
+                 this.objects[i].type=="http://www.w3.org/2001/XMLSchema#double" ||
+                 this.objects[i].type=="http://www.w3.org/2001/XMLSchema#boolean") {
+         s += this.objects[i].value;
+      } else if (this.objects[i].type=="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") {
+         var serializer = new XMLSerializer();
+         var value = "";
+         for (var x=0; x<this.objects[i].value.length; x++) {
+            if (this.objects[i].value[x].nodeType==Node.ELEMENT_NODE) {
+               var prefixMap = RDFaPredicate.getPrefixMap(this.objects[i].value[x]);
+               var prefixes = [];
+               for (var prefix in prefixMap) {
+                  prefixes.push(prefix);
+               }
+               prefixes.sort();
+               var e = this.objects[i].value[x].cloneNode(true);
+               for (var p=0; p<prefixes.length; p++) {
+                  e.setAttributeNS("http://www.w3.org/2000/xmlns/",prefixes[p].length==0 ? "xmlns" : "xmlns:"+prefixes[p],prefixMap[prefixes[p]]);
+               }
+               value += serializer.serializeToString(e);
+            } else if (this.objects[i].value[x].nodeType==Node.TEXT_NODE) {
+               value += this.objects[i].value[x].nodeValue;
+            }
+         }
+         s += '"""'+value.replace(/"""/,"\\\"\\\"\\\"")+'"""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>';
+      } else {
+         var l = this.objects[i].value;
+         if (l.indexOf("\n")>=0 || l.indexOf("\r")>=0) {
+            s += '"""' + l.replace(/"""/,"\\\"\\\"\\\"") + '"""';
+         } else {
+            s += '"' + l.replace(/"/,"\\\"") + '"';
+         }
+         if (this.objects[i].type!="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral") {
+             s += "^^<"+this.objects[i].type+">";
+         } else if (this.objects[i].language) {
+             s += "@"+this.objects[i].language;
+         }
+      }
+   }
+   return s;
+}
+GraphRDFaProcessor.prototype = new RDFaProcessor();
+GraphRDFaProcessor.prototype.constructor=RDFaProcessor;
+function GraphRDFaProcessor(target) {
+   RDFaProcessor.call(this,target);
+}
+
+GraphRDFaProcessor.prototype.getObjectSize = function(obj) {
+   var size = 0;
+   for (var key in obj) {
+      if (obj.hasOwnProperty(key)) {
+         size++;
+      }
+   }
+   return size;
+};
+
+
+GraphRDFaProcessor.prototype.init = function() {
+   var thisObj = this;
+   this.finishedHandlers.push(function(node) {
+      for (var subject in thisObj.target.graph.subjects) {
+         var snode = thisObj.target.graph.subjects[subject];
+         if (thisObj.getObjectSize(snode.predicates)==0) {
+            delete thisObj.target.graph.subjects[subject];
+         }
+      }
+   });
+}
+GraphRDFaProcessor.prototype.newBlankNode = function() {
+   return this.target.graph.newBlankNode();
+}
+
+GraphRDFaProcessor.prototype.newSubjectOrigin = function(origin,subject) {
+   var snode = this.newSubject(null,subject);
+   for (var i=0; i<snode.origins.length; i++) {
+      if (snode.origins[i]===origin) {
+         return;
+      }
+   }
+   snode.origins.push(origin);
+   if (!origin.data) {
+      Object.defineProperty(origin,"data", {
+            value: snode,
+            writable: false,
+            configurable: true,
+            enumerable: true
+         });
+   }
+}
+
+GraphRDFaProcessor.prototype.newSubject = function(origin,subject) {
+   var snode = this.target.graph.subjects[subject];
+   if (!snode) {
+      snode = new RDFaSubject(this.target.graph,subject);
+      this.target.graph.subjects[subject] = snode;
+   }
+   return snode;
+}
+
+
+GraphRDFaProcessor.prototype.addTriple = function(origin,subject,predicate,object) {
+   var snode = this.newSubject(origin,subject);
+   var pnode = snode.predicates[predicate];
+   if (!pnode) {
+      pnode = new RDFaPredicate(predicate);
+      snode.predicates[predicate] = pnode;
+   }
+
+   for (var i=0; i<pnode.objects.length; i++) {
+      if (pnode.objects[i].type==object.type && pnode.objects[i].value==object.value) {
+         if (pnode.objects[i].origin!==origin) {
+            if (!Array.isArray(pnode.objects[i].origin)) {
+               var origins = [];
+               origins.push(pnode.objects[i].origin);
+               pnode.objects[i].origin = origins;
+            }
+            pnode.objects[i].origin.push(origin);
+         }
+         return;
+      }
+   }
+   pnode.objects.push(object);   
+   object.origin = origin;
+   if (predicate==RDFaProcessor.typeURI) {
+      snode.types.push(object.value);
+   }
+}
+
+GraphRDFaProcessor.rdfaCopyPredicate = "http://www.w3.org/ns/rdfa#copy";
+GraphRDFaProcessor.rdfaPatternType = "http://www.w3.org/ns/rdfa#Pattern";
+
+GraphRDFaProcessor.prototype.copyProperties = function() {
+   var copySubjects = [];
+   var patternSubjects = {};
+   for (var subject in this.target.graph.subjects) {
+      var snode = this.target.graph.subjects[subject];
+      var pnode = snode.predicates[GraphRDFaProcessor.rdfaCopyPredicate];
+      if (!pnode) {
+         continue;
+      }
+      copySubjects.push(subject);
+      for (var i=0; i<pnode.objects.length; i++) {
+         if (pnode.objects[i].type!=RDFaProcessor.objectURI) {
+            continue;
+         }
+         var target = pnode.objects[i].value;
+         var patternSubjectNode = this.target.graph.subjects[target];
+         if (!patternSubjectNode) {
+            continue;
+         }
+         var patternTypes = patternSubjectNode.predicates[RDFaProcessor.typeURI];
+         if (!patternTypes) {
+            continue;
+         }
+         var isPattern = false;
+         for (var j=0; j<patternTypes.objects.length && !isPattern; j++) {
+            if (patternTypes.objects[j].value==GraphRDFaProcessor.rdfaPatternType && 
+                patternTypes.objects[j].type==RDFaProcessor.objectURI) {
+               isPattern = true;
+            }
+         }
+         if (!isPattern) {
+            continue;
+         }
+         patternSubjects[target] = true;
+         for (var predicate in patternSubjectNode.predicates) {
+            var targetPNode = patternSubjectNode.predicates[predicate];
+            if (predicate==RDFaProcessor.typeURI) {
+               if (targetPNode.objects.length==1) {
+                  continue;
+               }
+               for (var j=0; j<targetPNode.objects.length; j++) {
+                  if (targetPNode.objects[j].value!=GraphRDFaProcessor.rdfaPatternType) {
+                      var subjectPNode = snode.predicates[predicate];
+                      if (!subjectPNode) {
+                         subjectPNode = new RDFaPredicate(predicate);
+                         snode.predicates[predicate] = subjectPNode;
+                      }
+                      subjectPNode.objects.push(
+                         { type: targetPNode.objects[j].type, 
+                           value: targetPNode.objects[j].value, 
+                           language: targetPNode.objects[j].language, 
+                           origin: targetPNode.objects[j].origin}
+                      );
+                      snode.types.push(targetPNode.objects[j].value);
+                  }
+               }
+            } else {
+               var subjectPNode = snode.predicates[predicate];
+               if (!subjectPNode) {
+                  subjectPNode = new RDFaPredicate(predicate);
+                  snode.predicates[predicate] = subjectPNode;
+               }
+               for (var j=0; j<targetPNode.objects.length; j++) {
+                   subjectPNode.objects.push(
+                      { type: targetPNode.objects[j].type, 
+                        value: targetPNode.objects[j].value, 
+                        language: targetPNode.objects[j].language, 
+                        origin: targetPNode.objects[j].origin}
+                   );
+               }
+            }
+         }
+      }
+   }
+   for (var i=0; i<copySubjects.length; i++) {
+      var snode = this.target.graph.subjects[copySubjects[i]];
+      delete snode.predicates[GraphRDFaProcessor.rdfaCopyPredicate];
+   }
+   for (var subject in patternSubjects) {
+      delete this.target.graph.subjects[subject];
+   }
+}
+
+function RDFaEnvironment(owner) {
+   this.query = function(query,template) {
+      if (!query) {
+         return owner.getProjections(template);
+      }
+      var projections = [];
+      for (var subject in owner._data_.graph.subjects) {
+         var snode = owner._data_.graph.subjects[subject];
+         for (var key in query) {
+            var predicate = owner._data_.graph.curieParser.parse(key,true);
+            var pnode = snode.predicates[predicate];
+            if (!pnode) {
+               snode = null;
+               break;
+            }
+            var value = owner._data_.graph.curieParser.parse(query[key],false);
+            var object = null;
+            for (var i=0; !object && i<pnode.objects.length; i++) {
+               if (pnode.objects[i].value==value) {
+                  object = pnode.objects[i];
+               }
+            }
+            if (!object) {
+               snode = null;
+               break;
+            }
+         }
+         if (snode) {
+            projections.push(DocumentData.toProjection(owner,snode,template));
+         }
+      }
+      return projections;
+   }
+}
+
+function Projection(owner,subject) {
+   this._data_ = { 
+      owner: owner,
+      subject: subject,
+      properties: {}
+   };
+}
+
+Projection.prototype.getProperties = function() {
+   var propertyNames = [];
+   for (var property in this._data_.properties) {
+      propertyNames.push(property);
+   }
+   return propertyNames;
+}
+
+Projection.prototype.getSubject = function() {
+   return this._data_.subject;
+}
+
+Projection.prototype.get = function(uriOrCurie) {
+   var property = this._data_.owner._data_.graph.curieParser.parse(uriOrCurie,true);
+   var objects = this._data_.properties[property];
+   return objects ? objects[0] : null;
+}
+
+Projection.prototype.getAll = function(uriOrCurie) {
+   var property = this._data_.owner._data_.graph.curieParser.parse(uriOrCurie,true);
+   return this._data_.properties[property];
+}
+
+DocumentData.prototype = new URIResolver();
+DocumentData.prototype.constructor = DocumentData;
+function DocumentData (uri) {
+   this._data_ = { 
+      graph: new RDFaGraph()
+   };
+   this._data_.graph.baseURI = this.parseURI(uri)
+   this._data_.baseURI = this._data_.graph.baseURI;
+
+   var dataContext = this._data_;
+   Object.defineProperty(this,"rdfa", {
+      value: new RDFaEnvironment(this),
+      writable: false,
+      configurable: false,
+      enumerable: true
+   });
+   Object.defineProperty(this,"graph", {
+      value: this._data_.graph,
+      writable: false,
+      configurable: false,
+      enumerable: true
+   });
+   Object.defineProperty(this,"implementation", {
+      value: GreenTurtle.implementation,
+      writable: false,
+      configurable: false,
+      enumerable: true
+   });
+}
+
+DocumentData.nameChar = '[-A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u10000-\uEFFFF\.0-9\u00B7\u0300-\u036F\u203F-\u2040]';
+DocumentData.nameStartChar = '[\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u0131\u0134-\u013E\u0141-\u0148\u014A-\u017E\u0180-\u01C3\u01CD-\u01F0\u01F4-\u01F5\u01FA-\u0217\u0250-\u02A8\u02BB-\u02C1\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2-\u03F3\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E-\u0481\u0490-\u04C4\u04C7-\u04C8\u04CB-\u04CC\u04D0-\u04EB\u04EE-\u04F5\u04F8-\u04F9\u0531-\u0556\u0559\u0561-\u0586\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0641-\u064A\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D3\u06D5\u06E5-\u06E6\u0905-\u0939\u093D\u0958-\u0961\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F-\u0B
 10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0E01-\u0E2E\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EAE\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0F40-\u0F47\u0F49-\u0F69\u10A0-\u10C5\u10D0-\u10F6\u1100\u1102-\u1103\u1105-\u1107\u1109\u110B-\u110C\u110E-\u1112\u113C\u113E\u1140\u114C\u114E\u1150\u1154-\u1155\u1159\u115F-\u1161\u1163\u1165\u1167\u1169\u116D-\u116E\u1172-\u1173\u1175\u119E\u11A8\u11AB\u11AE-\u11AF\u11B7-\u11B8\u11BA\u11BC-\u11C2\u11EB\u11F0\u11F9\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1
 F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u212E\u2180-\u2182\u3041-\u3094\u30A1-\u30FA\u3105-\u312C\uAC00-\uD7A3\u4E00-\u9FA5\u3007\u3021-\u3029_]';
+DocumentData.NCNAME = new RegExp('^' + RDFaProcessor.nameStartChar + RDFaProcessor.nameChar + '*$');
+
+DocumentData.toProjection = function(owner,snode,template) {
+
+   var projection = new Projection(owner,snode.subject);
+   for (var predicate in snode.predicates) {
+      var pnode = snode.predicates[predicate];
+      var values = [];
+      projection._data_.properties[predicate] = values;
+      for (var i=0; i<pnode.objects.length; i++) {
+         values.push(pnode.objects[i].value);
+      }
+   }
+   if (template) {
+      for (var key in template) {
+         var predicate = template[key];
+         predicate = owner._data_.graph.curieParser.parse(predicate,true);
+         var values = projection._data_.properties[predicate];
+         if (values) {
+            // TODO: API issue: is this the first value or all values?
+            projection[key] = values.length==1 ? values[0] : values;
+         }
+      }
+   }
+   return projection;
+};
+
+
+DocumentData.prototype.getProperties = function(subject) {
+   
+   var properties = [];
+
+   if (subject) {
+      subject = this._data_.graph.curieParser.parse(subject,true);
+      snode = this._data_.graph.subjects[subject];
+      if (snode) {
+         for (var predicate in snode.predicates) {
+            properties.push(predicate);
+         }
+      }
+   } else {
+      var uniqueProperties = {};
+      for (var graphSubject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[graphSubject];
+         if (snode) {
+            for (var predicate in snode.predicates) {
+               if (!uniqueProperties[predicate]) {
+                  uniqueProperties[predicate] = true;
+                  properties.push(predicate);
+               }
+            }
+         }
+      }
+   }
+   return properties;
+};
+
+DocumentData.prototype.getSubjects = function(property,value) {
+   var subjects = [];
+   if (property) {
+      property = this._data_.graph.curieParser.parse(property,true);
+   }
+   if (property && value) {
+      var expanded = this._data_.graph.curieParser.parse(value,true);
+      for (var subject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[subject];
+         var pnode = snode.predicates[property];
+         if (pnode) {
+            for (var i=0; i<pnode.objects.length; i++) {
+               if (pnode.objects[i].value==value || pnode.objects[i].value==expanded) {
+                  subjects.push(subject);
+                  break;
+               }
+            }
+         }
+      }
+   } else if (property) {
+      for (var subject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[subject];
+         var pnode = snode.predicates[property];
+         if (pnode) {
+            subjects.push(subject);
+         }
+      }
+   } else if (value) {
+      var expanded = this._data_.graph.curieParser.parse(value,true);
+      for (var subject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[subject];
+         for (var predicate in snode.predicates) {
+            var pnode = subject.predicates[predicate];
+            if (pnode) {
+               var object = null;
+               for (var i=0; !object && i<pnode.objects.length; i++) {
+                  if (pnode.objects[i].value==value || node.objects[i].value==expanded) {
+                     object = pnode.objects[i];
+                  }
+               }
+               if (object) {
+                  subjects.push(subject);
+                  break;
+               }
+            }
+         }
+      }
+   } else {
+      for (var subject in this._data_.graph.subjects) {
+         subjects.push(subject);
+      }
+   }
+   return subjects;
+};
+
+// TODO: is there a way to merge this with getValueOrigin ?  The code is almost the same
+DocumentData.prototype.getValueOrigins = function(subject,property) {
+   var values = [];
+   var convert = function(pnode) {
+      if (pnode) {
+         for (var i=0; i<pnode.objects.length; i++) {
+            if (Array.isArray(pnode.objects[i].origin)) {
+               for (var j=0; j<pnode.objects[i].origin.length; j++) {
+                  values.push({ origin: pnode.objects[i].origin[j], value: pnode.objects[i].value });
+               }
+            } else {
+               values.push({ origin: pnode.objects[i].origin, value: pnode.objects[i].value });
+            }
+         }
+      }
+   }
+   if (property) {
+      property = this._data_.graph.curieParser.parse(property,true);
+   }
+   if (subject) {
+      subject = this._data_.graph.curieParser.parse(subject,true);
+      var snode = this._data_.graph.subjects[subject];
+      if (snode) {
+         if (property) {
+            convert(snode.predicates[property]);
+         } else {
+            for (var predicate in snode.predicates) {
+               convert(snode.predicates[predicate]);
+            }
+         }
+      }
+   } else if (property) {
+      for (var graphSubject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[graphSubject];
+         convert(snode.predicates[property]);
+      }
+   } else {
+      for (var graphSubject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[graphSubject];
+         for (var predicate in snode.predicates) {
+            convert(snode.predicates[predicate]);
+         }
+      }
+   }
+   return values;
+}
+DocumentData.prototype.getValues = function(subject,property) {
+   var values = [];
+   if (property) {
+      property = this._data_.graph.curieParser.parse(property,true);
+   }
+   if (subject) {
+      subject = this._data_.graph.curieParser.parse(subject,true);
+      var snode = this._data_.graph.subjects[subject];
+      if (snode) {
+         if (property) {
+            var pnode = snode.predicates[property];
+            if (pnode) {
+               for (var i=0; i<pnode.objects.length; i++) {
+                  values.push(pnode.objects[i].value);
+               }
+            }
+         } else {
+            for (var predicate in snode.predicates) {
+               var pnode = snode.predicates[predicate];
+               for (var i=0; i<pnode.objects.length; i++) {
+                  values.push(pnode.objects[i].value);
+               }
+            }
+         }
+      }
+   } else if (property) {
+      for (var graphSubject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[graphSubject];
+         var pnode = snode.predicates[property];
+         if (pnode) {
+            for (var i=0; i<pnode.objects.length; i++) {
+               values.push(pnode.objects[i].value);
+            }
+         }
+      }
+   } else {
+      for (var graphSubject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[graphSubject];
+         for (var predicate in snode.predicates) {
+            var pnode = snode.predicates[predicate];
+            for (var i=0; i<pnode.objects.length; i++) {
+               values.push(pnode.objects[i].value);
+            }
+         }
+      }
+   }
+   return values;
+};
+
+Object.defineProperty(DocumentData.prototype,"prefixes",{
+   enumerable: true,
+   get: function() {
+      return Object.keys(this._data_.graph.prefixes);
+   }
+});
+
+DocumentData.prototype.setMapping = function(prefix,uri) {
+   this._data_.graph.prefixes[prefix] = uri;
+};
+
+DocumentData.prototype.getMapping = function(prefix) {
+   return this._data_.graph.prefixes[prefix];
+};
+
+DocumentData.prototype.expand = function(curie) {
+   return this._data_.graph.expand(curie);  
+}
+
+DocumentData.prototype.shorten = function(uri) {
+   return this._data_.graph.shorten(uri);
+}
+
+DocumentData.prototype.getSubject = function(subject) {
+   if (!subject) { return null; }
+
+   subject = this._data_.graph.curieParser.parse(subject,true);
+ 
+   var snode = this._data_.graph.subjects[subject];
+   return snode ? snode : null;
+}
+
+DocumentData.prototype.getProjection = function(subject, template) {
+   if (!subject) { return null }
+
+   subject = this._data_.graph.curieParser.parse(subject,true);
+   
+   var snode = this._data_.graph.subjects[subject];
+   if (!snode) {
+      return null;
+   }
+
+   return DocumentData.toProjection(this,snode,template);
+}
+
+DocumentData.prototype.getProjections = function(property, value, template) {
+   if (property) {
+      property = this._data_.graph.curieParser.parse(property,true);
+   }
+   var projections = [];
+   if (typeof value == "undefined" && typeof template == "undefined") {
+      template = property;
+   }
+   if (property && value) {
+      var expanded = this._data_.graph.curieParser.parse(value,true);
+      for (var subject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[subject];
+         var pnode = snode.predicates[property];
+         if (pnode) {
+            for (var i=0; i<pnode.objects.length; i++) {
+               if (pnode.objects[i].value==value || pnode.objects[i].value==expanded) {
+                  projections.push(DocumentData.toProjection(this,snode,template));
+                  break;
+               }
+            }
+         }
+      }
+   } else if (property) {
+      for (var subject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[subject];
+         if (snode.predicates[property]) {
+            projections.push(DocumentData.toProjection(this,snode,template));
+         }
+      }
+   } else {
+      for (var subject in this._data_.graph.subjects) {
+         var snode = this._data_.graph.subjects[subject];
+         projections.push(DocumentData.toProjection(this,snode,template));
+      }
+   }
+   return projections;
+};
+
+DocumentData.prototype.merge = function(graph,options) {
+   var mergeBlank = options && options.mergeBlankNodes ? true : false;
+   var max = 0;
+   if (!mergeBlank) {
+      for (var subject in this._data_.graph.subjects) {
+         var match = /_:([0-9]+)/.exec(subject);
+         if (match) {
+            var n = parseInt(match[1]);
+            if (n>max) {
+               max = n;
+            }
+         }
+      }
+   }
+   if (graph) {
+      var blankMap = {};
+      var subjectMap = mergeBlank ? 
+         function(u) { return u; } :
+         function(u) { 
+            var mapSubject = blankMap[u];
+            if (!mapSubject && /_:([0-9]+)/.test(u)) {
+               max++;
+               mapSubject = "_:"+max;
+               blankMap[u] = mapSubject;
+            }
+            return mapSubject ? mapSubject : u;
+         };
+      for (var subject in graph) {
+         var mapSubject = subjectMap(subject);
+         var snode = graph[subject];
+         subject = mapSubject ? mapSubject : subject;
+         var target = this._data_.graph.subjects[subject];
+         if (target) {
+            for (var predicate in snode.predicates) {
+               var pnode = snode.predicates[predicate];
+               var targetPredicate = target.predicates[predicate];
+               if (targetPredicate) {
+                  for (var i=0; i<pnode.objects.length; i++) {
+                     var object = pnode.objects[i];
+                     var toAdd = [];
+                     for (var j=0; j<targetPredicate.objects.length; j++) {
+                        if (object.type==RDFaProcessor.XMLLiteralURI && (targetPredicate.objects[j].type!=object.type || targetPredicate.objects[j].value!==object.value)) {
+                           toAdd.push(object);
+                        } else if (targetPredicate.objects[j].type!=object.type || targetPredicate.objects[j].value==object.value) {
+                           toAdd.push(object);
+                        }
+                     }
+                     // map object subjects
+                     for (var j=0; j<toAdd.length; j++) {
+                        if (toAdd[j].type==RDFaProcessor.objectURI) {
+                           toAdd[j].value = subjectMap(toAdd[j].value);
+                        }
+                        targetPredicate.objects.push(toAdd[j]);
+                     }
+                  }
+               } else {
+                  target.predicates[predicate] = pnode;
+                  // map object subjects
+                  for (var i=0; i<pnode.objects.length; i++) {
+                     if (pnode.objects[i].type==RDFaProcessor.objectURI) {
+                        pnode.objects[i].value = subjectMap(pnode.objects[i].value);
+                     }
+                  }
+               }
+            }
+         } else {
+            this._data_.graph.subjects[subject] = snode;
+            snode.subject = subject;
+            // map object subjects
+            for (var predicate in snode.predicates) {
+               var pnode = snode.predicates[predicate];
+               for (var i=0; i<pnode.objects.length; i++) {
+                  if (pnode.objects[i].type==RDFaProcessor.objectURI) {
+                     pnode.objects[i].value = subjectMap(pnode.objects[i].value);
+                  }
+               }
+            }
+         }
+      }
+   }
+   if (options && options.prefixes) {
+      for (var prefix in options.prefixes) {
+         if (!this._data_.graph.prefixes[prefix]) {
+            this._data_.graph.prefixes[prefix] = options.prefixes[prefix];
+         }
+      }
+   }
+}
+
+Element.prototype.getElementsByType = function() {
+   var typeList = [];
+   for (var i=0; i<arguments.length; i++) {
+      typeList.push(this.ownerDo

<TRUNCATED>

[35/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/style.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/style.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/style.rng
new file mode 100755
index 0000000..484722d
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/style.rng
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Style Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="style">
+  <element name="style">
+    <ref name="style.attlist"/>
+    <text/>
+  </element>
+</define>
+
+<define name="style.attlist">
+  <ref name="title.attrib"/>
+  <ref name="I18n.attrib"/>
+  <attribute name="type">
+    <ref name="ContentType.datatype"/>
+  </attribute>
+  <optional>
+    <attribute name="media">
+      <ref name="MediaDesc.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="xml:space">
+      <value>preserve</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="head.content" combine="interleave">
+  <zeroOrMore>
+    <ref name="style"/>
+  </zeroOrMore>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/table.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/table.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/table.rng
new file mode 100755
index 0000000..7e10e4e
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/table.rng
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Tables Module -->
+<!-- This builds on the basic tables module, unlike with the DTD
+implementation. -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<include href="basic-table.rng">
+
+  <define name="table">
+    <element name="table">
+      <ref name="table.attlist"/>
+      <optional>
+	<ref name="caption"/>
+      </optional>
+      <choice>
+	<zeroOrMore>
+	  <ref name="col"/>
+	</zeroOrMore>
+	<zeroOrMore>
+	  <ref name="colgroup"/>
+	</zeroOrMore>
+      </choice>
+      <choice>
+	<group>
+	  <optional>
+	    <ref name="thead"/>
+	  </optional>
+	  <optional>
+	    <ref name="tfoot"/>
+	  </optional>
+	  <oneOrMore>
+	    <ref name="tbody"/>
+	  </oneOrMore>
+	</group>
+	<oneOrMore>
+	  <ref name="tr"/>
+	</oneOrMore>
+      </choice>
+    </element>
+  </define>
+
+  <define name="th">
+    <element name="th">
+      <ref name="th.attlist"/>
+      <ref name="Flow.model"/>
+    </element>
+  </define>
+
+  <define name="td">
+    <element name="td">
+      <ref name="td.attlist"/>
+      <ref name="Flow.model"/>
+    </element>
+  </define>
+
+  <define name="CellHAlign.attrib">
+    <optional>
+      <attribute name="align">
+	<choice>
+	  <value>left</value>
+	  <value>center</value>
+	  <value>right</value>
+	  <value>justify</value>
+	  <value>char</value>
+	</choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="char">
+	<ref name="Character.datatype"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="charoff">
+	<ref name="Length.datatype"/>
+      </attribute>
+    </optional>
+  </define>
+
+  <define name="CellVAlign.attrib">
+    <optional>
+      <attribute name="valign">
+	<choice>
+	  <value>top</value>
+	  <value>middle</value>
+	  <value>bottom</value>
+	  <value>baseline</value>
+	</choice>
+      </attribute>
+    </optional>
+  </define>
+
+  <define name="scope.attrib">
+    <optional>
+      <attribute name="scope">
+	<choice>
+	  <value>row</value>
+	  <value>col</value>
+	  <value>rowgroup</value>
+	  <value>colgroup</value>
+	</choice>
+      </attribute>
+    </optional>
+  </define>
+
+</include>
+
+<define name="table.attlist" combine="interleave">
+  <optional>
+    <attribute name="width">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="border">
+      <ref name="Pixels.datatype"/>
+    </attribute>
+  </optional>
+  <ref name="frame.attrib"/>
+  <ref name="rules.attrib"/>
+  <optional>
+    <attribute name="cellspacing">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="cellpadding">
+      <ref name="Length.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="col">
+  <element name="col">
+    <ref name="col.attlist"/>
+  </element>
+</define>
+
+<define name="col.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="span">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="MultiLength.datatype"/>
+    </attribute>
+  </optional>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="colgroup">
+  <element name="colgroup">
+    <ref name="colgroup.attlist"/>
+    <zeroOrMore>
+      <ref name="col"/>
+    </zeroOrMore>
+  </element>
+</define>
+
+<define name="colgroup.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="span">
+      <ref name="Number.datatype"/>
+    </attribute>
+  </optional>
+  <optional>
+    <attribute name="width">
+      <ref name="MultiLength.datatype"/>
+    </attribute>
+  </optional>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="tbody">
+  <element name="tbody">
+    <ref name="tbody.attlist"/>
+    <oneOrMore>
+      <ref name="tr"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="tbody.attlist">
+  <ref name="Common.attrib"/>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="thead">
+  <element name="thead">
+    <ref name="thead.attlist"/>
+    <oneOrMore>
+      <ref name="tr"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="thead.attlist">
+  <ref name="Common.attrib"/>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="tfoot">
+  <element name="tfoot">
+    <ref name="tfoot.attlist"/>
+    <oneOrMore>
+      <ref name="tr"/>
+    </oneOrMore>
+  </element>
+</define>
+
+<define name="tfoot.attlist">
+  <ref name="Common.attrib"/>
+  <ref name="CellHAlign.attrib"/>
+  <ref name="CellVAlign.attrib"/>
+</define>
+
+<define name="frame.attrib">
+  <optional>
+    <attribute name="frame">
+      <choice>
+        <value>void</value>
+        <value>above</value>
+        <value>below</value>
+        <value>hsides</value>
+        <value>lhs</value>
+        <value>rhs</value>
+        <value>vsides</value>
+        <value>box</value>
+        <value>border</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+<define name="rules.attrib">
+  <optional>
+    <attribute name="rules">
+      <choice>
+        <value>none</value>
+        <value>groups</value>
+        <value>rows</value>
+        <value>cols</value>
+        <value>all</value>
+      </choice>
+    </attribute>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/target.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/target.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/target.rng
new file mode 100755
index 0000000..b13f4ca
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/target.rng
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Target Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="a.attlist" combine="interleave">
+  <ref name="target.attrib"/>
+</define>
+
+<define name="area.attlist" combine="interleave">
+  <ref name="target.attrib"/>
+</define>
+
+<define name="base.attlist" combine="interleave">
+  <ref name="target.attrib"/>
+</define>
+
+<define name="link.attrib" combine="interleave">
+  <ref name="target.attrib"/>
+</define>
+
+<define name="form.attlist" combine="interleave">
+  <ref name="target.attrib"/>
+</define>
+
+<define name="target.attrib">
+  <optional>
+    <attribute name="target"/>
+  </optional>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/text.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/text.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/text.rng
new file mode 100755
index 0000000..c380a7c
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/modules/text.rng
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Text Module -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+<define name="br">
+  <element name="br">
+    <ref name="br.attlist"/>
+    <empty/>
+  </element>
+</define>
+
+<define name="br.attlist">
+  <ref name="Core.attrib"/>
+</define>
+
+<define name="span">
+  <element name="span">
+    <ref name="span.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="span.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="abbr">
+  <element name="abbr">
+    <ref name="abbr.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="abbr.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="acronym">
+  <element name="acronym">
+    <ref name="acronym.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="acronym.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="cite">
+  <element name="cite">
+    <ref name="cite.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="cite.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="code">
+  <element name="code">
+    <ref name="code.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="code.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="dfn">
+  <element name="dfn">
+    <ref name="dfn.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="dfn.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="em">
+  <element name="em">
+    <ref name="em.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="em.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="kbd">
+  <element name="kbd">
+    <ref name="kbd.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="kbd.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="q">
+  <element name="q">
+    <ref name="q.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="q.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="cite">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="samp">
+  <element name="samp">
+    <ref name="samp.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="samp.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="strong">
+  <element name="strong">
+    <ref name="strong.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="strong.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="var">
+  <element name="var">
+    <ref name="var.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="var.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="div">
+  <element name="div">
+    <ref name="div.attlist"/>
+    <ref name="Flow.model"/>
+  </element>
+</define>
+
+<define name="div.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="p">
+  <element name="p">
+    <ref name="p.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="p.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="address">
+  <element name="address">
+    <ref name="address.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="address.attlist">
+  <ref name="Common.attrib"/>
+</define>
+
+<define name="blockquote">
+  <element name="blockquote">
+    <ref name="blockquote.attlist"/>
+    <ref name="Block.model"/>
+  </element>
+</define>
+
+<define name="blockquote.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="cite">
+      <ref name="URI.datatype"/>
+    </attribute>
+  </optional>
+</define>
+
+<define name="pre">
+  <element name="pre">
+    <ref name="pre.attlist"/>
+    <ref name="Inline.model"/>
+  </element>
+</define>
+
+<define name="pre.attlist">
+  <ref name="Common.attrib"/>
+  <optional>
+    <attribute name="xml:space">
+      <value>preserve</value>
+    </attribute>
+  </optional>
+</define>
+
+<define name="h1">
+  <element name="h1">
+    <ref name="Heading.attrib"/>
+    <ref name="Heading.content"/>
+  </element>
+</define>
+ 
+<define name="h2">
+  <element name="h2">
+    <ref name="Heading.attrib"/>
+    <ref name="Heading.content"/>
+  </element>
+</define>
+ 
+<define name="h3">
+  <element name="h3">
+    <ref name="Heading.attrib"/>
+    <ref name="Heading.content"/>
+  </element>
+</define>
+ 
+<define name="h4">
+  <element name="h4">
+    <ref name="Heading.attrib"/>
+    <ref name="Heading.content"/>
+  </element>
+</define>
+ 
+<define name="h5">
+  <element name="h5">
+    <ref name="Heading.attrib"/>
+    <ref name="Heading.content"/>
+  </element>
+</define>
+
+<define name="h6">
+  <element name="h6">
+    <ref name="Heading.attrib"/>
+    <ref name="Heading.content"/>
+  </element>
+</define>
+
+<define name="Heading.attrib">
+  <ref name="Common.attrib"/>
+</define>
+ 
+<define name="Heading.content">
+  <ref name="Inline.model"/>
+</define>
+
+<define name="Heading.class">
+  <choice>
+    <ref name="h1"/>
+    <ref name="h2"/>
+    <ref name="h3"/>
+    <ref name="h4"/>
+    <ref name="h5"/>
+    <ref name="h6"/>
+  </choice>
+</define>
+
+<define name="Block.class">
+  <choice>
+    <ref name="address"/>
+    <ref name="blockquote"/>
+    <ref name="div"/>
+    <ref name="p"/>
+    <ref name="pre"/>
+    <ref name="Heading.class"/>
+  </choice>
+</define>
+
+<define name="Inline.class">
+  <choice>
+    <ref name="abbr"/>
+    <ref name="acronym"/>
+    <ref name="br"/>
+    <ref name="cite"/>
+    <ref name="code"/>
+    <ref name="dfn"/>
+    <ref name="em"/>
+    <ref name="kbd"/>
+    <ref name="q"/>
+    <ref name="samp"/>
+    <ref name="span"/>
+    <ref name="strong"/>
+    <ref name="var"/>
+  </choice>
+</define>
+
+<define name="Inline.model">
+  <zeroOrMore>
+    <choice>
+      <text/>
+      <ref name="Inline.class"/>
+    </choice>
+  </zeroOrMore>
+</define>
+
+<!-- This is redefined by the legacy module to include inlines. -->
+<define name="Block.mix">
+  <ref name="Block.class"/>
+</define>
+
+<define name="Block.model">
+  <oneOrMore>
+    <ref name="Block.mix"/>
+  </oneOrMore>
+</define>
+
+<define name="Flow.model">
+  <zeroOrMore>
+    <choice>
+      <text/>
+      <ref name="Inline.class"/>
+      <ref name="Block.class"/>
+    </choice>
+  </zeroOrMore>
+</define>
+
+</grammar>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-basic.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-basic.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-basic.rng
new file mode 100755
index 0000000..8976916
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-basic.rng
@@ -0,0 +1,21 @@
+<!-- XHTML Basic -->
+
+<grammar ns="http://www.w3.org/1999/xhtml"
+         xmlns="http://relaxng.org/ns/structure/1.0">
+
+<include href="modules/datatypes.rng"/>
+<include href="modules/attribs.rng"/>
+<include href="modules/struct.rng"/>
+<include href="modules/text.rng"/>
+<include href="modules/hypertext.rng"/>
+<include href="modules/list.rng"/>
+<include href="modules/basic-form.rng"/>
+<include href="modules/basic-table.rng"/>
+<include href="modules/image.rng"/>
+<include href="modules/param.rng"/>
+<include href="modules/object.rng"/>
+<include href="modules/meta.rng"/>
+<include href="modules/link.rng"/>
+<include href="modules/base.rng"/>
+
+</grammar>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-strict.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-strict.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-strict.rng
new file mode 100755
index 0000000..545d668
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml-strict.rng
@@ -0,0 +1,36 @@
+<!-- XHTML Strict -->
+
+<grammar ns="http://www.w3.org/1999/xhtml"
+         xmlns="http://relaxng.org/ns/structure/1.0">
+
+<include href="modules/datatypes.rng"/>
+<include href="modules/attribs.rng"/>
+<include href="modules/struct.rng"/>
+<include href="modules/text.rng"/>
+<include href="modules/hypertext.rng"/>
+<include href="modules/list.rng"/>
+<include href="modules/image.rng"/>
+<include href="modules/ssismap.rng"/>
+<include href="modules/base.rng"/>
+<include href="modules/link.rng"/>
+<include href="modules/meta.rng"/>
+<include href="modules/param.rng"/>
+<include href="modules/object.rng"/>
+<include href="modules/bdo.rng"/>
+<include href="modules/pres.rng"/>
+<include href="modules/edit.rng"/>
+<include href="modules/applet.rng"/>
+<!-- <include href="modules/basic-form.rng"/> -->
+<include href="modules/form.rng"/>
+<include href="modules/style.rng"/>
+<include href="modules/script.rng"/>
+<!-- <include href="modules/basic-table.rng"/> -->
+<include href="modules/table.rng"/>
+<include href="modules/csismap.rng"/>
+<include href="modules/events.rng"/>
+<include href="modules/inlstyle.rng"/>
+<include href="modules/target.rng"/>
+<include href="modules/iframe.rng"/>
+<include href="modules/nameident.rng"/>
+
+</grammar>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml.rng
----------------------------------------------------------------------
diff --git a/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml.rng b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml.rng
new file mode 100755
index 0000000..9acf062
--- /dev/null
+++ b/platform/content/src/main/resources/org/apache/clerezza/platform/content/staticweb/discoscripts/mozile/lib/xhtml/xhtml.rng
@@ -0,0 +1,39 @@
+<!-- XHTML -->
+<!-- This corresponds to the union of transitional and frameset. -->
+
+<grammar ns="http://www.w3.org/1999/xhtml"
+         xmlns="http://relaxng.org/ns/structure/1.0">
+
+<include href="modules/datatypes.rng"/>
+<include href="modules/attribs.rng"/>
+<!-- <include href="modules/struct.rng"/> -->
+<include href="modules/frames.rng"/>
+<include href="modules/text.rng"/>
+<include href="modules/hypertext.rng"/>
+<include href="modules/list.rng"/>
+<include href="modules/image.rng"/>
+<include href="modules/ssismap.rng"/>
+<include href="modules/base.rng"/>
+<include href="modules/link.rng"/>
+<include href="modules/meta.rng"/>
+<include href="modules/param.rng"/>
+<include href="modules/object.rng"/>
+<include href="modules/bdo.rng"/>
+<include href="modules/pres.rng"/>
+<include href="modules/edit.rng"/>
+<include href="modules/applet.rng"/>
+<!-- <include href="modules/basic-form.rng"/> -->
+<include href="modules/form.rng"/>
+<include href="modules/style.rng"/>
+<include href="modules/script.rng"/>
+<!-- <include href="modules/basic-table.rng"/> -->
+<include href="modules/table.rng"/>
+<include href="modules/csismap.rng"/>
+<include href="modules/events.rng"/>
+<include href="modules/inlstyle.rng"/>
+<include href="modules/target.rng"/>
+<include href="modules/iframe.rng"/>
+<include href="modules/nameident.rng"/>
+<include href="modules/legacy.rng"/>
+
+</grammar>


[24/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/jquery.min.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/jquery.min.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/jquery.min.js
new file mode 100644
index 0000000..006e953
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/jquery.min.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery.min.map
+*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e)
 {if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:funct
 ion(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:fun
 ction(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;r
 eturn!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},node
 Name:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r
 &&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEv
 entListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(
 ){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r
 ={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--
 i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,check
 On:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bub
 bles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1
 %;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;
 if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[
 b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data
 -"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>a
 rguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend(
 {attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&
 (n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==
 o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length|
 |(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",col
 span:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specif
 ied?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e
 ){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.eve
 nts={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort
 (),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)
 "+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c
 =b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,han
 dlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documen
 tElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.r
 emoveEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagati
 on()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
+return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add
 (this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r
 ,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===
 arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F
 +")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){re
 turn t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m
 =V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'><
 /a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!=
 =A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").leng
 th||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l
 =[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expressi
 on: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{
 },relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttr
 ibute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]
 ={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+
 e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},bu
 tton:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W,"
  ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r))
 ,i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),
 o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[
 1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++
 )b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var 
 n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentD
 ocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){retur
 n b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></tab
 le>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b
 .isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n
 )));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;
 n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return thi
 s}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&
 &(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.supp
 ort.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i
 =o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
+}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+
 ")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.
 length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"
 ),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle
 },Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parse
 Float(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":"
 "},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var
  r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArra
 y(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn
 .load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({
 url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML}
 ,flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.d
 one,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader(
 "Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="er
 ror",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"
 !==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readySta
 te))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0
 ]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.n
 oop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat
 (Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.tim
 er(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overfl
 ow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this
 .prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scroll
 Top=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].ele
 m!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacit

<TRUNCATED>

[31/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/ontologies/LICENSE b/platform/curieprefixmanager/ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/curieprefixmanager/ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/ontologies/pom.xml b/platform/curieprefixmanager/ontologies/pom.xml
new file mode 100644
index 0000000..c479410
--- /dev/null
+++ b/platform/curieprefixmanager/ontologies/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.curieprefixmanager</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.curieprefixmanager.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - CURIE prefix manager Ontologies</name>
+    <description>
+        Skeleton Ontologies
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/ontologies/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/ontologies/curie.ttl
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/ontologies/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/ontologies/curie.ttl b/platform/curieprefixmanager/ontologies/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/ontologies/curie.ttl
new file mode 100644
index 0000000..5d8c314
--- /dev/null
+++ b/platform/curieprefixmanager/ontologies/src/main/resources/org/apache/clerezza/platform/curieprefixmanager/ontologies/curie.ttl
@@ -0,0 +1,40 @@
+# 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.
+
+@prefix : <http://clerezza.apache.org/platform/curieprefix#>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
+@prefix skos: <http://www.w3.org/2008/05/skos#>.
+@prefix owl: <http://www.w3.org/2002/07/owl#>.
+
+
+: a owl:Ontology.
+
+:CuriePrefixBinding a rdfs:Class;
+	skos:definition "A binding of a CURIE prefix to the string which has to be prepended to reference part of the CURIE to produce a IRI."@en.
+
+:prefix a rdf:Property;
+	skos:definition "The CURIE pefix, i.e. a NCName according to http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName."@en;
+	rdfs:Domain :CuriePrefixBinding.
+
+:binding a rdf:Property;
+	skos:definition "The value to which the pefix associated with the subject is bound to."@en;
+	rdfs:Domain :CuriePrefixBinding.
+
+:CuriePrefixBindingList a rdfs:Class;
+	skos:definition "A List of CURIE prefix bindings"@en;
+	rdfs:subClassOf rdf:List.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/curieprefixmanager/pom.xml
----------------------------------------------------------------------
diff --git a/platform/curieprefixmanager/pom.xml b/platform/curieprefixmanager/pom.xml
new file mode 100644
index 0000000..04ef3e3
--- /dev/null
+++ b/platform/curieprefixmanager/pom.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.curieprefixmanager</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - CURIE prefix manager</name>
+    <modules>
+        <module>ontologies</module>
+        <module>core</module>
+    </modules>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>platform.curieprefixmanager.ontologies</artifactId>
+                <version>0.2</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <!-- <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.archetype</groupId>
+                    <artifactId>archetype-packaging:maven-plugin</artifactId>
+                    <version>2.0-alpha-5</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build> -->
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard.webinterface/LICENSE
----------------------------------------------------------------------
diff --git a/platform/dashboard.webinterface/LICENSE b/platform/dashboard.webinterface/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/dashboard.webinterface/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard.webinterface/pom.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard.webinterface/pom.xml b/platform/dashboard.webinterface/pom.xml
new file mode 100644
index 0000000..66ff34d
--- /dev/null
+++ b/platform/dashboard.webinterface/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.dashboard.webinterface</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Dashboard Webinterface</name>
+    <description>Provides a dashboard</description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.extensions</artifactId>
+            <version>0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.dashboard.ontologies</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <version>0.3</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard.webinterface/src/main/java/org/apache/clerezza/platform/dashboard/webinterface/DashBoard.java
----------------------------------------------------------------------
diff --git a/platform/dashboard.webinterface/src/main/java/org/apache/clerezza/platform/dashboard/webinterface/DashBoard.java b/platform/dashboard.webinterface/src/main/java/org/apache/clerezza/platform/dashboard/webinterface/DashBoard.java
new file mode 100644
index 0000000..ccdb0ff
--- /dev/null
+++ b/platform/dashboard.webinterface/src/main/java/org/apache/clerezza/platform/dashboard/webinterface/DashBoard.java
@@ -0,0 +1,131 @@
+/*
+ * 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.dashboard.webinterface;
+
+import java.net.URL;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.clerezza.jaxrs.utils.RedirectUtil;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
+import org.apache.clerezza.platform.dashboard.ontologies.DASHBOARD;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Services;
+
+/**
+ *
+ * @author tio
+ */
+@Component
+@Services({
+    @Service(Object.class),
+    @Service(GlobalMenuItemsProvider.class)
+})
+
+@Property(name="javax.ws.rs", boolValue=true)
+@Path("/dashboard")
+public class DashBoard implements GlobalMenuItemsProvider{
+
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Reference
+    private TcManager tcMgr;
+    
+    @Reference
+    private RenderletManager renderletManager;
+
+    protected void activate(ComponentContext cCtx) throws Exception {
+        logger.debug("Activating DashBoard");    
+    
+        URL template = getClass().getResource("dashboard-template.ssp");
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(), 
+                new UriRef(template.toURI().toString()), DASHBOARD.DashBoard,
+                "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
+    }
+    
+    /**
+     * Redirects to the overview page
+     * 
+     * @return {@link Response}
+     * 
+     */
+    @GET
+    public Response redirectToHomePage(@Context UriInfo uriInfo) {
+        if (uriInfo.getAbsolutePath().toString().endsWith("/")) {
+            return RedirectUtil.createSeeOtherResponse("overview", uriInfo);
+        }
+        return RedirectUtil.createSeeOtherResponse(
+                "dashboard/overview", uriInfo);
+    }
+
+    /**
+     * Returns the overview page of the dashboard.
+     * 
+     * @return {@link GraphNode}
+     * 
+     */
+    @GET
+    @Path("overview")
+    public GraphNode getHomePage(@Context UriInfo uriInfo) {
+
+        TrailingSlash.enforceNotPresent(uriInfo);
+
+        MGraph mGraph = new SimpleMGraph(); 
+        NonLiteral overview = new BNode();
+        mGraph.add(new TripleImpl(overview, RDF.type, DASHBOARD.DashBoard));
+        mGraph.add(new TripleImpl(overview, RDF.type, PLATFORM.HeadedPage));
+        return new GraphNode(overview, mGraph);
+    }
+
+    @Override
+    public Set<GlobalMenuItem> getMenuItems() {
+        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
+        items.add(new GlobalMenuItem("/dashboard", "DHB", "Dashboard", 10000,
+                null));
+        return items;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard.webinterface/src/main/resources/org/apache/clerezza/platform/dashboard/webinterface/dashboard-template.ssp
----------------------------------------------------------------------
diff --git a/platform/dashboard.webinterface/src/main/resources/org/apache/clerezza/platform/dashboard/webinterface/dashboard-template.ssp b/platform/dashboard.webinterface/src/main/resources/org/apache/clerezza/platform/dashboard/webinterface/dashboard-template.ssp
new file mode 100644
index 0000000..26d15d3
--- /dev/null
+++ b/platform/dashboard.webinterface/src/main/resources/org/apache/clerezza/platform/dashboard/webinterface/dashboard-template.ssp
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+resultDocModifier.setTitle("Dashboard");
+resultDocModifier.addNodes2Elem("tx-module", <h1>Dashboard</h1>);
+
+resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Overview</a></li>);
+
+<div id="tx-content">
+
+	<div id="tx-list" class="tx-list">
+
+		
+	</div>
+</div>
+
+
+
+
+
+
+
+	

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/LICENSE
----------------------------------------------------------------------
diff --git a/platform/dashboard/LICENSE b/platform/dashboard/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/dashboard/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/LICENSE b/platform/dashboard/platform.dashboard.core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/pom.xml b/platform/dashboard/platform.dashboard.core/pom.xml
new file mode 100644
index 0000000..313dc24
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/pom.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.dashboard</artifactId>
+        <version>0.5</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.dashboard.core</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Dashboard Core</name>
+    <description>
+        Dashboard core
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.utils</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>0.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.dashboard.ontologies</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stanbol</groupId>
+            <artifactId>org.apache.stanbol.commons.security.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.users.core</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.usermanager</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <version>0.3</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.xsite</groupId>
+                <artifactId>xsite-maven-plugin</artifactId>
+                <configuration>
+                    <sourceDirectoryPath>${basedir}/src/site/xsite</sourceDirectoryPath>
+                    <sitemapPath>content/sitemap.xml</sitemapPath>
+                    <skinPath>templates/skin.html</skinPath>
+                    <outputDirectoryPath>${basedir}/target/site/documentation</outputDirectoryPath>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/ContextualMenuGenerator.java
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/ContextualMenuGenerator.java b/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/ContextualMenuGenerator.java
new file mode 100644
index 0000000..968692a
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/ContextualMenuGenerator.java
@@ -0,0 +1,207 @@
+/*
+ * 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.dashboard;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.clerezza.platform.typerendering.UserContextProvider;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.platform.dashboard.ontologies.*;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.Literal;
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.DCTERMS;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.ontologies.RDFS;
+import org.apache.clerezza.rdf.utils.RdfList;
+
+/**
+ * Attaches the global menu to the context node.
+ * 
+ * @author mir
+ */
+@Component(enabled=true, immediate=true)
+@Service(UserContextProvider.class)
+@Reference(name="globalMenuItemsProvider",
+        cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
+        policy=ReferencePolicy.DYNAMIC,
+        referenceInterface=GlobalMenuItemsProvider.class)
+        
+public class ContextualMenuGenerator implements UserContextProvider {
+
+    Set<GlobalMenuItemsProvider> globalMenuItemsProviders = 
+            new HashSet<GlobalMenuItemsProvider>();
+
+    private static class Menu implements Comparable<Menu> {
+        GlobalMenuItem root;
+        SortedSet<GlobalMenuItem> children = new TreeSet<GlobalMenuItem>();
+
+        private Menu(GlobalMenuItem root) {
+            this.root = root;
+        }
+
+        private Menu(String identifier) {
+            this.root = new GlobalMenuItem(null,identifier ,
+                    identifier.replace('_', ' '), 0, null);
+        }
+
+        @Override
+        public int compareTo(Menu o) {
+            return root.compareTo(o.root);
+        }
+    }
+
+    @Override
+    public GraphNode addUserContext(GraphNode node) {
+        node.addProperty(GLOBALMENU.globalMenu, 
+                asRdfList(createMenus(), node.getGraph()));
+        return node;
+    }
+
+    protected void bindGlobalMenuItemsProvider(GlobalMenuItemsProvider provider) {
+        globalMenuItemsProviders.add(provider);
+    }
+
+    protected void unbindGlobalMenuItemsProvider(GlobalMenuItemsProvider provider) {
+        globalMenuItemsProviders.remove(provider);
+    }
+
+    private SortedSet<Menu> createMenus() {
+        Set<GlobalMenuItem> allItems = new HashSet<GlobalMenuItem>();
+        for (GlobalMenuItemsProvider provider : globalMenuItemsProviders) {
+            Set<GlobalMenuItem> items = provider.getMenuItems();
+            for (GlobalMenuItem item: items) {
+                allItems.add(item);
+            }
+        }
+
+        SortedSet<Menu> menus = new TreeSet<Menu>();
+        Map<String, Menu> idMenuMap = new HashMap<String, Menu>();
+        Iterator<GlobalMenuItem> globalMenuItems = allItems.iterator();
+        while (globalMenuItems.hasNext()) {
+            GlobalMenuItem globalMenuItem = globalMenuItems.next();
+            if (globalMenuItem.getGroupIdentifier() == null) {
+                final Menu menu = new Menu(globalMenuItem);
+                idMenuMap.put(menu.root.getIdentifier(), menu);
+                menus.add(menu);
+                globalMenuItems.remove();
+            }
+        }
+        globalMenuItems = allItems.iterator();
+        while (globalMenuItems.hasNext()) {
+            GlobalMenuItem globalMenuItem = globalMenuItems.next();
+            Menu menu = idMenuMap.get(globalMenuItem.getGroupIdentifier());
+            if (menu != null) {
+                menu.children.add(globalMenuItem);
+                globalMenuItems.remove();
+            }
+        }
+        Set<String> implicitGroups = new HashSet<String>();
+        for (GlobalMenuItem globalMenuItem : allItems) {
+            final String groupIdentifier = globalMenuItem.getGroupIdentifier();
+            implicitGroups.add(groupIdentifier);
+        }
+        for (String implicitGroupId : implicitGroups) {
+            Menu menu = new Menu(implicitGroupId);
+            idMenuMap.put(menu.root.getIdentifier(), menu);
+            menus.add(menu);
+        }
+
+        for (GlobalMenuItem item : allItems) {
+            Menu menu = idMenuMap.get(item.getGroupIdentifier());
+            if (menu != null) {
+                menu.children.add(item);
+            }
+        }
+        return menus;
+    }
+    
+    private NonLiteral asRdfList(SortedSet<Menu> menus, TripleCollection mGraph) {
+        NonLiteral result = new BNode();
+        RdfList list = new RdfList(result, mGraph);
+        for (Menu menu : menus) {
+            BNode node = new BNode();
+            final String label = menu.root.getLabel();
+            Literal labelLiteral = new PlainLiteralImpl(label);
+            mGraph.add(new TripleImpl(node, RDFS.label,labelLiteral));
+            final String description = menu.root.getDescription();
+            if (description != null) {
+                Literal descLiteral = new PlainLiteralImpl(description);
+                mGraph.add(new TripleImpl(node, DCTERMS.description, descLiteral));
+            }
+            final String path = menu.root.getPath();
+            if (path != null) {
+                Literal pathLiteral = LiteralFactory.getInstance().
+                        createTypedLiteral(path);
+                mGraph.add(new TripleImpl(node, GLOBALMENU.path, pathLiteral));
+            }
+            if (menu.children.size() > 0) {
+                mGraph.add(new TripleImpl(node, GLOBALMENU.children, 
+                        itemsAsRdfList(menu.children, mGraph)));
+                mGraph.add(new TripleImpl(node, RDF.type, GLOBALMENU.Menu));
+            } else {
+                mGraph.add(new TripleImpl(node, RDF.type, GLOBALMENU.MenuItem));
+            }
+            list.add(node);
+            
+        }
+        return result;
+    }
+
+    private NonLiteral itemsAsRdfList(SortedSet<GlobalMenuItem> menus, TripleCollection mGraph) {
+        NonLiteral result = new BNode();
+        RdfList list = new RdfList(result, mGraph);
+        for (GlobalMenuItem item : menus) {
+            BNode node = new BNode();
+            final String label = item.getLabel();
+            Literal labelLiteral = new PlainLiteralImpl(label);
+            mGraph.add(new TripleImpl(node, RDFS.label,labelLiteral));
+            final String description = item.getDescription();
+            if (description != null) {
+                Literal descLiteral = new PlainLiteralImpl(description);
+                mGraph.add(new TripleImpl(node, DCTERMS.description, descLiteral));
+            }
+            final String path = item.getPath();
+            if (path != null) {
+                Literal pathLiteral = LiteralFactory.getInstance().
+                        createTypedLiteral(path);
+                mGraph.add(new TripleImpl(node, GLOBALMENU.path, pathLiteral));
+            }
+            mGraph.add(new TripleImpl(node, RDF.type, GLOBALMENU.MenuItem));
+            list.add(node);
+        }
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/UserLoginNode.java
----------------------------------------------------------------------
diff --git a/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/UserLoginNode.java b/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/UserLoginNode.java
new file mode 100644
index 0000000..8dedbc2
--- /dev/null
+++ b/platform/dashboard/platform.dashboard.core/src/main/java/org/apache/clerezza/platform/dashboard/UserLoginNode.java
@@ -0,0 +1,98 @@
+/*
+ * 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.dashboard;
+
+import org.apache.stanbol.commons.security.UserUtil;
+import org.apache.clerezza.platform.typerendering.UserContextProvider;
+import org.apache.clerezza.platform.usermanager.UserManager;
+import org.apache.clerezza.platform.users.WebIdGraphsService;
+import org.apache.clerezza.platform.users.WebIdInfo;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.ontologies.PERMISSION;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.clerezza.rdf.utils.UnionMGraph;
+import org.apache.commons.lang.Validate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Iterator;
+
+/**
+ * The login name is added to the user context node. The name is accessable via
+ * ssp template by using the context node
+ * (e.g. context/platform("user")/platform("userName")).
+ *
+ * @author tio
+ */
+@Component(enabled=true, immediate=true)
+@Service(UserContextProvider.class)
+
+public class UserLoginNode implements UserContextProvider {
+
+    @Reference
+    protected UserManager userManager;
+
+    @Reference
+    private WebIdGraphsService webIdGraphsService;
+
+    @Override
+    public GraphNode addUserContext(GraphNode node) {
+
+        final AccessControlContext context = AccessController.getContext();
+        GraphNode agent = AccessController.doPrivileged(new PrivilegedAction<GraphNode>() {
+            @Override
+            public GraphNode run() {
+                final String userName = UserUtil.getUserName(context);
+                if (userName == null) {
+                    return null;
+                }
+                return userManager.getUserGraphNode(userName);
+            }
+        });
+        if (agent != null) {
+            if (agent.getNode() instanceof UriRef) {
+                WebIdInfo webIdInfo = webIdGraphsService.getWebIdInfo((UriRef)agent.getNode());
+                MGraph userGraph = webIdInfo.localPublicUserData();
+                agent = new GraphNode(agent.getNode(), new UnionMGraph(agent.getGraph(), userGraph));
+            }
+            node.addProperty(PLATFORM.user, agent.getNode());
+            MGraph userContext = new SimpleMGraph(agent.getNodeContext());
+            removeTripleWithProperty(userContext, PERMISSION.password);
+            removeTripleWithProperty(userContext, PERMISSION.passwordSha1);
+            node.getGraph().addAll(userContext);            
+        }
+        return node;
+    }
+
+    private void removeTripleWithProperty(MGraph userContext, UriRef property) {
+        Iterator<Triple> propertyTriples = userContext.filter(null, property, null);
+        while (propertyTriples.hasNext()) {
+            propertyTriples.next();
+            propertyTriples.remove();
+        }
+    }
+}


[13/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/LICENSE
----------------------------------------------------------------------
diff --git a/platform/logging/LICENSE b/platform/logging/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/logging/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/core/LICENSE
----------------------------------------------------------------------
diff --git a/platform/logging/core/LICENSE b/platform/logging/core/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/logging/core/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/logging/core/pom.xml b/platform/logging/core/pom.xml
new file mode 100644
index 0000000..68bcf42
--- /dev/null
+++ b/platform/logging/core/pom.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.logging.parent</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.logging.core</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Logging Core</name>
+    <description>
+        Configure logging for the Clerezza Platform Core
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.logging.ontologies</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform</artifactId>
+            <version>0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.globalmenu.api</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.graphprovider.content</artifactId>
+            <version>0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.core</artifactId>
+            <version>0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>platform.typerendering.scalaserverpages</artifactId>
+            <version>0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>web.fileserver</artifactId>
+            <version>0.10</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManager.java
----------------------------------------------------------------------
diff --git a/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManager.java b/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManager.java
new file mode 100644
index 0000000..ec342d3
--- /dev/null
+++ b/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManager.java
@@ -0,0 +1,163 @@
+/*
+ * 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.logging;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.RedirectUtil;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
+import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
+import org.apache.clerezza.platform.logging.ontologies.LOGGING;
+import org.apache.clerezza.platform.typerendering.RenderletManager;
+import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
+import org.apache.clerezza.rdf.core.BNode;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
+import org.apache.clerezza.rdf.ontologies.PLATFORM;
+import org.apache.clerezza.rdf.ontologies.RDF;
+import org.apache.clerezza.rdf.utils.GraphNode;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.felix.scr.annotations.Services;
+import org.osgi.framework.Bundle;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.component.ComponentContext;
+
+@Component
+@Services({
+    @Service(value = Object.class),
+    @Service(value = GlobalMenuItemsProvider.class)
+})
+@Property(name = "javax.ws.rs", boolValue = true)
+@Path("admin/logging")
+public class LoggingManager implements GlobalMenuItemsProvider {
+
+    @Reference
+    private RenderletManager renderletManager;
+    @Reference
+    private ConfigurationAdmin configurationAdmin;
+    private String paxLoggingLocation = null;
+
+    public void activate(ComponentContext context)
+            throws URISyntaxException, IOException {
+        renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
+                new UriRef(getClass().getResource(
+                "config-page-naked.ssp").toURI().toString()),
+                LOGGING.LoggingConfigPage, "naked",
+                MediaType.APPLICATION_XHTML_XML_TYPE, true);
+
+        for (Bundle bundle : context.getBundleContext().getBundles()) {
+            if (bundle.getSymbolicName().equals("org.ops4j.pax.logging.pax-logging-service")) {
+                paxLoggingLocation = bundle.getLocation();
+                break;
+            }
+        }
+
+    }
+
+    private void setProperties(Dictionary props)
+            throws IOException {
+        Configuration config = getServiceConfig();
+        config.update(props);
+    }
+
+    /*private void setProperties(Hashtable properties) {
+    setProperties
+    }*/
+    private Configuration getServiceConfig()
+            throws IOException {
+        Configuration config = configurationAdmin.getConfiguration("org.ops4j.pax.logging", paxLoggingLocation);
+        return config;
+    }
+
+    @GET
+    public GraphNode entry(@Context UriInfo uriInfo)
+            throws IOException {
+        AccessController.checkPermission(new LoggingManagerAccessPermission());
+        TrailingSlash.enforcePresent(uriInfo);
+        SimpleMGraph resultMGraph = new SimpleMGraph();
+        GraphNode result = new GraphNode(new BNode(), resultMGraph);
+        result.addPropertyValue(LOGGING.loggingConfig, getPropertiesAsString());
+        result.addProperty(RDF.type, PLATFORM.HeadedPage);
+        result.addProperty(RDF.type, LOGGING.LoggingConfigPage);
+        return result;
+    }
+
+    private String getPropertiesAsString()
+            throws IOException {
+        Configuration config = getServiceConfig();
+        Properties properties = new Properties();
+        Dictionary propertyDictionary = config.getProperties();
+        Enumeration<String> keys = propertyDictionary.keys();
+        while (keys.hasMoreElements()) {
+            String key = keys.nextElement();
+            properties.put(key, propertyDictionary.get(key));
+        }
+        StringWriter stringWriter = new StringWriter();
+        properties.store(stringWriter, "properties of the pax-logging service");
+        return stringWriter.toString();
+    }
+
+    @POST
+    @Path("setConfiguration")
+    public Response setConfiguration(@Context UriInfo uriInfo,
+            @FormParam("configuration") String configuration)
+            throws IOException {
+        AccessController.checkPermission(new LoggingManagerAccessPermission());
+        Properties properties = new Properties();
+        properties.load(new StringReader(configuration));
+        setProperties(properties);
+        return RedirectUtil.createSeeOtherResponse("./", uriInfo);
+    }
+
+    @Override
+    public Set<GlobalMenuItem> getMenuItems() {
+        Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
+        try {
+            AccessController.checkPermission(new LoggingManagerAccessPermission());
+        } catch (AccessControlException e) {
+            return items;
+        }
+        items.add(new GlobalMenuItem("/admin/logging", "Logging", "Logging", 3,
+                "Administration"));
+        return items;
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManagerAccessPermission.java
----------------------------------------------------------------------
diff --git a/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManagerAccessPermission.java b/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManagerAccessPermission.java
new file mode 100644
index 0000000..ba0d302
--- /dev/null
+++ b/platform/logging/core/src/main/java/org/apache/clerezza/platform/logging/LoggingManagerAccessPermission.java
@@ -0,0 +1,71 @@
+/*
+ * 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.logging;
+
+import java.security.Permission;
+import org.apache.clerezza.permissiondescriptions.PermissionInfo;
+
+/**
+ * Grants access to the logging manager. Additionally the user needs permission to
+ * update the configuration via ConfigurationAdmin.
+ *
+ *
+ * @author tio
+ */
+@PermissionInfo(value="Logging Manager Access Permission", description="Grants access " +
+    "to the logging manager.")
+public class LoggingManagerAccessPermission extends Permission {
+
+    public LoggingManagerAccessPermission() {
+        super("LoggingMangerAccess");
+    }
+
+    public LoggingManagerAccessPermission(String name, String actions) {
+        super("LoggingMangerAccess");
+    }
+
+    @Override
+    public boolean implies(Permission permission) {
+        return (permission instanceof LoggingManagerAccessPermission);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String getActions() {
+        return "";
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 13;
+        hash = 101 * hash + "LoggingMangerAccess".hashCode();
+        return hash;
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/core/src/main/resources/org/apache/clerezza/platform/logging/config-page-naked.ssp
----------------------------------------------------------------------
diff --git a/platform/logging/core/src/main/resources/org/apache/clerezza/platform/logging/config-page-naked.ssp b/platform/logging/core/src/main/resources/org/apache/clerezza/platform/logging/config-page-naked.ssp
new file mode 100644
index 0000000..d9ea5d0
--- /dev/null
+++ b/platform/logging/core/src/main/resources/org/apache/clerezza/platform/logging/config-page-naked.ssp
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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 logging(s: Any) = new UriRef("http://clerezza.apache.org/2010/12/03/logging#" + s)
+
+<div id="tx-content">
+	<h3>Logging Configuration:</h3>
+	<form action="setConfiguration" method="POST">
+	<textarea name="configuration" style="width: 80%; height: 20em">{res/logging("loggingConfig")*}</textarea>
+	<br/>
+	<input type="submit" value="Save" />
+	</form>
+
+</div>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/initializer/LICENSE
----------------------------------------------------------------------
diff --git a/platform/logging/initializer/LICENSE b/platform/logging/initializer/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/logging/initializer/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/initializer/pom.xml
----------------------------------------------------------------------
diff --git a/platform/logging/initializer/pom.xml b/platform/logging/initializer/pom.xml
new file mode 100644
index 0000000..99e8299
--- /dev/null
+++ b/platform/logging/initializer/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
+
+ 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.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.logging.parent</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.logging.initializer</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Logging Initializer</name>
+    <description>
+        Configure logging for the Clerezza Platform Initializer
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Activator>org.apache.clerezza.platform.logging.initializer.Activator</Bundle-Activator>
+                        <Private-Package>org.apache.clerezza.platform.logging.initializer</Private-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.scala-tools</groupId>
+                <artifactId>maven-scala-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/initializer/src/main/scala/org/apache/clerezza/platform/logging/initializer/Activator.scala
----------------------------------------------------------------------
diff --git a/platform/logging/initializer/src/main/scala/org/apache/clerezza/platform/logging/initializer/Activator.scala b/platform/logging/initializer/src/main/scala/org/apache/clerezza/platform/logging/initializer/Activator.scala
new file mode 100644
index 0000000..c8220db
--- /dev/null
+++ b/platform/logging/initializer/src/main/scala/org/apache/clerezza/platform/logging/initializer/Activator.scala
@@ -0,0 +1,88 @@
+/*
+ * 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.logging.initializer;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.framework.BundleActivator
+
+class Activator extends BundleActivator {
+
+  private val configurationAdminClassName = classOf[ConfigurationAdmin].getName
+
+  def start(context: BundleContext) {
+    import scala.collection.JavaConversions._
+    val paxLoggingLocation: String = context.getBundles().
+      find(bundle => bundle.getSymbolicName().equals("org.ops4j.pax.logging.pax-logging-service")) match {
+        case Some(b) => b.getLocation();
+        case _ => throw new RuntimeException("org.ops4j.pax.logging.pax-logging-service not found")
+      }
+    val serviceReference = context.getServiceReference(configurationAdminClassName);
+    def configureIfUnconfigured(serviceReference: ServiceReference[_]) {
+      val configurationAdmin = context.getService(serviceReference).asInstanceOf[ConfigurationAdmin]
+      val config: Configuration = configurationAdmin.getConfiguration(
+        "org.ops4j.pax.logging", paxLoggingLocation);
+      if (config.getProperties() == null) {
+        val props: Dictionary[String, String] = new Hashtable[String, String]();
+        props.put("log4j.rootLogger", "INFO, R, stdout");
+        props.put("log4j.logger.org.apache.clerezza","DEBUG")
+        props.put("log4j.appender.stdout", "org.apache.log4j.ConsoleAppender");
+        props.put("log4j.appender.stdout.layout", "org.apache.log4j.PatternLayout");
+        props.put("log4j.appender.stdout.Threshold", "WARN");
+        // Pattern to output the caller's file name and line number.
+        props.put("log4j.appender.stdout.layout.ConversionPattern", "%d [%t] %5p [%t] (%F\\:%L) - %m%n");
+        props.put("log4j.appender.R", "org.apache.log4j.FileAppender");
+        props.put("log4j.appender.R.File", "clerezza.log");
+        props.put("log4j.appender.R.layout", "org.apache.log4j.PatternLayout");
+        props.put("log4j.appender.R.layout.ConversionPattern", "%d [%t] %p %t %c - %m%n");
+
+        config.update(props);
+      }
+    }
+    if (serviceReference != null) {
+      configureIfUnconfigured(serviceReference);
+    } else {
+      val filter: String = "(objectclass=" + configurationAdminClassName + ")";
+      context.addServiceListener(new ServiceListener{
+        def serviceChanged(e: ServiceEvent) {
+          if (e.getType == ServiceEvent.REGISTERED) {
+            configureIfUnconfigured(e.getServiceReference)
+          }
+        }
+      },filter)
+    }
+    
+  }
+
+  def stop(context: BundleContext) {
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/ontologies/LICENSE
----------------------------------------------------------------------
diff --git a/platform/logging/ontologies/LICENSE b/platform/logging/ontologies/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/platform/logging/ontologies/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/ontologies/pom.xml
----------------------------------------------------------------------
diff --git a/platform/logging/ontologies/pom.xml b/platform/logging/ontologies/pom.xml
new file mode 100644
index 0000000..cfb8f09
--- /dev/null
+++ b/platform/logging/ontologies/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>platform.logging.parent</artifactId>
+        <version>0.2</version>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.logging.ontologies</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Clerezza - Platform Logging Ontologies</name>
+    <description>
+        Skeleton Ontologies
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core</artifactId>
+            <version>0.14</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.clerezza</groupId>
+                <artifactId>maven-ontologies-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <resourcePath>${basedir}/src/main/resources</resourcePath>
+                            <sources>
+                                <source>${basedir}/target/generated-sources/main/java</source>
+                            </sources>
+                        </configuration>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <version>0.4</version>
+        </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/ontologies/src/main/resources/org/apache/clerezza/platform/logging/ontologies/logging.ttl
----------------------------------------------------------------------
diff --git a/platform/logging/ontologies/src/main/resources/org/apache/clerezza/platform/logging/ontologies/logging.ttl b/platform/logging/ontologies/src/main/resources/org/apache/clerezza/platform/logging/ontologies/logging.ttl
new file mode 100644
index 0000000..a4dab43
--- /dev/null
+++ b/platform/logging/ontologies/src/main/resources/org/apache/clerezza/platform/logging/ontologies/logging.ttl
@@ -0,0 +1,32 @@
+# 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.
+
+
+@prefix : <http://clerezza.apache.org/2010/12/03/logging#>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
+@prefix skos: <http://www.w3.org/2008/05/skos#>.
+@prefix owl: <http://www.w3.org/2002/07/owl#>.
+
+
+: a owl:Ontology.
+
+:LoggingConfigPage a rdfs:Class;
+	skos:definition "A page to configure logging."@en.
+
+:loggingConfig a rdf:Property;
+	skos:definition "Points to the logging configuration pertinent to the subject."@en.

http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/logging/pom.xml
----------------------------------------------------------------------
diff --git a/platform/logging/pom.xml b/platform/logging/pom.xml
new file mode 100644
index 0000000..11ac529
--- /dev/null
+++ b/platform/logging/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.clerezza</groupId>
+        <artifactId>clerezza</artifactId>
+        <version>0.5</version>
+        <relativePath>../parent</relativePath>
+    </parent>
+    <groupId>org.apache.clerezza</groupId>
+    <artifactId>platform.logging.parent</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - Platform Logging</name>
+    <modules>
+        <module>ontologies</module>
+        <module>core</module>
+        <module>initializer</module>
+    </modules>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.clerezza.platform.logging</groupId>
+                <artifactId>ontologies</artifactId>
+                <version>0.1-SNAPSHOT</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
\ No newline at end of file


[23/51] [partial] clerezza git commit: CLEREZZA-966: removed platform. prefix of folder names

Posted by re...@apache.org.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/rdfstore.js
----------------------------------------------------------------------
diff --git a/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/rdfstore.js b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/rdfstore.js
new file mode 100644
index 0000000..41ecf4d
--- /dev/null
+++ b/platform/editor/src/main/resources/META-INF/resources/tools/editor/scripts/rdfstore.js
@@ -0,0 +1,31836 @@
+(function() {
+
+
+  if(typeof(console)=='undefined') {
+     console = {};
+     console.log = function(e){};
+  }
+  
+  window.process = {};
+  process.nextTick = function(f) {
+    setTimeout(f,0);
+  };
+var Utils = {};
+
+
+
+Utils['extends'] = function(supertype, descendant) {
+    descendant.prototype = new supertype();
+};
+
+
+Utils.stackCounterLimit = 1000;
+Utils.stackCounter = 0;
+
+Utils.recur = function(c){
+    if(Utils.stackCounter === Utils.stackCounterLimit) {
+        Utils.stackCounter = 0;
+        setTimeout(c, 0);
+    } else {
+        Utils.stackCounter++;
+        c();
+    } 
+};
+
+Utils.clone = function(o) {
+    return JSON.parse(JSON.stringify(o));
+};
+
+Utils.shuffle = function(o){ //v1.0
+    for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x){};
+    return o;
+};
+
+Utils.include = function(a,v) {
+    var cmp = arguments[2];
+
+    for(var i=(a.length-1); i>=0; i--) {
+        var res = false;
+        if(cmp == null) {
+            res = (a[i] === v);
+        } else {
+            res = (cmp(a[i],v) === 0);
+        }
+
+        if(res === true) {
+            return true;
+        }
+    }
+
+    return false;
+};
+
+Utils.remove = function(a,v) {
+    var acum = [];
+    for(var i=0; i<a.length; i++) {
+        if(a[i] !== v) {
+            acum.push(a[i]);
+        }
+    }
+
+    return acum;
+};
+
+Utils.repeat = function(c,max,floop,fend,env) {
+    if(arguments.length===4) { env = {}; }
+    if(c<max) {
+        env._i = c;
+        floop(function(floop,env){
+            // avoid stack overflow
+            // deadly hack
+            Utils.recur(function(){ Utils.repeat(c+1, max, floop, fend, env); });
+        },env);
+    } else {
+        fend(env);
+    }
+};
+
+
+Utils.meanwhile = function(c,floop,fend,env) {
+    if(arguments.length===3) { env = {}; }
+
+    if(env['_stack_counter'] == null) {
+        env['_stack_counter'] = 0;
+    }
+
+    if(c===true) {
+        floop(function(c,floop,env){
+            if(env['_stack_counter'] % 40 == 39) {
+                env['_stack_counter'] = env['_stack_counter'] + 1;
+                setTimeout(function(){ Utils.neanwhile(c, floop, fend, env); }, 0);
+            } else {
+                env['_stack_counter'] = env['_stack_counter'] + 1;
+                Utils.meanwhile(c, floop, fend, env);
+            }
+        },env);
+    } else {
+        fend(env);
+    }
+};
+
+Utils.seq = function() {
+    var fs = arguments;
+    return function(callback) {
+        Utils.repeat(0, fs.length, function(k,env){
+            var floop = arguments.callee;
+            fs[env._i](function(){
+                k(floop, env);
+            });
+        }, function(){
+            callback();
+        });
+    };
+};
+
+
+Utils.partition = function(c, n) {
+    var rem = c.length % n;
+    var currentGroup = [];
+    for(var i=0; i<rem; i++) {
+        currentGroup.push(null);
+    }
+    
+    var groups = [];
+    for(var i=0; i<c.length; i++) {
+        currentGroup.push(c[i]);
+        if(currentGroup.length % n == 0) {
+            groups.push(currentGroup);
+            currentGroup = [];
+        }
+    }
+    return groups;
+};
+
+Utils.keys = function(obj) {
+    var variables = [];
+    for(var variable in obj) {
+        variables.push(variable);
+    }
+
+    return variables;
+};
+
+Utils.iso8601 = function(date) {
+    function pad(n){
+        return n<10 ? '0'+n : n;
+    }    
+    return date.getUTCFullYear()+'-'
+        + pad(date.getUTCMonth()+1)+'-'
+        + pad(date.getUTCDate())+'T'
+        + pad(date.getUTCHours())+':'
+        + pad(date.getUTCMinutes())+':'
+        + pad(date.getUTCSeconds())+'Z';
+};
+
+
+Utils.parseStrictISO8601 = function (str) {
+    var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
+        "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
+        "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
+    var d = str.match(new RegExp(regexp));
+
+    var offset = 0;
+    var date = new Date(d[1], 0, 1);
+
+    if (d[3]) {
+        date.setMonth(d[3] - 1);
+    } else {
+        throw "missing ISO8061 component"
+    }
+    if (d[5]) {
+        date.setDate(d[5]);
+    } else {
+        throw "missing ISO8061 component"
+    }
+    if (d[7]) {
+        date.setHours(d[7]);
+    } else {
+        throw "missing ISO8061 component"
+    }
+    if (d[8]) {
+        date.setMinutes(d[8]);
+    } else {
+        throw "missing ISO8061 component"
+    }
+    if (d[10]) {
+        date.setSeconds(d[10]);
+    } else {
+        throw "missing ISO8061 component"
+    }
+    if (d[12]) {
+        date.setMilliseconds(Number("0." + d[12]) * 1000);
+    }
+    if (d[14]) {
+        offset = (Number(d[16]) * 60) + Number(d[17]);
+        offset *= ((d[15] == '-') ? 1 : -1);
+    }
+
+    offset -= date.getTimezoneOffset();
+    var time = (Number(date) + (offset * 60 * 1000));
+    var toReturn = new Date();
+    toReturn.setTime(Number(time));
+    return toReturn;
+};
+
+
+Utils.parseISO8601 = function (str) {
+    var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
+        "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
+        "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
+    var d = str.match(new RegExp(regexp));
+
+    var offset = 0;
+    var date = new Date(d[1], 0, 1);
+
+    if (d[3]) { date.setMonth(d[3] - 1); }
+    if (d[5]) { date.setDate(d[5]);  }
+    if (d[7]) { date.setHours(d[7]);  }
+    if (d[8]) { date.setMinutes(d[8]);  }
+    if (d[10]) { date.setSeconds(d[10]);  }
+    if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
+    if (d[14]) {
+        offset = (Number(d[16]) * 60) + Number(d[17]);
+        offset *= ((d[15] == '-') ? 1 : -1);
+    }
+
+    offset -= date.getTimezoneOffset();
+    var time = (Number(date) + (offset * 60 * 1000));
+    var toReturn = new Date();
+    toReturn.setTime(Number(time));
+    return toReturn;
+};
+
+Utils.parseISO8601Components = function (str) {
+    var regexp = "([0-9]{4})(-([0-9]{2}))(-([0-9]{2}))(T([0-9]{2}):([0-9]{2})(:([0-9]{2}))?(\.([0-9]+))?)?(Z|([-+])([0-9]{2})(:([0-9]{2}))?)?";
+    var d = str.match(new RegExp(regexp));
+    var year, month, date, hours, minutes, seconds, millisecs, timezone;
+    year = Number(d[1]);
+    month = d[3] - 1;
+    date  = Number(d[5]);
+    hours = Number(d[7]);
+    minutes = Number(d[8]);
+    seconds = Number(d[10]);
+
+    if(d[12]) { millisecs = Number("0." + d[12]) * 1000; }
+
+    if(d[13]==="Z") {
+        timezone = 0;
+    } else if (d[14]) {
+        timezone = 0;
+        if(d[17]) {
+            timezone = Number(d[17]);
+        }
+        timezone = timezone+(Number(d[15]) * 60);
+        timezone *= ((d[14] == '-') ? -1 : +1);
+    } else if(d[14]==null && d[11]) {
+        timezone = Number(d[12])*60;
+    }    
+
+    return {'year': isNaN(year) ? null : year,
+            'month': isNaN(month) ? null : month,
+            'date': isNaN(date) ? null : date,
+            'hours': isNaN(hours) ? null : hours,
+            'minutes': isNaN(minutes) ? null : minutes,
+            'seconds': isNaN(seconds) ? null : seconds,
+            'millisecs':isNaN(millisecs) ? null : millisecs,
+            'timezone': isNaN(timezone) ? null : timezone};
+};
+
+Utils.compareDateComponents = function(stra,strb) {
+    var a = Utils.parseISO8601Components(stra);
+    var b = Utils.parseISO8601Components(strb);
+
+    if((a.timezone == null && b.timezone == null) ||
+       (a.timezone != null && b.timezone != null)) {        
+        var da = Utils.parseISO8601(stra);
+        var db = Utils.parseISO8601(strb);
+        
+        if(da.getTime() == db.getTime()) {
+            return 0;
+        } else if(da.getTime() < db.getTime()){
+            return -1;
+        } else {
+            return 1;
+        }
+    } else if (a.timezone != null && b.timezone == null){
+        da = Utils.parseISO8601(stra);
+        db = Utils.parseISO8601(strb);
+        var ta = da.getTime();
+        var tb = db.getTime();
+
+        var offset = 14*60*60;
+
+        if(ta < tb && ta < (tb + offset)) {
+            return -1;
+        } else if(ta > tb && ta > (tb - offset)) {
+            return 1;
+        } else {
+        return null;
+        }
+    } else {
+        da = Utils.parseISO8601(stra);
+        db = Utils.parseISO8601(strb);
+        ta = da.getTime();
+        tb = db.getTime();
+
+        var offset = 14*60*60;
+        if(ta < tb && (ta + offset)  < tb) {
+            return -1;
+        } else if(ta > tb && (ta + offset) > tb) {
+            return 1;
+        } else {
+        return null;
+        }
+    }
+};
+
+// RDF utils
+Utils.lexicalFormLiteral = function(term, env) {
+    var value = term.value;
+    var lang = term.lang;
+    var type = term.type;
+
+    var indexedValue = null;
+    if(value != null && type != null && typeof(type) != 'string') {
+        var typeValue = type.value;
+
+        if(typeValue == null) {
+            var typePrefix = type.prefix;
+            var typeSuffix = type.suffix;
+
+            var resolvedPrefix = env.namespaces[typePrefix];
+            term.type = resolvedPrefix+typeSuffix;
+	    typeValue = resolvedPrefix+typeSuffix;
+        }
+	// normalization
+	if(typeValue.indexOf('hexBinary') != -1) {
+            indexedValue = '"' + term.value.toLowerCase() + '"^^<' + typeValue + '>';
+	} else {
+            indexedValue = '"' + term.value + '"^^<' + typeValue + '>';
+	}
+    } else {
+        if(lang == null && type == null) {
+            indexedValue = '"' + value + '"';
+        } else if(type == null) {
+            indexedValue = '"' + value + '"' + "@" + lang;        
+        } else {
+	    // normalization
+	    if(type.indexOf('hexBinary') != -1) {
+		indexedValue = '"' + term.value.toLowerCase() + '"^^<'+type+'>';
+	    } else {
+		indexedValue = '"' + term.value + '"^^<'+type+'>';
+	    }
+        }
+    }
+    return indexedValue;
+};
+
+Utils.lexicalFormBaseUri = function(term, env) {
+    var uri = null;
+    env = env || {};
+    //console.log("*** normalizing URI token:");
+    //console.log(term);
+    if(term.value == null) {
+        //console.log(" - URI has prefix and suffix");
+        //console.log(" - prefix:"+term.prefix);
+        //console.log(" - suffixx:"+term.suffix);
+        var prefix = term.prefix;
+        var suffix = term.suffix;
+        var resolvedPrefix = env.namespaces[prefix];
+        if(resolvedPrefix != null) {            
+            uri = resolvedPrefix+suffix;
+        } else {
+            uri = prefix+":"+suffix;
+        }
+    } else {
+        //console.log(" - URI is not prefixed");
+        uri = term.value;
+    }
+
+    if(uri===null) {
+        return null;
+    } else {
+        //console.log(" - resolved URI is "+uri);
+        if(uri.indexOf(":") == -1) {
+            //console.log(" - URI is partial");
+            uri = (env.base||"") + uri; // applyBaseUri
+        } else {
+            //console.log(" - URI is complete");
+        }
+        //console.log(" -> FINAL URI: "+uri);
+    }
+
+    return uri;
+};
+
+
+Utils.lexicalFormTerm = function(term, ns) {
+    if(term.token === 'uri') {
+        return {'uri': Utils.lexicalFormBaseUri(term, ns)};
+    } else if(term.token === 'literal') {
+        return {'literal': Utils.lexicalFormLiteral(term, ns)};
+    } else if(term.token === 'blank') {
+        var label = '_:'+term.value;
+        return {'blank': label};
+    } else {
+	throw "Error, cannot get lexical form of unknown token: "+term.token;
+    }
+};
+
+Utils.normalizeUnicodeLiterals = function (string) {
+    var escapedUnicode = string.match(/\\u[0-9abcdefABCDEF]{4,4}/g) || [];
+    var dups = {};
+    for (var i = 0; i < escapedUnicode.length; i++) {
+        if (dups[escapedUnicode[i]] == null) {
+            dups[escapedUnicode[i]] = true;
+            string = string.replace(new RegExp("\\" + escapedUnicode[i], "g"), eval("'" + escapedUnicode[i] + "'"));
+        }
+    }
+
+    return string;
+};
+
+Utils.hashTerm = function(term) {
+    try {
+      if(term == null) {
+          return "";
+      } if(term.token==='uri') {
+          return "u"+term.value;
+      } else if(term.token === 'blank') {
+          return "b"+term.value;
+      } else if(term.token === 'literal') {
+          var l = "l"+term.value;
+          l = l + (term.type || "");
+          l = l + (term.lang || "");        
+   
+          return l;
+      }
+    } catch(e) {
+        if(typeof(term) === 'object') {
+            var key = "";
+            for(p in term) {
+                key = key + p + term[p];
+            }
+
+            return key;
+        }
+        return term;
+    }
+};
+
+// end of ./src/js-trees/src/utils.js 
+// exports
+var InMemoryBTree = {};
+
+var left = -1;
+var right = 1;
+
+
+/**
+ * @doc
+ * Implementation based on <http://www.gossamer-threads.com/lists/linux/kernel/667935>
+ *
+ */
+
+/**
+ * Tree
+ *
+ * Implements the interface of BinarySearchTree.Tree
+ *
+ * An implementation of an in memory B-Tree.
+ */
+
+InMemoryBTree.Tree = function(order) {
+    if(arguments.length != 0) {
+        this.order = order;
+        this.root = this._allocateNode();
+        this.root.isLeaf = true;
+        this.root.level = 0;
+        this._diskWrite(this.root);
+        this._updateRootNode(this.root);
+
+        this.comparator = function(a,b) {
+            if(a < b) {
+                return -1;
+            } else if(a > b){
+                return 1;
+            } else {
+                return 0;
+            }
+        };
+        this.merger = null;
+    }
+};
+
+/**
+ * Creates the new node.
+ *
+ * This class can be overwritten by different versions of
+ * the tree t select the right kind of node to be used
+ *
+ * @returns the new alloacted node
+ */
+InMemoryBTree.Tree.prototype._allocateNode = function () {
+    return new InMemoryBTree.Node();
+};
+
+/**
+ * _diskWrite
+ *
+ * Persists the node to secondary memory.
+ */
+InMemoryBTree.Tree.prototype._diskWrite= function(node) {
+    // dummy implementation;
+    // no-op
+};
+
+
+/**
+ * _diskRead
+ *
+ * Retrieves a node from secondary memory using the provided
+ * pointer
+ */
+InMemoryBTree.Tree.prototype._diskRead = function(pointer) {
+    // dummy implementation;
+    // no-op
+    return pointer;
+};
+
+
+InMemoryBTree.Tree.prototype._diskDelete= function(node) {
+    // dummy implmentation
+    // no-op
+};
+
+/**
+ * _updateRootNode
+ *
+ * Updates the pointer to the root node stored in disk.
+ */
+InMemoryBTree.Tree.prototype._updateRootNode = function(node) {
+    // dummy implementation;
+    // no-op
+    return node;
+};
+
+InMemoryBTree.Tree.prototype.clear = function() {
+        this.root = this._allocateNode();
+        this.root.isLeaf = true;
+        this.root.level = 0;
+        this._updateRootNode(this.root);
+};
+
+/**
+ * search
+ *
+ * Retrieves the node matching the given value.
+ * If no node is found, null is returned.
+ */
+InMemoryBTree.Tree.prototype.search = function(key, checkExists) {
+    var searching = true;
+    var node = this.root;
+
+    while(searching) {
+        var idx = 0;
+        while(idx < node.numberActives && this.comparator(key, node.keys[idx].key) === 1) {
+            idx++;
+        }
+
+        if(idx < node.numberActives && this.comparator(node.keys[idx].key,key) === 0) {
+            if(checkExists != null && checkExists == true) {
+                return true;
+            } else {
+                return node.keys[idx].data;
+            }
+        } else {
+            if(node.isLeaf === true) {
+                searching = false;
+            } else {
+                node = this._diskRead(node.children[idx]);
+            }
+        }
+    }
+
+    return null;
+};
+
+
+/**
+ * walk
+ * Applies a function to all the nodes key and data in the the
+ * tree in key order.
+ */
+InMemoryBTree.Tree.prototype.walk = function(f) {
+    this._walk(f,this.root);
+};
+
+InMemoryBTree.Tree.prototype._walk = function(f,node) {
+    if(node.isLeaf) {
+        for(var i=0; i<node.numberActives; i++) {
+            f(node.keys[i]);
+        }
+    } else {
+        for(var i=0; i<node.numberActives; i++) {
+            this._walk(f,this._diskRead(node.children[i]));
+            f(node.keys[i]);
+        }
+        this._walk(f,this._diskRead(node.children[node.numberActives]));
+    }
+};
+
+/**
+ * walkNodes
+ * Applies a function to all the nodes in the the
+ * tree in key order.
+ */
+InMemoryBTree.Tree.prototype.walkNodes = function(f) {
+    this._walkNodes(f,this.root);
+};
+
+InMemoryBTree.Tree.prototype._walkNodes = function(f,node) {
+    if(node.isLeaf) {
+        f(node);
+    } else {
+        f(node);
+        for(var i=0; i<node.numberActives; i++) {
+            this._walkNodes(f,this._diskRead(node.children[i]));
+        }
+        this._walkNodes(f,this._diskRead(node.children[node.numberActives]));
+    }
+};
+
+/**
+ * _splitChild
+ *
+ * Split the child node and adjusts the parent.
+ */
+InMemoryBTree.Tree.prototype._splitChild = function(parent, index, child) {
+    var newChild = this._allocateNode();
+    newChild.isLeaf = child.isLeaf;
+    newChild.level = child.level;
+    newChild.numberActives = this.order - 1;
+
+    // Copy the higher order keys to the new child
+    var newParentChild = child.keys[this.order-1];
+    child.keys[this.order-1] = null;
+
+    for(var i=0; i< this.order-1; i++) {
+	newChild.keys[i]=child.keys[i+this.order];
+	child.keys[i+this.order] = null;
+	if(!child.isLeaf) {
+	    newChild.children[i] = child.children[i+this.order];
+            child.children[i+this.order] = null;
+	}
+    }
+
+    // Copy the last child pointer
+    if(!child.isLeaf) {
+	newChild.children[i] = child.children[i+this.order];
+        child.children[i+this.order] = null;
+    }
+
+    child.numberActives = this.order - 1;
+
+
+    for(i = parent.numberActives + 1; i>index+1; i--) {
+	parent.children[i] = parent.children[i-1];
+    }
+
+    parent.children[index+1] = newChild;
+
+    for(i = parent.numberActives; i>index; i--) {
+	parent.keys[i] = parent.keys[i-1];
+    }
+
+    parent.keys[index] = newParentChild;
+    parent.numberActives++;
+
+    this._diskWrite(newChild);
+    this._diskWrite(parent);
+    this._diskWrite(child);
+};
+
+/**
+ * insert
+ *
+ * Creates a new node with value key and data and inserts it
+ * into the tree.
+ */
+InMemoryBTree.Tree.prototype.insert = function(key,data) {
+    if(this.root.numberActives === (2 * this.order - 1)) {
+        var newRoot = this._allocateNode();
+        newRoot.isLeaf = false;
+        newRoot.level = this.root.level + 1;
+        newRoot.numberActives = 0;
+        newRoot.children[0] = this.root;
+
+        this._splitChild(newRoot, 0, this.root);
+        this.root = newRoot;
+        this._updateRootNode(this.root);
+        this._insertNonFull(newRoot, key, data);
+    } else {
+        this._insertNonFull(this.root, key, data);
+    }
+};
+
+/**
+ * _insertNonFull
+ *
+ * Recursive function that tries to insert the new key in
+ * in the prvided node, or splits it and go deeper
+ * in the BTree hierarchy.
+ */
+InMemoryBTree.Tree.prototype._insertNonFull = function(node,key,data) {
+    var idx = node.numberActives - 1;
+
+    while(!node.isLeaf) {
+        while(idx>=0 && this.comparator(key,node.keys[idx].key) === -1) {
+            idx--;
+        }
+        idx++;
+        var child = this._diskRead(node.children[idx]);
+
+        if(child.numberActives === 2*this.order -1) {
+            this._splitChild(node,idx,child);
+            if(this.comparator(key, node.keys[idx].key)===1) {
+                idx++;
+            }
+        }
+        node = this._diskRead(node.children[idx]);
+        idx = node.numberActives -1;
+    }
+
+    while(idx>=0 && this.comparator(key,node.keys[idx].key) === -1) {
+        node.keys[idx+1] = node.keys[idx];
+        idx--;
+    }
+
+    node.keys[idx + 1] = {key:key, data:data};
+    node.numberActives++;
+    this._diskWrite(node);
+};
+
+/**
+ * delete
+ *
+ * Deletes the key from the BTree.
+ * If the key is not found, an exception is thrown.
+ *
+ * @param key the key to be deleted
+ * @returns true if the key is deleted false otherwise
+ */
+InMemoryBTree.Tree.prototype['delete'] = function(key) {
+    var node = this.root;
+    var parent = null;
+    var searching = true;
+    var idx = null;
+    var lsibling = null;
+    var rsibling = null;
+    var shouldContinue = true;
+
+    while(shouldContinue === true) {
+        shouldContinue = false;
+
+        while(searching === true) {
+            i = 0;
+
+            if(node.numberActives === 0) {
+                return false;
+            }
+
+            while(i<node.numberActives && this.comparator(key, node.keys[i].key) === 1) {
+                i++;
+            }
+
+            idx = i;
+
+            if(i<node.numberActives && this.comparator(key, node.keys[i].key) === 0) {
+                searching = false;
+            }
+
+            if(searching === true) {
+
+                if(node.isLeaf === true) {
+                    return false;
+                }
+
+                parent = node;
+                node = this._diskRead(node.children[i]);
+
+                if(node===null) {
+                    return false;
+                }
+
+                if(idx === parent.numberActives) {
+                    lsibling = this._diskRead(parent.children[idx-1]);
+                    rsibling = null;
+                } else if(idx === 0) {
+                    lsibling = null;
+                    rsibling = this._diskRead(parent.children[1]);
+                } else {
+                    lsibling = this._diskRead(parent.children[idx-1]);
+                    rsibling = this._diskRead(parent.children[idx+1]);
+                }
+
+
+                if(node.numberActives === (this.order-1) && parent != null) {
+                    if(rsibling != null && rsibling.numberActives > (this.order-1)) {
+                        // The current node has (t - 1) keys but the right sibling has > (t - 1) keys
+                        this._moveKey(parent,i,left);
+                    } else if(lsibling != null && lsibling.numberActives > (this.order-1)) {
+                        // The current node has (t - 1) keys but the left sibling has > (t - 1) keys
+                        this._moveKey(parent,i,right);
+                    } else if(lsibling != null && lsibling.numberActives === (this.order-1)) {
+                        // The current node has (t - 1) keys but the left sibling has (t - 1) keys
+                        node = this._mergeSiblings(parent,i,left);
+                    } else if(rsibling != null && rsibling.numberActives === (this.order-1)){
+                        // The current node has (t - 1) keys but the left sibling has (t - 1) keys
+                        node = this._mergeSiblings(parent,i,right);
+                    }
+                }
+            }
+        }
+
+
+        //Case 1 : The node containing the key is found and is the leaf node.
+        //Also the leaf node has keys greater than the minimum required.
+        //Simply remove the key
+        if(node.isLeaf && (node.numberActives > (this.order-1))) {
+            this._deleteKeyFromNode(node,idx);
+            return true;
+        }
+
+
+        //If the leaf node is the root permit deletion even if the number of keys is
+        //less than (t - 1)
+        if(node.isLeaf && (node === this.root)) {
+            this._deleteKeyFromNode(node,idx);
+            return true;
+        }
+
+
+        //Case 2: The node containing the key is found and is an internal node
+        if(node.isLeaf === false) {
+            var tmpNode = null;
+            var tmpNode2 = null;
+            if((tmpNode=this._diskRead(node.children[idx])).numberActives > (this.order-1)) {
+                var subNodeIdx = this._getMaxKeyPos(tmpNode);
+                key = subNodeIdx.node.keys[subNodeIdx.index];
+
+                node.keys[idx] = key;
+
+                //this._delete(node.children[idx],key.key);
+                this._diskWrite(node);
+                node = tmpNode;
+                key = key.key;
+                shouldContinue = true;
+                searching = true;
+            } else if ((tmpNode = this._diskRead(node.children[idx+1])).numberActives >(this.order-1)) {
+                var subNodeIdx = this._getMinKeyPos(tmpNode);
+                key = subNodeIdx.node.keys[subNodeIdx.index];
+
+                node.keys[idx] = key;
+
+                //this._delete(node.children[idx+1],key.key);
+                this._diskWrite(node);
+                node = tmpNode;
+                key = key.key;
+                shouldContinue = true;
+                searching = true;
+            } else if((tmpNode = this._diskRead(node.children[idx])).numberActives === (this.order-1) &&
+                      (tmpNode2 = this._diskRead(node.children[idx+1])).numberActives === (this.order-1)) {
+
+                var combNode = this._mergeNodes(tmpNode, node.keys[idx], tmpNode2);
+                node.children[idx] = combNode;
+
+                idx++;
+                for(var i=idx; i<node.numberActives; i++) {
+          	    node.children[i] = node.children[i+1];
+          	    node.keys[i-1] = node.keys[i];
+                }
+                // freeing unused references
+                node.children[i] = null;
+                node.keys[i-1] = null;
+
+                node.numberActives--;
+                if (node.numberActives === 0 && this.root === node) {
+                    this.root = combNode;
+                }
+
+                this._diskWrite(node);
+
+                node = combNode;
+                shouldContinue = true;
+                searching = true;
+            }
+        }
+
+
+        // Case 3:
+	// In this case start from the top of the tree and continue
+	// moving to the leaf node making sure that each node that
+	// we encounter on the way has atleast 't' (order of the tree)
+	// keys
+	if(node.isLeaf && (node.numberActives > this.order - 1) && searching===false) {
+            this._deleteKeyFromNode(node,idx);
+	}
+
+        if(shouldContinue === false) {
+            return true;
+        }
+    }
+};
+
+/**
+ * _moveKey
+ *
+ * Move key situated at position i of the parent node
+ * to the left or right child at positions i-1 and i+1
+ * according to the provided position
+ *
+ * @param parent the node whose is going to be moved to a child
+ * @param i Index of the key in the parent
+ * @param position left, or right
+ */
+InMemoryBTree.Tree.prototype._moveKey = function (parent, i, position) {
+
+    if (position === right) {
+        i--;
+    }
+
+    //var lchild = parent.children[i-1];
+    var lchild = this._diskRead(parent.children[i]);
+    var rchild = this._diskRead(parent.children[i + 1]);
+
+
+    if (position == left) {
+        lchild.keys[lchild.numberActives] = parent.keys[i];
+        lchild.children[lchild.numberActives + 1] = rchild.children[0];
+        rchild.children[0] = null;
+        lchild.numberActives++;
+
+        parent.keys[i] = rchild.keys[0];
+
+        for (var _i = 1; _i < rchild.numberActives; _i++) {
+            rchild.keys[_i - 1] = rchild.keys[_i];
+            rchild.children[_i - 1] = rchild.children[_i];
+        }
+        rchild.children[rchild.numberActives - 1] = rchild.children[rchild.numberActives];
+        rchild.numberActives--;
+    } else {
+        rchild.children[rchild.numberActives + 1] = rchild.children[rchild.numberActives];
+        for (var _i = rchild.numberActives; _i > 0; _i--) {
+            rchild.children[_i] = rchild.children[_i - 1];
+            rchild.keys[_i] = rchild.keys[_i - 1];
+        }
+        rchild.keys[0] = null;
+        rchild.children[0] = null;
+
+        rchild.children[0] = lchild.children[lchild.numberActives];
+        rchild.keys[0] = parent.keys[i];
+        rchild.numberActives++;
+
+        lchild.children[lchild.numberActives] = null;
+        parent.keys[i] = lchild.keys[lchild.numberActives - 1];
+        lchild.keys[lchild.numberActives - 1] = null;
+        lchild.numberActives--;
+    }
+
+    this._diskWrite(lchild);
+    this._diskWrite(rchild);
+    this._diskWrite(parent);
+};
+
+/**
+ * _mergeSiblings
+ *
+ * Merges two nodes at the left and right of the provided
+ * index in the parent node.
+ *
+ * @param parent the node whose children will be merged
+ * @param i Index of the key in the parent pointing to the nodes to merge
+ */
+InMemoryBTree.Tree.prototype._mergeSiblings = function (parent, index, pos) {
+    var i, j;
+    var n1, n2;
+
+    if (index === (parent.numberActives)) {
+        index--;
+        n1 = this._diskRead(parent.children[parent.numberActives - 1]);
+        n2 = this._diskRead(parent.children[parent.numberActives]);
+    } else {
+        n1 = this._diskRead(parent.children[index]);
+        n2 = this._diskRead(parent.children[index + 1]);
+    }
+
+    //Merge the current node with the left node
+    var newNode = this._allocateNode();
+    newNode.isLeaf = n1.isLeaf;
+    newNode.level = n1.level;
+
+    for (j = 0; j < this.order - 1; j++) {
+        newNode.keys[j] = n1.keys[j];
+        newNode.children[j] = n1.children[j];
+    }
+
+    newNode.keys[this.order - 1] = parent.keys[index];
+    newNode.children[this.order - 1] = n1.children[this.order - 1];
+
+    for (j = 0; j < this.order - 1; j++) {
+        newNode.keys[j + this.order] = n2.keys[j];
+        newNode.children[j + this.order] = n2.children[j];
+    }
+    newNode.children[2 * this.order - 1] = n2.children[this.order - 1];
+
+    parent.children[index] = newNode;
+
+    for (j = index; j < parent.numberActives; j++) {
+        parent.keys[j] = parent.keys[j + 1];
+        parent.children[j + 1] = parent.children[j + 2];
+    }
+
+    newNode.numberActives = n1.numberActives + n2.numberActives + 1;
+    parent.numberActives--;
+
+    for (i = parent.numberActives; i < 2 * this.order - 1; i++) {
+        parent.keys[i] = null;
+    }
+
+    if (parent.numberActives === 0 && this.root === parent) {
+        this.root = newNode;
+        if (newNode.level) {
+            newNode.isLeaf = false;
+        } else {
+            newNode.isLeaf = true;
+        }
+    }
+
+    this._diskWrite(newNode);
+    if (this.root === newNode) {
+        this._updateRootNode(this.root);
+    }
+    this._diskWrite(parent);
+    this._diskDelete(n1);
+    this._diskDelete(n2);
+
+    return newNode;
+};
+
+/**
+ * _deleteKeyFromNode
+ *
+ * Deletes the key at position index from the provided node.
+ *
+ * @param node The node where the key will be deleted.
+ * @param index The index of the key that will be deletd.
+ * @return true if the key can be deleted, false otherwise
+ */
+InMemoryBTree.Tree.prototype._deleteKeyFromNode = function (node, index) {
+    var keysMax = (2 * this.order) - 1;
+    if (node.numberActives < keysMax) {
+        keysMax = node.numberActives;
+    }
+    ;
+
+    var i;
+
+    if (node.isLeaf === false) {
+        return false;
+    }
+
+    var key = node.keys[index];
+
+    for (i = index; i < keysMax - 1; i++) {
+        node.keys[i] = node.keys[i + 1];
+    }
+
+    // cleaning invalid reference
+    node.keys.pop();
+
+    node.numberActives--;
+
+    this._diskWrite(node);
+
+    return true;
+};
+
+InMemoryBTree.Tree.prototype._mergeNodes = function (n1, key, n2) {
+    var newNode;
+    var i;
+
+    newNode = this._allocateNode();
+    newNode.isLeaf = true;
+
+    for (i = 0; i < n1.numberActives; i++) {
+        newNode.keys[i] = n1.keys[i];
+        newNode.children[i] = n1.children[i];
+    }
+    newNode.children[n1.numberActives] = n1.children[n1.numberActives];
+    newNode.keys[n1.numberActives] = key;
+
+    for (i = 0; i < n2.numberActives; i++) {
+        newNode.keys[i + n1.numberActives + 1] = n2.keys[i];
+        newNode.children[i + n1.numberActives + 1] = n2.children[i];
+    }
+    newNode.children[(2 * this.order) - 1] = n2.children[n2.numberActives];
+
+    newNode.numberActives = n1.numberActives + n2.numberActives + 1;
+    newNode.isLeaf = n1.isLeaf;
+    newNode.level = n1.level;
+
+
+    this._diskWrite(newNode);
+    // @todo
+    // delte old nodes from disk
+    return newNode;
+};
+
+/**
+ * audit
+ *
+ * Checks that the tree data structure is
+ * valid.
+ */
+InMemoryBTree.Tree.prototype.audit = function (showOutput) {
+    var errors = [];
+    var alreadySeen = [];
+    var that = this;
+
+    var foundInArray = function (data) {
+        for (var i = 0; i < alreadySeen.length; i++) {
+            if (that.comparator(alreadySeen[i], data) === 0) {
+                var error = " !!! duplicated key " + data;
+                if (showOutput === true) {
+                    console.log(error);
+                }
+                errors.push(error);
+            }
+        }
+    };
+
+    var length = null;
+    var that = this;
+    this.walkNodes(function (n) {
+        if (showOutput === true) {
+            console.log("--- Node at " + n.level + " level");
+            console.log(" - leaf? " + n.isLeaf);
+            console.log(" - num actives? " + n.numberActives);
+            console.log(" - keys: ");
+        }
+        for (var i = n.numberActives; i < n.keys.length; i++) {
+            if (n.keys[i] != null) {
+                if (showOutput === true) {
+                    console.log(" * warning : redundant key data");
+                    errors.push(" * warning : redundant key data");
+                }
+            }
+        }
+
+        for (var i = n.numberActives + 1; i < n.children.length; i++) {
+            if (n.children[i] != null) {
+                if (showOutput === true) {
+                    console.log(" * warning : redundant children data");
+                    errors.push(" * warning : redundant key data");
+                }
+            }
+        }
+
+
+        if (n.isLeaf === false) {
+            for (var i = 0; i < n.numberActives; i++) {
+                var maxLeft = that._diskRead(n.children[i]).keys[that._diskRead(n.children[i]).numberActives - 1 ].key;
+                var minRight = that._diskRead(n.children[i + 1]).keys[0].key;
+                if (showOutput === true) {
+                    console.log("   " + n.keys[i].key + "(" + maxLeft + "," + minRight + ")");
+                }
+                if (that.comparator(n.keys[i].key, maxLeft) === -1) {
+                    var error = " !!! value max left " + maxLeft + " > key " + n.keys[i].key;
+                    if (showOutput === true) {
+                        console.log(error);
+                    }
+                    errors.push(error);
+                }
+                if (that.comparator(n.keys[i].key, minRight) === 1) {
+                    var error = " !!! value min right " + minRight + " < key " + n.keys[i].key;
+                    if (showOutput === true) {
+                        console.log(error);
+                    }
+                    errors.push(error);
+                }
+
+                foundInArray(n.keys[i].key);
+                alreadySeen.push(n.keys[i].key);
+            }
+        } else {
+            if (length === null) {
+                length = n.level;
+            } else {
+                if (length != n.level) {
+                    var error = " !!! Leaf node with wrong level value";
+                    if (showOutput === true) {
+                        console.log(error);
+                    }
+                    errors.push(error);
+                }
+            }
+            for (var i = 0; i < n.numberActives; i++) {
+                if (showOutput === true) {
+                    console.log(" " + n.keys[i].key);
+                }
+                foundInArray(n.keys[i].key);
+                alreadySeen.push(n.keys[i].key);
+
+            }
+        }
+
+        if (n != that.root) {
+            if (n.numberActives > ((2 * that.order) - 1)) {
+                if (showOutput === true) {
+                    var error = " !!!! MAX num keys restriction violated ";
+                }
+                console.log(error);
+                errors.push(error);
+            }
+            if (n.numberActives < (that.order - 1)) {
+                if (showOutput === true) {
+                    var error = " !!!! MIN num keys restriction violated ";
+                }
+                console.log(error);
+                errors.push(error);
+            }
+
+        }
+    });
+
+    return errors;
+};
+
+/**
+ *  _getMaxKeyPos
+ *
+ *  Used to get the position of the MAX key within the subtree
+ *  @return An object containing the key and position of the key
+ */
+InMemoryBTree.Tree.prototype._getMaxKeyPos = function (node) {
+    var node_pos = {};
+
+    while (true) {
+        if (node === null) {
+            break;
+        }
+
+        if (node.isLeaf === true) {
+            node_pos.node = node;
+            node_pos.index = node.numberActives - 1;
+            return node_pos;
+        } else {
+            node_pos.node = node;
+            node_pos.index = node.numberActives - 1;
+            node = this._diskRead(node.children[node.numberActives]);
+        }
+    }
+
+    return node_pos;
+};
+
+/**
+ *  _getMinKeyPos
+ *
+ *  Used to get the position of the MAX key within the subtree
+ *  @return An object containing the key and position of the key
+ */
+InMemoryBTree.Tree.prototype._getMinKeyPos = function (node) {
+    var node_pos = {};
+
+    while (true) {
+        if (node === null) {
+            break;
+        }
+
+        if (node.isLeaf === true) {
+            node_pos.node = node;
+            node_pos.index = 0;
+            return node_pos;
+        } else {
+            node_pos.node = node;
+            node_pos.index = 0;
+            node = this._diskRead(node.children[0]);
+        }
+    }
+
+    return node_pos;
+};
+
+
+/**
+ * Node
+ *
+ * Implements the interface of BinarySearchTree.Node
+ *
+ * A Tree node augmented with BTree
+ * node structures
+ */
+InMemoryBTree.Node = function() {
+    this.numberActives = 0;
+    this.isLeaf = null;
+    this.keys = [];
+    this.children = [];
+    this.level = 0;
+};
+
+// end of ./src/js-trees/src/in_memory_b_tree.js 
+// exports
+var QuadIndexCommon = {};
+
+/**
+ * NodeKey
+ *
+ * Implements the interface of BinarySearchTree.Node
+ *
+ * A Tree node augmented with BPlusTree
+ * node structures
+ */
+QuadIndexCommon.NodeKey = function(components, order) {
+    this.subject = components.subject;
+    this.predicate = components.predicate;
+    this.object = components.object;
+    this.graph = components.graph;
+    this.order = order;
+};
+
+QuadIndexCommon.NodeKey.prototype.comparator = function(keyPattern) {
+    for(var i=0; i<this.order.length; i++) {
+        var component = this.order[i];
+        if(keyPattern[component] == null) {
+            return 0;
+        } else {
+            if(this[component] < keyPattern[component] ) {
+                return -1
+            } else if(this[component] > keyPattern[component]) {
+                return 1
+            }
+        }
+    }
+
+    return 0;
+};
+
+/**
+ * Pattern
+ *
+ * A pattern with some variable components
+ */
+QuadIndexCommon.Pattern = function (components) {
+    this.subject = components.subject;
+    this.predicate = components.predicate;
+    this.object = components.object;
+    this.graph = components.graph;
+    this.indexKey = [];
+
+    this.keyComponents = {};
+
+    var order = [];
+    var indif = [];
+    var components = ['subject', 'predicate', 'object', 'graph'];
+
+    // components must have been already normalized and
+    // inserted in the lexicon.
+    // OIDs retrieved from the lexicon *are* numbers so
+    // they can be told apart from variables (strings)
+    for (var i = 0; i < components.length; i++) {
+        if (typeof(this[components[i]]) === 'string') {
+            indif.push(components[i]);
+            this.keyComponents[components[i]] = null;
+        } else {
+            order.push(components[i]);
+            this.keyComponents[components[i]] = this[components[i]];
+            this.indexKey.push(components[i]);
+        }
+    }
+
+    this.order = order.concat(indif);
+    this.key = new QuadIndexCommon.NodeKey(this.keyComponents, this.order);
+};
+
+// end of ./src/js-rdf-persistence/src/quad_index_common.js 
+// exports
+var QuadIndex = {};
+
+// imports
+var BaseTree = InMemoryBTree;
+
+QuadIndex.Tree = function(params,callback) {
+    if(arguments != 0) {
+        this.componentOrder = params.componentOrder;
+
+
+        // @todo change this if using the file backed implementation
+        BaseTree.Tree.call(this, params.order, params['name'], params['persistent'], params['cacheMaxSize']);
+
+        this.comparator = function (a, b) {
+            for (var i = 0; i < this.componentOrder.length; i++) {
+                var component = this.componentOrder[i];
+                var vala = a[component];
+                var valb = b[component];
+                if (vala < valb) {
+                    return -1;
+                } else if (vala > valb) {
+                    return 1;
+                }
+            }
+            return 0;
+        };
+
+        this.rangeComparator = function (a, b) {
+            for (var i = 0; i < this.componentOrder.length; i++) {
+                var component = this.componentOrder[i];
+                if (b[component] == null || a[component] == null) {
+                    return 0;
+                } else {
+                    if (a[component] < b[component]) {
+                        return -1
+                    } else if (a[component] > b[component]) {
+                        return 1
+                    }
+                }
+            }
+
+            return 0;
+        };
+
+        if(callback!=null) {
+            callback(this);
+        }
+    }
+};
+
+Utils['extends'](BaseTree.Tree, QuadIndex.Tree);
+
+QuadIndex.Tree.prototype.insert = function(quad, callback) {
+    BaseTree.Tree.prototype.insert.call(this, quad, null);
+    if(callback)
+        callback(true);
+
+    return true
+};
+
+QuadIndex.Tree.prototype.search = function(quad, callback) {
+    var result = BaseTree.Tree.prototype.search.call(this, quad, true); // true -> check exists : not present in all the b-tree implementations, check first.
+    if(callback)
+        callback(result);
+
+    return result;
+};
+
+QuadIndex.Tree.prototype.range = function (pattern, callback) {
+    var result = null;
+    if (typeof(this.root) === 'string') {
+        result = this._rangeTraverse(this, this._diskRead(this.root), pattern);
+    } else {
+        result = this._rangeTraverse(this, this.root, pattern);
+    }
+
+    if (callback)
+        callback(result);
+
+    return result;
+};
+
+QuadIndex.Tree.prototype._rangeTraverse = function(tree,node, pattern) {
+    var patternKey  = pattern.key;
+    var acum = [];
+    var pendingNodes = [node];
+    var node, idxMin, idxMax;
+    while(pendingNodes.length > 0) {
+        node = pendingNodes.shift();
+        idxMin = 0;
+
+        while(idxMin < node.numberActives && tree.rangeComparator(node.keys[idxMin].key,patternKey) === -1) {
+            idxMin++;
+        }
+        if(node.isLeaf === true) {
+            idxMax = idxMin;
+
+            while(idxMax < node.numberActives && tree.rangeComparator(node.keys[idxMax].key,patternKey) === 0) {
+                acum.push(node.keys[idxMax].key);
+                idxMax++;
+            }
+
+        } else {
+            var pointer = node.children[idxMin];
+            var childNode = tree._diskRead(pointer);
+            pendingNodes.push(childNode);
+
+            var idxMax = idxMin;
+            while(true) {
+                if(idxMax < node.numberActives && tree.rangeComparator(node.keys[idxMax].key,patternKey) === 0) {
+                    acum.push(node.keys[idxMax].key);
+                    idxMax++;
+                    childNode = tree._diskRead(node.children[idxMax]);
+                    pendingNodes.push(childNode);
+                } else {
+                    break;
+                }
+            }
+        }
+    }
+    return acum;
+};
+
+// end of ./src/js-rdf-persistence/src/quad_index.js 
+// exports
+var QuadBackend = {};
+
+
+// imports
+
+
+/*
+ * "perfect" indices for RDF indexing
+ *
+ * SPOG (?, ?, ?, ?), (s, ?, ?, ?), (s, p, ?, ?), (s, p, o, ?), (s, p, o, g)
+ * GP   (?, ?, ?, g), (?, p, ?, g)
+ * OGS  (?, ?, o, ?), (?, ?, o, g), (s, ?, o, g)
+ * POG  (?, p, ?, ?), (?, p, o, ?), (?, p, o, g)
+ * GSP  (s, ?, ?, g), (s, p, ?, g)
+ * OS   (s, ?, o, ?)
+ */
+QuadBackend.QuadBackend = function (configuration, callback) {
+    if (arguments != 0) {
+        this.indexMap = {};
+        this.treeOrder = configuration['treeOrder'];
+        this.indices = ['SPOG', 'GP', 'OGS', 'POG', 'GSP', 'OS'];
+        this.componentOrders = {
+            SPOG:['subject', 'predicate', 'object', 'graph'],
+            GP:['graph', 'predicate', 'subject', 'object'],
+            OGS:['object', 'graph', 'subject', 'predicate'],
+            POG:['predicate', 'object', 'graph', 'subject'],
+            GSP:['graph', 'subject', 'predicate', 'object'],
+            OS:['object', 'subject', 'predicate', 'graph']
+        };
+
+        for (var i = 0; i < this.indices.length; i++) {
+            var indexKey = this.indices[i];
+            this.indexMap[indexKey] = new QuadIndex.Tree({order:this.treeOrder,
+                componentOrder:this.componentOrders[indexKey],
+                persistent:configuration['persistent'],
+                name:(configuration['name'] || "") + indexKey,
+                cacheMaxSize:configuration['cacheMaxSize']});
+        }
+
+        if (callback)
+            callback(this);
+    }
+};
+
+QuadBackend.QuadBackend.prototype.clear = function() {
+        for(var i=0; i<this.indices.length; i++) {
+            var indexKey = this.indices[i];
+            this.indexMap[indexKey].clear();
+        }
+};
+
+QuadBackend.QuadBackend.prototype._indexForPattern = function (pattern) {
+    var indexKey = pattern.indexKey;
+    var matchingIndices = this.indices;
+
+    for (var i = 0; i < matchingIndices.length; i++) {
+        var index = matchingIndices[i];
+        var indexComponents = this.componentOrders[index];
+        for (var j = 0; j < indexComponents.length; j++) {
+            if (Utils.include(indexKey, indexComponents[j]) === false) {
+                break;
+            }
+            if (j == indexKey.length - 1) {
+                return index;
+            }
+        }
+    }
+
+    return 'SPOG'; // If no other match, we erturn the more generic index
+};
+
+
+QuadBackend.QuadBackend.prototype.index = function (quad, callback) {
+    for (var i = 0; i < this.indices.length; i++) {
+        var indexKey = this.indices[i];
+        var index = this.indexMap[indexKey];
+
+        index.insert(quad);
+    }
+
+    if (callback)
+        callback(true);
+
+    return true;
+};
+
+QuadBackend.QuadBackend.prototype.range = function (pattern, callback) {
+    var indexKey = this._indexForPattern(pattern);
+    var index = this.indexMap[indexKey];
+    var quads = index.range(pattern);
+    if (callback)
+        callback(quads);
+
+    return quads;
+};
+
+QuadBackend.QuadBackend.prototype.search = function (quad, callback) {
+    var indexKey = this.indices[0];
+    var index = this.indexMap[indexKey];
+    var result = index.search(quad);
+
+    if (callback)
+        callback(result != null);
+
+    return (result != null)
+};
+
+
+QuadBackend.QuadBackend.prototype['delete'] = function (quad, callback) {
+    var indexKey, index;
+    for (var i = 0; i < this.indices.length; i++) {
+        indexKey = this.indices[i];
+        index = this.indexMap[indexKey];
+
+        index['delete'](quad);
+    }
+
+    if (callback)
+        callback(true);
+
+    return true;
+};
+
+// end of ./src/js-rdf-persistence/src/quad_backend.js 
+// exports
+var Lexicon = {};
+
+// imports
+
+/**
+ * Temporal implementation of the lexicon
+ */
+
+
+Lexicon.Lexicon = function(callback){
+    this.uriToOID = {};
+    this.OIDToUri = {};
+
+    this.literalToOID = {};
+    this.OIDToLiteral = {};
+
+    this.blankToOID = {};
+    this.OIDToBlank = {};
+
+    this.defaultGraphOid = 0;
+
+    this.defaultGraphUri = "https://github.com/antoniogarrote/rdfstore-js#default_graph";
+    this.defaultGraphUriTerm = {"token": "uri", "prefix": null, "suffix": null, "value": this.defaultGraphUri, "oid": this.defaultGraphOid};
+    this.oidCounter = 1;
+
+    this.knownGraphs = {};
+    
+    if(callback != null) {
+        callback(this);
+    }
+};
+
+Lexicon.Lexicon.prototype.registerGraph = function(oid){
+    if(oid != this.defaultGraphOid) {
+        this.knownGraphs[oid] = true;
+    }
+    return true
+};
+
+Lexicon.Lexicon.prototype.registeredGraphs = function(shouldReturnUris) {
+    var acum = [];
+
+    for(var g in this.knownGraphs) {
+        if(shouldReturnUris === true) {
+            acum.push(this.OIDToUri['u'+g]);
+        } else {
+            acum.push(g);
+        }
+    }
+    return acum;
+};
+
+Lexicon.Lexicon.prototype.registerUri = function(uri) {
+    if(uri === this.defaultGraphUri) {
+        return(this.defaultGraphOid);
+    } else if(this.uriToOID[uri] == null){
+        var oid = this.oidCounter;
+        var oidStr = 'u'+oid;
+        this.oidCounter++;
+
+        this.uriToOID[uri] =[oid, 0];
+        this.OIDToUri[oidStr] = uri;
+
+        return(oid);
+    } else {
+        var oidCounter = this.uriToOID[uri];
+        var oid = oidCounter[0];
+        var counter = oidCounter[1] + 1;
+        this.uriToOID[uri] = [oid, counter];
+        return(oid);
+    }
+};
+
+Lexicon.Lexicon.prototype.resolveUri = function(uri) {
+    if(uri === this.defaultGraphUri) {
+        return(this.defaultGraphOid);
+    } else {
+        var oidCounter = this.uriToOID[uri];
+        if(oidCounter != null) {
+            return(oidCounter[0]);
+        } else {
+            return(-1);
+        }
+    }
+};
+
+Lexicon.Lexicon.prototype.resolveUriCost = function(uri) {
+    if(uri === this.defaultGraphUri) {
+        return(this.defaultGraphOid);
+    } else {
+        var oidCounter = this.uriToOID[uri];
+        if(oidCounter != null) {
+            return(oidCounter[1]);
+        } else {
+            return(-1);
+        }
+    }
+};
+
+Lexicon.Lexicon.prototype.registerBlank = function(label) {
+    var oid = this.oidCounter;
+    this.oidCounter++;
+    var oidStr = ""+oid;
+    this.OIDToBlank[oidStr] = true;
+    return(oidStr);
+};
+
+Lexicon.Lexicon.prototype.resolveBlank = function(label) {
+//    @todo
+//    this is failing with unicode tests... e.g. kanji2
+
+//    var id = label.split(":")[1];
+//    callback(id);
+
+    var oid = this.oidCounter;
+    this.oidCounter++;
+    return(""+oid);
+};
+
+Lexicon.Lexicon.prototype.resolveBlankCost = function(label) {
+    return 0;
+};
+
+Lexicon.Lexicon.prototype.registerLiteral = function(literal) {
+    if(this.literalToOID[literal] == null){
+        var oid = this.oidCounter;
+        var oidStr =  'l'+ oid;
+        this.oidCounter++;
+
+        this.literalToOID[literal] = [oid, 0];
+        this.OIDToLiteral[oidStr] = literal;
+
+        return(oid);
+    } else {
+        var oidCounter = this.literalToOID[literal];
+        var oid = oidCounter[0];
+        var counter = oidCounter[1] + 1;
+        this.literalToOID[literal] = [oid, counter];
+        return(oid);
+    }
+};
+
+Lexicon.Lexicon.prototype.resolveLiteral = function (literal) {
+    var oidCounter = this.literalToOID[literal];
+    if (oidCounter != null) {
+        return(oidCounter[0]);
+    } else {
+        return(-1);
+    }
+};
+
+Lexicon.Lexicon.prototype.resolveLiteralCost = function (literal) {
+    var oidCounter = this.literalToOID[literal];
+    if (oidCounter != null) {
+        return(oidCounter[1]);
+    } else {
+        return(0);
+    }
+};
+
+
+Lexicon.Lexicon.prototype.parseLiteral = function(literalString) {
+    var parts = literalString.lastIndexOf("@");
+    if(parts!=-1 && literalString[parts-1]==='"' && literalString.substring(parts, literalString.length).match(/^@[a-zA-Z\-]+$/g)!=null) {
+        var value = literalString.substring(1,parts-1);
+        var lang = literalString.substring(parts+1, literalString.length);
+        return {token: "literal", value:value, lang:lang};
+    }
+
+    var parts = literalString.lastIndexOf("^^");
+    if(parts!=-1 && literalString[parts-1]==='"' && literalString[parts+2] === '<' && literalString[literalString.length-1] === '>') {
+        var value = literalString.substring(1,parts-1);
+        var type = literalString.substring(parts+3, literalString.length-1);
+
+        return {token: "literal", value:value, type:type};
+    }
+
+    var value = literalString.substring(1,literalString.length-1);
+    return {token:"literal", value:value};
+};
+
+Lexicon.Lexicon.prototype.parseUri = function(uriString) {
+    return {token: "uri", value:uriString};
+};
+
+Lexicon.Lexicon.prototype.retrieve = function(oid) {
+    try {
+        if(oid === this.defaultGraphOid) {
+            return({ token: "uri", 
+                       value:this.defaultGraphUri,
+                       prefix: null,
+                       suffix: null,
+                       defaultGraph: true });
+        } else {
+          var maybeUri = this.OIDToUri['u'+oid];
+          if(maybeUri != null) {
+              return(this.parseUri(maybeUri));
+          } else {
+              var maybeLiteral = this.OIDToLiteral['l'+oid];
+              if(maybeLiteral != null) {
+                  return(this.parseLiteral(maybeLiteral));
+              } else {
+                  var maybeBlank = this.OIDToBlank[""+oid];
+                  if(maybeBlank != null) {
+                      return({token:"blank", value:"_:"+oid});
+                  } else {
+                      throw("Null value for OID");
+                  }
+              }
+          }
+        }
+    } catch(e) {
+        console.log("error in lexicon retrieving OID:");
+        console.log(oid);
+        if(e.message || e.stack) {
+            if(e.message) {
+                console.log(e.message); 
+            }
+            if(e.stack) {
+                console.log(e.stack);
+            }
+        } else {
+            console.log(e);
+        }
+        throw new Error("Unknown retrieving OID in lexicon:"+oid);
+
+    }
+};
+
+Lexicon.Lexicon.prototype.clear = function() {
+    this.uriToOID = {};
+    this.OIDToUri = {};
+
+    this.literalToOID = {};
+    this.OIDToLiteral = {};
+
+    this.blankToOID = {};
+    this.OIDToBlank = {};
+};
+
+Lexicon.Lexicon.prototype.unregister = function (quad, key) {
+    try {
+        this.unregisterTerm(quad.subject.token, key.subject);
+        this.unregisterTerm(quad.predicate.token, key.predicate);
+        this.unregisterTerm(quad.object.token, key.object);
+        if (quad.graph != null) {
+            this.unregisterTerm(quad.graph.token, key.graph);
+        }
+        return(true);
+    } catch (e) {
+        console.log("Error unregistering quad");
+        console.log(e.message);
+        return(false);
+    }
+};
+
+Lexicon.Lexicon.prototype.unregisterTerm = function (kind, oid) {
+    if (kind === 'uri') {
+        if (oid != this.defaultGraphOid) {
+            var oidStr = 'u' + oid;
+            var uri = this.OIDToUri[oidStr];     // = uri;
+            var oidCounter = this.uriToOID[uri]; // =[oid, 0];
+
+            var counter = oidCounter[1];
+            if ("" + oidCounter[0] === "" + oid) {
+                if (counter === 0) {
+                    delete this.OIDToUri[oidStr];
+                    delete this.uriToOID[uri];
+                    // delete the graph oid from known graphs
+                    // in case this URI is a graph identifier
+                    delete this.knownGraphs[oid];
+                } else {
+                    this.uriToOID[uri] = [oid, counter - 1];
+                }
+            } else {
+                throw("Not matching OID : " + oid + " vs " + oidCounter[0]);
+            }
+        }
+    } else if (kind === 'literal') {
+        this.oidCounter++;
+        var oidStr = 'l' + oid;
+        var literal = this.OIDToLiteral[oidStr];  // = literal;
+        var oidCounter = this.literalToOID[literal]; // = [oid, 0];
+
+        var counter = oidCounter[1];
+        if ("" + oidCounter[0] === "" + oid) {
+            if (counter === 0) {
+                delete this.OIDToLiteral[oidStr];
+                delete this.literalToOID[literal];
+            } else {
+                this.literalToOID[literal] = [oid, counter - 1];
+            }
+        } else {
+            throw("Not matching OID : " + oid + " vs " + oidCounter[0]);
+        }
+
+    } else if (kind === 'blank') {
+        delete this.OIDToBlank["" + oid];
+    }
+};
+
+// end of ./src/js-rdf-persistence/src/lexicon.js 
+// exports
+var NetworkTransport = {};
+
+NetworkTransport.load = function (uri, accept, callback, redirect) {
+    var transport = jQuery;
+
+    transport.ajax({
+        url:uri,
+        headers:{"Accept":accept},
+
+        success:function (data, status, xhr) {
+            if (("" + xhr.status)[0] == '2') {
+                var headers = xhr.getAllResponseHeaders().split("\n");
+                var acum = {};
+                for (var i = 0; i < headers.length; i++) {
+                    var header = headers[i].split(":");
+                    acum[header[0]] = header[1];
+                }
+
+                callback(true, {headers:acum,
+                                data:data});
+            }
+        },
+
+        error:function (xhr, textStatus, ex) {
+            if (("" + xhr.status)[0] == '3') {
+                if (redirection == 0) {
+                    callback(false, 500);
+                } else {
+                    var location = (xhr.getAllResponseHeaders()["Location"] || xhr.getAllResponseHeaders()["location"]);
+                    if (location != null) {
+                        NetworkTransport.load(location, accept, callback, (redirection - 1));
+                    } else {
+                        callback(false, 500);
+                    }
+                }
+            } else {
+                callback(false, xhr.statusCode());
+            }
+        }
+    });
+};
+
+// end of ./src/js-communication/src/ajax_transport.js 
+
+/**
+ * Javascript implementation of JSON-LD.
+ *
+ * @author Dave Longley
+ *
+ * Copyright (c) 2011 Digital Bazaar, Inc. All rights reserved.
+ */
+
+var jsonldParser = null;
+
+(function()
+{
+
+// used by Exception
+var _setMembers = function(self, obj)
+{
+   self.stack = '';
+   for(var key in obj)
+   {
+      self[key] = obj[key];
+   }
+};
+
+// define jsonld
+if(typeof(window) !== 'undefined')
+{
+   var jsonld = window.jsonld = window.jsonld || {};
+   Exception = function(obj)
+   {
+      _setMembers(this, obj);
+   };
+
+   // define js 1.8.5 Object.keys method unless present
+   if(!Object.keys)
+   {
+      Object.keys = function(o)
+      {  
+         if(o !== Object(o))
+         {
+            throw new TypeError('Object.keys called on non-object');
+         }
+         var rval = [];
+         for(var p in o)
+         {
+            if(Object.prototype.hasOwnProperty.call(o, p))
+            {
+               rval.push(p);
+            }
+         }
+         return rval;
+      };
+   }
+
+   if (!Array.prototype.filter)
+   {
+     Array.prototype.filter = function(fun /*, thisp */)
+     {
+       "use strict";
+    
+       if (this == null)
+         throw new TypeError();
+    
+       var t = Object(this);
+       var len = t.length >>> 0;
+       if (typeof fun != "function")
+         throw new TypeError();
+    
+       var res = [];
+       var thisp = arguments[1];
+       for (var i = 0; i < len; i++)
+       {
+         if (i in t)
+         {
+           var val = t[i]; // in case fun mutates this
+           if (fun.call(thisp, val, i, t))
+             res.push(val);
+         }
+       }
+    
+       return res;
+     };
+   }
+
+}
+// define node.js module
+else if(typeof(module) !== 'undefined' && module.exports)
+{
+   var jsonld = {};
+   //module.exports = jsonld;
+   Exception = function(obj)
+   {
+      _setMembers(this, obj);
+      this.stack = new Error().stack;
+   };
+}
+
+
+jsonldParser = jsonld;
+
+var defaultContext = { "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+                       "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
+                       "owl": "http://www.w3.org/2002/07/owl#",
+                       "xsd": "http://www.w3.org/2001/XMLSchema#",
+                       "dcterms": "http://purl.org/dc/terms/",
+                       "foaf": "http://xmlns.com/foaf/0.1/",
+                       "cal": "http://www.w3.org/2002/12/cal/ical#",
+                       "vcard": "http://www.w3.org/2006/vcard/ns# ",
+                       "geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",
+                       "cc": "http://creativecommons.org/ns#",
+                       "sioc": "http://rdfs.org/sioc/ns#",
+                       "doap": "http://usefulinc.com/ns/doap#",
+                       "com": "http://purl.org/commerce#",
+                       "ps": "http://purl.org/payswarm#",
+                       "gr": "http://purl.org/goodrelations/v1#",
+                       "sig": "http://purl.org/signature#",
+                       "ccard": "http://purl.org/commerce/creditcard#"
+                     };
+
+/*
+ * Globals and helper functions.
+ */
+var ns =
+{
+   xsd: 'http://www.w3.org/2001/XMLSchema#'
+};
+
+var xsd =
+{
+   'boolean': ns.xsd + 'boolean',
+   'double': ns.xsd + 'double',
+   'integer': ns.xsd + 'integer'
+};
+
+/**
+ * Sets a subject's property to the given object value. If a value already
+ * exists, it will be appended to an array.
+ *
+ * @param s the subject.
+ * @param p the property.
+ * @param o the object.
+ */
+var _setProperty = function(s, p, o)
+{
+   if(p in s)
+   {
+      if(s[p].constructor === Array)
+      {
+         s[p].push(o);
+      }
+      else
+      {
+         s[p] = [s[p], o];
+      }
+   }
+   else
+   {
+      s[p] = o;
+   }
+};
+
+/**
+ * Clones an object, array, or string/number. If cloning an object, the keys
+ * will be sorted.
+ * 
+ * @param value the value to clone.
+ * 
+ * @return the cloned value.
+ */
+var _clone = function(value)
+{
+   var rval;
+   
+   if(value.constructor === Object)
+   {
+      rval = {};
+      var keys = Object.keys(value).sort();
+      for(var i in keys)
+      {
+         var key = keys[i];
+         rval[key] = _clone(value[key]);
+      }
+   }
+   else if(value.constructor === Array)
+   {
+      rval = [];
+      for(var i in value)
+      {
+         rval[i] = _clone(value[i]);
+      }
+   }
+   else
+   {
+      rval = value;
+   }
+   
+   return rval;
+};
+
+/**
+ * Gets the keywords from a context.
+ * 
+ * @param ctx the context.
+ * 
+ * @return the keywords.
+ */
+var _getKeywords = function(ctx)
+{
+   // TODO: reduce calls to this function by caching keywords in processor
+   // state
+   
+   var rval =
+   {
+      '@id': '@id',
+      '@language': '@language',
+      '@literal': '@literal',
+      '@type': '@type'
+   };
+   
+   if(ctx)
+   {
+      // gather keyword aliases from context
+      var keywords = {};
+      for(var key in ctx)
+      {
+         if(ctx[key].constructor === String && ctx[key] in rval)
+         {
+            keywords[ctx[key]] = key;
+         }
+      }
+      
+      // overwrite keywords
+      for(var key in keywords)
+      {
+         rval[key] = keywords[key];
+      }
+   }
+   
+   return rval;
+};
+
+/**
+ * Gets the iri associated with a term.
+ * 
+ * @param ctx the context.
+ * @param term the term.
+ * 
+ * @return the iri or NULL.
+ */
+var _getTermIri = function(ctx, term)
+{
+   var rval = null;
+   if(term in ctx)
+   {
+      if(ctx[term].constructor === String)
+      {
+         rval = ctx[term];
+      }
+      else if(ctx[term].constructor === Object && '@id' in ctx[term])
+      {
+         rval = ctx[term]['@id'];
+      }
+   }
+   return rval;
+};
+
+/**
+ * Compacts an IRI into a term or prefix if it can be. IRIs will not be
+ * compacted to relative IRIs if they match the given context's default
+ * vocabulary.
+ *
+ * @param ctx the context to use.
+ * @param iri the IRI to compact.
+ * @param usedCtx a context to update if a value was used from "ctx".
+ *
+ * @return the compacted IRI as a term or prefix or the original IRI.
+ */
+var _compactIri = function(ctx, iri, usedCtx)
+{
+   var rval = null;
+   
+   // check the context for a term that could shorten the IRI
+   // (give preference to terms over prefixes)
+   for(var key in ctx)
+   {
+      // skip special context keys (start with '@')
+      if(key.length > 0 && key[0] !== '@')
+      {
+         // compact to a term
+         if(iri === _getTermIri(ctx, key))
+         {
+            rval = key;
+            if(usedCtx !== null)
+            {
+               usedCtx[key] = _clone(ctx[key]);
+            }
+            break;
+         }
+      }
+   }
+   
+   // term not found, if term is @type, use keyword
+   if(rval === null && iri === '@type')
+   {
+      rval = _getKeywords(ctx)['@type'];
+   }
+   
+   // term not found, check the context for a prefix
+   if(rval === null)
+   {
+      for(var key in ctx)
+      {
+         // skip special context keys (start with '@')
+         if(key.length > 0 && key[0] !== '@')
+         {
+            // see if IRI begins with the next IRI from the context
+            var ctxIri = _getTermIri(ctx, key);
+            if(ctxIri !== null)
+            {
+               var idx = iri.indexOf(ctxIri);
+               
+               // compact to a prefix
+               if(idx === 0 && iri.length > ctxIri.length)
+               {
+                  rval = key + ':' + iri.substr(ctxIri.length);
+                  if(usedCtx !== null)
+                  {
+                     usedCtx[key] = _clone(ctx[key]);
+                  }
+                  break;
+               }
+            }
+         }
+      }
+   }
+
+   // could not compact IRI
+   if(rval === null)
+   {
+      rval = iri;
+   }
+
+   return rval;
+};
+
+/**
+ * Expands a term into an absolute IRI. The term may be a regular term, a
+ * prefix, a relative IRI, or an absolute IRI. In any case, the associated
+ * absolute IRI will be returned.
+ *
+ * @param ctx the context to use.
+ * @param term the term to expand.
+ * @param usedCtx a context to update if a value was used from "ctx".
+ *
+ * @return the expanded term as an absolute IRI.
+ */
+var _expandTerm = function(ctx, term, usedCtx)
+{
+   var rval = term;
+   
+   // get JSON-LD keywords
+   var keywords = _getKeywords(ctx);
+   
+   // 1. If the property has a colon, it is a prefix or an absolute IRI:
+   var idx = term.indexOf(':');
+   if(idx !== -1)
+   {
+      // get the potential prefix
+      var prefix = term.substr(0, idx);
+
+      // expand term if prefix is in context, otherwise leave it be
+      if(prefix in ctx)
+      {
+         // prefix found, expand property to absolute IRI
+         var iri = _getTermIri(ctx, prefix);
+         rval = iri + term.substr(idx + 1);
+         if(usedCtx !== null)
+         {
+            usedCtx[prefix] = _clone(ctx[prefix]);
+         }
+      }
+   }
+   // 2. If the property is in the context, then it's a term.
+   else if(term in ctx)
+   {
+      rval = _getTermIri(ctx, term);
+      if(usedCtx !== null)
+      {
+         usedCtx[term] = _clone(ctx[term]);
+      }
+   }
+   // 3. The property is a keyword.
+   else
+   {
+      for(var key in keywords)
+      {
+         if(term === keywords[key])
+         {
+            rval = key;
+            break;
+         }
+      }
+   }
+   
+   return rval;
+};
+
+/**
+ * Sorts the keys in a context.
+ * 
+ * @param ctx the context to sort.
+ * 
+ * @return the sorted context.
+ */
+var _sortContextKeys = function(ctx)
+{
+   // sort keys
+   var rval = {};
+   var keys = Object.keys(ctx).sort();
+   for(var k in keys)
+   {
+      var key = keys[k];
+      rval[key] = ctx[key];
+   }
+   return rval;
+};
+
+/**
+ * Gets whether or not a value is a reference to a subject (or a subject with
+ * no properties).
+ * 
+ * @param value the value to check.
+ * 
+ * @return true if the value is a reference to a subject, false if not.
+ */
+var _isReference = function(value)
+{
+   // Note: A value is a reference to a subject if all of these hold true:
+   // 1. It is an Object.
+   // 2. It is has an @id key.
+   // 3. It has only 1 key.
+   return (value !== null &&
+      value.constructor === Object &&
+      '@id' in value &&
+      Object.keys(value).length === 1);
+};
+
+/**
+ * Gets whether or not a value is a subject with properties.
+ * 
+ * @param value the value to check.
+ * 
+ * @return true if the value is a subject with properties, false if not.
+ */
+var _isSubject = function(value)
+{
+   var rval = false;
+   
+   // Note: A value is a subject if all of these hold true:
+   // 1. It is an Object.
+   // 2. It is not a literal.
+   // 3. It has more than 1 key OR any existing key is not '@id'.
+   if(value !== null && value.constructor === Object && !('@literal' in value))
+   {
+      var keyCount = Object.keys(value).length;
+      rval = (keyCount > 1 || !('@id' in value));
+   }
+   
+   return rval;
+};
+
+/*
+ * JSON-LD API.
+ */
+
+/**
+ * Normalizes a JSON-LD object.
+ *
+ * @param input the JSON-LD object to normalize.
+ * 
+ * @return the normalized JSON-LD object.
+ */
+jsonld.normalize = function(input)
+{
+   return new Processor().normalize(input);
+};
+
+/**
+ * Removes the context from a JSON-LD object, expanding it to full-form.
+ *
+ * @param input the JSON-LD object to remove the context from.
+ * 
+ * @return the context-neutral JSON-LD object.
+ */
+jsonld.expand = function(input)
+{
+   return new Processor().expand({}, null, input);
+};
+
+/**
+ * Expands the given JSON-LD object and then compacts it using the
+ * given context.
+ *
+ * @param ctx the new context to use.
+ * @param input the input JSON-LD object.
+ * 
+ * @return the output JSON-LD object.
+ */
+jsonld.compact = function(ctx, input)
+{
+   var rval = null;
+   
+   // TODO: should context simplification be optional? (ie: remove context
+   // entries that are not used in the output)
+
+   if(input !== null)
+   {
+      // fully expand input
+      input = jsonld.expand(input);
+      
+      var tmp;
+      if(input.constructor === Array)
+      {
+         rval = [];
+         tmp = input;
+      }
+      else
+      {
+         tmp = [input];
+      }
+      
+      // merge context if it is an array
+      if(ctx.constructor === Array)
+      {
+         ctx = jsonld.mergeContexts({}, ctx);
+      }
+      
+      for(var i in tmp)
+      {
+         // setup output context
+         var ctxOut = {};
+         
+         // compact
+         var out = new Processor().compact(_clone(ctx), null, tmp[i], ctxOut);
+         
+         // add context if used
+         if(Object.keys(ctxOut).length > 0)
+         {
+            // sort context keys
+            ctxOut = _sortContextKeys(ctxOut);
+            
+            // sort keys
+            var keys = Object.keys(out);
+            keys.sort();
+            
+            // put @context first
+            keys.unshift('@context');
+            out['@context'] = ctxOut;
+            
+            // order keys in output
+            var ordered = {};
+            for(var k in keys)
+            {
+               var key = keys[k];
+               ordered[key] = out[key];
+            }
+            out = ordered;
+         }
+         
+         if(rval === null)
+         {
+            rval = out;
+         }
+         else
+         {
+            rval.push(out);
+         }
+      }
+   }
+
+   return rval;
+};
+
+/**
+ * Merges one context with another.
+ *
+ * @param ctx1 the context to overwrite/append to.
+ * @param ctx2 the new context to merge onto ctx1.
+ *
+ * @return the merged context.
+ */
+jsonld.mergeContexts = function(ctx1, ctx2)
+{
+   // merge first context if it is an array
+   if(ctx1.constructor === Array)
+   {
+      ctx1 = jsonld.mergeContexts({}, ctx1);
+   }
+   
+   // copy context to merged output
+   var merged = _clone(ctx1);
+   
+   if(ctx2.constructor === Array)
+   {
+      // merge array of contexts in order
+      for(var i in ctx2)
+      {
+         merged = jsonld.mergeContexts(merged, ctx2[i]);
+      }
+   }
+   else
+   {
+      // if the new context contains any IRIs that are in the merged context,
+      // remove them from the merged context, they will be overwritten
+      for(var key in ctx2)
+      {
+         // ignore special keys starting with '@'
+         if(key.indexOf('@') !== 0)
+         {
+            for(var mkey in merged)
+            {
+               if(merged[mkey] === ctx2[key])
+               {
+                  // FIXME: update related coerce rules
+                  delete merged[mkey];
+                  break;
+               }
+            }
+         }
+      }
+   
+      // merge contexts
+      for(var key in ctx2)
+      {
+         merged[key] = _clone(ctx2[key]);
+      }
+   }
+
+   return merged;
+};
+
+/**
+ * Expands a term into an absolute IRI. The term may be a regular term, a
+ * prefix, a relative IRI, or an absolute IRI. In any case, the associated
+ * absolute IRI will be returned.
+ *
+ * @param ctx the context to use.
+ * @param term the term to expand.
+ *
+ * @return the expanded term as an absolute IRI.
+ */
+jsonld.expandTerm = _expandTerm;
+
+/**
+ * Compacts an IRI into a term or prefix if it can be. IRIs will not be
+ * compacted to relative IRIs if they match the given context's default
+ * vocabulary.
+ *
+ * @param ctx the context to use.
+ * @param iri the IRI to compact.
+ *
+ * @return the compacted IRI as a term or prefix or the original IRI.
+ */
+jsonld.compactIri = function(ctx, iri)
+{
+   return _compactIri(ctx, iri, null);
+};
+
+/**
+ * Frames JSON-LD input.
+ * 
+ * @param input the JSON-LD input.
+ * @param frame the frame to use.
+ * @param options framing options to use.
+ * 
+ * @return the framed output.
+ */
+jsonld.frame = function(input, frame, options)
+{
+   return new Processor().frame(input, frame, options);
+};
+
+/**
+ * Generates triples given a JSON-LD input. Each triple that is generated
+ * results in a call to the given callback. The callback takes 3 parameters:
+ * subject, property, and object. If the callback returns false then this
+ * method will stop generating triples and return. If the callback is null,
+ * then an array with triple objects containing "s", "p", "o" properties will
+ * be returned.
+ * 
+ * The object or "o" property will be a JSON-LD formatted object.
+ * 
+ * @param input the JSON-LD input.
+ * @param callback the triple callback.
+ * 
+ * @return an array of triple objects if callback is null, null otherwise.
+ */
+jsonld.toTriples = function(input, graph, callback)
+{
+   var rval = null;
+   
+   // normalize input
+   var normalized = jsonld.normalize(input);
+   
+   // setup default callback
+   callback = callback || null;
+   if(callback === null)
+   {
+      rval = [];
+      callback = function(s, p, o)
+      {
+         rval.push({'subject': Utils.lexicalFormTerm(s), 
+                    'predicate': Utils.lexicalFormTerm(p), 
+                    'object': Utils.lexicalFormTerm(o), 
+                    'graph': graph});
+      };
+   }
+   
+   // generate triples
+   var quit = false;
+   for(var i1 in normalized)
+   {
+      var e = normalized[i1];
+      var s = e['@id'];
+       if(s[0] == "_") {
+           s = {'token':'blank', 'value':s.split(":")[1]};
+       } else {
+           s = {'token':'uri', 'value':s};
+       }
+
+      for(var p in e)
+      {
+         if(p !== '@id')
+         {
+	     var obj = e[p];
+             if(obj.constructor !== Array)
+             {
+		 obj = [obj];
+             }
+            for(var i2 in obj)
+            {
+                var obji2 = obj[i2];
+		if(p === '@type' || p === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type') {
+		    p = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';
+                    obji2 = {'token':'uri', 'value':obji2};		    
+                } else if(typeof(obji2) === 'string') {
+                    obji2 = {'token': 'literal', 'value':obji2};
+                } else if(obji2['@id'] != null) {
+                    if(obji2['@id'][0] == "_") {
+                        obji2 = {'token':'blank', 'value':obji2['@id'].split(":")[1]};
+                    } else {
+                        obji2 = {'token':'uri', 'value':obji2['@id']};
+                    }
+                } else if(obji2['@type'] != null) {
+                    obji2 = {'token':'literal', 'value':obji2['@literal'], 'type':obji2['@type']};
+                } else if(obji2['@language'] != null) {
+                    obji2 = {'token':'literal', 'value':obji2['@literal'], 'lang':obji2['@language']};
+                }
+
+		quit = (callback(s, {'token':'uri', 'value':p}, obji2) === false);
+		if(quit)
+		{
+                    break;
+		}
+            }
+            if(quit)
+            {
+               break;
+            }
+         }
+      }
+      if(quit)
+      {
+         break;
+      }
+   }
+   
+   return rval;
+};
+
+/**
+ * Resolves external @context URLs. Every @context URL in the given JSON-LD
+ * object is resolved using the given URL-resolver function. Once all of
+ * the @contexts have been resolved, the given result callback is invoked.
+ * 
+ * @param input the JSON-LD input object (or array).
+ * @param resolver the resolver method that takes a URL and a callback that
+ *           receives a JSON-LD serialized @context or null on error (with
+ *           optional an error object as the second parameter).
+ * @param callback the callback to be invoked with the fully-resolved
+ *           JSON-LD output (object or array) or null on error (with an
+ *           optional error array as the second parameter).
+ */
+jsonld.resolve = function(input, resolver, callback)
+{
+   // find all @context URLs
+   var urls = {};
+   var findUrls = function(input, replace)
+   {
+      if(input.constructor === Array)
+      {
+         for(var i in input)
+         {
+            findUrls(input[i]);
+         }
+      }
+      else if(input.constructor === Object)
+      {
+         for(var key in input)
+         {
+            if(key === '@context')
+            {
+               // @context is an array that might contain URLs
+               if(input[key].constructor === Array)
+               {
+                  var list = input[key];
+                  for(var i in list)
+                  {
+                     if(list[i].constructor === String)
+                     {
+                        // replace w/resolved @context if appropriate
+                        if(replace)
+                        {
+                           list[i] = urls[list[i]];
+                        }
+                        // unresolved @context found
+                        else
+                        {
+                           urls[list[i]] = {};
+                        }
+                     }
+                  }
+               }
+               else if(input[key].constructor === String)
+               {
+                  // replace w/resolved @context if appropriate
+                  if(replace)
+                  {
+                     input[key] = urls[input[key]];
+                  }
+                  // unresolved @context found
+                  else
+                  {
+                     urls[input[key]] = {};
+                  }
+               }
+            }
+         }
+      }
+   };
+   findUrls(input, false);
+   
+   // state for resolving URLs
+   var count = Object.keys(urls).length;
+   var errors = null;
+   
+   if(count === 0)
+   {
+      callback(input, errors);
+   }
+   else
+   {
+      // resolve all URLs
+      for(var url in urls)
+      {
+         resolver(url, function(result, error)
+         {
+            --count;
+            
+            if(result === null)
+            {
+               errors = errors || [];
+               errors.push({ url: url, error: error });
+            }
+            else
+            {
+               try
+               {
+                  if(result.constructor === String)
+                  {
+                     urls[url] = JSON.parse(result)['@context'];
+                  }
+                  else
+                  {
+                     urls[url] = result['@context'];
+                  }
+               }
+               catch(ex)
+               {
+                  errors = errors || [];
+                  errors.push({ url: url, error: ex });
+               }
+            }
+            
+            if(count === 0)
+            {
+               if(errors === null)
+               {
+                  findUrls(input, true);
+               }
+               callback(input, errors);
+            }
+         });
+      }
+   }
+};
+
+// TODO: organizational rewrite
+
+/**
+ * Constructs a new JSON-LD processor.
+ */
+var Processor = function()
+{
+};
+
+/**
+ * Recursively compacts a value. This method will compact IRIs to prefixes or
+ * terms and do reverse type coercion to compact a value.
+ *
+ * @param ctx the context to use.
+ * @param property the property that points to the value, NULL for none.
+ * @param value the value to compact.
+ * @param usedCtx a context to update if a value was used from "ctx".
+ *
+ * @return the compacted value.
+ */
+Processor.prototype.compact = function(ctx, property, value, usedCtx)
+{
+   var rval;
+   
+   // get JSON-LD keywords
+   var keywords = _getKeywords(ctx);
+   
+   if(value === null)
+   {
+      // return null, but check coerce type to add to usedCtx
+      rval = null;
+      this.getCoerceType(ctx, property, usedCtx);
+   }
+   else if(value.constructor === Array)
+   {
+      // recursively add compacted values to array
+      rval = [];
+      for(var i in value)
+      {
+         rval.push(this.compact(ctx, property, value[i], usedCtx));
+      }
+   }
+   // graph literal/disjoint graph
+   else if(
+      value.constructor === Object &&
+      '@id' in value && value['@id'].constructor === Array)
+   {
+      rval = {};
+      rval[keywords['@id']] = this.compact(
+         ctx, property, value['@id'], usedCtx);
+   }
+   // recurse if value is a subject
+   else if(_isSubject(value))
+   {
+      // recursively handle sub-properties that aren't a sub-context
+      rval = {};
+      for(var key in value)
+      {
+         if(value[key] !== '@context')
+         {
+            // set object to compacted property, only overwrite existing
+            // properties if the property actually compacted
+            var p = _compactIri(ctx, key, usedCtx);
+            if(p !== key || !(p in rval))
+            {
+               // FIXME: clean old values from the usedCtx here ... or just
+               // change usedCtx to be built at the end of processing?
+               rval[p] = this.compact(ctx, key, value[key], usedCtx);
+            }
+         }
+      }
+   }
+   else
+   {
+      // get coerce type
+      var coerce = this.getCoerceType(ctx, property, usedCtx);
+      
+      // get type from value, to ensure coercion is valid
+      var type = null;
+      if(value.constructor === Object)
+      {
+         // type coercion can only occur if language is not specified
+         if(!('@language' in value))
+         {
+            // type must match coerce type if specified
+            if('@type' in value)
+            {
+               type = value['@type'];
+            }
+            // type is ID (IRI)
+            else if('@id' in value)
+            {
+               type = '@id';
+            }
+            // can be coerced to any type
+            else
+            {
+               type = coerce;
+            }
+         }
+      }
+      // type can be coerced to anything
+      else if(value.constructor === String)
+      {
+         type = coerce;
+      }
+
+      // types that can be auto-coerced from a JSON-builtin
+      if(coerce === null &&
+         (type === xsd['boolean'] || type === xsd['integer'] ||
+         type === xsd['double']))
+      {
+         coerce = type;
+      }
+
+      // do reverse type-coercion
+      if(coerce !== null)
+      {
+         // type is only null if a language was specified, which is an error
+         // if type coercion is specified
+         if(type === null)
+         {
+            throw {
+               message: 'Cannot coerce type when a language is specified. ' +
+                  'The language information would be lost.'
+            };
+         }
+         // if the value type does not match the coerce type, it is an error
+         else if(type !== coerce)
+         {
+            throw new Exception({
+               message: 'Cannot coerce type because the type does ' +
+                  'not match.',
+               type: type,
+               expected: coerce
+            });
+         }
+         // do reverse type-coercion
+         else
+         {
+            if(value.constructor === Object)
+            {
+               if('@id' in value)
+               {
+                  rval = value['@id'];
+               }
+               else if('@literal' in value)
+               {
+                  rval = value['@literal'];
+               }
+            }
+            else
+            {
+               rval = value;
+            }
+
+            // do basic JSON types conversion
+            if(coerce === xsd['boolean'])
+            {
+               rval = (rval === 'true' || rval != 0);
+            }
+            else if(coerce === xsd['double'])
+            {
+               rval = parseFloat(rval);
+            }
+            else if(coerce === xsd['integer'])
+            {
+               rval = parseInt(rval);
+            }
+         }
+      }
+      // no type-coercion, just change keywords/copy value
+      else if(value.constructor === Object)
+      {
+         rval = {};
+         for(var key in value)
+         {
+            rval[keywords[key]] = value[key];
+         }
+      }
+      else
+      {
+         rval = _clone(value);
+      }
+
+      // compact IRI
+      if(type === '@id')
+      {
+         if(rval.constructor === Object)
+         {
+            rval[keywords['@id']] = _compactIri(
+               ctx, rval[keywords['@id']], usedCtx);
+         }
+         else
+         {
+            rval = _compactIri(ctx, rval, usedCtx);
+         }
+      }
+   }
+
+   return rval;
+};
+
+/**
+ * Recursively expands a value using the given context. Any context in
+ * the value will be removed.
+ *
+ * @param ctx the context.
+ * @param property the property that points to the value, NULL for none.
+ * @param value the value to expand.
+ *
+ * @return the expanded value.
+ */
+Processor.prototype.expand = function(ctx, property, value)
+{
+   var rval;
+   
+   // TODO: add data format error detection?
+   
+   // value is null, nothing to expand
+   if(value === null)
+   {
+      rval = null;
+   }
+   // if no property is specified and the value is a string (this means the
+   // value is a property itself), expand to an IRI
+   else if(property === null && value.constructor === String)
+   {
+      rval = _expandTerm(ctx, value, null);
+   }
+   else if(value.constructor === Array)
+   {
+      // recursively add expanded values to array
+      rval = [];
+      for(var i in value)
+      {
+         rval.push(this.expand(ctx, property, value[i]));
+      }
+   }
+   else if(value.constructor === Object)
+   {
+      // if value has a context, use it
+      if('@context' in value)
+      {
+         ctx = jsonld.mergeContexts(ctx, value['@context']);
+      }
+      
+      // recursively handle sub-properties that aren't a sub-context
+      rval = {};
+      for(var key in value)
+      {
+         // preserve frame keywords
+         if(key === '@embed' || key === '@explicit' ||
+            key === '@default' || key === '@omitDefault')
+         {
+            _setProperty(rval, key, _clone(value[key]));
+         }
+         else if(key !== '@context')
+         {
+

<TRUNCATED>