From: <tri...@us...> - 2008-07-24 18:42:41
|
Revision: 635 http://equanda.svn.sourceforge.net/equanda/?rev=635&view=rev Author: triathlon98 Date: 2008-07-24 18:42:38 +0000 (Thu, 24 Jul 2008) Log Message: ----------- EQ-103 various template readability improvements Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java Modified: trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm 2008-07-24 16:35:37 UTC (rev 634) +++ trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm 2008-07-24 18:42:38 UTC (rev 635) @@ -75,6 +75,10 @@ { Import${table.Name} obj = (Import${table.Name}) proxyObject; #if( !$field.isLink() ) + ## tests to assure modified is set + #if( $field.isBoolean() ) obj.set${field.Name}( true );#end + #if( $field.isInt() ) obj.set${field.Name}( 1 );#end + #if( $field.isDouble() ) obj.set${field.Name}( 1.0 );#end obj.set${field.Name}( ImportParser.parse${field.FieldTypeName}( fieldValue ) ); #else ## linked field Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java =================================================================== --- trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java 2008-07-24 16:35:37 UTC (rev 634) +++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java 2008-07-24 18:42:38 UTC (rev 635) @@ -557,21 +557,31 @@ ImportUtil.quote( firstName ) + ',' + ImportUtil.quote( lastName ) + ',' + ImportUtil.quote( job ) + ',' + "10.0" + ',' + "true" }; + assertNull( ImportUtil.importStrings( lines, URL, getImportCredentials() ) ); + CocoonManSelectorEJB cocoonManSelector = EquandaGlobal.getCocoonManSelector(); + List<CocoonManEJB> cocoonMans = cocoonManSelector.selectPersonByLastNameEJB( lastName ); + assertEquals( 1, cocoonMans.size() ); + CocoonManEJB cocoonMan = cocoonMans.get( 0 ); + assertNotNull( cocoonMan ); + assertEquals( firstName.toUpperCase(), cocoonMan.getFirstName() ); + assertEquals( cocoonMan.getHeight(), 10.0, 0.0 ); + assertTrue( cocoonMan.getEmployed() ); + assertFalse( cocoonMan.getPreviousJobs().isEmpty() ); + String updateLines[] = { ":table:CocoonMan/PersonByLastName:FirstName,LastName,PreviousJobs,Employed", "null" + ',' + ImportUtil.quote( lastName ) + ',' + "[]" + ',' + "false" }; - - assertNull( ImportUtil.importStrings( lines, URL, getImportCredentials() ) ); assertNull( ImportUtil.importStrings( updateLines, URL, getImportCredentials() ) ); // verify import - CocoonManSelectorEJB cocoonManSelector = EquandaGlobal.getCocoonManSelector(); - CocoonManEJB cocoonMan = cocoonManSelector.selectPersonByLastNameEJB( lastName ).iterator().next(); + cocoonMans = cocoonManSelector.selectPersonByLastNameEJB( lastName ); + assertEquals( 1, cocoonMans.size() ); + cocoonMan = cocoonMans.get( 0 ); assertNotNull( cocoonMan ); assertNull( " update should have set FirstName to null ", cocoonMan.getFirstName() ); - assertEquals( " update should not change the Height value ", cocoonMan.getHeight(), 10.0, 0.0 ); + assertEquals( " update should not change the Height value ", 10.0, cocoonMan.getHeight(), 0.0 ); assertFalse( " update should have set Employed to false ", cocoonMan.getEmployed() ); assertTrue( " update should have emptied PreviouesJobs ", cocoonMan.getPreviousJobs().isEmpty() ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-07-28 16:04:23
|
Revision: 639 http://equanda.svn.sourceforge.net/equanda/?rev=639&view=rev Author: triathlon98 Date: 2008-07-28 16:04:19 +0000 (Mon, 28 Jul 2008) Log Message: ----------- remove some dependencies Modified Paths: -------------- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml trunk/pom.xml Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml 2008-07-28 16:01:51 UTC (rev 638) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml 2008-07-28 16:04:19 UTC (rev 639) @@ -164,5 +164,17 @@ <version>2.3.9</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>ant</groupId> + <artifactId>ant</artifactId> + <version>1.7.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-all</artifactId> + <version>1.5.4</version> + <scope>provided</scope> + </dependency> </dependencies> </project> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-07-28 16:01:51 UTC (rev 638) +++ trunk/pom.xml 2008-07-28 16:04:19 UTC (rev 639) @@ -399,7 +399,7 @@ <dependency> <groupId>ant</groupId> <artifactId>ant</artifactId> - <version>1.6.5</version> + <version>1.7.0</version> </dependency> <dependency> <groupId>jalopy</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-05 16:39:52
|
Revision: 654 http://equanda.svn.sourceforge.net/equanda/?rev=654&view=rev Author: triathlon98 Date: 2008-08-05 16:39:43 +0000 (Tue, 05 Aug 2008) Log Message: ----------- EQ-199 assure errors during onActivate() are properly handled Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/resources/components/Layout.tml trunk/equanda-test/test-t5-gui/src/main/resources/org/equanda/test/gui/components/Layout.tml Modified: trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm 2008-08-05 13:30:17 UTC (rev 653) +++ trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm 2008-08-05 16:39:43 UTC (rev 654) @@ -35,6 +35,7 @@ import org.apache.log4j.Logger; import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.ValidationTracker; +import org.apache.tapestry5.services.Environment; import org.apache.tapestry5.annotations.Environmental; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.corelib.components.Form; @@ -44,8 +45,8 @@ import org.equanda.persistence.Uoid; import org.equanda.t5gui.*; import org.equanda.t5gui.services.EquandaSetterCache; +import org.equanda.tapestry5.data.MessageContainer; - /** * Base class for edit page */ @@ -64,6 +65,11 @@ @Environmental private ValidationTracker validationTracker; + private Exception keepException; + + @Inject + private Environment environment; + @Persist private SelectedSettings<T> selectedSettings; @@ -99,7 +105,7 @@ } catch ( EquandaPersistenceException epe ) { - error( epe ); + delayedError( epe ); } } @@ -122,7 +128,7 @@ } catch ( EquandaPersistenceException epe ) { - error( epe ); + delayedError( epe ); } } @@ -227,6 +233,20 @@ } /** + * Log error and display (later) on screen, returns null to allow "return delayedError()". + * Special version for use in onActivate. + * + * @param exc exception to log + * @return null + */ + public Object delayedError( Exception exc ) + { + log.warn( exc, exc ); + keepException = exc; + return null; + } + + /** * Log error and display on screen, returns null to allow "return error()" * * @param exc exception to log @@ -238,8 +258,7 @@ validationTracker.recordError( exc.getMessage() ); return null; } - - + /** * Used to find out how page is used: to edit an existing object or to create a new object * @@ -249,4 +268,17 @@ { return ( getObject() != null ); } + + void beginRender() + { + if ( null != keepException ) + { + environment.push( MessageContainer.class, new MessageContainer( keepException.getMessage() ) ); + } + } + + void endRender() + { + if ( null != keepException ) environment.pop( MessageContainer.class ); + } } Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/resources/components/Layout.tml =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/resources/components/Layout.tml 2008-08-05 13:30:17 UTC (rev 653) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/resources/components/Layout.tml 2008-08-05 16:39:43 UTC (rev 654) @@ -54,6 +54,7 @@ <div> <t:form><div t:id="formSupport"> <div id="layout-main"> + <t:equanda.ValidationTrackerDelegate/> <t:errors/> <t:body/> </div> Modified: trunk/equanda-test/test-t5-gui/src/main/resources/org/equanda/test/gui/components/Layout.tml =================================================================== --- trunk/equanda-test/test-t5-gui/src/main/resources/org/equanda/test/gui/components/Layout.tml 2008-08-05 13:30:17 UTC (rev 653) +++ trunk/equanda-test/test-t5-gui/src/main/resources/org/equanda/test/gui/components/Layout.tml 2008-08-05 16:39:43 UTC (rev 654) @@ -51,6 +51,7 @@ <div> <t:form> <div id="layout-main"> + <t:equanda.ValidationTrackerDelegate/> <t:errors/> <t:body/> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-05 20:45:01
|
Revision: 655 http://equanda.svn.sourceforge.net/equanda/?rev=655&view=rev Author: triathlon98 Date: 2008-08-05 20:44:56 +0000 (Tue, 05 Aug 2008) Log Message: ----------- fix some dependencies Modified Paths: -------------- trunk/equanda-generate/pom.xml trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml trunk/equanda-server/pom.xml trunk/pom.xml Modified: trunk/equanda-generate/pom.xml =================================================================== --- trunk/equanda-generate/pom.xml 2008-08-05 16:39:43 UTC (rev 654) +++ trunk/equanda-generate/pom.xml 2008-08-05 20:44:56 UTC (rev 655) @@ -31,7 +31,7 @@ <artifactId>equanda-util</artifactId> </dependency> <dependency> - <groupId>ant</groupId> + <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <scope>provided</scope> </dependency> Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml 2008-08-05 16:39:43 UTC (rev 654) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/pom.xml 2008-08-05 20:44:56 UTC (rev 655) @@ -165,7 +165,7 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>ant</groupId> + <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <version>1.7.0</version> <scope>provided</scope> Modified: trunk/equanda-server/pom.xml =================================================================== --- trunk/equanda-server/pom.xml 2008-08-05 16:39:43 UTC (rev 654) +++ trunk/equanda-server/pom.xml 2008-08-05 20:44:56 UTC (rev 655) @@ -31,7 +31,7 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>ant</groupId> + <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <scope>provided</scope> </dependency> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-05 16:39:43 UTC (rev 654) +++ trunk/pom.xml 2008-08-05 20:44:56 UTC (rev 655) @@ -394,10 +394,10 @@ <dependency> <groupId>jasperreports</groupId> <artifactId>jasperreports</artifactId> - <version>1.2.4</version> + <version>3.0.0</version> </dependency> <dependency> - <groupId>ant</groupId> + <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <version>1.7.0</version> </dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-06 11:50:31
|
Revision: 658 http://equanda.svn.sourceforge.net/equanda/?rev=658&view=rev Author: triathlon98 Date: 2008-08-06 11:50:28 +0000 (Wed, 06 Aug 2008) Log Message: ----------- EQ-208 assure "render" macro always uses Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/typechanger.js.vm trunk/pom.xml Modified: trunk/equanda-generate/src/main/velocity/t5gui/typechanger.js.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/typechanger.js.vm 2008-08-06 10:03:08 UTC (rev 657) +++ trunk/equanda-generate/src/main/velocity/t5gui/typechanger.js.vm 2008-08-06 11:50:28 UTC (rev 658) @@ -26,6 +26,8 @@ * Contributor(s): * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> *# +##parser below is included to assure the macro is available later (other files), should be fixed invelocity 1.6 +#parse( "t5gui/render.vm" ) #foreach( $table in $dm.RootTables ) function equandaSwitchType${table.Name}( el ) { Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-06 10:03:08 UTC (rev 657) +++ trunk/pom.xml 2008-08-06 11:50:28 UTC (rev 658) @@ -304,7 +304,7 @@ <dependency> <groupId>velocity</groupId> <artifactId>velocity-dep</artifactId> - <version>1.4</version> + <version>1.5</version> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-07 11:27:43
|
Revision: 660 http://equanda.svn.sourceforge.net/equanda/?rev=660&view=rev Author: triathlon98 Date: 2008-08-07 11:27:41 +0000 (Thu, 07 Aug 2008) Log Message: ----------- EQ-208 fix cfr incompatible velocity Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/render.vm trunk/pom.xml Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm 2008-08-07 06:33:34 UTC (rev 659) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm 2008-08-07 11:27:41 UTC (rev 660) @@ -1,5 +1,5 @@ #if( !$page.isHidden() ) -#if( $page.Name == "ALL" ) +#if( "ALL" == "$!page.Name" ) <t:parameter name="contentAll"> #render( "edit.field.${table.Name}.EquandaType" "edit.field.EquandaType" "" "" ) #else Modified: trunk/equanda-generate/src/main/velocity/t5gui/render.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/render.vm 2008-08-07 06:33:34 UTC (rev 659) +++ trunk/equanda-generate/src/main/velocity/t5gui/render.vm 2008-08-07 11:27:41 UTC (rev 660) @@ -1,18 +1,18 @@ #macro( render $key1 $key2 $key3 $key4 ) -#set( $file = "" ) -#set( $file = $keyvalue.getProperty("$key1") ) +##(( render.vm $!keyvalue.getProperty($key1) $!keyvalue.getProperty($key2) $!keyvalue.getProperty($key3) $!keyvalue.getProperty($key4) )) +#set( $file = "$!keyvalue.getProperty($key1)" ) #if( "x$file" != "x" ) #parse( "$file" ) #else -#set( $file = $keyvalue.getProperty("$key2") ) +#set( $file = "$!keyvalue.getProperty($key2)" ) #if( "x$file" != "x" ) #parse( "$file" ) #else -#set( $file = $keyvalue.getProperty("$key3") ) +#set( $file = "$!keyvalue.getProperty($key3)" ) #if( "x$file" != "x" ) #parse( "$file" ) #else -#set( $file = $keyvalue.getProperty("$key4") ) +#set( $file = "$!keyvalue.getProperty($key4)" ) #if( "x$file" != "x" ) #parse( "$file" ) #else Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-07 06:33:34 UTC (rev 659) +++ trunk/pom.xml 2008-08-07 11:27:41 UTC (rev 660) @@ -304,7 +304,7 @@ <dependency> <groupId>velocity</groupId> <artifactId>velocity-dep</artifactId> - <version>1.5</version> + <version>1.4</version> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-07 23:18:55
|
Revision: 662 http://equanda.svn.sourceforge.net/equanda/?rev=662&view=rev Author: triathlon98 Date: 2008-08-07 23:18:48 +0000 (Thu, 07 Aug 2008) Log Message: ----------- EQ-209 compare constraints for type on linked fields Modified Paths: -------------- trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-compare.java.vm trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm trunk/equanda-test/src/main/dm/Compare.table trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java =================================================================== --- trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java 2008-08-07 23:18:48 UTC (rev 662) @@ -62,6 +62,7 @@ int ECV_DOWNCAST_CREATE_ERROR = 91015; int ECV_INVALID_TABLE_TYPE = 91016; int ECV_OTHERSIDE_EMBEDDED_FIELD_IMMUTABLE_ONCE_SET = 91017; + int ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED = 91018; int CME_DATA_HAS_BEEN_ALREADY_CHANGED = 92001; Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java 2008-08-07 23:18:48 UTC (rev 662) @@ -47,6 +47,8 @@ @XStreamOmitField private boolean tableLevel; + @XStreamOmitField + private String typeValue; public String getTest() { @@ -92,4 +94,14 @@ { return right; } + + public String getTypeValue() + { + return typeValue; + } + + public void setTypeValue( String typeValue ) + { + this.typeValue = typeValue; + } } Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java 2008-08-07 23:18:48 UTC (rev 662) @@ -217,7 +217,10 @@ { if ( field.isAuto() ) err( parser, "is auto so it can not have compare constraints" ); if ( field.isCalculated() ) err( parser, "is calculated so it can not have compare constraints" ); - if ( field.isMultiple() ) err( parser, "is multiple so it can not have compare constraints" ); + if ( field.isMultiple() && !field.isLink() ) + { + err( parser, "is multiple and not link, so it can not have compare constraints" ); + } } for ( Compare compare : getCompares() ) { @@ -281,9 +284,13 @@ // value needs to be one of the table types boolean valueValid = false; RootTable linkRoot = field.getLinkTable(); - for ( RootTable.TableType options : linkRoot.getTypes() ) + for ( RootTable.TableType option : linkRoot.getTypes() ) { - if ( options.getName().equals( value ) ) valueValid = true; + if ( option.getName().equals( value ) ) + { + valueValid = true; + compare.setTypeValue( option.getType() ); + } } if ( !valueValid ) { @@ -347,7 +354,7 @@ private void validateTest( Parser parser, String test ) { - if ( !"=".equals( test ) && !"!=".equals( test ) && + if ( !"==".equals( test ) && !"!=".equals( test ) && !"<".equals( test ) && !">".equals( test ) && !"<=".equals( test ) && !">=".equals( test ) ) { Modified: trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-compare.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-compare.java.vm 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-compare.java.vm 2008-08-07 23:18:48 UTC (rev 662) @@ -42,21 +42,17 @@ #end } } - #end - - #if( $field.isBoolean() ) + #elseif( $field.isBoolean() ) #if( $ii.fieldLevel ) if (!($field.varName$ii.Test$ii.Value)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", new Boolean($ii.Value).toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); #else boolean tmp=$ii.Value; if (!($field.varName${ii.Test}tmp)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", new Boolean($ii.Value).toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); #end } - #end - - #if( $field.isDate() ) + #elseif( $field.isDate() ) java.sql.Date tmp=$ii.Value; #if( $ii.fieldLevel ) if ( $field.varName!=null ) { @@ -64,12 +60,10 @@ if ( ($field.varName!=null ) && (tmp!=null) ) { #end if ( !( ${field.varName}.compareTo(tmp)${ii.Test}0 ) ) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", ${ii.Value}.toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); } } - #end - - #if($field.isTimestamp() ) + #elseif( $field.isTimestamp() ) java.sql.Timestamp tmp = $ii.Value; #if( $ii.fieldLevel ) if ($field.varName!=null) { @@ -77,32 +71,34 @@ if (($field.varName!=null) && (tmp!=null)) { #end if (!(${field.varName}.compareTo(tmp)${ii.Test}0)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", ${ii.Value}.toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "${ii.Value}" ); } } - #end - - #if( $field.isInt() ) + #elseif( $field.isInt() ) #if ($ii.fieldLevel) if (!($field.varName$ii.Test$ii.Value)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", new Integer($ii.Value).toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); #else int tmp=$ii.Value; if (!($field.varName${ii.Test}tmp)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", new Integer($ii.Value).toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); #end } - #end - #if( $field.isDouble() ) + #elseif( $field.isDouble() ) #if ($ii.fieldLevel) if (!($field.varName$ii.Test$ii.Value)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", new Double($ii.Value).toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); #else double tmp=$ii.Value; if (!($field.varName${ii.Test}tmp)) { - throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", new Double($ii.Value).toString()); + throw new EquandaConstraintViolation(ECV_COMPARE_CONSTRAINT_NOT_SATISFIED, "$ii.Test", "field.${table.Name}.${field.Name}", "$ii.Value" ); #end } + #elseif( $field.isLink() ) + if ( !"$ii.TypeValue".equals( valueBean.getEquandaType() ) ) + { + throw new EquandaConstraintViolation( ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED, "field.${table.Name}.${field.Name}", "$ii.Value" ); + } #end } #end Modified: trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm 2008-08-07 23:18:48 UTC (rev 662) @@ -94,7 +94,6 @@ // make the add the field on the right side #if( $field.isBidirectional() && !$field.isOwner() ) - //DM${field.LinkTable.Name}Bean obj = DM${field.LinkTable.Name}Selector.selectId( em, value ); ${field.LinkTable.Name}EJBLocal ejb = EquandaGlobal.get${field.LinkTable.Name}Local(); ejb.init( value ); #if ( ${field.LinkField.isMultiple()} ) @@ -107,7 +106,9 @@ #end ejb.remove(); #else - entity.get${field.Name}().add( DM${field.LinkTable.Name}Selector.selectId( em, value ) ); + DM${field.LinkTable.Name}Bean valueBean = DM${field.LinkTable.Name}Selector.selectId( em, value ); + #parse("MediatorBase-compare.java.vm") + entity.get${field.Name}().add( valueBean ); #end entity.modified(); } @@ -265,7 +266,10 @@ } #end #else - entity.set${field.Name}( value == null ? null : DM${field.FieldTypeName}Selector.selectId( em, value ) ); + DM${field.LinkTable.Name}Bean valueBean = null; + if ( null != value) valueBean = DM${field.LinkTable.Name}Selector.selectId( em, value ); + #parse("MediatorBase-compare.java.vm") + entity.set${field.Name}( valueBean ); #end #if( $field.isEmbedded() ) Modified: trunk/equanda-test/src/main/dm/Compare.table =================================================================== --- trunk/equanda-test/src/main/dm/Compare.table 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-test/src/main/dm/Compare.table 2008-08-07 23:18:48 UTC (rev 662) @@ -74,6 +74,19 @@ </constraints> </field> + <field name="WheeledVehicle" type="Vehicle"> + <constraints> + <compare test="type" value="VehicleWithWheels"/> + </constraints> + </field> + + <field name="WheeledVehicles" type="Vehicle"> + <multiple/> + <constraints> + <compare test="type" value="VehicleWithWheels"/> + </constraints> + </field> + </page> <constraints> <compare left="Bool2" test="=" right="Bool1"/> Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java =================================================================== --- trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java 2008-08-07 14:33:18 UTC (rev 661) +++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java 2008-08-07 23:18:48 UTC (rev 662) @@ -26,12 +26,18 @@ import org.equanda.persistence.EquandaConstraintViolation; import org.equanda.persistence.EquandaPersistenceException; +import org.equanda.persistence.ExceptionCodes; +import org.equanda.test.dm.client.Compare; import org.equanda.test.dm.client.CompareEJB; import org.equanda.test.dm.client.EquandaGlobal; +import org.equanda.test.dm.client.Vehicle; +import org.equanda.test.dm.client.constants.VehicleConstants; import java.sql.Date; +import java.util.ArrayList; import java.util.Calendar; import java.util.GregorianCalendar; +import java.util.List; /** * test case for compare @@ -76,7 +82,8 @@ public void testCompareFailureBooleanField() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setBool1( true ); @@ -90,7 +97,8 @@ public void testCompareFailureBooleanGlobal() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); obj.setBool1( false ); try { @@ -105,7 +113,8 @@ public void testCompareFailureDoubleField() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setDouble1( 1.1 ); @@ -119,7 +128,8 @@ public void testCompareFailureDoubleGlobal() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); obj.setDouble1( 1.2 ); try { @@ -134,7 +144,8 @@ public void testCompareFailureStringField() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setStr1( "aaa" ); @@ -148,7 +159,8 @@ public void testCompareFailureStringGlobal() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); obj.setStr1( "bbb" ); try { @@ -163,7 +175,8 @@ public void testCompareFailureDateField() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); java.util.GregorianCalendar cal = new java.util.GregorianCalendar(); cal.set( Calendar.YEAR, 2000 ); try @@ -179,7 +192,8 @@ public void testCompareFailureDateGlobal() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); GregorianCalendar cal = new GregorianCalendar(); cal.clear(); cal.set( 2005, 1, 1 ); @@ -198,7 +212,8 @@ public void testCompareFailureTimestampField() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); java.util.GregorianCalendar cal = new java.util.GregorianCalendar(); cal.set( Calendar.YEAR, 2020 ); try @@ -214,7 +229,8 @@ public void testCompareFailureTimestampGlobal() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); java.util.GregorianCalendar cal = new java.util.GregorianCalendar(); cal.set( Calendar.YEAR, 2005 ); obj.setTime1( new java.sql.Timestamp( cal.getTime().getTime() ) ); @@ -231,7 +247,8 @@ public void testCompareFailureDateBuiltIn() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setDateFuture( new java.sql.Date( System.currentTimeMillis() ) ); @@ -245,7 +262,8 @@ public void testCompareFailureTimestampBuiltIn() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setTimePast( new java.sql.Timestamp( System.currentTimeMillis() + 1000 ) ); @@ -259,7 +277,8 @@ public void testCompareSuccessDateBuiltIn() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setDateFuture( new java.sql.Date( System.currentTimeMillis() + 3600 * 25 * 1000 ) ); @@ -273,7 +292,8 @@ public void testCompareSuccessTimestampBuiltIn() throws Exception { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 1, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 1, 1 ); try { obj.setTimePast( new java.sql.Timestamp( System.currentTimeMillis() - 1000 ) ); @@ -289,11 +309,90 @@ { try { - CompareEJB obj = EquandaGlobal.getCompare(); obj.init( 100, 1 ); + CompareEJB obj = EquandaGlobal.getCompare(); + obj.init( 100, 1 ); obj.remove(); fail( "compare ignored" ); } catch ( EquandaPersistenceException ucv ) - {} + {/*ignore*/} } + + public void testCompareLinkTypeSingleAllowed() + throws Exception + { + Vehicle vehicle = Vehicle.equandaCreate( VehicleConstants.TYPE_VehicleWithWheels ); + vehicle.setName( "CompareLinkTypeSingleAllowed" ); + Compare obj = Compare.equandaCreate(); + obj.setTestImmutableDouble( 1.0 ); + obj.setDouble1( 1.2 ); + obj.setWheeledVehicle( vehicle ); + obj.equandaUpdate(); + } + + public void testCompareLinkTypeSingleDisallowed() + throws Exception + { + Vehicle vehicle = Vehicle.equandaCreate( VehicleConstants.TYPE_Vehicle ); + vehicle.setName( "CompareLinkTypeSingleDisallowed" ); + Compare obj = Compare.equandaCreate(); + obj.setTestImmutableDouble( 1.0 ); + obj.setDouble1( 1.2 ); + obj.setWheeledVehicle( vehicle ); + try + { + obj.equandaUpdate(); + } + catch ( EquandaPersistenceException epe ) + { + assertEquals( ExceptionCodes.ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED, epe.getExceptionCode() ); + return; + } + fail( "type compare constraint not adhered for single linked fields" ); + } + + public void testCompareLinkTypeMultipleAllowed() + throws Exception + { + Vehicle vehicle; + List<Vehicle> vehicles = new ArrayList<Vehicle>(); + vehicle = Vehicle.equandaCreate( VehicleConstants.TYPE_VehicleWithWheels ); + vehicle.setName( "CompareLinkTypeMultipleAllowed1" ); + vehicles.add( vehicle ); + vehicle = Vehicle.equandaCreate( VehicleConstants.TYPE_VehicleWithWheels ); + vehicle.setName( "CompareLinkTypeMultipleAllowed2" ); + vehicles.add( vehicle ); + Compare obj = Compare.equandaCreate(); + obj.setTestImmutableDouble( 1.0 ); + obj.setDouble1( 1.2 ); + obj.setWheeledVehicles( vehicles ); + obj.equandaUpdate(); + } + + public void testCompareLinkTypeMultipleDisallowed() + throws Exception + { + Vehicle vehicle; + List<Vehicle> vehicles = new ArrayList<Vehicle>(); + vehicle = Vehicle.equandaCreate( VehicleConstants.TYPE_VehicleWithWheels ); + vehicle.setName( "CompareLinkTypeMultipleDisallowed1" ); + vehicles.add( vehicle ); + vehicle = Vehicle.equandaCreate( VehicleConstants.TYPE_Vehicle ); + vehicle.setName( "CompareLinkTypeMultipleDisallowed2" ); + vehicles.add( vehicle ); + Compare obj = Compare.equandaCreate(); + obj.setTestImmutableDouble( 1.0 ); + obj.setDouble1( 1.2 ); + obj.setWheeledVehicles( vehicles ); + try + { + obj.equandaUpdate(); + } + catch ( EquandaPersistenceException epe ) + { + assertEquals( ExceptionCodes.ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED, epe.getExceptionCode() ); + return; + } + fail( "type compare constraint not adhered for multiple linked fields" ); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-11 22:46:40
|
Revision: 663 http://equanda.svn.sourceforge.net/equanda/?rev=663&view=rev Author: triathlon98 Date: 2008-08-11 22:46:35 +0000 (Mon, 11 Aug 2008) Log Message: ----------- EQ-210 make sure filters always use the SelectorsState which were valid at time of query creation Modified Paths: -------------- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsFiltersTest.java Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java =================================================================== --- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java 2008-08-07 23:18:48 UTC (rev 662) +++ trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java 2008-08-11 22:46:35 UTC (rev 663) @@ -68,17 +68,26 @@ protected EJB getOneObject( int index ) throws NamingException, EquandaPersistenceException { - SEL sel = getSelector(); - int saveFirstResult = query.getFirstResult(); - int saveMaxResult = query.getMaxResults(); - query.setFirstResult( index ); - query.setMaxResults( 1 ); - List<EJB> res = sel.equandaRunQueryEJB( query ); - query.setFirstResult( saveFirstResult ); - query.setMaxResults( saveMaxResult ); - sel.remove(); - if ( res.size() == 0 ) return null; - return res.get( 0 ); + SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState(); + try + { + SelectorsState.setSelectorsState( selectorsState ); + SEL sel = getSelector(); + int saveFirstResult = query.getFirstResult(); + int saveMaxResult = query.getMaxResults(); + query.setFirstResult( index ); + query.setMaxResults( 1 ); + List<EJB> res = sel.equandaRunQueryEJB( query ); + query.setFirstResult( saveFirstResult ); + query.setMaxResults( saveMaxResult ); + sel.remove(); + if ( res.size() == 0 ) return null; + return res.get( 0 ); + } + finally + { + SelectorsState.setSelectorsState( keepSelectorsState ); + } } protected EJB refreshObject( EJB obj ) @@ -100,17 +109,26 @@ protected EJB[] getMultipleObjects( int first, int size ) throws NamingException, EquandaPersistenceException { - SEL sel = getSelector(); - int saveFirstResult = query.getFirstResult(); - int saveMaxResult = query.getMaxResults(); - query.setFirstResult( first ); - query.setMaxResults( size ); - List<EJB> col = sel.equandaRunQueryEJB( query ); - EJB[] res = (EJB[]) new EquandaEJB[col.size()]; - for ( int i = 0; i < col.size() ; i++ ) res[ i ] = col.get( i ); - query.setFirstResult( saveFirstResult ); - query.setMaxResults( saveMaxResult ); - sel.remove(); - return res; + SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState(); + try + { + SelectorsState.setSelectorsState( selectorsState ); + SEL sel = getSelector(); + int saveFirstResult = query.getFirstResult(); + int saveMaxResult = query.getMaxResults(); + query.setFirstResult( first ); + query.setMaxResults( size ); + List<EJB> col = sel.equandaRunQueryEJB( query ); + EJB[] res = (EJB[]) new EquandaEJB[col.size()]; + for ( int i = 0; i < col.size() ; i++ ) res[ i ] = col.get( i ); + query.setFirstResult( saveFirstResult ); + query.setMaxResults( saveMaxResult ); + sel.remove(); + return res; + } + finally + { + SelectorsState.setSelectorsState( keepSelectorsState ); + } } } Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java =================================================================== --- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java 2008-08-07 23:18:48 UTC (rev 662) +++ trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java 2008-08-11 22:46:35 UTC (rev 663) @@ -24,9 +24,9 @@ package org.equanda.persistence; +import org.apache.log4j.Logger; import org.equanda.persistence.query.EquandaQuery; import org.equanda.util.MockObject; -import org.apache.log4j.Logger; import javax.naming.NamingException; import java.io.Serializable; @@ -153,6 +153,8 @@ private List<ID> data; // possible list with data for complex queries + protected SelectorsStateType selectorsState; + public LazyList( EquandaQuery query ) { if ( query == null ) throw new IllegalArgumentException(); @@ -161,6 +163,7 @@ this.hasSubselects = false; originalFirst = query.getFirstResult(); originalMax = query.getMaxResults(); + selectorsState = SelectorsState.getSelectorsState(); } public LazyList( List<EquandaQuery> queries, boolean addOperator, int equandaLimit ) @@ -171,6 +174,7 @@ this.hasSubselects = true; originalFirst = -1; originalMax = equandaLimit; + selectorsState = SelectorsState.getSelectorsState(); } public void setMockObject( MockObject m ) { mock = m; } @@ -391,8 +395,10 @@ { if ( size != -1 ) return size; EquandaSelector sel = null; + SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState(); try { + SelectorsState.setSelectorsState( selectorsState ); sel = getSelector(); if ( !hasSubselects ) { @@ -430,6 +436,7 @@ finally { if ( sel != null ) sel.remove(); + SelectorsState.setSelectorsState( keepSelectorsState ); } } Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java =================================================================== --- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java 2008-08-07 23:18:48 UTC (rev 662) +++ trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java 2008-08-11 22:46:35 UTC (rev 663) @@ -68,17 +68,26 @@ protected PROXY getOneObject( int index ) throws NamingException, EquandaPersistenceException { - SEL sel = getSelector(); - int saveFirstResult = query.getFirstResult(); - int saveMaxResult = query.getMaxResults(); - query.setFirstResult( index ); - query.setMaxResults( 1 ); - List<PROXY> res = sel.equandaRunQuery( query ); - query.setFirstResult( saveFirstResult ); - query.setMaxResults( saveMaxResult ); - sel.remove(); - if ( res.size() == 0 ) return null; - return res.get( 0 ); + SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState(); + try + { + SelectorsState.setSelectorsState( selectorsState ); + SEL sel = getSelector(); + int saveFirstResult = query.getFirstResult(); + int saveMaxResult = query.getMaxResults(); + query.setFirstResult( index ); + query.setMaxResults( 1 ); + List<PROXY> res = sel.equandaRunQuery( query ); + query.setFirstResult( saveFirstResult ); + query.setMaxResults( saveMaxResult ); + sel.remove(); + if ( res.size() == 0 ) return null; + return res.get( 0 ); + } + finally + { + SelectorsState.setSelectorsState( keepSelectorsState ); + } } protected PROXY refreshObject( PROXY obj ) @@ -100,18 +109,26 @@ protected PROXY[] getMultipleObjects( int first, int size ) throws NamingException, EquandaPersistenceException { - SEL sel = getSelector(); - int saveFirstResult = query.getFirstResult(); - int saveMaxResult = query.getMaxResults(); - query.setFirstResult( first ); - query.setMaxResults( size ); - List<PROXY> col = sel.equandaRunQuery( query ); - PROXY[] res = (PROXY[]) new EquandaProxy[col.size()]; - for ( int i = 0; i < col.size() ; i++ ) res[ i ] = col.get( i ); - query.setFirstResult( saveFirstResult ); - query.setMaxResults( saveMaxResult ); - sel.remove(); - return res; + SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState(); + try + { + SelectorsState.setSelectorsState( selectorsState ); + SEL sel = getSelector(); + int saveFirstResult = query.getFirstResult(); + int saveMaxResult = query.getMaxResults(); + query.setFirstResult( first ); + query.setMaxResults( size ); + List<PROXY> col = sel.equandaRunQuery( query ); + PROXY[] res = (PROXY[]) new EquandaProxy[col.size()]; + for ( int i = 0; i < col.size() ; i++ ) res[ i ] = col.get( i ); + query.setFirstResult( saveFirstResult ); + query.setMaxResults( saveMaxResult ); + sel.remove(); + return res; + } + finally + { + SelectorsState.setSelectorsState( keepSelectorsState ); + } } - } Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsFiltersTest.java =================================================================== --- trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsFiltersTest.java 2008-08-07 23:18:48 UTC (rev 662) +++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsFiltersTest.java 2008-08-11 22:46:35 UTC (rev 663) @@ -27,8 +27,9 @@ import org.equanda.test.dm.client.EquandaGlobal; import org.equanda.test.dm.client.FootballPlayer; import org.equanda.test.dm.client.FootballPlayerSelectorEJB; + +import java.util.ArrayList; import java.util.List; -import java.util.ArrayList; /** * Tests for the selectors filters (setting/unsetting the variable should affect the order of the results) @@ -133,6 +134,58 @@ playerS.removeEntityBean(); } + public void testParameterFilterKeepState() + throws Exception + { + FootballPlayer playerG = new FootballPlayer(); + playerG.setGoalkeeper( true ); + playerG.setName( "G" ); + playerG.setTeam( "Anderlecht" ); + playerG.equandaUpdate(); + + FootballPlayer playerD = new FootballPlayer(); + playerD.setDefender( true ); + playerD.setName( "D" ); + playerD.setTeam( "Anderlecht" ); + playerD.equandaUpdate(); + + FootballPlayer playerM = new FootballPlayer(); + playerM.setMidfielder( true ); + playerM.setName( "M" ); + playerM.setTeam( "Standard" ); + playerM.equandaUpdate(); + + FootballPlayer playerS = new FootballPlayer(); + playerS.setMidfielder( true ); + playerS.setName( "S" ); + playerS.setTeam( "Standard" ); + playerS.equandaUpdate(); + + FootballPlayerSelectorEJB sel = EquandaGlobal.getFootballPlayerSelector(); + List<FootballPlayer> results = sel.selectAll(); + assertEquals( 4, results.size() ); + + SelectorsState.setFilter( "Team", "Standard" ); + results = sel.selectAll(); + SelectorsState.setFilter( "Team", null ); + assertEquals( 2, results.size() ); + assertEquals( "M", results.get( 0 ).getName() ); + assertEquals( "S", results.get( 1 ).getName() ); + + Thread.sleep( 1500 ); // assure data is requeried + SelectorsState.setFilter( "Team", null ); + assertEquals( 2, results.size() ); + assertEquals( "M", results.get( 0 ).getName() ); + assertEquals( "S", results.get( 1 ).getName() ); + + sel.remove(); + + playerG.removeEntityBean(); + playerD.removeEntityBean(); + playerM.removeEntityBean(); + playerS.removeEntityBean(); + } + public void testFromFilter() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-11 22:49:39
|
Revision: 664 http://equanda.svn.sourceforge.net/equanda/?rev=664&view=rev Author: triathlon98 Date: 2008-08-11 22:49:30 +0000 (Mon, 11 Aug 2008) Log Message: ----------- EQ-209 assure limitations are also respected in the generated user interface Modified Paths: -------------- trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettingsForSelect.java Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java =================================================================== --- trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2008-08-11 22:49:30 UTC (rev 664) @@ -24,13 +24,14 @@ package org.equanda.persistence; +import javolution.lang.TextBuilder; import org.apache.log4j.Logger; import org.equanda.persistence.query.EquandaQuery; + +import javax.persistence.EntityManager; +import javax.persistence.Query; import java.util.Collection; import java.util.Map; -import javax.persistence.EntityManager; -import javax.persistence.Query; -import javolution.lang.TextBuilder; /** * Support methods for DMObjectSelector classes @@ -99,7 +100,7 @@ return obj; } - private static String addFilter( String orgQuery, String fromPart, String wherePart ) + public static String addFilter( String orgQuery, String fromPart, String wherePart ) { StringBuffer query = new StringBuffer( orgQuery ); @@ -155,7 +156,7 @@ return query.toString(); } - protected static String addTypeFilter( String query, ObjectType type ) + public static String addTypeFilter( String query, ObjectType type ) { if ( type == null ) return query; StringBuffer filter = new StringBuffer(); Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Compare.java 2008-08-11 22:49:30 UTC (rev 664) @@ -36,6 +36,8 @@ @XStreamAlias( "compare" ) public class Compare { + public static final String TEST_TYPE = "type"; + @XStreamAsAttribute private String test; @XStreamAsAttribute Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Constraints.java 2008-08-11 22:49:30 UTC (rev 664) @@ -277,7 +277,7 @@ } else if ( field.isLink() ) { - if ( !"type".equals( test ) ) + if ( !Compare.TEST_TYPE.equals( test ) ) { err( parser, "compare on link field only allows \"type\" test" ); } Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java 2008-08-11 22:49:30 UTC (rev 664) @@ -1406,4 +1406,16 @@ if ( null == subjectory ) subjectory = new Subjectory(); return subjectory; } + + public boolean hasLinkTypeCompare() + { + if ( isLink() && hasCompare() ) + { + for ( Compare compare : getCompares() ) + { + if ( Compare.TEST_TYPE.equals( compare.getTest() ) ) return true; + } + } + return false; + } } \ No newline at end of file Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java 2008-08-11 22:49:30 UTC (rev 664) @@ -1137,7 +1137,7 @@ public boolean hasDataFilters() { - return getTable().getDataFilters().size() > 0; + return getTable().hasDataFilters(); } public long getLastModified() Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -230,33 +230,16 @@ // handle EquandaQuery public static List<DM${table.Name}Bean> equandaRunQuery( EntityManager em, EquandaQuery equandaQuery ) { -#if( $table.hasDataFilters() ) try { -#end - String sorting = SelectorsState.getSorting( "$table.Name" ); - Query query; - #if( !$table.hasDataFilters() ) - if ( sorting == null || sorting.length() == 0 ) - { - query = getEquandaQuery( em, equandaQuery ); - } - else - { - #end + String sorting = SelectorsState.getSorting( "$table.Name" ); + Query query; String queryString = equandaQuery.getQueryString(); queryString = setOrderBy( queryString, sorting ); - #if( $table.hasDataFilters() ) queryString = setFilters( equandaQuery, queryString ); - #end query = getEquandaQuery( em, equandaQuery, queryString ); - #if( !$table.hasDataFilters() ) - } - #end - return (List<DM${table.Name}Bean>) query.getResultList(); -#if( $table.hasDataFilters() ) + return (List<DM${table.Name}Bean>) query.getResultList(); } finally { equandaQuery.clearExtra(); } -#end } // count for uniqueness @@ -287,6 +270,7 @@ #foreach( $filter in $table.DataFilters ) queryString = setFilter( equandaQuery, queryString, "$filter.Name", "$filter.FilterQuery.From", "$filter.FilterQuery.Where" ); #end + queryString = org.equanda.persistence.ObjectSelector.addFilter( queryString, "", SelectorsState.getFilter( "equanda${table.Name}" ) ); return queryString; } @@ -299,26 +283,20 @@ */ public static List runCountQuery( EntityManager em, EquandaQuery equandaQuery ) { -#if( $table.hasDataFilters() ) - try { -#end - // make sure the query will return the latest version of the data (including in-transaction changes) - //em.flush(); + try { + // make sure the query will return the latest version of the data (including in-transaction changes) + //em.flush(); - Query query; - String queryString = getRunCountQueryString( equandaQuery ); -#if( $table.hasDataFilters() ) - queryString = setFilters( equandaQuery, queryString ); -#end - query = getEquandaQuery( em, equandaQuery, queryString, false ); + Query query; + String queryString = getRunCountQueryString( equandaQuery ); + queryString = setFilters( equandaQuery, queryString ); + query = getEquandaQuery( em, equandaQuery, queryString, false ); - Map<String, Object> parameters = equandaQuery.getParameters(); - for ( String name : parameters.keySet() ) query.setParameter( name, parameters.get( name ) ); + Map<String, Object> parameters = equandaQuery.getParameters(); + for ( String name : parameters.keySet() ) query.setParameter( name, parameters.get( name ) ); - return query.getResultList(); -#if( $table.hasDataFilters() ) - } finally { equandaQuery.clearExtra(); } -#end + return query.getResultList(); + } finally { equandaQuery.clearExtra(); } } } Modified: trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -135,6 +135,18 @@ queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name}Bean p WHERE p.${field.VarName} = :${field.VarName}" ); #end +#foreach( $field in $table.LinkFields ) +#if( $field.hasCompare() ) +#set( $sep = "" ) +#set( $test = "" ) +#foreach( $ii in $field.Compares ) +#set( $test = "$sep o.equandaType = '${ii.TypeValue}'" ) +#set( $sep = "" ) +#end + queryStrings.put( "${table.Name}.equandaCompareType${field.Name}", "$test" ); +#end +#end + #end## foreach table } } Modified: trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -110,6 +110,11 @@ this.selectedSettings = selectedSettings; } + public String getFilter() + { + return null != selectedSettings ? selectedSettings.getFilter() : null; + } + public boolean isRootPage() { return ( this.selectedSettings == null ); Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -33,6 +33,7 @@ package ${package}.components.${table.VarName}; #set( $ejbPackage=${engine.getConfig("ejb-package")} ) +import ${ejbPackage}.client.EquandaGlobal; import org.apache.tapestry5.*; import org.apache.tapestry5.annotations.*; import org.apache.tapestry5.corelib.base.*; @@ -349,5 +350,9 @@ } catch ( EquandaPersistenceException epe) { /*ignore*/ return null; } } #end + +#if( $field.hasLinkTypeCompare() ) + public String get${field.Name}Filter() { return EquandaGlobal.getQueryString( "${table.Name}.equandaCompareType${field.Name}" ); } #end +#end } Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -61,6 +61,9 @@ @Parameter private boolean embedded; + @Parameter + private String filter; + @InjectPage private ${table.Name}EquandaAll select; @@ -132,13 +135,13 @@ Object onActionFromAdd( Integer index, String componentId ) { return add( new SelectedSettingsForSelect<${table.Name}>( - resources.createPageLink( resources.getPageName(), false ), componentId, index ) ); + resources.createPageLink( resources.getPageName(), false ), filter, componentId, index ) ); } Object onActionFromAdd() { return add( new SelectedSettings<${table.Name}>( - resources.createPageLink( resources.getPageName(), false ), value, null ) ); + resources.createPageLink( resources.getPageName(), false ), value, null, filter ) ); } Object add( SelectedSettings<${table.Name}> selectedSettings ) @@ -177,6 +180,15 @@ return embedded; } + public String getFilter() { + return filter; + } + + public void setFilter( String value ) + { + filter = value; + } + public List<Object> getSelectParameters() { List<Object> res = new ArrayList<Object>(); Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -56,6 +56,9 @@ @Parameter private SelectedSetter<${table.Name}> setter; + @Parameter + private String filter; + @InjectPage private ${table.Name}EquandaAll select; @@ -90,7 +93,17 @@ { this.selectComponentId = selectComponentId; } + + public String getFilter() { + return filter; + } + public void setFilter( String value ) + { + filter = value; + } + + public ${ejbPackage}.client.${table.Name} getValue() { return value; @@ -115,14 +128,14 @@ Object onActionFromSelect( Integer index, String componentId ) { select.setSelectedSettings( new SelectedSettingsForSelect<${table.Name}>( - resources.createPageLink( resources.getPageName(), false ), componentId, index ) ); + resources.createPageLink( resources.getPageName(), false ), filter, componentId, index ) ); return select; } Object onActionFromSelect() { select.setSelectedSettings( new SelectedSettings<${table.Name}>( - resources.createPageLink( resources.getPageName(), false ), null, setter ) ); + resources.createPageLink( resources.getPageName(), false ), null, setter, filter ) ); return select; } Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -1 +1 @@ -<input t:type="${field.LinkTable.VarName}/LinkList" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" editIndex="editIndex" selectComponentId="${table.Name}.${field.Name}"/> +<input t:type="${field.LinkTable.VarName}/LinkList" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" editIndex="editIndex" selectComponentId="${table.Name}.${field.Name}" #if( $field.hasLinkTypeCompare() )filter="${field.Name}Filter"#end /> Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -1 +1 @@ -<input t:type="${field.LinkTable.VarName}/LinkOne" t:value="value.${field.VarName}" t:setter="${field.Name}Setter" editIndex="editIndex" selectComponentId="${table.Name}.${field.Name}"/> +<input t:type="${field.LinkTable.VarName}/LinkOne" t:value="value.${field.VarName}" t:setter="${field.Name}Setter" editIndex="editIndex" selectComponentId="${table.Name}.${field.Name}" #if( $field.hasLinkTypeCompare() )filter="${field.Name}Filter"#end /> Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2008-08-11 22:49:30 UTC (rev 664) @@ -36,7 +36,6 @@ import ${ejbPackage}.client.${table.Name}; import ${ejbPackage}.client.${table.Name}SelectorEJB; import ${ejbPackage}.client.EquandaGlobal; -import org.equanda.t5gui.ListGetter; import ${package}.base.SelectPageBase; import org.apache.log4j.Logger; import org.apache.tapestry5.annotations.InjectPage; @@ -44,6 +43,8 @@ import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.ComponentResources; import org.equanda.persistence.EquandaPersistenceException; +import org.equanda.persistence.SelectorsState; +import org.equanda.t5gui.ListGetter; import java.util.List; import java.util.ArrayList; @@ -81,6 +82,7 @@ List<${table.Name}> list = null; try { + SelectorsState.setFilter( "equanda${table.Name}", getFilter() ); #if( $select.isSingle() ) $table.Name one = sel.select${select.Name}( $select.ParametersListNoLimit #if($select.hasLimit()),10000#end); list = new ArrayList<${table.Name}>(); @@ -93,6 +95,10 @@ { equandaLog.error( ee, ee ); } + finally + { + SelectorsState.setFilter( "equanda${table.Name}", null ); + } sel.remove(); return list; } Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java =================================================================== --- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettings.java 2008-08-11 22:49:30 UTC (rev 664) @@ -36,6 +36,7 @@ private Object selectedReturnPage; private List<T> selectedList; private SelectedSetter<T> selectedSetter; + private String filter; public SelectedSettings( Object returnPage, List<T> list, SelectedSetter<T> ss ) { @@ -44,6 +45,15 @@ selectedSetter = ss; } + public SelectedSettings( Object returnPage, List<T> list, SelectedSetter<T> ss, String filter ) + { + selectedReturnPage = returnPage; + selectedList = list; + selectedSetter = ss; + System.out.println( "Setting SelectedSettings filter to " + filter ); + this.filter = filter; + } + public Object getSelectedReturnPage() { return selectedReturnPage; @@ -58,4 +68,9 @@ { return selectedSetter; } + + public String getFilter() + { + return filter; + } } Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettingsForSelect.java =================================================================== --- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettingsForSelect.java 2008-08-11 22:46:35 UTC (rev 663) +++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSettingsForSelect.java 2008-08-11 22:49:30 UTC (rev 664) @@ -36,9 +36,9 @@ private Integer index; private String componentId; - public SelectedSettingsForSelect( Object returnPage, String componentId, Integer index ) + public SelectedSettingsForSelect( Object returnPage, String filter, String componentId, Integer index ) { - super( returnPage, null, null ); + super( returnPage, null, null, filter ); this.componentId = componentId; this.index = index; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-12 16:10:51
|
Revision: 666 http://equanda.svn.sourceforge.net/equanda/?rev=666&view=rev Author: triathlon98 Date: 2008-08-12 16:10:44 +0000 (Tue, 12 Aug 2008) Log Message: ----------- EQ-211 upgrade to tapestry 5.0.14 Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ear/pom.xml trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml trunk/equanda-test/pom.xml trunk/pom.xml Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm 2008-08-12 11:55:38 UTC (rev 665) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm 2008-08-12 16:10:44 UTC (rev 666) @@ -73,7 +73,7 @@ public BeanModel<${table.Name}> getGridModel() { - model = beanModelSource.create( ${table.Name}.class, true, resources ); + model = beanModelSource.create( ${table.Name}.class, true, resources.getMessages() ); List<String> toremove = model.getPropertyNames(); for ( String one : toremove ) model.exclude( one ); Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2008-08-12 11:55:38 UTC (rev 665) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2008-08-12 16:10:44 UTC (rev 666) @@ -21,13 +21,13 @@ <t:parameter name="title$pageindex">Metadata</t:parameter> <t:parameter name="content$pageindex"> <t:label for="id"/> - <input t:type="TextField" t:label="equanda-message:field.EquandaId" t:id="id" t:value="value.Id" size="14" disabled="true" translate="IdTranslator"/> + <input t:type="TextField" t:label="equanda-message:field.EquandaId" t:id="id" t:value="value.Id" size="14" disabled="true" translate="prop:IdTranslator"/> <br/> <t:label for="equandaCreationDate"/> - <input t:type="TextField" t:label="equanda-message:field.EquandaCreationDate" t:id="equandaCreationDate" t:value="value.EquandaCreationDate" size="20" disabled="true" translate="TimestampTranslator"/> + <input t:type="TextField" t:label="equanda-message:field.EquandaCreationDate" t:id="equandaCreationDate" t:value="value.EquandaCreationDate" size="20" disabled="true" translate="prop:TimestampTranslator"/> <br/> <t:label for="equandaModificationDate"/> - <input t:type="TextField" t:label="equanda-message:field.EquandaModificationDate" t:id="equandaModificationDate" t:value="value.EquandaModificationDate" size="20" disabled="true" translate="TimestampTranslator"/> + <input t:type="TextField" t:label="equanda-message:field.EquandaModificationDate" t:id="equandaModificationDate" t:value="value.EquandaModificationDate" size="20" disabled="true" translate="prop:TimestampTranslator"/> <br/> <t:label for="equandaVersion"/> <input t:type="TextField" t:label="equanda-message:field.EquandaVersion" t:id="equandaVersion" t:value="value.EquandaVersion" size="6" disabled="true"/> Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ear/pom.xml =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ear/pom.xml 2008-08-12 11:55:38 UTC (rev 665) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ear/pom.xml 2008-08-12 16:10:44 UTC (rev 666) @@ -70,11 +70,6 @@ <artifactId>log4j</artifactId> <excluded>true</excluded> </javaModule> - <javaModule> - <groupId>jboss</groupId> - <artifactId>javassist</artifactId> - <excluded>true</excluded> - </javaModule> </modules> <jboss> <version>4</version> Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml 2008-08-12 11:55:38 UTC (rev 665) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml 2008-08-12 16:10:44 UTC (rev 666) @@ -458,9 +458,9 @@ </profiles> <properties> - <equanda-version>0.9.1-SNAPSHOT</equanda-version> + <equanda-version>0.9.1</equanda-version> <staticwiki-version>0.9</staticwiki-version> - <tapestry-version>5.0.13</tapestry-version> + <tapestry-version>5.0.14</tapestry-version> <t5compo-version>0.5.13</t5compo-version> </properties> Modified: trunk/equanda-test/pom.xml =================================================================== --- trunk/equanda-test/pom.xml 2008-08-12 11:55:38 UTC (rev 665) +++ trunk/equanda-test/pom.xml 2008-08-12 16:10:44 UTC (rev 666) @@ -177,7 +177,7 @@ </dependencyManagement> <properties> - <tapestry-version>5.0.13</tapestry-version> + <tapestry-version>5.0.14</tapestry-version> </properties> </project> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-12 11:55:38 UTC (rev 665) +++ trunk/pom.xml 2008-08-12 16:10:44 UTC (rev 666) @@ -557,7 +557,7 @@ </profiles> <properties> - <tapestry-release-version>5.0.13</tapestry-release-version> + <tapestry-release-version>5.0.14</tapestry-release-version> <tapestry-commons-version>0.5.13</tapestry-commons-version> <staticwiki-release-version>0.9</staticwiki-release-version> </properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-13 09:25:54
|
Revision: 669 http://equanda.svn.sourceforge.net/equanda/?rev=669&view=rev Author: triathlon98 Date: 2008-08-13 09:25:50 +0000 (Wed, 13 Aug 2008) Log Message: ----------- fix which is needed for prototype which is part of tapestry 5.0.14 Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2008-08-12 22:12:16 UTC (rev 668) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2008-08-13 09:25:50 UTC (rev 669) @@ -102,8 +102,8 @@ #if( $table.Types.size() > 1 ) void beginRender() { - renderSupport.addScript( "equandaSwitchType${table.Name}( ${dollar}(${table.Name}EquandaType) );"+ - "Event.observe( '${table.Name}EquandaType', 'change', function() { equandaSwitchType${table.Name}( ${dollar}(${table.Name}EquandaType) ) } );" ); + renderSupport.addScript( "equandaSwitchType${table.Name}( ${dollar}('${table.Name}EquandaType') );"+ + "Event.observe( '${table.Name}EquandaType', 'change', function() { equandaSwitchType${table.Name}( ${dollar}('${table.Name}EquandaType') ) } );" ); } #end Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2008-08-12 22:12:16 UTC (rev 668) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2008-08-13 09:25:50 UTC (rev 669) @@ -174,8 +174,8 @@ #end #end #if( $table.Types.size() > 1 ) - renderSupport.addScript( "equandaSwitchType${table.Name}( ${dollar}(${table.Name}EquandaType) );"+ - "Event.observe( '${table.Name}EquandaType', 'change', function() { equandaSwitchType${table.Name}( ${dollar}(${table.Name}EquandaType) ) } );" ); + renderSupport.addScript( "equandaSwitchType${table.Name}( ${dollar}('${table.Name}EquandaType') );"+ + "Event.observe( '${table.Name}EquandaType', 'change', function() { equandaSwitchType${table.Name}( ${dollar}('${table.Name}EquandaType') ) } );" ); #end } Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js =================================================================== --- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js 2008-08-12 22:12:16 UTC (rev 668) +++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/accordion.js 2008-08-13 09:25:50 UTC (rev 669) @@ -4,11 +4,12 @@ function equandaAccordion( el, indx ) { - if (el.tagName == "A" ) el = el.up(); + if ( el.tagName == "A" ) el = $( el.up() ); var accordionId = el.parentNode.id; - if ( !Element.hasClassName( el, accordionId + "_title_active" ) ) + if ( !el.hasClassName( accordionId + "_title_active" ) ) { - $$( '.' + accordionId + '_title_active').each( function deactivate( object ) { + $$( '.' + accordionId + '_title_active').each( function deactivate( object ) + { object.next().style.display = "none"; object.removeClassName( accordionId + '_title_active' ); object.down().removeClassName( EQUANDA_ACCORDION_SKIP ); @@ -24,7 +25,8 @@ { var objects = $$( '#' + elementName + ' .' + elementName+'_title' ); objects.each( function hide( object ) { - if ( !Element.hasClassName( object, elementName + "_title_active" ) ) { + if ( !object.hasClassName( elementName + "_title_active" ) ) + { object.next().style.display = "none"; } } ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-13 17:02:25
|
Revision: 674 http://equanda.svn.sourceforge.net/equanda/?rev=674&view=rev Author: triathlon98 Date: 2008-08-13 17:02:13 +0000 (Wed, 13 Aug 2008) Log Message: ----------- [maven-release-plugin] prepare release equanda-0.9.1 Modified Paths: -------------- trunk/equanda-client/pom.xml trunk/equanda-generate/pom.xml trunk/equanda-maven-plugin/pom.xml trunk/equanda-server/pom.xml trunk/equanda-t5gui/pom.xml trunk/equanda-tapestry5/pom.xml trunk/equanda-test/pom.xml trunk/equanda-test/test-core/pom.xml trunk/equanda-test/test-ddltool/pom.xml trunk/equanda-test/test-gui-t5-test/pom.xml trunk/equanda-test/test-t5-ear/pom.xml trunk/equanda-test/test-t5-gui/pom.xml trunk/equanda-test/test-test/pom.xml trunk/equanda-tool/pom.xml trunk/equanda-util/pom.xml trunk/pom.xml Modified: trunk/equanda-client/pom.xml =================================================================== --- trunk/equanda-client/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-client/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-client</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-client</name> <dependencies> <dependency> Modified: trunk/equanda-generate/pom.xml =================================================================== --- trunk/equanda-generate/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-generate/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-generate</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-generate</name> <build> <resources> Modified: trunk/equanda-maven-plugin/pom.xml =================================================================== --- trunk/equanda-maven-plugin/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-maven-plugin/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <artifactId>equanda</artifactId> <groupId>org.equanda</groupId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-maven-plugin</artifactId> <packaging>maven-plugin</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-maven-plugin</name> <description> Provide the maven plugins for equanda users. Modified: trunk/equanda-server/pom.xml =================================================================== --- trunk/equanda-server/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-server/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-server</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-server</name> <dependencies> <dependency> Modified: trunk/equanda-t5gui/pom.xml =================================================================== --- trunk/equanda-t5gui/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-t5gui/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-t5gui</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-t5gui</name> <build> Modified: trunk/equanda-tapestry5/pom.xml =================================================================== --- trunk/equanda-tapestry5/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-tapestry5/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-tapestry5</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-tapestry5</name> <build> Modified: trunk/equanda-test/pom.xml =================================================================== --- trunk/equanda-test/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,183 +1,182 @@ -<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>org.equanda</groupId> - <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.equanda</groupId> - <artifactId>equanda-test</artifactId> - <packaging>pom</packaging> - - <version>0.9.1-SNAPSHOT</version> - - <name>equanda-test</name> - <description>tests for equanda</description> - <modules> - <module>test-core</module> - <module>test-t5-gui</module> - <module>test-t5-ear</module> - <module>test-ddltool</module> - <module>test-test</module> - <module>test-gui-t5-test</module> - </modules> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.equanda.test</groupId> - <artifactId>test-core</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda.test</groupId> - <artifactId>test-t5-gui</artifactId> - <version>${project.version}</version> - <type>war</type> - </dependency> - <dependency> - <groupId>org.equanda.test</groupId> - <artifactId>test-t5-ear</artifactId> - <version>${project.version}</version> - <type>ear</type> - </dependency> - <dependency> - <groupId>org.equanda.test</groupId> - <artifactId>test-ddltool</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda.test</groupId> - <artifactId>test-test</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-util</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-server</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-client</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-tapestry5</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-t5gui</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-maven-plugin</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tapestry</groupId> - <artifactId>tapestry-core</artifactId> - <version>${tapestry-version}</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.14</version> - </dependency> - <dependency> - <groupId>org.javolution</groupId> - <artifactId>javolution</artifactId> - <version>3.7.10</version> - </dependency> - <dependency> - <groupId>javax.persistence</groupId> - <artifactId>persistence-api</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-serialization</artifactId> - <version>1.0.3.GA</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-j2ee</artifactId> - <version>4.2.1.GA</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jbosssx</artifactId> - <version>4.2.1.GA</version> - </dependency> - <dependency> - <groupId>org.jboss</groupId> - <artifactId>jboss-common-jdbc-wrapper</artifactId> - <version>4.0.4</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-annotations-ejb3</artifactId> - <version>4.2.1.GA</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-ejb-api</artifactId> - <version>4.2.1.GA</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-system</artifactId> - <version>4.2.1.GA</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-jmx</artifactId> - <version>4.2.1.GA</version> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-cache</artifactId> - <version>2.0.0.GA</version> - </dependency> - <dependency> - <groupId>org.jboss</groupId> - <artifactId>jboss-client</artifactId> - <version>4.2.2</version> - </dependency> - <dependency> - <groupId>joda-time</groupId> - <artifactId>joda-time</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>xerces</groupId> - <artifactId>xercesImpl</artifactId> - <version>2.4.0</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.3.0.ga</version> - </dependency> - </dependencies> - </dependencyManagement> - - <properties> - <tapestry-version>5.0.14</tapestry-version> - </properties> - -</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> + <groupId>org.equanda</groupId> + <artifactId>equanda</artifactId> + <version>0.9.1</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.equanda</groupId> + <artifactId>equanda-test</artifactId> + <packaging>pom</packaging> + + <version>0.9.1</version> + + <name>equanda-test</name> + <description>tests for equanda</description> + <modules> + <module>test-core</module> + <module>test-t5-gui</module> + <module>test-t5-ear</module> + <module>test-ddltool</module> + <module>test-test</module> + <module>test-gui-t5-test</module> + </modules> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.equanda.test</groupId> + <artifactId>test-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda.test</groupId> + <artifactId>test-t5-gui</artifactId> + <version>${project.version}</version> + <type>war</type> + </dependency> + <dependency> + <groupId>org.equanda.test</groupId> + <artifactId>test-t5-ear</artifactId> + <version>${project.version}</version> + <type>ear</type> + </dependency> + <dependency> + <groupId>org.equanda.test</groupId> + <artifactId>test-ddltool</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda.test</groupId> + <artifactId>test-test</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-util</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-server</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-client</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-tapestry5</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-t5gui</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-maven-plugin</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.tapestry</groupId> + <artifactId>tapestry-core</artifactId> + <version>${tapestry-version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.14</version> + </dependency> + <dependency> + <groupId>org.javolution</groupId> + <artifactId>javolution</artifactId> + <version>3.7.10</version> + </dependency> + <dependency> + <groupId>javax.persistence</groupId> + <artifactId>persistence-api</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-serialization</artifactId> + <version>1.0.3.GA</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-j2ee</artifactId> + <version>4.2.1.GA</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jbosssx</artifactId> + <version>4.2.1.GA</version> + </dependency> + <dependency> + <groupId>org.jboss</groupId> + <artifactId>jboss-common-jdbc-wrapper</artifactId> + <version>4.0.4</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-annotations-ejb3</artifactId> + <version>4.2.1.GA</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-ejb-api</artifactId> + <version>4.2.1.GA</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-system</artifactId> + <version>4.2.1.GA</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-jmx</artifactId> + <version>4.2.1.GA</version> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-cache</artifactId> + <version>2.0.0.GA</version> + </dependency> + <dependency> + <groupId>org.jboss</groupId> + <artifactId>jboss-client</artifactId> + <version>4.2.2</version> + </dependency> + <dependency> + <groupId>joda-time</groupId> + <artifactId>joda-time</artifactId> + <version>1.4</version> + </dependency> + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.4.0</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.3.0.ga</version> + </dependency> + </dependencies> + </dependencyManagement> + + <properties> + <tapestry-version>5.0.14</tapestry-version> + </properties> + +</project> \ No newline at end of file Modified: trunk/equanda-test/test-core/pom.xml =================================================================== --- trunk/equanda-test/test-core/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/test-core/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,102 +1,101 @@ -<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>org.equanda</groupId> - <artifactId>equanda-test</artifactId> - <version>0.9.1-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.equanda.test</groupId> - <artifactId>test-core</artifactId> - <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> - <name>test-core</name> - <description>test core</description> - <build> - <plugins> - <plugin> - <groupId>org.equanda</groupId> - <artifactId>equanda-maven-plugin</artifactId> - <configuration> - <sourceDirectory>${basedir}/../src/main/dm</sourceDirectory> - <template>ejb3,import,login</template> - <verifyLanguages>en;nl</verifyLanguages> - <translateTarget>${basedir}/src/main/resources/translations.txt</translateTarget> - </configuration> - <executions> - <execution> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-util</artifactId> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-server</artifactId> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-maven-plugin</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-annotations-ejb3</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-ejb-api</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-j2ee</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jbosssx</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-jmx</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-cache</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-serialization</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> -</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> + <groupId>org.equanda</groupId> + <artifactId>equanda-test</artifactId> + <version>0.9.1</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.equanda.test</groupId> + <artifactId>test-core</artifactId> + <packaging>jar</packaging> + <version>0.9.1</version> + <name>test-core</name> + <description>test core</description> + <build> + <plugins> + <plugin> + <groupId>org.equanda</groupId> + <artifactId>equanda-maven-plugin</artifactId> + <configuration> + <sourceDirectory>${basedir}/../src/main/dm</sourceDirectory> + <template>ejb3,import,login</template> + <verifyLanguages>en;nl</verifyLanguages> + <translateTarget>${basedir}/src/main/resources/translations.txt</translateTarget> + </configuration> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-util</artifactId> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-server</artifactId> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-maven-plugin</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-annotations-ejb3</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-ejb-api</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-j2ee</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jbosssx</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-jmx</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-cache</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>jboss</groupId> + <artifactId>jboss-serialization</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> +</project> \ No newline at end of file Modified: trunk/equanda-test/test-ddltool/pom.xml =================================================================== --- trunk/equanda-test/test-ddltool/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/test-ddltool/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,60 +1,59 @@ -<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>org.equanda</groupId> - <artifactId>equanda-test</artifactId> - <version>0.9.1-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.equanda.test</groupId> - <artifactId>test-ddltool</artifactId> - <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> - <name>test-ddltool</name> - <description>test ddltool</description> - - <build> - <plugins> - <plugin> - <groupId>org.equanda</groupId> - <artifactId>equanda-maven-plugin</artifactId> - <configuration> - <sourceDirectory>${basedir}/../src/main/dm</sourceDirectory> - <template>ddltool</template> - </configuration> - <executions> - <execution> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-util</artifactId> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-server</artifactId> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-tool</artifactId> - </dependency> - <dependency> - <groupId>org.equanda</groupId> - <artifactId>equanda-maven-plugin</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> -</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> + <groupId>org.equanda</groupId> + <artifactId>equanda-test</artifactId> + <version>0.9.1</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.equanda.test</groupId> + <artifactId>test-ddltool</artifactId> + <packaging>jar</packaging> + <version>0.9.1</version> + <name>test-ddltool</name> + <description>test ddltool</description> + + <build> + <plugins> + <plugin> + <groupId>org.equanda</groupId> + <artifactId>equanda-maven-plugin</artifactId> + <configuration> + <sourceDirectory>${basedir}/../src/main/dm</sourceDirectory> + <template>ddltool</template> + </configuration> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-util</artifactId> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-server</artifactId> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-tool</artifactId> + </dependency> + <dependency> + <groupId>org.equanda</groupId> + <artifactId>equanda-maven-plugin</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> +</project> \ No newline at end of file Modified: trunk/equanda-test/test-gui-t5-test/pom.xml =================================================================== --- trunk/equanda-test/test-gui-t5-test/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/test-gui-t5-test/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,15 +1,14 @@ -<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>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-gui-t5-test</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>test-gui-t5-test</name> <description>test test</description> Modified: trunk/equanda-test/test-t5-ear/pom.xml =================================================================== --- trunk/equanda-test/test-t5-ear/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/test-t5-ear/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,15 +1,14 @@ -<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>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-t5-ear</artifactId> <packaging>ear</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>test-t5-ear</name> <description>test ear</description> <build> Modified: trunk/equanda-test/test-t5-gui/pom.xml =================================================================== --- trunk/equanda-test/test-t5-gui/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/test-t5-gui/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,15 +1,14 @@ -<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>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-t5-gui</artifactId> <packaging>war</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>test-t5-gui</name> <description>test gui</description> <build> Modified: trunk/equanda-test/test-test/pom.xml =================================================================== --- trunk/equanda-test/test-test/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-test/test-test/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -1,15 +1,14 @@ -<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>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-test</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>test-test</name> <description>test test</description> @@ -24,8 +23,8 @@ <phase>test-compile</phase> <configuration> <tasks> - <copy file="${equanda.db.empty}" tofile="${equanda.db.location}" overwrite="true"/> - <chmod file="${equanda.db.location}" perm="a+rw"/> + <copy file="${equanda.db.empty}" tofile="${equanda.db.location}" overwrite="true" /> + <chmod file="${equanda.db.location}" perm="a+rw" /> </tasks> </configuration> <goals> Modified: trunk/equanda-tool/pom.xml =================================================================== --- trunk/equanda-tool/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-tool/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-tool</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-tool</name> <dependencies> <dependency> Modified: trunk/equanda-util/pom.xml =================================================================== --- trunk/equanda-util/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/equanda-util/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-util</artifactId> <packaging>jar</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda-util</name> <dependencies> <dependency> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-13 16:51:39 UTC (rev 673) +++ trunk/pom.xml 2008-08-13 17:02:13 UTC (rev 674) @@ -4,7 +4,7 @@ <artifactId>equanda</artifactId> <packaging>pom</packaging> - <version>0.9.1-SNAPSHOT</version> + <version>0.9.1</version> <name>equanda</name> <description> @@ -41,9 +41,9 @@ <url>http://jira.equanda.org/</url> </issueManagement> <scm> - <connection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/trunk</connection> - <developerConnection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/trunk</developerConnection> - <url>http://equanda.svn.sourceforge.net/viewvc/equanda/</url> + <connection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/tags/equanda-0.9.1</connection> + <developerConnection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/tags/equanda-0.9.1</developerConnection> + <url>http://equanda.svn.sourceforge.net/viewvc/equanda/tags/equanda-0.9.1</url> </scm> <ciManagement> <system>hudson</system> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-13 17:05:03
|
Revision: 676 http://equanda.svn.sourceforge.net/equanda/?rev=676&view=rev Author: triathlon98 Date: 2008-08-13 17:04:54 +0000 (Wed, 13 Aug 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/equanda-client/pom.xml trunk/equanda-generate/pom.xml trunk/equanda-maven-plugin/pom.xml trunk/equanda-server/pom.xml trunk/equanda-t5gui/pom.xml trunk/equanda-tapestry5/pom.xml trunk/equanda-test/pom.xml trunk/equanda-test/test-core/pom.xml trunk/equanda-test/test-ddltool/pom.xml trunk/equanda-test/test-gui-t5-test/pom.xml trunk/equanda-test/test-t5-ear/pom.xml trunk/equanda-test/test-t5-gui/pom.xml trunk/equanda-test/test-test/pom.xml trunk/equanda-tool/pom.xml trunk/equanda-util/pom.xml trunk/pom.xml Modified: trunk/equanda-client/pom.xml =================================================================== --- trunk/equanda-client/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-client/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-client</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-client</name> <dependencies> <dependency> Modified: trunk/equanda-generate/pom.xml =================================================================== --- trunk/equanda-generate/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-generate/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-generate</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-generate</name> <build> <resources> Modified: trunk/equanda-maven-plugin/pom.xml =================================================================== --- trunk/equanda-maven-plugin/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-maven-plugin/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <artifactId>equanda</artifactId> <groupId>org.equanda</groupId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-maven-plugin</artifactId> <packaging>maven-plugin</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-maven-plugin</name> <description> Provide the maven plugins for equanda users. Modified: trunk/equanda-server/pom.xml =================================================================== --- trunk/equanda-server/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-server/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-server</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-server</name> <dependencies> <dependency> Modified: trunk/equanda-t5gui/pom.xml =================================================================== --- trunk/equanda-t5gui/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-t5gui/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-t5gui</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-t5gui</name> <build> Modified: trunk/equanda-tapestry5/pom.xml =================================================================== --- trunk/equanda-tapestry5/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-tapestry5/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-tapestry5</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-tapestry5</name> <build> Modified: trunk/equanda-test/pom.xml =================================================================== --- trunk/equanda-test/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,14 +2,14 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> <packaging>pom</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-test</name> <description>tests for equanda</description> Modified: trunk/equanda-test/test-core/pom.xml =================================================================== --- trunk/equanda-test/test-core/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/test-core/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-core</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>test-core</name> <description>test core</description> <build> Modified: trunk/equanda-test/test-ddltool/pom.xml =================================================================== --- trunk/equanda-test/test-ddltool/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/test-ddltool/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-ddltool</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>test-ddltool</name> <description>test ddltool</description> Modified: trunk/equanda-test/test-gui-t5-test/pom.xml =================================================================== --- trunk/equanda-test/test-gui-t5-test/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/test-gui-t5-test/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-gui-t5-test</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>test-gui-t5-test</name> <description>test test</description> Modified: trunk/equanda-test/test-t5-ear/pom.xml =================================================================== --- trunk/equanda-test/test-t5-ear/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/test-t5-ear/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-t5-ear</artifactId> <packaging>ear</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>test-t5-ear</name> <description>test ear</description> <build> Modified: trunk/equanda-test/test-t5-gui/pom.xml =================================================================== --- trunk/equanda-test/test-t5-gui/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/test-t5-gui/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-t5-gui</artifactId> <packaging>war</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>test-t5-gui</name> <description>test gui</description> <build> Modified: trunk/equanda-test/test-test/pom.xml =================================================================== --- trunk/equanda-test/test-test/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-test/test-test/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda-test</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda.test</groupId> <artifactId>test-test</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>test-test</name> <description>test test</description> Modified: trunk/equanda-tool/pom.xml =================================================================== --- trunk/equanda-tool/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-tool/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-tool</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-tool</name> <dependencies> <dependency> Modified: trunk/equanda-util/pom.xml =================================================================== --- trunk/equanda-util/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/equanda-util/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -2,13 +2,13 @@ <parent> <groupId>org.equanda</groupId> <artifactId>equanda</artifactId> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.equanda</groupId> <artifactId>equanda-util</artifactId> <packaging>jar</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda-util</name> <dependencies> <dependency> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-13 17:03:43 UTC (rev 675) +++ trunk/pom.xml 2008-08-13 17:04:54 UTC (rev 676) @@ -4,7 +4,7 @@ <artifactId>equanda</artifactId> <packaging>pom</packaging> - <version>0.9.1</version> + <version>0.9.2-SNAPSHOT</version> <name>equanda</name> <description> @@ -41,9 +41,9 @@ <url>http://jira.equanda.org/</url> </issueManagement> <scm> - <connection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/tags/equanda-0.9.1</connection> - <developerConnection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/tags/equanda-0.9.1</developerConnection> - <url>http://equanda.svn.sourceforge.net/viewvc/equanda/tags/equanda-0.9.1</url> + <connection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/trunk</connection> + <developerConnection>scm:svn:https://equanda.svn.sourceforge.net/svnroot/equanda/trunk</developerConnection> + <url>http://equanda.svn.sourceforge.net/viewvc/equanda/</url> </scm> <ciManagement> <system>hudson</system> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-14 13:56:08
|
Revision: 677 http://equanda.svn.sourceforge.net/equanda/?rev=677&view=rev Author: triathlon98 Date: 2008-08-14 13:56:02 +0000 (Thu, 14 Aug 2008) Log Message: ----------- EQ-214 no copyright msg in generated Start class and correct messages order Modified Paths: -------------- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java 2008-08-13 17:04:54 UTC (rev 676) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java 2008-08-14 13:56:02 UTC (rev 677) @@ -1,27 +1,3 @@ -/** - * This file is part of the equanda project. - * - * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF - * ANY KIND, either express or implied. See the License for the specific language governing rights and - * limitations under the License. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - */ - package ${srcPackage}; import java.util.Date; @@ -34,8 +10,11 @@ /** * Start page of application ca-t5gui. + * + * @author generated by equanda */ -public class Start implements EquandaMessagesGroup +public class Start + implements EquandaMessagesGroup { @Inject @@ -61,12 +40,12 @@ public String[] getMessagesGroups() { - return new String[]{ + return new String[] { "equanda-table", "equanda-fixed", - "equanda-skin", "equanda-exceptions", - "equanda-application-exceptions", + "app", + "app-exceptions" }; } } \ No newline at end of file Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java =================================================================== --- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java 2008-08-13 17:04:54 UTC (rev 676) +++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSourceImpl.java 2008-08-14 13:56:02 UTC (rev 677) @@ -39,7 +39,7 @@ "equanda-fixed", "equanda-exceptions", "app", - "equanda-app-exceptions", + "app-exceptions", }; private EquandaMessagesTranslator equandaMessageTranslator; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-20 13:03:59
|
Revision: 683 http://equanda.svn.sourceforge.net/equanda/?rev=683&view=rev Author: triathlon98 Date: 2008-08-20 13:03:53 +0000 (Wed, 20 Aug 2008) Log Message: ----------- EQ-218 remove createpk from ddltool Modified Paths: -------------- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/DdltoolPlugin.java trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ddltool/pom.xml trunk/equanda-test/test-test/pom.xml trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java trunk/pom.xml trunk/src/site/wiki/config.wiki Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/DdltoolPlugin.java =================================================================== --- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/DdltoolPlugin.java 2008-08-18 09:04:25 UTC (rev 682) +++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/DdltoolPlugin.java 2008-08-20 13:03:53 UTC (rev 683) @@ -85,7 +85,7 @@ private String dbpassword; /** - * @parameter expression="update defaults createpk indexes" + * @parameter expression="update defaults indexes" */ private String ddltargets; Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ddltool/pom.xml =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ddltool/pom.xml 2008-08-18 09:04:25 UTC (rev 682) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/ddltool/pom.xml 2008-08-20 13:03:53 UTC (rev 683) @@ -68,7 +68,7 @@ <dblogin>${${artifactId}.db.login}</dblogin> <dbpassword>${${artifactId}.db.password}</dbpassword> <dbmap>${basePackage}.ddltool.EquandaMap</dbmap> - <ddltargets>update defaults createpk indexes</ddltargets> + <ddltargets>update defaults indexes</ddltargets> </configuration> <executions> <execution> @@ -103,7 +103,7 @@ <dblogin>${${artifactId}.db.login}</dblogin> <dbpassword>${${artifactId}.db.password}</dbpassword> <dbmap>${basePackage}.ddltool.EquandaMap</dbmap> - <ddltargets>update defaults createpk indexes</ddltargets> + <ddltargets>update defaults indexes</ddltargets> </configuration> <executions> <execution> Modified: trunk/equanda-test/test-test/pom.xml =================================================================== --- trunk/equanda-test/test-test/pom.xml 2008-08-18 09:04:25 UTC (rev 682) +++ trunk/equanda-test/test-test/pom.xml 2008-08-20 13:03:53 UTC (rev 683) @@ -41,7 +41,7 @@ <dblogin>${equanda.db.login}</dblogin> <dbpassword>${equanda.db.password}</dbpassword> <dbmap>org.equanda.test.ddltool.EquandaMap</dbmap> - <ddltargets>update defaults createpk indexes</ddltargets> + <ddltargets>update defaults indexes</ddltargets> </configuration> <executions> <execution> Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java 2008-08-18 09:04:25 UTC (rev 682) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java 2008-08-20 13:03:53 UTC (rev 683) @@ -28,7 +28,7 @@ import org.equanda.util.ExceptionGroup; /** - * Utility main class + * ddltool utility main class * * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> */ @@ -118,7 +118,7 @@ } else if ( "createpk".equals( next ) ) { - manager.checkPrimaryKeys(); + System.out.print( "createpk option no longer supported" ); } else if ( "defaults".equals( next ) ) { @@ -151,7 +151,6 @@ log.info( "Operations:" ); log.info( "update - create all tables and fields, update definition if possible;" ); log.info( "defaults - update field values where there is null and a default value is specified." ); - log.info( "createpk - creates primary keys for tables that don't have any;" ); log.info( "indexes - create indexes (and delete if next word is delete);" ); log.info( "file - executes a query file. The file name with full path has to be specified next." ); System.exit( 0 ); Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-18 09:04:25 UTC (rev 682) +++ trunk/pom.xml 2008-08-20 13:03:53 UTC (rev 683) @@ -388,8 +388,13 @@ </dependency> <dependency> <groupId>org.hibernate</groupId> + <artifactId>hibernate-core</artifactId> + <version>3.3.0.GA</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> - <version>3.3.0.ga</version> + <version>3.3.0.GA</version> </dependency> <dependency> <groupId>jasperreports</groupId> Modified: trunk/src/site/wiki/config.wiki =================================================================== --- trunk/src/site/wiki/config.wiki 2008-08-18 09:04:25 UTC (rev 682) +++ trunk/src/site/wiki/config.wiki 2008-08-20 13:03:53 UTC (rev 683) @@ -163,7 +163,7 @@ <dblogin>${synca.db.login}</dblogin> <dbpassword>${synca.db.password}</dbpassword> <dbmap>be.synergetics.ca.ddltool.EquandaMap</dbmap> - <ddltargets>update defaults createpk indexes</ddltargets> + <ddltargets>update defaults indexes</ddltargets> </configuration> <executions> <execution> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-21 16:00:54
|
Revision: 685 http://equanda.svn.sourceforge.net/equanda/?rev=685&view=rev Author: triathlon98 Date: 2008-08-21 16:00:50 +0000 (Thu, 21 Aug 2008) Log Message: ----------- EQ-217 make ddltool database independent (db dialect is now external) Modified Paths: -------------- trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java trunk/equanda-generate/src/main/velocity/ddltool/Map.java.vm trunk/equanda-generate/src/main/velocity/ejb3/DMFieldBean.java.vm trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseMap.java trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/JdbcManager.java Added Paths: ----------- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseField.java trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseRelation.java trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/FirebirdDialect.java Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java 2008-08-21 16:00:50 UTC (rev 685) @@ -24,25 +24,31 @@ package org.equanda.domain.db; +import org.equanda.util.StringUtil; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + /** - * convert table and field names from given names to something acceptable for the specific database Default - * implementation : no conversion + * convert table and field names from given names to something acceptable for the specific database. + * Default implementation : no conversion, but add proper prefixes and suffixes. * * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> */ public class Convert { + private Map<String, String> tabletoShort = new HashMap<String, String>(); + private Map<String, String> shortToTable = new HashMap<String, String>(); + private Map<String, String> indexNames = new HashMap<String, String>(); + private Map<String, Set<String>> indexNamesPerTable = new HashMap<String, Set<String>>(); - /** - * initialise conversion routines, may read conversion tables - */ + /** initialise conversion routines, may read conversion tables */ public void init() { } - /** - * finish off conversion routines, may be done to make conversions persistent - */ + /** finish off conversion routines, may be done to make conversions persistent */ public void done() { } @@ -50,8 +56,8 @@ /** * convert a table name * - * @param name - * @return + * @param name base table name to convert + * @return converted table name */ public String convertTable( String name ) { @@ -61,11 +67,118 @@ /** * convert a field name * - * @param name - * @return + * @param name base field name to convert + * @return converted field name */ public String convertField( String name ) { return name; } + + /** + * convert a field name + * + * @param name base index name to convert + * @return converted field name + */ + public String convertIndex( String name ) + { + return name; + } + + public String getTableName( String base ) + { + return convertTable( "T_" + base ); + } + + public String getMultipleTableName( String table, String field ) + { + return convertTable( "M_" + table + "_" + field ); + } + + public String getFieldName( String base ) + { + return convertField( "F_" + base ); + } + + public String getLinkFieldName( String base ) + { + return convertField( "F_" + base + "_UOID" ); + } + + public String getIndexName( String table, String field ) + { + StringBuffer name = new StringBuffer( "I_" ); + if ( table.length() < 5 ) + { + name.append( table.toUpperCase() ); + } + else + { + name.append( getShortTableName( table ) ); + } + name.append( '_' ); + name.append( getSimplifiedFieldName( field ) ); + return validateIndexNameUnique( convertIndex( name.toString() ), table ); + } + + private String getShortTableName( String tableName ) + { + String res = tabletoShort.get( tableName ); + if ( res == null ) + { + StringBuffer camel = new StringBuffer(); + + if ( tableName.startsWith( "T_" ) ) tableName = tableName.substring( 2 ); + + for ( int i = 0; i < tableName.length() ; i++ ) + { + if ( Character.isUpperCase( tableName.charAt( i ) ) ) + { + camel.append( tableName.charAt( i ) ); + } + } + if ( camel.length() > 1 ) + { + res = camel.toString(); + } + else + { + if ( tableName.length() <= 5 ) + { + res = tableName; + } + else + { + res = tableName.substring( 0, 5 ); + } + } + int count = 1; + String base = res; + while ( shortToTable.containsKey( res ) ) {res = base + ( count++ );} + tabletoShort.put( tableName, res ); + shortToTable.put( res, tableName ); + } + return res; + } + + private String getSimplifiedFieldName( String name ) + { + return StringUtil.replace( name, "EQUANDA_", "EQ_" ); + } + + private String validateIndexNameUnique( String indexName, String tableName ) + { + Set<String> indexNames = indexNamesPerTable.get( tableName ); + if ( null == indexNames || indexNames.contains( indexName ) ) return indexName; + StringBuffer sb = new StringBuffer(); + for ( int i = 1; true ; i++ ) + { + sb.setLength( 0 ); + sb.append( indexName ); + sb.append( '_' ); + sb.append( Integer.toString( i ) ); + if ( indexNames.contains( sb.toString() ) ) return sb.toString(); + } + } } Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java 2008-08-21 16:00:50 UTC (rev 685) @@ -25,8 +25,8 @@ package org.equanda.domain.db; /** - * convert table and field names from given names to something acceptable for the specific database Firebird only allows - * metadata names to be 31 characters in length. + * Convert table and field names from given names to something acceptable for the specific database. + * Limit names to 31 characters in length and convret to upper case. * * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> */ @@ -34,6 +34,7 @@ extends Convert { public static final int MAX_LENGTH = 31; + public static final int MAX_IDNEX_LENGTH = 27; public String convertTable( String name ) { @@ -41,7 +42,7 @@ { name = name.substring( 0, MAX_LENGTH ); } - return name; + return name.toUpperCase(); } public String convertField( String name ) @@ -57,6 +58,12 @@ name = name.substring( 0, MAX_LENGTH ); } } - return name; + return name.toUpperCase(); } + + public String convertIndex( String name ) + { + if ( name.length() > MAX_IDNEX_LENGTH ) name = name.substring( 0, MAX_IDNEX_LENGTH ); + return name.toUpperCase(); + } } Modified: trunk/equanda-generate/src/main/velocity/ddltool/Map.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ddltool/Map.java.vm 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-generate/src/main/velocity/ddltool/Map.java.vm 2008-08-21 16:00:50 UTC (rev 685) @@ -22,67 +22,61 @@ * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. - *# -/** + * + * @author Andrei,Florin + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + *#/** * This file is generated by equanda on $generationdate, do not modify */ package ${package}; -import java.util.Hashtable; +import org.equanda.tool.ddltool.DatabaseField; +import org.equanda.tool.ddltool.DatabaseMap; +import org.equanda.tool.ddltool.DatabaseRelation; import java.util.Collection; import java.util.ArrayList; /** - * Utility main class - * - * @author Andrei,Florin + * Database definition for use by ddltool */ public class EquandaMap - implements org.equanda.tool.ddltool.DatabaseMap + implements DatabaseMap { - - private Hashtable<String, Collection<String>> map = null; private Collection<String> tables = null; - private Collection<String[]> tablesForMultiple = null; // [0] -table name; [1] -field name; [2] -definition - private Collection<String[]> tablesForLinks = null; // [0] -table name; [1] -1st field name; [2] -second field name; [3] -true/false unique constraint - private Hashtable<String, Collection<String>> dbFields = null; + private Collection<DatabaseRelation> tablesForLinks = null; + private Collection<DatabaseField> fields = null; - public EquandaMap() {} - public void init() { /* Init table unique columns*/ - map = new Hashtable<String, Collection<String>>(); tables = new ArrayList<String>(); - tablesForMultiple = new ArrayList<String[]>(); - tablesForLinks = new ArrayList<String[]>(); - dbFields = new Hashtable<String, Collection<String>>(); - Collection<String> columns = null; - Collection<String> fields = null; + fields = new ArrayList<DatabaseField>(); #macro( getDefault $field ) + #set( $default = "" ) #if( $field.isInt() || $field.isDouble() || $field.isBoolean() ) - #set( $default=" DEFAULT 0 " ) + #set( $default=" 0 " ) #end #if( $field.isDefaultValue() ) - #if( $field.isString() ) #set( $default=" DEFAULT $field.DefaultValueForDDL " ) #end - #if( $field.isInt() ) #set( $default=" DEFAULT $field.DefaultValueForDDL " ) #end - #if( $field.isDouble() ) #set( $default=" DEFAULT $field.DefaultValueForDDL " ) #end + #if( $field.isString() ) #set( $default="$field.DefaultValueForDDL" ) #end + #if( $field.isInt() ) #set( $default="$field.DefaultValueForDDL" ) #end + #if( $field.isDouble() ) #set( $default="$field.DefaultValueForDDL" ) #end #if( $field.isBoolean() ) - #if( $field.Default=="true" || $field.Default=="TRUE" )#set( $default=" DEFAULT 1 " )#end + #if( $field.Default=="true" || $field.Default=="TRUE" )#set( $default="1" )#end #end #end + "$default" #end -#macro( getFieldDefinition $field ) - #if( $field.isString() ) #getDefault($field) #set( $fieldDef="VARCHAR($field.Length) $default" ) #end - #if( $field.isInt() ) #getDefault($field) #set( $fieldDef="INTEGER $default Not Null" ) #end - #if( $field.isDouble() ) #getDefault($field) #set( $fieldDef="DOUBLE PRECISION $default Not Null" ) #end - #if( $field.isBoolean() ) #getDefault($field) #set( $fieldDef="SMALLINT $default Not Null" ) #end - #if( $field.isDate() ) #set( $fieldDef="DATE" ) #end - #if( $field.isTimestamp() ) #set( $fieldDef="TIMESTAMP" ) #end - #if( $field.isBlob() ) #set( $fieldDef="BLOB SUB_TYPE 0" ) #end - #if( $field.isClob() ) #set( $fieldDef="BLOB SUB_TYPE 1" ) #end +#macro( getFieldType $field ) + #if( $field.isString() ) DatabaseField.STRING #end + #if( $field.isInt() ) DatabaseField.INT #end + #if( $field.isDouble() ) DatabaseField.DOUBLE #end + #if( $field.isBoolean() ) DatabaseField.BOOLEAN #end + #if( $field.isDate() ) DatabaseField.DATE #end + #if( $field.isTimestamp() ) DatabaseField.TIMESTAMP #end + #if( $field.isBlob() ) DatabaseField.BLOB #end + #if( $field.isClob() ) DatabaseField.CLOB #end #end #macro( getTableLinkNameMacro $linkField ) #if( $field.hasLinkName() ) "$dbtype.convertTable("L_${linkField.LinkName}")" @@ -91,68 +85,42 @@ #end##macro getTableLinkNameMacro #foreach( $table in $dm.RootTables ) - #set( $tableName = $dbtype.convertTable("T_${table.Name}") ) - columns = new ArrayList<String>(); - fields = new ArrayList<String>(); - columns.add( "EQUANDA_MODIFIED" ); - fields.add( "EQUANDA_VERSION INTEGER default 0 not null" ); - #foreach( $field in $table.Fields ) - #set( $fieldName = $dbtype.convertField("F_${field.Name}") ) - #if( $field.isUnique() || $field.isIndexed() ) - columns.add( "$fieldName" ); - #end - #if( !$field.isLink() && !$field.isMultiple() ) - #set( $fieldDef="" ) - #set( $default="" ) - #getFieldDefinition($field) - fields.add( "$fieldName $fieldDef" ); +#set( $tableName = $dbtype.getTableName( ${table.Name} ) ) + tables.add( "$tableName" ); + fields.add( new DatabaseField( "$tableName", "EQUANDA_MODIFIED", DatabaseField.TIMESTAMP, 0, "", "$dbtype.getIndexName( $table.Name, "EQUANDA_MODIFIED" )" ) ); + fields.add( new DatabaseField( "$tableName", "EQUANDA_VERSION", DatabaseField.INT, 0, "" ) ); +#foreach( $field in $table.Fields ) +#set( $fieldName = $dbtype.getFieldName( ${field.Name} ) ) + #if( $field.isMultiple() && !$field.isLink() ) + fields.add( new DatabaseField( "$tableName", "$fieldName", "$dbtype.getMultipleTableName( ${table.Name}, ${field.Name} )", #getFieldType( $field ), $field.Length, #getDefault($field) ) ); + #elseif( !$field.isLink() && !$field.isMultiple() ) + fields.add( new DatabaseField( "$tableName", "$fieldName", #getFieldType( $field ), $field.Length, #getDefault($field) #if( $field.isUnique() || $field.isIndexed() ), "$dbtype.getIndexName( $table.Name, $field.Name )"#end ) ); #elseif( $field.isUseRelationField() ) - fields.add( "$dbtype.convertField("F_${field.Name}_UOID") $dbtype.convertTable("T_${field.LinkTable.Name}")" ); +#set( $fieldName = $dbtype.getLinkFieldName( ${field.Name} ) ) + fields.add( new DatabaseField( "$tableName", "$fieldName", "$dbtype.getTableName( ${field.LinkTableName} )" ) ); #end - #end - map.put( "$tableName", columns ); - dbFields.put( "$tableName", fields ); -#end ## tables foreach +#end ## foreach field +#end ## foreach table - /* Init tables for multiple fields */ -#foreach( $table in $dm.RootTables ) - #foreach( $field in $table.MultipleNotLinkFields ) - #set( $fieldDef="" ) - #set( $default="" ) - #getFieldDefinition($field) - tablesForMultiple.add(new String[]{ "$dbtype.convertTable("M_${table.Name}_${field.Name}")", "$dbtype.convertField("F_${field.Name}")", "$fieldDef" }); - #set( $tableName = $dbtype.convertTable("T_${table.Name}") ) - tables.add( "$tableName" ); - #end -#end - /* Init tables for link fields */ + /* Init tables for link fields */ + tablesForLinks = new ArrayList<DatabaseRelation>(); #foreach( $table in $dm.RootTables ) #foreach( $field in $table.LinkFields ) #if( ${field.isUseRelationTable()} ) #if( ${field.isBidirectional()} ) - tablesForLinks.add( new String[]{ #getTableLinkNameMacro( ${field} ), "$dbtype.convertField("F_${field.Name}_UOID")", "$dbtype.convertTable("T_${table.Name}")", "$dbtype.convertField("F_${field.LinkField.Name}_UOID")", "$dbtype.convertTable("T_${field.LinkField.Table}")", "false"} ); + tablesForLinks.add( new DatabaseRelation( #getTableLinkNameMacro( $field ), "$dbtype.getTableName( $table.Name )", "$dbtype.getLinkFieldName( ${field.Name} )", "$dbtype.getTableName( ${field.LinkTableName} )", "$dbtype.getLinkFieldName( ${field.LinkField.Name} )", false ) ); #else - tablesForLinks.add( new String[]{ #getTableLinkNameMacro( ${field} ), "$dbtype.convertField("${table.Name}_UOID")", "$dbtype.convertTable("T_${table.Name}")", "$dbtype.convertField("F_${field.Name}_UOID")", "$dbtype.convertTable("T_${field.LinkTable.Name}")", "true"} ); + tablesForLinks.add( new DatabaseRelation( #getTableLinkNameMacro( $field ), "$dbtype.getTableName( $table.Name )", "$dbtype.convertField("${table.Name}_UOID")", "$dbtype.getTableName( ${field.LinkTableName} )", "$dbtype.getLinkFieldName( ${field.Name} )", true ) ); #end #end #end #end - - /* Init tables */ -#foreach( $table in $dm.RootTables ) - #set( $tableName = $dbtype.convertTable("T_${table.Name}") ) - tables.add( "$tableName" ); -#end } - public Hashtable<String, Collection<String>> getIndexedFields() { return map; } - public Collection<String> getTables() { return tables; } - public Collection<String[]> getTablesForMultiples() { return tablesForMultiple; } - - public Collection<String[]> getTablesForLinks() { return tablesForLinks; } + public Collection<DatabaseRelation> getRelationTables() { return tablesForLinks; } - public Hashtable<String, Collection<String>> getDbFields() { return dbFields; } + public Collection<DatabaseField> getFields() { return fields; } } Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMFieldBean.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/DMFieldBean.java.vm 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-generate/src/main/velocity/ejb3/DMFieldBean.java.vm 2008-08-21 16:00:50 UTC (rev 685) @@ -75,7 +75,7 @@ } @Column( - name = "$dbtype.convertField("F_${field.Name}")" + name = "$dbtype.getFieldName( ${field.Name} )" #if( $field.isString() ), columnDefinition = "VARCHAR($field.Length)"#end #if( $field.isInt() ), columnDefinition = "INTEGER default 0 not null"#end #if( $field.isDouble() ), columnDefinition = "DOUBLE PRECISION default 0 not null"#end Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm 2008-08-21 16:00:50 UTC (rev 685) @@ -58,7 +58,7 @@ #if( !$multipleBatch ) #set( $multipleBatch=$batchSize ) #end @Entity @BatchSize( size = $batchSize ) -@Table( name = "$dbtype.convertTable("T_$table.Name")" ) +@Table( name = "$dbtype.getTableName( $table.Name )" ) @Cache( usage=CacheConcurrencyStrategy.TRANSACTIONAL ) public class DM${table.Name}Bean implements EquandaEntity, java.io.Serializable @@ -285,17 +285,17 @@ #if( ${joinField.isUseRelationTable()} && ${joinField.LinkField} ) @JoinTable( name=#getTableLinkNameMacro( ${joinField} ), - joinColumns = { @JoinColumn( name="$dbtype.convertField("F_${joinField.Name}_UOID")", columnDefinition = "CHAR(14)" ) }, - inverseJoinColumns = { @JoinColumn( name="$dbtype.convertField("F_${joinField.LinkField.Name}_UOID")", columnDefinition = "CHAR(14)" ) } + joinColumns = { @JoinColumn( name="$dbtype.getLinkFieldName( ${joinField.Name} )", columnDefinition = "CHAR(14)" ) }, + inverseJoinColumns = { @JoinColumn( name="$dbtype.getLinkFieldName( ${joinField.LinkField.Name} )", columnDefinition = "CHAR(14)" ) } ) #elseif( ${joinField.isMultiple()} ) @JoinTable( - name=#getTableLinkNameMacro( ${joinField} ), uniqueConstraints=@UniqueConstraint(columnNames={"$dbtype.convertField("${table.Name}_UOID")", "$dbtype.convertField("F_${joinField.Name}_UOID")"}), + name=#getTableLinkNameMacro( ${joinField} ), uniqueConstraints=@UniqueConstraint(columnNames={"$dbtype.convertField("${table.Name}_UOID")", "$dbtype.getLinkFieldName( ${joinField.Name} )"}), joinColumns = { @JoinColumn( name="$dbtype.convertField("${table.Name}_UOID")", columnDefinition = "CHAR(14)" ) }, - inverseJoinColumns = { @JoinColumn( name="$dbtype.convertField("F_${joinField.Name}_UOID")", columnDefinition = "CHAR(14)" ) } + inverseJoinColumns = { @JoinColumn( name="$dbtype.getLinkFieldName( ${joinField.Name} )", columnDefinition = "CHAR(14)" ) } ) #else## joinColumn - @JoinColumns( { @JoinColumn( name="$dbtype.convertField("F_${field.Name}_UOID")", columnDefinition = "CHAR(14)" ) } ) + @JoinColumns( { @JoinColumn( name="$dbtype.getLinkFieldName( ${field.Name} )", columnDefinition = "CHAR(14)" ) } ) #end##isUseRelationTable #end##!isBidir || owner #end## macro buildJoinMacro @@ -335,9 +335,9 @@ #buildJoinMacro( ${field} ) #elseif ($field.isBlob() || $field.isClob()) @Lob @Basic(fetch = FetchType.EAGER) - @Column( name = "$dbtype.convertField("F_${field.Name}")") + @Column( name = "$dbtype.getFieldName( ${field.Name} )") #else##is not link nor multiple - @Column( name = "$dbtype.convertField("F_${field.Name}")" + @Column( name = "$dbtype.getFieldName( ${field.Name} )" #if( $field.isString() ), columnDefinition = "VARCHAR($field.Length)"#end #if( $field.isInt() ), columnDefinition = "INTEGER default 0 not null"#end #if( $field.isDouble() ), columnDefinition = "DOUBLE PRECISION default 0 not null"#end Added: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java (rev 0) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java 2008-08-21 16:00:50 UTC (rev 685) @@ -0,0 +1,59 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.tool.ddltool; + +/** + * Handling of database dialects. + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public interface DatabaseDialect +{ + String getFieldDefinition( DatabaseField field ); + + String getAddColumnQuery( DatabaseField field ); + + String getDropColumnQuery( DatabaseField field ); + + String getDropColumnQuery( String table, String field ); + + String getCreateIndexQuery( DatabaseField field ); + + String getDropIndexQuery( DatabaseField field ); + + String getDropIndexQuery( String index ); + + String getCreateTableQuery( String table ); + + String getCreateTableQuery( DatabaseField field ); + + String getCreateTableQuery( DatabaseRelation relation ); + + String getDropTableQuery( String table ); + + String getUpdateFieldLengthQuery( DatabaseField field ); + + String getUpdateDefaultQuery( DatabaseField field ); +} Added: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseField.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseField.java (rev 0) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseField.java 2008-08-21 16:00:50 UTC (rev 685) @@ -0,0 +1,226 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.tool.ddltool; + +/** + * Representation of a field in the database. + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public class DatabaseField +{ + public static final int FIXEDSTRING = 1; + public static final int STRING = 2; + public static final int INT = 3; + public static final int DOUBLE = 4; + public static final int BOOLEAN = 5; + public static final int DATE = 6; + public static final int TIMESTAMP = 7; + public static final int BLOB = 8; + public static final int CLOB = 9; + public static final int LINK = 10; + + private String table; + private String name; + private int type; + private int length; + private String defaultValue = ""; + private String indexName; + private String linkedTable; + private String multipleTable; + + /** + * Field definition for a link field + * + * @param table table this field is part of + * @param name field name (db level) + * @param linkedTable linked table name (db level) + */ + public DatabaseField( String table, String name, String linkedTable ) + { + this.table = table; + this.name = name; + this.type = LINK; + this.linkedTable = linkedTable; + } + + /** + * Field definition for a normal (non-indexed) field + * + * @param table table this field is part of + * @param name field name (db level) + * @param type field type + * @param length field length + * @param def default value + */ + public DatabaseField( String table, String name, int type, int length, String def ) + { + this.table = table; + this.name = name; + this.type = type; + this.length = length; + this.defaultValue = def; + } + + /** + * Field definition for a normal, indexed field + * + * @param table table this field is part of + * @param name field name (db level) + * @param type field type + * @param length field length + * @param def default value + * @param indexName name for the index + */ + public DatabaseField( String table, String name, int type, int length, String def, String indexName ) + { + this.table = table; + this.name = name; + this.type = type; + this.length = length; + this.defaultValue = def; + this.indexName = indexName; + } + + /** + * Field definition for a multiple, not link field + * + * @param table table this field is part of + * @param name field name (db level) + * @param mtable table for multiple field, db level name + * @param type field type + * @param length field length + * @param def default value + */ + public DatabaseField( String table, String name, String mtable, int type, int length, String def ) + { + this.table = table; + this.name = name; + this.multipleTable = mtable; + this.type = type; + this.length = length; + this.defaultValue = def; + } + + public String getTable() + { + return table; + } + + public String getName() + { + return name; + } + + public int getType() + { + return type; + } + + public int getLength() + { + return length; + } + + public String getDefaultValue() + { + return defaultValue; + } + + public boolean isIndexed() + { + return null != indexName; + } + + public String getIndexName() + { + return indexName; + } + + public String getLinkedTable() + { + return linkedTable; + } + + public String getMultipleTable() + { + return multipleTable; + } + + public boolean isFixedString() + { + return FIXEDSTRING == type; + } + + public boolean isString() + { + return STRING == type; + } + + public boolean isInt() + { + return INT == type; + } + + public boolean isDouble() + { + return DOUBLE == type; + } + + public boolean isBoolean() + { + return BOOLEAN == type; + } + + public boolean isDate() + { + return DATE == type; + } + + public boolean isTimestamp() + { + return TIMESTAMP == type; + } + + public boolean isBlob() + { + return BLOB == type; + } + + public boolean isClob() + { + return CLOB == type; + } + + public boolean isLink() + { + return LINK == type; + } + + public boolean isMultiple() + { + return null != multipleTable; + } +} Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseMap.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseMap.java 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseMap.java 2008-08-21 16:00:50 UTC (rev 685) @@ -25,10 +25,9 @@ package org.equanda.tool.ddltool; import java.util.Collection; -import java.util.Hashtable; /** - * Utility main class + * Representation of database definition * * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> */ @@ -36,15 +35,9 @@ { public void init(); - /* Return unique columns for each table */ - public Hashtable<String, Collection<String>> getIndexedFields(); - - /* Return all tables */ public Collection<String> getTables(); - public Collection<String[]> getTablesForMultiples(); + public Collection<DatabaseRelation> getRelationTables(); - public Collection<String[]> getTablesForLinks(); - - public Hashtable<String, Collection<String>> getDbFields(); + public Collection<DatabaseField> getFields(); } Added: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseRelation.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseRelation.java (rev 0) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseRelation.java 2008-08-21 16:00:50 UTC (rev 685) @@ -0,0 +1,80 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.tool.ddltool; + +/** + * Representation of a relation table in the database. + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public class DatabaseRelation +{ + private String tableName; + private String firstTable; + private String firstField; + private String secondTable; + private String secondField; + private boolean isUnique; + + public DatabaseRelation( String table, String table1, String field1, String table2, String field2, boolean unique ) + { + this.tableName = table; + this.firstTable = table1; + this.firstField = field1; + this.secondTable = table2; + this.secondField = field2; + this.isUnique = unique; + } + + public String getTableName() + { + return tableName; + } + + public String getFirstField() + { + return firstField; + } + + public String getSecondField() + { + return secondField; + } + + public boolean isUnique() + { + return isUnique; + } + + public String getFirstTable() + { + return firstTable; + } + + public String getSecondTable() + { + return secondTable; + } +} Added: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/FirebirdDialect.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/FirebirdDialect.java (rev 0) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/FirebirdDialect.java 2008-08-21 16:00:50 UTC (rev 685) @@ -0,0 +1,249 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.tool.ddltool; + +/** + * Database dialect for firebird. + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public class FirebirdDialect + implements DatabaseDialect +{ + public String getFieldDefinition( DatabaseField field ) + { + StringBuilder query = new StringBuilder(); + query.append( field.getName() ); + switch ( field.getType() ) + { + case DatabaseField.FIXEDSTRING: + query.append( " CHAR(" ); + query.append( field.getLength() ); + query.append( ") " ); + break; + case DatabaseField.STRING: + query.append( " VARCHAR(" ); + query.append( field.getLength() ); + query.append( ") " ); + break; + case DatabaseField.INT: + query.append( " INTEGER " ); + break; + case DatabaseField.DOUBLE: + query.append( " DOUBLE PRECISION " ); + break; + case DatabaseField.BOOLEAN: + query.append( " SMALLINT " ); + break; + case DatabaseField.DATE: + query.append( " DATE " ); + break; + case DatabaseField.TIMESTAMP: + query.append( " TIMESTAMP " ); + break; + case DatabaseField.BLOB: + query.append( " BLOB SUB_TYPE 0 " ); + break; + case DatabaseField.CLOB: + query.append( " BLOB SUB_TYPE 1 " ); + break; + case DatabaseField.LINK: + query.append( " CHAR(14) " ); + break; + } + if ( !"".equals( field.getDefaultValue() ) ) + { + query.append( "DEFAULT " ); + query.append( field.getDefaultValue() ); + } + if ( field.isInt() || field.isDouble() || field.isBoolean() ) query.append( " NOT NULL" ); + query.append( " " ); + return query.toString(); + } + + public String getCreateIndexQuery( DatabaseField field ) + { + String column = field.getName(); + StringBuilder sb = new StringBuilder(); + sb.append( "CREATE INDEX " ); + sb.append( field.getIndexName() ); + sb.append( " ON " ); + sb.append( field.getTable() ); + sb.append( '(' ); + sb.append( column ); + sb.append( ')' ); + return sb.toString(); + } + + public String getAddColumnQuery( DatabaseField field ) + { + StringBuilder query = new StringBuilder(); + query.append( "ALTER TABLE " ); + query.append( field.getTable() ); + query.append( " ADD " ); + query.append( getFieldDefinition( field ) ); + if ( field.isLink() ) + { + query.append( " REFERENCES " ); + query.append( field.getLinkedTable() ); + query.append( " (EQUANDA_UOID) ON DELETE SET NULL ON UPDATE CASCADE" ); + } + return query.toString(); + } + + public String getDropColumnQuery( DatabaseField field ) + { + StringBuilder query = new StringBuilder(); + query.append( "ALTER TABLE " ); + query.append( field.getTable() ); + query.append( " DROP " ); + query.append( field.getName() ); + return query.toString(); + } + + public String getDropColumnQuery( String table, String field ) + { + StringBuilder query = new StringBuilder(); + query.append( "ALTER TABLE " ); + query.append( table ); + query.append( " DROP " ); + query.append( field ); + return query.toString(); + } + + public String getDropIndexQuery( DatabaseField field ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "DROP INDEX " ); + sb.append( field.getIndexName() ); + return sb.toString(); + } + + public String getDropIndexQuery( String index ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "DROP INDEX " ); + sb.append( index ); + return sb.toString(); + } + + public String getCreateTableQuery( String table ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "CREATE TABLE " ); + sb.append( table ); + sb.append( "(" + + " EQUANDA_UOID Char(14) NOT NULL,\n" + + " EQUANDA_TYPE Char(4),\n" + + " EQUANDA_MODIFIED Timestamp,\n" + + " EQUANDA_VERSION Integer default 0 NOT NULL,\n" + + " EQUANDA_STATUS Char(1),\n" + + " EQUANDA_CREATION Timestamp,\n" + + " PRIMARY KEY (EQUANDA_UOID)\n" + + ")" ); + return sb.toString(); + } + + public String getCreateTableQuery( DatabaseRelation relation ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "CREATE TABLE " ); + sb.append( relation.getTableName() ); + sb.append( "(\n" ); + sb.append( relation.getFirstField() ); + sb.append( " Char(14) not null REFERENCES " ); + sb.append( relation.getFirstTable() ); + sb.append( " (EQUANDA_UOID) ON DELETE CASCADE ON UPDATE CASCADE, \n" ); + sb.append( relation.getSecondField() ); + sb.append( " Char(14) not null REFERENCES " ); + sb.append( relation.getSecondTable() ); + sb.append( " (EQUANDA_UOID) ON DELETE CASCADE ON UPDATE CASCADE \n" ); + if ( relation.isUnique() ) + { + sb.append( ", UNIQUE (" ); + sb.append( relation.getFirstField() ); + sb.append( "," ); + sb.append( relation.getSecondField() ); + sb.append( ")" ); + } + sb.append( ")" ); + return sb.toString(); + } + + public String getCreateTableQuery( DatabaseField field ) + { + if ( !field.isMultiple() ) return ""; + StringBuilder sb = new StringBuilder(); + sb.append( "CREATE TABLE " ); + sb.append( field.getMultipleTable() ); + sb.append( "( EQUANDA_UOID Char(14) NOT NULL,\n" ); + sb.append( getFieldDefinition( field ) ); + sb.append( ",\n EQUANDA_CREATION Timestamp,\n" + + " EQUANDA_PARENT_UOID Char(14) REFERENCES " ); + sb.append( field.getTable() ); + sb.append( " (EQUANDA_UOID) ON DELETE CASCADE ON UPDATE CASCADE,\n" + + " PRIMARY KEY (EQUANDA_UOID)\n" + + ")" ); + return sb.toString(); + } + + public String getDropTableQuery( String table ) + { + StringBuilder sb = new StringBuilder(); + sb.append( "DROP TABLE " ); + sb.append( table ); + return sb.toString(); + } + + public String getUpdateFieldLengthQuery( DatabaseField field ) + { + if ( !field.isString() || field.getLength() == 0 ) return null; + StringBuffer sb = new StringBuffer(); + sb.append( "ALTER TABLE " ); + sb.append( field.getTable() ); + sb.append( " ALTER COLUMN " ); + sb.append( field.getName() ); + sb.append( " TYPE VARCHAR (" ); + sb.append( field.getLength() ); + sb.append( ")" ); + return sb.toString(); + } + + public String getUpdateDefaultQuery( DatabaseField field ) + { + if ( "".equals( field.getDefaultValue() ) ) return null; + StringBuffer sb = new StringBuffer(); + sb.append( "UPDATE " ); + sb.append( field.getTable() ); + sb.append( " SET " ); + sb.append( field.getName() ); + sb.append( " = " ); + sb.append( field.getDefaultValue() ); + sb.append( " WHERE " ); + sb.append( field.getName() ); + sb.append( " IS NULL" ); + return sb.toString(); + } +} Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/JdbcManager.java =================================================================== --- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/JdbcManager.java 2008-08-21 12:51:27 UTC (rev 684) +++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/JdbcManager.java 2008-08-21 16:00:50 UTC (rev 685) @@ -24,17 +24,17 @@ package org.equanda.tool.ddltool; +import org.apache.log4j.Logger; +import org.equanda.util.SaveException; + import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.sql.*; import java.util.*; -import org.apache.log4j.Logger; -import org.equanda.util.SaveException; -import org.equanda.util.StringUtil; /** - * Manages the Firebird database. + * Manages the jdbc interactions for the ddltool * * @author NetRom team * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> @@ -46,6 +46,8 @@ private Logger log = Logger.getLogger( this.getClass() ); private Connection connection; private Exception oops; + private DatabaseDialect dialect; + private Map<String, Set<String>> dbMap; public JdbcManager( String location, String clazz, String user, String password ) { @@ -67,6 +69,8 @@ properties.put( "password", password ); connection = driver.connect( location, properties ); connection.setAutoCommit( true ); + + dialect = new FirebirdDialect(); } catch ( Exception e ) { @@ -106,29 +110,12 @@ return col; } - private boolean addColumn( String tableName, String columnDefinition ) + private boolean addColumn( DatabaseField field ) { boolean result = true; - String query = null; + String query = dialect.getAddColumnQuery( field ); try { - String fieldName = columnDefinition.substring( 0, columnDefinition.indexOf( " " ) ).toUpperCase(); - boolean isLink = fieldName.endsWith( "_UOID" ); - if ( isLink ) - { - String linkTableName = columnDefinition.substring( columnDefinition.indexOf( " " ) + 1 ).toUpperCase(); - query = "ALTER TABLE " + tableName + " ADD " + fieldName + " Char(14)"; - executeQuery( query ); - // could not find a way to build - String fk = "FK_" + getShortTableName( tableName ) + '_' + fieldName; - if ( fk.length() > 27 ) fk = fk.substring( 0, 27 ); - query = "ALTER TABLE " + tableName + " ADD CONSTRAINT " + fk + - " FOREIGN KEY (" + fieldName + ") REFERENCES " + linkTableName + " (EQUANDA_UOID)"; - } - else - { - query = "ALTER TABLE " + tableName + " ADD " + columnDefinition; - } executeQuery( query ); } catch ( SQLException e ) @@ -141,14 +128,12 @@ return result; } - private boolean createIndex( String tableName, String columnName ) + private boolean createIndex( DatabaseField field ) { boolean result = true; try { - String query = "CREATE INDEX " + getIndexName( tableName, columnName ) + " ON " + - tableName + '(' + columnName + ')'; - executeQuery( query ); + executeQuery( dialect.getCreateIndexQuery( field ) ); } catch ( SQLException e ) { @@ -160,77 +145,12 @@ return result; } - private Map<String, String> tabletoShort = new HashMap<String, String>(); - private Map<String, String> shortToTable = new HashMap<String, String>(); - - private String getShortTableName( String tableName ) + private boolean dropIndex( String index ) { - String res = tabletoShort.get( tableName ); - if ( res == null ) - { - StringBuffer camel = new StringBuffer(); - - if ( tableName.startsWith( "T_" ) ) tableName = tableName.substring( 2 ); - - for ( int i = 0; i < tableName.length() ; i++ ) - { - if ( Character.isUpperCase( tableName.charAt( i ) ) ) - { - camel.append( tableName.charAt( i ) ); - } - } - if ( camel.length() > 1 ) - { - res = camel.toString(); - } - else - { - if ( tableName.length() <= 5 ) - { - res = tableName; - } - else - { - res = tableName.substring( 0, 5 ); - } - } - int count = 1; - String base = res; - while ( shortToTable.containsKey( res ) ) {res = base + ( count++ );} - tabletoShort.put( tableName, res ); - shortToTable.put( res, tableName ); - } - return res; - } - - private String getSimplifiedFieldName( String name ) - { - return StringUtil.replace( name, "EQUANDA_", "EQ_" ); - } - - private String getIndexName( String tableName, String columnName ) - { - StringBuffer name = new StringBuffer( "I_" ); - if ( tableName.length() < 5 ) - { - name.append( tableName ); - } - else - { - name.append( getShortTableName( tableName ) ); - } - name.append( '_' ); - name.append( getSimplifiedFieldName( columnName ) ); - if ( name.length() > 27 ) name.setLength( 27 ); - return validateIndexName( name.toString(), tableName ); - } - - private boolean dropIndex( String indexName ) - { boolean result = true; try { - String query = "DROP INDEX " + indexName; + String query = dialect.getDropIndexQuery( index ); executeQuery( query ); } catch ( SQLException e ) @@ -248,7 +168,7 @@ boolean result = true; try { - String query = "DROP TABLE " + table; + String query = dialect.getDropTableQuery( table ); executeQuery( query ); } catch ( SQLException e ) @@ -266,10 +186,7 @@ boolean result = true; try { - String index = getIndexName( table, field ); - if ( !isIndexAvailable( index, table ) ) dropIndex( index ); - String query = "ALTER TABLE " + table + " DROP " + field; - executeQuery( query ); + executeQuery( dialect.getDropColumnQuery( table, field ) ); } catch ( SQLException e ) { @@ -320,42 +237,6 @@ return col; } - private String validateIndexName( String indexName, String tableName ) - { - if ( isIndexAvailable( indexName, tableName ) ) return indexName; - StringBuffer sb = new StringBuffer(); - for ( int i = 1; true ; i++ ) - { - sb.setLength( 0 ); - sb.append( indexName ); - sb.append( '_' ); - sb.append( Integer.toString( i ) ); - if ( isIndexAvailable( sb.toString(), tableName ) ) return sb.toString(); - } - } - - private boolean isIndexAvailable( String indexName, String tableName ) - { - try - { - ResultSet rs = connection.getMetaData().getIndexInfo( null, null, tableName, false, false ); - while ( rs.next() ) - { - String tmp = rs.getString( "INDEX_NAME" ); - if ( tmp.equalsIgnoreCase( indexName ) ) - { - return false; - } - } - } - catch ( SQLException e ) - { - SaveException.saveException( e ); - log.error( e, e ); - } - return true; - } - public void restoreIndexes( DatabaseMap map, boolean delete ) { /* remove all indexes from all tables */ @@ -378,110 +259,22 @@ } /* recreate indexes from map */ - Hashtable<String, Collection<String>> dbMap = map.getIndexedFields(); - for ( String tableName : dbMap.keySet() ) + for ( DatabaseField field : map.getFields() ) { - for ( String colName : dbMap.get( tableName ) ) + if ( field.isIndexed() ) { - if ( !createIndex( tableName, colName ) ) + if ( createIndex( field ) ) { - log.error( "On table " + tableName + " index not created!" ); + log.info( "On table " + field.getTable() + " index created." ); } else { - log.info( "On table " + tableName + " index created." ); + log.error( "On table " + field.getTable() + " index not created!" ); } } } } - private boolean addPrimaryKey( String table ) - { - boolean res = true; - try - { - StringBuffer fields = new StringBuffer(); - String sep = ""; - ResultSet rs = connection.getMetaData().getColumns( null, null, table, null ); - boolean cont = true; - while ( rs.next() && cont ) - { - String columnName = rs.getString( "COLUMN_NAME" ); - if ( columnName.equals( "EQUANDA_UOID" ) ) - { - fields.setLength( 0 ); - fields.append( "EQUANDA_UOID" ); - cont = false; - } - else - { - fields.append( sep ); - fields.append( columnName ); - sep = ", "; - } - } - StringBuffer query = new StringBuffer(); - query.append( "ALTER TABLE " ); - query.append( table ); - query.append( " ADD CONSTRAINT PK_" ); - table = table.substring( 2 ); - if ( table.length() > 27 ) - { - table = table.substring( 0, 27 ); - } - query.append( table ); - query.append( " PRIMARY KEY (" ); - query.append( fields.toString() ); - query.append( ')' ); - executeQuery( query.toString() ); - } - catch ( SQLException e ) - { - SaveException.saveException( e ); - log.error( e, e ); - res = false; - } - return res; - } - - private ResultSet getPrimaryKeys( String table ) - { - try - { - return connection.getMetaData().getPrimaryKeys( null, null, table ); - } - catch ( SQLException e ) - { - SaveException.saveException( e ); - log.error( e, e ); - return null; - } - } - - public void checkPrimaryKeys() - { - Collection<String> col = getTables(); - for ( String table : col ) - { - ResultSet rs = getPrimaryKeys( table ); - boolean hasPK = false; - try - { - hasPK = rs.next(); - } - catch ( SQLException e ) - { - SaveException.saveException( e ); - log.error( e, e ); - } - if ( !hasPK ) - { - this.addPrimaryKey( table ); - log.info( "Primary key created for " + table ); - } - } - } - public void createTables( DatabaseMap map ) { // update main tables @@ -492,17 +285,7 @@ ResultSet rs = connection.getMetaData().getTables( null, null, tableName.toUpperCase(), null ); if ( !rs.next() ) { - String query = "CREATE TABLE " + tableName.toUpperCase() + - "(" + - " EQUANDA_UOID Char(14) NOT NULL,\n" + - " EQUANDA_TYPE Char(4),\n" + - " EQUANDA_MODIFIED Timestamp,\n" + - " EQUANDA_VERSION Integer default 0 NOT NULL,\n" + - " EQUANDA_STATUS Char(1),\n" + - " EQUANDA_CREATION Timestamp,\n" + - " PRIMARY KEY (EQUANDA_UOID)\n" + - ")"; - executeQuery( query ); + executeQuery( dialect.getCreateTableQuery( tableName ) ); } } catch ( SQLException e ) @@ -513,84 +296,35 @@ } } // update multiple tables - for ( String[] tableInfo : map.getTablesForMultiples() ) + for ( DatabaseField field : map.getFields() ) { - try + if ( field.isMultiple() ) { - String table = tableInfo[ 0 ]; - String upTable = table.toUpperCase(); - String field = tableInfo[ 1 ]; - String fieldDef = tableInfo[ 2 ]; - ResultSet rs = connection.getMetaData().getTables( null, null, upTable, null ); - if ( !rs.next() ) + try { - String query = "CREATE TABLE " + upTable + - "(\n" + - " EQUANDA_UOID Char(14) NOT NULL, \n" + - field.toUpperCase() + " " + fieldDef + ",\n" + - " EQUANDA_CREATION Timestamp,\n" + - " EQUANDA_PARENT_UOID Char(14),\n" + - " PRIMARY KEY (EQUANDA_UOID)\n" + - ")"; - executeQuery( query ); - String fk = "FK_" + getShortTableName( table ) + "_PARENT"; - if ( fk.length() > 27 ) fk = fk.substring( 0, 27 ); - String parentTable = "T_" + table.substring( 2, table.indexOf( "_", 3 ) ).toUpperCase(); - query = "ALTER TABLE " + table + " ADD CONSTRAINT " + fk + - " FOREIGN KEY (EQUANDA_PARENT_UOID) REFERENCES " + parentTable + " (EQUANDA_UOID)"; - executeQuery( query ); + ResultSet rs = connection.getMetaData().getTables( null, null, field.getMultipleTable(), null ); + if ( !rs.next() ) + { + executeQuery( dialect.getCreateTableQuery( field ) ); + } } + catch ( SQLException e ) + { + oops = e; + SaveException.saveException( e ); + log.error( e, e ); + } } - catch ( SQLException e ) - { - oops = e; - SaveException.saveException( e ); - log.error( e, e ); - } } // update link tables - for ( String[] tableInfo : map.getTablesForLinks() ) + for ( Da... [truncated message content] |
From: <tri...@us...> - 2008-08-22 08:41:38
|
Revision: 687 http://equanda.svn.sourceforge.net/equanda/?rev=687&view=rev Author: triathlon98 Date: 2008-08-22 08:41:33 +0000 (Fri, 22 Aug 2008) Log Message: ----------- EQ-221 fix functions names in jspager.js Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkOne.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.tml.vm trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/JSPagedLoop.tml trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/jspager.js Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.tml.vm 2008-08-21 17:36:54 UTC (rev 686) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.tml.vm 2008-08-22 08:41:33 UTC (rev 687) @@ -9,8 +9,8 @@ </t:parameter> <div class="equandaInlineLinkListRowLabel"> - <a href="javascript:;" id="equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}" onclick="markRowDeleted( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}' )" title="Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/delete.png}" alt="${dollar}{equanda-message:Delete}" /></a> - <a href="javascript:;" id="equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}" onclick="revertDeletedRow( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}' )" style="display: none;" title="Undo Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/undo_delete.gif}" alt="${dollar}{equanda-message:UndoDelete}" /></a> + <a href="javascript:;" id="equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}" onclick="equandaMarkRowDeleted( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}' )" title="Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/delete.png}" alt="${dollar}{equanda-message:Delete}" /></a> + <a href="javascript:;" id="equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}" onclick="equandaRevertDeletedRow( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}' )" style="display: none;" title="Undo Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/undo_delete.gif}" alt="${dollar}{equanda-message:UndoDelete}" /></a> </div> <div class="equandaInlineLinkListRowData equanda-edit-row-${dollar}{clientId}-${dollar}{index}"> <t:if t:test="current"><t:${table.VarName}.Edit value="current" showMetadata="prop:false" editIndex="index" selectComponentId="prop:clientId"/></t:if> Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkOne.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkOne.tml.vm 2008-08-21 17:36:54 UTC (rev 686) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkOne.tml.vm 2008-08-22 08:41:33 UTC (rev 687) @@ -3,11 +3,11 @@ <div class="equandaInlineLinkList"> <div class="equandaInlineLinkListRow"> <div class="equandaInlineLinkListRowLabel"> - <t:equanda.formactionlink t:id="Delete" context="prop:selectParameters" class="equandalinkOpacity"><img src="${dollar}{asset:classpath:org/equanda/t5gui/delete.png}"/></t:equanda.formactionlink> - <t:equanda.formactionlink t:id="Select" context="prop:selectParameters">${dollar}{equanda-message:Select}</t:equanda.formactionlink> + <a href="javascript:;" id="equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}" onclick="equandaMarkRowDeleted( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}' )" title="Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/delete.png}" alt="${dollar}{equanda-message:Delete}" /></a> + <a href="javascript:;" id="equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}" onclick="equandaRevertDeletedRow( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}' )" style="display: none;" title="Undo Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/undo_delete.gif}" alt="${dollar}{equanda-message:UndoDelete}" /></a> </div> - <div class="equandaInlineLinkListRowData"> - <t:if test="hasValue()"><t:${table.VarName}.Edit value="value" t:editIndex="prop:editIndex" t:selectComponentId="prop:selectComponentId" t:showMetadata="prop:false"/></t:if> + <div class="equandaInlineLinkListRowData equanda-edit-row-${dollar}{clientId}-0"> + <t:${table.VarName}.Edit value="value" t:editIndex="prop:editIndex" t:selectComponentId="prop:selectComponentId" t:showMetadata="prop:false"/> </div> </div> </div> Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.tml.vm 2008-08-21 17:36:54 UTC (rev 686) +++ trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.tml.vm 2008-08-22 08:41:33 UTC (rev 687) @@ -8,8 +8,8 @@ <t:equanda.formactionlink t:id="Add">${dollar}{equanda-message:Add}</t:equanda.formactionlink> </t:parameter> <div class="equandaInlinePrimitiveListRowLabel"> - <a href="javascript:;" id="equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}" onclick="markRowDeleted( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}' )" title="Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/delete.png}" alt="${dollar}{equanda-message:Delete}" /></a> - <a href="javascript:;" id="equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}" onclick="revertDeletedRow( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}' )" style="display: none;" title="Undo Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/undo_delete.gif}" alt="${dollar}{equanda-message:UndoDelete}" /></a> + <a href="javascript:;" id="equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}" onclick="equandaMarkRowDeleted( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}' )" title="Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/delete.png}" alt="${dollar}{equanda-message:Delete}" /></a> + <a href="javascript:;" id="equanda-revert-anchor-${dollar}{clientId}-${dollar}{index}" onclick="equandaRevertDeletedRow( this, '${dollar}{deletedHiddenId}', ${dollar}{index}, 'equanda-edit-row-${dollar}{clientId}-${dollar}{index}', 'equanda-delete-anchor-${dollar}{clientId}-${dollar}{index}' )" style="display: none;" title="Undo Delete"><img src="${dollar}{asset:classpath:org/equanda/t5gui/undo_delete.gif}" alt="${dollar}{equanda-message:UndoDelete}" /></a> </div> <div class="equandaInlinePrimitiveListRowData equanda-edit-row-${dollar}{clientId}-${dollar}{index}"> <t:if t:test="dateType"> Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java =================================================================== --- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java 2008-08-21 17:36:54 UTC (rev 686) +++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java 2008-08-22 08:41:33 UTC (rev 687) @@ -106,8 +106,8 @@ object.put( "addBlockClass", "jspagedloop_addblock_" + clientId ); object.put( "name", clientId ); renderSupport.addScript( "JSPagerConfigs.%s = %s;", clientId, object ); - renderSupport.addScript( "eqShowPage( %s, JSPagerConfigs.%s );", pagedLoop.getCurrentPage(), clientId ); - renderSupport.addScript( "checkAddLinks( JSPagerConfigs.%s );", clientId ); + renderSupport.addScript( "equandaShowPage( %s, JSPagerConfigs.%s );", pagedLoop.getCurrentPage(), clientId ); + renderSupport.addScript( "equandaCheckAddLinks( JSPagerConfigs.%s );", clientId ); // logger.info( String.format( "Config Object. %s = %s ", clientId, object ) ); } } Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/JSPagedLoop.tml =================================================================== --- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/JSPagedLoop.tml 2008-08-21 17:36:54 UTC (rev 686) +++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/components/JSPagedLoop.tml 2008-08-22 08:41:33 UTC (rev 687) @@ -24,7 +24,7 @@ </div> <div class="jspagedloop_addlink_${fixedClientId}"> - <a href="javascript:;" onclick="addNewLinkListRow( JSPagerConfigs.${fixedClientId} )">${addRowLinkTitle}</a> + <a href="javascript:;" onclick="equandaAddNewLinkListRow( JSPagerConfigs.${fixedClientId} )">${addRowLinkTitle}</a> </div> </t:container> \ No newline at end of file Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/jspager.js =================================================================== --- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/jspager.js 2008-08-21 17:36:54 UTC (rev 686) +++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/jspager.js 2008-08-22 08:41:33 UTC (rev 687) @@ -1,4 +1,5 @@ /** This file is part of the equanda project, http://equanda.org */ + // Object to store all pager configurations var JSPagerConfigs = new Object(); @@ -8,7 +9,7 @@ * @param pageIdx - selected page index * @param config - configuration object which contains all required data for JS pager */ -function eqShowPage( pageIdx, config ) +function equandaShowPage( pageIdx, config ) { if( config == undefined ) { @@ -73,7 +74,7 @@ for( var i = 1; i <= 2; i++ ) { - writePageLink( container, i, config, config.name ); + equandaWritePageLink( container, i, config, config.name ); } var low = config.currentPage - config.range; @@ -95,12 +96,12 @@ for( var i = low; i <= high; i++ ) { - writePageLink( container, i, config, config.name ); + equandaWritePageLink( container, i, config, config.name ); } for( var i = config.maxPages - 1; i <= config.maxPages; i++ ) { - writePageLink( container, i, config, config.name ); + equandaWritePageLink( container, i, config, config.name ); } container.show(); @@ -113,7 +114,7 @@ * @param pageIndex - selected page * @param config - configuration object */ -function writePageLink( element, pageIndex, config ) +function equandaWritePageLink( element, pageIndex, config ) { if( pageIndex < 1 || pageIndex > config.maxPages ) return; @@ -141,7 +142,7 @@ anchor.href = "javascript:;"; anchor.onclick = function() { - eqShowPage( pageIndex, config ); + equandaShowPage( pageIndex, config ); }; anchor.title = "Goto Page " + pageIndex; anchor.innerHTML = "" + pageIndex; @@ -153,7 +154,7 @@ * * @param config - configuration object */ -function addNewLinkListRow( config ) +function equandaAddNewLinkListRow( config ) { if( !config || config.additionalRowCount == 0 || config.rowCount == 0 ) { @@ -165,11 +166,11 @@ config.addedRowCount = config.addedRowCount + 1; } - checkAddLinks( config ); + equandaCheckAddLinks( config ); $( config.addedRowFieldName ).value = "" + config.addedRowCount; - eqShowPage( config.currentPage, config ); + equandaShowPage( config.currentPage, config ); } /** @@ -177,7 +178,7 @@ * * @param config - configuration object */ -function checkAddLinks( config ) +function equandaCheckAddLinks( config ) { var addLinks = $$( "." + config.addLinkClass ); var addBlocks = $$( "." + config.addBlockClass ); @@ -206,13 +207,13 @@ * @param rowContentClass - css class of the row * @param revertAnchorId - revert anchor id */ -function markRowDeleted( anchor, hiddenId, index, rowContentClass, revertAnchorId ) +function equandaMarkRowDeleted( anchor, hiddenId, index, rowContentClass, revertAnchorId ) { if( hiddenId && $( hiddenId ) != null && index >= 0 ) { var hidden = $( hiddenId ); - var arrValues = stringToIntArray( hidden.value ); + var arrValues = equandaStringToIntArray( hidden.value ); arrValues.push( index ); arrValues = arrValues.uniq(); @@ -244,13 +245,13 @@ * @param rowContentClass - css class of the row * @param deleteAnchorId - delete anchor id */ -function revertDeletedRow( anchor, hiddenId, index, rowContentClass, deleteAnchorId ) +function equandaRevertDeletedRow( anchor, hiddenId, index, rowContentClass, deleteAnchorId ) { if( hiddenId && $( hiddenId ) != null && index >= 0 ) { var hidden = $( hiddenId ); - var arrValues = stringToIntArray( hidden.value ); + var arrValues = equandaStringToIntArray( hidden.value ); arrValues = arrValues.without( index ); @@ -279,7 +280,7 @@ * @param delimiter - value delimiter * @return new array of integers */ -function stringToIntArray( str, delimiter ) +function equandaStringToIntArray( str, delimiter ) { var arr = new Array(); if( str ) @@ -300,13 +301,3 @@ arr = arr.uniq(); return arr; } - -/** - * Shows debug message - * - * @param message - message to show - */ -function eqdebug( message ) -{ - // alert( message ); -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-08-29 08:27:04
|
Revision: 694 http://equanda.svn.sourceforge.net/equanda/?rev=694&view=rev Author: triathlon98 Date: 2008-08-29 08:26:58 +0000 (Fri, 29 Aug 2008) Log Message: ----------- EQ-255 StreamUtil class with tests Modified Paths: -------------- trunk/pom.xml Added Paths: ----------- trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java trunk/equanda-util/src/test/java/org/equanda/util/io/StreamUtilTest.java Added: trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java =================================================================== --- trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java (rev 0) +++ trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java 2008-08-29 08:26:58 UTC (rev 694) @@ -0,0 +1,85 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.util.io; + +import javolution.lang.TextBuilder; + +import java.io.*; + +/** + * Utility code for handling streams. + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public class StreamUtil +{ + /** + * Convert an inputstream to a string by reading the streams content. Using UTF-8 character encoding. + * A newline is added at te end of the document if there was none. + * + * @param stream stream to convert + * @return string containing the streams content, ending in newline + * @throws IOException oops + */ + public static String slurp( InputStream stream ) + throws IOException + { + return slurp( stream, "UTF-8" ); + } + + /** + * Convert an inputstream to a string by reading the streams content. + * A newline is added at te end of the document if there was none. + * + * @param stream stream to convert + * @param encoding character encoding to use for stream + * @return string containing the streams content, ending in newline + * @throws IOException oops + */ + public static String slurp( InputStream stream, String encoding ) + throws IOException + { + if ( stream == null ) return ""; + BufferedReader br = new BufferedReader( new InputStreamReader( stream, encoding ) ); + TextBuilder sb = TextBuilder.newInstance(); + String line; + + while ( ( line = br.readLine() ) != null ) + { + sb.append( line ); + sb.append( "\n" ); + } + + br.close(); + return sb.toString(); + } + + public static void copy( InputStream in, OutputStream out ) + throws IOException + { + int data; + while ( ( data = in.read() ) >= 0 ) out.write( data ); + } +} Added: trunk/equanda-util/src/test/java/org/equanda/util/io/StreamUtilTest.java =================================================================== --- trunk/equanda-util/src/test/java/org/equanda/util/io/StreamUtilTest.java (rev 0) +++ trunk/equanda-util/src/test/java/org/equanda/util/io/StreamUtilTest.java 2008-08-29 08:26:58 UTC (rev 694) @@ -0,0 +1,72 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.util.io; + +import junit.framework.TestCase; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; + +/** + * Tests for StreamUtil. + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public class StreamUtilTest + extends TestCase +{ + public void testSlurp() + throws Exception + { + String test = "Need a simple string for testing\n"; + InputStream is = new ByteArrayInputStream( test.getBytes( "UTF-8" ) ); + assertEquals( test, StreamUtil.slurp( is ) ); + } + + public void testSlurpNull() + throws Exception + { + assertEquals( "", StreamUtil.slurp( null ) ); + } + + public void testSlurpAddsNewline() + throws Exception + { + String test = "Need a simple string for testing"; + InputStream is = new ByteArrayInputStream( test.getBytes( "UTF-8" ) ); + assertEquals( test + "\n", StreamUtil.slurp( is, "UTF-8" ) ); + } + + public void testCopy() + throws Exception + { + String test = "Another testing string"; + InputStream is = new ByteArrayInputStream( test.getBytes( "UTF-8" ) ); + ByteArrayOutputStream os = new ByteArrayOutputStream( test.length() ); + StreamUtil.copy( is, os ); + assertEquals( test, os.toString() ); + } +} Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-08-24 10:55:16 UTC (rev 693) +++ trunk/pom.xml 2008-08-29 08:26:58 UTC (rev 694) @@ -394,7 +394,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> - <version>3.3.0.GA</version> + <version>3.3.0.GA</version> </dependency> <dependency> <groupId>jasperreports</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-09-05 12:02:13
|
Revision: 698 http://equanda.svn.sourceforge.net/equanda/?rev=698&view=rev Author: triathlon98 Date: 2008-09-05 12:02:03 +0000 (Fri, 05 Sep 2008) Log Message: ----------- various small site improvements Modified Paths: -------------- trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki trunk/equanda-generate/src/site/wiki/templates/t5guiAuthorization.wiki trunk/equanda-tapestry5/src/site/site.xml trunk/equanda-util/src/site/wiki/index.wiki Removed Paths: ------------- trunk/equanda-generate/src/site/wiki/templates/t5guiRights.wiki Modified: trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki =================================================================== --- trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki 2008-09-01 10:37:11 UTC (rev 697) +++ trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki 2008-09-05 12:02:03 UTC (rev 698) @@ -6,8 +6,8 @@ - fields can be distributed over (tab) pages with some fields be visible on all tabs - fields can be grouped - setting links using suggest values (*) -- [powerful user management with customization of rights|t5guiAuthorization.wiki] -- [possible choice of visible fields per user|t5guiAuthorization.wiki] +- [powerful user management with customization of rights|t5guiAuthorization.html] +- [possible choice of visible fields per user|t5guiAuthorization.html] - possible printout (pdf doc) of the result of selectors, with user configurable fields (screen and pdf), and column width (pdf) (*) - inclusion of reporting in the user interface (*) - generated components can be used to build custom pages Modified: trunk/equanda-generate/src/site/wiki/templates/t5guiAuthorization.wiki =================================================================== --- trunk/equanda-generate/src/site/wiki/templates/t5guiAuthorization.wiki 2008-09-01 10:37:11 UTC (rev 697) +++ trunk/equanda-generate/src/site/wiki/templates/t5guiAuthorization.wiki 2008-09-05 12:02:03 UTC (rev 698) @@ -1,6 +1,6 @@ h1. equanda rights handling -*Note :* to assure teh authorization and configuration work, you have to configure your [login to work properly|login.html]. +*Note :* to assure the authorization and configuration work, you have to configure your [login to work properly|login.html]. The equanda generated user interface should be very flexible and extremely configurable, both for the user and for an administrator who can define what is allowed by a user. Deleted: trunk/equanda-generate/src/site/wiki/templates/t5guiRights.wiki =================================================================== --- trunk/equanda-generate/src/site/wiki/templates/t5guiRights.wiki 2008-09-01 10:37:11 UTC (rev 697) +++ trunk/equanda-generate/src/site/wiki/templates/t5guiRights.wiki 2008-09-05 12:02:03 UTC (rev 698) @@ -1,9 +0,0 @@ -h1. equanda rights handling - -The equanda generated user interface should be very flexible. -This is a layered approach where some defaults are defined in the domain model, restrictions can be defined by an administrator (based on roles) and the user herself can also choose whether they want certain information to be hidden. - -The _EquandaUser_ table is used to indentify the logged in user. This user can be part of one or more roles and have some personalizations. - -Some users can have the administration rights (this is a field in the _EquandaUser_ table). - Modified: trunk/equanda-tapestry5/src/site/site.xml =================================================================== --- trunk/equanda-tapestry5/src/site/site.xml 2008-09-01 10:37:11 UTC (rev 697) +++ trunk/equanda-tapestry5/src/site/site.xml 2008-09-05 12:02:03 UTC (rev 698) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project name="equanda-util"> +<project name="equanda-tapestry5"> <body> <links> <item name="equanda" href="http://www.equanda.org/"/> Modified: trunk/equanda-util/src/site/wiki/index.wiki =================================================================== --- trunk/equanda-util/src/site/wiki/index.wiki 2008-09-01 10:37:11 UTC (rev 697) +++ trunk/equanda-util/src/site/wiki/index.wiki 2008-09-05 12:02:03 UTC (rev 698) @@ -12,6 +12,7 @@ - EAN 128 barcode utility code, both for decomposing barcodes and building (printer specific) barcode strings. - io -- TextBuilderWriter a StringWriter which builds the string in a ([javolution|http://www.javolution.org/]) TextBuilder, thus being more efficient and creating less garbade. +-- StreamUtil including methods to "slurp" the contents of a stream into a string and to copy data from an input to an output stream. - some [FScript|http://sourceforge.net/projects/fscript] extensions. -- [UtilScriptBoolean] functions/variables for boolean value -- [UtilScriptDatabase] jdbc database access aid routines @@ -21,7 +22,6 @@ -- [UtilScriptDM] some aid rouines to access a equanda generated domain model -- [UtilScriptString] some string handing aid routines - Various swing utility classes -- An xml parser which allows building the tree in custom objects. However this implementation is not recommended as it is likely to be replaced. -- ImportUtil to allow easy access to the ymport provisions of generated applications +- ImportUtil to allow easy access to the import provisions of generated applications For more details about these, see the API docs. \ 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: <tri...@us...> - 2008-09-05 16:27:24
|
Revision: 700 http://equanda.svn.sourceforge.net/equanda/?rev=700&view=rev Author: triathlon98 Date: 2008-09-05 16:27:19 +0000 (Fri, 05 Sep 2008) Log Message: ----------- EQ-228 fix class name Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/webapp/css/style.css trunk/equanda-t5gui/src/site/wiki/translation.wiki Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2008-09-05 15:49:14 UTC (rev 699) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2008-09-05 16:27:19 UTC (rev 700) @@ -36,7 +36,7 @@ </div> <t:if test="has-equanda-message:field.${table.Name}.${field.Name}.caption"> -<div class="equandaFieldHelp">${dollar}{equanda-message:field.${table.Name}.${field.Name}.caption}</div> +<div class="equandaFieldCaption">${dollar}{equanda-message:field.${table.Name}.${field.Name}.caption}</div> </t:if> </span> </div> Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm 2008-09-05 15:49:14 UTC (rev 699) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm 2008-09-05 16:27:19 UTC (rev 700) @@ -6,7 +6,7 @@ <input class="${table.Name}-type-Selector" t:type="Select" t:label="equanda-message:field.EquandaType" t:id="${table.Name}EquandaType" t:value="value.EquandaType" t:disabled="isTypeKnown()" model="TypeModel" encoder="TypeEncoder" t:validate="required"/> </div> <t:if test="has-equanda-message:field.${table.Name}.${field.Name}.caption"> - <div class="equandaFieldHelp">${dollar}{equanda-message:field.${table.Name}.EquandaType.caption}</div> + <div class="equandaFieldCaption">${dollar}{equanda-message:field.${table.Name}.EquandaType.caption}</div> </t:if> </span> </div> Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm 2008-09-05 15:49:14 UTC (rev 699) +++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm 2008-09-05 16:27:19 UTC (rev 700) @@ -31,7 +31,7 @@ <input t:type="TextField" t:label="equanda-message:parameter.${table.Name}.${select.Name}.${par.Name}" t:id="${par.Name}" t:value="${par.Name}"/> </div> <t:if test="has-equanda-message:parameter.${table.Name}.${select.Name}.${par.Field.Name}.help"> -<div class="equandaFieldHelp">${dollar}{equanda-message:parameter.${table.Name}.${select.Name}.${par.Name}.help}</div> +<div class="equandaFieldCaption">${dollar}{equanda-message:parameter.${table.Name}.${select.Name}.${par.Name}.help}</div> </t:if> </span> <br/> Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/webapp/css/style.css =================================================================== --- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/webapp/css/style.css 2008-09-05 15:49:14 UTC (rev 699) +++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/webapp/css/style.css 2008-09-05 16:27:19 UTC (rev 700) @@ -115,7 +115,7 @@ width: 8em; padding: .2em 1em; display: block; - background: lightgray; + background-color: lightgray; color: black; font-weight: bold; text-decoration: none; @@ -131,7 +131,7 @@ } .equandaTabsAll { border-bottom: solid 1px; - background: beige; + background-color: beige; padding: 1em; } .equandaTabsPanelContent { Modified: trunk/equanda-t5gui/src/site/wiki/translation.wiki =================================================================== --- trunk/equanda-t5gui/src/site/wiki/translation.wiki 2008-09-05 15:49:14 UTC (rev 699) +++ trunk/equanda-t5gui/src/site/wiki/translation.wiki 2008-09-05 16:27:19 UTC (rev 700) @@ -55,6 +55,6 @@ For example in the field template. {code} <t:if test="has-equanda-message:field.${table.Name}.${field.Name}.help"> -<div class="equandaFieldHelp">${dollar}{equanda-message:field.${table.Name}.${field.Name}.help}</div> +<div class="equandaFieldCaption">${dollar}{equanda-message:field.${table.Name}.${field.Name}.help}</div> </t:if> {code} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-09-06 13:37:00
|
Revision: 706 http://equanda.svn.sourceforge.net/equanda/?rev=706&view=rev Author: triathlon98 Date: 2008-09-06 13:36:53 +0000 (Sat, 06 Sep 2008) Log Message: ----------- add documentation on proxy behaviour Modified Paths: -------------- trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki trunk/src/site/wiki/index.wiki Modified: trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki =================================================================== --- trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki 2008-09-06 13:22:29 UTC (rev 705) +++ trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki 2008-09-06 13:36:53 UTC (rev 706) @@ -21,7 +21,35 @@ As a bonus, when your client only uses the proxies, it is straightforward to replace the backend (this way the data could for example be based on webservices instead of EJB3 entity beans). +h2. Using the generated proxies +As part of the generated classes, some powerful _data access objects_ (DAO's) are generated. These _proxies_ assure that access to the objects always behaves consistently, independent of whether access is local, remote, using a UserTransaction or not. +The proxies have the following advantages and behaviour. +- All multiple linked fields are lazy loaded. They are instaniated when the collection is first accessed. +- Proxies can be saved and updated (using equandaUpdate() in place, the actual object stays the same though the data in it may change. However, linked objects which are updated because of casading update are replaced (see example velow)! +- All multiple fields in the proxies are always not-null. When there are no values in it, an empty collection is returned. +- All updates to proxies cascade. The linked records will also be updated when they are changed (though this only follows a path of changed objects, when object A links to object B which links to C and A and C are modified but B is not, then an update on A will not update C). +- Multiple fields in proxies are intelligent. They record which elements are removed or updated and will not touch unmodified linked objects. If however, you assign a new collection to these fields, then part of the intelligence is no longer possible, making updates somewhat less efficient. Therefor it is recommend to not assign new collections. +- Proxies are only marked as _modified_ if something has actually changed. Just assigning the current value in a field will not mark that field as modified. +- The "equandaCreate()" static method allows instantiation of a new object with all default values filled in. +- All selectors are available through static method on the proxy class. The results are lazy collections which are instantiated and refreshed automatically. +- The proxies allow direct invocation of the actions which are defined on the objects (in the domain model). You can choose whether the system should implicitly do a equandaUpdate() before calling the action (using "setEquandaUpdate()", default is false). +- You can choose whether to check for changes to fields which are not part of the object according to the inheritance (templates) in the domain model. Using "equandaUpdate( false )" you can assure the updates are only attempted on fields which are part of the object based on the equandaType. This can for example be very practical for interacting with user interfaces. +- To test whether a proxy already exists in the database, check whether "getId()" is not-null. +- To check whether a proxy is modified locally, you can use "isModified()". This accepts a parameter (similar to "equandaUpdate()") to limit the test to equandaType specific fields. + +Some things to watch out for. In code like the following (excerpt from the testcases). +{code} +Car car = Car.equandaCreate(); +car.setBrand( "CarBrand 1" ); +UniqueFields uf = UniqueFields.equandaCreate(); +uf.setUniqueImmutableInt( 1 ); +uf.setLinkedCar( car ); +uf.equandaUpdate(); +{code} +The "equandaUpdate()" will create both the "UniqueFields" and the "Car" records (because of cascading updates). +However, the update will replace the "Car" instance inside the "UniqueFields" object and not do an explicit update on the "car" object. Therefor "car.getId()" will still return null and "car.isModified()" will be true. To get the saved version, use "car = uf.getLinkedCar()". + h2. How the domain model is generated A whole set of classes are being generated. To handle the inheritance, the inheritance tree is flattened and a "root-table" is created which contains all fields, actions, selectors for all the tables in the inhertance tree. When is distinction needs to be made, this is handled in the code. Modified: trunk/src/site/wiki/index.wiki =================================================================== --- trunk/src/site/wiki/index.wiki 2008-09-06 13:22:29 UTC (rev 705) +++ trunk/src/site/wiki/index.wiki 2008-09-06 13:36:53 UTC (rev 706) @@ -61,7 +61,7 @@ - field (type) templates can be used Implementation -- powerful proxies are used which make objects available remotely. Similar to detached objects, but completely transparent (no need to instantiate) +- powerful [proxies|equanda-generate/templates/ejb3.html] are used which make objects available remotely. Similar to detached objects, but completely transparent (no need to instantiate) - lazy collection instantiation, when a selector contains lots of objects, the results are still batched (and counting works too) - inheritance sensitive selectors - filters and sort orders can be defined on the selectors This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-09-07 12:25:52
|
Revision: 707 http://equanda.svn.sourceforge.net/equanda/?rev=707&view=rev Author: triathlon98 Date: 2008-09-07 12:25:47 +0000 (Sun, 07 Sep 2008) Log Message: ----------- EQ-59 unique-for implementation Modified Paths: -------------- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java 2008-09-07 12:25:47 UTC (rev 707) @@ -498,6 +498,13 @@ if ( isCalculated() ) err( "calculated fields cannot be marked unique" ); if ( isAuto() ) err( "auto fields cannot be marked unique" ); } + if ( isUniqueFor() ) + { + if ( isMultiple() ) err( "multiple fields cannot be marked unique-for" ); + if ( isCalculated() ) err( "calculated fields cannot be marked unique-for" ); + if ( isAuto() ) err( "auto fields cannot be marked unique-for" ); + if ( isImmutable() ) err( "immutable fields cannot be marked unique-for" ); + } // value-when-null/zero handling ValueWhenNull vwn = constraints.getValueWhenNull(); Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/transform/RootTable.java 2008-09-07 12:25:47 UTC (rev 707) @@ -37,7 +37,8 @@ * * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> */ -public class RootTable +public class + RootTable { private DomainModel domainModel; private String name; // table name @@ -393,6 +394,32 @@ return res; } + public List<Field> getUniqueForFields() + { + List<Field> res = new ArrayList<Field>(); + new TemplateUtil<Field>().filterList( fields, res, new ListFilter<Field>() + { + public boolean isSuitable( Field field ) + { + return field.isUniqueFor(); + } + } ); + return res; + } + + public List<Field> getUniqueOrUniqueForFields() + { + List<Field> res = new ArrayList<Field>(); + new TemplateUtil<Field>().filterList( fields, res, new ListFilter<Field>() + { + public boolean isSuitable( Field field ) + { + return field.isUnique() || field.isUniqueFor(); + } + } ); + return res; + } + public List<Field> getFieldsNotHidden() { List<Field> res = new ArrayList<Field>(); Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-09-07 12:25:47 UTC (rev 707) @@ -252,6 +252,17 @@ return (Long)q.getResultList().get( 0 ); } #end +#foreach( $field in $table.UniqueForFields ) + public static long count${field.Name}( EntityManager em, ${field.JavaFieldType} ${field.VarName}, + ${field.UniqueForField.JavaEntityType} equandaFor ) + { + EquandaQuery query = EquandaGlobal.getQuery( "${table.Name}.equanda${field.Name}Unique" ); + query.setParameter( "${field.VarName}", ${field.VarName} ); + query.setParameter( "equandaFor", equandaFor ); + Query q = getEquandaQuery( em, query ); + return (Long)q.getResultList().get( 0 ); + } +#end public static DM${table.Name}Bean selectId(EntityManager em, Uoid uoid) { Modified: trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2008-09-07 12:25:47 UTC (rev 707) @@ -134,6 +134,9 @@ #foreach( $field in $table.UniqueFields ) queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name}Bean p WHERE p.${field.VarName} = :${field.VarName}" ); #end +#foreach( $field in $table.UniqueForFields ) + queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name}Bean p WHERE p.${field.VarName} = :${field.VarName} AND p.${field.UniqueForField.VarName} = :equandaFor"); +#end #foreach( $field in $table.LinkFields ) #if( $field.hasCompare() ) Modified: trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm 2008-09-07 12:25:47 UTC (rev 707) @@ -205,8 +205,12 @@ #set( $chosenValue="$field.VarName" ) #parse("MediatorBase-choices.java.vm") - #if ( $field.isUnique() ) - if ( object.count${field.Name}($field.VarName) > 0 ) + #if( $field.isUnique() || $field.isUniqueFor() ) +#set( $equandaFor = "" ) +#if( $field.isUniqueFor() ) +#set( $equandaFor = ", entity.get${field.UniqueForField.Name}()" ) +#end + if ( object.count${field.Name}( $field.VarName $equandaFor) > 0 ) { throw new EquandaConstraintViolation( ECV_FIELD_IS_UNIQUE, "field.${table.Name}.${field.Name}" ); } Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm 2008-09-07 12:25:47 UTC (rev 707) @@ -198,7 +198,7 @@ #set( $chosenValue="$field.VarName" ) #parse( "MediatorBase-choices.java.vm" ) #parse( "MediatorBase-compare.java.vm" ) - #if ($field.isUnique()) + #if( $field.isUnique() ) #set( $uc = "$!field.UniqueConverter" ) #if( $uc != "" ) $uc uc = new ${uc}(); @@ -216,7 +216,7 @@ $field.VarName = uc.getConvertedDouble( $field.VarName ); #end #end - if (count${field.Name}($field.VarName)>0) + if ( count${field.Name}( $field.VarName ) > 0 ) { throw new EquandaConstraintViolation( ECV_FIELD_IS_UNIQUE, "field.${table.Name}.${field.Name}" ); } @@ -247,9 +247,9 @@ ${field.VarName}=${field.VarName}.substring(0,$field.Length); #end #set( $chosenValue="$field.VarName" ) - #parse ("MediatorBase-choices.java.vm") - #parse ("MediatorBase-compare.java.vm") - #if ($field.isUnique()) + #parse( "MediatorBase-choices.java.vm" ) + #parse( "MediatorBase-compare.java.vm" ) + #if( $field.isUnique() ) #set( $uc = "$!field.UniqueConverter" ) #if( $uc != "" ) $uc uc = new ${uc}(); @@ -267,7 +267,7 @@ $field.VarName = uc.getConvertedDouble( $field.VarName ); #end #end - if (count${field.Name}($field.VarName)>0) + if ( count${field.Name}( $field.VarName ) > 0 ) { throw new EquandaConstraintViolation( ECV_FIELD_IS_UNIQUE, "field.${table.Name}.${field.Name}" ); } @@ -706,16 +706,29 @@ #end #foreach( $field in $table.UniqueFields ) - long count${field.Name}(${field.JavaFieldType} ${field.VarName}) { + long count${field.Name}( ${field.JavaFieldType} ${field.VarName} ) + { #if( $field.isString() || $field.isDate() || $field.isTimestamp() ) - if ($field.VarName==null) return 0; + if ( $field.VarName == null ) return 0; #end - long count=DM${table.Name}Selector.count${field.Name}(entityManager, ${field.VarName}); - if ( log.isDebugEnabled() ) log.debug("uniqueness test count$field.Name "+$field.VarName+" "+count); + long count = DM${table.Name}Selector.count${field.Name}( entityManager, ${field.VarName} ); + if ( log.isDebugEnabled() ) log.debug( "uniqueness test count$field.Name " + ${field.VarName} + " " + count ); return count; } #end +#foreach( $field in $table.UniqueForFields ) + long count${field.Name}( ${field.JavaFieldType} ${field.VarName}, ${field.UniqueForField.JavaEntityType} equandaFor ) + { +#if( $field.isString() || $field.isDate() || $field.isTimestamp() ) + if ( $field.VarName == null ) return 0; +#end + long count = DM${table.Name}Selector.count${field.Name}( entityManager, ${field.VarName}, equandaFor ); + if ( log.isDebugEnabled() ) log.debug( "uniqueness test count$field.Name " + ${field.VarName} + " " + count + " for " + equandaFor ); + return count; + } +#end + /** * utility routine to test equality of objects without relying on one of them being not null. * Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java =================================================================== --- trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java 2008-09-06 13:36:53 UTC (rev 706) +++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java 2008-09-07 12:25:47 UTC (rev 707) @@ -165,4 +165,44 @@ car1.removeEntityBean(); car2.removeEntityBean(); } + + // tests for EQ-59 unique-for + public void testUniqueFor() + throws Exception + { + Car car1 = Car.equandaCreate(); + car1.setBrand( "CarBrand 1" ); + car1.equandaUpdate(); + Car car2 = Car.equandaCreate(); + car2.setBrand( "CarBrand 2" ); + car2.equandaUpdate(); + UniqueFields uf1 = UniqueFields.equandaCreate(); + uf1.setUniqueImmutableInt( 1 ); + uf1.setLinkedCar( car1 ); + uf1.setUniqueForCar( "blue" ); + uf1.equandaUpdate(); + UniqueFields uf2 = UniqueFields.equandaCreate(); + uf2.setUniqueImmutableInt( 2 ); + uf2.setLinkedCar( car2 ); + uf2.setUniqueForCar( "blue" ); + uf2.equandaUpdate(); + UniqueFields uf3 = UniqueFields.equandaCreate(); + uf3.setUniqueImmutableInt( 3 ); + uf3.setLinkedCar( car1 ); + uf3.setUniqueForCar( "blue" ); + try + { + uf3.equandaUpdate(); + fail( "unique-for not activated" ); + } + catch ( EquandaConstraintViolation ecv ) + { + assertEquals( ExceptionCodes.ECV_FIELD_IS_UNIQUE, ecv.getExceptionCode() ); + } + + uf1.removeEntityBean(); + uf2.removeEntityBean(); + car1.removeEntityBean(); + car2.removeEntityBean(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tri...@us...> - 2008-09-07 13:07:59
|
Revision: 708 http://equanda.svn.sourceforge.net/equanda/?rev=708&view=rev Author: triathlon98 Date: 2008-09-07 13:07:56 +0000 (Sun, 07 Sep 2008) Log Message: ----------- EQ-59 unique-for implementation, assure also works when unique-for field is nul Modified Paths: -------------- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java 2008-09-07 12:25:47 UTC (rev 707) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Field.java 2008-09-07 13:07:56 UTC (rev 708) @@ -716,6 +716,11 @@ return type; } + public boolean isNullable() + { + return ( isString() || isDate() || isTimestamp() || isBlob() || isClob() || isLink() ) && !isMultiple(); + } + /** * Get (normal) Java field type for field * Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-09-07 12:25:47 UTC (rev 707) +++ trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-09-07 13:07:56 UTC (rev 708) @@ -257,8 +257,16 @@ ${field.UniqueForField.JavaEntityType} equandaFor ) { EquandaQuery query = EquandaGlobal.getQuery( "${table.Name}.equanda${field.Name}Unique" ); + if ( null != equandaFor ) + { + query = EquandaGlobal.getQuery( "${table.Name}.equanda${field.Name}Unique" ); + query.setParameter( "equandaFor", equandaFor ); + } + else + { + query = EquandaGlobal.getQuery( "${table.Name}.equanda${field.Name}UniqueNull" ); + } query.setParameter( "${field.VarName}", ${field.VarName} ); - query.setParameter( "equandaFor", equandaFor ); Query q = getEquandaQuery( em, query ); return (Long)q.getResultList().get( 0 ); } Modified: trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2008-09-07 12:25:47 UTC (rev 707) +++ trunk/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2008-09-07 13:07:56 UTC (rev 708) @@ -136,7 +136,10 @@ #end #foreach( $field in $table.UniqueForFields ) queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name}Bean p WHERE p.${field.VarName} = :${field.VarName} AND p.${field.UniqueForField.VarName} = :equandaFor"); +#if( $field.UniqueForField.isNullable() ) + queryStrings.put( "${table.Name}.equanda${field.Name}UniqueNull", "SELECT COUNT(p) FROM DM${table.Name}Bean p WHERE p.${field.VarName} = :${field.VarName} AND p.${field.UniqueForField.VarName} is null"); #end +#end #foreach( $field in $table.LinkFields ) #if( $field.hasCompare() ) Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java =================================================================== --- trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java 2008-09-07 12:25:47 UTC (rev 707) +++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java 2008-09-07 13:07:56 UTC (rev 708) @@ -167,6 +167,7 @@ } // tests for EQ-59 unique-for + public void testUniqueFor() throws Exception { @@ -205,4 +206,27 @@ car1.removeEntityBean(); car2.removeEntityBean(); } + + public void testUniqueForNull() + throws Exception + { + UniqueFields uf1 = UniqueFields.equandaCreate(); + uf1.setUniqueImmutableInt( 1 ); + uf1.setUniqueForCar( "blue" ); + uf1.equandaUpdate(); + UniqueFields uf2 = UniqueFields.equandaCreate(); + uf2.setUniqueImmutableInt( 2 ); + uf2.setUniqueForCar( "blue" ); + try + { + uf2.equandaUpdate(); + fail( "unique-for not activated" ); + } + catch ( EquandaConstraintViolation ecv ) + { + assertEquals( ExceptionCodes.ECV_FIELD_IS_UNIQUE, ecv.getExceptionCode() ); + } + + uf1.removeEntityBean(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gr...@us...> - 2008-09-15 14:16:57
|
Revision: 720 http://equanda.svn.sourceforge.net/equanda/?rev=720&view=rev Author: grizze Date: 2008-09-15 14:16:44 +0000 (Mon, 15 Sep 2008) Log Message: ----------- EQ-229 intermediate checkin. Make the Tabs component remember its active tab via cookies. Use MemTabs instead of Tabs in the equanda generated edit components Todo: user documentation, make sure javascript for MemTabs doesn't write a cookie, management of active tab in Tabs and Accordeon component should work in exactly the same way Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/MemTabs.java trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2008-09-15 14:13:34 UTC (rev 719) +++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2008-09-15 14:16:44 UTC (rev 720) @@ -1,4 +1,4 @@ -<span t:type="equanda/Tabs" t:exclude="prop:tabsExcludeIndex"> +<span t:type="equanda/MemTabs" t:id="tabs_${table.Name}" t:exclude="prop:tabsExcludeIndex"> ## page titles #set( $pageindex = 1 ) #foreach( $page in $table.Pages ) Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java =================================================================== --- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java 2008-09-15 14:13:34 UTC (rev 719) +++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/TitleContent.java 2008-09-15 14:16:44 UTC (rev 720) @@ -93,6 +93,11 @@ this.useCookies = useCookies; } + protected int getActiveIndex() + { + return activeIndex; + } + public String getId() { return assignedId; Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/MemTabs.java =================================================================== --- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/MemTabs.java 2008-09-15 14:13:34 UTC (rev 719) +++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/MemTabs.java 2008-09-15 14:16:44 UTC (rev 720) @@ -34,7 +34,6 @@ * Sibling of the Tabs component. But where the Tabs component uses cookies to remember the current tab, * the MemTabs component uses AJAX and a persistent field (currentTab). * - * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> * @author <a href="mailto:ge...@bl...">Geert Mergan</a> */ @SupportsInformalParameters Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java =================================================================== --- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2008-09-15 14:13:34 UTC (rev 719) +++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Tabs.java 2008-09-15 14:16:44 UTC (rev 720) @@ -38,7 +38,6 @@ public class Tabs extends TitleContent { - private static final int CURRENT = 0; @Inject @Path( "${tapestry.scriptaculous}/prototype.js" ) private Asset prototype; @@ -118,7 +117,7 @@ */ public String getActive() { - if ( getIndex() == CURRENT ) return "equandaTabsActive equandaTraverseSkip"; + if ( (getIndex() + 1) == getActiveIndex() ) return "equandaTabsActive equandaTraverseSkip"; return ""; } @@ -129,7 +128,7 @@ */ public String getDisplay() { - if ( getIndex() == CURRENT ) return "block"; + if ( (getIndex() + 1 ) == getActiveIndex() ) return "block"; return "none"; } } Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js =================================================================== --- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js 2008-09-15 14:13:34 UTC (rev 719) +++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/tabs.js 2008-09-15 14:16:44 UTC (rev 720) @@ -6,6 +6,10 @@ function equandaTabsClick( title, content ) { + var tabsId = title.up().up().up().readAttribute( "id" ); + var titleId = title.readAttribute( "id" ); + var indexstr = titleId.substr( titleId.length - 1); + var index = parseInt( indexstr ); if ( !title.hasClassName( EQUANDA_TABS_ACTIVE ) ) { title.addClassName( EQUANDA_TABS_ACTIVE ); @@ -18,5 +22,6 @@ if ( !el.hasClassName( EQUANDA_TABS_ALL ) ) el.style.display = "none"; } ); } + document.cookie = "active_index_" + tabsId + "=" + ( index + 1) + "; path=/"; return false; } \ 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: <tri...@us...> - 2008-09-20 10:44:47
|
Revision: 727 http://equanda.svn.sourceforge.net/equanda/?rev=727&view=rev Author: triathlon98 Date: 2008-09-20 10:44:08 +0000 (Sat, 20 Sep 2008) Log Message: ----------- EQ-237 translator on subjectory mapping Modified Paths: -------------- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Mapping.java trunk/equanda-generate/src/main/resources/equanda.dtd trunk/equanda-generate/src/test/java/org/equanda/domain/xml/MappingTest.java Added Paths: ----------- trunk/equanda-client/src/main/java/org/equanda/subjectory/ trunk/equanda-client/src/main/java/org/equanda/subjectory/MappingTranslator.java Added: trunk/equanda-client/src/main/java/org/equanda/subjectory/MappingTranslator.java =================================================================== --- trunk/equanda-client/src/main/java/org/equanda/subjectory/MappingTranslator.java (rev 0) +++ trunk/equanda-client/src/main/java/org/equanda/subjectory/MappingTranslator.java 2008-09-20 10:44:08 UTC (rev 727) @@ -0,0 +1,49 @@ +/** + * This file is part of the equanda project. + * + * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + */ + +package org.equanda.subjectory; + +/** + * Translator for handling specific mappings in the subjectory "mapping". + * + * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a> + */ +public interface MappingTranslator<EXTERNALTYPE, INTERNALTYPE> +{ + /** + * Get the internal representation of an external object to be mapped. + * + * @param external object in external mapping + * @return object internal (domain model) mapping + */ + INTERNALTYPE getInternal( EXTERNALTYPE external ); + + /** + * Get the external representation of an external object to be mapped. + * + * @param internal object in internal (domain model) mapping + * @return object external mapping + */ + EXTERNALTYPE getExternal( INTERNALTYPE internal ); +} Modified: trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Mapping.java =================================================================== --- trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Mapping.java 2008-09-19 09:22:15 UTC (rev 726) +++ trunk/equanda-generate/src/main/java/org/equanda/domain/xml/Mapping.java 2008-09-20 10:44:08 UTC (rev 727) @@ -41,8 +41,8 @@ private String context; private String container; @XStreamImplicit - @XStreamAlias( "expression" ) private List<Expression> expressions; + private String translator; public String getContext() { @@ -59,4 +59,9 @@ if ( null == expressions ) expressions = new ArrayList<Expression>(); return expressions; } + + public String getTranslator() + { + return translator; + } } Modified: trunk/equanda-generate/src/main/resources/equanda.dtd =================================================================== --- trunk/equanda-generate/src/main/resources/equanda.dtd 2008-09-19 09:22:15 UTC (rev 726) +++ trunk/equanda-generate/src/main/resources/equanda.dtd 2008-09-20 10:44:08 UTC (rev 727) @@ -271,10 +271,13 @@ can be used to indicate a (data) container the data comes from or should be put into several expressions can be used to indicate the conversion, the type (lowercase) indicates the kind of expression (for exampe (xpath", "groovy", "scala") + A translator can be specified which maps from the external format (string) to the internal format and vice versa, + this should be a classname which is an instance of org.equanda.subjectory.MappingTranslator. --> <!ELEMENT mapping ( (context), (container)?, - (expr)* + (expr)*, + (translator)? )> <!ELEMENT context (#PCDATA)> <!ELEMENT container (#PCDATA)> @@ -282,6 +285,7 @@ <!ATTLIST expr type CDATA #IMPLIED> +<!ELEMENT translator (#PCDATA)> <!-- Not allowed for int and double fields Modified: trunk/equanda-generate/src/test/java/org/equanda/domain/xml/MappingTest.java =================================================================== --- trunk/equanda-generate/src/test/java/org/equanda/domain/xml/MappingTest.java 2008-09-19 09:22:15 UTC (rev 726) +++ trunk/equanda-generate/src/test/java/org/equanda/domain/xml/MappingTest.java 2008-09-20 10:44:08 UTC (rev 727) @@ -49,6 +49,7 @@ assertNull( mapping.getContainer() ); assertNotNull( mapping.getExpressions() ); assertTrue( mapping.getExpressions().isEmpty() ); + assertNull( mapping.getTranslator() ); } public void testParse2() @@ -63,6 +64,7 @@ " <expr type=\"javascript\">js</expr>" + " <expr type=\"Groovy\">bla</expr>" + " <expr/>" + + " <translator>my.field.translator</translator>" + "</mapping>"; XStream stream = getXStreamInstance(); Object res = stream.fromXML( test ); @@ -82,5 +84,6 @@ expr = mapping.getExpressions().get( 2 ); assertNull( expr.getType() ); assertNull( expr.getValue() ); + assertEquals( "my.field.translator", mapping.getTranslator() ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |