You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/07/03 23:35:00 UTC
svn commit: r673822 [3/7] - in /myfaces/orchestra/trunk:
examples/src/main/java/org/apache/myfaces/examples/annotations/
examples/src/main/java/org/apache/myfaces/examples/ballot/backings/
examples/src/main/java/org/apache/myfaces/examples/ballot/dao/ ...
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupDao.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupDao.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupDao.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupDao.java Thu Jul 3 14:34:56 2008
@@ -27,33 +27,33 @@
public class CustomerGroupDao
{
- @PersistenceContext
- private EntityManager entityManager;
+ @PersistenceContext
+ private EntityManager entityManager;
- public CustomerGroup getByKey(long customerGroupId)
- {
- return entityManager.find(CustomerGroup.class, Long.valueOf(customerGroupId));
- }
-
- public List<CustomerGroup> getAll()
- {
- return entityManager.createNamedQuery("customerGroupsAll").getResultList();
- }
-
- public List<CustomerGroup> getCustomerGroupsByFulltext(String text)
- {
- Query query = entityManager.createNamedQuery("customerGroupByFulltext");
- query.setParameter("description", "%" + text.toLowerCase() + "%");
- return query.getResultList();
- }
-
- public void save(CustomerGroup customerGroup)
- {
- entityManager.persist(customerGroup);
- }
-
- public void delete(CustomerGroup customerGroup)
- {
- entityManager.remove(customerGroup);
- }
+ public CustomerGroup getByKey(long customerGroupId)
+ {
+ return entityManager.find(CustomerGroup.class, Long.valueOf(customerGroupId));
+ }
+
+ public List<CustomerGroup> getAll()
+ {
+ return entityManager.createNamedQuery("customerGroupsAll").getResultList();
+ }
+
+ public List<CustomerGroup> getCustomerGroupsByFulltext(String text)
+ {
+ Query query = entityManager.createNamedQuery("customerGroupByFulltext");
+ query.setParameter("description", "%" + text.toLowerCase() + "%");
+ return query.getResultList();
+ }
+
+ public void save(CustomerGroup customerGroup)
+ {
+ entityManager.persist(customerGroup);
+ }
+
+ public void delete(CustomerGroup customerGroup)
+ {
+ entityManager.remove(customerGroup);
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupSuggest.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupSuggest.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupSuggest.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/CustomerGroupSuggest.java Thu Jul 3 14:34:56 2008
@@ -25,31 +25,31 @@
public class CustomerGroupSuggest
{
- private CustomerGroupDao customerGroupDao;
+ private CustomerGroupDao customerGroupDao;
- public CustomerGroupDao getCustomerGroupDao()
- {
- return customerGroupDao;
- }
-
- public void setCustomerGroupDao(CustomerGroupDao customerGroupDao)
- {
- this.customerGroupDao = customerGroupDao;
- }
-
- public String getDescription(CustomerGroup customerGroup)
- {
- if (customerGroup == null)
- {
- return "";
- }
-
- return customerGroup.getId() + "/" + customerGroup.getDescription();
- }
-
- @Transactional(readOnly=true)
- public List<CustomerGroup> getCustomerGroupsByFulltext(String text)
- {
- return customerGroupDao.getCustomerGroupsByFulltext(text);
- }
+ public CustomerGroupDao getCustomerGroupDao()
+ {
+ return customerGroupDao;
+ }
+
+ public void setCustomerGroupDao(CustomerGroupDao customerGroupDao)
+ {
+ this.customerGroupDao = customerGroupDao;
+ }
+
+ public String getDescription(CustomerGroup customerGroup)
+ {
+ if (customerGroup == null)
+ {
+ return "";
+ }
+
+ return customerGroup.getId() + "/" + customerGroup.getDescription();
+ }
+
+ @Transactional(readOnly=true)
+ public List<CustomerGroup> getCustomerGroupsByFulltext(String text)
+ {
+ return customerGroupDao.getCustomerGroupsByFulltext(text);
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductDao.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductDao.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductDao.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductDao.java Thu Jul 3 14:34:56 2008
@@ -38,17 +38,17 @@
*/
public class ProductDao extends JpaDaoSupport
{
- public Product getByKey(Long productId)
- {
+ public Product getByKey(Long productId)
+ {
return getJpaTemplate().find(Product.class, productId);
- }
+ }
- public List<Product> getAll()
- {
- return getJpaTemplate().findByNamedQuery("productsAll");
- }
- public List<Product> getProductsByFulltext(final String text)
- {
+ public List<Product> getAll()
+ {
+ return getJpaTemplate().findByNamedQuery("productsAll");
+ }
+ public List<Product> getProductsByFulltext(final String text)
+ {
return (List<Product>) getJpaTemplate().execute(new JpaCallback()
{
public Object doInJpa(EntityManager entityManager) throws PersistenceException
@@ -60,8 +60,8 @@
});
}
- public void save(Product product)
- {
- getJpaTemplate().persist(product);
- }
+ public void save(Product product)
+ {
+ getJpaTemplate().persist(product);
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductPriceDao.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductPriceDao.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductPriceDao.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ProductPriceDao.java Thu Jul 3 14:34:56 2008
@@ -30,43 +30,43 @@
public class ProductPriceDao
{
- @PersistenceContext
- private EntityManager entityManager;
+ @PersistenceContext
+ private EntityManager entityManager;
- public ProductPrice getPriceForProduct(Product product, Long customerGroupId)
- {
- Date today = new Date();
+ public ProductPrice getPriceForProduct(Product product, Long customerGroupId)
+ {
+ Date today = new Date();
- Query query = entityManager.createNamedQuery("productPriceCustomerGroupCurrent");
- query.setParameter("product", product);
- query.setParameter("date", today, TemporalType.DATE);
- query.setParameter("customerGroupId", customerGroupId);
- ProductPrice price = null;
- try
- {
- price = (ProductPrice) query.getSingleResult();
- }
- catch (NoResultException e)
- {
- // fall through ... not unique or not existent
- }
- if (price != null)
- {
- return null;
- }
+ Query query = entityManager.createNamedQuery("productPriceCustomerGroupCurrent");
+ query.setParameter("product", product);
+ query.setParameter("date", today, TemporalType.DATE);
+ query.setParameter("customerGroupId", customerGroupId);
+ ProductPrice price = null;
+ try
+ {
+ price = (ProductPrice) query.getSingleResult();
+ }
+ catch (NoResultException e)
+ {
+ // fall through ... not unique or not existent
+ }
+ if (price != null)
+ {
+ return null;
+ }
- query = entityManager.createNamedQuery("productPriceCurrent");
- query.setParameter("product", product);
- query.setParameter("date", today, TemporalType.DATE);
- try
- {
- return (ProductPrice) query.getSingleResult();
- }
- catch (NoResultException e)
- {
- // fall through ... not unique or not existent
- }
+ query = entityManager.createNamedQuery("productPriceCurrent");
+ query.setParameter("product", product);
+ query.setParameter("date", today, TemporalType.DATE);
+ try
+ {
+ return (ProductPrice) query.getSingleResult();
+ }
+ catch (NoResultException e)
+ {
+ // fall through ... not unique or not existent
+ }
- return null;
- }
+ return null;
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ShopCustomerDao.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ShopCustomerDao.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ShopCustomerDao.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/dao/ShopCustomerDao.java Thu Jul 3 14:34:56 2008
@@ -25,21 +25,21 @@
public class ShopCustomerDao
{
- @PersistenceContext
- private EntityManager entityManager;
+ @PersistenceContext
+ private EntityManager entityManager;
- public ShopCustomer getByKey(long customerId)
- {
- return entityManager.find(ShopCustomer.class, Long.valueOf(customerId));
- }
+ public ShopCustomer getByKey(long customerId)
+ {
+ return entityManager.find(ShopCustomer.class, Long.valueOf(customerId));
+ }
- public void save(ShopCustomer shopCustomer)
- {
- entityManager.persist(shopCustomer);
- }
+ public void save(ShopCustomer shopCustomer)
+ {
+ entityManager.persist(shopCustomer);
+ }
- public void refresh(ShopCustomer customer)
- {
- entityManager.refresh(customer);
- }
+ public void refresh(ShopCustomer customer)
+ {
+ entityManager.refresh(customer);
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/lib/CustomerGroupPkConverter.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/lib/CustomerGroupPkConverter.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/lib/CustomerGroupPkConverter.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/lib/CustomerGroupPkConverter.java Thu Jul 3 14:34:56 2008
@@ -32,37 +32,37 @@
*/
public class CustomerGroupPkConverter implements Converter
{
- private CustomerGroupDao customerGroupDao;
+ private CustomerGroupDao customerGroupDao;
- public CustomerGroupDao getCustomerGroupDao()
- {
- return customerGroupDao;
- }
-
- public void setCustomerGroupDao(CustomerGroupDao customerGroupDao)
- {
- this.customerGroupDao = customerGroupDao;
- }
-
- @Transactional(readOnly=true)
- public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException
- {
- if (StringUtils.isEmpty(value))
- {
- return null;
- }
-
- long id = Long.parseLong(value, Character.MAX_RADIX);
- return customerGroupDao.getByKey(id);
- }
-
- public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException
- {
- if (value == null)
- {
- return "";
- }
+ public CustomerGroupDao getCustomerGroupDao()
+ {
+ return customerGroupDao;
+ }
+
+ public void setCustomerGroupDao(CustomerGroupDao customerGroupDao)
+ {
+ this.customerGroupDao = customerGroupDao;
+ }
+
+ @Transactional(readOnly=true)
+ public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException
+ {
+ if (StringUtils.isEmpty(value))
+ {
+ return null;
+ }
+
+ long id = Long.parseLong(value, Character.MAX_RADIX);
+ return customerGroupDao.getByKey(id);
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException
+ {
+ if (value == null)
+ {
+ return "";
+ }
- return Long.toString(((CustomerGroup) value).getId().longValue(), Character.MAX_RADIX);
- }
+ return Long.toString(((CustomerGroup) value).getId().longValue(), Character.MAX_RADIX);
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/CustomerGroup.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/CustomerGroup.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/CustomerGroup.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/CustomerGroup.java Thu Jul 3 14:34:56 2008
@@ -29,50 +29,50 @@
@Entity
@NamedQueries(value=
- {
- @NamedQuery(name="customerGroupByFulltext", query="select c from CustomerGroup c where lower(c.description) like :description"),
- @NamedQuery(name="customerGroupsAll", query="select c from CustomerGroup c")
- }
+ {
+ @NamedQuery(name="customerGroupByFulltext", query="select c from CustomerGroup c where lower(c.description) like :description"),
+ @NamedQuery(name="customerGroupsAll", query="select c from CustomerGroup c")
+ }
)
public class CustomerGroup
{
- private Long id;
+ private Long id;
- private String description;
+ private String description;
- private Long version;
+ private Long version;
- @Id
- @GeneratedValue(strategy = GenerationType.TABLE)
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- @Basic(optional=false)
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- @Version
- public Long getVersion()
- {
- return version;
- }
-
- public void setVersion(Long version)
- {
- this.version = version;
- }
+ @Id
+ @GeneratedValue(strategy = GenerationType.TABLE)
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Basic(optional=false)
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ @Version
+ public Long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(Long version)
+ {
+ this.version = version;
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/Product.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/Product.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/Product.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/Product.java Thu Jul 3 14:34:56 2008
@@ -36,110 +36,110 @@
@Entity
@NamedQueries(value=
- {
- @NamedQuery(name="productByFulltext", query="select p from Product p where lower(p.description) like :description"),
- @NamedQuery(name="productsAll", query="select p from Product p")
- }
+ {
+ @NamedQuery(name="productByFulltext", query="select p from Product p where lower(p.description) like :description"),
+ @NamedQuery(name="productsAll", query="select p from Product p")
+ }
)
public class Product
{
- private Long id;
+ private Long id;
- private String productNumber;
+ private String productNumber;
- private String description;
+ private String description;
- private String longDescription;
+ private String longDescription;
- private Set<ProductPrice> productPrices;
-
- private Long version;
-
- @Id
- @GeneratedValue(strategy= GenerationType.TABLE)
- @DisplayOnly
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- @Basic(optional=false)
- public String getProductNumber()
- {
- return productNumber;
- }
-
- public void setProductNumber(String productNumber)
- {
- this.productNumber = productNumber;
- }
-
- @Basic(optional=false)
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public String getLongDescription()
- {
- return longDescription;
- }
-
- public void setLongDescription(String longDescription)
- {
- this.longDescription = longDescription;
- }
-
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- public Set<ProductPrice> getProductPrices()
- {
- return productPrices;
- }
-
- public void setProductPrices(Set<ProductPrice> productPrices)
- {
- this.productPrices = productPrices;
- }
-
- @Version
- @DisplayOnly
- public Long getVersion()
- {
- return version;
- }
-
- public void setVersion(Long version)
- {
- this.version = version;
- }
-
- public void addProductPrice(ProductPrice productPrice)
- {
- if (productPrices == null)
- {
- productPrices = new HashSet();
- }
- productPrices.add(productPrice);
- productPrice.setProduct(this);
- }
-
- public void removeProductPrice(ProductPrice productPrice)
- {
- if (productPrices == null)
- {
- return;
- }
+ private Set<ProductPrice> productPrices;
+
+ private Long version;
+
+ @Id
+ @GeneratedValue(strategy= GenerationType.TABLE)
+ @DisplayOnly
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Basic(optional=false)
+ public String getProductNumber()
+ {
+ return productNumber;
+ }
+
+ public void setProductNumber(String productNumber)
+ {
+ this.productNumber = productNumber;
+ }
+
+ @Basic(optional=false)
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public String getLongDescription()
+ {
+ return longDescription;
+ }
+
+ public void setLongDescription(String longDescription)
+ {
+ this.longDescription = longDescription;
+ }
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ public Set<ProductPrice> getProductPrices()
+ {
+ return productPrices;
+ }
+
+ public void setProductPrices(Set<ProductPrice> productPrices)
+ {
+ this.productPrices = productPrices;
+ }
+
+ @Version
+ @DisplayOnly
+ public Long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(Long version)
+ {
+ this.version = version;
+ }
+
+ public void addProductPrice(ProductPrice productPrice)
+ {
+ if (productPrices == null)
+ {
+ productPrices = new HashSet();
+ }
+ productPrices.add(productPrice);
+ productPrice.setProduct(this);
+ }
+
+ public void removeProductPrice(ProductPrice productPrice)
+ {
+ if (productPrices == null)
+ {
+ return;
+ }
- productPrices.remove(productPrice);
- }
+ productPrices.remove(productPrice);
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ProductPrice.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ProductPrice.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ProductPrice.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ProductPrice.java Thu Jul 3 14:34:56 2008
@@ -38,112 +38,112 @@
@Entity
@NamedQueries(value=
- {
- @NamedQuery(
- name="productPriceCustomerGroupCurrent",
- query="select p from ProductPrice p where p.product = :product and p.validFrom <= :date and (p.validTo is null or p.validTo > :date) and p.customerGroup.id = :customerGroupId"),
- @NamedQuery(
- name="productPriceCurrent",
- query="select p from ProductPrice p where p.product = :product and p.validFrom <= :date and (p.validTo is null or p.validTo > :date) and p.customerGroup is null")
- }
+ {
+ @NamedQuery(
+ name="productPriceCustomerGroupCurrent",
+ query="select p from ProductPrice p where p.product = :product and p.validFrom <= :date and (p.validTo is null or p.validTo > :date) and p.customerGroup.id = :customerGroupId"),
+ @NamedQuery(
+ name="productPriceCurrent",
+ query="select p from ProductPrice p where p.product = :product and p.validFrom <= :date and (p.validTo is null or p.validTo > :date) and p.customerGroup is null")
+ }
)
public class ProductPrice
{
- private Long id;
+ private Long id;
- private Product product;
+ private Product product;
- private CustomerGroup customerGroup;
+ private CustomerGroup customerGroup;
- private Date validFrom;
+ private Date validFrom;
- private Date validTo;
-
- private double price;
-
- private Long version;
-
- @Id
- @GeneratedValue(strategy= GenerationType.TABLE)
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
- @DisplayOnly
- public Product getProduct()
- {
- return product;
- }
-
- public void setProduct(Product product)
- {
- this.product = product;
- }
-
- @Temporal(value= TemporalType.DATE)
- @Basic(optional=false)
- public Date getValidFrom()
- {
- return validFrom;
- }
-
- public void setValidFrom(Date validFrom)
- {
- this.validFrom = validFrom;
- }
-
- @Temporal(value= TemporalType.DATE)
- public Date getValidTo()
- {
- return validTo;
- }
-
- public void setValidTo(Date validTo)
- {
- this.validTo = validTo;
- }
-
- @Basic(optional=false)
- public double getPrice()
- {
- return price;
- }
-
- public void setPrice(double price)
- {
- this.price = price;
- }
-
- @Version
- public Long getVersion()
- {
- return version;
- }
-
- public void setVersion(Long version)
- {
- this.version = version;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- @DataProvider(
- description = "#{customerGroupSuggest.getDescription}",
- value = "#{customerGroupSuggest.getCustomerGroupsByFulltext}",
- converterBean="customerGroupPkConverter")
- public CustomerGroup getCustomerGroup()
- {
- return customerGroup;
- }
-
- public void setCustomerGroup(CustomerGroup customerGroup)
- {
- this.customerGroup = customerGroup;
- }
+ private Date validTo;
+
+ private double price;
+
+ private Long version;
+
+ @Id
+ @GeneratedValue(strategy= GenerationType.TABLE)
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
+ @DisplayOnly
+ public Product getProduct()
+ {
+ return product;
+ }
+
+ public void setProduct(Product product)
+ {
+ this.product = product;
+ }
+
+ @Temporal(value= TemporalType.DATE)
+ @Basic(optional=false)
+ public Date getValidFrom()
+ {
+ return validFrom;
+ }
+
+ public void setValidFrom(Date validFrom)
+ {
+ this.validFrom = validFrom;
+ }
+
+ @Temporal(value= TemporalType.DATE)
+ public Date getValidTo()
+ {
+ return validTo;
+ }
+
+ public void setValidTo(Date validTo)
+ {
+ this.validTo = validTo;
+ }
+
+ @Basic(optional=false)
+ public double getPrice()
+ {
+ return price;
+ }
+
+ public void setPrice(double price)
+ {
+ this.price = price;
+ }
+
+ @Version
+ public Long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(Long version)
+ {
+ this.version = version;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ @DataProvider(
+ description = "#{customerGroupSuggest.getDescription}",
+ value = "#{customerGroupSuggest.getCustomerGroupsByFulltext}",
+ converterBean="customerGroupPkConverter")
+ public CustomerGroup getCustomerGroup()
+ {
+ return customerGroup;
+ }
+
+ public void setCustomerGroup(CustomerGroup customerGroup)
+ {
+ this.customerGroup = customerGroup;
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShopCustomer.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShopCustomer.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShopCustomer.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShopCustomer.java Thu Jul 3 14:34:56 2008
@@ -33,86 +33,86 @@
@Entity
public class ShopCustomer
{
- private Long id;
+ private Long id;
- private String firstName;
+ private String firstName;
- private String lastName;
+ private String lastName;
- private String email;
+ private String email;
- private CustomerGroup customerGroup;
-
- private Long version;
-
- @Id
- @GeneratedValue(strategy = GenerationType.TABLE)
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- @Basic(optional=false)
- public String getFirstName()
- {
- return firstName;
- }
-
- public void setFirstName(String firstName)
- {
- this.firstName = firstName;
- }
-
- @Basic(optional=false)
- public String getLastName()
- {
- return lastName;
- }
-
- public void setLastName(String lastName)
- {
- this.lastName = lastName;
- }
-
- @Basic(optional=false)
- public String getEmail()
- {
- return email;
- }
-
- public void setEmail(String email)
- {
- this.email = email;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
- @DataProvider(
- description = "#{customerGroupSuggest.getDescription}",
- value = "#{customerGroupSuggest.getCustomerGroupsByFulltext}",
- converterBean="customerGroupPkConverter")
- public CustomerGroup getCustomerGroup()
- {
- return customerGroup;
- }
-
- public void setCustomerGroup(CustomerGroup customerGroup)
- {
- this.customerGroup = customerGroup;
- }
-
- @Version
- public Long getVersion()
- {
- return version;
- }
-
- public void setVersion(Long version)
- {
- this.version = version;
- }
+ private CustomerGroup customerGroup;
+
+ private Long version;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.TABLE)
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Basic(optional=false)
+ public String getFirstName()
+ {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+ @Basic(optional=false)
+ public String getLastName()
+ {
+ return lastName;
+ }
+
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+
+ @Basic(optional=false)
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
+ @DataProvider(
+ description = "#{customerGroupSuggest.getDescription}",
+ value = "#{customerGroupSuggest.getCustomerGroupsByFulltext}",
+ converterBean="customerGroupPkConverter")
+ public CustomerGroup getCustomerGroup()
+ {
+ return customerGroup;
+ }
+
+ public void setCustomerGroup(CustomerGroup customerGroup)
+ {
+ this.customerGroup = customerGroup;
+ }
+
+ @Version
+ public Long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(Long version)
+ {
+ this.version = version;
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCart.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCart.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCart.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCart.java Thu Jul 3 14:34:56 2008
@@ -33,71 +33,71 @@
@Entity
public class ShoppingCart
{
- private Long id;
+ private Long id;
- private ShopCustomer shopCustomer;
+ private ShopCustomer shopCustomer;
- private Set<ShoppingCartItem> shoppingCartItem;
+ private Set<ShoppingCartItem> shoppingCartItem;
- private Long version;
+ private Long version;
- @Id
- @GeneratedValue(strategy = GenerationType.TABLE)
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
- public ShopCustomer getCustomer()
- {
- return shopCustomer;
- }
-
- public void setCustomer(ShopCustomer shopCustomer)
- {
- this.shopCustomer = shopCustomer;
- }
-
- @OneToMany(fetch= FetchType.LAZY, mappedBy = "shoppingCart")
- public Set<ShoppingCartItem> getShoppingCartItem()
- {
- return shoppingCartItem;
- }
-
- public void setShoppingCartItem(Set<ShoppingCartItem> shoppingCartItem)
- {
- this.shoppingCartItem = shoppingCartItem;
- }
-
- @Version
- public Long getVersion()
- {
- return version;
- }
-
- public void setVersion(Long version)
- {
- this.version = version;
- }
-
- public void addProduct(Product product, long quantity)
- {
- if (shoppingCartItem == null)
- {
- shoppingCartItem = new HashSet();
- }
-
- ShoppingCartItem item = new ShoppingCartItem();
- item.setShoppingCart(this);
- item.setProduct(product);
- item.setQuantity(quantity);
+ @Id
+ @GeneratedValue(strategy = GenerationType.TABLE)
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
+ public ShopCustomer getCustomer()
+ {
+ return shopCustomer;
+ }
+
+ public void setCustomer(ShopCustomer shopCustomer)
+ {
+ this.shopCustomer = shopCustomer;
+ }
+
+ @OneToMany(fetch= FetchType.LAZY, mappedBy = "shoppingCart")
+ public Set<ShoppingCartItem> getShoppingCartItem()
+ {
+ return shoppingCartItem;
+ }
+
+ public void setShoppingCartItem(Set<ShoppingCartItem> shoppingCartItem)
+ {
+ this.shoppingCartItem = shoppingCartItem;
+ }
+
+ @Version
+ public Long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(Long version)
+ {
+ this.version = version;
+ }
+
+ public void addProduct(Product product, long quantity)
+ {
+ if (shoppingCartItem == null)
+ {
+ shoppingCartItem = new HashSet();
+ }
+
+ ShoppingCartItem item = new ShoppingCartItem();
+ item.setShoppingCart(this);
+ item.setProduct(product);
+ item.setQuantity(quantity);
- shoppingCartItem.add(item);
- }
+ shoppingCartItem.add(item);
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCartItem.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCartItem.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/mops/model/ShoppingCartItem.java Thu Jul 3 14:34:56 2008
@@ -31,69 +31,69 @@
@Entity
public class ShoppingCartItem
{
- private Long id;
+ private Long id;
- private ShoppingCart shoppingCart;
+ private ShoppingCart shoppingCart;
- private Product product;
+ private Product product;
- private long quantity;
+ private long quantity;
- private Long version;
-
- @Id
- @GeneratedValue(strategy = GenerationType.TABLE)
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
- public ShoppingCart getShoppingCart()
- {
- return shoppingCart;
- }
-
- public void setShoppingCart(ShoppingCart shoppingCart)
- {
- this.shoppingCart = shoppingCart;
- }
-
- @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
- public Product getProduct()
- {
- return product;
- }
-
- public void setProduct(Product product)
- {
- this.product = product;
- }
-
- @Basic(optional=false)
- public long getQuantity()
- {
- return quantity;
- }
-
- public void setQuantity(long quantity)
- {
- this.quantity = quantity;
- }
-
- @Version
- public Long getVersion()
- {
- return version;
- }
-
- public void setVersion(Long version)
- {
- this.version = version;
- }
+ private Long version;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.TABLE)
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
+ public ShoppingCart getShoppingCart()
+ {
+ return shoppingCart;
+ }
+
+ public void setShoppingCart(ShoppingCart shoppingCart)
+ {
+ this.shoppingCart = shoppingCart;
+ }
+
+ @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false)
+ public Product getProduct()
+ {
+ return product;
+ }
+
+ public void setProduct(Product product)
+ {
+ this.product = product;
+ }
+
+ @Basic(optional=false)
+ public long getQuantity()
+ {
+ return quantity;
+ }
+
+ public void setQuantity(long quantity)
+ {
+ this.quantity = quantity;
+ }
+
+ @Version
+ public Long getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(Long version)
+ {
+ this.version = version;
+ }
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Multibean.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Multibean.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Multibean.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Multibean.java Thu Jul 3 14:34:56 2008
@@ -25,32 +25,32 @@
public class Multibean implements BeanNameAware
{
- private static final Log log = LogFactory.getLog(Multibean.class);
- private String beanName;
+ private static final Log log = LogFactory.getLog(Multibean.class);
+ private String beanName;
- public Multibean()
- {
- log.info("Creating instance");
- }
+ public Multibean()
+ {
+ log.info("Creating instance");
+ }
- /** Invoked by Spring, due to BeanNameAware interface. */
- public void setBeanName(String name)
- {
- this.beanName = name;
- }
-
- public String getBeanName()
- {
- return beanName;
- }
+ /** Invoked by Spring, due to BeanNameAware interface. */
+ public void setBeanName(String name)
+ {
+ this.beanName = name;
+ }
+
+ public String getBeanName()
+ {
+ return beanName;
+ }
- public String getConversationName()
- {
- return Conversation.getCurrentInstance().getName();
- }
-
- public String getInstanceId()
- {
- return String.valueOf(System.identityHashCode(this));
- }
+ public String getConversationName()
+ {
+ return Conversation.getCurrentInstance().getName();
+ }
+
+ public String getInstanceId()
+ {
+ return String.valueOf(System.identityHashCode(this));
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/MultibeanController.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/MultibeanController.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/MultibeanController.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/MultibeanController.java Thu Jul 3 14:34:56 2008
@@ -22,18 +22,18 @@
public class MultibeanController
{
- String conversationName;
+ String conversationName;
- public void setConversationName(String conversationName) {
- this.conversationName = conversationName;
- }
-
- public String getConversationName() {
- return conversationName;
- }
-
- public String clearConversation() {
- ConversationUtils.invalidateIfExists(conversationName);
- return null;
- }
+ public void setConversationName(String conversationName) {
+ this.conversationName = conversationName;
+ }
+
+ public String getConversationName() {
+ return conversationName;
+ }
+
+ public String clearConversation() {
+ ConversationUtils.invalidateIfExists(conversationName);
+ return null;
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationBookView.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationBookView.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationBookView.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationBookView.java Thu Jul 3 14:34:56 2008
@@ -27,12 +27,12 @@
*/
public class ReservationBookView
{
- private final Log log = LogFactory.getLog(ReservationBookView.class);
+ private final Log log = LogFactory.getLog(ReservationBookView.class);
- private ReservationBook book = new ReservationBook();
-
- public ReservationBook getBook()
- {
- return book;
- }
+ private ReservationBook book = new ReservationBook();
+
+ public ReservationBook getBook()
+ {
+ return book;
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationView.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationView.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationView.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/backings/ReservationView.java Thu Jul 3 14:34:56 2008
@@ -31,79 +31,79 @@
*/
public class ReservationView
{
- private final Log log = LogFactory.getLog(ReservationView.class);
+ private final Log log = LogFactory.getLog(ReservationView.class);
- private ReservationBook book;
- private Reservation reservation;
- private boolean viewMode = false;
- private String reservationState;
-
-
- public int getInstanceId() {
- return System.identityHashCode(this);
- }
-
- public void setBook(ReservationBook book) {
- this.book = book;
- }
-
- public Reservation getReservation() {
- if (reservation == null)
- reservation = new Reservation();
- return reservation;
- }
-
- public void setReservation(Reservation reservation) {
- this.reservation = reservation;
- this.viewMode = true;
- }
-
- public boolean getViewMode() {
- return viewMode;
- }
-
- public String getReservationState() {
- return reservationState;
- }
-
- private boolean isAvailable(Date start, int days) {
- // the logic here would normally be on some "business service" class rather
- // than buried here inside the presentation class...
-
- // The hotel is closed on sat/sun nights.
- // Calendar.SUNDAY=1, SATURDAY=6
- Calendar cal = Calendar.getInstance();
- cal.setTime(start);
- int dow = cal.get(Calendar.DAY_OF_WEEK);
- if (dow == Calendar.SUNDAY)
- return false;
- if (dow + days > Calendar.SATURDAY)
- return false;
-
- // otherwise, ok
- return true;
- }
-
- public String checkAvailability() {
- if (isAvailable(reservation.getStart(), reservation.getDays())) {
- reservationState = "Available";
- } else {
- reservationState = "Not available";
- }
- return null;
- }
-
- public String save() {
- if (isAvailable(reservation.getStart(), reservation.getDays())) {
- book.getReservations().add(reservation);
- return "save";
- }
- reservationState = "Not Available";
- return null;
- }
-
- public String remove() {
- book.getReservations().remove(reservation);
- return "delete";
- }
+ private ReservationBook book;
+ private Reservation reservation;
+ private boolean viewMode = false;
+ private String reservationState;
+
+
+ public int getInstanceId() {
+ return System.identityHashCode(this);
+ }
+
+ public void setBook(ReservationBook book) {
+ this.book = book;
+ }
+
+ public Reservation getReservation() {
+ if (reservation == null)
+ reservation = new Reservation();
+ return reservation;
+ }
+
+ public void setReservation(Reservation reservation) {
+ this.reservation = reservation;
+ this.viewMode = true;
+ }
+
+ public boolean getViewMode() {
+ return viewMode;
+ }
+
+ public String getReservationState() {
+ return reservationState;
+ }
+
+ private boolean isAvailable(Date start, int days) {
+ // the logic here would normally be on some "business service" class rather
+ // than buried here inside the presentation class...
+
+ // The hotel is closed on sat/sun nights.
+ // Calendar.SUNDAY=1, SATURDAY=6
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(start);
+ int dow = cal.get(Calendar.DAY_OF_WEEK);
+ if (dow == Calendar.SUNDAY)
+ return false;
+ if (dow + days > Calendar.SATURDAY)
+ return false;
+
+ // otherwise, ok
+ return true;
+ }
+
+ public String checkAvailability() {
+ if (isAvailable(reservation.getStart(), reservation.getDays())) {
+ reservationState = "Available";
+ } else {
+ reservationState = "Not available";
+ }
+ return null;
+ }
+
+ public String save() {
+ if (isAvailable(reservation.getStart(), reservation.getDays())) {
+ book.getReservations().add(reservation);
+ return "save";
+ }
+ reservationState = "Not Available";
+ return null;
+ }
+
+ public String remove() {
+ book.getReservations().remove(reservation);
+ return "delete";
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/Reservation.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/Reservation.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/Reservation.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/Reservation.java Thu Jul 3 14:34:56 2008
@@ -23,31 +23,31 @@
public class Reservation
{
- private String name;
- private Date start;
- private int days;
+ private String name;
+ private Date start;
+ private int days;
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Date getStart() {
- return start;
- }
-
- public void setStart(Date start) {
- this.start = start;
- }
-
- public int getDays() {
- return days;
- }
-
- public void setDays(int days) {
- this.days = days;
- }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Date getStart() {
+ return start;
+ }
+
+ public void setStart(Date start) {
+ this.start = start;
+ }
+
+ public int getDays() {
+ return days;
+ }
+
+ public void setDays(int days) {
+ this.days = days;
+ }
}
Modified: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/ReservationBook.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/ReservationBook.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/ReservationBook.java (original)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/simple/model/ReservationBook.java Thu Jul 3 14:34:56 2008
@@ -23,9 +23,9 @@
public class ReservationBook
{
- private List reservations = new ArrayList();
+ private List reservations = new ArrayList();
- public List getReservations() {
- return reservations;
- }
+ public List getReservations() {
+ return reservations;
+ }
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/AbstractConnectionManagerListener.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/AbstractConnectionManagerListener.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/AbstractConnectionManagerListener.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/AbstractConnectionManagerListener.java Thu Jul 3 14:34:56 2008
@@ -25,11 +25,11 @@
*/
public abstract class AbstractConnectionManagerListener implements ConnectionManagerListener
{
- public void borrowConnection(Connection con)
- {
- }
+ public void borrowConnection(Connection con)
+ {
+ }
- public void releaseConnection(Connection con)
- {
- }
+ public void releaseConnection(Connection con)
+ {
+ }
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerDataSource.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerDataSource.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerDataSource.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerDataSource.java Thu Jul 3 14:34:56 2008
@@ -49,189 +49,189 @@
*/
public class ConnectionManagerDataSource implements DataSource
{
- private DataSource dataSource;
- private String jndiName;
- private ConnectionManagerListener[] listeners;
-
- // List of connections that have been borrowed by this thread but not returned.
- // When using a threadpool, it is required that the releaseAllBorrowedConnections
- // method be called before the thread is returned to the pool; that ensures this
- // threadlocal is reset to null.
- private static ThreadLocal borrowedConnections = new ThreadLocal()
- {
- protected Object initialValue()
- {
- return new HashSet();
- }
- };
-
- public ConnectionManagerDataSource()
- {
- }
-
- void onAfterBorrowConnection(Connection con)
- {
- ((Set) borrowedConnections.get()).add(con);
-
- if (listeners != null)
- {
- for (int i = 0; i<listeners.length; i++)
- {
- listeners[i].borrowConnection(con);
- }
- }
- }
-
- public void onBeforeReleaseConnection(Connection con)
- {
- if (listeners != null)
- {
- for (int i = 0; i<listeners.length; i++)
- {
- listeners[i].releaseConnection(con);
- }
- }
- }
-
- void onAfterReleaseConnection(Connection con)
- {
- ((Set) borrowedConnections.get()).remove(con);
- }
-
- public static void releaseAllBorrowedConnections()
- {
- DisconnectableConnection[] connections = new DisconnectableConnection[((Set) borrowedConnections.get()).size()];
- ((Set) borrowedConnections.get()).toArray(connections);
-
- for (int i = 0; i<connections.length; i++)
- {
- DisconnectableConnection connection = connections[i];
- connection.disconnect();
- }
-
- ((Set) borrowedConnections.get()).clear();
- }
-
- public void setListeners(ConnectionManagerListener[] listeners)
- {
- this.listeners = listeners;
- }
-
- public void setDataSource(DataSource dataSource)
- {
- this.dataSource = dataSource;
- }
-
- public DataSource getDataSource()
- {
- if (dataSource != null)
- {
- return dataSource;
- }
-
- try
- {
- Context ctx = new InitialContext();
- dataSource = (DataSource) ctx.lookup(jndiName);
- }
- catch (NamingException e)
- {
- throw (IllegalArgumentException) new IllegalArgumentException(jndiName).initCause(e);
- }
-
- return dataSource;
- }
-
- public void setJndiName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public Connection getConnection() throws SQLException
- {
- return DisconnectableConnectionFactory.create(this);
- }
-
- public Connection getConnection(String username, String password) throws SQLException
- {
- throw new UnsupportedOperationException();
- }
-
- public PrintWriter getLogWriter() throws SQLException
- {
- return getDataSource().getLogWriter();
- }
-
- public void setLogWriter(PrintWriter out) throws SQLException
- {
- getDataSource().setLogWriter(out);
- }
-
- public void setLoginTimeout(int seconds) throws SQLException
- {
- getDataSource().setLoginTimeout(seconds);
- }
-
- public int getLoginTimeout() throws SQLException
- {
- return getDataSource().getLoginTimeout();
- }
-
- public Object unwrap(Class iface) throws SQLException
- {
- throw new UnsupportedOperationException();
- /*
- try
- {
- if (iface.isAssignableFrom(dataSource.getClass()))
- {
- return dataSource;
- }
-
- Method method = dataSource.getClass().getMethod("unwrap", new Class[]{Class.class});
- return method.invoke(dataSource, new Object[] { iface });
- }
- catch (NoSuchMethodException e)
- {
- throw new UnsupportedOperationException();
- }
- catch (IllegalAccessException e)
- {
- throw new SQLException(e);
- }
- catch (InvocationTargetException e)
- {
- throw new SQLException(e);
- }
- */
- }
-
- public boolean isWrapperFor(Class iface) throws SQLException
- {
- throw new UnsupportedOperationException();
-
- /*
- try
- {
- if (iface.isAssignableFrom(dataSource.getClass()))
- {
- return true;
- }
- Method method = dataSource.getClass().getMethod("isWrapperFor", new Class[]{Class.class});
- return Boolean.TRUE.equals(method.invoke(dataSource, new Object[] { iface }));
- }
- catch (NoSuchMethodException e)
- {
- throw new UnsupportedOperationException();
- }
- catch (IllegalAccessException e)
- {
- throw new SQLException(e);
- }
- catch (InvocationTargetException e)
- {
- throw new SQLException(e);
- }
- */
- }
+ private DataSource dataSource;
+ private String jndiName;
+ private ConnectionManagerListener[] listeners;
+
+ // List of connections that have been borrowed by this thread but not returned.
+ // When using a threadpool, it is required that the releaseAllBorrowedConnections
+ // method be called before the thread is returned to the pool; that ensures this
+ // threadlocal is reset to null.
+ private static ThreadLocal borrowedConnections = new ThreadLocal()
+ {
+ protected Object initialValue()
+ {
+ return new HashSet();
+ }
+ };
+
+ public ConnectionManagerDataSource()
+ {
+ }
+
+ void onAfterBorrowConnection(Connection con)
+ {
+ ((Set) borrowedConnections.get()).add(con);
+
+ if (listeners != null)
+ {
+ for (int i = 0; i<listeners.length; i++)
+ {
+ listeners[i].borrowConnection(con);
+ }
+ }
+ }
+
+ public void onBeforeReleaseConnection(Connection con)
+ {
+ if (listeners != null)
+ {
+ for (int i = 0; i<listeners.length; i++)
+ {
+ listeners[i].releaseConnection(con);
+ }
+ }
+ }
+
+ void onAfterReleaseConnection(Connection con)
+ {
+ ((Set) borrowedConnections.get()).remove(con);
+ }
+
+ public static void releaseAllBorrowedConnections()
+ {
+ DisconnectableConnection[] connections = new DisconnectableConnection[((Set) borrowedConnections.get()).size()];
+ ((Set) borrowedConnections.get()).toArray(connections);
+
+ for (int i = 0; i<connections.length; i++)
+ {
+ DisconnectableConnection connection = connections[i];
+ connection.disconnect();
+ }
+
+ ((Set) borrowedConnections.get()).clear();
+ }
+
+ public void setListeners(ConnectionManagerListener[] listeners)
+ {
+ this.listeners = listeners;
+ }
+
+ public void setDataSource(DataSource dataSource)
+ {
+ this.dataSource = dataSource;
+ }
+
+ public DataSource getDataSource()
+ {
+ if (dataSource != null)
+ {
+ return dataSource;
+ }
+
+ try
+ {
+ Context ctx = new InitialContext();
+ dataSource = (DataSource) ctx.lookup(jndiName);
+ }
+ catch (NamingException e)
+ {
+ throw (IllegalArgumentException) new IllegalArgumentException(jndiName).initCause(e);
+ }
+
+ return dataSource;
+ }
+
+ public void setJndiName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public Connection getConnection() throws SQLException
+ {
+ return DisconnectableConnectionFactory.create(this);
+ }
+
+ public Connection getConnection(String username, String password) throws SQLException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PrintWriter getLogWriter() throws SQLException
+ {
+ return getDataSource().getLogWriter();
+ }
+
+ public void setLogWriter(PrintWriter out) throws SQLException
+ {
+ getDataSource().setLogWriter(out);
+ }
+
+ public void setLoginTimeout(int seconds) throws SQLException
+ {
+ getDataSource().setLoginTimeout(seconds);
+ }
+
+ public int getLoginTimeout() throws SQLException
+ {
+ return getDataSource().getLoginTimeout();
+ }
+
+ public Object unwrap(Class iface) throws SQLException
+ {
+ throw new UnsupportedOperationException();
+ /*
+ try
+ {
+ if (iface.isAssignableFrom(dataSource.getClass()))
+ {
+ return dataSource;
+ }
+
+ Method method = dataSource.getClass().getMethod("unwrap", new Class[]{Class.class});
+ return method.invoke(dataSource, new Object[] { iface });
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new UnsupportedOperationException();
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new SQLException(e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new SQLException(e);
+ }
+ */
+ }
+
+ public boolean isWrapperFor(Class iface) throws SQLException
+ {
+ throw new UnsupportedOperationException();
+
+ /*
+ try
+ {
+ if (iface.isAssignableFrom(dataSource.getClass()))
+ {
+ return true;
+ }
+ Method method = dataSource.getClass().getMethod("isWrapperFor", new Class[]{Class.class});
+ return Boolean.TRUE.equals(method.invoke(dataSource, new Object[] { iface }));
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new UnsupportedOperationException();
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new SQLException(e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new SQLException(e);
+ }
+ */
+ }
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerListener.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerListener.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerListener.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/ConnectionManagerListener.java Thu Jul 3 14:34:56 2008
@@ -30,6 +30,6 @@
*/
public interface ConnectionManagerListener
{
- public void borrowConnection(Connection con);
- public void releaseConnection(Connection con);
+ public void borrowConnection(Connection con);
+ public void releaseConnection(Connection con);
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnection.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnection.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnection.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnection.java Thu Jul 3 14:34:56 2008
@@ -30,6 +30,6 @@
*/
public interface DisconnectableConnection extends Connection
{
- public void disconnect();
- public Connection getConnection();
+ public void disconnect();
+ public Connection getConnection();
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnectionFactory.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnectionFactory.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnectionFactory.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/connectionManager/DisconnectableConnectionFactory.java Thu Jul 3 14:34:56 2008
@@ -36,108 +36,108 @@
*/
public class DisconnectableConnectionFactory
{
- private DisconnectableConnectionFactory()
- {
- }
-
- public static DisconnectableConnection create(final ConnectionManagerDataSource connectionManager)
- {
- return (DisconnectableConnection) Proxy.newProxyInstance(
-
- DisconnectableConnection.class.getClassLoader(),
-
- new Class[]
- {
- DisconnectableConnection.class
- },
-
- new InvocationHandler()
- {
- private Map connectionConfiguration = new HashMap();
- private Connection connection;
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- if ("equals".equals(method.getName()) || "hashCode".equals(method.getName())) // NON-NLS
- {
- // do not pass these methods to the connection as we dont want to change the
- // identity of the connection proxy
- return method.invoke(this, args);
- }
- else if ("close".equals(method.getName())) // NON-NLS
- {
- try
- {
- connectionManager.onBeforeReleaseConnection((Connection) proxy);
- if (connection != null)
- {
- connection.close();
- }
- connection = null;
- }
- finally
- {
- connectionManager.onAfterReleaseConnection((Connection) proxy);
- }
- return null;
- }
- else if ("disconnect".equals(method.getName())) // NON-NLS
- {
- connectionManager.onBeforeReleaseConnection((Connection) proxy);
- try
- {
- if (connection != null)
- {
- try
- {
- if (!connection.isClosed())
- {
- connection.close();
- }
- }
- catch (SQLException e)
- {
- LogFactory.getLog(DisconnectableConnectionFactory.class).warn(e.getLocalizedMessage(), e);
- }
- }
- }
- finally
- {
- connectionManager.onAfterReleaseConnection((Connection) proxy);
- connection = null;
- }
- return null;
- }
- else if ("getConnection".equals(method.getName())) // NON-NLS
- {
- return connection;
- }
-
- if (connection == null)
- {
- connection = connectionManager.getDataSource().getConnection();
-
- // if we have a configuration, we have to replay it now
- Iterator iterConfiguration = connectionConfiguration.entrySet().iterator();
- while (iterConfiguration.hasNext())
- {
- Map.Entry config = (Map.Entry) iterConfiguration.next();
- ((Method) config.getKey()).invoke(connection, (Object[]) config.getValue());
- }
-
- connectionManager.onAfterBorrowConnection((Connection) proxy);
- }
-
- Object ret = method.invoke(connection, args);
-
- // capture the connection configuration
- if (method.getName().startsWith("set")) // NON-NLS
- {
- connectionConfiguration.put(method, args);
- }
-
- return ret;
- }
- });
- }
+ private DisconnectableConnectionFactory()
+ {
+ }
+
+ public static DisconnectableConnection create(final ConnectionManagerDataSource connectionManager)
+ {
+ return (DisconnectableConnection) Proxy.newProxyInstance(
+
+ DisconnectableConnection.class.getClassLoader(),
+
+ new Class[]
+ {
+ DisconnectableConnection.class
+ },
+
+ new InvocationHandler()
+ {
+ private Map connectionConfiguration = new HashMap();
+ private Connection connection;
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ if ("equals".equals(method.getName()) || "hashCode".equals(method.getName())) // NON-NLS
+ {
+ // do not pass these methods to the connection as we dont want to change the
+ // identity of the connection proxy
+ return method.invoke(this, args);
+ }
+ else if ("close".equals(method.getName())) // NON-NLS
+ {
+ try
+ {
+ connectionManager.onBeforeReleaseConnection((Connection) proxy);
+ if (connection != null)
+ {
+ connection.close();
+ }
+ connection = null;
+ }
+ finally
+ {
+ connectionManager.onAfterReleaseConnection((Connection) proxy);
+ }
+ return null;
+ }
+ else if ("disconnect".equals(method.getName())) // NON-NLS
+ {
+ connectionManager.onBeforeReleaseConnection((Connection) proxy);
+ try
+ {
+ if (connection != null)
+ {
+ try
+ {
+ if (!connection.isClosed())
+ {
+ connection.close();
+ }
+ }
+ catch (SQLException e)
+ {
+ LogFactory.getLog(DisconnectableConnectionFactory.class).warn(e.getLocalizedMessage(), e);
+ }
+ }
+ }
+ finally
+ {
+ connectionManager.onAfterReleaseConnection((Connection) proxy);
+ connection = null;
+ }
+ return null;
+ }
+ else if ("getConnection".equals(method.getName())) // NON-NLS
+ {
+ return connection;
+ }
+
+ if (connection == null)
+ {
+ connection = connectionManager.getDataSource().getConnection();
+
+ // if we have a configuration, we have to replay it now
+ Iterator iterConfiguration = connectionConfiguration.entrySet().iterator();
+ while (iterConfiguration.hasNext())
+ {
+ Map.Entry config = (Map.Entry) iterConfiguration.next();
+ ((Method) config.getKey()).invoke(connection, (Object[]) config.getValue());
+ }
+
+ connectionManager.onAfterBorrowConnection((Connection) proxy);
+ }
+
+ Object ret = method.invoke(connection, args);
+
+ // capture the connection configuration
+ if (method.getName().startsWith("set")) // NON-NLS
+ {
+ connectionConfiguration.put(method, args);
+ }
+
+ return ret;
+ }
+ });
+ }
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ComponentHandler.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ComponentHandler.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ComponentHandler.java Thu Jul 3 14:34:56 2008
@@ -30,8 +30,8 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface ComponentHandler
{
- /**
- * The bean name which implements the DynaFormComponentHandler interface
- */
- public String value();
+ /**
+ * The bean name which implements the DynaFormComponentHandler interface
+ */
+ public String value();
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DataProvider.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DataProvider.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DataProvider.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DataProvider.java Thu Jul 3 14:34:56 2008
@@ -35,19 +35,19 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface DataProvider
{
- /**
- * An EL expression which evaluates to a list of objects of the same type
- * as the annotated property.
- */
- public String value();
+ /**
+ * An EL expression which evaluates to a list of objects of the same type
+ * as the annotated property.
+ */
+ public String value();
- /**
- * The properties to use as description.
- */
- public String description();
+ /**
+ * The properties to use as description.
+ */
+ public String description();
- /**
- * A converter to use to convert the object from/to a string value.
- */
- public String converterBean() default "";
+ /**
+ * A converter to use to convert the object from/to a string value.
+ */
+ public String converterBean() default "";
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DisplaySize.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DisplaySize.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DisplaySize.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/DisplaySize.java Thu Jul 3 14:34:56 2008
@@ -30,5 +30,5 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface DisplaySize
{
- int value();
+ int value();
}
\ No newline at end of file
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Length.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Length.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Length.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Length.java Thu Jul 3 14:34:56 2008
@@ -38,7 +38,7 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Length
{
- int min() default 0;
+ int min() default 0;
- int max() default Integer.MAX_VALUE;
+ int max() default Integer.MAX_VALUE;
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Max.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Max.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Max.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Max.java Thu Jul 3 14:34:56 2008
@@ -32,5 +32,5 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Max
{
- long value();
+ long value();
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Min.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Min.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Min.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Min.java Thu Jul 3 14:34:56 2008
@@ -32,5 +32,5 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Min
{
- long value();
+ long value();
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Range.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Range.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Range.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Range.java Thu Jul 3 14:34:56 2008
@@ -32,7 +32,7 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Range
{
- long min();
+ long min();
- long max();
+ long max();
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ReadOnly.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ReadOnly.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ReadOnly.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/ReadOnly.java Thu Jul 3 14:34:56 2008
@@ -35,8 +35,8 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface ReadOnly
{
- /**
- * set to true if you would like to render as disabled control
- */
- boolean disabled() default false;
+ /**
+ * set to true if you would like to render as disabled control
+ */
+ boolean disabled() default false;
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Temporal.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Temporal.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Temporal.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/Temporal.java Thu Jul 3 14:34:56 2008
@@ -42,5 +42,5 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface Temporal
{
- TemporalType value() default TemporalType.TIMESTAMP;
+ TemporalType value() default TemporalType.TIMESTAMP;
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/UIComponent.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/UIComponent.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/UIComponent.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/annot/ui/UIComponent.java Thu Jul 3 14:34:56 2008
@@ -44,5 +44,5 @@
@Retention(value = RetentionPolicy.RUNTIME)
public @interface UIComponent
{
- FieldRepresentation type() default FieldRepresentation.OutputText;
+ FieldRepresentation type() default FieldRepresentation.OutputText;
}
Modified: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java?rev=673822&r1=673821&r2=673822&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java (original)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/DynaConfig.java Thu Jul 3 14:34:56 2008
@@ -40,174 +40,174 @@
*/
public class DynaConfig extends UIComponentBase
{
- public static final String COMPONENT_TYPE = "org.apache.myfaces.orchestra.dynaForm.DynaConfig";
- public static final String COMPONENT_FAMILY = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.orchestra.dynaForm.DynaConfig";
+ public static final String COMPONENT_FAMILY = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
- private String forProperty;
- private Integer displaySize;
- private Boolean displayOnly;
- private Boolean readOnly;
- private Boolean disabled;
-
- @Override
- public String getFamily()
- {
- return COMPONENT_FAMILY;
- }
-
- /**
- * @see #setDisplaySize(Integer)
- */
- public Integer getDisplaySize()
- {
- if (displaySize != null)
- {
- return displaySize;
- }
- ValueBinding vb = getValueBinding("displaySize");
- return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
- }
-
- /**
- * a hint for the size the ui should use when rendering the field
- */
- public void setDisplaySize(Integer displaySize)
- {
- this.displaySize = displaySize;
- }
-
- /**
- * @see #setDisplayOnly(Boolean)
- */
- public Boolean getDisplayOnly()
- {
- if (displayOnly != null)
- {
- return displayOnly;
- }
- ValueBinding vb = getValueBinding("displayOnly");
- return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- }
-
- /**
- * set the field to display only
- */
- public void setDisplayOnly(Boolean displayOnly)
- {
- this.displayOnly = displayOnly;
- }
-
- /**
- * @see #setReadOnly(Boolean)
- */
- public Boolean getReadOnly()
- {
- if (readOnly != null)
- {
- return readOnly;
- }
- ValueBinding vb = getValueBinding("readOnly");
- return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- }
-
- /**
- * configure this field as readOnly - noneditable input field
- */
- public void setReadOnly(Boolean readOnly)
- {
- this.readOnly = readOnly;
- }
-
- /**
- * @see #setDisabled(Boolean)
- */
- public Boolean getDisabled()
- {
- if (disabled != null)
- {
- return disabled;
- }
- ValueBinding vb = getValueBinding("disabled");
- return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- }
-
- /**
- * configure this field as disabled - like readOnly but grayed too
- */
- public void setDisabled(Boolean disabled)
- {
- this.disabled = disabled;
- }
-
- /**
- * @see #setFor(String)
- */
- public String getFor()
- {
- if (forProperty != null)
- {
- return forProperty;
- }
- ValueBinding vb = getValueBinding("for");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- /**
- * the name of the property this configuration is for
- */
- public void setFor(String forProperty)
- {
- this.forProperty = forProperty;
- }
-
- @Override
- public void restoreState(FacesContext context, Object stateArray)
- {
- Object[] states = (Object[]) stateArray;
- super.restoreState(context, states[0]);
- displaySize = (Integer) states[1];
- forProperty = (String) states[2];
- displayOnly = (Boolean) states[3];
- readOnly = (Boolean) states[4];
- disabled = (Boolean) states[5];
- }
-
- @Override
- public Object saveState(FacesContext context)
- {
- return new Object[]
- {
- super.saveState(context),
- displaySize,
- forProperty,
- displayOnly,
- readOnly,
- disabled
- };
- }
-
- public void configureMetaData(MetaFieldWritable field)
- {
- if (getDisplaySize() != null)
- {
- field.setDisplaySize(getDisplaySize().intValue());
- }
- if (getDisplayOnly() != null)
- {
- field.setDisplayOnly(getDisplayOnly());
- }
- if (getReadOnly() != null)
- {
- field.setCanWrite(getReadOnly().booleanValue());
- }
- if (getDisabled() != null)
- {
- field.setDisabled(getDisabled().booleanValue());
- }
-
- if (getChildCount() > 0)
- {
- field.setWantedComponent((UIComponent) getChildren().get(0));
- }
- }
+ private String forProperty;
+ private Integer displaySize;
+ private Boolean displayOnly;
+ private Boolean readOnly;
+ private Boolean disabled;
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ /**
+ * @see #setDisplaySize(Integer)
+ */
+ public Integer getDisplaySize()
+ {
+ if (displaySize != null)
+ {
+ return displaySize;
+ }
+ ValueBinding vb = getValueBinding("displaySize");
+ return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * a hint for the size the ui should use when rendering the field
+ */
+ public void setDisplaySize(Integer displaySize)
+ {
+ this.displaySize = displaySize;
+ }
+
+ /**
+ * @see #setDisplayOnly(Boolean)
+ */
+ public Boolean getDisplayOnly()
+ {
+ if (displayOnly != null)
+ {
+ return displayOnly;
+ }
+ ValueBinding vb = getValueBinding("displayOnly");
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * set the field to display only
+ */
+ public void setDisplayOnly(Boolean displayOnly)
+ {
+ this.displayOnly = displayOnly;
+ }
+
+ /**
+ * @see #setReadOnly(Boolean)
+ */
+ public Boolean getReadOnly()
+ {
+ if (readOnly != null)
+ {
+ return readOnly;
+ }
+ ValueBinding vb = getValueBinding("readOnly");
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * configure this field as readOnly - noneditable input field
+ */
+ public void setReadOnly(Boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ /**
+ * @see #setDisabled(Boolean)
+ */
+ public Boolean getDisabled()
+ {
+ if (disabled != null)
+ {
+ return disabled;
+ }
+ ValueBinding vb = getValueBinding("disabled");
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * configure this field as disabled - like readOnly but grayed too
+ */
+ public void setDisabled(Boolean disabled)
+ {
+ this.disabled = disabled;
+ }
+
+ /**
+ * @see #setFor(String)
+ */
+ public String getFor()
+ {
+ if (forProperty != null)
+ {
+ return forProperty;
+ }
+ ValueBinding vb = getValueBinding("for");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * the name of the property this configuration is for
+ */
+ public void setFor(String forProperty)
+ {
+ this.forProperty = forProperty;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object stateArray)
+ {
+ Object[] states = (Object[]) stateArray;
+ super.restoreState(context, states[0]);
+ displaySize = (Integer) states[1];
+ forProperty = (String) states[2];
+ displayOnly = (Boolean) states[3];
+ readOnly = (Boolean) states[4];
+ disabled = (Boolean) states[5];
+ }
+
+ @Override
+ public Object saveState(FacesContext context)
+ {
+ return new Object[]
+ {
+ super.saveState(context),
+ displaySize,
+ forProperty,
+ displayOnly,
+ readOnly,
+ disabled
+ };
+ }
+
+ public void configureMetaData(MetaFieldWritable field)
+ {
+ if (getDisplaySize() != null)
+ {
+ field.setDisplaySize(getDisplaySize().intValue());
+ }
+ if (getDisplayOnly() != null)
+ {
+ field.setDisplayOnly(getDisplayOnly());
+ }
+ if (getReadOnly() != null)
+ {
+ field.setCanWrite(getReadOnly().booleanValue());
+ }
+ if (getDisabled() != null)
+ {
+ field.setDisabled(getDisabled().booleanValue());
+ }
+
+ if (getChildCount() > 0)
+ {
+ field.setWantedComponent((UIComponent) getChildren().get(0));
+ }
+ }
}
\ No newline at end of file