Author: reto
Date: Sat Apr  9 13:22:14 2011
New Revision: 1090586

URL: http://svn.apache.org/viewvc?rev=1090586&view=rev
Log:
no longer claiming that a Sesame frontend adaptor exists

Modified:
    incubator/clerezza/site/trunk/graph.nt
    incubator/clerezza/site/trunk/readme.txt
    incubator/clerezza/site/trunk/src/main/scala/Activator.scala

Modified: incubator/clerezza/site/trunk/graph.nt
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/site/trunk/graph.nt?rev=1090586&r1=1090585&r2=1090586&view=diff
==============================================================================
--- incubator/clerezza/site/trunk/graph.nt (original)
+++ incubator/clerezza/site/trunk/graph.nt Sat Apr  9 13:22:14 2011
@@ -1,6 +1,6 @@
 <http://localhost:8080/> <http://clerezza.org/2009/09/hierarchy#members> 
_:2d7f383e72651f1469e7dd5b4e9f08701 . 
 <http://localhost:8080/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://clerezza.org/2009/09/hierarchy#Collection> .
-<http://localhost:8080/content-el/0> <http://discobits.org/ontology#infoBit> 
"<div xmlns=\"http://www.w3.org/1999/xhtml\"; class=\"column 
one-column\">\n\t\t\t\tClerezza is a service platform based on OSGi (Open 
Services Gateway initiative) which provides a set of functionality for 
management of semantically linked data accessable through RESTful Web Services 
and in a secured way.\n\t\t\t\tFurthermore, Clerezza allows to easily develop 
semantic web applications by providing tools to manipulate RDF data, create 
RESTful Web Services and Renderlets using 
ScalaServerPages.\n\t\t\t\t<br></br>\n\t\t\t\t<br></br>Contents are stored as 
triples based on <a href=\"http://www.w3.org/TR/2004/REC-rdf-primer-20040210/\"; 
target=\"_blank\">W3C RDF specification</a>. These triples are stored via 
Clerezza\u2019s Smart Content Binding (SCB). SCB defines a technology-agnostic 
layer to access and modify triple stores. It provides a java implementation of 
the graph data model specified by W3C RDF 
 and functionalities to operate on that data model. SCB offers a service 
interface to access multiple named graphs and it can use various weighted 
providers to manage RDF graphs in a technology specific manner, e.g., using 
Jena  or Sesame. It also provides for adaptors that allow an application to use 
Jena or Sesame APIs to process RDF graphs. Furthermore, SCB offers a 
serialization and a parsing service to convert a graph into a certain 
representation (format) and vice 
versa.\n\t\t\t</div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
+<http://localhost:8080/content-el/0> <http://discobits.org/ontology#infoBit> 
"<div xmlns=\"http://www.w3.org/1999/xhtml\"; class=\"column 
one-column\">\n\t\t\t\tClerezza is a service platform based on OSGi (Open 
Services Gateway initiative) which provides a set of functionality for 
management of semantically linked data accessable through RESTful Web Services 
and in a secured way.\n\t\t\t\tFurthermore, Clerezza allows to easily develop 
semantic web applications by providing tools to manipulate RDF data, create 
RESTful Web Services and Renderlets using 
ScalaServerPages.\n\t\t\t\t<br></br>\n\t\t\t\t<br></br>Contents are stored as 
triples based on <a href=\"http://www.w3.org/TR/2004/REC-rdf-primer-20040210/\"; 
target=\"_blank\">W3C RDF specification</a>. These triples are stored via 
Clerezza\u2019s Smart Content Binding (SCB). SCB defines a technology-agnostic 
layer to access and modify triple stores. It provides a java implementation of 
the graph data model specified by W3C RDF 
 and functionalities to operate on that data model. SCB offers a service 
interface to access multiple named graphs and it can use various weighted 
providers to manage RDF graphs in a technology specific manner, e.g., using 
Jena  or Sesame. It also provides for adaptors that allow an application to use 
various APIs (including the Jena api) to process RDF graphs. Furthermore, SCB 
offers a serialization and a parsing service to convert a graph into a certain 
representation (format) and vice 
versa.\n\t\t\t</div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
 <http://localhost:8080/content-el/0> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://discobits.org/ontology#XHTMLInfoDiscoBit> .
 <http://localhost:8080/content-el/1-content-el/0> 
<http://discobits.org/ontology#infoBit> "Apache Clerezza allows to easily 
develop semantic web application by providing the following:<ul 
xmlns=\"http://www.w3.org/1999/xhtml\";><li>An API to access RDF 
Graphs</li><li>A Jax RS implementation</li><li>TypeHandlers: Jax-RS resources 
bound to an RDF type</li><li>Renderlets to create various represenattions from 
RDF resources, ScalaServerPages allow to easily write renderlets in 
Scala</li></ul>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
 <http://localhost:8080/content-el/1-content-el/0> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://discobits.org/ontology#XHTMLInfoDiscoBit> .

Modified: incubator/clerezza/site/trunk/readme.txt
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/site/trunk/readme.txt?rev=1090586&r1=1090585&r2=1090586&view=diff
==============================================================================
--- incubator/clerezza/site/trunk/readme.txt (original)
+++ incubator/clerezza/site/trunk/readme.txt Sat Apr  9 13:22:14 2011
@@ -1,8 +1,7 @@
 - start clerezza on localhost:8080
-- install offline-generation bundle with: 
start("mvn:org.apache.clerezza/tools.offline")
-- install stable serialization bundle with: 
start("mvn:org.apache.clerezza/rdf.stable.serializer")
+
 - install the directoty with the site project (the directory containing this 
readme) with: Dev load "/path/to/apache/clerezza/site/trunk"
-- go to http://localhost:8080/graph/upload-form, replace 
http://tpf.localhost/content.graph with graph.nt (note: you may need to make 
sure your operating system or browser associated the file-extensison .nt to 
text/rdf+nt)
+- if your content graph was empty this should have automatically added the 
content, otherwise go to http://localhost:8080/graph/upload-form, replace 
http://tpf.localhost/content.graph with graph.nt
 - change the site as needed, do not create pages ending with /, create a page 
ending with /index instead, the entry page is http://localhost:8080/index (you 
may open http://localhost:8080/tools/editor with firefox to edit it)
 - retrieve a zipped offline version from 
http://localhost:8080/admin/offline/download?baseUri=http://localhost:8080/&targetUri=http://incubator.apache.org/clerezza/&formatExtension=xhtml&formatExtension=rdf&formatExtension=png&formatExtension=html&formatExtension=js&formatExtension=jpeg&rootLinkPrefix=/clerezza
 - scp site<id>.zip  people.apache.org:/www/incubator.apache.org/clerezza
@@ -23,4 +22,4 @@ import rdf.ontologies._
 import platform.graphprovider.content.ContentGraphProvider
 val cgp = $[ContentGraphProvider]
 val cg = cgp.getContentGraph
-cg.add(new TripleImpl(new UriRef("http://localhost:8080/getting-started/";), 
RDF.`type`, HIERARCHY.Collection))
+cg.add(new TripleImpl(new UriRef("http://localhost:8080/downloads/";), 
RDF.`type`, HIERARCHY.Collection))

Modified: incubator/clerezza/site/trunk/src/main/scala/Activator.scala
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/site/trunk/src/main/scala/Activator.scala?rev=1090586&r1=1090585&r2=1090586&view=diff
==============================================================================
--- incubator/clerezza/site/trunk/src/main/scala/Activator.scala (original)
+++ incubator/clerezza/site/trunk/src/main/scala/Activator.scala Sat Apr  9 
13:22:14 2011
@@ -3,6 +3,13 @@ package org.apache.clerezza.site
 import org.osgi.framework.{BundleActivator, BundleContext, ServiceRegistration}
 import scala.collection.JavaConversions.asJavaDictionary
 import org.apache.clerezza.platform.typerendering.{TypeRenderlet, 
RenderletManager}
+import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider
+import org.apache.clerezza.rdf.core.access.TcManager
+import org.apache.clerezza.osgi.services.ServicesDsl
+import org.apache.clerezza.platform.Constants
+import org.apache.clerezza.rdf.core.event.{GraphEvent, FilterTriple, 
GraphListener}
+import org.apache.clerezza.rdf.core.serializedform.{Serializer, 
SupportedFormat, Parser}
+import java.io.{FileOutputStream, FileInputStream, File}
 
 /**
  * Activator for a bundle using Apache Clerezza.
@@ -14,12 +21,42 @@ class Activator extends BundleActivator 
         * called when the bundle is started, this method initializes the 
provided service
         */
        def start(context: BundleContext) {
+               val servicesDsl = new ServicesDsl(context)
+               import servicesDsl._
 
                val renderlet = new HeadedPageRenderlet
                val serviceReference = 
context.getServiceReference(classOf[RenderletManager].getName)
                renderletRegistration = 
context.registerService(classOf[TypeRenderlet].getName,
                                                                                
                  renderlet, null)
-               println("enjoy it the site")
+               
context.installBundle("mvn:org.apache.clerezza/rdf.stable.serializer").start();
+               
context.installBundle("mvn:org.apache.clerezza/tools.offline").start();
+               val tcManager = $[TcManager]
+               val contentGraph = 
tcManager.getMGraph(Constants.CONTENT_GRAPH_URI)
+               val path = {
+                       val bl = context.getBundle.getLocation
+                       bl.substring(bl.indexOf(':')+1)
+               }
+               val graphFile = new File(new File(path), "graph.nt");
+               val fileGraph = $[Parser].parse(new FileInputStream(graphFile), 
SupportedFormat.N_TRIPLE)
+               if (contentGraph.size > fileGraph.size) {
+                       println("content graph if bigger than the graph from 
file, not replacing with the content from file and not " +
+                               "writing any data to the file, you should 
manually either write the content graph to the file or clear " +
+                               "the content graph. Restart this bundle after 
resolving the issue.")
+               } else {
+                       contentGraph.clear
+                       contentGraph.addAll(fileGraph)
+                       println("graph size: "+fileGraph.size)
+                       println(path)
+                       println("the content graph has benn replaced with 
"+graphFile)
+                       object graphListener extends GraphListener {
+                               val serializer = $[Serializer]
+                               override def graphChanged(events: 
java.util.List[GraphEvent]) {
+                                       serializer.serialize(new 
FileOutputStream(graphFile), contentGraph,SupportedFormat.N_TRIPLE)
+                               }
+                       }
+                       contentGraph.addGraphListener(graphListener, new 
FilterTriple(null, null, null), 2000)
+
+               }
        }
 
        /**


Reply via email to