clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1137198 - in /incubator/clerezza/trunk/parent/platform.style.default/src/main/scala: CollectionHeader.scala HeadedPageRenderlet.scala
Date Sat, 18 Jun 2011 14:59:07 GMT
Author: reto
Date: Sat Jun 18 14:59:07 2011
New Revision: 1137198

URL: http://svn.apache.org/viewvc?rev=1137198&view=rev
Log:
CLEREZZA-563: Better title for collections

Modified:
    incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/CollectionHeader.scala
    incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/HeadedPageRenderlet.scala

Modified: incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/CollectionHeader.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/CollectionHeader.scala?rev=1137198&r1=1137197&r2=1137198&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/CollectionHeader.scala
(original)
+++ incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/CollectionHeader.scala
Sat Jun 18 14:59:07 2011
@@ -1,6 +1,8 @@
 package org.apache.clerezza.platform.style.default
 
 import org.apache.clerezza.rdf.ontologies._
+import org.apache.clerezza.rdf.scala.utils.RichGraphNode
+import org.apache.clerezza.rdf.scala.utils.Preamble._
 
 /**
  * A Renderlet for the menu
@@ -9,4 +11,7 @@ class CollectionHeader extends HeadedPag
 
 	override val getRdfType = HIERARCHY.Collection
 
+	override def defaultTitle(res: RichGraphNode) = (res*) +  " (Collection)"
+
+
 }

Modified: incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/HeadedPageRenderlet.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/HeadedPageRenderlet.scala?rev=1137198&r1=1137197&r2=1137198&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/HeadedPageRenderlet.scala
(original)
+++ incubator/clerezza/trunk/parent/platform.style.default/src/main/scala/HeadedPageRenderlet.scala
Sat Jun 18 14:59:07 2011
@@ -3,6 +3,7 @@ package org.apache.clerezza.platform.sty
 import javax.ws.rs.core.MediaType
 import org.apache.clerezza.platform.typerendering._
 import org.apache.clerezza.rdf.core.UriRef
+import org.apache.clerezza.rdf.scala.utils.RichGraphNode
 import org.apache.clerezza.rdf.utils.GraphNode
 import org.apache.clerezza.rdf.ontologies._
 import org.apache.clerezza.rdf.core._
@@ -20,6 +21,8 @@ class HeadedPageRenderlet extends SRende
 
 	override def getModePattern = "(?!.*naked).*"
 
+	protected def defaultTitle(res: RichGraphNode) = "An incomplete titled content "+(res/DISCOBITS.contains*)
+
 	override def renderedPage(arguments: XmlResult.Arguments) = {
 		new XmlResult(arguments) {
 			def menuLink(href: String, label: String) =
@@ -40,7 +43,7 @@ resultDocModifier.addScriptReference("/s
 	<head>
 		{(res/DISCOBITS.contains).find(e => ((e/DISCOBITS.pos*) == "0")) match {
 				case Some(e) => <title>{render(e/DISCOBITS.holds, "naked")}</title>
-				case None => <title>An incomplete titled content {res/DISCOBITS.contains*}</title>
+				case None => <title>{defaultTitle(res)}</title>
 			}
 		}
 	</head>



Mime
View raw message