[richfaces-svn-commits] JBoss Rich Faces SVN: r4878 - in trunk: framework/impl/src/main/java/org/ajax4jsf/org/w3c/tidy and 7 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Dec 17 17:48:55 EST 2007


Author: alexsmirnov
Date: 2007-12-17 17:48:55 -0500 (Mon, 17 Dec 2007)
New Revision: 4878

Added:
   trunk/samples/ajaxPortlet/src/main/webapp/includes/
   trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml
   trunk/samples/ajaxPortlet/src/main/webapp/richfaces/
   trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml
Modified:
   trunk/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java
   trunk/framework/impl/src/main/java/org/ajax4jsf/org/w3c/tidy/Node.java
   trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml
   trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
   trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
   trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml
   trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
   trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
   trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
Log:
Create RichFaces components sample portlet.
Fix http://jira.jboss.com/jira/browse/RF-1603  and http://jira.jboss.com/jira/browse/RF-1012

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java	2007-12-17 22:48:55 UTC (rev 4878)
@@ -67,8 +67,9 @@
 					.getInstance();
 			ParserState state = stateManager.getInitialState();
 			ParsingContext context = new ParsingContext(out);
-			char c;
-			while ((c = (char) in.read()) > 0) {
+			int nextChar;
+			while ((nextChar = in.read()) > 0) {
+				char c = (char)nextChar;
 				state = state.getNextState(c, context);
 				if (log.isDebugEnabled()) {
 					// Find state name.

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/org/w3c/tidy/Node.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/org/w3c/tidy/Node.java	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/org/w3c/tidy/Node.java	2007-12-17 22:48:55 UTC (rev 4878)
@@ -1554,7 +1554,7 @@
         for (attr = this.attributes; attr != null; attr = attr.next)
         {
             if (("language".equalsIgnoreCase(attr.attribute) || "type".equalsIgnoreCase(attr.attribute))
-                && "javascript".equalsIgnoreCase(attr.value))
+                && ("javascript".equalsIgnoreCase(attr.value)||"text/javascript".equalsIgnoreCase(attr.value)))
             {
                 result = true;
             }

Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/ajaxportlet-object.xml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -1,53 +1,65 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <deployments>
-  <deployment>
-    <parent-ref>default</parent-ref>
-    <if-exists>overwrite</if-exists>
-    <instance>
-      <instance-name>AjaxPortletInstance</instance-name>
-      <component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
-    </instance>
-  </deployment>
-  <!--
-  	<deployment>
-  	<parent-ref>default</parent-ref>
-  	<if-exists>overwrite</if-exists>
-  	<page>
-  	<page-name>ajaxPortlet</page-name>
-  	<window>
-  	<window-name>ajaxportletWindow</window-name>
-  	<instance-ref>AjaxPortletInstance</instance-ref>
-  	<default>true</default>
-  	<region>center</region>
-  	<height>0</height>
-  	</window>
-  	<window>
-  	<window-name>ajaxportletSecondWindow</window-name>
-  	<instance-ref>AjaxPortletSecondInstance</instance-ref>
-  	<default>true</default>
-  	<region>center</region>
-  	<height>0</height>
-  	</window>
-  	</page>
-  	</deployment>
-  -->
-  <deployment>
-      <if-exists>overwrite</if-exists>
-      <parent-ref>default.default</parent-ref>
-	    <window>
-		    <window-name>otherAjaxportletWindow</window-name>
-		    <instance-ref>AjaxPortletInstance</instance-ref>
-		    <default>true</default>
-		    <region>center</region>
-		    <height>0</height>
-	    </window>
-  </deployment><!--
-  <deployment>
-    <parent-ref>default</parent-ref>
-    <if-exists>overwrite</if-exists>
-    <instance>
-      <instance-name>AjaxPortletSecondInstance</instance-name>
-      <component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
-    </instance>
-  </deployment>
---></deployments>
+	<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<instance>
+			<instance-name>AjaxPortletInstance</instance-name>
+			<component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
+		</instance>
+	</deployment>
+	<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<instance>
+			<instance-name>RichfacesPortletInstance</instance-name>
+			<component-ref>ajaxPortletApp.richfacesPortlet</component-ref>
+		</instance>
+	</deployment>
+	<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<page>
+			<page-name>ajaxPortlet</page-name>
+			<window>
+				<window-name>ajaxportletWindow</window-name>
+				<instance-ref>AjaxPortletInstance</instance-ref>
+				<default>true</default>
+				<region>center</region>
+				<height>0</height>
+			</window>
+		</page>
+	</deployment>
+	<deployment>
+		<if-exists>overwrite</if-exists>
+		<parent-ref>default.default</parent-ref>
+		<window>
+			<window-name>otherAjaxportletWindow</window-name>
+			<instance-ref>AjaxPortletInstance</instance-ref>
+			<default>true</default>
+			<region>center</region>
+			<height>0</height>
+		</window>
+	</deployment>
+	<deployment>
+		<if-exists>overwrite</if-exists>
+		<parent-ref>default.default</parent-ref>
+		<window>
+			<window-name>richfacesPortletWindow</window-name>
+			<instance-ref>RichfacesPortletInstance</instance-ref>
+			<default>true</default>
+			<region>center</region>
+			<height>0</height>
+		</window>
+	</deployment>
+	<!--
+		<deployment>
+		<parent-ref>default</parent-ref>
+		<if-exists>overwrite</if-exists>
+		<instance>
+		<instance-name>AjaxPortletSecondInstance</instance-name>
+		<component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
+		</instance>
+		</deployment>
+	-->
+</deployments>

Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -6,4 +6,7 @@
     <portlet>
          <portlet-name>ajaxPortlet</portlet-name>
     </portlet>
+    <portlet>
+         <portlet-name>richfacesPortlet</portlet-name>
+    </portlet>
 </portlet-app>         
\ No newline at end of file

Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet-instances.xml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -8,8 +8,8 @@
 	</deployment>
 	<deployment>
 		<instance>
-			<instance-id>AjaxPortletSecondInstance</instance-id>
-			<portlet-ref>ajaxPortlet</portlet-ref>
+			<instance-id>RichfacesPortletInstance</instance-id>
+			<portlet-ref>richfacesPortlet</portlet-ref>
 		</instance>
 	</deployment>
 </deployments>

Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -33,4 +33,36 @@
       <portlet-mode>HELP</portlet-mode>
     </supports>
   </portlet>
+  <portlet>
+    <portlet-name>richfacesPortlet</portlet-name>
+    <portlet-class>
+      javax.portlet.faces.GenericFacesPortlet
+    </portlet-class>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.view</name>
+      <value>/richfaces/start.xhtml</value>
+    </init-param>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.edit</name>
+      <value>/richfaces/edit.xhtml</value>
+    </init-param>
+
+    <init-param>
+      <name>javax.portlet.faces.defaultViewId.help</name>
+      <value>/richfaces/help.xhtml</value>
+    </init-param>
+
+    <expiration-cache>-0</expiration-cache>
+    <portlet-info>
+       <title>RichFaces components demo</title>
+    </portlet-info>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+      <portlet-mode>EDIT</portlet-mode>
+      <portlet-mode>HELP</portlet-mode>
+    </supports>
+  </portlet>
 </portlet-app>

Added: trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml	                        (rev 0)
+++ trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<f:view xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:a="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+	<h:panelGrid columns="2" columnClasses="cols" width="100%">
+	<h:form>
+		<rich:panelMenu style="width:200px" mode="ajax"
+			iconExpandedGroup="disc" iconCollapsedGroup="disc"
+			iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+			iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right">
+
+			<rich:panelMenuGroup label="Group 1">
+
+				<rich:panelMenuItem label="Item 1.1"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.2"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.3"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+			</rich:panelMenuGroup>
+			<rich:panelMenuGroup label="Group 2">
+
+				<rich:panelMenuItem label="Item 1.1"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.2"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+
+				<rich:panelMenuItem label="Item 1.3"
+					action="#{panelMenu.updateCurrent}">
+				</rich:panelMenuItem>
+			</rich:panelMenuGroup>
+		</rich:panelMenu>
+		</h:form>
+		<rich:panel>
+			<f:facet name="header">
+				<h:panelGroup layout="block" styleClass="header">
+					<ui:insert name="header" />
+				</h:panelGroup>
+			</f:facet>
+			<ui:insert name="content" />
+		</rich:panel>
+	</h:panelGrid>
+	<h:panelGroup layout="block" styleClass="header">
+		Created with Richfaces UI components, Richfaces JSF portlet bridge and Facelets
+	</h:panelGroup>
+</f:view>


Property changes on: trunk/samples/ajaxPortlet/src/main/webapp/includes/template.xhtml
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain

Added: trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml	                        (rev 0)
+++ trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:ui="http://java.sun.com/jsf/facelets"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:a4j="http://richfaces.org/a4j"
+	xmlns:rich="http://richfaces.org/rich">
+<head>
+<title>Facelets composition with a "NONE" filter</title>
+</head>
+<body>
+<ui:composition template="/includes/template.xhtml">
+	<ui:define name="header">
+	<h:outputText value="RichFaces components in the portal environment"/>
+	</ui:define>
+	<ui:define name="content">
+	<h:form>
+		<h:panelGrid columns="1" border="1">
+	  <h:inputText value="#{bean.text}" >
+	     <a4j:support event="onkeyup" reRender="text,input"/>
+	  </h:inputText>
+	  <h:outputText id="text" value="#{bean.text}"/>
+	  <h:inputText disabled="true" id="input" value="#{bean.text}"/>
+	  			<rich:insert src="/pages/rusKoi.html" highlight="html"
+				encoding="Cp866" />
+			<rich:insert src="/notExist.xhtml" highlight="xhtml"
+				errorContent="/error.xhtml" />
+			<rich:insert src="/notExist.xhtml" highlight="xhtml" />
+		</h:panelGrid>
+		</h:form>
+	</ui:define>
+</ui:composition>
+</body>
+</html>
\ No newline at end of file


Property changes on: trunk/samples/ajaxPortlet/src/main/webapp/richfaces/start.xhtml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java	2007-12-17 22:48:55 UTC (rev 4878)
@@ -51,7 +51,7 @@
    
    private boolean bookingValid;
    
-   @Begin
+//   @Begin
    public void selectHotel(Hotel selectedHotel)
    {
       hotel = em.merge(selectedHotel);
@@ -91,7 +91,7 @@
       return bookingValid;
    }
    
-   @End
+//   @End
    public void confirm()
    {
       em.persist(booking);
@@ -100,7 +100,7 @@
       events.raiseTransactionSuccessEvent("bookingConfirmed");
    }
    
-   @End
+//   @End
    public void cancel() {}
    
    @Remove

Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -3,10 +3,9 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
 
-       no-conversation-view-id="/main.xhtml"
-                 login-view-id="/home.xhtml">
-
-    <page view-id="/register.xhtml">
+                 login-view-id="/home.xhtml"><!--
+no-conversation-view-id="/main.xhtml"
+    --><page view-id="/register.xhtml">
     
         <action if="#{validation.failed}"
            execute="#{register.invalid}"/>
@@ -57,7 +56,7 @@
     </page>
     
 	<page view-id="/hotel.xhtml" 
-	      conversation-required="true" 
+	      conversation-required="false" 
 	      login-required="true">
           
         <description>View hotel: #{hotel.name}</description>
@@ -69,7 +68,7 @@
     </page>
 
 	<page view-id="/book.xhtml" 
-	      conversation-required="true" 
+	      conversation-required="false" 
 	      login-required="true">
           
         <description>Book hotel: #{hotel.name}</description>
@@ -83,7 +82,7 @@
     </page>
 
 	<page view-id="/confirm.xhtml" 
-	      conversation-required="true" 
+	      conversation-required="false" 
 	      login-required="true">
           
         <description>Confirm booking: #{booking.description}</description>

Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2007-12-17 19:41:49 UTC (rev 4877)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2007-12-17 22:48:55 UTC (rev 4878)
@@ -66,12 +66,12 @@
 		<h:column>
 			<f:facet name="header">AJAX Action</f:facet>
 			<a:commandLink id="viewHotelAJAX" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
-		</h:column>
+		</h:column><!--
 		<h:column>
 			<f:facet name="header">Action</f:facet>
 			<s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
 		</h:column>
-	</h:dataTable>
+	--></h:dataTable>
 	<a:commandLink value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}" reRender="searchResults"/>
   </div>
 </a:outputPanel>




More information about the richfaces-svn-commits mailing list