forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r159554 - in forrest/trunk/plugins/org.apache.forrest.plugin.views: resources/templates/feeder.ft src/documentation/default.fv
Date Thu, 31 Mar 2005 01:26:28 GMT
Author: thorsten
Date: Wed Mar 30 17:26:28 2005
New Revision: 159554

URL: http://svn.apache.org/viewcvs?view=rev&rev=159554
Log:
enhanced the feeder contract

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feeder.ft
    forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feeder.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feeder.ft?view=diff&r1=159553&r2=159554
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feeder.ft (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/resources/templates/feeder.ft Wed
Mar 30 17:26:28 2005
@@ -32,32 +32,88 @@
         
         <xsl:template name="feeder-css">
 #feeder {
+	width: 23%;
+	display: block;
+	margin: 10px 0 0 0;
+	padding: 0;
+	background: #E0E9E9;
+	float: right;
     color: black;
-    background: #CFDCED;
+    /*background: #CFDCED;*/
     text-align:center;
     margin-top: 5px;
 }
+.channelTitle {
+	background: #EDF2F2;
+	text-decoration: none;
+	font-size: 10pt;
+	font-family: verdana, helvetica, sans;
+  color: #000066;
+  padding: 5px;
+}
+.channelItems {
+	background: #D9E4E4;
+	text-decoration: none;
+	font-size: 10pt;
+	font-family: verdana, helvetica, sans;
+	color: #000066;
+  padding: 5px;
 }</xsl:template>
         
 	    <xsl:template name="feeder-body" >
 	      <xsl:param name="feeder"/>
-				<xsl:apply-templates select="$feeder"/>		    
+        <xsl:param name="feedConfig"/>
+        <xsl:copy-of select="$feedConfig"/>
+				<xsl:apply-templates select="$feeder/rss">
+          <xsl:with-param name="feedConfig" select="$feedConfig"/>
+				</xsl:apply-templates>		    
 			</xsl:template>
       
       <xsl:template match="rss">
+        <xsl:param name="feedConfig"/>
         <div id="feeder">
-		      <h1><xsl:value-of select="channel/title"/></h1>
-		     <p><xsl:apply-templates select="channel/item"/></p>
+		     <xsl:apply-templates select="channel">
+          <xsl:with-param name="feedConfig" select="$feedConfig"/>
+		     </xsl:apply-templates>
 		    </div>
       </xsl:template>
-      <xsl:template match="item">
-  <section>
-    <b><xsl:value-of select="title" disable-output-escaping="yes"/></b>
-    <p><a href="{link}"><xsl:value-of select="link"/></a></p>
-    <!--<p><xsl:value-of select="description" disable-output-escaping="yes"/></p>-->
-  </section>
-</xsl:template>
       
+      <xsl:template match="channel">
+        <xsl:param name="feedConfig"/>
+        <div class="channelTitle">
+          <xsl:value-of select="title"/>
+        </div>
+        <div class="channelItems">
+          <xsl:apply-templates select="item">
+            <xsl:with-param name="feedConfig" select="$feedConfig"/>
+          </xsl:apply-templates>
+        </div>
+      </xsl:template>
+      
+      <xsl:template match="item">
+        <xsl:param name="feedConfig"/>
+
+        <xsl:variable name="parse">
+          <xsl:if test="$feedConfig/feed[@position]">
+            <xsl:value-of select="position()"/><xsl:value-of select="$feedConfig/feed/@position"/>
+					</xsl:if>
+          <div class="itemTitle"><xsl:value-of select="title" disable-output-escaping="yes"/></div>
+      		<div class="itemLink"><a href="{link}">...more</a></div>
+        </xsl:variable>
+        
+        <xsl:choose>
+          <xsl:when test="$feedConfig/feed[@maxItem]">
+            <xsl:if test="position()&lt;=$feedConfig/feed/@maxItem">
+							<xsl:copy-of select="$parse"/>            
+						</xsl:if>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$parse"/>
+          </xsl:otherwise>
+        </xsl:choose>
+			</xsl:template>
+    
     </xsl:stylesheet>
+    
 	</forrest:template>
 </forrest:contract>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv
URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv?view=diff&r1=159553&r2=159554
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.views/src/documentation/default.fv Wed
Mar 30 17:26:28 2005
@@ -24,22 +24,13 @@
   <forrest:hook name="container">
     <forrest:hook name="branding">
 			<forrest:contract name="projectlogo"/>
-      <forrest:contract name="grouplogo"/>
+      <!--<forrest:contract name="grouplogo"/>-->
       <forrest:contract name="searchbox"/>
       <forrest:contract name="nav-main"/>
       <!--<forrest:contract name="nav-main-sub"/>-->
     </forrest:hook>
     <forrest:hook name="spacer" />
     <forrest:contract name="nav"/>
-    <forrest:contract name="content"/>
-	    <!--<forrest:contract name="fontsize"/>-->
-			<!--<forrest:hook name="export-link">
-	      <forrest:contract name="txt-link"/>
-		    <forrest:contract name="xml-link"/>
-			</forrest:hook>
-	  </forrest:contract>-->
-  </forrest:hook>
-  <forrest:hook name="feedboxes">
     <forrest:contract name="feeder">
       <forrest:properties contract="feeder">
         <forrest:property name="feeder" nugget="get.nugget.feeder">
@@ -53,11 +44,29 @@
           </feedDescriptor>
         </forrest:property>
         <forrest:property name="feedConfig">
-          <feed id="planetJava" maxItem="10" descr="false"/>
+          <feed maxItem="1" descr="false"/>
         </forrest:property>
       </forrest:properties>
     </forrest:contract>
+    <forrest:contract name="content">
+	    <forrest:contract name="fontsize"/>
+        <!--
+			<forrest:hook name="export-link">
+	      <forrest:contract name="txt-link"/>
+		    <forrest:contract name="xml-link"/>
+        <!-#-<forrest:contract name="pdf-link"/>-#->
+			</forrest:hook>-->
+	  </forrest:contract>
   </forrest:hook>
-  <forrest:contract name="feedback"/>
+  <forrest:contract name="feedback-dyn">
+	  <forrest:properties contract="feedback-dyn">
+      <forrest:property name="main">
+	    <feedback to="webmaster@target-x.com" href="mailto:webmaster@foo.com?subject=Feedback&#160;"
>
+		    Send DYNAMIC feedback about the website to:
+		  </feedback>
+  	</forrest:property>
+    </forrest:properties>
+  </forrest:contract>
+
   
 </forrest:view>



Mime
View raw message