[jboss-cvs] JBossBlog SVN: r46 - in trunk-esial/blog-core/src: web/WEB-INF and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Feb 4 05:05:43 EST 2007


Author: acrignon
Date: 2007-02-04 05:05:42 -0500 (Sun, 04 Feb 2007)
New Revision: 46

Added:
   trunk-esial/blog-core/src/java/org/jboss/blog/recommendBlog.java
   trunk-esial/blog-core/src/web/views/recommend.xhtml
Modified:
   trunk-esial/blog-core/src/web/WEB-INF/faces-config.xml
   trunk-esial/blog-core/src/web/views/blog_view.xhtml
Log:
recommend fonction added (with a java class)

Added: trunk-esial/blog-core/src/java/org/jboss/blog/recommendBlog.java
===================================================================
--- trunk-esial/blog-core/src/java/org/jboss/blog/recommendBlog.java	                        (rev 0)
+++ trunk-esial/blog-core/src/java/org/jboss/blog/recommendBlog.java	2007-02-04 10:05:42 UTC (rev 46)
@@ -0,0 +1,51 @@
+package org.jboss.blog;
+
+public class recommendBlog {
+	
+	private String lastname;
+	private String firstname;
+	private String mail;
+	private String comment="default comment";
+	
+	public recommendBlog(){
+		
+	}
+	
+	public void setLastname(String lastname) {
+		this.lastname = lastname;
+	}
+	public String getLastname() {
+		return lastname;
+	}
+
+	public void setFirstname(String firstname) {
+		this.firstname = firstname;
+	}
+
+	public String getFirstname() {
+		return firstname;
+	}
+
+	public void setMail(String mail) {
+		this.mail = mail;
+	}
+
+	public String getMail() {
+		return mail;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+	
+	public String recommendation(){
+		return "mailto"+this.getMail()+"?subject="+this.getFirstname()+" "+this.getLastname()+" recommend a blog to you!"+"&body="+this.getComment();
+	}
+
+	
+
+}

Modified: trunk-esial/blog-core/src/web/WEB-INF/faces-config.xml
===================================================================
--- trunk-esial/blog-core/src/web/WEB-INF/faces-config.xml	2007-02-03 14:31:17 UTC (rev 45)
+++ trunk-esial/blog-core/src/web/WEB-INF/faces-config.xml	2007-02-04 10:05:42 UTC (rev 46)
@@ -79,6 +79,12 @@
         <managed-bean-name>state</managed-bean-name>
         <managed-bean-class>org.jboss.blog.ui.State</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
+    </managed-bean>
+    
+    <managed-bean>
+        <managed-bean-name>reco</managed-bean-name>
+        <managed-bean-class>org.jboss.blog.recommendBlog</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
 
     <!-- Post/ blog view -->
@@ -96,6 +102,14 @@
             <from-outcome>post_view</from-outcome>
             <to-view-id>/views/post_view.xhtml</to-view-id>
         </navigation-case>
+    </navigation-rule>
+    
+    <navigation-rule>
+        <from-view-id>*</from-view-id>
+        <navigation-case>
+            <from-outcome>recommend</from-outcome>
+            <to-view-id>/views/recommend.xhtml</to-view-id>
+        </navigation-case>
     </navigation-rule>
 
     <!-- Post edit/new/del -->

Modified: trunk-esial/blog-core/src/web/views/blog_view.xhtml
===================================================================
--- trunk-esial/blog-core/src/web/views/blog_view.xhtml	2007-02-03 14:31:17 UTC (rev 45)
+++ trunk-esial/blog-core/src/web/views/blog_view.xhtml	2007-02-04 10:05:42 UTC (rev 46)
@@ -71,7 +71,10 @@
         </h:dataTable>
         </h:form>
 
-        <h:form>
+        <h:form>
+        
+        	<h:panelGrid columns="3">
+        
             <h:panelGroup rendered="#{blogView.hasPrevious}">
                 <h:commandLink action="#{blogView.previous}">&lt;&lt; Previous</h:commandLink>
                 &#160;
@@ -79,7 +82,11 @@
             
             <h:panelGroup rendered="#{blogView.hasNext}">
                 <h:commandLink action="#{blogView.next}">Next &gt;&gt;</h:commandLink>
-            </h:panelGroup>
+            </h:panelGroup>
+            
+            <h:commandLink action="recommend">Recommend this blog</h:commandLink>
+            
+            </h:panelGrid>
         </h:form>
     </ui:define>
 </ui:composition>

Added: trunk-esial/blog-core/src/web/views/recommend.xhtml
===================================================================
--- trunk-esial/blog-core/src/web/views/recommend.xhtml	                        (rev 0)
+++ trunk-esial/blog-core/src/web/views/recommend.xhtml	2007-02-04 10:05:42 UTC (rev 46)
@@ -0,0 +1,37 @@
+<div  xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:c="http://java.sun.com/jstl/core"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:blog="http://www.jboss.org/portal/jbossblog">
+      
+<ui:composition template="view.xhtml">
+
+	<ui:define name="viewmain">
+	
+		<h:form>
+		
+			<h:panelGrid columns="2">
+			
+				<h:outputText value="Your lastname: "/>
+				<h:inputText value="#{reco.lastname}" required="true" maxlength="255" size="32"/>
+				
+				<h:outputText value="Your firstname: "/>
+				<h:inputText value="#{reco.firstname}" required="true" maxlength="255" size="32"/>
+				
+				<h:outputText value="Your friend's mail: "/>
+				<h:inputText value="#{reco.mail}" required="true" maxlength="255" size="32"/>
+				
+				<h:outputText value="Your comment: "/>
+				<h:inputTextarea value="#{reco.comment}" required="true" rows="5" cols="32" maxlength="255"/>
+				
+				<h:commandLink value="Send recommendation mail" action="{reco.recommendation}"/>
+			
+			</h:panelGrid>
+		
+		</h:form>
+		
+	</ui:define>
+	
+</ui:composition>
+</div>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list