Author: reto
Date: Sat Apr  9 13:36:40 2011
New Revision: 1090590

URL: http://svn.apache.org/viewvc?rev=1090590&view=rev
Log:
reduced steps in readme by doing more in the activator

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

Modified: incubator/clerezza/site/trunk/readme.txt
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/site/trunk/readme.txt?rev=1090590&r1=1090589&r2=1090590&view=diff
==============================================================================
--- incubator/clerezza/site/trunk/readme.txt (original)
+++ incubator/clerezza/site/trunk/readme.txt Sat Apr  9 13:36:40 2011
@@ -1,13 +1,15 @@
 - start clerezza on localhost:8080
 
 - install the directoty with the site project (the directory containing this 
readme) with: Dev load "/path/to/apache/clerezza/site/trunk"
-- 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
+- if all goes well you'll now see the contents of the clerezza site on your 
local instance, the content-graph is regularly written to the graph.nt file
 - 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)
+- commit the changed graph.nt to subversion
+
+Currently it is necessary to manually upload the site as follows
 - 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
 - on people.apache.org: unzip -o site<id>.zip
 - get the content, e.g. with: curl -u admin:admin -H "Accept: text/rdf+nt" 
http://localhost:8080/graph?name=http://tpf.localhost/content.graph > graph.nt
-- replace the file graph.nt in site/trunk of the subversion repository
 
 
 NOTES:

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=1090590&r1=1090589&r2=1090590&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:36:40 2011
@@ -17,6 +17,8 @@ import java.io.{FileOutputStream, FileIn
 class Activator extends BundleActivator {
 
        var renderletRegistration: ServiceRegistration = null
+       var graphListenerOption: Option[GraphListener] = null
+
        /**
         * called when the bundle is started, this method initializes the 
provided service
         */
@@ -25,7 +27,6 @@ class Activator extends BundleActivator 
                import servicesDsl._
 
                val renderlet = new HeadedPageRenderlet
-               val serviceReference = 
context.getServiceReference(classOf[RenderletManager].getName)
                renderletRegistration = 
context.registerService(classOf[TypeRenderlet].getName,
                                                                                
                  renderlet, null)
                
context.installBundle("mvn:org.apache.clerezza/rdf.stable.serializer").start();
@@ -42,11 +43,10 @@ class Activator extends BundleActivator 
                        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.")
+                       graphListenerOption = None
                } 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]
@@ -55,7 +55,8 @@ class Activator extends BundleActivator 
                                }
                        }
                        contentGraph.addGraphListener(graphListener, new 
FilterTriple(null, null, null), 2000)
-
+                       graphListenerOption = Some(graphListener)
+                       println("A GraphLIstener has been added that writes 
changes to the content graph to graph.nt")
                }
        }
 
@@ -64,6 +65,13 @@ class Activator extends BundleActivator 
         */
        def stop(context: BundleContext) {
                renderletRegistration.unregister()
+               val servicesDsl = new ServicesDsl(context)
+               import servicesDsl._
+               val tcManager = $[TcManager]
+               val contentGraph = 
tcManager.getMGraph(Constants.CONTENT_GRAPH_URI)
+               graphListenerOption match {
+                       case Some(l) => contentGraph.removeGraphListener(l)
+               }
                println("bye")
        }
 


Reply via email to