[jboss-cvs] jboss-seam/examples/spring/resources ...

Michael Youngstrom youngm at gmail.com
Tue Jul 3 16:37:38 EDT 2007


  User: myoungstrom
  Date: 07/07/03 16:37:38

  Added:       examples/spring/resources         faces-config.xml
                        applicationContext.xml log4j.xml components.xml
                        persistence.xml pages.xml web.xml navigation.xml
  Log:
  Fixes for:
  JBSEAM-1575
  JBSEAM-1583
  
  Revision  Changes    Path
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/faces-config.xml
  
  Index: faces-config.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <faces-config version="1.2"
                xmlns="http://java.sun.com/xml/ns/javaee"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
  
      <!-- Facelets support -->
      <application>
          <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
          <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
      </application>
      
  </faces-config>
  
  
  
  1.9       +73 -22    jboss-seam/examples/spring/resources/applicationContext.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: applicationContext.xml
  ===================================================================
  RCS file: applicationContext.xml
  diff -N applicationContext.xml
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ applicationContext.xml	3 Jul 2007 20:37:38 -0000	1.9
  @@ -0,0 +1,82 @@
  +<?xml version="1.0" encoding="UTF-8"?>
  +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
  +	xmlns:util="http://www.springframework.org/schema/util" xmlns:seam="http://jboss.com/products/seam/spring-seam"
  +	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
  +	xmlns:jee="http://www.springframework.org/schema/jee"
  +	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  +                           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
  +                           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
  +                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
  +                           http://jboss.com/products/seam/spring-seam http://jboss.com/products/seam/spring-seam-2.0.xsd
  +                           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
  +	default-lazy-init="true">
  +	<!--
  +	
  +	Waiting for SPR-3645
  +	
  +    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  +        <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
  +        <property name="url" value="jdbc:hsqldb:mem:defaultDB"/>
  +        <property name="username" value="sa"/>
  +        <property name="password" value=""/>
  +    </bean>
  +
  +	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  +		<property name="dataSource" ref="dataSource"/>
  +	</bean>
  +	
  +	-->
  +	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  +	   	<property name="entityManagerFactory" ref="seamEntityManagerFactory"/>
  +	</bean>
  +
  +	<tx:annotation-driven proxy-target-class="true" />
  +
  +	<bean id="userService" class="org.jboss.seam.example.spring.UserService">
  +		<seam:component/>
  +	</bean>
  +
  +	<bean id="bookingService" class="org.jboss.seam.example.spring.BookingService">
  +		<property name="entityManagerFactory" ref="seamEntityManagerFactory" />
  +		<seam:component/>
  +	</bean>
  +
  +	<!-- Testing out a seam scope -->
  +	<bean id="hotelSearch" class="org.jboss.seam.example.spring.HotelSearchingAction" scope="seam.SESSION">
  +		<!-- Testing creation time injection -->
  +		<property name="pageSize" value="10" />
  +	</bean>
  +
  +	<seam:configure-scopes />
  +
  +	<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
  +
  +	<bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
  +		<property name="persistenceContextName" value="entityManager" />
  +	</bean>
  +
  +	<bean id="timerFactory" class="org.springframework.scheduling.timer.TimerFactoryBean" lazy-init="false">
  +		<property name="scheduledTimerTasks">
  +			<list>
  +				<ref bean="scheduledTask" />
  +			</list>
  +		</property>
  +	</bean>
  +	
  +	<bean id="scheduledTask" class="org.springframework.scheduling.timer.ScheduledTimerTask">
  +		<property name="delay" value="10000" />
  +		<property name="period" value="50000" />
  +		<property name="timerTask" ref="doIt" />
  +	</bean>
  +
  +	<bean id="doIt" class="org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean">
  +		<property name="targetObject">
  +			 <!-- could just do a ref="bookingService" here but want to test seam:instance and using an EL expression
  +			 asynchronously. --> 
  +			<seam:instance name="#{bookingService}" />
  +		</property>
  +		<property name="targetMethod" value="testNonWebRequest" />
  +	</bean>
  +
  +	<bean id="springThreadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" />
  +</beans>
  
  
  
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/log4j.xml
  
  Index: log4j.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  
  <!-- ===================================================================== -->
  <!--                                                                       -->
  <!--  Log4j Configuration                                                  -->
  <!--                                                                       -->
  <!-- ===================================================================== -->
  
  <!-- $Id: log4j.xml,v 1.1 2007/07/03 20:37:38 myoungstrom Exp $ -->
  
  <!--
     | For more configuration infromation and examples see the Jakarta Log4j
     | owebsite: http://jakarta.apache.org/log4j
   -->
  
  <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
     
     <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
  
        <layout class="org.apache.log4j.PatternLayout">
           <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n"/>
        </layout>
     </appender>
     
     <!-- 
     <category name="org.hibernate">
        <priority value="DEBUG"/>
     </category>
     -->
  
     <!-- 
     <category name="org.jboss.seam">
        <priority value="DEBUG"/>
     </category>
     -->
     
     <!-- 
     <category name="org.jboss.kernel">
        <priority value="DEBUG"/>
     </category>
     -->
  
     <root>
        <priority value="INFO"/>
        <appender-ref ref="CONSOLE"/>
     </root>
  
  </log4j:configuration>
  
  
  
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/components.xml
  
  Index: components.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <components xmlns="http://jboss.com/products/seam/components" 
              xmlns:core="http://jboss.com/products/seam/core"
              xmlns:persistence="http://jboss.com/products/seam/persistence"
              xmlns:spring="http://jboss.com/products/seam/spring"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd 
                                  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
                                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
                                  http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.0.xsd">
  
  
      <core:manager conversation-timeout="120000" 
                    concurrent-request-timeout="500" 
                    conversation-id-parameter="cid"/>
                    
  	<persistence:entity-manager-factory name="entityManagerFactory"
  		persistence-unit-name="bookingDatabase"/>
  
      <persistence:managed-persistence-context name="entityManager"
                                        auto-create="true" 
                                        entity-manager-factory="#{entityManagerFactory}" />
      
      <core:init debug="true"/>
      
      <spring:context-loader />
  
  	<!-- Install a ThreadPoolDispatcher to handle scheduled asynchronous event -->
  	<core:thread-pool-dispatcher name="threadPoolDispatcher"/>
      
      <!-- Install the SpringDispatcher as default -->
      <spring:task-executor-dispatcher schedule-dispatcher="#{threadPoolDispatcher}" task-executor="#{springThreadPoolTaskExecutor}"/>
      
      <spring:spring-transaction platform-transaction-manager="#{transactionManager}"/>
      
  </components>
  
  
  
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/persistence.xml
  
  Index: persistence.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <persistence xmlns="http://java.sun.com/xml/ns/persistence"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
               version="1.0">
      <persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <properties>
              <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
              <property name="hibernate.show_sql" value="true"/>
  			<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
  			<property name="hibernate.show_sql" value="true"/>
  			<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
  			<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
  			<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
  			<property name="hibernate.connection.username" value="sa"/>
  			<property name="hibernate.connection.password" value=""/>
  			<property name="hibernate.connection.url" value="jdbc:hsqldb:mem:defaultDB"/>
          </properties>
      </persistence-unit>
  </persistence>
  
  
  
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/pages.xml
  
  Index: pages.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <pages xmlns="http://jboss.com/products/seam/pages"
         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">
  
      <page view-id="/register.xhtml">
      
          <action if="#{validation.failed}"
             execute="#{register.invalid}"/>
      
          <navigation>
              <rule if="#{register.registered}">
                  <redirect view-id="/home.xhtml"/>
              </rule>
          </navigation>
          
      </page>
  
      <page view-id="/home.xhtml">
      
          <navigation>
              <rule if="#{login.loggedIn}">
                  <redirect view-id="/main.xhtml"/>
              </rule>
          </navigation>
          
      </page>
      
      <page view-id="/password.xhtml">
      
          <navigation>
              <rule if="#{changePassword.changed}">
                  <redirect view-id="/main.xhtml"/>
              </rule>
          </navigation>
          
      </page>
  
      <page view-id="/main.xhtml">
      
          <action execute="#{login.validateLogin}"/>
          
          <navigation from-action="#{login.validateLogin}">
              <rule if="#{not login.loggedIn}">
                  <redirect view-id="/home.xhtml"/>
              </rule>
          </navigation>
          
          <navigation from-action="#{hotelBooking.selectHotel(hot)}">
              <redirect view-id="/hotel.xhtml"/>
          </navigation>
          
      </page>
  
  	<page view-id="/hotel.xhtml" 
            conversation-required="true">
            
          <description>View hotel: #{hotel.name}</description>
          
          <navigation from-action="#{hotelBooking.bookHotel}">
              <redirect view-id="/book.xhtml"/>
          </navigation>
          
      </page>
  
  	<page view-id="/book.xhtml" 
            conversation-required="true">
            
          <description>Book hotel: #{hotel.name}</description>
          
          <navigation from-action="#{hotelBooking.setBookingDetails}">
              <redirect view-id="/confirm.xhtml"/>
          </navigation>
          
      </page>
  
  	<page view-id="/confirm.xhtml" 
            conversation-required="true">
            
          <description>Confirm booking: #{booking.description}</description>
          
          <navigation from-action="#{hotelBooking.confirm}">
              <redirect view-id="/main.xhtml"/>
          </navigation>
          
      </page>
      
      <page view-id="*">
      
          <navigation from-action="#{login.logout}">
              <redirect view-id="/home.xhtml"/>
          </navigation>
  
          <navigation from-action="#{hotelBooking.cancel}">
              <redirect view-id="/main.xhtml"/>
          </navigation>
          
      </page>
  
  </pages>
  
  
  
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/web.xml
  
  Index: web.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <web-app version="2.4" 
           xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      
      <!-- Seam -->
      
      <listener>
          <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
      </listener>
  
      <filter>
          <filter-name>Seam Filter</filter-name>
          <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
      </filter>
  
      <filter-mapping>
          <filter-name>Seam Filter</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>
      
      <servlet>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
      </servlet>
      
      <servlet-mapping>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <url-pattern>/seam/resource/*</url-pattern>
      </servlet-mapping>     
  
      <context-param>
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
          <param-value>.xhtml</param-value>
      </context-param>
  
      <context-param>
          <param-name>facelets.DEVELOPMENT</param-name>
          <param-value>true</param-value>
      </context-param>
      
      <!-- JSF -->
  
      <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
      </servlet>
      
      <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.seam</url-pattern>
      </servlet-mapping>
      
      <session-config>
          <session-timeout>10</session-timeout> 
      </session-config>     
  </web-app>
  
  
  
  1.1      date: 2007/07/03 20:37:38;  author: myoungstrom;  state: Exp;jboss-seam/examples/spring/resources/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <faces-config version="1.2"
                xmlns="http://java.sun.com/xml/ns/javaee"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
  
      <navigation-rule>
          <navigation-case>
              <from-outcome>login</from-outcome>
              <to-view-id>/home.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
  
          <navigation-case>
              <from-outcome>register</from-outcome>
              <to-view-id>/register.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
  
          <navigation-case>
              <from-outcome>password</from-outcome>
              <to-view-id>/password.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
  
          <navigation-case>
              <from-outcome>main</from-outcome>
              <to-view-id>/main.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
  
          <navigation-case>
              <from-outcome>hotel</from-outcome>
              <to-view-id>/hotel.xhtml</to-view-id>
              <redirect />
          </navigation-case>
      </navigation-rule>
  
      <navigation-rule>
          <from-view-id>/hotel.xhtml</from-view-id>
          <navigation-case>
              <from-outcome>book</from-outcome>
              <to-view-id>/book.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
      </navigation-rule>
  
  
      <navigation-rule>
          <from-view-id>/book.xhtml</from-view-id>
  
          <navigation-case>
              <from-outcome>confirm</from-outcome>
              <to-view-id>/confirm.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
      </navigation-rule>
  
  
      <navigation-rule>
          <from-view-id>/confirm.xhtml</from-view-id>
          <navigation-case>
              <from-outcome>confirmed</from-outcome>
              <to-view-id>/main.xhtml</to-view-id>
  
              <redirect/>
          </navigation-case>
  
          <navigation-case>
              <from-outcome>back</from-outcome>
              <to-view-id>/book.xhtml</to-view-id>
  
              <redirect />
          </navigation-case>
      </navigation-rule>
  </faces-config>
  
  
  
  



More information about the jboss-cvs-commits mailing list