You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
| 2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
| 2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
| 2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
| 2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
| 2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
| 2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
| 2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <fg...@us...> - 2006-12-09 20:18:16
|
Revision: 139
http://svn.sourceforge.net/openutils/?rev=139&view=rev
Author: fgiust
Date: 2006-12-09 12:18:16 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-bshd5-1.0.3
Added Paths:
-----------
tags/openutils-bshd5-1.0.3/
tags/openutils-bshd5-1.0.3/pom.xml
tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
Removed Paths:
-------------
tags/openutils-bshd5-1.0.3/pom.xml
tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
Copied: tags/openutils-bshd5-1.0.3 (from rev 109, trunk/openutils-bshd5)
Deleted: tags/openutils-bshd5-1.0.3/pom.xml
===================================================================
--- trunk/openutils-bshd5/pom.xml 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-bshd5-1.0.3/pom.xml 2006-12-09 20:18:16 UTC (rev 139)
@@ -1,46 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <artifactId>openutils-bshd5</artifactId>
- <name>openutils base Spring-Hibernate DAO for java 5.0</name>
- <version>1.0.3-SNAPSHOT</version>
- <description>openutils base Spring-Hibernate DAO for java 5.0</description>
- <dependencies>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-hibernate3</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>3.2.0.cr5</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <optional>true</optional>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-bshd5-1.0.3/pom.xml (from rev 136, trunk/openutils-bshd5/pom.xml)
===================================================================
--- tags/openutils-bshd5-1.0.3/pom.xml (rev 0)
+++ tags/openutils-bshd5-1.0.3/pom.xml 2006-12-09 20:18:16 UTC (rev 139)
@@ -0,0 +1,52 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <artifactId>openutils-bshd5</artifactId>
+ <name>openutils base Spring-Hibernate DAO for java 5.0</name>
+ <version>1.0.3</version>
+ <description>openutils base Spring-Hibernate DAO for java 5.0</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-hibernate3</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.0.cr5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</connection>
+ <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</developerConnection>
+ <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-1.0.3</url>
+ </scm>
+</project>
\ No newline at end of file
Deleted: tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
===================================================================
--- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-12-09 20:18:16 UTC (rev 139)
@@ -1,319 +0,0 @@
-package it.openutils.hibernate.example;
-
-import it.openutils.dao.hibernate.MutableDateRange;
-
-import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.lang.ClassUtils;
-import org.apache.commons.lang.StringUtils;
-import org.hibernate.Criteria;
-import org.hibernate.HibernateException;
-import org.hibernate.criterion.Restrictions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.dao.DataRetrievalFailureException;
-
-
-/**
- * @author Fabrizio Giustina
- * @version $Id: $
- */
-public class EnhancedExample
-{
-
- private Map<String, FilterMetadata> metadata;
-
- private EnhancedExample(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
- {
- this.metadata = metadata == null ? new HashMap<String, FilterMetadata>(0) : metadata;
- fillCriteria(null, crit, filter);
- }
-
- /**
- * Logger.
- */
- private static Logger log = LoggerFactory.getLogger(EnhancedExample.class);
-
- /**
- * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
- * @param crit Criteria
- * @param filter javabean which will be analyzed for non-null properties
- * @throws HibernateException exception while building the criteria
- */
- public static void create(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
- throws HibernateException
- {
- new EnhancedExample(crit, filter, metadata);
- }
-
- /**
- * Adds contitions to an existing criteria or create sub-criteria for associations.
- * @param crit Criteria
- * @param propertyName property name in parent bean
- * @param value property value
- * @throws HibernateException exception while building the criteria
- */
- private void addCondition(Criteria crit, String propertyName, Object value, Object parentObject)
- throws HibernateException
- {
- if (isSimpleType(value))
- {
-
- // don't filter on empty strings!
- if (value instanceof String && StringUtils.isBlank((String) value))
- {
- return;
- }
-
- FilterMetadata fmd = metadata.get(propertyName);
-
- if (fmd == null)
- {
- fmd = FilterMetadata.EQUAL;
- }
-
- String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast(
- propertyName,
- ".") : propertyName;
-
- fmd.createFilter(crit, simplePropertyName, value);
-
- }
- else if (value instanceof MutableDateRange) // @todo MutableDateRange should be removed, use a FilterMetadata
- // for this scope
- {
- Date from = ((MutableDateRange) value).getFrom();
- Date to = ((MutableDateRange) value).getTo();
- if (from != null && to != null)
- {
- log.debug("crit.add(Restrictions.between({},{}, {})", new Object[]{propertyName, from, to});
- crit.add(Restrictions.between(propertyName, from, to));
- }
- else if (from != null)
- {
-
- log.debug("crit.add(Restrictions.ge({}, {})", propertyName, to);
-
- crit.add(Restrictions.ge(propertyName, from));
- }
- else if (to != null)
- {
- log.debug("crit.add(Restrictions.le({}, {})", propertyName, to);
- crit.add(Restrictions.le(propertyName, to));
- }
- }
- else
- {
- if (containsSomething(value))
- {
-
- // @todo handle multiple associations in lists?
- // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879
- if ((value instanceof Set || value instanceof List) && !((Collection) value).isEmpty())
- {
- // collection: the new criteria has already been created, now we only nee to analize content
-
- for (Object element : ((Collection) value))
- {
- String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
- .substringAfterLast(propertyName, ".") : propertyName;
- log.debug("crit.createCriteria({})", simplePropertyName);
- Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
- fillCriteria(propertyName, childrenCriteria, element);
- }
- }
- else
- {
- String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
- .substringAfterLast(propertyName, ".") : propertyName;
- log.debug("crit.createCriteria({})", simplePropertyName);
- Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
- fillCriteria(propertyName, childrenCriteria, value);
- }
- }
- }
- }
-
- /**
- * Check if the bean contains at least a valid property.
- * @param bean javabean
- * @return <code>true</code> if the bean contains at least a valid property
- */
- private boolean containsSomething(Object bean)
- {
-
- if (bean == null)
- {
- return false;
- }
- if (isSimpleType(bean))
- {
- return true;
- }
- else if (bean instanceof MutableDateRange)
- {
- return ((MutableDateRange) bean).isSet();
- }
-
- if (bean instanceof Collection)
- {
-
- Collection coll = ((Collection) bean);
- if (coll.isEmpty())
- {
- return false;
- }
-
- if (containsSomething(coll.iterator().next()))
- {
- return true;
- }
- }
- else if (bean instanceof Map)
- {
- Map coll = ((Map) bean);
- if (coll.isEmpty())
- {
- return false;
- }
-
- if (containsSomething(coll.values().iterator().next()))
- {
- return true;
- }
- }
-
- Map<String, Object> properties;
- try
- {
- properties = PropertyUtils.describe(bean);
- }
- catch (Throwable e)
- {
- if (e instanceof InvocationTargetException)
- {
- e = ((InvocationTargetException) e).getTargetException();
- }
-
- log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
- + ClassUtils.getShortClassName(bean, "NULL"), e);
- return false;
- }
-
- for (Map.Entry<String, Object> property : properties.entrySet())
- {
-
- if (!PropertyUtils.isWriteable(bean, property.getKey()))
- {
- // skip readonly properties
- continue;
- }
-
- Object propertyValue = property.getValue();
- if (propertyValue == null)
- {
- continue;
- }
-
- if (isSimpleType(propertyValue) || containsSomething(propertyValue))
- {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
- * @param crit Criteria
- * @param filter javabean which will be analyzed for non-null properties
- * @throws HibernateException exception while building the criteria
- */
- private void fillCriteria(String parentPropertyName, Criteria crit, Object filter) throws HibernateException
- {
- if ((filter instanceof Set || filter instanceof List) && !((Collection) filter).isEmpty())
- {
- // collection: the new criteria has already been created, now we only need to analize content
- for (Object element : ((Collection) filter))
- {
- fillCriteria(parentPropertyName, crit, element);
- }
- }
-
- Map<String, Object> properties;
- try
- {
- properties = PropertyUtils.describe(filter);
- }
- catch (Throwable e)
- {
- if (e instanceof InvocationTargetException)
- {
- e = ((InvocationTargetException) e).getTargetException();
- }
-
- throw new DataRetrievalFailureException(
- "Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
- + ClassUtils.getShortClassName(filter, "NULL")
- + ":"
- + e.getClass(),
- e);
- }
-
- Iterator<String> iterator = properties.keySet().iterator();
- while (iterator.hasNext())
- {
- String propertyName = iterator.next();
-
- Object value = properties.get(propertyName);
-
- // add only non-null values, ignore read-only properties
- if (value != null && PropertyUtils.isWriteable(filter, propertyName))
- {
- String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName
- + "."
- + propertyName;
- addCondition(crit, composedPropertyName, value, filter);
- }
- }
- }
-
- /**
- * Check if the given object is a simple java type
- * @param object object to check
- * @return <code>true</code>if the given object is a simple type
- */
- private boolean isSimpleType(Object object)
- {
-
- Class< ? extends Object> objClass = object.getClass();
-
- return objClass.isPrimitive()
- || objClass.equals(Integer.class)
- || objClass.equals(Long.class)
- || objClass.equals(Short.class)
- || objClass.equals(Boolean.class)
- || objClass.equals(String.class)
- || objClass.equals(Double.class)
- || objClass.equals(Float.class)
- || objClass.equals(Date.class)
- || objClass.equals(Byte.class)
- || objClass.equals(BigDecimal.class)
- || objClass.equals(Timestamp.class)
- || objClass.equals(Character.class)
- || objClass.equals(Calendar.class);
- }
-
-}
Copied: tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java (from rev 134, trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java)
===================================================================
--- tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java (rev 0)
+++ tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-12-09 20:18:16 UTC (rev 139)
@@ -0,0 +1,319 @@
+package it.openutils.hibernate.example;
+
+import it.openutils.dao.hibernate.MutableDateRange;
+
+import java.lang.reflect.InvocationTargetException;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.lang.StringUtils;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.criterion.Restrictions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DataRetrievalFailureException;
+
+
+/**
+ * @author Fabrizio Giustina
+ * @version $Id: $
+ */
+public class EnhancedExample
+{
+
+ private Map<String, FilterMetadata> metadata;
+
+ private EnhancedExample(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
+ {
+ this.metadata = metadata == null ? new HashMap<String, FilterMetadata>(0) : metadata;
+ fillCriteria(null, crit, filter);
+ }
+
+ /**
+ * Logger.
+ */
+ private static Logger log = LoggerFactory.getLogger(EnhancedExample.class);
+
+ /**
+ * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
+ * @param crit Criteria
+ * @param filter javabean which will be analyzed for non-null properties
+ * @throws HibernateException exception while building the criteria
+ */
+ public static void create(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
+ throws HibernateException
+ {
+ new EnhancedExample(crit, filter, metadata);
+ }
+
+ /**
+ * Adds contitions to an existing criteria or create sub-criteria for associations.
+ * @param crit Criteria
+ * @param propertyName property name in parent bean
+ * @param value property value
+ * @throws HibernateException exception while building the criteria
+ */
+ private void addCondition(Criteria crit, String propertyName, Object value, Object parentObject)
+ throws HibernateException
+ {
+ if (isSimpleType(value))
+ {
+
+ // don't filter on empty strings!
+ if (value instanceof String && StringUtils.isBlank((String) value))
+ {
+ return;
+ }
+
+ FilterMetadata fmd = metadata.get(propertyName);
+
+ if (fmd == null)
+ {
+ fmd = FilterMetadata.EQUAL;
+ }
+
+ String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast(
+ propertyName,
+ ".") : propertyName;
+
+ fmd.createFilter(crit, simplePropertyName, value);
+
+ }
+ else if (value instanceof MutableDateRange) // @todo MutableDateRange should be removed, use a FilterMetadata
+ // for this scope
+ {
+ Date from = ((MutableDateRange) value).getFrom();
+ Date to = ((MutableDateRange) value).getTo();
+ if (from != null && to != null)
+ {
+ log.debug("crit.add(Restrictions.between({},{}, {})", new Object[]{propertyName, from, to});
+ crit.add(Restrictions.between(propertyName, from, to));
+ }
+ else if (from != null)
+ {
+
+ log.debug("crit.add(Restrictions.ge({}, {})", propertyName, to);
+
+ crit.add(Restrictions.ge(propertyName, from));
+ }
+ else if (to != null)
+ {
+ log.debug("crit.add(Restrictions.le({}, {})", propertyName, to);
+ crit.add(Restrictions.le(propertyName, to));
+ }
+ }
+ else
+ {
+ if (containsSomething(value))
+ {
+
+ // @todo handle multiple associations in lists?
+ // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879
+ if ((value instanceof Set || value instanceof List) && !((Collection) value).isEmpty())
+ {
+ // collection: the new criteria has already been created, now we only nee to analize content
+
+ for (Object element : ((Collection) value))
+ {
+ String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
+ .substringAfterLast(propertyName, ".") : propertyName;
+ log.debug("crit.createCriteria({})", simplePropertyName);
+ Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
+ fillCriteria(propertyName, childrenCriteria, element);
+ }
+ }
+ else
+ {
+ String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
+ .substringAfterLast(propertyName, ".") : propertyName;
+ log.debug("crit.createCriteria({})", simplePropertyName);
+ Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
+ fillCriteria(propertyName, childrenCriteria, value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Check if the bean contains at least a valid property.
+ * @param bean javabean
+ * @return <code>true</code> if the bean contains at least a valid property
+ */
+ private boolean containsSomething(Object bean)
+ {
+
+ if (bean == null)
+ {
+ return false;
+ }
+ if (isSimpleType(bean))
+ {
+ return true;
+ }
+ else if (bean instanceof MutableDateRange)
+ {
+ return ((MutableDateRange) bean).isSet();
+ }
+
+ if (bean instanceof Collection)
+ {
+
+ Collection coll = ((Collection) bean);
+ if (coll.isEmpty())
+ {
+ return false;
+ }
+
+ if (containsSomething(coll.iterator().next()))
+ {
+ return true;
+ }
+ }
+ else if (bean instanceof Map)
+ {
+ Map coll = ((Map) bean);
+ if (coll.isEmpty())
+ {
+ return false;
+ }
+
+ if (containsSomething(coll.values().iterator().next()))
+ {
+ return true;
+ }
+ }
+
+ Map<String, Object> properties;
+ try
+ {
+ properties = PropertyUtils.describe(bean);
+ }
+ catch (Throwable e)
+ {
+ if (e instanceof InvocationTargetException)
+ {
+ e = ((InvocationTargetException) e).getTargetException();
+ }
+
+ log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
+ + ClassUtils.getShortClassName(bean, "NULL"), e);
+ return false;
+ }
+
+ for (Map.Entry<String, Object> property : properties.entrySet())
+ {
+
+ if (!PropertyUtils.isWriteable(bean, property.getKey()))
+ {
+ // skip readonly properties
+ continue;
+ }
+
+ Object propertyValue = property.getValue();
+ if (propertyValue == null)
+ {
+ continue;
+ }
+
+ if (isSimpleType(propertyValue) || containsSomething(propertyValue))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
+ * @param crit Criteria
+ * @param filter javabean which will be analyzed for non-null properties
+ * @throws HibernateException exception while building the criteria
+ */
+ private void fillCriteria(String parentPropertyName, Criteria crit, Object filter) throws HibernateException
+ {
+ if ((filter instanceof Set || filter instanceof List) && !((Collection) filter).isEmpty())
+ {
+ // collection: the new criteria has already been created, now we only need to analize content
+ for (Object element : ((Collection) filter))
+ {
+ fillCriteria(parentPropertyName, crit, element);
+ }
+ }
+
+ Map<String, Object> properties;
+ try
+ {
+ properties = PropertyUtils.describe(filter);
+ }
+ catch (Throwable e)
+ {
+ if (e instanceof InvocationTargetException)
+ {
+ e = ((InvocationTargetException) e).getTargetException();
+ }
+
+ throw new DataRetrievalFailureException(
+ "Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
+ + ClassUtils.getShortClassName(filter, "NULL")
+ + ":"
+ + e.getClass(),
+ e);
+ }
+
+ Iterator<String> iterator = properties.keySet().iterator();
+ while (iterator.hasNext())
+ {
+ String propertyName = iterator.next();
+
+ Object value = properties.get(propertyName);
+
+ // add only non-null values, ignore read-only properties
+ if (value != null && PropertyUtils.isWriteable(filter, propertyName))
+ {
+ String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName
+ + "."
+ + propertyName;
+ addCondition(crit, composedPropertyName, value, filter);
+ }
+ }
+ }
+
+ /**
+ * Check if the given object is a simple java type
+ * @param object object to check
+ * @return <code>true</code>if the given object is a simple type
+ */
+ private boolean isSimpleType(Object object)
+ {
+
+ Class< ? extends Object> objClass = object.getClass();
+
+ return objClass.isPrimitive()
+ || objClass.equals(Integer.class)
+ || objClass.equals(Long.class)
+ || objClass.equals(Short.class)
+ || objClass.equals(Boolean.class)
+ || objClass.equals(String.class)
+ || objClass.equals(Double.class)
+ || objClass.equals(Float.class)
+ || objClass.equals(Date.class)
+ || objClass.equals(Byte.class)
+ || objClass.equals(BigDecimal.class)
+ || objClass.equals(Timestamp.class)
+ || objClass.equals(Character.class)
+ || Calendar.class.isAssignableFrom(objClass);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-12-09 20:17:49
|
Revision: 138
http://svn.sourceforge.net/openutils/?rev=138&view=rev
Author: fgiust
Date: 2006-12-09 12:17:49 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
delete tag, will redo using release plugin
Removed Paths:
-------------
tags/openutils-bshd5-1.0.3/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-12-09 20:16:33
|
Revision: 137
http://svn.sourceforge.net/openutils/?rev=137&view=rev
Author: fgiust
Date: 2006-12-09 12:16:31 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-bshd5-1.0.3
Added Paths:
-----------
tags/openutils-bshd5-1.0.3/
tags/openutils-bshd5-1.0.3/pom.xml
tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
Removed Paths:
-------------
tags/openutils-bshd5-1.0.3/pom.xml
tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
Copied: tags/openutils-bshd5-1.0.3 (from rev 109, trunk/openutils-bshd5)
Deleted: tags/openutils-bshd5-1.0.3/pom.xml
===================================================================
--- trunk/openutils-bshd5/pom.xml 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-bshd5-1.0.3/pom.xml 2006-12-09 20:16:31 UTC (rev 137)
@@ -1,46 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <artifactId>openutils-bshd5</artifactId>
- <name>openutils base Spring-Hibernate DAO for java 5.0</name>
- <version>1.0.3-SNAPSHOT</version>
- <description>openutils base Spring-Hibernate DAO for java 5.0</description>
- <dependencies>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-hibernate3</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>3.2.0.cr5</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <optional>true</optional>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-bshd5-1.0.3/pom.xml (from rev 136, trunk/openutils-bshd5/pom.xml)
===================================================================
--- tags/openutils-bshd5-1.0.3/pom.xml (rev 0)
+++ tags/openutils-bshd5-1.0.3/pom.xml 2006-12-09 20:16:31 UTC (rev 137)
@@ -0,0 +1,52 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <artifactId>openutils-bshd5</artifactId>
+ <name>openutils base Spring-Hibernate DAO for java 5.0</name>
+ <version>1.0.3</version>
+ <description>openutils base Spring-Hibernate DAO for java 5.0</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-hibernate3</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.0.cr5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</connection>
+ <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</developerConnection>
+ <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-1.0.3</url>
+ </scm>
+</project>
\ No newline at end of file
Deleted: tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
===================================================================
--- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-12-09 20:16:31 UTC (rev 137)
@@ -1,319 +0,0 @@
-package it.openutils.hibernate.example;
-
-import it.openutils.dao.hibernate.MutableDateRange;
-
-import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.lang.ClassUtils;
-import org.apache.commons.lang.StringUtils;
-import org.hibernate.Criteria;
-import org.hibernate.HibernateException;
-import org.hibernate.criterion.Restrictions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.dao.DataRetrievalFailureException;
-
-
-/**
- * @author Fabrizio Giustina
- * @version $Id: $
- */
-public class EnhancedExample
-{
-
- private Map<String, FilterMetadata> metadata;
-
- private EnhancedExample(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
- {
- this.metadata = metadata == null ? new HashMap<String, FilterMetadata>(0) : metadata;
- fillCriteria(null, crit, filter);
- }
-
- /**
- * Logger.
- */
- private static Logger log = LoggerFactory.getLogger(EnhancedExample.class);
-
- /**
- * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
- * @param crit Criteria
- * @param filter javabean which will be analyzed for non-null properties
- * @throws HibernateException exception while building the criteria
- */
- public static void create(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
- throws HibernateException
- {
- new EnhancedExample(crit, filter, metadata);
- }
-
- /**
- * Adds contitions to an existing criteria or create sub-criteria for associations.
- * @param crit Criteria
- * @param propertyName property name in parent bean
- * @param value property value
- * @throws HibernateException exception while building the criteria
- */
- private void addCondition(Criteria crit, String propertyName, Object value, Object parentObject)
- throws HibernateException
- {
- if (isSimpleType(value))
- {
-
- // don't filter on empty strings!
- if (value instanceof String && StringUtils.isBlank((String) value))
- {
- return;
- }
-
- FilterMetadata fmd = metadata.get(propertyName);
-
- if (fmd == null)
- {
- fmd = FilterMetadata.EQUAL;
- }
-
- String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast(
- propertyName,
- ".") : propertyName;
-
- fmd.createFilter(crit, simplePropertyName, value);
-
- }
- else if (value instanceof MutableDateRange) // @todo MutableDateRange should be removed, use a FilterMetadata
- // for this scope
- {
- Date from = ((MutableDateRange) value).getFrom();
- Date to = ((MutableDateRange) value).getTo();
- if (from != null && to != null)
- {
- log.debug("crit.add(Restrictions.between({},{}, {})", new Object[]{propertyName, from, to});
- crit.add(Restrictions.between(propertyName, from, to));
- }
- else if (from != null)
- {
-
- log.debug("crit.add(Restrictions.ge({}, {})", propertyName, to);
-
- crit.add(Restrictions.ge(propertyName, from));
- }
- else if (to != null)
- {
- log.debug("crit.add(Restrictions.le({}, {})", propertyName, to);
- crit.add(Restrictions.le(propertyName, to));
- }
- }
- else
- {
- if (containsSomething(value))
- {
-
- // @todo handle multiple associations in lists?
- // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879
- if ((value instanceof Set || value instanceof List) && !((Collection) value).isEmpty())
- {
- // collection: the new criteria has already been created, now we only nee to analize content
-
- for (Object element : ((Collection) value))
- {
- String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
- .substringAfterLast(propertyName, ".") : propertyName;
- log.debug("crit.createCriteria({})", simplePropertyName);
- Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
- fillCriteria(propertyName, childrenCriteria, element);
- }
- }
- else
- {
- String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
- .substringAfterLast(propertyName, ".") : propertyName;
- log.debug("crit.createCriteria({})", simplePropertyName);
- Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
- fillCriteria(propertyName, childrenCriteria, value);
- }
- }
- }
- }
-
- /**
- * Check if the bean contains at least a valid property.
- * @param bean javabean
- * @return <code>true</code> if the bean contains at least a valid property
- */
- private boolean containsSomething(Object bean)
- {
-
- if (bean == null)
- {
- return false;
- }
- if (isSimpleType(bean))
- {
- return true;
- }
- else if (bean instanceof MutableDateRange)
- {
- return ((MutableDateRange) bean).isSet();
- }
-
- if (bean instanceof Collection)
- {
-
- Collection coll = ((Collection) bean);
- if (coll.isEmpty())
- {
- return false;
- }
-
- if (containsSomething(coll.iterator().next()))
- {
- return true;
- }
- }
- else if (bean instanceof Map)
- {
- Map coll = ((Map) bean);
- if (coll.isEmpty())
- {
- return false;
- }
-
- if (containsSomething(coll.values().iterator().next()))
- {
- return true;
- }
- }
-
- Map<String, Object> properties;
- try
- {
- properties = PropertyUtils.describe(bean);
- }
- catch (Throwable e)
- {
- if (e instanceof InvocationTargetException)
- {
- e = ((InvocationTargetException) e).getTargetException();
- }
-
- log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
- + ClassUtils.getShortClassName(bean, "NULL"), e);
- return false;
- }
-
- for (Map.Entry<String, Object> property : properties.entrySet())
- {
-
- if (!PropertyUtils.isWriteable(bean, property.getKey()))
- {
- // skip readonly properties
- continue;
- }
-
- Object propertyValue = property.getValue();
- if (propertyValue == null)
- {
- continue;
- }
-
- if (isSimpleType(propertyValue) || containsSomething(propertyValue))
- {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
- * @param crit Criteria
- * @param filter javabean which will be analyzed for non-null properties
- * @throws HibernateException exception while building the criteria
- */
- private void fillCriteria(String parentPropertyName, Criteria crit, Object filter) throws HibernateException
- {
- if ((filter instanceof Set || filter instanceof List) && !((Collection) filter).isEmpty())
- {
- // collection: the new criteria has already been created, now we only need to analize content
- for (Object element : ((Collection) filter))
- {
- fillCriteria(parentPropertyName, crit, element);
- }
- }
-
- Map<String, Object> properties;
- try
- {
- properties = PropertyUtils.describe(filter);
- }
- catch (Throwable e)
- {
- if (e instanceof InvocationTargetException)
- {
- e = ((InvocationTargetException) e).getTargetException();
- }
-
- throw new DataRetrievalFailureException(
- "Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
- + ClassUtils.getShortClassName(filter, "NULL")
- + ":"
- + e.getClass(),
- e);
- }
-
- Iterator<String> iterator = properties.keySet().iterator();
- while (iterator.hasNext())
- {
- String propertyName = iterator.next();
-
- Object value = properties.get(propertyName);
-
- // add only non-null values, ignore read-only properties
- if (value != null && PropertyUtils.isWriteable(filter, propertyName))
- {
- String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName
- + "."
- + propertyName;
- addCondition(crit, composedPropertyName, value, filter);
- }
- }
- }
-
- /**
- * Check if the given object is a simple java type
- * @param object object to check
- * @return <code>true</code>if the given object is a simple type
- */
- private boolean isSimpleType(Object object)
- {
-
- Class< ? extends Object> objClass = object.getClass();
-
- return objClass.isPrimitive()
- || objClass.equals(Integer.class)
- || objClass.equals(Long.class)
- || objClass.equals(Short.class)
- || objClass.equals(Boolean.class)
- || objClass.equals(String.class)
- || objClass.equals(Double.class)
- || objClass.equals(Float.class)
- || objClass.equals(Date.class)
- || objClass.equals(Byte.class)
- || objClass.equals(BigDecimal.class)
- || objClass.equals(Timestamp.class)
- || objClass.equals(Character.class)
- || objClass.equals(Calendar.class);
- }
-
-}
Copied: tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java (from rev 134, trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java)
===================================================================
--- tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java (rev 0)
+++ tags/openutils-bshd5-1.0.3/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-12-09 20:16:31 UTC (rev 137)
@@ -0,0 +1,319 @@
+package it.openutils.hibernate.example;
+
+import it.openutils.dao.hibernate.MutableDateRange;
+
+import java.lang.reflect.InvocationTargetException;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.lang.StringUtils;
+import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
+import org.hibernate.criterion.Restrictions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DataRetrievalFailureException;
+
+
+/**
+ * @author Fabrizio Giustina
+ * @version $Id: $
+ */
+public class EnhancedExample
+{
+
+ private Map<String, FilterMetadata> metadata;
+
+ private EnhancedExample(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
+ {
+ this.metadata = metadata == null ? new HashMap<String, FilterMetadata>(0) : metadata;
+ fillCriteria(null, crit, filter);
+ }
+
+ /**
+ * Logger.
+ */
+ private static Logger log = LoggerFactory.getLogger(EnhancedExample.class);
+
+ /**
+ * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
+ * @param crit Criteria
+ * @param filter javabean which will be analyzed for non-null properties
+ * @throws HibernateException exception while building the criteria
+ */
+ public static void create(Criteria crit, Object filter, Map<String, FilterMetadata> metadata)
+ throws HibernateException
+ {
+ new EnhancedExample(crit, filter, metadata);
+ }
+
+ /**
+ * Adds contitions to an existing criteria or create sub-criteria for associations.
+ * @param crit Criteria
+ * @param propertyName property name in parent bean
+ * @param value property value
+ * @throws HibernateException exception while building the criteria
+ */
+ private void addCondition(Criteria crit, String propertyName, Object value, Object parentObject)
+ throws HibernateException
+ {
+ if (isSimpleType(value))
+ {
+
+ // don't filter on empty strings!
+ if (value instanceof String && StringUtils.isBlank((String) value))
+ {
+ return;
+ }
+
+ FilterMetadata fmd = metadata.get(propertyName);
+
+ if (fmd == null)
+ {
+ fmd = FilterMetadata.EQUAL;
+ }
+
+ String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast(
+ propertyName,
+ ".") : propertyName;
+
+ fmd.createFilter(crit, simplePropertyName, value);
+
+ }
+ else if (value instanceof MutableDateRange) // @todo MutableDateRange should be removed, use a FilterMetadata
+ // for this scope
+ {
+ Date from = ((MutableDateRange) value).getFrom();
+ Date to = ((MutableDateRange) value).getTo();
+ if (from != null && to != null)
+ {
+ log.debug("crit.add(Restrictions.between({},{}, {})", new Object[]{propertyName, from, to});
+ crit.add(Restrictions.between(propertyName, from, to));
+ }
+ else if (from != null)
+ {
+
+ log.debug("crit.add(Restrictions.ge({}, {})", propertyName, to);
+
+ crit.add(Restrictions.ge(propertyName, from));
+ }
+ else if (to != null)
+ {
+ log.debug("crit.add(Restrictions.le({}, {})", propertyName, to);
+ crit.add(Restrictions.le(propertyName, to));
+ }
+ }
+ else
+ {
+ if (containsSomething(value))
+ {
+
+ // @todo handle multiple associations in lists?
+ // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879
+ if ((value instanceof Set || value instanceof List) && !((Collection) value).isEmpty())
+ {
+ // collection: the new criteria has already been created, now we only nee to analize content
+
+ for (Object element : ((Collection) value))
+ {
+ String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
+ .substringAfterLast(propertyName, ".") : propertyName;
+ log.debug("crit.createCriteria({})", simplePropertyName);
+ Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
+ fillCriteria(propertyName, childrenCriteria, element);
+ }
+ }
+ else
+ {
+ String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils
+ .substringAfterLast(propertyName, ".") : propertyName;
+ log.debug("crit.createCriteria({})", simplePropertyName);
+ Criteria childrenCriteria = crit.createCriteria(simplePropertyName);
+ fillCriteria(propertyName, childrenCriteria, value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Check if the bean contains at least a valid property.
+ * @param bean javabean
+ * @return <code>true</code> if the bean contains at least a valid property
+ */
+ private boolean containsSomething(Object bean)
+ {
+
+ if (bean == null)
+ {
+ return false;
+ }
+ if (isSimpleType(bean))
+ {
+ return true;
+ }
+ else if (bean instanceof MutableDateRange)
+ {
+ return ((MutableDateRange) bean).isSet();
+ }
+
+ if (bean instanceof Collection)
+ {
+
+ Collection coll = ((Collection) bean);
+ if (coll.isEmpty())
+ {
+ return false;
+ }
+
+ if (containsSomething(coll.iterator().next()))
+ {
+ return true;
+ }
+ }
+ else if (bean instanceof Map)
+ {
+ Map coll = ((Map) bean);
+ if (coll.isEmpty())
+ {
+ return false;
+ }
+
+ if (containsSomething(coll.values().iterator().next()))
+ {
+ return true;
+ }
+ }
+
+ Map<String, Object> properties;
+ try
+ {
+ properties = PropertyUtils.describe(bean);
+ }
+ catch (Throwable e)
+ {
+ if (e instanceof InvocationTargetException)
+ {
+ e = ((InvocationTargetException) e).getTargetException();
+ }
+
+ log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
+ + ClassUtils.getShortClassName(bean, "NULL"), e);
+ return false;
+ }
+
+ for (Map.Entry<String, Object> property : properties.entrySet())
+ {
+
+ if (!PropertyUtils.isWriteable(bean, property.getKey()))
+ {
+ // skip readonly properties
+ continue;
+ }
+
+ Object propertyValue = property.getValue();
+ if (propertyValue == null)
+ {
+ continue;
+ }
+
+ if (isSimpleType(propertyValue) || containsSomething(propertyValue))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Fills a criteria object calling addCondition() for any non-null property or for any component in collections.
+ * @param crit Criteria
+ * @param filter javabean which will be analyzed for non-null properties
+ * @throws HibernateException exception while building the criteria
+ */
+ private void fillCriteria(String parentPropertyName, Criteria crit, Object filter) throws HibernateException
+ {
+ if ((filter instanceof Set || filter instanceof List) && !((Collection) filter).isEmpty())
+ {
+ // collection: the new criteria has already been created, now we only need to analize content
+ for (Object element : ((Collection) filter))
+ {
+ fillCriteria(parentPropertyName, crit, element);
+ }
+ }
+
+ Map<String, Object> properties;
+ try
+ {
+ properties = PropertyUtils.describe(filter);
+ }
+ catch (Throwable e)
+ {
+ if (e instanceof InvocationTargetException)
+ {
+ e = ((InvocationTargetException) e).getTargetException();
+ }
+
+ throw new DataRetrievalFailureException(
+ "Unable to build filter, PropertyUtils.describe throws an exception while analizing class "
+ + ClassUtils.getShortClassName(filter, "NULL")
+ + ":"
+ + e.getClass(),
+ e);
+ }
+
+ Iterator<String> iterator = properties.keySet().iterator();
+ while (iterator.hasNext())
+ {
+ String propertyName = iterator.next();
+
+ Object value = properties.get(propertyName);
+
+ // add only non-null values, ignore read-only properties
+ if (value != null && PropertyUtils.isWriteable(filter, propertyName))
+ {
+ String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName
+ + "."
+ + propertyName;
+ addCondition(crit, composedPropertyName, value, filter);
+ }
+ }
+ }
+
+ /**
+ * Check if the given object is a simple java type
+ * @param object object to check
+ * @return <code>true</code>if the given object is a simple type
+ */
+ private boolean isSimpleType(Object object)
+ {
+
+ Class< ? extends Object> objClass = object.getClass();
+
+ return objClass.isPrimitive()
+ || objClass.equals(Integer.class)
+ || objClass.equals(Long.class)
+ || objClass.equals(Short.class)
+ || objClass.equals(Boolean.class)
+ || objClass.equals(String.class)
+ || objClass.equals(Double.class)
+ || objClass.equals(Float.class)
+ || objClass.equals(Date.class)
+ || objClass.equals(Byte.class)
+ || objClass.equals(BigDecimal.class)
+ || objClass.equals(Timestamp.class)
+ || objClass.equals(Character.class)
+ || Calendar.class.isAssignableFrom(objClass);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-12-09 20:12:08
|
Revision: 136
http://svn.sourceforge.net/openutils/?rev=136&view=rev
Author: fgiust
Date: 2006-12-09 12:12:06 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
change svn url to nex sintax
Modified Paths:
--------------
trunk/openutils-bshd5/pom.xml
Modified: trunk/openutils-bshd5/pom.xml
===================================================================
--- trunk/openutils-bshd5/pom.xml 2006-12-05 15:34:21 UTC (rev 135)
+++ trunk/openutils-bshd5/pom.xml 2006-12-09 20:12:06 UTC (rev 136)
@@ -45,8 +45,8 @@
</dependencies>
<scm>
- <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</connection>
- <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</developerConnection>
- <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-1.0.3</url>
+ <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</connection>
+ <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</developerConnection>
+ <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-1.0.3</url>
</scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-12-05 15:34:22
|
Revision: 135
http://svn.sourceforge.net/openutils/?rev=135&view=rev
Author: fgiust
Date: 2006-12-05 07:34:21 -0800 (Tue, 05 Dec 2006)
Log Message:
-----------
[maven-release-plugin] prepare release openutils-bshd5-1.0.3
Modified Paths:
--------------
trunk/openutils-bshd5/pom.xml
Modified: trunk/openutils-bshd5/pom.xml
===================================================================
--- trunk/openutils-bshd5/pom.xml 2006-12-05 15:33:48 UTC (rev 134)
+++ trunk/openutils-bshd5/pom.xml 2006-12-05 15:34:21 UTC (rev 135)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-bshd5</artifactId>
<name>openutils base Spring-Hibernate DAO for java 5.0</name>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.3</version>
<description>openutils base Spring-Hibernate DAO for java 5.0</description>
<dependencies>
<dependency>
@@ -43,4 +43,10 @@
<optional>true</optional>
</dependency>
</dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-1.0.3</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-1.0.3</url>
+ </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-12-05 15:33:51
|
Revision: 134
http://svn.sourceforge.net/openutils/?rev=134&view=rev
Author: fgiust
Date: 2006-12-05 07:33:48 -0800 (Tue, 05 Dec 2006)
Log Message:
-----------
fix calendar paramters
Modified Paths:
--------------
trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java
===================================================================
--- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-11-20 19:54:23 UTC (rev 133)
+++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2006-12-05 15:33:48 UTC (rev 134)
@@ -313,7 +313,7 @@
|| objClass.equals(BigDecimal.class)
|| objClass.equals(Timestamp.class)
|| objClass.equals(Character.class)
- || objClass.equals(Calendar.class);
+ || Calendar.class.isAssignableFrom(objClass);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-20 20:50:33
|
Revision: 130
http://svn.sourceforge.net/openutils/?rev=130&view=rev
Author: fgiust
Date: 2006-11-20 11:39:55 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare release openutils-usermanagement-dataobjects-1.1.1
Modified Paths:
--------------
trunk/openutils-usermanagement-dataobjects/pom.xml
Modified: trunk/openutils-usermanagement-dataobjects/pom.xml
===================================================================
--- trunk/openutils-usermanagement-dataobjects/pom.xml 2006-11-20 19:38:07 UTC (rev 129)
+++ trunk/openutils-usermanagement-dataobjects/pom.xml 2006-11-20 19:39:55 UTC (rev 130)
@@ -10,7 +10,7 @@
<artifactId>openutils-usermanagement-dataobjects</artifactId>
<packaging>jar</packaging>
<name>openutils-usermanagement-dataobjects</name>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.1</version>
<description>Usermanagement dataobjects</description>
<dependencies>
<dependency>
@@ -70,4 +70,10 @@
</exclusions>
</dependency>
</dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</url>
+ </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-20 20:49:24
|
Revision: 129
http://svn.sourceforge.net/openutils/?rev=129&view=rev
Author: fgiust
Date: 2006-11-20 11:38:07 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
add equals and hashcode
Modified Paths:
--------------
trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Group.java
trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Role.java
trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java
Modified: trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Group.java
===================================================================
--- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Group.java 2006-11-16 10:09:48 UTC (rev 128)
+++ trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Group.java 2006-11-20 19:38:07 UTC (rev 129)
@@ -107,4 +107,49 @@
this.roles = roles;
}
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ final Group other = (Group) obj;
+ if (this.id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!this.id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
}
Modified: trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Role.java
===================================================================
--- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Role.java 2006-11-16 10:09:48 UTC (rev 128)
+++ trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Role.java 2006-11-20 19:38:07 UTC (rev 129)
@@ -71,4 +71,47 @@
this.description).toString();
}
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ final Role other = (Role) obj;
+ if (this.id == null)
+ {
+ if (other.id != null)
+ return false;
+ }
+ else if (!this.id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
}
Modified: trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java
===================================================================
--- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2006-11-16 10:09:48 UTC (rev 128)
+++ trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2006-11-20 19:38:07 UTC (rev 129)
@@ -52,7 +52,7 @@
private String name;
@Column(name = "SURNAME", nullable = false, length = 80)
- private String surname;
+ private String lastname;
@Column(name = "EMAIL", nullable = false, length = 150)
private String email;
@@ -187,7 +187,7 @@
*/
public boolean isEnabled()
{
- return (this.enabled == null) ? false : this.enabled.booleanValue();
+ return Boolean.TRUE.equals(this.enabled);
}
public String getName()
@@ -202,14 +202,24 @@
public String getSurname()
{
- return surname;
+ return lastname;
}
public void setSurname(String surname)
{
- this.surname = surname;
+ this.lastname = surname;
}
+ public void setLastname(String lastname)
+ {
+ this.lastname = lastname;
+ }
+
+ public String getLastname()
+ {
+ return lastname;
+ }
+
/**
* Getter for <code>email</code>.
* @return Returns the email.
@@ -236,11 +246,56 @@
{
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
"enabled",
- this.enabled).append("name", this.name).append("surname", this.surname).append(
+ this.enabled).append("name", this.name).append("surname", this.lastname).append(
"authorities",
this.getAuthorities()).append("username", this.getUsername()).append("email", this.email).append(
"password",
this.password).toString();
}
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ final User other = (User) obj;
+ if (this.id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!this.id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-20 19:54:30
|
Revision: 133
http://svn.sourceforge.net/openutils/?rev=133&view=rev
Author: fgiust
Date: 2006-11-20 11:54:23 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
move to dataobjects v. 1.1.1
Modified Paths:
--------------
trunk/openutils-usermanagement/pom.xml
Modified: trunk/openutils-usermanagement/pom.xml
===================================================================
--- trunk/openutils-usermanagement/pom.xml 2006-11-20 19:40:38 UTC (rev 132)
+++ trunk/openutils-usermanagement/pom.xml 2006-11-20 19:54:23 UTC (rev 133)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sourceforge.openutils</groupId>
@@ -22,7 +23,7 @@
<dependency>
<groupId>net.sourceforge.openutils</groupId>
<artifactId>openutils-usermanagement-dataobjects</artifactId>
- <version>1.1</version>
+ <version>1.1.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.openutils</groupId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-20 19:49:49
|
Revision: 131
http://svn.sourceforge.net/openutils/?rev=131&view=rev
Author: fgiust
Date: 2006-11-20 11:40:26 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-usermanagement-dataobjects-1.1.1
Added Paths:
-----------
tags/openutils-usermanagement-dataobjects-1.1.1/
tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml
tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java
tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java
tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java
Removed Paths:
-------------
tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml
tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java
tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java
tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java
Copied: tags/openutils-usermanagement-dataobjects-1.1.1 (from rev 109, trunk/openutils-usermanagement-dataobjects)
Deleted: tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml
===================================================================
--- trunk/openutils-usermanagement-dataobjects/pom.xml 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml 2006-11-20 19:40:26 UTC (rev 131)
@@ -1,73 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-usermanagement-dataobjects</artifactId>
- <packaging>jar</packaging>
- <name>openutils-usermanagement-dataobjects</name>
- <version>1.1.1-SNAPSHOT</version>
- <description>Usermanagement dataobjects</description>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.2.0.ga</version>
- <exclusions>
- <exclusion>
- <!-- not needed here, just load annotations -->
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.acegisecurity</groupId>
- <artifactId>acegi-security</artifactId>
- <version>1.0.2</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-remoting</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-support</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- <exclusion>
- <groupId>oro</groupId>
- <artifactId>oro</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml (from rev 130, trunk/openutils-usermanagement-dataobjects/pom.xml)
===================================================================
--- tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml (rev 0)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/pom.xml 2006-11-20 19:40:26 UTC (rev 131)
@@ -0,0 +1,79 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-usermanagement-dataobjects</artifactId>
+ <packaging>jar</packaging>
+ <name>openutils-usermanagement-dataobjects</name>
+ <version>1.1.1</version>
+ <description>Usermanagement dataobjects</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.2.0.ga</version>
+ <exclusions>
+ <exclusion>
+ <!-- not needed here, just load annotations -->
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.acegisecurity</groupId>
+ <artifactId>acegi-security</artifactId>
+ <version>1.0.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-remoting</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-support</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</url>
+ </scm>
+</project>
\ No newline at end of file
Deleted: tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java
===================================================================
--- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Group.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java 2006-11-20 19:40:26 UTC (rev 131)
@@ -1,110 +0,0 @@
-package it.openutils.usermanagement.dataobjects;
-
-import java.io.Serializable;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-import org.hibernate.annotations.Fetch;
-import org.hibernate.annotations.FetchMode;
-
-
-/**
- * @author fberar
- * @version $Revision$ ($Author$)
- */
-@Entity
-@Table(name = "APP_GROUP")
-public class Group implements Serializable
-{
-
- /**
- * stable serialVersionUID.
- */
- private static final long serialVersionUID = 1L;
-
- @Id
- @Column(name = "ID_GROUP", length = 100)
- private String id;
-
- @Column(name = "DESCRIPTION", length = 255, nullable = false)
- private String description;
-
- @Column(name = "ENABLED", nullable = false)
- private Boolean enabled;
-
- @ManyToMany(cascade = CascadeType.PERSIST, targetEntity = Role.class, fetch = FetchType.EAGER)
- @Fetch(FetchMode.SUBSELECT)
- @JoinTable(name = "APP_GROUP_ROLE", joinColumns = @JoinColumn(name = "ID_GROUP"), inverseJoinColumns = @JoinColumn(name = "ID_ROLE"))
- private Set<Role> roles;
-
- /**
- * Getter for <code>id</code>.
- * @return Returns the id.
- */
- public String getId()
- {
- return this.id;
- }
-
- /**
- * Setter for <code>id</code>.
- * @param id The id to set.
- */
- public void setId(String id)
- {
- this.id = id;
- }
-
- public Boolean getEnabled()
- {
- return this.enabled;
- }
-
- public void setEnabled(Boolean enabled)
- {
- this.enabled = enabled;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
- "description",
- this.description).append("enabled", this.enabled).toString();
- }
-
- public Set<Role> getRoles()
- {
- return roles;
- }
-
- public void setRoles(Set<Role> roles)
- {
- this.roles = roles;
- }
-
-}
Copied: tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java (from rev 129, trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Group.java)
===================================================================
--- tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java (rev 0)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Group.java 2006-11-20 19:40:26 UTC (rev 131)
@@ -0,0 +1,155 @@
+package it.openutils.usermanagement.dataobjects;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.Table;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
+
+
+/**
+ * @author fberar
+ * @version $Revision$ ($Author$)
+ */
+@Entity
+@Table(name = "APP_GROUP")
+public class Group implements Serializable
+{
+
+ /**
+ * stable serialVersionUID.
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "ID_GROUP", length = 100)
+ private String id;
+
+ @Column(name = "DESCRIPTION", length = 255, nullable = false)
+ private String description;
+
+ @Column(name = "ENABLED", nullable = false)
+ private Boolean enabled;
+
+ @ManyToMany(cascade = CascadeType.PERSIST, targetEntity = Role.class, fetch = FetchType.EAGER)
+ @Fetch(FetchMode.SUBSELECT)
+ @JoinTable(name = "APP_GROUP_ROLE", joinColumns = @JoinColumn(name = "ID_GROUP"), inverseJoinColumns = @JoinColumn(name = "ID_ROLE"))
+ private Set<Role> roles;
+
+ /**
+ * Getter for <code>id</code>.
+ * @return Returns the id.
+ */
+ public String getId()
+ {
+ return this.id;
+ }
+
+ /**
+ * Setter for <code>id</code>.
+ * @param id The id to set.
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public Boolean getEnabled()
+ {
+ return this.enabled;
+ }
+
+ public void setEnabled(Boolean enabled)
+ {
+ this.enabled = enabled;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
+ "description",
+ this.description).append("enabled", this.enabled).toString();
+ }
+
+ public Set<Role> getRoles()
+ {
+ return roles;
+ }
+
+ public void setRoles(Set<Role> roles)
+ {
+ this.roles = roles;
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ final Group other = (Group) obj;
+ if (this.id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!this.id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
+}
Deleted: tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java
===================================================================
--- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Role.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java 2006-11-20 19:40:26 UTC (rev 131)
@@ -1,74 +0,0 @@
-package it.openutils.usermanagement.dataobjects;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-
-
-/**
- * @author fberar
- * @version $Revision$ ($Author$)
- */
-@Entity
-@Table(name = "APP_ROLE")
-public class Role implements Serializable
-{
-
- /**
- * stable serialVersionUID.
- */
- private static final long serialVersionUID = 1L;
-
- @Id
- @Column(name = "ID_ROLE", length = 100)
- private String id;
-
- @Column(name = "DESCRIPTION", length = 255, nullable = false)
- private String description;
-
- /**
- * Getter for <code>id</code>.
- * @return Returns the id.
- */
- public String getId()
- {
- return this.id;
- }
-
- /**
- * Setter for <code>id</code>.
- * @param id The id to set.
- */
- public void setId(String id)
- {
- this.id = id;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
- "description",
- this.description).toString();
- }
-
-}
Copied: tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java (from rev 129, trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/Role.java)
===================================================================
--- tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java (rev 0)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/Role.java 2006-11-20 19:40:26 UTC (rev 131)
@@ -0,0 +1,117 @@
+package it.openutils.usermanagement.dataobjects;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
+
+/**
+ * @author fberar
+ * @version $Revision$ ($Author$)
+ */
+@Entity
+@Table(name = "APP_ROLE")
+public class Role implements Serializable
+{
+
+ /**
+ * stable serialVersionUID.
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "ID_ROLE", length = 100)
+ private String id;
+
+ @Column(name = "DESCRIPTION", length = 255, nullable = false)
+ private String description;
+
+ /**
+ * Getter for <code>id</code>.
+ * @return Returns the id.
+ */
+ public String getId()
+ {
+ return this.id;
+ }
+
+ /**
+ * Setter for <code>id</code>.
+ * @param id The id to set.
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
+ "description",
+ this.description).toString();
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ final Role other = (Role) obj;
+ if (this.id == null)
+ {
+ if (other.id != null)
+ return false;
+ }
+ else if (!this.id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
+}
Deleted: tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java
===================================================================
--- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2006-11-20 19:40:26 UTC (rev 131)
@@ -1,246 +0,0 @@
-package it.openutils.usermanagement.dataobjects;
-
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
-
-import org.acegisecurity.GrantedAuthority;
-import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.userdetails.UserDetails;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-import org.hibernate.annotations.Fetch;
-import org.hibernate.annotations.FetchMode;
-
-
-/**
- * @author fberar
- * @version $Revision$ ($Author$)
- */
-@Entity
-@Table(name = "APP_USER")
-public class User implements Serializable, UserDetails
-{
-
- /**
- * stable serialVersionUID.
- */
- private static final long serialVersionUID = 1L;
-
- @Id
- @Column(name = "ID_USER", length = 50)
- private String id;
-
- @Column(name = "PASSWORD", nullable = false, length = 50)
- private String password;
-
- @Column(name = "ENABLED", nullable = false)
- private Boolean enabled;
-
- @Column(name = "NAME", nullable = false, length = 80)
- private String name;
-
- @Column(name = "SURNAME", nullable = false, length = 80)
- private String surname;
-
- @Column(name = "EMAIL", nullable = false, length = 150)
- private String email;
-
- @ManyToMany(cascade = CascadeType.PERSIST, targetEntity = Group.class, fetch = FetchType.EAGER)
- @Fetch(FetchMode.SUBSELECT)
- @JoinTable(name = "APP_USER_GROUP", joinColumns = @JoinColumn(name = "ID_USER"), inverseJoinColumns = @JoinColumn(name = "ID_GROUP"))
- private Set<Group> groups;
-
- public Set<Group> getGroups()
- {
- return groups;
- }
-
- public void setGroups(Set<Group> groups)
- {
- this.groups = groups;
- }
-
- /**
- * Getter for <code>id</code>.
- * @return Returns the id.
- */
- public String getId()
- {
- return this.id;
- }
-
- /**
- * Setter for <code>id</code>.
- * @param id The id to set.
- */
- public void setId(String id)
- {
- this.id = id;
- }
-
- public Boolean getEnabled()
- {
- return this.enabled;
- }
-
- public void setEnabled(Boolean enabled)
- {
- this.enabled = enabled;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public void setPassword(String password)
- {
- this.password = password;
- }
-
- public Set<Role> getRoles()
- {
- if (groups == null)
- {
- return null;
- }
-
- Set<Role> roles = new HashSet<Role>();
-
- for (Group group : groups)
- {
- roles.addAll(group.getRoles());
- }
-
- return roles;
- }
-
- /**
- * @see UserDetails.isAccountNonExpired()
- */
- public boolean isAccountNonExpired()
- {
- return (this.enabled == null) ? false : this.enabled.booleanValue();
- }
-
- /**
- * @see UserDetails.isAccountNonLocked()
- */
- public boolean isAccountNonLocked()
- {
- return (this.enabled == null) ? false : this.enabled.booleanValue();
- }
-
- /**
- * @see UserDetails.isCredentialsNonExpired()
- */
- public boolean isCredentialsNonExpired()
- {
- return (this.enabled == null) ? false : this.enabled.booleanValue();
- }
-
- /**
- * @see UserDetails.getAuthorities()
- */
- public GrantedAuthority[] getAuthorities()
- {
- if (this.getRoles() == null)
- {
- return null;
- }
-
- GrantedAuthority[] auths = new GrantedAuthorityImpl[this.getRoles().size()];
- Iterator<Role> iter = this.getRoles().iterator();
- int i = 0;
- while (iter.hasNext())
- {
- Role r = iter.next();
- auths[i] = new GrantedAuthorityImpl(r.getId());
- i++;
- }
-
- return auths;
- }
-
- /**
- * @see UserDetails.getUsername()
- */
- public String getUsername()
- {
- return this.id;
- }
-
- /**
- * @see UserDetails.isEnabled()
- */
- public boolean isEnabled()
- {
- return (this.enabled == null) ? false : this.enabled.booleanValue();
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getSurname()
- {
- return surname;
- }
-
- public void setSurname(String surname)
- {
- this.surname = surname;
- }
-
- /**
- * Getter for <code>email</code>.
- * @return Returns the email.
- */
- public String getEmail()
- {
- return this.email;
- }
-
- /**
- * Setter for <code>email</code>.
- * @param email The email to set.
- */
- public void setEmail(String email)
- {
- this.email = email;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
- "enabled",
- this.enabled).append("name", this.name).append("surname", this.surname).append(
- "authorities",
- this.getAuthorities()).append("username", this.getUsername()).append("email", this.email).append(
- "password",
- this.password).toString();
- }
-
-}
Copied: tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java (from rev 129, trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java)
===================================================================
--- tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java (rev 0)
+++ tags/openutils-usermanagement-dataobjects-1.1.1/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2006-11-20 19:40:26 UTC (rev 131)
@@ -0,0 +1,301 @@
+package it.openutils.usermanagement.dataobjects;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.Table;
+
+import org.acegisecurity.GrantedAuthority;
+import org.acegisecurity.GrantedAuthorityImpl;
+import org.acegisecurity.userdetails.UserDetails;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
+
+
+/**
+ * @author fberar
+ * @version $Revision$ ($Author$)
+ */
+@Entity
+@Table(name = "APP_USER")
+public class User implements Serializable, UserDetails
+{
+
+ /**
+ * stable serialVersionUID.
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "ID_USER", length = 50)
+ private String id;
+
+ @Column(name = "PASSWORD", nullable = false, length = 50)
+ private String password;
+
+ @Column(name = "ENABLED", nullable = false)
+ private Boolean enabled;
+
+ @Column(name = "NAME", nullable = false, length = 80)
+ private String name;
+
+ @Column(name = "SURNAME", nullable = false, length = 80)
+ private String lastname;
+
+ @Column(name = "EMAIL", nullable = false, length = 150)
+ private String email;
+
+ @ManyToMany(cascade = CascadeType.PERSIST, targetEntity = Group.class, fetch = FetchType.EAGER)
+ @Fetch(FetchMode.SUBSELECT)
+ @JoinTable(name = "APP_USER_GROUP", joinColumns = @JoinColumn(name = "ID_USER"), inverseJoinColumns = @JoinColumn(name = "ID_GROUP"))
+ private Set<Group> groups;
+
+ public Set<Group> getGroups()
+ {
+ return groups;
+ }
+
+ public void setGroups(Set<Group> groups)
+ {
+ this.groups = groups;
+ }
+
+ /**
+ * Getter for <code>id</code>.
+ * @return Returns the id.
+ */
+ public String getId()
+ {
+ return this.id;
+ }
+
+ /**
+ * Setter for <code>id</code>.
+ * @param id The id to set.
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public Boolean getEnabled()
+ {
+ return this.enabled;
+ }
+
+ public void setEnabled(Boolean enabled)
+ {
+ this.enabled = enabled;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public Set<Role> getRoles()
+ {
+ if (groups == null)
+ {
+ return null;
+ }
+
+ Set<Role> roles = new HashSet<Role>();
+
+ for (Group group : groups)
+ {
+ roles.addAll(group.getRoles());
+ }
+
+ return roles;
+ }
+
+ /**
+ * @see UserDetails.isAccountNonExpired()
+ */
+ public boolean isAccountNonExpired()
+ {
+ return (this.enabled == null) ? false : this.enabled.booleanValue();
+ }
+
+ /**
+ * @see UserDetails.isAccountNonLocked()
+ */
+ public boolean isAccountNonLocked()
+ {
+ return (this.enabled == null) ? false : this.enabled.booleanValue();
+ }
+
+ /**
+ * @see UserDetails.isCredentialsNonExpired()
+ */
+ public boolean isCredentialsNonExpired()
+ {
+ return (this.enabled == null) ? false : this.enabled.booleanValue();
+ }
+
+ /**
+ * @see UserDetails.getAuthorities()
+ */
+ public GrantedAuthority[] getAuthorities()
+ {
+ if (this.getRoles() == null)
+ {
+ return null;
+ }
+
+ GrantedAuthority[] auths = new GrantedAuthorityImpl[this.getRoles().size()];
+ Iterator<Role> iter = this.getRoles().iterator();
+ int i = 0;
+ while (iter.hasNext())
+ {
+ Role r = iter.next();
+ auths[i] = new GrantedAuthorityImpl(r.getId());
+ i++;
+ }
+
+ return auths;
+ }
+
+ /**
+ * @see UserDetails.getUsername()
+ */
+ public String getUsername()
+ {
+ return this.id;
+ }
+
+ /**
+ * @see UserDetails.isEnabled()
+ */
+ public boolean isEnabled()
+ {
+ return Boolean.TRUE.equals(this.enabled);
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getSurname()
+ {
+ return lastname;
+ }
+
+ public void setSurname(String surname)
+ {
+ this.lastname = surname;
+ }
+
+ public void setLastname(String lastname)
+ {
+ this.lastname = lastname;
+ }
+
+ public String getLastname()
+ {
+ return lastname;
+ }
+
+ /**
+ * Getter for <code>email</code>.
+ * @return Returns the email.
+ */
+ public String getEmail()
+ {
+ return this.email;
+ }
+
+ /**
+ * Setter for <code>email</code>.
+ * @param email The email to set.
+ */
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", this.id).append(
+ "enabled",
+ this.enabled).append("name", this.name).append("surname", this.lastname).append(
+ "authorities",
+ this.getAuthorities()).append("username", this.getUsername()).append("email", this.email).append(
+ "password",
+ this.password).toString();
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ final User other = (User) obj;
+ if (this.id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!this.id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-20 19:49:40
|
Revision: 132
http://svn.sourceforge.net/openutils/?rev=132&view=rev
Author: fgiust
Date: 2006-11-20 11:40:38 -0800 (Mon, 20 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/openutils-usermanagement-dataobjects/pom.xml
Modified: trunk/openutils-usermanagement-dataobjects/pom.xml
===================================================================
--- trunk/openutils-usermanagement-dataobjects/pom.xml 2006-11-20 19:40:26 UTC (rev 131)
+++ trunk/openutils-usermanagement-dataobjects/pom.xml 2006-11-20 19:40:38 UTC (rev 132)
@@ -10,7 +10,7 @@
<artifactId>openutils-usermanagement-dataobjects</artifactId>
<packaging>jar</packaging>
<name>openutils-usermanagement-dataobjects</name>
- <version>1.1.1</version>
+ <version>1.1.2-SNAPSHOT</version>
<description>Usermanagement dataobjects</description>
<dependencies>
<dependency>
@@ -70,10 +70,4 @@
</exclusions>
</dependency>
</dependencies>
-
- <scm>
- <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</connection>
- <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</developerConnection>
- <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-usermanagement-dataobjects-1.1.1</url>
- </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 10:09:47
|
Revision: 128
http://svn.sourceforge.net/openutils/?rev=128&view=rev
Author: fgiust
Date: 2006-11-16 02:09:48 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/openutils-deployment/pom.xml
Modified: trunk/openutils-deployment/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-16 10:09:39 UTC (rev 127)
+++ trunk/openutils-deployment/pom.xml 2006-11-16 10:09:48 UTC (rev 128)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-deployment</artifactId>
<name>openutils deployment tools</name>
- <version>1.0.3</version>
+ <version>1.0.4-SNAPSHOT</version>
<description />
<dependencies>
<dependency>
@@ -67,10 +67,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <scm>
- <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.3</connection>
- <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.3</developerConnection>
- <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.3</url>
- </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 10:09:39
|
Revision: 127
http://svn.sourceforge.net/openutils/?rev=127&view=rev
Author: fgiust
Date: 2006-11-16 02:09:39 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-deployment-1.0.3
Added Paths:
-----------
tags/openutils-deployment-1.0.3/
tags/openutils-deployment-1.0.3/pom.xml
tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
Removed Paths:
-------------
tags/openutils-deployment-1.0.3/pom.xml
tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
Copied: tags/openutils-deployment-1.0.3 (from rev 117, trunk/openutils-deployment)
Deleted: tags/openutils-deployment-1.0.3/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-15 17:45:28 UTC (rev 117)
+++ tags/openutils-deployment-1.0.3/pom.xml 2006-11-16 10:09:39 UTC (rev 127)
@@ -1,70 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <artifactId>openutils-deployment</artifactId>
- <name>openutils deployment tools</name>
- <version>1.1-SNAPSHOT</version>
- <description />
- <dependencies>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>2.0</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>logkit</groupId>
- <artifactId>logkit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-deployment-1.0.3/pom.xml (from rev 126, trunk/openutils-deployment/pom.xml)
===================================================================
--- tags/openutils-deployment-1.0.3/pom.xml (rev 0)
+++ tags/openutils-deployment-1.0.3/pom.xml 2006-11-16 10:09:39 UTC (rev 127)
@@ -0,0 +1,76 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <artifactId>openutils-deployment</artifactId>
+ <name>openutils deployment tools</name>
+ <version>1.0.3</version>
+ <description />
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>2.0</version>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.3</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.3</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.3</url>
+ </scm>
+</project>
\ No newline at end of file
Deleted: tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
===================================================================
--- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-15 17:45:28 UTC (rev 117)
+++ tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 10:09:39 UTC (rev 127)
@@ -1,155 +0,0 @@
-package it.openutils.deployment.spring;
-
-import java.io.File;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.UnknownHostException;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.UrlResource;
-import org.springframework.web.context.ServletContextAware;
-
-
-/**
- * @author fgiust
- * @version $Id: $
- */
-public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware
-{
-
- private String fileLocation;
-
- private String defaultEnvironment;
-
- private ServletContext servletContext;
-
- /**
- * Logger.
- */
- private static Logger log = LoggerFactory.getLogger(EnvironmentPropertyConfigurer.class);
-
- /**
- * {@inheritDoc}
- */
- public void setServletContext(ServletContext servletContext)
- {
- this.servletContext = servletContext;
- }
-
- /**
- * Setter for <code>fileLocation</code>.
- * @param fileLocation The fileLocation to set.
- */
- public void setFileLocation(String fileLocation)
- {
- this.fileLocation = fileLocation;
- }
-
- /**
- * Setter for <code>defaultEnvironment</code>.
- * @param defaultEnvironment The defaultEnvironment to set.
- */
- public void setDefaultEnvironment(String defaultEnvironment)
- {
- this.defaultEnvironment = defaultEnvironment;
- }
-
- private String getRootPath()
- {
- if (servletContext != null)
- {
- return servletContext.getRealPath("/");
- }
- return "src/main/webapp/";
- }
-
- private URL getResource(String resource)
- {
- URL url = null;
-
- if (servletContext != null)
- {
- try
- {
- url = servletContext.getResource(resource);
- }
- catch (MalformedURLException e)
- {
- log.error(e.getMessage(), e);
- }
- }
- else
- {
- try
- {
- return new File(getRootPath(), resource).toURL();
- }
- catch (MalformedURLException e)
- {
- log.error(e.getMessage(), e);
- }
- // test
- }
- return url;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
- {
- if (fileLocation != null)
- {
-
- String hostname = null;
-
- try
- {
- hostname = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName());
- }
- catch (UnknownHostException e)
- {
- log.error(e.getMessage());
- }
-
- System.setProperty("env", hostname);
-
- String resolvedLocation = StringUtils.replace(fileLocation, "${env}", hostname);
- URL propertyUrl = null;
-
- propertyUrl = getResource(resolvedLocation);
-
- if (propertyUrl == null)
- {
- log.info("No environment specific properties found at {}, using default", resolvedLocation);
- resolvedLocation = StringUtils.replace(fileLocation, "${env}", this.defaultEnvironment);
-
- propertyUrl = getResource(resolvedLocation);
-
- }
-
- if (propertyUrl == null)
- {
- log.error("No default properties found at {}", resolvedLocation);
- }
- else
- {
- Resource resource = new UrlResource(propertyUrl);
- super.setLocation(resource);
- }
- }
-
- super.postProcessBeanFactory(beanFactory);
- }
-
-}
Copied: tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java (from rev 125, trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java)
===================================================================
--- tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java (rev 0)
+++ tags/openutils-deployment-1.0.3/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 10:09:39 UTC (rev 127)
@@ -0,0 +1,170 @@
+package it.openutils.deployment.spring;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownHostException;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
+import org.springframework.web.context.ServletContextAware;
+
+
+/**
+ * @author fgiust
+ * @version $Id: $
+ */
+public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware
+{
+
+ private String fileLocation;
+
+ private String defaultEnvironment;
+
+ private ServletContext servletContext;
+
+ /**
+ * Logger.
+ */
+ private static Logger log = LoggerFactory.getLogger(EnvironmentPropertyConfigurer.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setServletContext(ServletContext servletContext)
+ {
+ this.servletContext = servletContext;
+ }
+
+ /**
+ * Setter for <code>fileLocation</code>.
+ * @param fileLocation The fileLocation to set.
+ */
+ public void setFileLocation(String fileLocation)
+ {
+ this.fileLocation = fileLocation;
+ }
+
+ /**
+ * Setter for <code>defaultEnvironment</code>.
+ * @param defaultEnvironment The defaultEnvironment to set.
+ */
+ public void setDefaultEnvironment(String defaultEnvironment)
+ {
+ this.defaultEnvironment = defaultEnvironment;
+ }
+
+ private String getRootPath()
+ {
+ if (servletContext != null)
+ {
+ return servletContext.getRealPath("/");
+ }
+ return "src/main/webapp/";
+ }
+
+ private URL getResource(String resource)
+ {
+ URL url = null;
+
+ if (servletContext != null)
+ {
+ try
+ {
+ url = servletContext.getResource(resource);
+
+ if (url != null)
+ {
+ // check needed for servletUnit
+ // we need to check for a connection because getResource always returns a URL, also if the resource
+ // doesn't exists
+ url.openConnection().connect();
+ }
+
+ }
+ catch (MalformedURLException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ catch (IOException e)
+ {
+ // ignore, URL is not a valid resource
+ url = null;
+ }
+ }
+ else
+ {
+ try
+ {
+ return new File(getRootPath(), resource).toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ // test
+ }
+ return url;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
+ {
+ if (fileLocation != null)
+ {
+
+ String hostname = null;
+
+ try
+ {
+ hostname = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName());
+ }
+ catch (UnknownHostException e)
+ {
+ log.error(e.getMessage());
+ }
+
+ System.setProperty("env", hostname);
+
+ String resolvedLocation = StringUtils.replace(fileLocation, "${env}", hostname);
+ URL propertyUrl = null;
+
+ propertyUrl = getResource(resolvedLocation);
+
+ if (propertyUrl == null)
+ {
+ log.info("No environment specific properties found at {}, using default", resolvedLocation);
+ resolvedLocation = StringUtils.replace(fileLocation, "${env}", this.defaultEnvironment);
+
+ propertyUrl = getResource(resolvedLocation);
+
+ }
+
+ if (propertyUrl == null)
+ {
+ log.error("No default properties found at {}", resolvedLocation);
+ }
+ else
+ {
+ Resource resource = new UrlResource(propertyUrl);
+ super.setLocation(resource);
+ }
+ }
+
+ super.postProcessBeanFactory(beanFactory);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 10:09:21
|
Revision: 126
http://svn.sourceforge.net/openutils/?rev=126&view=rev
Author: fgiust
Date: 2006-11-16 02:09:21 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare release openutils-deployment-1.0.3
Modified Paths:
--------------
trunk/openutils-deployment/pom.xml
Modified: trunk/openutils-deployment/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-16 10:08:23 UTC (rev 125)
+++ trunk/openutils-deployment/pom.xml 2006-11-16 10:09:21 UTC (rev 126)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-deployment</artifactId>
<name>openutils deployment tools</name>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.3</version>
<description />
<dependencies>
<dependency>
@@ -67,4 +67,10 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.3</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.3</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.3</url>
+ </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 10:08:23
|
Revision: 125
http://svn.sourceforge.net/openutils/?rev=125&view=rev
Author: fgiust
Date: 2006-11-16 02:08:23 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
fix bad NPE with real appservers...
Modified Paths:
--------------
trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
===================================================================
--- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 09:32:01 UTC (rev 124)
+++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 10:08:23 UTC (rev 125)
@@ -83,10 +83,13 @@
{
url = servletContext.getResource(resource);
- // check needed for servletUnit
- // we need to check for a connection because getResource always returns a URL, also if the resource
- // doesn't exists
- url.openConnection().connect();
+ if (url != null)
+ {
+ // check needed for servletUnit
+ // we need to check for a connection because getResource always returns a URL, also if the resource
+ // doesn't exists
+ url.openConnection().connect();
+ }
}
catch (MalformedURLException e)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 09:32:02
|
Revision: 124
http://svn.sourceforge.net/openutils/?rev=124&view=rev
Author: fgiust
Date: 2006-11-16 01:32:01 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/openutils-deployment/pom.xml
Modified: trunk/openutils-deployment/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-16 09:31:51 UTC (rev 123)
+++ trunk/openutils-deployment/pom.xml 2006-11-16 09:32:01 UTC (rev 124)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-deployment</artifactId>
<name>openutils deployment tools</name>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
<description />
<dependencies>
<dependency>
@@ -67,10 +67,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <scm>
- <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.2</connection>
- <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.2</developerConnection>
- <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.2</url>
- </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 09:31:57
|
Revision: 123
http://svn.sourceforge.net/openutils/?rev=123&view=rev
Author: fgiust
Date: 2006-11-16 01:31:51 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-deployment-1.0.2
Added Paths:
-----------
tags/openutils-deployment-1.0.2/
tags/openutils-deployment-1.0.2/pom.xml
tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
Removed Paths:
-------------
tags/openutils-deployment-1.0.2/pom.xml
tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
Copied: tags/openutils-deployment-1.0.2 (from rev 117, trunk/openutils-deployment)
Deleted: tags/openutils-deployment-1.0.2/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-15 17:45:28 UTC (rev 117)
+++ tags/openutils-deployment-1.0.2/pom.xml 2006-11-16 09:31:51 UTC (rev 123)
@@ -1,70 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <artifactId>openutils-deployment</artifactId>
- <name>openutils deployment tools</name>
- <version>1.1-SNAPSHOT</version>
- <description />
- <dependencies>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>2.0</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>logkit</groupId>
- <artifactId>logkit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-deployment-1.0.2/pom.xml (from rev 122, trunk/openutils-deployment/pom.xml)
===================================================================
--- tags/openutils-deployment-1.0.2/pom.xml (rev 0)
+++ tags/openutils-deployment-1.0.2/pom.xml 2006-11-16 09:31:51 UTC (rev 123)
@@ -0,0 +1,76 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <artifactId>openutils-deployment</artifactId>
+ <name>openutils deployment tools</name>
+ <version>1.0.2</version>
+ <description />
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>2.0</version>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.2</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.2</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.2</url>
+ </scm>
+</project>
\ No newline at end of file
Deleted: tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
===================================================================
--- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-15 17:45:28 UTC (rev 117)
+++ tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 09:31:51 UTC (rev 123)
@@ -1,155 +0,0 @@
-package it.openutils.deployment.spring;
-
-import java.io.File;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.UnknownHostException;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.UrlResource;
-import org.springframework.web.context.ServletContextAware;
-
-
-/**
- * @author fgiust
- * @version $Id: $
- */
-public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware
-{
-
- private String fileLocation;
-
- private String defaultEnvironment;
-
- private ServletContext servletContext;
-
- /**
- * Logger.
- */
- private static Logger log = LoggerFactory.getLogger(EnvironmentPropertyConfigurer.class);
-
- /**
- * {@inheritDoc}
- */
- public void setServletContext(ServletContext servletContext)
- {
- this.servletContext = servletContext;
- }
-
- /**
- * Setter for <code>fileLocation</code>.
- * @param fileLocation The fileLocation to set.
- */
- public void setFileLocation(String fileLocation)
- {
- this.fileLocation = fileLocation;
- }
-
- /**
- * Setter for <code>defaultEnvironment</code>.
- * @param defaultEnvironment The defaultEnvironment to set.
- */
- public void setDefaultEnvironment(String defaultEnvironment)
- {
- this.defaultEnvironment = defaultEnvironment;
- }
-
- private String getRootPath()
- {
- if (servletContext != null)
- {
- return servletContext.getRealPath("/");
- }
- return "src/main/webapp/";
- }
-
- private URL getResource(String resource)
- {
- URL url = null;
-
- if (servletContext != null)
- {
- try
- {
- url = servletContext.getResource(resource);
- }
- catch (MalformedURLException e)
- {
- log.error(e.getMessage(), e);
- }
- }
- else
- {
- try
- {
- return new File(getRootPath(), resource).toURL();
- }
- catch (MalformedURLException e)
- {
- log.error(e.getMessage(), e);
- }
- // test
- }
- return url;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
- {
- if (fileLocation != null)
- {
-
- String hostname = null;
-
- try
- {
- hostname = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName());
- }
- catch (UnknownHostException e)
- {
- log.error(e.getMessage());
- }
-
- System.setProperty("env", hostname);
-
- String resolvedLocation = StringUtils.replace(fileLocation, "${env}", hostname);
- URL propertyUrl = null;
-
- propertyUrl = getResource(resolvedLocation);
-
- if (propertyUrl == null)
- {
- log.info("No environment specific properties found at {}, using default", resolvedLocation);
- resolvedLocation = StringUtils.replace(fileLocation, "${env}", this.defaultEnvironment);
-
- propertyUrl = getResource(resolvedLocation);
-
- }
-
- if (propertyUrl == null)
- {
- log.error("No default properties found at {}", resolvedLocation);
- }
- else
- {
- Resource resource = new UrlResource(propertyUrl);
- super.setLocation(resource);
- }
- }
-
- super.postProcessBeanFactory(beanFactory);
- }
-
-}
Copied: tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java (from rev 121, trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java)
===================================================================
--- tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java (rev 0)
+++ tags/openutils-deployment-1.0.2/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 09:31:51 UTC (rev 123)
@@ -0,0 +1,167 @@
+package it.openutils.deployment.spring;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownHostException;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
+import org.springframework.web.context.ServletContextAware;
+
+
+/**
+ * @author fgiust
+ * @version $Id: $
+ */
+public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware
+{
+
+ private String fileLocation;
+
+ private String defaultEnvironment;
+
+ private ServletContext servletContext;
+
+ /**
+ * Logger.
+ */
+ private static Logger log = LoggerFactory.getLogger(EnvironmentPropertyConfigurer.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setServletContext(ServletContext servletContext)
+ {
+ this.servletContext = servletContext;
+ }
+
+ /**
+ * Setter for <code>fileLocation</code>.
+ * @param fileLocation The fileLocation to set.
+ */
+ public void setFileLocation(String fileLocation)
+ {
+ this.fileLocation = fileLocation;
+ }
+
+ /**
+ * Setter for <code>defaultEnvironment</code>.
+ * @param defaultEnvironment The defaultEnvironment to set.
+ */
+ public void setDefaultEnvironment(String defaultEnvironment)
+ {
+ this.defaultEnvironment = defaultEnvironment;
+ }
+
+ private String getRootPath()
+ {
+ if (servletContext != null)
+ {
+ return servletContext.getRealPath("/");
+ }
+ return "src/main/webapp/";
+ }
+
+ private URL getResource(String resource)
+ {
+ URL url = null;
+
+ if (servletContext != null)
+ {
+ try
+ {
+ url = servletContext.getResource(resource);
+
+ // check needed for servletUnit
+ // we need to check for a connection because getResource always returns a URL, also if the resource
+ // doesn't exists
+ url.openConnection().connect();
+
+ }
+ catch (MalformedURLException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ catch (IOException e)
+ {
+ // ignore, URL is not a valid resource
+ url = null;
+ }
+ }
+ else
+ {
+ try
+ {
+ return new File(getRootPath(), resource).toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ // test
+ }
+ return url;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
+ {
+ if (fileLocation != null)
+ {
+
+ String hostname = null;
+
+ try
+ {
+ hostname = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName());
+ }
+ catch (UnknownHostException e)
+ {
+ log.error(e.getMessage());
+ }
+
+ System.setProperty("env", hostname);
+
+ String resolvedLocation = StringUtils.replace(fileLocation, "${env}", hostname);
+ URL propertyUrl = null;
+
+ propertyUrl = getResource(resolvedLocation);
+
+ if (propertyUrl == null)
+ {
+ log.info("No environment specific properties found at {}, using default", resolvedLocation);
+ resolvedLocation = StringUtils.replace(fileLocation, "${env}", this.defaultEnvironment);
+
+ propertyUrl = getResource(resolvedLocation);
+
+ }
+
+ if (propertyUrl == null)
+ {
+ log.error("No default properties found at {}", resolvedLocation);
+ }
+ else
+ {
+ Resource resource = new UrlResource(propertyUrl);
+ super.setLocation(resource);
+ }
+ }
+
+ super.postProcessBeanFactory(beanFactory);
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 09:31:34
|
Revision: 122
http://svn.sourceforge.net/openutils/?rev=122&view=rev
Author: fgiust
Date: 2006-11-16 01:31:32 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare release openutils-deployment-1.0.2
Modified Paths:
--------------
trunk/openutils-deployment/pom.xml
Modified: trunk/openutils-deployment/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-16 09:30:51 UTC (rev 121)
+++ trunk/openutils-deployment/pom.xml 2006-11-16 09:31:32 UTC (rev 122)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-deployment</artifactId>
<name>openutils deployment tools</name>
- <version>1.0.2-SNAPSHOT</version>
+ <version>1.0.2</version>
<description />
<dependencies>
<dependency>
@@ -67,4 +67,10 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.2</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.2</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.2</url>
+ </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-16 09:30:52
|
Revision: 121
http://svn.sourceforge.net/openutils/?rev=121&view=rev
Author: fgiust
Date: 2006-11-16 01:30:51 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
fix for httpUnit
Modified Paths:
--------------
trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java
===================================================================
--- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-15 17:47:26 UTC (rev 120)
+++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2006-11-16 09:30:51 UTC (rev 121)
@@ -1,6 +1,7 @@
package it.openutils.deployment.spring;
import java.io.File;
+import java.io.IOException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
@@ -81,11 +82,22 @@
try
{
url = servletContext.getResource(resource);
+
+ // check needed for servletUnit
+ // we need to check for a connection because getResource always returns a URL, also if the resource
+ // doesn't exists
+ url.openConnection().connect();
+
}
catch (MalformedURLException e)
{
log.error(e.getMessage(), e);
}
+ catch (IOException e)
+ {
+ // ignore, URL is not a valid resource
+ url = null;
+ }
}
else
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-15 17:47:28
|
Revision: 120
http://svn.sourceforge.net/openutils/?rev=120&view=rev
Author: fgiust
Date: 2006-11-15 09:47:26 -0800 (Wed, 15 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/openutils-deployment/pom.xml
Modified: trunk/openutils-deployment/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-15 17:47:15 UTC (rev 119)
+++ trunk/openutils-deployment/pom.xml 2006-11-15 17:47:26 UTC (rev 120)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-deployment</artifactId>
<name>openutils deployment tools</name>
- <version>1.0.1</version>
+ <version>1.0.2-SNAPSHOT</version>
<description />
<dependencies>
<dependency>
@@ -67,10 +67,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <scm>
- <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.1</connection>
- <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.1</developerConnection>
- <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.1</url>
- </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-15 17:47:20
|
Revision: 119
http://svn.sourceforge.net/openutils/?rev=119&view=rev
Author: fgiust
Date: 2006-11-15 09:47:15 -0800 (Wed, 15 Nov 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-deployment-1.0.1
Added Paths:
-----------
tags/openutils-deployment-1.0.1/
tags/openutils-deployment-1.0.1/pom.xml
Removed Paths:
-------------
tags/openutils-deployment-1.0.1/pom.xml
Copied: tags/openutils-deployment-1.0.1 (from rev 117, trunk/openutils-deployment)
Deleted: tags/openutils-deployment-1.0.1/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-15 17:45:28 UTC (rev 117)
+++ tags/openutils-deployment-1.0.1/pom.xml 2006-11-15 17:47:15 UTC (rev 119)
@@ -1,70 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <artifactId>openutils-deployment</artifactId>
- <name>openutils deployment tools</name>
- <version>1.1-SNAPSHOT</version>
- <description />
- <dependencies>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>2.0</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>logkit</groupId>
- <artifactId>logkit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-deployment-1.0.1/pom.xml (from rev 118, trunk/openutils-deployment/pom.xml)
===================================================================
--- tags/openutils-deployment-1.0.1/pom.xml (rev 0)
+++ tags/openutils-deployment-1.0.1/pom.xml 2006-11-15 17:47:15 UTC (rev 119)
@@ -0,0 +1,76 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <artifactId>openutils-deployment</artifactId>
+ <name>openutils deployment tools</name>
+ <version>1.0.1</version>
+ <description />
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>2.0</version>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.1</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.1</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.1</url>
+ </scm>
+</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-15 17:47:01
|
Revision: 118
http://svn.sourceforge.net/openutils/?rev=118&view=rev
Author: fgiust
Date: 2006-11-15 09:47:01 -0800 (Wed, 15 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare release openutils-deployment-1.0.1
Modified Paths:
--------------
trunk/openutils-deployment/pom.xml
Modified: trunk/openutils-deployment/pom.xml
===================================================================
--- trunk/openutils-deployment/pom.xml 2006-11-15 17:45:28 UTC (rev 117)
+++ trunk/openutils-deployment/pom.xml 2006-11-15 17:47:01 UTC (rev 118)
@@ -8,7 +8,7 @@
</parent>
<artifactId>openutils-deployment</artifactId>
<name>openutils deployment tools</name>
- <version>1.1-SNAPSHOT</version>
+ <version>1.0.1</version>
<description />
<dependencies>
<dependency>
@@ -67,4 +67,10 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.1</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-deployment-1.0.1</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-deployment-1.0.1</url>
+ </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-15 17:45:32
|
Revision: 117
http://svn.sourceforge.net/openutils/?rev=117&view=rev
Author: fgiust
Date: 2006-11-15 09:45:28 -0800 (Wed, 15 Nov 2006)
Log Message:
-----------
fix invalid getRealPath(""), should be getRealPath("/")
Modified Paths:
--------------
trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java
Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java
===================================================================
--- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2006-11-14 16:09:49 UTC (rev 116)
+++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2006-11-15 17:45:28 UTC (rev 117)
@@ -35,7 +35,7 @@
System.err.println(e.getMessage());
}
- String rootPath = StringUtils.replace(context.getRealPath(StringUtils.EMPTY), "\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
+ String rootPath = StringUtils.replace(context.getRealPath("/"), "\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
String webapp = StringUtils.substringAfterLast(rootPath, "/"); //$NON-NLS-1$
for (int j = 0; j < propertiesLocation.length; j++)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-14 16:09:54
|
Revision: 116
http://svn.sourceforge.net/openutils/?rev=116&view=rev
Author: fgiust
Date: 2006-11-14 08:09:49 -0800 (Tue, 14 Nov 2006)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/openutils-usermanagement/pom.xml
Modified: trunk/openutils-usermanagement/pom.xml
===================================================================
--- trunk/openutils-usermanagement/pom.xml 2006-11-14 16:09:40 UTC (rev 115)
+++ trunk/openutils-usermanagement/pom.xml 2006-11-14 16:09:49 UTC (rev 116)
@@ -10,7 +10,7 @@
<artifactId>openutils-usermanagement</artifactId>
<packaging>jar</packaging>
<name>openutils-usermanagement</name>
- <version>1.1.1</version>
+ <version>1.1.2-SNAPSHOT</version>
<description>Usermanagement classes</description>
<dependencies>
<dependency>
@@ -112,10 +112,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <scm>
- <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-1.1.1</connection>
- <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-1.1.1</developerConnection>
- <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-usermanagement-1.1.1</url>
- </scm>
</project>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fg...@us...> - 2006-11-14 16:09:54
|
Revision: 115
http://svn.sourceforge.net/openutils/?rev=115&view=rev
Author: fgiust
Date: 2006-11-14 08:09:40 -0800 (Tue, 14 Nov 2006)
Log Message:
-----------
[maven-scm] copy for tag openutils-usermanagement-1.1.1
Added Paths:
-----------
tags/openutils-usermanagement-1.1.1/
tags/openutils-usermanagement-1.1.1/pom.xml
tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java
tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java
Removed Paths:
-------------
tags/openutils-usermanagement-1.1.1/pom.xml
tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java
tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java
Copied: tags/openutils-usermanagement-1.1.1 (from rev 109, trunk/openutils-usermanagement)
Deleted: tags/openutils-usermanagement-1.1.1/pom.xml
===================================================================
--- trunk/openutils-usermanagement/pom.xml 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-1.1.1/pom.xml 2006-11-14 16:09:40 UTC (rev 115)
@@ -1,116 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils</artifactId>
- <version>2</version>
- <relativePath>../openutils-parent</relativePath>
- </parent>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-usermanagement</artifactId>
- <packaging>jar</packaging>
- <name>openutils-usermanagement</name>
- <version>1.1-SNAPSHOT</version>
- <description>Usermanagement classes</description>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-spring</artifactId>
- <version>1.0</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-usermanagement-dataobjects</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-bshd5</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-testing</artifactId>
- <version>1.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <version>3.2.0.ga</version>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.2.1</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <artifactId>xerces</artifactId>
- <groupId>xerces</groupId>
- </exclusion>
- <exclusion>
- <artifactId>xml-apis</artifactId>
- <groupId>xml-apis</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.acegisecurity</groupId>
- <artifactId>acegi-security</artifactId>
- <version>1.0.2</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-remoting</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-support</artifactId>
- </exclusion>
- <exclusion>
- <groupId>logkit</groupId>
- <artifactId>logkit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.1.2.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>dbunit</groupId>
- <artifactId>dbunit</artifactId>
- <version>2.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/openutils-usermanagement-1.1.1/pom.xml (from rev 114, trunk/openutils-usermanagement/pom.xml)
===================================================================
--- tags/openutils-usermanagement-1.1.1/pom.xml (rev 0)
+++ tags/openutils-usermanagement-1.1.1/pom.xml 2006-11-14 16:09:40 UTC (rev 115)
@@ -0,0 +1,121 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils</artifactId>
+ <version>2</version>
+ <relativePath>../openutils-parent</relativePath>
+ </parent>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-usermanagement</artifactId>
+ <packaging>jar</packaging>
+ <name>openutils-usermanagement</name>
+ <version>1.1.1</version>
+ <description>Usermanagement classes</description>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-spring</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-usermanagement-dataobjects</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-bshd5</artifactId>
+ <version>1.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-testing</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.2.0.ga</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.2.1</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>xerces</artifactId>
+ <groupId>xerces</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.acegisecurity</groupId>
+ <artifactId>acegi-security</artifactId>
+ <version>1.0.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-remoting</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-support</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>dbunit</groupId>
+ <artifactId>dbunit</artifactId>
+ <version>2.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-1.1.1</connection>
+ <developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-1.1.1</developerConnection>
+ <url>http://svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-usermanagement-1.1.1</url>
+ </scm>
+</project>
\ No newline at end of file
Deleted: tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java
===================================================================
--- trunk/openutils-usermanagement/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java 2006-11-14 16:09:40 UTC (rev 115)
@@ -1,57 +0,0 @@
-package it.openutils.usermanagement.acegi;
-
-import it.openutils.usermanagement.dao.GroupDAO;
-import it.openutils.usermanagement.dao.UserDAO;
-
-import org.acegisecurity.userdetails.UserDetails;
-import org.acegisecurity.userdetails.UserDetailsService;
-import org.acegisecurity.userdetails.UsernameNotFoundException;
-import org.apache.commons.lang.ArrayUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.dao.DataAccessException;
-
-
-public class HibernateUserDetailsServiceImpl implements UserDetailsService
-{
-
- private Logger log = LoggerFactory.getLogger(getClass());
-
- private UserDAO userDao;
-
- private GroupDAO groupDao;
-
- public void setUserDao(UserDAO userDao)
- {
- this.userDao = userDao;
- }
-
- public void setGroupDAO(GroupDAO groupDao)
- {
- this.groupDao = groupDao;
- }
-
- public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException
- {
-
- log.debug("Login:: Loading User's Data");
-
- it.openutils.usermanagement.dataobjects.User filter = new it.openutils.usermanagement.dataobjects.User();
- filter.setId(username);
- it.openutils.usermanagement.dataobjects.User user = null;
-
- user = this.userDao.findFilteredFirst(filter);
-
- // warning: user can be null
- if (user != null)
- {
- log.debug("Groups: {}, Roles {}", user.getGroups(), user.getRoles());
- log.debug("Authorities: {}", ArrayUtils.toString(user.getAuthorities()));
- }
-
- log.debug("Login:: Returning User to Acegi: {}", user);
-
- return user;
- }
-
-}
Copied: tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java (from rev 113, trunk/openutils-usermanagement/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java)
===================================================================
--- tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java (rev 0)
+++ tags/openutils-usermanagement-1.1.1/src/main/java/it/openutils/usermanagement/acegi/HibernateUserDetailsServiceImpl.java 2006-11-14 16:09:40 UTC (rev 115)
@@ -0,0 +1,59 @@
+package it.openutils.usermanagement.acegi;
+
+import it.openutils.usermanagement.dao.GroupDAO;
+import it.openutils.usermanagement.dao.UserDAO;
+
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
+import org.apache.commons.lang.ArrayUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DataAccessException;
+
+
+public class HibernateUserDetailsServiceImpl implements UserDetailsService
+{
+
+ private Logger log = LoggerFactory.getLogger(getClass());
+
+ private UserDAO userDao;
+
+ private GroupDAO groupDao;
+
+ public void setUserDao(UserDAO userDao)
+ {
+ this.userDao = userDao;
+ }
+
+ public void setGroupDAO(GroupDAO groupDao)
+ {
+ this.groupDao = groupDao;
+ }
+
+ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException
+ {
+
+ log.debug("Login:: Loading User's Data");
+
+ it.openutils.usermanagement.dataobjects.User filter = new it.openutils.usermanagement.dataobjects.User();
+ filter.setId(username);
+ it.openutils.usermanagement.dataobjects.User user = null;
+
+ user = this.userDao.findFilteredFirst(filter);
+
+ // mandatory: UserDetailsService can't return null
+ if (user == null)
+ {
+ throw new UsernameNotFoundException("Username " + username + " not found");
+ }
+
+ log.debug("Groups: {}, Roles {}", user.getGroups(), user.getRoles());
+ log.debug("Authorities: {}", ArrayUtils.toString(user.getAuthorities()));
+
+ log.debug("Login:: Returning User to Acegi: {}", user);
+
+ return user;
+ }
+
+}
Deleted: tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java
===================================================================
--- trunk/openutils-usermanagement/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java 2006-11-13 21:23:57 UTC (rev 109)
+++ tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java 2006-11-14 16:09:40 UTC (rev 115)
@@ -1,24 +0,0 @@
-package it.openutils.usermanagement.manager;
-
-import it.openutils.testing.junit.GenericsDbUnitTestCase;
-
-import org.acegisecurity.userdetails.UserDetails;
-import org.acegisecurity.userdetails.UserDetailsService;
-
-
-/**
- * @author fgiust
- * @version $Id$
- */
-public class HibernateUserDetailsServiceTest extends GenericsDbUnitTestCase<UserDetailsService>
-{
-
- public void testLoadUserByUsername()
- {
-
- UserDetails user = instance.loadUserByUsername("UserUno");
- assertNotNull(user);
-
- }
-
-}
Copied: tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java (from rev 113, trunk/openutils-usermanagement/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java)
===================================================================
--- tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java (rev 0)
+++ tags/openutils-usermanagement-1.1.1/src/test/java/it/openutils/usermanagement/manager/HibernateUserDetailsServiceTest.java 2006-11-14 16:09:40 UTC (rev 115)
@@ -0,0 +1,39 @@
+package it.openutils.usermanagement.manager;
+
+import it.openutils.testing.junit.GenericsDbUnitTestCase;
+
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
+
+
+/**
+ * @author fgiust
+ * @version $Id$
+ */
+public class HibernateUserDetailsServiceTest extends GenericsDbUnitTestCase<UserDetailsService>
+{
+
+ public void testLoadUserByUsername()
+ {
+
+ UserDetails user = instance.loadUserByUsername("UserUno");
+ assertNotNull(user);
+
+ }
+
+ public void testNotExistingUser()
+ {
+ try
+ {
+ instance.loadUserByUsername("notexisting");
+ }
+ catch (UsernameNotFoundException e)
+ {
+ // as expected
+ return;
+ }
+ fail("Expected UsernameNotFoundException not thrown");
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|