forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twilli...@apache.org
Subject svn commit: r953200 - in /forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9: Main.scala Pipeline.scala filters/Filter.scala filters/OutputTypeFilter.scala task/BuildTask.scala task/InitTask.scala
Date Thu, 10 Jun 2010 02:35:08 GMT
Author: twilliams
Date: Thu Jun 10 02:35:08 2010
New Revision: 953200

URL: http://svn.apache.org/viewvc?rev=953200&view=rev
Log:
Change to site command and fix hang when new proj creation declined.

Modified:
    forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Main.scala
    forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Pipeline.scala
    forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/Filter.scala
    forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/OutputTypeFilter.scala
    forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/BuildTask.scala
    forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/InitTask.scala

Modified: forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Main.scala
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Main.scala?rev=953200&r1=953199&r2=953200&view=diff
==============================================================================
--- forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Main.scala (original)
+++ forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Main.scala Thu Jun 10
02:35:08 2010
@@ -54,7 +54,7 @@ object Main {
 	 	 	state = retState
 	 	  case "exit" =>
 	 	 	Pipeline.exit
-	 	    return
+	 	 	return 	    
 	 	  case _ =>
 	 	    println("unknown(" + state + ").")
 	 	    state = retState

Modified: forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Pipeline.scala
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Pipeline.scala?rev=953200&r1=953199&r2=953200&view=diff
==============================================================================
--- forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Pipeline.scala (original)
+++ forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/Pipeline.scala Thu Jun
10 02:35:08 2010
@@ -20,6 +20,8 @@ import java.io.File
 import org.apache.forrest.f9.filters._
 
 object Pipeline {
+	  var started = false
+	  
 	  val pipeline:List[Filter] = List(
 	 		  new SourceLocatorFilter(new File(".")),
 	 		  new SourceTypeFilter(),
@@ -28,10 +30,12 @@ object Pipeline {
 	 		  
 	def init() {
       pipeline.foreach(p => p.start)
+      started = true
 	}
 	  
 	def exit() {
-	  pipeline.foreach(p => p ! "exit_now")
+	  if(started == true) 
+	    pipeline.foreach(p => p ! "exit_now")
 	}
 	
 	def pump(r: Map[String,Any]) {

Modified: forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/Filter.scala
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/Filter.scala?rev=953200&r1=953199&r2=953200&view=diff
==============================================================================
--- forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/Filter.scala
(original)
+++ forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/Filter.scala
Thu Jun 10 02:35:08 2010
@@ -23,6 +23,7 @@ import scala.xml.Elem
 trait Filter extends Actor {
     
 	def act() {
+	  init_hook()
 	  loop {
 	   react {
 	     case (model: Map[String, Any], p: List[Filter]) if p.length == 0 =>
@@ -45,4 +46,5 @@ trait Filter extends Actor {
 	}
 	def process(model: Map[String, Any]): Map[String, Any] 
 	def exit_hook() {}
+	def init_hook() {}
 }

Modified: forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/OutputTypeFilter.scala
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/OutputTypeFilter.scala?rev=953200&r1=953199&r2=953200&view=diff
==============================================================================
--- forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/OutputTypeFilter.scala
(original)
+++ forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/filters/OutputTypeFilter.scala
Thu Jun 10 02:35:08 2010
@@ -20,7 +20,6 @@ package org.apache.forrest.f9.filters
 class OutputTypeFilter(base: String) extends Filter {
 	val supportedTypes = Map("application/xhtml+xml"->new HtmlFileSink(base))
 
-	supportedTypes.values.foreach(t => t.start)
 	
  	def process(model: Map[String, Any]) = {
  		println("Attempting output for: " + model("resourceUri"))
@@ -41,4 +40,7 @@ class OutputTypeFilter(base: String) ext
 	override def exit_hook() {
 		supportedTypes.values.foreach(t => t ! "exit_now")
 	}
+	override def init_hook() {
+		supportedTypes.values.foreach(t => t.start)
+	}
 }
\ No newline at end of file

Modified: forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/BuildTask.scala
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/BuildTask.scala?rev=953200&r1=953199&r2=953200&view=diff
==============================================================================
--- forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/BuildTask.scala
(original)
+++ forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/BuildTask.scala
Thu Jun 10 02:35:08 2010
@@ -22,7 +22,7 @@ import org.apache.commons.io.FileUtils
 /**
  * Task to actually build the content through the pipeline.
  */
-object BuildTask extends Task("build", false) {
+object BuildTask extends Task("site", false) {
 	var base: File = null
 		
 	def call(state: AppState):Boolean = {

Modified: forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/InitTask.scala
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/InitTask.scala?rev=953200&r1=953199&r2=953200&view=diff
==============================================================================
--- forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/InitTask.scala (original)
+++ forrest/trunk/whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/InitTask.scala Thu
Jun 10 02:35:08 2010
@@ -51,6 +51,7 @@ object InitTask extends Task("init", tru
 			case _ =>
 			  println("ok(valid).")
 		}
+
 		Pipeline.init
 		state.state += ("initialized"->true)
 		return true



Mime
View raw message