[jboss-cvs] JBossAS SVN: r97201 - in projects/snowdrop/trunk/documentation/samples/sportsclub: sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 1 01:29:41 EST 2009
Author: marius.bogoevici
Date: 2009-12-01 01:29:40 -0500 (Tue, 01 Dec 2009)
New Revision: 97201
Added:
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/BillingTypeConverter.java
Modified:
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-hibernate-dao/src/main/resources/hibernate/hibernate.properties
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/AccountCreate.java
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReferenceData.java
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/WEB-INF/faces-config.xml
projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/createForm.xhtml
Log:
changing id type to Long
Modified: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-hibernate-dao/src/main/resources/hibernate/hibernate.properties
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-hibernate-dao/src/main/resources/hibernate/hibernate.properties 2009-12-01 05:08:26 UTC (rev 97200)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-hibernate-dao/src/main/resources/hibernate/hibernate.properties 2009-12-01 06:29:40 UTC (rev 97201)
@@ -1,4 +1,4 @@
hibernate.hbm2ddl.auto=create-drop
hibernate.current_session_context_class=jta
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
-hibernate.transaction.factory_class=org.hibernate.transaction.CMTTransactionFactory
+hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
Modified: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java 2009-12-01 05:08:26 UTC (rev 97200)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java 2009-12-01 06:29:40 UTC (rev 97201)
@@ -1,6 +1,7 @@
package org.jboss.snowdrop.samples.sportsclub.ejb;
import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
import javax.interceptor.Interceptors;
import java.util.Collection;
@@ -55,6 +56,7 @@
return accountRepository.countByCriteria(accountSearchCriteria);
}
+ @TransactionAttribute
public Account createAccountForPerson(Person person, Membership membership)
{
Account account = new Account();
Modified: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/AccountCreate.java
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/AccountCreate.java 2009-12-01 05:08:26 UTC (rev 97200)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/AccountCreate.java 2009-12-01 06:29:40 UTC (rev 97201)
@@ -2,6 +2,7 @@
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Account;
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Address;
+import org.jboss.snowdrop.samples.sportsclub.domain.entity.BillingType;
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Membership;
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Name;
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Person;
@@ -35,6 +36,8 @@
private Membership membership = null;
+ private BillingType billingType;
+
public void setReferenceData(ReferenceData referenceData)
{
this.referenceData = referenceData;
@@ -133,4 +136,14 @@
{
return membership;
}
+
+ public void setBillingType(BillingType billingType)
+ {
+ this.billingType = billingType;
+ }
+
+ public BillingType getBillingType()
+ {
+ return billingType;
+ }
}
Added: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/BillingTypeConverter.java
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/BillingTypeConverter.java (rev 0)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/BillingTypeConverter.java 2009-12-01 06:29:40 UTC (rev 97201)
@@ -0,0 +1,16 @@
+package org.jboss.snowdrop.samples.sportsclub.jsf.beans;
+
+import javax.faces.convert.EnumConverter;
+
+import org.jboss.snowdrop.samples.sportsclub.domain.entity.BillingType;
+
+/**
+ * @author Marius Bogoevici
+ */
+public class BillingTypeConverter extends EnumConverter
+{
+ public BillingTypeConverter()
+ {
+ super(BillingType.class);
+ }
+}
Modified: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReferenceData.java
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReferenceData.java 2009-12-01 05:08:26 UTC (rev 97200)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/java/org/jboss/snowdrop/samples/sportsclub/jsf/beans/ReferenceData.java 2009-12-01 06:29:40 UTC (rev 97201)
@@ -1,11 +1,14 @@
package org.jboss.snowdrop.samples.sportsclub.jsf.beans;
+import javax.annotation.PostConstruct;
import javax.ejb.EJB;
+import javax.faces.model.SelectItem;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
+import org.jboss.snowdrop.samples.sportsclub.domain.entity.BillingType;
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Membership;
import org.jboss.snowdrop.samples.sportsclub.ejb.SubscriptionService;
@@ -20,8 +23,27 @@
Map<String, Membership> membershipTypes;
+ SelectItem[] billingTypes;
+
ReentrantLock lock = new ReentrantLock();
+
+ @PostConstruct
+ void init()
+ {
+ billingTypes = new SelectItem[BillingType.values().length];
+ int i=0;
+ for (BillingType billingType: BillingType.values())
+ {
+ billingTypes[i++] = new SelectItem(billingType);
+ }
+ }
+
+ public SelectItem[] getBillingTypes()
+ {
+ return billingTypes;
+ }
+
public Map<String, Membership> getMembershipTypes()
{
Modified: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/WEB-INF/faces-config.xml 2009-12-01 05:08:26 UTC (rev 97200)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/WEB-INF/faces-config.xml 2009-12-01 06:29:40 UTC (rev 97201)
@@ -31,6 +31,10 @@
<value>#{referenceData}</value>
</managed-property>
</managed-bean>
+ <converter>
+ <converter-id>enumConverter</converter-id>
+ <converter-class>org.jboss.snowdrop.samples.sportsclub.jsf.beans.BillingTypeConverter</converter-class>
+ </converter>
<!--<navigation-rule>-->
<!--<from-view-id>/searchForm.xhtml</from-view-id>-->
<!--<navigation-case>-->
Modified: projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/createForm.xhtml
===================================================================
--- projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/createForm.xhtml 2009-12-01 05:08:26 UTC (rev 97200)
+++ projects/snowdrop/trunk/documentation/samples/sportsclub/sportsclub-subscriptions-web/src/main/webapp/createForm.xhtml 2009-12-01 06:29:40 UTC (rev 97201)
@@ -21,6 +21,12 @@
<rich:inplaceInput defaultLabel="Click to enter" value="#{accountCreate.city}"/>
<h:outputLabel value="Province"/>
<rich:inplaceInput defaultLabel="Click to enter" value="#{accountCreate.provinceOrState}"/>
+ <h:outputLabel value="Billing"/>
+ <rich:inplaceSelect defaultLabel="Click to select"
+ value="#{accountCreate.billingType}">
+ <f:converter converterId="enumConverter" />
+ <f:selectItems value="#{referenceData.billingTypes}"/>
+ </rich:inplaceSelect>
<h:outputLabel value="Membership"/>
<rich:inplaceSelect defaultLabel="Click to select" value="#{accountCreate.membership}"
showControls="true" converter="#{membershipConverter}">
More information about the jboss-cvs-commits
mailing list