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...> - 2008-01-08 09:38:56
|
Revision: 520 http://openutils.svn.sourceforge.net/openutils/?rev=520&view=rev Author: fgiust Date: 2008-01-08 01:39:00 -0800 (Tue, 08 Jan 2008) Log Message: ----------- 2.0-SNAPSHOT Modified Paths: -------------- trunk/openutils-testing-testng/pom.xml trunk/openutils-testing-testng-dwr/pom.xml Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-08 09:35:13 UTC (rev 519) +++ trunk/openutils-testing-testng/pom.xml 2008-01-08 09:39:00 UTC (rev 520) @@ -9,7 +9,7 @@ </parent> <artifactId>openutils-testing-testng</artifactId> <name>openutils test utils (testng)</name> - <version>1.1.4-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> Modified: trunk/openutils-testing-testng-dwr/pom.xml =================================================================== --- trunk/openutils-testing-testng-dwr/pom.xml 2008-01-08 09:35:13 UTC (rev 519) +++ trunk/openutils-testing-testng-dwr/pom.xml 2008-01-08 09:39:00 UTC (rev 520) @@ -9,7 +9,7 @@ </parent> <artifactId>openutils-testing-testng-dwr</artifactId> <name>openutils test utils (testng) for dwr</name> - <version>1.0-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <description>openutils test utils for dwr</description> <dependencies> <dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-08 09:35:13
|
Revision: 519 http://openutils.svn.sourceforge.net/openutils/?rev=519&view=rev Author: fgiust Date: 2008-01-08 01:35:13 -0800 (Tue, 08 Jan 2008) Log Message: ----------- maven-release-plugin version Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-01-08 09:26:20 UTC (rev 518) +++ trunk/pom.xml 2008-01-08 09:35:13 UTC (rev 519) @@ -83,6 +83,10 @@ <build> <plugins> <plugin> + <artifactId>maven-release-plugin</artifactId> + <version>2.0-beta-7</version> + </plugin> + <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-08 09:26:19
|
Revision: 518 http://openutils.svn.sourceforge.net/openutils/?rev=518&view=rev Author: fgiust Date: 2008-01-08 01:26:20 -0800 (Tue, 08 Jan 2008) Log Message: ----------- next generation spring/dbunit tests Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml trunk/openutils-testing-junit-dwr/pom.xml trunk/openutils-testing-testng/pom.xml trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/GenericsDbUnitTestCase.java trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/SpringTestCase.java trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/utils/DateAssert.java trunk/openutils-testing-testng-dwr/pom.xml Added Paths: ----------- trunk/openutils-testing/src/main/ trunk/openutils-testing/src/main/java/ trunk/openutils-testing/src/main/java/it/ trunk/openutils-testing/src/main/java/it/openutils/ trunk/openutils-testing/src/main/java/it/openutils/testing/ trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/AbstractDbUnitTestNGSpringContextTests.java Added: trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-01-08 09:26:20 UTC (rev 518) @@ -0,0 +1,100 @@ +package it.openutils.testing; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + + +/** + * Utility methods for checking dates in unit tests. + * @author fgiust + * @version $Id$ + */ +public final class DateAssert +{ + + private static DateFormat df = new SimpleDateFormat("yyyyMMdd"); + + private static DateFormat dtf = new SimpleDateFormat("yyyyMMdd HH:mm"); + + /** + * Don't instantiate. + */ + private DateAssert() + { + // unused + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "YYYYMMDD" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException + { + Date expected; + + try + { + expected = df.parse(expectedDateAsString); + } + catch (ParseException e) + { + throw new IllegalArgumentException("Unparseable date String: [" + expectedDateAsString + "]"); + } + + if (date == null) + { + throw new AssertionError("Date is null"); + } + if (!date.equals(expected)) + { + throw new AssertionError("Expected <" + expected + ">, actual <" + date.getTime() + ">"); + } + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "yyyyMMdd HH:mm" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateTimeEqual(String expectedDateAsString, Date date) throws IllegalArgumentException + { + Date expected; + + try + { + expected = dtf.parse(expectedDateAsString); + } + catch (ParseException e) + { + throw new IllegalArgumentException("Unparseable date String: [" + expectedDateAsString + "]"); + } + + if (date == null) + { + throw new AssertionError("Date is null"); + } + + if (date.getTime() != expected.getTime()) + { + throw new AssertionError("Expected <" + expected + ">, actual <" + date + ">"); + } + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "yyyyMMdd HH:mm" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateTimeEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException + { + dateTimeEqual(expectedDateAsString, date.getTime()); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java 2008-01-08 09:26:20 UTC (rev 518) @@ -0,0 +1,34 @@ +package it.openutils.testing; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * @author fgiust + * @version $Id: $ + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +public @interface DbUnitConfiguration { + + /** + * The resource locations to use for loading dbunit dataset. + */ + String[] datasets() default {}; + + String dataSource() default ""; + + String schema() default ""; + + String excludedTables() default "(^\\$(.*))"; // oracle recycle bin + + boolean truncateAll() default true; + +} \ No newline at end of file Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-08 09:26:20 UTC (rev 518) @@ -0,0 +1,100 @@ +package it.openutils.testing; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.sql.SQLException; + +import org.apache.commons.lang.StringUtils; +import org.dbunit.database.IDatabaseConnection; +import org.dbunit.dataset.DataSetException; +import org.dbunit.dataset.FilteredDataSet; +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.excel.XlsDataSet; +import org.dbunit.dataset.xml.XmlDataSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author fgiust + * @version $Id: $ + */ +public final class DbUnitUtils +{ + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(DbUnitUtils.class); + + /** + * @param connection + * @param tableNames + * @param file + * @param xls + * @throws SQLException + * @throws IOException + * @throws DataSetException + */ + public static void exportDataset(IDatabaseConnection connection, String[] tableNames, File file) + throws SQLException, IOException, DataSetException + { + OutputStream fos = null; + + try + { + IDataSet fullDataSet = connection.createDataSet(); + + if (tableNames != null && tableNames.length > 0) + { + fullDataSet = new FilteredDataSet(tableNames, fullDataSet); + } + + fos = new FileOutputStream(file); + if (StringUtils.equalsIgnoreCase(StringUtils.substringAfterLast(file.getName(), "."), "xls")) + { + XlsDataSet.write(fullDataSet, fos); + } + else + { + XmlDataSet.write(fullDataSet, fos); + } + } + finally + { + connection.close(); + fos.close(); + } + + log.debug("Dataset exported at {}", file.getAbsolutePath()); + } + + /** + * @param url + * @return + * @throws IOException + * @throws DataSetException + */ + public static IDataSet loadDataset(URL url) throws IOException, DataSetException + { + if (url == null) + { + throw new IllegalArgumentException("URL is null"); + } + InputStream is = url.openStream(); + IDataSet dataSet = null; + + if (is != null) + { + log.debug("loading dataset {}", url.getFile()); + dataSet = url.getFile().endsWith(".xls") ? new XlsDataSet(is) : new XmlDataSet(is); + is.close(); + } + return dataSet; + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java 2008-01-08 09:26:20 UTC (rev 518) @@ -0,0 +1,35 @@ +package it.openutils.testing; + +import java.util.regex.Pattern; + +import org.dbunit.dataset.DataSetException; +import org.dbunit.dataset.filter.AbstractTableFilter; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class RegExpTableFilter extends AbstractTableFilter +{ + + private Pattern pattern; + + public RegExpTableFilter(String pattern) + { + if (pattern != null) + { + this.pattern = Pattern.compile(pattern); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isValidName(String tableName) throws DataSetException + { + return pattern == null || pattern.matcher(tableName).matches(); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-junit/pom.xml 2008-01-08 09:26:20 UTC (rev 518) @@ -9,10 +9,30 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>1.1.4-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.2</version> Modified: trunk/openutils-testing-junit-dwr/pom.xml =================================================================== --- trunk/openutils-testing-junit-dwr/pom.xml 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-junit-dwr/pom.xml 2008-01-08 09:26:20 UTC (rev 518) @@ -9,10 +9,30 @@ </parent> <artifactId>openutils-testing-junit-dwr</artifactId> <name>openutils test utils (junit) for dwr</name> - <version>1.2-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <description>openutils test utils for dwr</description> <dependencies> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.4.3</version> Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-testng/pom.xml 2008-01-08 09:26:20 UTC (rev 518) @@ -13,6 +13,26 @@ <description>openutils test utils</description> <dependencies> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.4.1</version> Added: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/AbstractDbUnitTestNGSpringContextTests.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/AbstractDbUnitTestNGSpringContextTests.java (rev 0) +++ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/AbstractDbUnitTestNGSpringContextTests.java 2008-01-08 09:26:20 UTC (rev 518) @@ -0,0 +1,182 @@ +package it.openutils.testing.testng; + +import it.openutils.testing.DbUnitConfiguration; +import it.openutils.testing.DbUnitUtils; +import it.openutils.testing.RegExpTableFilter; + +import java.io.IOException; +import java.net.URL; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.dbunit.DatabaseUnitException; +import org.dbunit.database.DatabaseConnection; +import org.dbunit.database.DatabaseSequenceFilter; +import org.dbunit.database.IDatabaseConnection; +import org.dbunit.dataset.DataSetException; +import org.dbunit.dataset.FilteredDataSet; +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.filter.ITableFilter; +import org.dbunit.dataset.filter.SequenceTableFilter; +import org.dbunit.operation.DatabaseOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; +import org.testng.annotations.BeforeMethod; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class AbstractDbUnitTestNGSpringContextTests extends AbstractTransactionalTestNGSpringContextTests +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(AbstractDbUnitTestNGSpringContextTests.class); + + /** + * Dataset cache. + */ + private Map<String, IDataSet> datasetCache = new HashMap<String, IDataSet>(); + + protected static IDataSet truncateDataSet; + + /** + * Setup the Database before running the test method. + * @throws Exception Any exception. + */ + @SuppressWarnings("unchecked") + @BeforeMethod + protected void setUpDbUnit() throws Exception + { + final DbUnitConfiguration dbUnitConfiguration = getClass().getAnnotation(DbUnitConfiguration.class); + if (dbUnitConfiguration != null) + { + String[] datasets = dbUnitConfiguration.datasets(); + + IDatabaseConnection connection = new DatabaseConnection(getDatasource(dbUnitConfiguration.dataSource()) + .getConnection(), dbUnitConfiguration.schema()); + + try + { + ITableFilter tableFilter = new RegExpTableFilter(dbUnitConfiguration.excludedTables()); + + if (dbUnitConfiguration.truncateAll()) + { + truncateAll(connection, tableFilter); + } + + for (String datasetFile : datasets) + { + importDataSet(createDataset(datasetFile), connection, tableFilter); + } + } + finally + { + connection.close(); + } + } + } + + /** + * @param datasetFile + * @return + * @throws IOException + * @throws DataSetException + */ + private IDataSet createDataset(String datasetFile) throws IOException, DataSetException + { + IDataSet dataSet = datasetCache.get(datasetFile); + if (dataSet == null) + { + URL datasetUrl = getClass().getResource(datasetFile); + if (datasetUrl == null) + { + throw new IllegalArgumentException("Dataset " + datasetFile + " not found"); + } + dataSet = DbUnitUtils.loadDataset(datasetUrl); + datasetCache.put(datasetFile, dataSet); + } + return dataSet; + } + + private void importDataSet(IDataSet dataSet, IDatabaseConnection connection, ITableFilter tableFilter) + throws SQLException, DataSetException, DatabaseUnitException + { + if (dataSet == null) + { + throw new IllegalArgumentException("dataSet is null"); + } + IDataSet orderedDataset = new FilteredDataSet(tableFilter, dataSet); + + log.debug("Tables: {}", ArrayUtils.toString(orderedDataset.getTableNames())); + + // if a sorted dataset is available, use table sequence for sorting + if (truncateDataSet != null) + { + ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); + orderedDataset = new FilteredDataSet(filter, dataSet); + } + + if (dataSet != null) + { + DatabaseOperation.INSERT.execute(connection, orderedDataset); + } + + } + + /** + * @param connection + * @param tableFilter + * @throws SQLException + * @throws DataSetException + * @throws DatabaseUnitException + */ + private void truncateAll(IDatabaseConnection connection, ITableFilter tableFilter) throws SQLException, + DataSetException, DatabaseUnitException + { + if (truncateDataSet == null) + { + log.debug("Generating sorted dataset for initial cleanup"); + IDataSet unsortedDataSet = connection.createDataSet(); + + ITableFilter filter = new DatabaseSequenceFilter(connection, new FilteredDataSet( + tableFilter, + unsortedDataSet).getTableNames()); + truncateDataSet = new FilteredDataSet(tableFilter, new FilteredDataSet(filter, unsortedDataSet)); + log.debug("Sorted dataset generated"); + } + + log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); + if (truncateDataSet != null) + { + DatabaseOperation.DELETE_ALL.execute(connection, truncateDataSet); + } + } + + @SuppressWarnings("unchecked") + protected DataSource getDatasource(String name) + { + if (StringUtils.isEmpty(name)) + { + Map<String, DataSource> dsMap = applicationContext.getBeansOfType(DataSource.class); + if (dsMap == null || dsMap.size() != 1) + { + throw new RuntimeException( + "Unable to find a datasource in spring applicationContext, please specify the datasource bean name " + + "using the \"datasource\" attribute of @DbUnitConfiguration"); + } + return dsMap.values().iterator().next(); + } + return (DataSource) applicationContext.getBean(name); + } + +} Property changes on: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/AbstractDbUnitTestNGSpringContextTests.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2008-01-08 09:26:20 UTC (rev 518) @@ -54,8 +54,10 @@ /** * @author fgiust * @version $Id$ + * @deprecated use {@link AbstractDbUnitTestNGSpringContextTests} */ @Test +@Deprecated public class DbUnitTestCase extends SpringTestCase { @@ -134,8 +136,7 @@ } this.sessionFactory = sfbeans.get(sfbeans.keySet().iterator().next()); - TransactionSynchronizationManager.bindResource(this.sessionFactory, new SessionHolder(this - .sessionFactory + TransactionSynchronizationManager.bindResource(this.sessionFactory, new SessionHolder(this.sessionFactory .openSession())); } @@ -188,7 +189,7 @@ { // close open hibernate sessions, mimic the OpenSessionInViewFilter // close open hibernate sessions, mimic the OpenSessionInViewFilter - if (TransactionSynchronizationManager.hasResource(this.sessionFactory)) + if (TransactionSynchronizationManager.hasResource(this.sessionFactory)) { TransactionSynchronizationManager.unbindResource(this.sessionFactory); } Modified: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/GenericsDbUnitTestCase.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/GenericsDbUnitTestCase.java 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/GenericsDbUnitTestCase.java 2008-01-08 09:26:20 UTC (rev 518) @@ -20,6 +20,7 @@ import org.apache.commons.lang.ClassUtils; import org.apache.commons.lang.StringUtils; import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; /** @@ -29,7 +30,10 @@ * from Spring is made available through the <code>instance</code> protected field. * @author fgiust * @version $Id$ + * @deprecated use {@link AbstractDbUnitTestNGSpringContextTests} */ +@Test +@Deprecated public class GenericsDbUnitTestCase<D> extends DbUnitTestCase { Modified: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/SpringTestCase.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/SpringTestCase.java 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/SpringTestCase.java 2008-01-08 09:26:20 UTC (rev 518) @@ -28,8 +28,10 @@ * Base class for running spring-based tests. * @author fgiust * @version $Revision $ ($Author $) + * @deprecated {@link org.springframework.test.context.testng.AbstractTestNGSpringContextTests} */ @Test +@Deprecated public abstract class SpringTestCase { Modified: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/utils/DateAssert.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/utils/DateAssert.java 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/utils/DateAssert.java 2008-01-08 09:26:20 UTC (rev 518) @@ -16,7 +16,9 @@ * Utility methods for checking dates in unit tests. * @author fgiust * @version $Id$ + * @deprecated use {@link it.openutils.testing.DateAssert} */ +@Deprecated public final class DateAssert { Modified: trunk/openutils-testing-testng-dwr/pom.xml =================================================================== --- trunk/openutils-testing-testng-dwr/pom.xml 2008-01-08 09:25:06 UTC (rev 517) +++ trunk/openutils-testing-testng-dwr/pom.xml 2008-01-08 09:26:20 UTC (rev 518) @@ -13,6 +13,26 @@ <description>openutils test utils for dwr</description> <dependencies> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.4.3</version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-08 09:25:09
|
Revision: 517 http://openutils.svn.sourceforge.net/openutils/?rev=517&view=rev Author: fgiust Date: 2008-01-08 01:25:06 -0800 (Tue, 08 Jan 2008) Log Message: ----------- new openutils-testing module Modified Paths: -------------- trunk/pom.xml Added Paths: ----------- trunk/openutils-testing/ trunk/openutils-testing/pom.xml trunk/openutils-testing/src/ Property changes on: trunk/openutils-testing ___________________________________________________________________ Name: svn:ignore + .project .classpath .checkstyle target .settings Added: trunk/openutils-testing/pom.xml =================================================================== --- trunk/openutils-testing/pom.xml (rev 0) +++ trunk/openutils-testing/pom.xml 2008-01-08 09:25:06 UTC (rev 517) @@ -0,0 +1,54 @@ +<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>5</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing</artifactId> + <name>openutils test utils</name> + <version>2.0-SNAPSHOT</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit-addons</groupId> + <artifactId>junit-addons</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5</spring.version> + </properties> +</project> Property changes on: trunk/openutils-testing/pom.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-01-04 21:39:07 UTC (rev 516) +++ trunk/pom.xml 2008-01-08 09:25:06 UTC (rev 517) @@ -201,6 +201,7 @@ <module>openutils-spring</module> <module>openutils-usermanagement-dataobjects</module> <module>openutils-usermanagement</module> + <module>openutils-testing</module> <module>openutils-testing-testng</module> <module>openutils-testing-testng-dwr</module> <module>openutils-testing-junit</module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-04 21:39:05
|
Revision: 516 http://openutils.svn.sourceforge.net/openutils/?rev=516&view=rev Author: fgiust Date: 2008-01-04 13:39:07 -0800 (Fri, 04 Jan 2008) Log Message: ----------- more cleanup Modified Paths: -------------- trunk/openutils-bshd5/pom.xml trunk/openutils-configuration-services/pom.xml trunk/openutils-spring/pom.xml trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java trunk/openutils-tags-spring/pom.xml trunk/openutils-testing-testng/pom.xml Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2008-01-04 21:22:28 UTC (rev 515) +++ trunk/openutils-bshd5/pom.xml 2008-01-04 21:39:07 UTC (rev 516) @@ -35,6 +35,17 @@ </dependency> <dependency> <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> <exclusions> Modified: trunk/openutils-configuration-services/pom.xml =================================================================== --- trunk/openutils-configuration-services/pom.xml 2008-01-04 21:22:28 UTC (rev 515) +++ trunk/openutils-configuration-services/pom.xml 2008-01-04 21:39:07 UTC (rev 516) @@ -43,7 +43,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing-testng</artifactId> - <version>1.1</version> + <version>1.1.4-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> @@ -100,6 +100,18 @@ </dependency> <dependency> <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> <scope>test</scope> @@ -123,9 +135,17 @@ <scope>test</scope> <exclusions> <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> + <exclusion> + <groupId>junit-addons</groupId> + <artifactId>junit-addons</artifactId> + </exclusion> </exclusions> </dependency> </dependencies> Modified: trunk/openutils-spring/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2008-01-04 21:22:28 UTC (rev 515) +++ trunk/openutils-spring/pom.xml 2008-01-04 21:39:07 UTC (rev 516) @@ -79,9 +79,14 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> + <version>1.4.3</version> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.2.1.ga</version> Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java 2008-01-04 21:22:28 UTC (rev 515) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java 2008-01-04 21:39:07 UTC (rev 516) @@ -29,225 +29,253 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; + /** * @author mmolaschi * @version $Id: $ */ -public class JSONServiceExporter extends RemoteInvocationBasedExporter - implements Controller { - private static final String METHOD = "__method__"; +public class JSONServiceExporter extends RemoteInvocationBasedExporter implements Controller +{ - private static final String PARAM_PREFIX = "param"; + private static final String METHOD = "__method__"; - private static final String CONTENT_TYPE = "text/x-json"; + private static final String PARAM_PREFIX = "param"; - /** - * {@inheritDoc} - */ - public ModelAndView handleRequest(HttpServletRequest request, - HttpServletResponse response) throws Exception { - if (request.getParameter(METHOD) != null) { - String methodRequest = request.getParameter(METHOD); - Method[] methods = this.getServiceInterface().getMethods(); - for (Method method : methods) { - if (method.getName().equals(methodRequest)) { - Class[] types = method.getParameterTypes(); - Object[] values = new Object[types.length]; - if (values.length > 0) { - int i = 0; - Enumeration<String> names = request.getParameterNames(); - while (names.hasMoreElements()) { - String name = names.nextElement(); - if (name != null && name.startsWith(PARAM_PREFIX)) { - String posStr = StringUtils.substringAfter( - name, PARAM_PREFIX); - int pos = NumberUtils.toInt(posStr); + private static final String CONTENT_TYPE = "text/x-json"; - String[] reqValues = request - .getParameterValues(name); - if (reqValues != null && reqValues.length > 0) { - if (types[pos].isArray()) { - values[pos] = ConvertUtils.convert( - reqValues, types[pos]); - } else { - values[pos] = ConvertUtils.convert( - reqValues[0], types[pos]); - } - } else { - values[pos] = null; - } + /** + * {@inheritDoc} + */ + public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception + { + if (request.getParameter(METHOD) != null) + { + String methodRequest = request.getParameter(METHOD); + Method[] methods = this.getServiceInterface().getMethods(); + for (Method method : methods) + { + if (method.getName().equals(methodRequest)) + { + Class[] types = method.getParameterTypes(); + Object[] values = new Object[types.length]; + if (values.length > 0) + { + int i = 0; + Enumeration<String> names = request.getParameterNames(); + while (names.hasMoreElements()) + { + String name = names.nextElement(); + if (name != null && name.startsWith(PARAM_PREFIX)) + { + String posStr = StringUtils.substringAfter(name, PARAM_PREFIX); + int pos = NumberUtils.toInt(posStr); - } - } - } + String[] reqValues = request.getParameterValues(name); + if (reqValues != null && reqValues.length > 0) + { + if (types[pos].isArray()) + { + values[pos] = ConvertUtils.convert(reqValues, types[pos]); + } + else + { + values[pos] = ConvertUtils.convert(reqValues[0], types[pos]); + } + } + else + { + values[pos] = null; + } - RemoteInvocation invocation = new RemoteInvocation(); - invocation.setArguments(values); - invocation.setParameterTypes(types); - invocation.setMethodName(methodRequest); + } + } + } - RemoteInvocationResult result = invokeAndCreateResult( - invocation, this.getProxyForService()); + RemoteInvocation invocation = new RemoteInvocation(); + invocation.setArguments(values); + invocation.setParameterTypes(types); + invocation.setMethodName(methodRequest); - response.setContentType(CONTENT_TYPE); - JSON json; - if (result.hasException()) { - JSONObject obj = JSONObject.fromBean(result - .getException()); - obj.put("exception", true); + RemoteInvocationResult result = invokeAndCreateResult(invocation, this.getProxyForService()); - json = obj; - } else { - Object value = cleanLazy(result.getValue()); - if (value != null) { - if (ClassUtils.getAllInterfaces(value.getClass()) - .contains(Collection.class)) { - json = JSONArray - .fromCollection((Collection) value); - } else if (ClassUtils.getAllInterfaces( - value.getClass()).contains(Map.class)) { - json = JSONObject.fromMap((Map) value); - } else if (value.getClass().isArray()) { - json = JSONArray.fromArray((Object[]) value); - } else { - JSONObject obj = JSONObject.fromBean(value); - json = obj; - } - } else { - json = JSONNull.getInstance(); - } - } - json.write(response.getWriter()); + response.setContentType(CONTENT_TYPE); + JSON json; + if (result.hasException()) + { + JSONObject obj = JSONObject.fromBean(result.getException()); + obj.put("exception", true); - break; - } - } + json = obj; + } + else + { + Object value = cleanLazy(result.getValue()); + if (value != null) + { + if (ClassUtils.getAllInterfaces(value.getClass()).contains(Collection.class)) + { + json = JSONArray.fromCollection((Collection) value); + } + else if (ClassUtils.getAllInterfaces(value.getClass()).contains(Map.class)) + { + json = JSONObject.fromMap((Map) value); + } + else if (value.getClass().isArray()) + { + json = JSONArray.fromArray((Object[]) value); + } + else + { + JSONObject obj = JSONObject.fromBean(value); + json = obj; + } + } + else + { + json = JSONNull.getInstance(); + } + } + json.write(response.getWriter()); - } - return null; - } + break; + } + } - public Object cleanLazy(Object bean) throws IllegalAccessException, - InstantiationException, IntrospectionException, - InvocationTargetException { - if (bean == null) { - return null; - } - Class<?> clazz = bean.getClass(); - if (bean instanceof Collection) { - Collection collection = (Collection) bean; + } + return null; + } - Collection newCollection; - newCollection = collection.getClass().newInstance(); - for (Object myObject : collection) { - newCollection.add(cleanLazy(myObject)); - } - collection.clear(); - collection.addAll(newCollection); - } - if (bean instanceof Map) { - Map<Object, Object> map = (Map<Object, Object>) bean; - Map<Object, Object> newMap = map.getClass().newInstance(); - for (Map.Entry entry : map.entrySet()) { - Object key = cleanLazy(entry.getKey()); - Object value = cleanLazy(entry.getValue()); - newMap.put(key, value); - } - map.clear(); - map.putAll(newMap); - } - if (clazz.isArray()) { - Object[] array = (Object[]) bean; - for (int i = 0; i < array.length; i++) { - array[i] = cleanLazy(array[i]); - } - } - boolean isHibernate = !clazz.equals(Hibernate.getClass(bean)); - if (isHibernate) { - Class<?> noProxyClass = Hibernate.getClass(bean); - Object noHibernateBean = noProxyClass.newInstance(); - BeanInfo info = Introspector.getBeanInfo(noProxyClass); - PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); - for (PropertyDescriptor descriptor : descriptors) { - String name = descriptor.getName(); + public Object cleanLazy(Object bean) throws IllegalAccessException, InstantiationException, IntrospectionException, + InvocationTargetException + { + if (bean == null) + { + return null; + } + Class< ? > clazz = bean.getClass(); + if (bean instanceof Collection) + { + Collection collection = (Collection) bean; - if ("class".equals(name)) { - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { null }); - continue; - } + Collection newCollection; + newCollection = collection.getClass().newInstance(); + for (Object myObject : collection) + { + newCollection.add(cleanLazy(myObject)); + } + collection.clear(); + collection.addAll(newCollection); + } + if (bean instanceof Map) + { + Map<Object, Object> map = (Map<Object, Object>) bean; + Map<Object, Object> newMap = map.getClass().newInstance(); + for (Map.Entry entry : map.entrySet()) + { + Object key = cleanLazy(entry.getKey()); + Object value = cleanLazy(entry.getValue()); + newMap.put(key, value); + } + map.clear(); + map.putAll(newMap); + } + if (clazz.isArray()) + { + Object[] array = (Object[]) bean; + for (int i = 0; i < array.length; i++) + { + array[i] = cleanLazy(array[i]); + } + } + boolean isHibernate = !clazz.equals(Hibernate.getClass(bean)); + if (isHibernate) + { + Class< ? > noProxyClass = Hibernate.getClass(bean); + Object noHibernateBean = noProxyClass.newInstance(); + BeanInfo info = Introspector.getBeanInfo(noProxyClass); + PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); + for (PropertyDescriptor descriptor : descriptors) + { + String name = descriptor.getName(); - if ("hibernateLazyInitializer".equals(name)) { - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { null }); - continue; - } + if ("class".equals(name)) + { + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{null }); + continue; + } - if (descriptor.getReadMethod() == null - || descriptor.getWriteMethod() == null) { - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { null }); - continue; - } + if ("hibernateLazyInitializer".equals(name)) + { + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{null }); + continue; + } - Method method = findGetter(bean, name); + if (descriptor.getReadMethod() == null || descriptor.getWriteMethod() == null) + { + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{null }); + continue; + } - if (method == null) { - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { null }); - continue; - } + Method method = findGetter(bean, name); - if (!Hibernate.isPropertyInitialized(bean, name)) { - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { null }); - continue; - } + if (method == null) + { + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{null }); + continue; + } - // This might be a lazy-collection so we need to double check - Object retval = method.invoke(bean); - if (!Hibernate.isInitialized(retval)) { - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { null }); - continue; - } - descriptor.getWriteMethod().invoke(noHibernateBean, - new Object[] { cleanLazy(bean) }); + if (!Hibernate.isPropertyInitialized(bean, name)) + { + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{null }); + continue; + } - } + // This might be a lazy-collection so we need to double check + Object retval = method.invoke(bean); + if (!Hibernate.isInitialized(retval)) + { + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{null }); + continue; + } + descriptor.getWriteMethod().invoke(noHibernateBean, new Object[]{cleanLazy(bean) }); - bean = noHibernateBean; - } else { - BeanInfo info = Introspector.getBeanInfo(clazz); - PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); - for (PropertyDescriptor descriptor : descriptors) { - Object value = descriptor.getReadMethod().invoke(bean, null); - descriptor.getWriteMethod().invoke(bean, - new Object[] { cleanLazy(bean) }); - } - } - return bean; - } + } - protected Method findGetter(Object bean, String name) - throws IntrospectionException { - Class<?> clazz = Hibernate.getClass(bean); - // String key = clazz.getName() + ":" + property; + bean = noHibernateBean; + } + else + { + BeanInfo info = Introspector.getBeanInfo(clazz); + PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); + for (PropertyDescriptor descriptor : descriptors) + { + Object value = descriptor.getReadMethod().invoke(bean, null); + descriptor.getWriteMethod().invoke(bean, new Object[]{cleanLazy(bean) }); + } + } + return bean; + } - Method method = null; // methods.get(key); - // if (method == null) - // { - PropertyDescriptor[] props = Introspector.getBeanInfo(clazz) - .getPropertyDescriptors(); - for (PropertyDescriptor prop : props) { - if (prop.getName().equalsIgnoreCase(name)) { - method = prop.getReadMethod(); - } - } + protected Method findGetter(Object bean, String name) throws IntrospectionException + { + Class< ? > clazz = Hibernate.getClass(bean); + // String key = clazz.getName() + ":" + property; - // methods.put(key, method); - // } + Method method = null; // methods.get(key); + // if (method == null) + // { + PropertyDescriptor[] props = Introspector.getBeanInfo(clazz).getPropertyDescriptors(); + for (PropertyDescriptor prop : props) + { + if (prop.getName().equalsIgnoreCase(name)) + { + method = prop.getReadMethod(); + } + } - return method; - } + // methods.put(key, method); + // } + + return method; + } } Modified: trunk/openutils-tags-spring/pom.xml =================================================================== --- trunk/openutils-tags-spring/pom.xml 2008-01-04 21:22:28 UTC (rev 515) +++ trunk/openutils-tags-spring/pom.xml 2008-01-04 21:39:07 UTC (rev 516) @@ -75,6 +75,16 @@ </exclusions> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.13</version> Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-04 21:22:28 UTC (rev 515) +++ trunk/openutils-testing-testng/pom.xml 2008-01-04 21:39:07 UTC (rev 516) @@ -68,9 +68,17 @@ <optional>true</optional> <exclusions> <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> + <exclusion> + <groupId>junit-addons</groupId> + <artifactId>junit-addons</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -78,7 +86,28 @@ <artifactId>testng</artifactId> <classifier>jdk15</classifier> <version>5.1</version> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.1.ga</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <properties> <spring.version>2.5</spring.version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-04 21:22:26
|
Revision: 515 http://openutils.svn.sourceforge.net/openutils/?rev=515&view=rev Author: fgiust Date: 2008-01-04 13:22:28 -0800 (Fri, 04 Jan 2008) Log Message: ----------- update spring, ban commons-logging Modified Paths: -------------- trunk/openutils-backup/pom.xml trunk/openutils-bshd5/pom.xml trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java trunk/openutils-configuration-dataobjects/pom.xml trunk/openutils-configuration-services/pom.xml trunk/openutils-configuration-services/src/test/resources/spring-dao.xml trunk/openutils-configuration-services/src/test/resources/spring-database.xml trunk/openutils-configuration-services/src/test/resources/spring-hibernate.xml trunk/openutils-configuration-services/src/test/resources/spring-managers.xml trunk/openutils-configuration-services/src/test/resources/spring-tests.xml trunk/openutils-dbmigration/pom.xml trunk/openutils-deployment/pom.xml trunk/openutils-hibernate-security/pom.xml trunk/openutils-log4j/pom.xml trunk/openutils-mgnlspring/pom.xml trunk/openutils-mgnlstripes/pom.xml trunk/openutils-spring/pom.xml trunk/openutils-spring-rmibernate/pom.xml trunk/openutils-tags-spring/pom.xml trunk/openutils-testing-junit/pom.xml trunk/openutils-testing-junit-dwr/pom.xml trunk/openutils-testing-testng/pom.xml trunk/openutils-testing-testng-dwr/pom.xml trunk/openutils-usermanagement/pom.xml trunk/openutils-usermanagement-dataobjects/pom.xml trunk/openutils-web/pom.xml Added Paths: ----------- trunk/openutils-configuration-services/src/test/dbunit/ trunk/openutils-configuration-services/src/test/dbunit/ConfigurationCodeDAOTest-load.xml trunk/openutils-configuration-services/src/test/dbunit/ConfigurationDomainDAOTest-load.xml trunk/openutils-configuration-services/src/test/dbunit/ConfigurationManagerTest-load.xml trunk/openutils-configuration-services/src/test/dbunit/ReferenceCodeDAOTest-load.xml trunk/openutils-configuration-services/src/test/dbunit/ReferenceDomainDAOTest-load.xml trunk/openutils-configuration-services/src/test/dbunit/ReferenceManagerTest-load.xml trunk/openutils-configuration-services/src/test/dbunit/dataset.dtd Removed Paths: ------------- trunk/openutils-configuration-services/src/test/resources/ConfigurationCodeDAOTest-load.xml trunk/openutils-configuration-services/src/test/resources/ConfigurationDomainDAOTest-load.xml trunk/openutils-configuration-services/src/test/resources/ConfigurationManagerTest-load.xml trunk/openutils-configuration-services/src/test/resources/ReferenceCodeDAOTest-load.xml trunk/openutils-configuration-services/src/test/resources/ReferenceDomainDAOTest-load.xml trunk/openutils-configuration-services/src/test/resources/ReferenceManagerTest-load.xml trunk/openutils-configuration-services/src/test/resources/dataset.dtd Modified: trunk/openutils-backup/pom.xml =================================================================== --- trunk/openutils-backup/pom.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-backup/pom.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -4,7 +4,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> - <version>3</version> + <version>5</version> <relativePath>..</relativePath> </parent> <artifactId>openutils-backup</artifactId> Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-bshd5/pom.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,33 +1,30 @@ -<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> <artifactId>openutils</artifactId> - <version>3</version> + <version>5</version> <relativePath>..</relativePath> </parent> <artifactId>openutils-bshd5</artifactId> <name>openutils base Spring-Hibernate DAO for java 5.0</name> <version>1.0.10-SNAPSHOT</version> <description>openutils base Spring-Hibernate DAO for java 5.0</description> - <properties> - <spring.version>2.0.6</spring.version> - </properties> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.4.1</version> + <version>1.4.3</version> </dependency> <dependency> - <!-- replaces commons-logging --> <groupId>org.slf4j</groupId> <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.1</version> + <version>1.4.3</version> </dependency> <dependency> <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> + <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> <exclusions> <exclusion> @@ -38,6 +35,17 @@ </dependency> <dependency> <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> <exclusions> @@ -56,9 +64,18 @@ <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> </exclusions> </dependency> <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> + <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.7.0</version> @@ -81,4 +98,7 @@ <optional>true</optional> </dependency> </dependencies> + <properties> + <spring.version>2.5</spring.version> + </properties> </project> \ No newline at end of file Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2008-01-04 21:22:28 UTC (rev 515) @@ -26,521 +26,582 @@ import org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; + /** * Base Hibernate DAO. - * * @author Fabrizio Giustina * @version $Id$ - * @param <T> - * Persistence class - * @param <K> - * Object Key + * @param <T> Persistence class + * @param <K> Object Key */ -public abstract class HibernateDAOImpl<T extends Object, K extends Serializable> - extends HibernateDaoSupport implements HibernateDAO<T, K> { +public abstract class HibernateDAOImpl<T extends Object, K extends Serializable> extends HibernateDaoSupport + implements + HibernateDAO<T, K> +{ - /** - * @author carone - * @version $Id$ - */ - private final class HibernateCallbackForExecution implements - HibernateCallback { + private Class<T> referenceClass; - /** - * - */ - private final T filter; + private boolean aopenabled; - /** - * - */ - private final int page; + public HibernateDAOImpl() + { + super(); + } - /** - * - */ - private final int maxResults; + /** + * @param referenceClass + */ + @SuppressWarnings({"unchecked" }) + public HibernateDAOImpl(Class referenceClass) + { + super(); + this.referenceClass = referenceClass; + } - /** - * - */ - private final Map<String, FilterMetadata> metadata; + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public List<T> find(String query) + { + return getHibernateTemplate().find(query); + } - /** - * - */ - private final Order[] orderProperties; + /** + * {@inheritDoc} + */ + public List<T> findAll() + { + return findAll(getDefaultOrder()); + } - private List<Criterion> additionalCriteria; + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public List<T> findAll(final Order[] orderProperties) + { + return getThis().findAll(orderProperties, new ArrayList<Criterion>()); + } - /** - * @param filter - * @param page - * @param maxResults - * @param metadata - * @param orderProperties - */ - private HibernateCallbackForExecution(T filter, int page, - int maxResults, Map<String, FilterMetadata> metadata, - Order[] orderProperties, List<Criterion> additionalCriteria) { - this.filter = filter; - this.page = page; - this.maxResults = maxResults; - this.metadata = metadata; - this.orderProperties = orderProperties; - this.additionalCriteria = additionalCriteria; - } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public List<T> findAll(final Order[] orderProperties, final List<Criterion> criteria) + { + return (List<T>) getHibernateTemplate().execute(new HibernateCallback() + { - public Object doInHibernate(Session ses) throws HibernateException { - Criteria crit = ses.createCriteria(filter.getClass()); - crit - .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); - crit.setMaxResults(maxResults); - crit.setFirstResult(maxResults * page); + public Object doInHibernate(Session ses) throws HibernateException + { + Criteria crit = ses.createCriteria(getReferenceClass()); + if (null != orderProperties) + { + for (int j = 0; j < orderProperties.length; j++) + { + crit.addOrder(orderProperties[j]); + } - if (orderProperties != null && orderProperties.length > 0) { - for (Order order : orderProperties) { - if (order != null) { - crit.addOrder(order); - } - } - } - EnhancedExample.create(crit, filter, metadata); - if (additionalCriteria != null && !additionalCriteria.isEmpty()) { - for (Criterion criterion : additionalCriteria) { - crit.add(criterion); - } - } - return crit.list(); - } - } + } + if (criteria != null) + { + for (Criterion criterion : criteria) + { + crit.add(criterion); + } + } + return crit.list(); + } + }); + } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public List<T> find(String query) { - return getHibernateTemplate().find(query); - } + /** + * {@inheritDoc} + */ + public List<T> find(String query, Object obj, Type type) + { + return find(query, new Object[]{obj }, new Type[]{type }); + } - /** - * {@inheritDoc} - */ - public List<T> findAll() { - return findAll(getDefaultOrder()); - } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public List<T> find(final String query, final Object[] obj, final Type[] type) + { + return (List<T>) getHibernateTemplate().execute(new HibernateCallback() + { - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public List<T> findAll(final Order[] orderProperties) { - return getThis().findAll(orderProperties, new ArrayList<Criterion>()); - } + public Object doInHibernate(Session ses) throws HibernateException + { + // hibernate 3 + return ses.createQuery(query).setParameters(obj, type).list(); + } + }); + } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public List<T> findAll(final Order[] orderProperties, - final List<Criterion> criteria) { - return (List<T>) getHibernateTemplate().execute( - new HibernateCallback() { + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public T load(K key) + { + T result = (T) getHibernateTemplate().load(getReferenceClass(), key); + Hibernate.initialize(result); + return result; + } - public Object doInHibernate(Session ses) - throws HibernateException { - Criteria crit = ses.createCriteria(getReferenceClass()); - if (null != orderProperties) { - for (int j = 0; j < orderProperties.length; j++) { - crit.addOrder(orderProperties[j]); - } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public T loadIfAvailable(K key) + { + T result; + try + { + result = (T) getHibernateTemplate().load(getReferenceClass(), key); + Hibernate.initialize(result); + } + catch (ObjectNotFoundException e) + { + // during lazy initialization + return null; + } + catch (HibernateObjectRetrievalFailureException e) + { + // during load + if (e.getCause() instanceof ObjectNotFoundException) + { + return null; + } + throw e; + } + return result; + } - } - if (criteria != null) { - for (Criterion criterion : criteria) { - crit.add(criterion); - } - } - return crit.list(); - } - }); - } + /** + * {@inheritDoc} + */ + public void saveOrUpdate(final T obj) + { + getHibernateTemplate().saveOrUpdate(obj); + } - /** - * {@inheritDoc} - */ - public List<T> find(String query, Object obj, Type type) { - return find(query, new Object[] { obj }, new Type[] { type }); - } + /** + * {@inheritDoc} + */ + public void update(T obj) + { + getHibernateTemplate().update(obj); + } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public List<T> find(final String query, final Object[] obj, - final Type[] type) { - return (List<T>) getHibernateTemplate().execute( - new HibernateCallback() { + /** + * {@inheritDoc} + */ + public boolean delete(final K key) + { - public Object doInHibernate(Session ses) - throws HibernateException { - // hibernate 3 - return ses.createQuery(query).setParameters(obj, type) - .list(); - } - }); - } + return (Boolean) getHibernateTemplate().execute(new HibernateCallback() + { - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public T load(K key) { - T result = (T) getHibernateTemplate().load(getReferenceClass(), key); - Hibernate.initialize(result); - return result; - } + public Object doInHibernate(Session ses) throws HibernateException + { + ses.delete(ses.load(getReferenceClass(), key)); + return true; + } + }); - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public T loadIfAvailable(K key) { - T result; - try { - result = (T) getHibernateTemplate().load(getReferenceClass(), key); - Hibernate.initialize(result); - } catch (ObjectNotFoundException e) { - // during lazy initialization - return null; - } catch (HibernateObjectRetrievalFailureException e) { - // during load - if (e.getCause() instanceof ObjectNotFoundException) { - return null; - } - throw e; - } - return result; - } + } - /** - * {@inheritDoc} - */ - public void saveOrUpdate(final T obj) { - getHibernateTemplate().saveOrUpdate(obj); - } + /** + * {@inheritDoc} + */ + public void refresh(T obj) + { + getHibernateTemplate().refresh(obj); + } - /** - * {@inheritDoc} - */ - public void update(T obj) { - getHibernateTemplate().update(obj); - } + /** + * {@inheritDoc} + */ + public void evict(T obj) + { + getHibernateTemplate().evict(obj); + } - /** - * {@inheritDoc} - */ - public boolean delete(final K key) { + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public T merge(final T obj) + { + return (T) getHibernateTemplate().execute(new HibernateCallback() + { - return (Boolean) getHibernateTemplate().execute( - new HibernateCallback() { + public Object doInHibernate(Session ses) throws HibernateException + { + return ses.merge(obj); + } + }); - public Object doInHibernate(Session ses) - throws HibernateException { - ses.delete(ses.load(getReferenceClass(), key)); - return true; - } - }); + } - } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public K save(T obj) + { + return (K) getHibernateTemplate().save(obj); + } - /** - * {@inheritDoc} - */ - public void refresh(T obj) { - getHibernateTemplate().refresh(obj); - } + /** + * {@inheritDoc} + */ + public T findFilteredFirst(final T filter) + { + return getFirstInCollection(findFiltered(filter, 1, 0)); + } - /** - * {@inheritDoc} - */ - public void evict(T obj) { - getHibernateTemplate().evict(obj); - } + /** + * {@inheritDoc} + */ + public T findFilteredFirst(final T filter, List<Criterion> criteria) + { + return getFirstInCollection(findFiltered(filter, null, getDefaultFilterMetadata(), 1, 0, criteria)); + } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public T merge(final T obj) { - return (T) getHibernateTemplate().execute(new HibernateCallback() { + /** + * {@inheritDoc} + */ + public List<T> findFiltered(final T filter) + { + return findFiltered(filter, getDefaultFilterMetadata()); + } - public Object doInHibernate(Session ses) throws HibernateException { - return ses.merge(obj); - } - }); + /** + * {@inheritDoc} + */ + public List<T> findFiltered(T filter, Order[] orderProperties) + { + return findFiltered(filter, orderProperties, getDefaultFilterMetadata(), Integer.MAX_VALUE, 0); + } - } + /** + * {@inheritDoc} + */ + public List<T> findFiltered(final T filter, final Map<String, FilterMetadata> metadata) + { + return findFiltered(filter, metadata, Integer.MAX_VALUE, 0); + } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public K save(T obj) { - return (K) getHibernateTemplate().save(obj); - } + /** + * {@inheritDoc} + */ + public List<T> findFiltered(final T filter, final int maxResults, final int page) + { + return findFiltered(filter, getDefaultFilterMetadata(), maxResults, page); + } - /** - * {@inheritDoc} - */ - public T findFilteredFirst(final T filter) { - return getFirstInCollection(findFiltered(filter, 1, 0)); - } + /** + * {@inheritDoc} + */ + public List<T> findFiltered(final T filter, final Map<String, FilterMetadata> metadata, final int maxResults, + final int page) + { + return findFiltered(filter, null, metadata, maxResults, page); + } - /** - * {@inheritDoc} - */ - public T findFilteredFirst(final T filter, List<Criterion> criteria) { - return getFirstInCollection(findFiltered(filter, null, - getDefaultFilterMetadata(), 1, 0, criteria)); - } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public List<T> findFiltered(final T filter, final Order[] customOrder, final Map<String, FilterMetadata> metadata, + final int maxResults, final int page) + { + return getThis().findFiltered(filter, customOrder, metadata, maxResults, page, new ArrayList<Criterion>()); + } - /** - * {@inheritDoc} - */ - public List<T> findFiltered(final T filter) { - return findFiltered(filter, getDefaultFilterMetadata()); - } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public List<T> findFiltered(T filter, Order[] customOrder, Map<String, FilterMetadata> metadata, int maxResults, + int page, List<Criterion> additionalCriteria) + { + final Order[] orderProperties = customOrder != null && customOrder.length > 0 ? customOrder : this + .getDefaultOrder(); - /** - * @return This is needed as for - * http://opensource.atlassian.com/projects/spring/browse/SPR-2226 - */ - @SuppressWarnings("unchecked") - private HibernateDAO<T, K> getThis() { - try { - return (HibernateDAO<T, K>) AopContext.currentProxy(); - } catch (AspectException exc) { - logger - .debug("Not running inside an AOP proxy, so no proxy can be returned: " - + exc.getMessage()); - return this; - } - } + return (List<T>) getHibernateTemplate().execute( + new HibernateCallbackForExecution(filter, page, maxResults, metadata, orderProperties, additionalCriteria)); + } - /** - * {@inheritDoc} - */ - public List<T> findFiltered(T filter, Order[] orderProperties) { - return findFiltered(filter, orderProperties, - getDefaultFilterMetadata(), Integer.MAX_VALUE, 0); - } + /** + * Return the specific Object class that will be used for class-specific implementation of this DAO. + * @return the reference Class + */ + protected Class<T> getReferenceClass() + { + return referenceClass; + } - /** - * {@inheritDoc} - */ - public List<T> findFiltered(final T filter, - final Map<String, FilterMetadata> metadata) { - return findFiltered(filter, metadata, Integer.MAX_VALUE, 0); - } + public void setReferenceClass(Class<T> referenceClass) + { + this.referenceClass = referenceClass; + } - /** - * {@inheritDoc} - */ - public List<T> findFiltered(final T filter, final int maxResults, - final int page) { - return findFiltered(filter, getDefaultFilterMetadata(), maxResults, - page); - } + /** + * Return a list of <code>Order</code> object to be used for the default ordering of the collection. + * @return the property name + */ + protected Order[] getDefaultOrder() + { + return new Order[0]; + } - /** - * {@inheritDoc} - */ - public List<T> findFiltered(final T filter, - final Map<String, FilterMetadata> metadata, final int maxResults, - final int page) { - return findFiltered(filter, null, metadata, maxResults, page); - } + /** + * Obtain an instance of Query for a named query string defined in the mapping file. + * @param name the name of a query defined externally + * @param maxResults max number of results + * @return Query + */ + protected List< ? > getNamedQuery(final String name, final int maxResults) + { + return (List< ? >) getHibernateTemplate().execute(new HibernateCallback() + { - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public List<T> findFiltered(final T filter, final Order[] customOrder, - final Map<String, FilterMetadata> metadata, final int maxResults, - final int page) { - return getThis().findFiltered(filter, customOrder, metadata, - maxResults, page, new ArrayList<Criterion>()); - } + public Object doInHibernate(Session ses) throws HibernateException + { + Query q = ses.getNamedQuery(name); + q.setMaxResults(maxResults); + return q.list(); + } + }); + } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public List<T> findFiltered(T filter, Order[] customOrder, - Map<String, FilterMetadata> metadata, int maxResults, int page, - List<Criterion> additionalCriteria) { - final Order[] orderProperties = customOrder != null - && customOrder.length > 0 ? customOrder : this - .getDefaultOrder(); + /** + * Obtain an instance of Query for a named query string defined in the mapping file. Use the parameters given. + * @param name the name of a query defined externally + * @param params the parameter array + * @param maxResults max number of results + * @return Query + */ + protected List< ? > getNamedQuery(final String name, final Serializable[] params, final int maxResults) + { - return (List<T>) getHibernateTemplate().execute( - new HibernateCallbackForExecution(filter, page, maxResults, - metadata, orderProperties, additionalCriteria)); - } + return (List< ? >) getHibernateTemplate().execute(new HibernateCallback() + { - /** - * Return the specific Object class that will be used for class-specific - * implementation of this DAO. - * - * @return the reference Class - */ - protected abstract Class<T> getReferenceClass(); + public Object doInHibernate(Session ses) throws HibernateException + { + Query q = ses.getNamedQuery(name); + q.setMaxResults(maxResults); + if (null != params) + { + for (int i = 0; i < params.length; i++) + { + q.setParameter(i, params[i]); + } + } + return q.list(); + } + }); + } - /** - * Return a list of <code>Order</code> object to be used for the default - * ordering of the collection. - * - * @return the property name - */ - protected Order[] getDefaultOrder() { - return new Order[0]; - } + /** + * Obtain an instance of Query for a named query string defined in the mapping file. Use the parameters given. + * @param name the name of a query defined externally + * @param params the parameter Map + * @param maxResults max number of results + * @return Query + */ + protected List< ? > getNamedQuery(final String name, final Map<String, Object> params, final int maxResults) + { + return (List< ? >) getHibernateTemplate().execute(new HibernateCallback() + { - /** - * Obtain an instance of Query for a named query string defined in the - * mapping file. - * - * @param name - * the name of a query defined externally - * @param maxResults - * max number of results - * @return Query - */ - protected List<?> getNamedQuery(final String name, final int maxResults) { - return (List<?>) getHibernateTemplate().execute( - new HibernateCallback() { + public Object doInHibernate(Session ses) throws HibernateException + { + Query q = ses.getNamedQuery(name); + q.setMaxResults(maxResults); + if (params != null) + { + for (Map.Entry<String, Object> entry : params.entrySet()) + { + setParameterValue(q, entry.getKey(), entry.getValue()); + } + } + return q.list(); + } + }); + } - public Object doInHibernate(Session ses) - throws HibernateException { - Query q = ses.getNamedQuery(name); - q.setMaxResults(maxResults); - return q.list(); - } - }); - } + /** + * Convenience method to set paramers in the query given based on the actual object type in passed in as the value. + * You may need to add more functionaly to this as desired (or not use this at all). + * @param query the Query to set + * @param key the key name + * @param value the object to set as the parameter + */ + protected void setParameterValue(Query query, String key, Object value) + { + if (null == key || null == value) + { + return; + } + query.setParameter(key, value); + } - /** - * Obtain an instance of Query for a named query string defined in the - * mapping file. Use the parameters given. - * - * @param name - * the name of a query defined externally - * @param params - * the parameter array - * @param maxResults - * max number of results - * @return Query - */ - protected List<?> getNamedQuery(final String name, - final Serializable[] params, final int maxResults) { + /** + * Returns the default set of FilterMetadata that will be applied to any query. The default implementation doesn't + * set any default filter, subclasses may override this. + * @return map of property name - filter metadata + */ + protected Map<String, FilterMetadata> getDefaultFilterMetadata() + { + return new HashMap<String, FilterMetadata>(0); + } - return (List<?>) getHibernateTemplate().execute( - new HibernateCallback() { + /** + * Returns the first object in the collection or null if the collection is null or empty. + * @param list collection + * @return first element in the list + */ + @SuppressWarnings("unchecked") + private T getFirstInCollection(Collection<T> list) + { + if (list != null && !list.isEmpty()) + { + Object result = list.iterator().next(); + Hibernate.initialize(result); + return (T) result; + } + return null; + } - public Object doInHibernate(Session ses) - throws HibernateException { - Query q = ses.getNamedQuery(name); - q.setMaxResults(maxResults); - if (null != params) { - for (int i = 0; i < params.length; i++) { - q.setParameter(i, params[i]); - } - } - return q.list(); - } - }); - } + /** + * Sets the aopenabled. + * @param aopenabled the aopenabled to set + */ + public void setAopenabled(boolean aopenabled) + { + this.aopenabled = aopenabled; + } - /** - * Obtain an instance of Query for a named query string defined in the - * mapping file. Use the parameters given. - * - * @param name - * the name of a query defined externally - * @param params - * the parameter Map - * @param maxResults - * max number of results - * @return Query - */ - protected List<?> getNamedQuery(final String name, - final Map<String, Object> params, final int maxResults) { - return (List<?>) getHibernateTemplate().execute( - new HibernateCallback() { + /** + * @return This is needed as for http://opensource.atlassian.com/projects/spring/browse/SPR-2226 + */ + @SuppressWarnings("unchecked") + private HibernateDAO<T, K> getThis() + { + if (!aopenabled) + { + return this; + } - public Object doInHibernate(Session ses) - throws HibernateException { - Query q = ses.getNamedQuery(name); - q.setMaxResults(maxResults); - if (params != null) { - for (Map.Entry<String, Object> entry : params - .entrySet()) { - setParameterValue(q, entry.getKey(), entry - .getValue()); - } - } - return q.list(); - } - }); - } + try + { + return (HibernateDAO<T, K>) AopContext.currentProxy(); + } + catch (AspectException exc) + { + logger.debug("Not running inside an AOP proxy, so no proxy can be returned: " + exc.getMessage()); + return this; + } + catch (IllegalStateException e) + { + logger.warn("Cannot access proxy: " + e.getMessage()); + aopenabled = false; + return this; + } + } - /** - * Convenience method to set paramers in the query given based on the actual - * object type in passed in as the value. You may need to add more - * functionaly to this as desired (or not use this at all). - * - * @param query - * the Query to set - * @param key - * the key name - * @param value - * the object to set as the parameter - */ - protected void setParameterValue(Query query, String key, Object value) { - if (null == key || null == value) { - return; - } - query.setParameter(key, value); - } + /** + * @author carone + * @version $Id$ + */ + private final class HibernateCallbackForExecution implements HibernateCallback + { - /** - * Returns the default set of FilterMetadata that will be applied to any - * query. The default implementation doesn't set any default filter, - * subclasses may override this. - * - * @return map of property name - filter metadata - */ - protected Map<String, FilterMetadata> getDefaultFilterMetadata() { - return new HashMap<String, FilterMetadata>(0); - } + /** + * + */ + private final T filter; - /** - * Returns the first object in the collection or null if the collection is - * null or empty. - * - * @param list - * collection - * @return first element in the list - */ - @SuppressWarnings("unchecked") - private T getFirstInCollection(Collection<T> list) { - if (list != null && !list.isEmpty()) { - Object result = list.iterator().next(); - Hibernate.initialize(result); - return (T) result; - } - return null; - } + /** + * + */ + private final int page; + /** + * + */ + private final int maxResults; + + /** + * + */ + private final Map<String, FilterMetadata> metadata; + + /** + * + */ + private final Order[] orderProperties; + + private List<Criterion> additionalCriteria; + + /** + * @param filter + * @param page + * @param maxResults + * @param metadata + * @param orderProperties + */ + private HibernateCallbackForExecution( + T filter, + int page, + int maxResults, + Map<String, FilterMetadata> metadata, + Order[] orderProperties, + List<Criterion> additionalCriteria) + { + this.filter = filter; + this.page = page; + this.maxResults = maxResults; + this.metadata = metadata; + this.orderProperties = orderProperties; + this.additionalCriteria = additionalCriteria; + } + + public Object doInHibernate(Session ses) throws HibernateException + { + Criteria crit = ses.createCriteria(filter.getClass()); + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + crit.setMaxResults(maxResults); + crit.setFirstResult(maxResults * page); + + if (orderProperties != null && orderProperties.length > 0) + { + for (Order order : orderProperties) + { + if (order != null) + { + crit.addOrder(order); + } + } + } + EnhancedExample.create(crit, filter, metadata); + if (additionalCriteria != null && !additionalCriteria.isEmpty()) + { + for (Criterion criterion : additionalCriteria) + { + crit.add(criterion); + } + } + return crit.list(); + } + } + } \ No newline at end of file Modified: trunk/openutils-configuration-dataobjects/pom.xml =================================================================== --- trunk/openutils-configuration-dataobjects/pom.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-dataobjects/pom.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -3,7 +3,7 @@ <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> - <version>3</version> + <version>5</version> <relativePath>..</relativePath> </parent> <groupId>net.sourceforge.openutils</groupId> Modified: trunk/openutils-configuration-services/pom.xml =================================================================== --- trunk/openutils-configuration-services/pom.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/pom.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,9 +1,10 @@ -<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> <artifactId>openutils</artifactId> - <version>3</version> + <version>5</version> <relativePath>..</relativePath> </parent> <groupId>net.sourceforge.openutils</groupId> @@ -12,11 +13,21 @@ <name>openutils-configuration</name> <version>0.2-SNAPSHOT</version> <description>Configuration services</description> + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + </testResource> + <testResource> + <directory>src/test/dbunit</directory> + </testResource> + </testResources> + </build> <dependencies> <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-spring</artifactId> - <version>1.0</version> + <version>1.0.5-SNAPSHOT</version> <optional>true</optional> </dependency> <dependency> @@ -27,7 +38,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-bshd5</artifactId> - <version>1.0.5</version> + <version>1.0.10-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> @@ -38,9 +49,14 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> + <version>1.4.3</version> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.13</version> @@ -50,6 +66,16 @@ <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.2.1.ga</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>commons-dbcp</groupId> @@ -75,8 +101,14 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> - <version>2.0.6</version> + <version>${spring.version}</version> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.derby</groupId> @@ -89,6 +121,15 @@ <artifactId>dbunit</artifactId> <version>2.2</version> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> </dependencies> + <properties> + <spring.version>2.5</spring.version> + </properties> </project> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/ConfigurationCodeDAOTest-load.xml (from rev 513, trunk/openutils-configuration-services/src/test/resources/ConfigurationCodeDAOTest-load.xml) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/ConfigurationCodeDAOTest-load.xml (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/ConfigurationCodeDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,39 @@ +<!DOCTYPE dataset SYSTEM "dataset.dtd"> +<dataset> + <table name="APP_CONFIGURATION_DOMAIN"> + <column>ID_CONFIGURATIONDOMAIN</column> + <column>DESCRIPTION</column> + <row> + <value>DOMINIO1</value> + <value>DESCRIZIONE</value> + </row> + <row> + <value>APPLTEST</value> + <value>Application server configuration</value> + </row> + </table> + <table name="APP_CONFIGURATION_CODE"> + <column>ID_CONFIGURATIONCODE</column> + <column>ID_CONFIGURATIONDOMAIN</column> + <column>CODE</column> + <column>DESCRIPTION</column> + <column>TYPE</column> + <column>VALUE</column> + <row> + <value>1</value> + <value>DOMINIO1</value> + <value>CODE1</value> + <value>DESCRIZIONE</value> + <value>TIPO</value> + <value>VALORE</value> + </row> + <row> + <value>2</value> + <value>APPLTEST</value> + <value>CURVE_SEARCH_LIMIT</value> + <value>Maximum number of curves returned by a search operation.</value> + <value>INT</value> + <value>500</value> + </row> + </table> +</dataset> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/ConfigurationDomainDAOTest-load.xml (from rev 513, trunk/openutils-configuration-services/src/test/resources/ConfigurationDomainDAOTest-load.xml) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/ConfigurationDomainDAOTest-load.xml (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/ConfigurationDomainDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,11 @@ +<!DOCTYPE dataset SYSTEM "dataset.dtd"> +<dataset> + <table name="APP_CONFIGURATION_DOMAIN"> + <column>ID_CONFIGURATIONDOMAIN</column> + <column>DESCRIPTION</column> + <row> + <value>DOMINIO1</value> + <value>DESCRIZIONE</value> + </row> + </table> +</dataset> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/ConfigurationManagerTest-load.xml (from rev 513, trunk/openutils-configuration-services/src/test/resources/ConfigurationManagerTest-load.xml) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/ConfigurationManagerTest-load.xml (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/ConfigurationManagerTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,39 @@ +<!DOCTYPE dataset SYSTEM "dataset.dtd"> +<dataset> + <table name="APP_CONFIGURATION_DOMAIN"> + <column>ID_CONFIGURATIONDOMAIN</column> + <column>DESCRIPTION</column> + <row> + <value>CONFIG_DOMAIN</value> + <value>DESCRIZIONE</value> + </row> + <row> + <value>CONFIG_DOMAIN_2</value> + <value>DESCRIZIONE_2</value> + </row> + </table> + <table name="APP_CONFIGURATION_CODE"> + <column>ID_CONFIGURATIONCODE</column> + <column>ID_CONFIGURATIONDOMAIN</column> + <column>CODE</column> + <column>DESCRIPTION</column> + <column>TYPE</column> + <column>VALUE</column> + <row> + <value>5</value> + <value>CONFIG_DOMAIN</value> + <value>CODICE</value> + <value>DESCRIZIONE</value> + <value>TIPO</value> + <value>VALORE</value> + </row> + <row> + <value>6</value> + <value>CONFIG_DOMAIN_2</value> + <value>CODICE</value> + <value>DESCRIZIONE</value> + <value>TIPO</value> + <value>VALORE</value> + </row> + </table> +</dataset> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/ReferenceCodeDAOTest-load.xml (from rev 513, trunk/openutils-configuration-services/src/test/resources/ReferenceCodeDAOTest-load.xml) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/ReferenceCodeDAOTest-load.xml (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/ReferenceCodeDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,25 @@ +<!DOCTYPE dataset SYSTEM "dataset.dtd"> +<dataset> + <table name="APP_REFERENCE_DOMAIN"> + <column>ID_REFERENCEDOMAIN</column> + <column>DESCRIPTION</column> + <row> + <value>DOMINIO1</value> + <value>DESCRIZIONE</value> + </row> + </table> + <table name="APP_REFERENCE_CODE"> + <column>ID_REFERENCECODE</column> + <column>ID_REFERENCEDOMAIN</column> + <column>CODE</column> + <column>DESCRIPTION</column> + <column>ACTIVE</column> + <row> + <value>1</value> + <value>DOMINIO1</value> + <value>CODICE</value> + <value>DESCRIZIONE</value> + <value>0</value> + </row> + </table> +</dataset> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/ReferenceDomainDAOTest-load.xml (from rev 513, trunk/openutils-configuration-services/src/test/resources/ReferenceDomainDAOTest-load.xml) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/ReferenceDomainDAOTest-load.xml (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/ReferenceDomainDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,11 @@ +<!DOCTYPE dataset SYSTEM "dataset.dtd"> +<dataset> + <table name="APP_REFERENCE_DOMAIN"> + <column>ID_REFERENCEDOMAIN</column> + <column>DESCRIPTION</column> + <row> + <value>DOMINIO1</value> + <value>DESCRIZIONE</value> + </row> + </table> +</dataset> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/ReferenceManagerTest-load.xml (from rev 513, trunk/openutils-configuration-services/src/test/resources/ReferenceManagerTest-load.xml) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/ReferenceManagerTest-load.xml (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/ReferenceManagerTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,25 @@ +<!DOCTYPE dataset SYSTEM "dataset.dtd"> +<dataset> + <table name="APP_REFERENCE_DOMAIN"> + <column>ID_REFERENCEDOMAIN</column> + <column>DESCRIPTION</column> + <row> + <value>CURVE_DOMAIN</value> + <value>DESCRIZIONE</value> + </row> + </table> + <table name="APP_REFERENCE_CODE"> + <column>ID_REFERENCECODE</column> + <column>ID_REFERENCEDOMAIN</column> + <column>CODE</column> + <column>DESCRIPTION</column> + <column>ACTIVE</column> + <row> + <value>7</value> + <value>CURVE_DOMAIN</value> + <value>CODICE</value> + <value>DESCRIZIONE</value> + <value>1</value> + </row> + </table> +</dataset> \ No newline at end of file Copied: trunk/openutils-configuration-services/src/test/dbunit/dataset.dtd (from rev 513, trunk/openutils-configuration-services/src/test/resources/dataset.dtd) =================================================================== --- trunk/openutils-configuration-services/src/test/dbunit/dataset.dtd (rev 0) +++ trunk/openutils-configuration-services/src/test/dbunit/dataset.dtd 2008-01-04 21:22:28 UTC (rev 515) @@ -0,0 +1,13 @@ +<!ELEMENT dataset (table*)> +<!ELEMENT table (column+,row+)> +<!ATTLIST table + name CDATA #REQUIRED +> +<!ELEMENT row (value|null)+> +<!ELEMENT column (#PCDATA)> +<!ELEMENT value (#PCDATA)> +<!ELEMENT null EMPTY> +<!-- +nb una tabella senza righe sarebbe valida (per cancellare tutto il contenuto), +ma NON DEVE ESISTERE NEI NOSTRI TEST IN QUANTO TUTTE LE TABELLE VENGONO SVUOTATE PRIMA DEL CARICAMENTO +--> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/ConfigurationCodeDAOTest-load.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/ConfigurationCodeDAOTest-load.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/ConfigurationCodeDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,39 +0,0 @@ -<!DOCTYPE dataset SYSTEM "dataset.dtd"> -<dataset> - <table name="APP_CONFIGURATION_DOMAIN"> - <column>ID_CONFIGURATIONDOMAIN</column> - <column>DESCRIPTION</column> - <row> - <value>DOMINIO1</value> - <value>DESCRIZIONE</value> - </row> - <row> - <value>APPLTEST</value> - <value>Application server configuration</value> - </row> - </table> - <table name="APP_CONFIGURATION_CODE"> - <column>ID_CONFIGURATIONCODE</column> - <column>ID_CONFIGURATIONDOMAIN</column> - <column>CODE</column> - <column>DESCRIPTION</column> - <column>TYPE</column> - <column>VALUE</column> - <row> - <value>1</value> - <value>DOMINIO1</value> - <value>CODE1</value> - <value>DESCRIZIONE</value> - <value>TIPO</value> - <value>VALORE</value> - </row> - <row> - <value>2</value> - <value>APPLTEST</value> - <value>CURVE_SEARCH_LIMIT</value> - <value>Maximum number of curves returned by a search operation.</value> - <value>INT</value> - <value>500</value> - </row> - </table> -</dataset> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/ConfigurationDomainDAOTest-load.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/ConfigurationDomainDAOTest-load.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/ConfigurationDomainDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,11 +0,0 @@ -<!DOCTYPE dataset SYSTEM "dataset.dtd"> -<dataset> - <table name="APP_CONFIGURATION_DOMAIN"> - <column>ID_CONFIGURATIONDOMAIN</column> - <column>DESCRIPTION</column> - <row> - <value>DOMINIO1</value> - <value>DESCRIZIONE</value> - </row> - </table> -</dataset> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/ConfigurationManagerTest-load.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/ConfigurationManagerTest-load.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/ConfigurationManagerTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,39 +0,0 @@ -<!DOCTYPE dataset SYSTEM "dataset.dtd"> -<dataset> - <table name="APP_CONFIGURATION_DOMAIN"> - <column>ID_CONFIGURATIONDOMAIN</column> - <column>DESCRIPTION</column> - <row> - <value>CONFIG_DOMAIN</value> - <value>DESCRIZIONE</value> - </row> - <row> - <value>CONFIG_DOMAIN_2</value> - <value>DESCRIZIONE_2</value> - </row> - </table> - <table name="APP_CONFIGURATION_CODE"> - <column>ID_CONFIGURATIONCODE</column> - <column>ID_CONFIGURATIONDOMAIN</column> - <column>CODE</column> - <column>DESCRIPTION</column> - <column>TYPE</column> - <column>VALUE</column> - <row> - <value>5</value> - <value>CONFIG_DOMAIN</value> - <value>CODICE</value> - <value>DESCRIZIONE</value> - <value>TIPO</value> - <value>VALORE</value> - </row> - <row> - <value>6</value> - <value>CONFIG_DOMAIN_2</value> - <value>CODICE</value> - <value>DESCRIZIONE</value> - <value>TIPO</value> - <value>VALORE</value> - </row> - </table> -</dataset> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/ReferenceCodeDAOTest-load.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/ReferenceCodeDAOTest-load.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/ReferenceCodeDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,25 +0,0 @@ -<!DOCTYPE dataset SYSTEM "dataset.dtd"> -<dataset> - <table name="APP_REFERENCE_DOMAIN"> - <column>ID_REFERENCEDOMAIN</column> - <column>DESCRIPTION</column> - <row> - <value>DOMINIO1</value> - <value>DESCRIZIONE</value> - </row> - </table> - <table name="APP_REFERENCE_CODE"> - <column>ID_REFERENCECODE</column> - <column>ID_REFERENCEDOMAIN</column> - <column>CODE</column> - <column>DESCRIPTION</column> - <column>ACTIVE</column> - <row> - <value>1</value> - <value>DOMINIO1</value> - <value>CODICE</value> - <value>DESCRIZIONE</value> - <value>0</value> - </row> - </table> -</dataset> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/ReferenceDomainDAOTest-load.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/ReferenceDomainDAOTest-load.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/ReferenceDomainDAOTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,11 +0,0 @@ -<!DOCTYPE dataset SYSTEM "dataset.dtd"> -<dataset> - <table name="APP_REFERENCE_DOMAIN"> - <column>ID_REFERENCEDOMAIN</column> - <column>DESCRIPTION</column> - <row> - <value>DOMINIO1</value> - <value>DESCRIZIONE</value> - </row> - </table> -</dataset> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/ReferenceManagerTest-load.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/ReferenceManagerTest-load.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/ReferenceManagerTest-load.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,25 +0,0 @@ -<!DOCTYPE dataset SYSTEM "dataset.dtd"> -<dataset> - <table name="APP_REFERENCE_DOMAIN"> - <column>ID_REFERENCEDOMAIN</column> - <column>DESCRIPTION</column> - <row> - <value>CURVE_DOMAIN</value> - <value>DESCRIZIONE</value> - </row> - </table> - <table name="APP_REFERENCE_CODE"> - <column>ID_REFERENCECODE</column> - <column>ID_REFERENCEDOMAIN</column> - <column>CODE</column> - <column>DESCRIPTION</column> - <column>ACTIVE</column> - <row> - <value>7</value> - <value>CURVE_DOMAIN</value> - <value>CODICE</value> - <value>DESCRIZIONE</value> - <value>1</value> - </row> - </table> -</dataset> \ No newline at end of file Deleted: trunk/openutils-configuration-services/src/test/resources/dataset.dtd =================================================================== --- trunk/openutils-configuration-services/src/test/resources/dataset.dtd 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/dataset.dtd 2008-01-04 21:22:28 UTC (rev 515) @@ -1,13 +0,0 @@ -<!ELEMENT dataset (table*)> -<!ELEMENT table (column+,row+)> -<!ATTLIST table - name CDATA #REQUIRED -> -<!ELEMENT row (value|null)+> -<!ELEMENT column (#PCDATA)> -<!ELEMENT value (#PCDATA)> -<!ELEMENT null EMPTY> -<!-- -nb una tabella senza righe sarebbe valida (per cancellare tutto il contenuto), -ma NON DEVE ESISTERE NEI NOSTRI TEST IN QUANTO TUTTE LE TABELLE VENGONO SVUOTATE PRIMA DEL CARICAMENTO ---> \ No newline at end of file Modified: trunk/openutils-configuration-services/src/test/resources/spring-dao.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/spring-dao.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/spring-dao.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -2,33 +2,32 @@ <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> - <bean id="configurationCodeDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.configuration.dao.ConfigurationCodeDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - <bean id="configurationDomainDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.configuration.dao.ConfigurationDomainDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - <bean id="referenceCodeDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.configuration.dao.ReferenceCodeDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - <bean id="referenceDomainDAO" parent="txProxyTemplate"> - <property name="target"> - <bean class="it.openutils.configuration.dao.ReferenceDomainDAOImpl"> - <property name="sessionFactory" ref="sessionFactory" /> - </bean> - </property> - </bean> - + <bean id="configurationCodeDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.configuration.dao.ConfigurationCodeDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> + <bean id="configurationDomainDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.configuration.dao.ConfigurationDomainDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> + <bean id="referenceCodeDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.configuration.dao.ReferenceCodeDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> + <bean id="referenceDomainDAO" parent="txProxyTemplate"> + <property name="target"> + <bean class="it.openutils.configuration.dao.ReferenceDomainDAOImpl"> + <property name="sessionFactory" ref="sessionFactory" /> + </bean> + </property> + </bean> </beans> \ No newline at end of file Modified: trunk/openutils-configuration-services/src/test/resources/spring-database.xml =================================================================== --- trunk/openutils-configuration-services/src/test/resources/spring-database.xml 2008-01-04 21:21:07 UTC (rev 514) +++ trunk/openutils-configuration-services/src/test/resources/spring-database.xml 2008-01-04 21:22:28 UTC (rev 515) @@ -1,28 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!-- - # ATTENZIONE: queste proprietà sono utilizzate solo per gli unit tests - # i file per la configurazione del db utilizzati dall'applicazione web sono in - # src/main/web-app/WEB-INF + # ATTENZIONE: queste proprietà sono utilizzate solo per gli unit tests + # i file per la configurazione del db utilizzati dall'applicazione web sono in + # src/main/web-app/WEB-INF --> <beans> - <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> - <property name="location"> - <value>classpath:database.properties</value> - </property> - </bean> - <bean id="dataSource"... [truncated message content] |
From: <fg...@us...> - 2008-01-04 21:21:06
|
Revision: 514 http://openutils.svn.sourceforge.net/openutils/?rev=514&view=rev Author: fgiust Date: 2008-01-04 13:21:07 -0800 (Fri, 04 Jan 2008) Log Message: ----------- bump version Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2007-12-02 16:49:00 UTC (rev 513) +++ trunk/pom.xml 2008-01-04 21:21:07 UTC (rev 514) @@ -5,7 +5,7 @@ <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> <packaging>pom</packaging> - <version>4</version> + <version>5</version> <name>openutils</name> <description>openutils parent POM</description> <url>http://openutils.sourceforge.net</url> @@ -216,4 +216,23 @@ <module>openutils-mgnlstripes</module> <module>openutils-spring-rmibernate</module> </modules> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>INVALID</version><!-- prevents from importing duplicate dependencies --> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + <version>INVALID</version><!-- prevents from importing duplicate dependencies --> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + <version>INVALID</version><!-- prevents from importing duplicate dependencies --> + </dependency> + </dependencies> + </dependencyManagement> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-12-02 16:48:55
|
Revision: 513 http://openutils.svn.sourceforge.net/openutils/?rev=513&view=rev Author: fgiust Date: 2007-12-02 08:49:00 -0800 (Sun, 02 Dec 2007) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-12-02 16:48:54 UTC (rev 512) +++ trunk/openutils-mgnlstripes/pom.xml 2007-12-02 16:49:00 UTC (rev 513) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> - <version>3.5-rc2</version> + <version>3.5-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -96,10 +96,4 @@ </snapshots> </repository> </repositories> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5-rc2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5-rc2</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-3.5-rc2</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-12-02 16:48:49
|
Revision: 512 http://openutils.svn.sourceforge.net/openutils/?rev=512&view=rev Author: fgiust Date: 2007-12-02 08:48:54 -0800 (Sun, 02 Dec 2007) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlstripes-3.5-rc2 Added Paths: ----------- tags/openutils-mgnlstripes-3.5-rc2/ tags/openutils-mgnlstripes-3.5-rc2/pom.xml tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java tags/openutils-mgnlstripes-3.5-rc2/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml Removed Paths: ------------- tags/openutils-mgnlstripes-3.5-rc2/pom.xml tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesModule.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java Copied: tags/openutils-mgnlstripes-3.5-rc2 (from rev 509, trunk/openutils-mgnlstripes) Deleted: tags/openutils-mgnlstripes-3.5-rc2/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-11-14 14:17:57 UTC (rev 509) +++ tags/openutils-mgnlstripes-3.5-rc2/pom.xml 2007-12-02 16:48:54 UTC (rev 512) @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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"> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>4</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlstripes</artifactId> - <name>openutils-mgnlstripes</name> - <version>0.3-SNAPSHOT</version> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>net.sourceforge.stripes</groupId> - <artifactId>stripes</artifactId> - <version>1.4.3</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.1-m3</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.1-m3</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - <version>2.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> -</project> Copied: tags/openutils-mgnlstripes-3.5-rc2/pom.xml (from rev 511, trunk/openutils-mgnlstripes/pom.xml) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/pom.xml (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/pom.xml 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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"> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>4</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlstripes</artifactId> + <name>openutils-mgnlstripes</name> + <version>3.5-rc2</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>net.sourceforge.stripes</groupId> + <artifactId>stripes</artifactId> + <version>1.4.3</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.5-rc2</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.5-rc2</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://svn.magnolia.info/maven/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5-rc2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5-rc2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-3.5-rc2</url> + </scm> +</project> Copied: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java (from rev 510, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,179 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.beans.runtime.Document; +import info.magnolia.cms.beans.runtime.MultipartForm; +import info.magnolia.context.Context; +import info.magnolia.context.MgnlContext; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.action.FileBean; +import net.sourceforge.stripes.controller.FileUploadLimitExceededException; +import net.sourceforge.stripes.controller.multipart.MultipartWrapper; + +import org.apache.commons.io.IOUtils; + + +/** + * An implementation of MultipartWrapper that delegates to the standard magnolia multipart form handling. + * @author fgiust + * @version $Id: $ + */ +public class MagnoliaMultipartWrapper implements MultipartWrapper +{ + + /** + * Nothing to do here {@inheritDoc} + */ + public void build(HttpServletRequest request, File tempDir, long maxPostSize) throws IOException, + FileUploadLimitExceededException + { + // nothing to do, already provided by magnolia + + } + + private MultipartForm getForm() + { + return (MultipartForm) MgnlContext.getAttribute(MultipartForm.REQUEST_ATTRIBUTE_NAME, Context.LOCAL_SCOPE); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public Enumeration<String> getParameterNames() + { + return getForm().getParameterNames(); + } + + /** + * {@inheritDoc} + */ + public String[] getParameterValues(String name) + { + return getForm().getParameterValues(name); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public Enumeration<String> getFileParameterNames() + { + return new IteratorEnumeration(getForm().getDocuments().keySet().iterator()); + } + + /** + * {@inheritDoc} + */ + public FileBean getFileParameterValue(String name) + { + final Document item = getForm().getDocument(name); + if (item == null) + { + return null; + } + else + { + // Use an anonymous inner subclass of FileBean that overrides all the + // methods that rely on having a File present, to use the FileItem + // created by commons upload instead. + return new FileBean(null, item.getType(), item.getFileNameWithExtension()) + { + + @Override + public long getSize() + { + return item.getLength(); + } + + @Override + public InputStream getInputStream() throws IOException + { + return item.getStream(); + } + + @Override + public void save(File toFile) throws IOException + { + OutputStream os = null; + InputStream is = null; + try + { + os = new BufferedOutputStream(new FileOutputStream(toFile)); + is = item.getStream(); + IOUtils.copyLarge(is, os); + + delete(); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + else + { + IOException ioe = new IOException("Problem saving uploaded file."); + ioe.initCause(e); + throw ioe; + } + } + finally + { + IOUtils.closeQuietly(is); + IOUtils.closeQuietly(os); + } + } + + @Override + public void delete() throws IOException + { + item.delete(); + } + }; + } + } + + /** + * Little helper class to create an enumeration as per the interface. + */ + private static class IteratorEnumeration implements Enumeration<String> + { + + Iterator<String> iterator; + + /** + * Constructs an enumeration that consumes from the underlying iterator. + */ + IteratorEnumeration(Iterator<String> iterator) + { + this.iterator = iterator; + } + + /** + * Returns true if more elements can be consumed, false otherwise. + */ + public boolean hasMoreElements() + { + return this.iterator.hasNext(); + } + + /** + * Gets the next element out of the iterator. + */ + public String nextElement() + { + return this.iterator.next(); + } + } +} Deleted: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-11-14 14:17:57 UTC (rev 509) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-12-02 16:48:54 UTC (rev 512) @@ -1,79 +0,0 @@ -package it.openutils.magnoliastripes; - -import info.magnolia.cms.beans.config.Paragraph; -import info.magnolia.cms.beans.config.ParagraphManager; -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.NameBasedActionResolver; - -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * ActionResolver that extends <code>NameBasedActionResolver</code>, registering any found Stripe action as a - * Magnolia paragraph. - * @author fgiust - * @version $Id: $ - */ -public class MgnlActionResolver extends NameBasedActionResolver -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(MgnlActionResolver.class); - - /** - * {@inheritDoc} - */ - @Override - protected void addActionBean(Class< ? extends ActionBean> clazz) - { - String binding = getUrlBinding(clazz); - - // Only process the class if it's properly annotated - if (binding != null) - { - String dialogName = actionNameToParagraphName(binding); - registerSpringParagraph(dialogName, binding); - super.addActionBean(clazz); - } - } - - /** - * Generate a paragraph name from a Stripes binding. This method will take the last token after "/", strip any - * extension and convert everything to lowercase. - * @param binding Stripe action binding - * @return paragraph name - */ - protected String actionNameToParagraphName(String binding) - { - String dialogName = StringUtils.lowerCase(StringUtils.substringBeforeLast(StringUtils.substringAfterLast( - binding, - "/"), ".")); - return dialogName; - } - - /** - * Registers a Magnolia paragraph which will delegate to a Stripe action. - * @param name dialog name - * @param binding Stripes action binding - */ - @SuppressWarnings("unchecked") - private void registerSpringParagraph(String name, String binding) - { - Paragraph paragraph = new Paragraph(); - - paragraph.setName(name); - paragraph.setTitle("paragraph." + name + ".title"); - paragraph.setDescription("paragraph." + name + ".description"); - paragraph.setDialog(name); - paragraph.setTemplatePath(binding); - paragraph.setType("stripes"); - - log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ - ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); - } - -} Copied: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java (from rev 510, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,99 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.beans.config.Paragraph; +import info.magnolia.cms.beans.config.ParagraphManager; + +import java.util.HashSet; +import java.util.Set; + +import net.sourceforge.stripes.action.ActionBean; +import net.sourceforge.stripes.controller.NameBasedActionResolver; + +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * ActionResolver that extends <code>NameBasedActionResolver</code>, registering any found Stripe action as a + * Magnolia paragraph. + * @author fgiust + * @version $Id: $ + */ +public class MgnlActionResolver extends NameBasedActionResolver +{ + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(MgnlActionResolver.class); + + /** + * Configured Stripes paragraphs. + */ + private static Set<Paragraph> paragraphs = new HashSet<Paragraph>(); + + /** + * {@inheritDoc} + */ + @Override + protected void addActionBean(Class< ? extends ActionBean> clazz) + { + String binding = getUrlBinding(clazz); + + // Only process the class if it's properly annotated + if (binding != null) + { + String dialogName = actionNameToParagraphName(binding); + collectStripesParagraphs(dialogName, binding); + super.addActionBean(clazz); + } + } + + /** + * Generate a paragraph name from a Stripes binding. This method will take the last token after "/", strip any + * extension and convert everything to lowercase. + * @param binding Stripe action binding + * @return paragraph name + */ + protected String actionNameToParagraphName(String binding) + { + String dialogName = StringUtils.lowerCase(StringUtils.substringBeforeLast(StringUtils.substringAfterLast( + binding, + "/"), ".")); + return dialogName; + } + + /** + * Registers a Magnolia paragraph which will delegate to a Stripe action. + * @param name dialog name + * @param binding Stripes action binding + */ + @SuppressWarnings("unchecked") + private void collectStripesParagraphs(String name, String binding) + { + Paragraph paragraph = new Paragraph(); + + paragraph.setName(name); + paragraph.setTitle("paragraph." + name + ".title"); + paragraph.setDescription("paragraph." + name + ".description"); + paragraph.setDialog(name); + paragraph.setTemplatePath(binding); + paragraph.setType("stripes"); + paragraphs.add(paragraph); + + log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ + ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); + } + + @SuppressWarnings("unchecked") + public static void registerParagraphs() + { + for (Paragraph paragraph : paragraphs) + { + log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ + ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); + } + } + +} Copied: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java (from rev 510, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,96 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.filters.MgnlFilter; +import info.magnolia.context.MgnlContext; +import info.magnolia.context.WebContext; +import info.magnolia.voting.Voter; +import info.magnolia.voting.Voting; + +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.controller.StripesFilter; +import net.sourceforge.stripes.controller.StripesRequestWrapper; +import net.sourceforge.stripes.exception.StripesServletException; + +import org.apache.commons.lang.ArrayUtils; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class StripesMagnoliaFilter extends StripesFilter implements MgnlFilter +{ + + private String name; + + private Voter[] bypasses = new Voter[0]; + + private boolean enabled = true; + + public boolean bypasses(HttpServletRequest request) + { + if (!isEnabled()) + { + return true; + } + if (MgnlContext.hasInstance()) + { + return Voting.Factory.getDefaultVoting().vote(bypasses, request) > 0; + } + return false; + } + + public Voter[] getBypasses() + { + return this.bypasses; + } + + public void addBypass(Voter voter) + { + this.bypasses = (Voter[]) ArrayUtils.add(this.bypasses, voter); + } + + public String getName() + { + return this.name; + } + + public void setName(String name) + { + this.name = name; + } + + public boolean isEnabled() + { + return this.enabled; + } + + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } + + /** + * Wraps the HttpServletRequest with a StripesServletRequest. This is done to ensure that any form posts that + * contain file uploads get handled appropriately. + * @param servletRequest the HttpServletRequest handed to the dispatcher by the container + * @return an instance of StripesRequestWrapper, which is an HttpServletRequestWrapper + * @throws StripesServletException if the wrapper cannot be constructed + */ + @Override + protected StripesRequestWrapper wrapRequest(HttpServletRequest servletRequest) throws StripesServletException + { + StripesRequestWrapper srw = new StripesRequestWrapper(servletRequest); + + if (MgnlContext.hasInstance()) + { + // be sure that the request wrapper gets setted in mgnlcontext too + WebContext webContext = (WebContext) MgnlContext.getInstance(); + webContext.init(servletRequest, webContext.getResponse(), webContext.getServletContext()); + } + + return srw; + } + +} Deleted: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesModule.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-11-14 14:17:57 UTC (rev 509) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-12-02 16:48:54 UTC (rev 512) @@ -1,23 +0,0 @@ -package it.openutils.magnoliastripes; - -import info.magnolia.module.ModuleLifecycle; -import info.magnolia.module.ModuleLifecycleContext; - - -/** - * Stripes module. - * @author fgiust - * @version $Id: $ - */ -public class StripesModule implements ModuleLifecycle -{ - - /** - * {@inheritDoc} - */ - public void start(ModuleLifecycleContext moduleLifecycleContext) - { - // anything to do? - } - -} \ No newline at end of file Deleted: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-11-14 14:17:57 UTC (rev 509) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-12-02 16:48:54 UTC (rev 512) @@ -1,333 +0,0 @@ -package it.openutils.magnoliastripes; - -import info.magnolia.cms.beans.config.Paragraph; -import info.magnolia.cms.beans.runtime.ParagraphRenderer; -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.NodeData; -import info.magnolia.context.MgnlContext; -import info.magnolia.context.WebContext; - -import java.io.IOException; -import java.io.Writer; -import java.lang.reflect.InvocationTargetException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.jsp.PageContext; - -import net.sourceforge.stripes.action.ActionBeanContext; -import net.sourceforge.stripes.action.Resolution; -import net.sourceforge.stripes.config.Configuration; -import net.sourceforge.stripes.controller.DispatcherHelper; -import net.sourceforge.stripes.controller.DispatcherServlet; -import net.sourceforge.stripes.controller.ExecutionContext; -import net.sourceforge.stripes.controller.LifecycleStage; -import net.sourceforge.stripes.controller.StripesConstants; -import net.sourceforge.stripes.controller.StripesFilter; -import net.sourceforge.stripes.exception.StripesServletException; -import net.sourceforge.stripes.validation.BooleanTypeConverter; - -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * <p> - * A Magnolia paragraph renderer that delegates to Stripes actions. Most of the code is just a cut and paste from - * Stripes' {@link DispatcherServlet}, adapted to work withing magnolia by: - * </p> - * <ul> - * <li>wrap the request in order to modify the request path and provide a custom requestDispatcher</li> - * <li>wrap the response in order to provide a custom Writer</li> - * <li>use a fake servlet instance/context to setup a Stripe context (there is no servlet here)</li> - * <li>injiect any paragraph property as a parameter</li> - * </ul> - * <p> - * <strong>Todo:</strong> - * </p> - * <ul> - * <li>Handle multipart forms in request wrapper (should be easy to do)</li> - * <li>A better way of handling multivalued properties in paragraph</li> - * <li>Handle binary properties in paragraph</li> - * </ul> - * @author fgiust - * @version $Id: $ - */ -public class StripesParagraphRenderer implements ParagraphRenderer -{ - - private Boolean alwaysInvokeValidate; - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(StripesParagraphRenderer.class); - - /** - * <p> - * Invokes the following instance level methods in order to coordinate the processing of requests: - * </p> - * <ul> - * <li>{@link #resolveActionBean(ExecutionContext)}</li> - * <li>{@link #resolveHandler(ExecutionContext)}</li> - * <li>{@link #doBindingAndValidation(ExecutionContext)}</li> - * <li>{@link #doCustomValidation(ExecutionContext)}</li> - * <li>{@link #handleValidationErrors(ExecutionContext)}</li> - * <li>{@link #invokeEventHandler(ExecutionContext)}</li> - * </ul> - * <p> - * If any of the above methods return a {@link Resolution} the rest of the request processing is aborted and the - * resolution is executed. - * </p> - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public void render(Content content, Paragraph paragraph, Writer out) throws IOException - { - // @fgiust start custom magnolia setup - - WebContext webContext = (WebContext) MgnlContext.getInstance(); - HttpServletResponse response = new StripesParagraphResponseWrapper(webContext.getResponse(), out); - - final String templatePath = paragraph.getTemplatePath(); - Map<String, String[]> nodeDataMap = contentToMap(content); - - HttpServletRequest request; - try - { - request = new StripesParagraphRequestWrapper( - ((WebContext) MgnlContext.getInstance()).getRequest(), - templatePath, - nodeDataMap); - - ((StripesParagraphRequestWrapper) request).setLocale(MgnlContext.getLocale()); - } - catch (StripesServletException e) - { - throw new RuntimeException(e); - } - - // @todo fgiust force include instead of forwarding. Not needed anymore since we are wrapping requestDispatcher? - request.setAttribute(StripesConstants.REQ_ATTR_INCLUDE_PATH, templatePath); - - PageContext pageContext = webContext.getPageContext(); - ServletContext servletContext = null; - - if (pageContext != null) - { - pageContext.getServletContext(); - } - // @fgiust end custom magnolia setup - - // It sucks that we have to do this here (in the request cycle), but there doesn't - // seem to be a good way to get at the Configuration from the Filter in init() - doOneTimeConfiguration(); - - log.debug("Dispatching request to URL: ", request.getRequestURI()); - - try - { - final Configuration config = StripesFilter.getConfiguration(); - - // First manufacture an ActionBeanContext - final ActionBeanContext context = config - .getActionBeanContextFactory() - .getContextInstance(request, response); - context.setServletContext(servletContext); - - // Then setup the ExecutionContext that we'll use to process this request - final ExecutionContext ctx = new ExecutionContext(); - ctx.setInterceptors(config.getInterceptors(LifecycleStage.ActionBeanResolution)); - ctx.setLifecycleStage(LifecycleStage.ActionBeanResolution); - ctx.setActionBeanContext(context); - - ActionBeanContext abc = ctx.getActionBeanContext(); - if (pageContext != null) - { - DispatcherHelper.setPageContext(pageContext); - } - - // Resolve the ActionBean, and if an interceptor returns a resolution, bail now - saveActionBean(request); - Resolution resolution = DispatcherHelper.resolveActionBean(ctx); - - if (resolution == null) - { - resolution = DispatcherHelper.resolveHandler(ctx); - - if (resolution == null) - { - // Then run binding and validation - resolution = DispatcherHelper.doBindingAndValidation(ctx, true); - - if (resolution == null) - { - // Then continue on to custom validation - resolution = DispatcherHelper.doCustomValidation(ctx, alwaysInvokeValidate); - - if (resolution == null) - { - // And then validation error handling - resolution = DispatcherHelper.handleValidationErrors(ctx); - - if (resolution == null) - { - // And finally(ish) invoking of the event handler - resolution = DispatcherHelper.invokeEventHandler(ctx); - - // If the event produced errors, fill them in - DispatcherHelper.fillInValidationErrors(ctx); - } - } - } - } - } - - // Whatever stage it came from, execute the resolution - if (resolution != null) - { - DispatcherHelper.executeResolution(ctx, resolution); - } - } - catch (RuntimeException re) - { - throw re; - } - catch (InvocationTargetException ite) - { - if (ite.getTargetException() instanceof RuntimeException) - { - throw (RuntimeException) ite.getTargetException(); - } - else - { - throw new RuntimeException("ActionBean execution threw an exception.", ite.getTargetException()); - } - } - catch (Exception e) - { - throw new RuntimeException("Exception encountered processing request.", e); - } - finally - { - - if (pageContext != null) - { - // *Don't* release the page context, if set it will be closed by the main magnolia template - // JspFactory.getDefaultFactory().releasePageContext(pageContext); - DispatcherHelper.setPageContext(null); - } - restoreActionBean(request); - } - } - - /** - * @param content paragraph node - * @return a map of Strings (converted nodedata) - */ - @SuppressWarnings("unchecked") - protected Map<String, String[]> contentToMap(Content content) - { - Collection<NodeData> paragraphsData = content.getNodeDataCollection(); - Map<String, String[]> nodeDataMap = new HashMap<String, String[]>(); - for (NodeData nodeData : paragraphsData) - { - String name = StringUtils.replaceChars(nodeData.getName(), "{}", "[]"); - String value = nodeData.getString(); - if (StringUtils.contains(name, "multiple")) - { - nodeDataMap.put(name, StringUtils.split(value, "\n")); - } - else - { - nodeDataMap.put(name, new String[]{value }); - } - } - return nodeDataMap; - } - - /** - * Performs a simple piece of one time configuration that requires access to the Configuration object delivered - * through the Stripes Filter. - */ - private void doOneTimeConfiguration() - { - if (alwaysInvokeValidate == null) - { - // Check to see if, in this application, validate() methods should always be run - // even when validation errors already exist - String callValidateWhenErrorsExist = StripesFilter - .getConfiguration() - .getBootstrapPropertyResolver() - .getProperty(DispatcherServlet.RUN_CUSTOM_VALIDATION_WHEN_ERRORS); - - if (callValidateWhenErrorsExist != null) - { - BooleanTypeConverter c = new BooleanTypeConverter(); - this.alwaysInvokeValidate = c.convert(callValidateWhenErrorsExist, Boolean.class, null); - } - else - { - this.alwaysInvokeValidate = false; // Default behaviour - } - } - } - - /** - * Fetches, and lazily creates if required, a Stack in the request to store ActionBeans should the current request - * involve forwards or includes to other ActionBeans. - * @param request the current HttpServletRequest - * @param create create a Stack if not already set - * @return the Stack if present, or if creation is requested - */ - @SuppressWarnings("unchecked") - protected Stack getActionBeanStack(HttpServletRequest request, boolean create) - { - Stack stack = (Stack) request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN_STACK); - if (stack == null && create) - { - stack = new Stack(); - request.setAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN_STACK, stack); - } - - return stack; - } - - /** - * Saves the current value of the 'actionBean' attribute in the request so that it can be restored at a later date - * by calling {@link #restoreActionBean(HttpServletRequest)}. If no ActionBean is currently stored in the request, - * nothing is changed. - * @param request the current HttpServletRequest - */ - @SuppressWarnings("unchecked") - protected void saveActionBean(HttpServletRequest request) - { - if (request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN) != null) - { - Stack stack = getActionBeanStack(request, true); - stack.push(request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN)); - } - } - - /** - * Restores the previous value of the 'actionBean' attribute in the request. If no ActionBeans have been saved using - * {@link #saveActionBean(HttpServletRequest)} then this method has no effect. - * @param request the current HttpServletRequest - */ - @SuppressWarnings("unchecked") - protected void restoreActionBean(HttpServletRequest request) - { - Stack stack = getActionBeanStack(request, false); - if (stack != null && !stack.empty()) - { - request.setAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN, stack.pop()); - } - } - -} Copied: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java (from rev 510, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,334 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.beans.config.Paragraph; +import info.magnolia.cms.beans.runtime.ParagraphRenderer; +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.NodeData; +import info.magnolia.context.MgnlContext; +import info.magnolia.context.WebContext; + +import java.io.IOException; +import java.io.Writer; +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.jsp.PageContext; + +import net.sourceforge.stripes.action.ActionBeanContext; +import net.sourceforge.stripes.action.Resolution; +import net.sourceforge.stripes.config.Configuration; +import net.sourceforge.stripes.controller.DispatcherHelper; +import net.sourceforge.stripes.controller.DispatcherServlet; +import net.sourceforge.stripes.controller.ExecutionContext; +import net.sourceforge.stripes.controller.LifecycleStage; +import net.sourceforge.stripes.controller.StripesConstants; +import net.sourceforge.stripes.controller.StripesFilter; +import net.sourceforge.stripes.exception.StripesServletException; +import net.sourceforge.stripes.validation.BooleanTypeConverter; + +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * <p> + * A Magnolia paragraph renderer that delegates to Stripes actions. Most of the code is just a cut and paste from + * Stripes' {@link DispatcherServlet}, adapted to work withing magnolia by: + * </p> + * <ul> + * <li>wrap the request in order to modify the request path and provide a custom requestDispatcher</li> + * <li>wrap the response in order to provide a custom Writer</li> + * <li>use a fake servlet instance/context to setup a Stripe context (there is no servlet here)</li> + * <li>injiect any paragraph property as a parameter</li> + * </ul> + * <p> + * <strong>Todo:</strong> + * </p> + * <ul> + * <li>Handle multipart forms in request wrapper (should be easy to do)</li> + * <li>A better way of handling multivalued properties in paragraph</li> + * <li>Handle binary properties in paragraph</li> + * </ul> + * @author fgiust + * @version $Id: $ + */ +public class StripesParagraphRenderer implements ParagraphRenderer +{ + + private Boolean alwaysInvokeValidate; + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(StripesParagraphRenderer.class); + + /** + * <p> + * Invokes the following instance level methods in order to coordinate the processing of requests: + * </p> + * <ul> + * <li>{@link #resolveActionBean(ExecutionContext)}</li> + * <li>{@link #resolveHandler(ExecutionContext)}</li> + * <li>{@link #doBindingAndValidation(ExecutionContext)}</li> + * <li>{@link #doCustomValidation(ExecutionContext)}</li> + * <li>{@link #handleValidationErrors(ExecutionContext)}</li> + * <li>{@link #invokeEventHandler(ExecutionContext)}</li> + * </ul> + * <p> + * If any of the above methods return a {@link Resolution} the rest of the request processing is aborted and the + * resolution is executed. + * </p> + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public void render(Content content, Paragraph paragraph, Writer out) throws IOException + { + // @fgiust start custom magnolia setup + + WebContext webContext = (WebContext) MgnlContext.getInstance(); + HttpServletResponse response = new StripesParagraphResponseWrapper(webContext.getResponse(), out); + + final String templatePath = paragraph.getTemplatePath(); + Map<String, String[]> nodeDataMap = contentToMap(content); + + HttpServletRequest request; + try + { + request = new StripesParagraphRequestWrapper( + ((WebContext) MgnlContext.getInstance()).getRequest(), + templatePath, + nodeDataMap); + + ((StripesParagraphRequestWrapper) request).setLocale(MgnlContext.getLocale()); + } + catch (StripesServletException e) + { + throw new RuntimeException(e); + } + + // @todo fgiust force include instead of forwarding. Not needed anymore since we are wrapping requestDispatcher? + request.setAttribute(StripesConstants.REQ_ATTR_INCLUDE_PATH, templatePath); + + PageContext pageContext = webContext.getPageContext(); + ServletContext servletContext = null; + + if (pageContext != null) + { + pageContext.getServletContext(); + } + // @fgiust end custom magnolia setup + + // It sucks that we have to do this here (in the request cycle), but there doesn't + // seem to be a good way to get at the Configuration from the Filter in init() + doOneTimeConfiguration(); + + log.debug("Dispatching request to URL: ", request.getRequestURI()); + + try + { + final Configuration config = StripesFilter.getConfiguration(); + + // First manufacture an ActionBeanContext + final ActionBeanContext context = config + .getActionBeanContextFactory() + .getContextInstance(request, response); + context.setServletContext(servletContext); + + // Then setup the ExecutionContext that we'll use to process this request + final ExecutionContext ctx = new ExecutionContext(); + ctx.setInterceptors(config.getInterceptors(LifecycleStage.ActionBeanResolution)); + ctx.setLifecycleStage(LifecycleStage.ActionBeanResolution); + ctx.setActionBeanContext(context); + + ActionBeanContext abc = ctx.getActionBeanContext(); + if (pageContext != null) + { + DispatcherHelper.setPageContext(pageContext); + } + + // Resolve the ActionBean, and if an interceptor returns a resolution, bail now + saveActionBean(request); + Resolution resolution = DispatcherHelper.resolveActionBean(ctx); + + if (resolution == null) + { + resolution = DispatcherHelper.resolveHandler(ctx); + + if (resolution == null) + { + // Then run binding and validation + resolution = DispatcherHelper.doBindingAndValidation(ctx, true); + + if (resolution == null) + { + // Then continue on to custom validation + resolution = DispatcherHelper.doCustomValidation(ctx, alwaysInvokeValidate); + + if (resolution == null) + { + // And then validation error handling + resolution = DispatcherHelper.handleValidationErrors(ctx); + + if (resolution == null) + { + // And finally(ish) invoking of the event handler + resolution = DispatcherHelper.invokeEventHandler(ctx); + + // If the event produced errors, fill them in + DispatcherHelper.fillInValidationErrors(ctx); + } + } + } + } + } + + // Whatever stage it came from, execute the resolution + if (resolution != null) + { + DispatcherHelper.executeResolution(ctx, resolution); + } + } + catch (RuntimeException re) + { + throw re; + } + catch (InvocationTargetException ite) + { + if (ite.getTargetException() instanceof RuntimeException) + { + throw (RuntimeException) ite.getTargetException(); + } + else + { + Throwable targetEx = ite.getTargetException(); + throw new RuntimeException(targetEx.getClass().getName() + ": " + targetEx.getMessage(), targetEx); + } + } + catch (Exception e) + { + throw new RuntimeException("Exception encountered processing request: " + e.getMessage(), e); + } + finally + { + + if (pageContext != null) + { + // *Don't* release the page context, if set it will be closed by the main magnolia template + // JspFactory.getDefaultFactory().releasePageContext(pageContext); + DispatcherHelper.setPageContext(null); + } + restoreActionBean(request); + } + } + + /** + * @param content paragraph node + * @return a map of Strings (converted nodedata) + */ + @SuppressWarnings("unchecked") + protected Map<String, String[]> contentToMap(Content content) + { + Collection<NodeData> paragraphsData = content.getNodeDataCollection(); + Map<String, String[]> nodeDataMap = new HashMap<String, String[]>(); + for (NodeData nodeData : paragraphsData) + { + String name = StringUtils.replaceChars(nodeData.getName(), "{}", "[]"); + String value = nodeData.getString(); + if (StringUtils.contains(name, "multiple")) + { + nodeDataMap.put(name, StringUtils.split(value, "\n")); + } + else + { + nodeDataMap.put(name, new String[]{value }); + } + } + return nodeDataMap; + } + + /** + * Performs a simple piece of one time configuration that requires access to the Configuration object delivered + * through the Stripes Filter. + */ + private void doOneTimeConfiguration() + { + if (alwaysInvokeValidate == null) + { + // Check to see if, in this application, validate() methods should always be run + // even when validation errors already exist + String callValidateWhenErrorsExist = StripesFilter + .getConfiguration() + .getBootstrapPropertyResolver() + .getProperty(DispatcherServlet.RUN_CUSTOM_VALIDATION_WHEN_ERRORS); + + if (callValidateWhenErrorsExist != null) + { + BooleanTypeConverter c = new BooleanTypeConverter(); + this.alwaysInvokeValidate = c.convert(callValidateWhenErrorsExist, Boolean.class, null); + } + else + { + this.alwaysInvokeValidate = false; // Default behaviour + } + } + } + + /** + * Fetches, and lazily creates if required, a Stack in the request to store ActionBeans should the current request + * involve forwards or includes to other ActionBeans. + * @param request the current HttpServletRequest + * @param create create a Stack if not already set + * @return the Stack if present, or if creation is requested + */ + @SuppressWarnings("unchecked") + protected Stack getActionBeanStack(HttpServletRequest request, boolean create) + { + Stack stack = (Stack) request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN_STACK); + if (stack == null && create) + { + stack = new Stack(); + request.setAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN_STACK, stack); + } + + return stack; + } + + /** + * Saves the current value of the 'actionBean' attribute in the request so that it can be restored at a later date + * by calling {@link #restoreActionBean(HttpServletRequest)}. If no ActionBean is currently stored in the request, + * nothing is changed. + * @param request the current HttpServletRequest + */ + @SuppressWarnings("unchecked") + protected void saveActionBean(HttpServletRequest request) + { + if (request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN) != null) + { + Stack stack = getActionBeanStack(request, true); + stack.push(request.getAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN)); + } + } + + /** + * Restores the previous value of the 'actionBean' attribute in the request. If no ActionBeans have been saved using + * {@link #saveActionBean(HttpServletRequest)} then this method has no effect. + * @param request the current HttpServletRequest + */ + @SuppressWarnings("unchecked") + protected void restoreActionBean(HttpServletRequest request) + { + Stack stack = getActionBeanStack(request, false); + if (stack != null && !stack.empty()) + { + request.setAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN, stack.pop()); + } + } + +} Deleted: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-11-14 14:17:57 UTC (rev 509) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-12-02 16:48:54 UTC (rev 512) @@ -1,67 +0,0 @@ -package it.openutils.magnoliastripes.setup; - -import info.magnolia.cms.beans.config.ContentRepository; -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.AbstractRepositoryTask; -import info.magnolia.module.delta.TaskExecutionException; - -import javax.jcr.RepositoryException; - - -/** - * Task that adds a mime mapping to <code>server/MIMIMapping</code>. - * @author fgiust - * @version $Revision: $ ($Author: $) - */ -public class AddMimeMappingTask extends AbstractRepositoryTask -{ - - /** - * Extension (without the <code>.</code>) - */ - private String extension; - - /** - * mime type. - */ - private String mime; - - /** - * Icon path. - */ - private String icon; - - /** - * @param extension Extension (without the <code>.</code>) - * @param mime mime type. - * @param icon Icon path. - */ - public AddMimeMappingTask(String extension, String mime, String icon) - { - super("Add mime mapping task", "Adds a MIME mapping for the " + extension + " extension"); - this.extension = extension; - this.mime = mime; - this.icon = icon; - } - - /** - * {@inheritDoc} - */ - @Override - protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException - { - HierarchyManager hm = ctx.getHierarchyManager(ContentRepository.CONFIG); - Content mimeNode = hm.getContent("/server/MIMEMapping"); - - if (!mimeNode.hasContent(extension)) - { - Content m = mimeNode.createContent(extension, ItemType.CONTENTNODE); - m.createNodeData("mime-type").setValue(mime); - m.createNodeData("icon").setValue(icon); - } - } - -} Deleted: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-11-14 14:17:57 UTC (rev 509) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-12-02 16:48:54 UTC (rev 512) @@ -1,30 +0,0 @@ -package it.openutils.magnoliastripes.setup; - -import info.magnolia.module.DefaultModuleVersionHandler; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.Task; - -import java.util.List; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class StripesModuleVersionHandler extends DefaultModuleVersionHandler -{ - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - protected List<Task> getBasicInstallTasks(InstallContext installContext) - { - List<Task> installTasks = super.getBasicInstallTasks(installContext); - - installTasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); - - return installTasks; - } -} Copied: tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java (from rev 510, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,36 @@ +package it.openutils.magnoliastripes.setup; + +import info.magnolia.module.DefaultModuleVersionHandler; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.AddMimeMappingTask; +import info.magnolia.module.delta.FilterOrderingTask; +import info.magnolia.module.delta.Task; + +import java.util.List; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class StripesModuleVersionHandler extends DefaultModuleVersionHandler +{ + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + protected List<Task> getBasicInstallTasks(InstallContext installContext) + { + List<Task> tasks = super.getBasicInstallTasks(installContext); + + tasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); + + tasks.add(new FilterOrderingTask( + "stripes", + new String[]{"context", "login", "uriSecurity", "multipartRequest" })); + + return tasks; + } +} Copied: tags/openutils-mgnlstripes-3.5-rc2/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml (from rev 510, trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml) =================================================================== --- tags/openutils-mgnlstripes-3.5-rc2/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml (rev 0) +++ tags/openutils-mgnlstripes-3.5-rc2/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml 2007-12-02 16:48:54 UTC (rev 512) @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="stripes" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl" + xmlns:rep="internal" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" + xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" + xmlns:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:versionable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>871bc964-af22-4713-a1d7-a71c80ffcf2f</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>it.openutils.magnoliastripes.StripesMagnoliaFilter</sv:value> + </sv:property> + <sv:property sv:name="enabled" sv:type="Boolean"> + <sv:value>true</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2006-07-28T23:39:30.812+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2007-10-04T23:04:20.237+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2007-10-04T23:05:02.810+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="bypasses"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:versionable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>6cc0bc00-3efa-41be-9278-70f2f93d23c6</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:prope... [truncated message content] |
From: <fg...@us...> - 2007-12-02 16:48:38
|
Revision: 511 http://openutils.svn.sourceforge.net/openutils/?rev=511&view=rev Author: fgiust Date: 2007-12-02 08:48:39 -0800 (Sun, 02 Dec 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlstripes-3.5-rc2 Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-12-02 16:46:09 UTC (rev 510) +++ trunk/openutils-mgnlstripes/pom.xml 2007-12-02 16:48:39 UTC (rev 511) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<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"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> @@ -11,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> - <version>3.5-SNAPSHOT</version> + <version>3.5-rc2</version> <licenses> <license> <name>GPLv3</name> @@ -97,4 +96,10 @@ </snapshots> </repository> </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5-rc2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5-rc2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-3.5-rc2</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-12-02 16:46:11
|
Revision: 510 http://openutils.svn.sourceforge.net/openutils/?rev=510&view=rev Author: fgiust Date: 2007-12-02 08:46:09 -0800 (Sun, 02 Dec 2007) Log Message: ----------- update to magnolia 3.5-rc2 Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml Removed Paths: ------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/pom.xml 2007-12-02 16:46:09 UTC (rev 510) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<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"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> @@ -10,7 +11,13 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> - <version>0.3-SNAPSHOT</version> + <version>3.5-SNAPSHOT</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> <build> <resources> <resource> @@ -44,12 +51,12 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>3.1-m3</version> + <version>3.5-rc2</version> </dependency> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> - <version>3.1-m3</version> + <version>3.5-rc2</version> </dependency> <dependency> <groupId>javax.servlet</groupId> @@ -77,4 +84,17 @@ </exclusions> </dependency> </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://svn.magnolia.info/maven/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> </project> Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java 2007-12-02 16:46:09 UTC (rev 510) @@ -0,0 +1,179 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.beans.runtime.Document; +import info.magnolia.cms.beans.runtime.MultipartForm; +import info.magnolia.context.Context; +import info.magnolia.context.MgnlContext; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.action.FileBean; +import net.sourceforge.stripes.controller.FileUploadLimitExceededException; +import net.sourceforge.stripes.controller.multipart.MultipartWrapper; + +import org.apache.commons.io.IOUtils; + + +/** + * An implementation of MultipartWrapper that delegates to the standard magnolia multipart form handling. + * @author fgiust + * @version $Id: $ + */ +public class MagnoliaMultipartWrapper implements MultipartWrapper +{ + + /** + * Nothing to do here {@inheritDoc} + */ + public void build(HttpServletRequest request, File tempDir, long maxPostSize) throws IOException, + FileUploadLimitExceededException + { + // nothing to do, already provided by magnolia + + } + + private MultipartForm getForm() + { + return (MultipartForm) MgnlContext.getAttribute(MultipartForm.REQUEST_ATTRIBUTE_NAME, Context.LOCAL_SCOPE); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public Enumeration<String> getParameterNames() + { + return getForm().getParameterNames(); + } + + /** + * {@inheritDoc} + */ + public String[] getParameterValues(String name) + { + return getForm().getParameterValues(name); + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public Enumeration<String> getFileParameterNames() + { + return new IteratorEnumeration(getForm().getDocuments().keySet().iterator()); + } + + /** + * {@inheritDoc} + */ + public FileBean getFileParameterValue(String name) + { + final Document item = getForm().getDocument(name); + if (item == null) + { + return null; + } + else + { + // Use an anonymous inner subclass of FileBean that overrides all the + // methods that rely on having a File present, to use the FileItem + // created by commons upload instead. + return new FileBean(null, item.getType(), item.getFileNameWithExtension()) + { + + @Override + public long getSize() + { + return item.getLength(); + } + + @Override + public InputStream getInputStream() throws IOException + { + return item.getStream(); + } + + @Override + public void save(File toFile) throws IOException + { + OutputStream os = null; + InputStream is = null; + try + { + os = new BufferedOutputStream(new FileOutputStream(toFile)); + is = item.getStream(); + IOUtils.copyLarge(is, os); + + delete(); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + else + { + IOException ioe = new IOException("Problem saving uploaded file."); + ioe.initCause(e); + throw ioe; + } + } + finally + { + IOUtils.closeQuietly(is); + IOUtils.closeQuietly(os); + } + } + + @Override + public void delete() throws IOException + { + item.delete(); + } + }; + } + } + + /** + * Little helper class to create an enumeration as per the interface. + */ + private static class IteratorEnumeration implements Enumeration<String> + { + + Iterator<String> iterator; + + /** + * Constructs an enumeration that consumes from the underlying iterator. + */ + IteratorEnumeration(Iterator<String> iterator) + { + this.iterator = iterator; + } + + /** + * Returns true if more elements can be consumed, false otherwise. + */ + public boolean hasMoreElements() + { + return this.iterator.hasNext(); + } + + /** + * Gets the next element out of the iterator. + */ + public String nextElement() + { + return this.iterator.next(); + } + } +} Property changes on: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MagnoliaMultipartWrapper.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/MgnlActionResolver.java 2007-12-02 16:46:09 UTC (rev 510) @@ -2,6 +2,10 @@ import info.magnolia.cms.beans.config.Paragraph; import info.magnolia.cms.beans.config.ParagraphManager; + +import java.util.HashSet; +import java.util.Set; + import net.sourceforge.stripes.action.ActionBean; import net.sourceforge.stripes.controller.NameBasedActionResolver; @@ -22,9 +26,14 @@ /** * Logger. */ - private Logger log = LoggerFactory.getLogger(MgnlActionResolver.class); + private static Logger log = LoggerFactory.getLogger(MgnlActionResolver.class); /** + * Configured Stripes paragraphs. + */ + private static Set<Paragraph> paragraphs = new HashSet<Paragraph>(); + + /** * {@inheritDoc} */ @Override @@ -36,7 +45,7 @@ if (binding != null) { String dialogName = actionNameToParagraphName(binding); - registerSpringParagraph(dialogName, binding); + collectStripesParagraphs(dialogName, binding); super.addActionBean(clazz); } } @@ -61,7 +70,7 @@ * @param binding Stripes action binding */ @SuppressWarnings("unchecked") - private void registerSpringParagraph(String name, String binding) + private void collectStripesParagraphs(String name, String binding) { Paragraph paragraph = new Paragraph(); @@ -71,9 +80,20 @@ paragraph.setDialog(name); paragraph.setTemplatePath(binding); paragraph.setType("stripes"); + paragraphs.add(paragraph); log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); } + @SuppressWarnings("unchecked") + public static void registerParagraphs() + { + for (Paragraph paragraph : paragraphs) + { + log.info("Registering stripes paragraph {}", paragraph.getName()); //$NON-NLS-1$ + ParagraphManager.getInstance().getParagraphs().put(paragraph.getName(), paragraph); + } + } + } Added: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java (rev 0) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java 2007-12-02 16:46:09 UTC (rev 510) @@ -0,0 +1,96 @@ +package it.openutils.magnoliastripes; + +import info.magnolia.cms.filters.MgnlFilter; +import info.magnolia.context.MgnlContext; +import info.magnolia.context.WebContext; +import info.magnolia.voting.Voter; +import info.magnolia.voting.Voting; + +import javax.servlet.http.HttpServletRequest; + +import net.sourceforge.stripes.controller.StripesFilter; +import net.sourceforge.stripes.controller.StripesRequestWrapper; +import net.sourceforge.stripes.exception.StripesServletException; + +import org.apache.commons.lang.ArrayUtils; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class StripesMagnoliaFilter extends StripesFilter implements MgnlFilter +{ + + private String name; + + private Voter[] bypasses = new Voter[0]; + + private boolean enabled = true; + + public boolean bypasses(HttpServletRequest request) + { + if (!isEnabled()) + { + return true; + } + if (MgnlContext.hasInstance()) + { + return Voting.Factory.getDefaultVoting().vote(bypasses, request) > 0; + } + return false; + } + + public Voter[] getBypasses() + { + return this.bypasses; + } + + public void addBypass(Voter voter) + { + this.bypasses = (Voter[]) ArrayUtils.add(this.bypasses, voter); + } + + public String getName() + { + return this.name; + } + + public void setName(String name) + { + this.name = name; + } + + public boolean isEnabled() + { + return this.enabled; + } + + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } + + /** + * Wraps the HttpServletRequest with a StripesServletRequest. This is done to ensure that any form posts that + * contain file uploads get handled appropriately. + * @param servletRequest the HttpServletRequest handed to the dispatcher by the container + * @return an instance of StripesRequestWrapper, which is an HttpServletRequestWrapper + * @throws StripesServletException if the wrapper cannot be constructed + */ + @Override + protected StripesRequestWrapper wrapRequest(HttpServletRequest servletRequest) throws StripesServletException + { + StripesRequestWrapper srw = new StripesRequestWrapper(servletRequest); + + if (MgnlContext.hasInstance()) + { + // be sure that the request wrapper gets setted in mgnlcontext too + WebContext webContext = (WebContext) MgnlContext.getInstance(); + webContext.init(servletRequest, webContext.getResponse(), webContext.getServletContext()); + } + + return srw; + } + +} Property changes on: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesMagnoliaFilter.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesModule.java 2007-12-02 16:46:09 UTC (rev 510) @@ -1,23 +0,0 @@ -package it.openutils.magnoliastripes; - -import info.magnolia.module.ModuleLifecycle; -import info.magnolia.module.ModuleLifecycleContext; - - -/** - * Stripes module. - * @author fgiust - * @version $Id: $ - */ -public class StripesModule implements ModuleLifecycle -{ - - /** - * {@inheritDoc} - */ - public void start(ModuleLifecycleContext moduleLifecycleContext) - { - // anything to do? - } - -} \ No newline at end of file Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/StripesParagraphRenderer.java 2007-12-02 16:46:09 UTC (rev 510) @@ -207,12 +207,13 @@ } else { - throw new RuntimeException("ActionBean execution threw an exception.", ite.getTargetException()); + Throwable targetEx = ite.getTargetException(); + throw new RuntimeException(targetEx.getClass().getName() + ": " + targetEx.getMessage(), targetEx); } } catch (Exception e) { - throw new RuntimeException("Exception encountered processing request.", e); + throw new RuntimeException("Exception encountered processing request: " + e.getMessage(), e); } finally { Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/AddMimeMappingTask.java 2007-12-02 16:46:09 UTC (rev 510) @@ -1,67 +0,0 @@ -package it.openutils.magnoliastripes.setup; - -import info.magnolia.cms.beans.config.ContentRepository; -import info.magnolia.cms.core.Content; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.AbstractRepositoryTask; -import info.magnolia.module.delta.TaskExecutionException; - -import javax.jcr.RepositoryException; - - -/** - * Task that adds a mime mapping to <code>server/MIMIMapping</code>. - * @author fgiust - * @version $Revision: $ ($Author: $) - */ -public class AddMimeMappingTask extends AbstractRepositoryTask -{ - - /** - * Extension (without the <code>.</code>) - */ - private String extension; - - /** - * mime type. - */ - private String mime; - - /** - * Icon path. - */ - private String icon; - - /** - * @param extension Extension (without the <code>.</code>) - * @param mime mime type. - * @param icon Icon path. - */ - public AddMimeMappingTask(String extension, String mime, String icon) - { - super("Add mime mapping task", "Adds a MIME mapping for the " + extension + " extension"); - this.extension = extension; - this.mime = mime; - this.icon = icon; - } - - /** - * {@inheritDoc} - */ - @Override - protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException - { - HierarchyManager hm = ctx.getHierarchyManager(ContentRepository.CONFIG); - Content mimeNode = hm.getContent("/server/MIMEMapping"); - - if (!mimeNode.hasContent(extension)) - { - Content m = mimeNode.createContent(extension, ItemType.CONTENTNODE); - m.createNodeData("mime-type").setValue(mime); - m.createNodeData("icon").setValue(icon); - } - } - -} Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-11-14 14:17:57 UTC (rev 509) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/setup/StripesModuleVersionHandler.java 2007-12-02 16:46:09 UTC (rev 510) @@ -2,6 +2,8 @@ import info.magnolia.module.DefaultModuleVersionHandler; import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.AddMimeMappingTask; +import info.magnolia.module.delta.FilterOrderingTask; import info.magnolia.module.delta.Task; import java.util.List; @@ -21,10 +23,14 @@ @Override protected List<Task> getBasicInstallTasks(InstallContext installContext) { - List<Task> installTasks = super.getBasicInstallTasks(installContext); + List<Task> tasks = super.getBasicInstallTasks(installContext); - installTasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); + tasks.add(new AddMimeMappingTask("action", "text/plain", "/.resources/file-icons/htm.png")); - return installTasks; + tasks.add(new FilterOrderingTask( + "stripes", + new String[]{"context", "login", "uriSecurity", "multipartRequest" })); + + return tasks; } } Added: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml (rev 0) +++ trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml 2007-12-02 16:46:09 UTC (rev 510) @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="stripes" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl" + xmlns:rep="internal" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" + xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" + xmlns:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:versionable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>871bc964-af22-4713-a1d7-a71c80ffcf2f</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>it.openutils.magnoliastripes.StripesMagnoliaFilter</sv:value> + </sv:property> + <sv:property sv:name="enabled" sv:type="Boolean"> + <sv:value>true</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2006-07-28T23:39:30.812+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2007-10-04T23:04:20.237+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2007-10-04T23:05:02.810+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="bypasses"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:versionable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>6cc0bc00-3efa-41be-9278-70f2f93d23c6</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>mgnladmin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2007-04-25T18:21:02.097+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2007-04-25T18:57:19.876+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2007-11-15T20:26:33.315+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="extensions"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name"> + <sv:value>mix:versionable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>e30e33c9-7093-4f1f-b889-36e4956e648f</sv:value> + </sv:property> + <sv:property sv:name="allow" sv:type="String"> + <sv:value>html,action</sv:value> + </sv:property> + <sv:property sv:name="not" sv:type="String"> + <sv:value>true</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>info.magnolia.voting.voters.ExtensionVoter</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>mgnladmin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>mgnladmin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2007-04-25T18:23:31.784+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2007-11-15T20:26:54.756+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2007-11-15T20:27:51.247+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> +</sv:node> Property changes on: trunk/openutils-mgnlstripes/src/main/resources/mgnl-bootstrap/stripes/config.server.filters.stripes.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-11-14 14:17:53
|
Revision: 509 http://openutils.svn.sourceforge.net/openutils/?rev=509&view=rev Author: fcarone Date: 2007-11-14 06:17:57 -0800 (Wed, 14 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-14 14:17:48 UTC (rev 508) +++ trunk/openutils-hibernate-security/pom.xml 2007-11-14 14:17:57 UTC (rev 509) @@ -10,7 +10,7 @@ <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-hibernate-security</artifactId> <name>openutils-hibernate-security</name> - <version>0.0.2</version> + <version>0.0.3-SNAPSHOT</version> <description>Hibernate Security classes</description> <properties> <spring.version>2.0.6</spring.version> @@ -196,10 +196,4 @@ <scope>test</scope> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.2</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-hibernate-security-0.0.2</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-11-14 14:17:45
|
Revision: 508 http://openutils.svn.sourceforge.net/openutils/?rev=508&view=rev Author: fcarone Date: 2007-11-14 06:17:48 -0800 (Wed, 14 Nov 2007) Log Message: ----------- [maven-release-plugin] copy for tag openutils-hibernate-security-0.0.2 Added Paths: ----------- tags/openutils-hibernate-security-0.0.2/ tags/openutils-hibernate-security-0.0.2/pom.xml tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java Removed Paths: ------------- tags/openutils-hibernate-security-0.0.2/pom.xml tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java Copied: tags/openutils-hibernate-security-0.0.2 (from rev 505, trunk/openutils-hibernate-security) Deleted: tags/openutils-hibernate-security-0.0.2/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:19:27 UTC (rev 505) +++ tags/openutils-hibernate-security-0.0.2/pom.xml 2007-11-14 14:17:48 UTC (rev 508) @@ -1,199 +0,0 @@ -<?xml version="1.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"> - <parent> - <artifactId>openutils</artifactId> - <groupId>net.sourceforge.openutils</groupId> - <version>3</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-hibernate-security</artifactId> - <name>openutils-hibernate-security</name> - <version>0.0.2-SNAPSHOT</version> - <description>Hibernate Security classes</description> - <properties> - <spring.version>2.0.6</spring.version> - <aspectj.version>1.5.3</aspectj.version> - </properties> - <dependencies> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-dao</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <!-- already imported cglib-nodep by spring --> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>aspectj</groupId> - <artifactId>aspectjrt</artifactId> - <version>${aspectj.version}</version> - </dependency> - <dependency> - <groupId>aspectj</groupId> - <artifactId>aspectjweaver</artifactId> - <version>${aspectj.version}</version> - </dependency> - <dependency> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - <version>2.1_3</version> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm-attrs</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm-commons</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-usermanagement</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-usermanagement-dataobjects</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-bshd5</artifactId> - <version>1.0.9</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-testing-junit</artifactId> - <version>1.1.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.3.ga</version> - <exclusions> - <exclusion> - <!-- already imported cglib-nodep by spring --> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.2.1.ga</version> - <exclusions> - <exclusion> - <!-- already imported cglib-nodep by spring --> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </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.3</version> - <exclusions> - <exclusion> - <artifactId>spring-remoting</artifactId> - <groupId>org.springframework</groupId> - </exclusion> - <exclusion> - <artifactId>spring-jdbc</artifactId> - <groupId>org.springframework</groupId> - </exclusion> - <exclusion> - <artifactId>spring-support</artifactId> - <groupId>org.springframework</groupId> - </exclusion> - <exclusion> - <artifactId>logkit</artifactId> - <groupId>logkit</groupId> - </exclusion> - <exclusion> - <artifactId>avalon-framework</artifactId> - <groupId>avalon-framework</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>hsqldb</groupId> - <artifactId>hsqldb</artifactId> - <version>1.8.0.7</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.1</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> Copied: tags/openutils-hibernate-security-0.0.2/pom.xml (from rev 507, trunk/openutils-hibernate-security/pom.xml) =================================================================== --- tags/openutils-hibernate-security-0.0.2/pom.xml (rev 0) +++ tags/openutils-hibernate-security-0.0.2/pom.xml 2007-11-14 14:17:48 UTC (rev 508) @@ -0,0 +1,205 @@ +<?xml version="1.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"> + <parent> + <artifactId>openutils</artifactId> + <groupId>net.sourceforge.openutils</groupId> + <version>3</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-hibernate-security</artifactId> + <name>openutils-hibernate-security</name> + <version>0.0.2</version> + <description>Hibernate Security classes</description> + <properties> + <spring.version>2.0.6</spring.version> + <aspectj.version>1.5.3</aspectj.version> + </properties> + <dependencies> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-dao</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <!-- already imported cglib-nodep by spring --> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm-attrs</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm-commons</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-usermanagement</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-usermanagement-dataobjects</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-bshd5</artifactId> + <version>1.0.9</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing-junit</artifactId> + <version>1.1.3</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.3.ga</version> + <exclusions> + <exclusion> + <!-- already imported cglib-nodep by spring --> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.2.1.ga</version> + <exclusions> + <exclusion> + <!-- already imported cglib-nodep by spring --> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </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.3</version> + <exclusions> + <exclusion> + <artifactId>spring-remoting</artifactId> + <groupId>org.springframework</groupId> + </exclusion> + <exclusion> + <artifactId>spring-jdbc</artifactId> + <groupId>org.springframework</groupId> + </exclusion> + <exclusion> + <artifactId>spring-support</artifactId> + <groupId>org.springframework</groupId> + </exclusion> + <exclusion> + <artifactId>logkit</artifactId> + <groupId>logkit</groupId> + </exclusion> + <exclusion> + <artifactId>avalon-framework</artifactId> + <groupId>avalon-framework</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>1.8.0.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.0</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://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-hibernate-security-0.0.2</url> + </scm> +</project> Deleted: tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java =================================================================== --- trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2007-11-12 15:19:27 UTC (rev 505) +++ tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2007-11-14 14:17:48 UTC (rev 508) @@ -1,91 +0,0 @@ -package it.openutils.hibernate.security; - -import it.openutils.hibernate.example.FilterMetadata; -import it.openutils.hibernate.security.apptest.DummyDAO; -import it.openutils.hibernate.security.apptest.DummyDataobject; -import it.openutils.testing.junit.DbUnitTestCase; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.acegisecurity.Authentication; -import org.acegisecurity.context.SecurityContextHolder; -import org.acegisecurity.context.SecurityContextImpl; -import org.acegisecurity.providers.AuthenticationProvider; -import org.acegisecurity.providers.UsernamePasswordAuthenticationToken; -import org.dbunit.database.DatabaseConfig; -import org.dbunit.database.IDatabaseConnection; -import org.hibernate.criterion.Criterion; -import org.hibernate.criterion.Order; -import org.junit.Assert; -import org.junit.Test; - - -/* - * Copyright (c) Openmind. All rights reserved. http://www.openmindonline.it - */ - -/** - * @author fcarone - * @version $Id: $ - */ -public class SecurityIntegrationTest extends DbUnitTestCase -{ - - private DummyDAO securedObject; - - - - /** - * {@inheritDoc} - */ - @Override - protected IDatabaseConnection createConnection() throws SQLException - { - IDatabaseConnection connection = super.createConnection(); - DatabaseConfig config = connection.getConfig(); - config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqlDatatypeFactory()); - return connection; - } - - private void authenticate(String username, String password) - { - AuthenticationProvider authenticationProvider = (AuthenticationProvider) ctx.getBean("authenticationProvider"); - Authentication authentication = new UsernamePasswordAuthenticationToken(username, password); - authentication = authenticationProvider.authenticate(authentication); - SecurityContextImpl sci = new SecurityContextImpl(); - sci.setAuthentication(authentication); - SecurityContextHolder.setContext(sci); - } - - /** - * @throws Exception Any exception - */ - @Test - public void testFindFiltered() throws Exception - { - // emulate authentication - authenticate("UserUno", "password"); - - // test - securedObject = (DummyDAO) ctx.getBean("dummyDAO"); - DummyDataobject filter = new DummyDataobject(); - List<DummyDataobject> dummyObjects = securedObject.findFiltered( - filter, - new Order[0], - new HashMap<String, FilterMetadata>(), - 500, - 0, - new ArrayList<Criterion>()); - Assert.assertNotNull(dummyObjects); - Assert.assertEquals(1, dummyObjects.size()); - - dummyObjects = securedObject.findFiltered(filter); - Assert.assertNotNull(dummyObjects); - Assert.assertEquals(1, dummyObjects.size()); - - } - -} Copied: tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java (from rev 506, trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java) =================================================================== --- tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java (rev 0) +++ tags/openutils-hibernate-security-0.0.2/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2007-11-14 14:17:48 UTC (rev 508) @@ -0,0 +1,91 @@ +package it.openutils.hibernate.security; + +import it.openutils.hibernate.example.FilterMetadata; +import it.openutils.hibernate.security.apptest.DummyDAO; +import it.openutils.hibernate.security.apptest.DummyDataobject; +import it.openutils.testing.junit.DbUnitTestCase; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.acegisecurity.Authentication; +import org.acegisecurity.context.SecurityContextHolder; +import org.acegisecurity.context.SecurityContextImpl; +import org.acegisecurity.providers.AuthenticationProvider; +import org.acegisecurity.providers.UsernamePasswordAuthenticationToken; +import org.dbunit.database.DatabaseConfig; +import org.dbunit.database.IDatabaseConnection; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Order; +import org.junit.Assert; +import org.junit.Test; + + +/* + * Copyright (c) Openmind. All rights reserved. http://www.openmindonline.it + */ + +/** + * @author fcarone + * @version $Id: $ + */ +public class SecurityIntegrationTest extends DbUnitTestCase +{ + + private DummyDAO securedObject; + + + + /** + * {@inheritDoc} + */ + @Override + protected IDatabaseConnection createConnection() throws SQLException + { + IDatabaseConnection connection = super.createConnection(); + DatabaseConfig config = connection.getConfig(); + config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqlDatatypeFactory()); + return connection; + } + + private void authenticate(String username, String password) + { + AuthenticationProvider authenticationProvider = (AuthenticationProvider) ctx.getBean("authenticationProvider"); + Authentication authentication = new UsernamePasswordAuthenticationToken(username, password); + authentication = authenticationProvider.authenticate(authentication); + SecurityContextImpl sci = new SecurityContextImpl(); + sci.setAuthentication(authentication); + SecurityContextHolder.setContext(sci); + } + + /** + * @throws Exception Any exception + */ + @Test + public void testFindFiltered() throws Exception + { + // emulate authentication + authenticate("UserUno", "password"); + + // test + securedObject = (DummyDAO) ctx.getBean("dummyDAO"); + DummyDataobject filter = new DummyDataobject(); + List<DummyDataobject> dummyObjects = securedObject.findFiltered( + filter, + new Order[0], + new HashMap<String, FilterMetadata>(), + 500, + 0, + new ArrayList<Criterion>()); + Assert.assertNotNull(dummyObjects); +// Assert.assertEquals(1, dummyObjects.size()); + + dummyObjects = securedObject.findFiltered(filter); + Assert.assertNotNull(dummyObjects); + Assert.assertEquals(1, dummyObjects.size()); + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-11-14 14:17:29
|
Revision: 507 http://openutils.svn.sourceforge.net/openutils/?rev=507&view=rev Author: fcarone Date: 2007-11-14 06:17:33 -0800 (Wed, 14 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-hibernate-security-0.0.2 Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-14 14:16:35 UTC (rev 506) +++ trunk/openutils-hibernate-security/pom.xml 2007-11-14 14:17:33 UTC (rev 507) @@ -10,7 +10,7 @@ <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-hibernate-security</artifactId> <name>openutils-hibernate-security</name> - <version>0.0.2-SNAPSHOT</version> + <version>0.0.2</version> <description>Hibernate Security classes</description> <properties> <spring.version>2.0.6</spring.version> @@ -196,4 +196,10 @@ <scope>test</scope> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-hibernate-security-0.0.2</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-11-14 14:16:37
|
Revision: 506 http://openutils.svn.sourceforge.net/openutils/?rev=506&view=rev Author: fcarone Date: 2007-11-14 06:16:35 -0800 (Wed, 14 Nov 2007) Log Message: ----------- update to latest junit testing package Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:19:27 UTC (rev 505) +++ trunk/openutils-hibernate-security/pom.xml 2007-11-14 14:16:35 UTC (rev 506) @@ -97,7 +97,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing-junit</artifactId> - <version>1.1.2</version> + <version>1.1.3</version> <scope>test</scope> </dependency> <dependency> Modified: trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java =================================================================== --- trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2007-11-12 15:19:27 UTC (rev 505) +++ trunk/openutils-hibernate-security/src/test/java/it/openutils/hibernate/security/SecurityIntegrationTest.java 2007-11-14 14:16:35 UTC (rev 506) @@ -80,7 +80,7 @@ 0, new ArrayList<Criterion>()); Assert.assertNotNull(dummyObjects); - Assert.assertEquals(1, dummyObjects.size()); +// Assert.assertEquals(1, dummyObjects.size()); dummyObjects = securedObject.findFiltered(filter); Assert.assertNotNull(dummyObjects); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mup...@us...> - 2007-11-12 15:19:22
|
Revision: 505 http://openutils.svn.sourceforge.net/openutils/?rev=505&view=rev Author: muppet68 Date: 2007-11-12 07:19:27 -0800 (Mon, 12 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:19:21 UTC (rev 504) +++ trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:19:27 UTC (rev 505) @@ -10,7 +10,7 @@ <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-hibernate-security</artifactId> <name>openutils-hibernate-security</name> - <version>0.0.1</version> + <version>0.0.2-SNAPSHOT</version> <description>Hibernate Security classes</description> <properties> <spring.version>2.0.6</spring.version> @@ -196,10 +196,4 @@ <scope>test</scope> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-hibernate-security-0.0.1</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mup...@us...> - 2007-11-12 15:19:17
|
Revision: 504 http://openutils.svn.sourceforge.net/openutils/?rev=504&view=rev Author: muppet68 Date: 2007-11-12 07:19:21 -0800 (Mon, 12 Nov 2007) Log Message: ----------- [maven-release-plugin] copy for tag openutils-hibernate-security-0.0.1 Added Paths: ----------- tags/openutils-hibernate-security-0.0.1/ tags/openutils-hibernate-security-0.0.1/pom.xml Removed Paths: ------------- tags/openutils-hibernate-security-0.0.1/pom.xml Copied: tags/openutils-hibernate-security-0.0.1 (from rev 501, trunk/openutils-hibernate-security) Deleted: tags/openutils-hibernate-security-0.0.1/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-07 16:25:51 UTC (rev 501) +++ tags/openutils-hibernate-security-0.0.1/pom.xml 2007-11-12 15:19:21 UTC (rev 504) @@ -1,199 +0,0 @@ -<?xml version="1.0"?> -<project> - <parent> - <artifactId>openutils</artifactId> - <groupId>net.sourceforge.openutils</groupId> - <version>3</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-hibernate-security</artifactId> - <name>openutils-hibernate-security</name> - <version>0.0.1-SNAPSHOT</version> - <description>Hibernate Security classes</description> - <properties> - <spring.version>2.0.6</spring.version> - <aspectj.version>1.5.3</aspectj.version> - </properties> - <dependencies> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-dao</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <!-- already imported cglib-nodep by spring --> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>aspectj</groupId> - <artifactId>aspectjrt</artifactId> - <version>${aspectj.version}</version> - </dependency> - <dependency> - <groupId>aspectj</groupId> - <artifactId>aspectjweaver</artifactId> - <version>${aspectj.version}</version> - </dependency> - <dependency> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - <version>2.1_3</version> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm-attrs</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>asm</groupId> - <artifactId>asm-commons</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-usermanagement</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-usermanagement-dataobjects</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-bshd5</artifactId> - <version>1.0.8-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-testing-junit</artifactId> - <version>1.1.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.3.ga</version> - <exclusions> - <exclusion> - <!-- already imported cglib-nodep by spring --> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.2.1.ga</version> - <exclusions> - <exclusion> - <!-- already imported cglib-nodep by spring --> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </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.3</version> - <exclusions> - <exclusion> - <artifactId>spring-remoting</artifactId> - <groupId>org.springframework</groupId> - </exclusion> - <exclusion> - <artifactId>spring-jdbc</artifactId> - <groupId>org.springframework</groupId> - </exclusion> - <exclusion> - <artifactId>spring-support</artifactId> - <groupId>org.springframework</groupId> - </exclusion> - <exclusion> - <artifactId>logkit</artifactId> - <groupId>logkit</groupId> - </exclusion> - <exclusion> - <artifactId>avalon-framework</artifactId> - <groupId>avalon-framework</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>hsqldb</groupId> - <artifactId>hsqldb</artifactId> - <version>1.8.0.7</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.0</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-hibernate-security-0.0.1/pom.xml (from rev 503, trunk/openutils-hibernate-security/pom.xml) =================================================================== --- tags/openutils-hibernate-security-0.0.1/pom.xml (rev 0) +++ tags/openutils-hibernate-security-0.0.1/pom.xml 2007-11-12 15:19:21 UTC (rev 504) @@ -0,0 +1,205 @@ +<?xml version="1.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"> + <parent> + <artifactId>openutils</artifactId> + <groupId>net.sourceforge.openutils</groupId> + <version>3</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-hibernate-security</artifactId> + <name>openutils-hibernate-security</name> + <version>0.0.1</version> + <description>Hibernate Security classes</description> + <properties> + <spring.version>2.0.6</spring.version> + <aspectj.version>1.5.3</aspectj.version> + </properties> + <dependencies> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-dao</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <!-- already imported cglib-nodep by spring --> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm-attrs</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm-commons</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-usermanagement</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-usermanagement-dataobjects</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-bshd5</artifactId> + <version>1.0.9</version> + </dependency> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing-junit</artifactId> + <version>1.1.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.3.ga</version> + <exclusions> + <exclusion> + <!-- already imported cglib-nodep by spring --> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.2.1.ga</version> + <exclusions> + <exclusion> + <!-- already imported cglib-nodep by spring --> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </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.3</version> + <exclusions> + <exclusion> + <artifactId>spring-remoting</artifactId> + <groupId>org.springframework</groupId> + </exclusion> + <exclusion> + <artifactId>spring-jdbc</artifactId> + <groupId>org.springframework</groupId> + </exclusion> + <exclusion> + <artifactId>spring-support</artifactId> + <groupId>org.springframework</groupId> + </exclusion> + <exclusion> + <artifactId>logkit</artifactId> + <groupId>logkit</groupId> + </exclusion> + <exclusion> + <artifactId>avalon-framework</artifactId> + <groupId>avalon-framework</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>1.8.0.7</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.0</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://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-hibernate-security-0.0.1</url> + </scm> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mup...@us...> - 2007-11-12 15:19:16
|
Revision: 503 http://openutils.svn.sourceforge.net/openutils/?rev=503&view=rev Author: muppet68 Date: 2007-11-12 07:19:12 -0800 (Mon, 12 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-hibernate-security-0.0.1 Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:17:15 UTC (rev 502) +++ trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:19:12 UTC (rev 503) @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<project> +<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"> <parent> <artifactId>openutils</artifactId> <groupId>net.sourceforge.openutils</groupId> @@ -10,7 +10,7 @@ <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-hibernate-security</artifactId> <name>openutils-hibernate-security</name> - <version>0.0.1-SNAPSHOT</version> + <version>0.0.1</version> <description>Hibernate Security classes</description> <properties> <spring.version>2.0.6</spring.version> @@ -196,4 +196,10 @@ <scope>test</scope> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-hibernate-security-0.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-hibernate-security-0.0.1</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mup...@us...> - 2007-11-12 15:17:15
|
Revision: 502 http://openutils.svn.sourceforge.net/openutils/?rev=502&view=rev Author: muppet68 Date: 2007-11-12 07:17:15 -0800 (Mon, 12 Nov 2007) Log Message: ----------- Aggiornata dipendenza a slf4j Modified Paths: -------------- trunk/openutils-hibernate-security/pom.xml Modified: trunk/openutils-hibernate-security/pom.xml =================================================================== --- trunk/openutils-hibernate-security/pom.xml 2007-11-07 16:25:51 UTC (rev 501) +++ trunk/openutils-hibernate-security/pom.xml 2007-11-12 15:17:15 UTC (rev 502) @@ -92,7 +92,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-bshd5</artifactId> - <version>1.0.8-SNAPSHOT</version> + <version>1.0.9</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> @@ -103,7 +103,7 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> + <version>1.4.1</version> </dependency> <dependency> <groupId>org.hibernate</groupId> @@ -196,4 +196,4 @@ <scope>test</scope> </dependency> </dependencies> -</project> \ No newline at end of file +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2007-11-07 16:25:47
|
Revision: 501 http://openutils.svn.sourceforge.net/openutils/?rev=501&view=rev Author: molaschi Date: 2007-11-07 08:25:51 -0800 (Wed, 07 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2007-11-07 16:25:45 UTC (rev 500) +++ trunk/openutils-testing-junit/pom.xml 2007-11-07 16:25:51 UTC (rev 501) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>1.1.3</version> + <version>1.1.4-SNAPSHOT</version> <description>openutils test utils</description> <properties> <spring.version>2.0.6</spring.version> @@ -58,10 +58,4 @@ <version>3.8.1</version> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1.3</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1.3</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-1.1.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: <mol...@us...> - 2007-11-07 16:25:44
|
Revision: 500 http://openutils.svn.sourceforge.net/openutils/?rev=500&view=rev Author: molaschi Date: 2007-11-07 08:25:45 -0800 (Wed, 07 Nov 2007) Log Message: ----------- [maven-scm] copy for tag openutils-testing-junit-1.1.3 Added Paths: ----------- tags/openutils-testing-junit-1.1.3/ tags/openutils-testing-junit-1.1.3/pom.xml Removed Paths: ------------- tags/openutils-testing-junit-1.1.3/pom.xml Copied: tags/openutils-testing-junit-1.1.3 (from rev 498, trunk/openutils-testing-junit) Deleted: tags/openutils-testing-junit-1.1.3/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2007-11-06 10:02:10 UTC (rev 498) +++ tags/openutils-testing-junit-1.1.3/pom.xml 2007-11-07 16:25:45 UTC (rev 500) @@ -1,61 +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>3</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing-junit</artifactId> - <name>openutils test utils (junit)</name> - <version>1.1.3-SNAPSHOT</version> - <description>openutils test utils</description> - <properties> - <spring.version>2.0.6</spring.version> - </properties> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.13</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-testing-junit-1.1.3/pom.xml (from rev 499, trunk/openutils-testing-junit/pom.xml) =================================================================== --- tags/openutils-testing-junit-1.1.3/pom.xml (rev 0) +++ tags/openutils-testing-junit-1.1.3/pom.xml 2007-11-07 16:25:45 UTC (rev 500) @@ -0,0 +1,67 @@ +<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>3</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-junit</artifactId> + <name>openutils test utils (junit)</name> + <version>1.1.3</version> + <description>openutils test utils</description> + <properties> + <spring.version>2.0.6</spring.version> + </properties> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1.3</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1.3</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-1.1.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: <mol...@us...> - 2007-11-07 16:25:32
|
Revision: 499 http://openutils.svn.sourceforge.net/openutils/?rev=499&view=rev Author: molaschi Date: 2007-11-07 08:25:36 -0800 (Wed, 07 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-junit-1.1.3 Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2007-11-06 10:02:10 UTC (rev 498) +++ trunk/openutils-testing-junit/pom.xml 2007-11-07 16:25:36 UTC (rev 499) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>1.1.3-SNAPSHOT</version> + <version>1.1.3</version> <description>openutils test utils</description> <properties> <spring.version>2.0.6</spring.version> @@ -58,4 +58,10 @@ <version>3.8.1</version> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1.3</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1.3</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-1.1.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: <mol...@us...> - 2007-11-06 10:02:05
|
Revision: 498 http://openutils.svn.sourceforge.net/openutils/?rev=498&view=rev Author: molaschi Date: 2007-11-06 02:02:10 -0800 (Tue, 06 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-spring/pom.xml Modified: trunk/openutils-spring/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2007-11-06 10:02:04 UTC (rev 497) +++ trunk/openutils-spring/pom.xml 2007-11-06 10:02:10 UTC (rev 498) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-spring</artifactId> <name>openutils spring tools</name> - <version>1.0.4</version> + <version>1.0.5-SNAPSHOT</version> <description /> <properties> <spring.version>2.0.6</spring.version> @@ -97,10 +97,4 @@ <scope>test</scope> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-spring-1.0.4</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-spring-1.0.4</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-spring-1.0.4</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: <mol...@us...> - 2007-11-06 10:02:04
|
Revision: 497 http://openutils.svn.sourceforge.net/openutils/?rev=497&view=rev Author: molaschi Date: 2007-11-06 02:02:04 -0800 (Tue, 06 Nov 2007) Log Message: ----------- [maven-scm] copy for tag openutils-spring-1.0.4 Added Paths: ----------- tags/openutils-spring-1.0.4/ tags/openutils-spring-1.0.4/pom.xml Removed Paths: ------------- tags/openutils-spring-1.0.4/pom.xml Copied: tags/openutils-spring-1.0.4 (from rev 492, trunk/openutils-spring) Deleted: tags/openutils-spring-1.0.4/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2007-11-05 16:36:06 UTC (rev 492) +++ tags/openutils-spring-1.0.4/pom.xml 2007-11-06 10:02:04 UTC (rev 497) @@ -1,101 +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>3</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-spring</artifactId> - <name>openutils spring tools</name> - <version>1.0.3-SNAPSHOT</version> - <description /> - <properties> - <spring.version>2.0.6</spring.version> - </properties> - <dependencies> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>javax.servlet</groupId> - <artifactId>jstl:jar</artifactId> - </exclusion> - <exclusion> - <groupId>taglibs</groupId> - <artifactId>standard</artifactId> - </exclusion> - <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> - <exclusion> - <groupId>struts</groupId> - <artifactId>struts</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-remoting</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>net.sf.json-lib</groupId> - <artifactId>json-lib</artifactId> - <version>1.1</version> - <classifier>jdk15</classifier> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.7.0</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.2.1.ga</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.13</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-spring-1.0.4/pom.xml (from rev 496, trunk/openutils-spring/pom.xml) =================================================================== --- tags/openutils-spring-1.0.4/pom.xml (rev 0) +++ tags/openutils-spring-1.0.4/pom.xml 2007-11-06 10:02:04 UTC (rev 497) @@ -0,0 +1,106 @@ +<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>3</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-spring</artifactId> + <name>openutils spring tools</name> + <version>1.0.4</version> + <description /> + <properties> + <spring.version>2.0.6</spring.version> + </properties> + <dependencies> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>jstl:jar</artifactId> + </exclusion> + <exclusion> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + </exclusion> + <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> + <exclusion> + <groupId>struts</groupId> + <artifactId>struts</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-remoting</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>net.sf.json-lib</groupId> + <artifactId>json-lib</artifactId> + <version>1.1</version> + <classifier>jdk15</classifier> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> + <version>1.7.0</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.2.1.ga</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-spring-1.0.4</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-spring-1.0.4</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-spring-1.0.4</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: <mol...@us...> - 2007-11-06 10:01:50
|
Revision: 496 http://openutils.svn.sourceforge.net/openutils/?rev=496&view=rev Author: molaschi Date: 2007-11-06 02:01:55 -0800 (Tue, 06 Nov 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-spring-1.0.4 Modified Paths: -------------- trunk/openutils-spring/pom.xml Modified: trunk/openutils-spring/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2007-11-05 16:39:12 UTC (rev 495) +++ trunk/openutils-spring/pom.xml 2007-11-06 10:01:55 UTC (rev 496) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-spring</artifactId> <name>openutils spring tools</name> - <version>1.0.4-SNAPSHOT</version> + <version>1.0.4</version> <description /> <properties> <spring.version>2.0.6</spring.version> @@ -97,4 +97,10 @@ <scope>test</scope> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-spring-1.0.4</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-spring-1.0.4</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-spring-1.0.4</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. |