You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(41) |
Sep
(44) |
Oct
(31) |
Nov
(54) |
Dec
(53) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(71) |
Feb
(66) |
Mar
(65) |
Apr
(73) |
May
(68) |
Jun
(69) |
Jul
(28) |
Aug
(49) |
Sep
(44) |
Oct
(77) |
Nov
(64) |
Dec
(78) |
| 2009 |
Jan
(50) |
Feb
(28) |
Mar
(41) |
Apr
(30) |
May
(5) |
Jun
(30) |
Jul
(6) |
Aug
(2) |
Sep
(18) |
Oct
(11) |
Nov
(6) |
Dec
(10) |
| 2010 |
Jan
(5) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bri...@us...> - 2008-12-10 11:00:55
|
Revision: 909
http://equanda.svn.sourceforge.net/equanda/?rev=909&view=rev
Author: brian_reynolds
Date: 2008-12-10 11:00:50 +0000 (Wed, 10 Dec 2008)
Log Message:
-----------
if the field is a link it should only be displayed if the target table is visible
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-09 04:56:17 UTC (rev 908)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-10 11:00:50 UTC (rev 909)
@@ -65,6 +65,11 @@
#set ($summaryBox="${field.Name}_sumCheck")
#set ($printBox="${field.Name}_printCheck")
+## if the field is a link it should only be displayed if the target table is visible
+#if( ${field.isLink()} )
+ <t:if test="equanda-readable:table.${field.linkTableName}">
+#end
+
<t:if test="equanda-readable:field.${table.Name}.${field.Name}">
<div>
@@ -109,7 +114,10 @@
<br/>
</t:if>
+#if( ${field.isLink()} )
+ </t:if>
#end
+#end
</fieldSet>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-09 04:56:17 UTC (rev 908)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-10 11:00:50 UTC (rev 909)
@@ -70,6 +70,11 @@
#set ($summaryBox="${field.Name}_sumCheck")
#set ($printBox="${field.Name}_printCheck")
+## if the field is a link it should only be displayed if the target table is visible
+#if( ${field.isLink()} )
+ <t:if test="equanda-readable:table.${field.linkTableName}">
+#end
+
<t:if test="equanda-readable:field.${table.Name}.${field.Name}">
<div>
@@ -113,7 +118,11 @@
</div>
<br/>
</t:if>
+
+#if( ${field.isLink()} )
+ </t:if>
#end
+#end
#foreach( $group in $group.Groups )
#parse( "pages/AuthAndConfigGroup.tml.vm" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-09 04:56:29
|
Revision: 908
http://equanda.svn.sourceforge.net/equanda/?rev=908&view=rev
Author: triathlon98
Date: 2008-12-09 04:56:17 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
archetype fix
Modified Paths:
--------------
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.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-12-08 15:08:25 UTC (rev 907)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java 2008-12-09 04:56:17 UTC (rev 908)
@@ -48,4 +48,4 @@
"app-exceptions"
};
}
-}
\ 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: <bri...@us...> - 2008-12-08 15:08:27
|
Revision: 907
http://equanda.svn.sourceforge.net/equanda/?rev=907&view=rev
Author: brian_reynolds
Date: 2008-12-08 15:08:25 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Added some words on the auth pages
Modified Paths:
--------------
trunk/src/site/wiki/templates/t5guiAuthorization.wiki
Modified: trunk/src/site/wiki/templates/t5guiAuthorization.wiki
===================================================================
--- trunk/src/site/wiki/templates/t5guiAuthorization.wiki 2008-12-08 12:19:05 UTC (rev 906)
+++ trunk/src/site/wiki/templates/t5guiAuthorization.wiki 2008-12-08 15:08:25 UTC (rev 907)
@@ -102,4 +102,28 @@
Some pages are needed for managing the rights. There should be a set of pages (with a start page) for an administrator (managing the roles), and a set of pages for the user herself (allowing the hiding of fields and managing the list fields).
These pages can probably be fixed but reading the configuration from a (set of) generated config files.
+h2. Authorization Pages
+The page used for managing the roles is named _AuthAndConfigRoles_. To use this page, the user must be a member of a role which has GUI Administrator rights. The list of available roles are provided in a drop-down box, if no roles are selected, the current users rights will be selected for editing.
+
+.The page used for managing tables is named _AuthAndConfigTables_. If the user has admin rights, they are allowed to select what tables are Readable, Writable, and have Delete enabled for each role. Otherwise, the user can set individual tables visible or not.
+The user can also choose to Configure the rights for individual tables, with the _Configure_ link.
+
+The page used for managing a table is available by clicking the *Configure* link in the _AuthAndConfigTables_ page. This link will only be available if the user has read rights on the table to be edited.
+The table page allows the rights to be set at a field level. If there are Selectors or Actions available for this table, they can be enabled/disabled here. Each of the Selectors for a table are grouped under the name _Selects_. Each of the Actions for a table are grouped under the name _Actions_. All other fields are grouped by _Page name_ or _Group name_.
+Some rights are implicitly enabled when another right is selected. For example, to use enable _Print_ on a field, _Read_ / _Visible_ must also be enabled. To ensure the rights are consistent, the appropriate checkboxes will be enabled or disabled automatically.
+
+It is suggested that the following values be used for the div selectors used in this page.
+
+{code}
+div.nameCol { position:absolute; left: 10px; }
+div.readCol { position:absolute; left: 250px; }
+div.writeCol { position:absolute; left: 300px; }
+div.listCol { position:absolute; left: 350px; }
+div.summaryCol { position:absolute; left: 400px; }
+div.printCol { position:absolute; left: 500px; }
+{code}
+
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-08 12:19:14
|
Revision: 906
http://equanda.svn.sourceforge.net/equanda/?rev=906&view=rev
Author: brian_reynolds
Date: 2008-12-08 12:19:05 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Allow configure when table is visible/readable
Enable page level write boxes.
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.tml.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-05 18:49:40 UTC (rev 905)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-08 12:19:05 UTC (rev 906)
@@ -21,12 +21,12 @@
</t:parameter>
</t:if>
- <!--
<t:if test="writeAllowed">
- <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}" onclick="eqEnableBoxes( ${readBox}, ${writeBox}, false)" t:type="CheckBox"/>
- <t:label for="${writeBox}"> ${dollar}{equanda-message:authAndConfig.label.Write} </t:label>
+ <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_writeCheck')"
+ t:type="CheckBox"/>
+ <t:label for="${writeBox}"> ${dollar}{equanda-message:authAndConfig.label.Write} | </t:label>
</t:if>
- -->
<input t:id="${listBox}" name="${listBox}" value="${listBox}"
onclick="eqHandlePageBox( this, '$!{page.Name}', '_listCheck')" t:type="CheckBox"/>
@@ -80,10 +80,11 @@
</div>
<t:if test="writeAllowed">
- <div class="writeCol">
- <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
- onclick="eqEnableBoxes( ${readBox}, ${writeBox}, false)" t:type="CheckBox"/>
- </div>
+ <div class="writeCol">
+ <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
+ onclick="eqHandleFieldBox( ${page.Name}_pageWriteCheck, ${readBox}, this, '$!{page.Name}', '_writeCheck' )"
+ t:type="CheckBox"/>
+ </div>
</t:if>
<div class="listCol">
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-05 18:49:40 UTC (rev 905)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-08 12:19:05 UTC (rev 906)
@@ -27,12 +27,11 @@
</t:parameter>
</t:if>
- <!--
<t:if test="writeAllowed">
- <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}" onclick="eqEnableBoxes( ${readBox}, ${writeBox},false)" t:type="CheckBox"/>
- <t:label for="${writeBox}"> ${dollar}{equanda-message:authAndConfig.label.Write} </t:label>
+ <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
+ onclick="eqHandlePageBox( this, '$!{group.Name}', '_writeCheck')" t:type="CheckBox"/>
+ <t:label for="${writeBox}"> ${dollar}{equanda-message:authAndConfig.label.Write} | </t:label>
</t:if>
- -->
<input t:id="${listBox}" name="${listBox}" value="${listBox}"
onclick="eqHandlePageBox( this, '$!{group.Name}', '_listCheck')" t:type="CheckBox"/>
@@ -86,10 +85,11 @@
</div>
<t:if test="writeAllowed">
- <div class="writeCol">
- <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
- onclick="eqEnableBoxes( ${readBox}, ${writeBox}, false)" t:type="CheckBox"/>
- </div>
+ <div class="writeCol">
+ <input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
+ onclick="eqHandleFieldBox( ${page.Name}_groupWriteCheck, ${readBox}, this, '$!{group.Name}', '_writeCheck' )"
+ t:type="CheckBox"/>
+ </div>
</t:if>
<div class="listCol">
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.tml.vm 2008-12-05 18:49:40 UTC (rev 905)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.tml.vm 2008-12-08 12:19:05 UTC (rev 906)
@@ -84,7 +84,7 @@
</t:if>
<td style="align: center;">
- <t:if test="equanda-writable:table.${table.Name}">
+ <t:if test="equanda-readable:table.${table.Name}">
<t:equanda.formactionlink context="context_${table.Name}">Configure</t:equanda.formactionlink>
</t:if>
</td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-05 18:49:45
|
Revision: 905
http://equanda.svn.sourceforge.net/equanda/?rev=905&view=rev
Author: brian_reynolds
Date: 2008-12-05 18:49:40 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Add group level list, summary and print boxes.
Improve checkbox javascript.
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-05 18:49:22 UTC (rev 904)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-05 18:49:40 UTC (rev 905)
@@ -8,18 +8,22 @@
<legend>
- $!{group.Name}
+ $!{group.Name} |
#set ($readBox="${group.Name}_groupReadCheck")
#set ($writeBox="${group.Name}_groupWriteCheck")
+#set ($listBox="${group.Name}_groupListCheck")
+#set ($sumBox="${group.Name}_groupSumCheck")
+#set ($printBox="${group.Name}_groupPrintCheck")
+
<input t:id="${readBox}" name="${readBox}" value="${readBox}"
- onclick="eqHandlePageReadBox( ${readBox}, '$!{group.Name}', '_readCheck')"
+ onclick="eqHandlePageBox( ${readBox}, '$!{group.Name}', '_readCheck', '${writeBox}', ${listBox}, ${sumBox}, ${printBox} )"
t:type="CheckBox"/>
<t:if test="roleName">
- <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Read} </t:label>
+ <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Read} | </t:label>
<t:parameter name="else">
- <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Visible} </t:label>
+ <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Visible} | </t:label>
</t:parameter>
</t:if>
@@ -30,6 +34,18 @@
</t:if>
-->
+ <input t:id="${listBox}" name="${listBox}" value="${listBox}"
+ onclick="eqHandlePageBox( this, '$!{group.Name}', '_listCheck')" t:type="CheckBox"/>
+ <t:label for="${listBox}"> ${dollar}{equanda-message:authAndConfig.label.List} | </t:label>
+
+ <input t:id="${sumBox}" name="${sumBox}" value="${sumBox}"
+ onclick="eqHandlePageBox( this, '$!{group.Name}', '_sumCheck')" t:type="CheckBox"/>
+ <t:label for="${sumBox}"> ${dollar}{equanda-message:authAndConfig.label.Summary} | </t:label>
+
+ <input t:id="${printBox}" name="${printBox}" value="${printBox}"
+ onclick="eqHandlePageBox( this, '$!{group.Name}', '_printCheck')" t:type="CheckBox"/>
+ <t:label for="${printBox}"> ${dollar}{equanda-message:authAndConfig.label.Print} | </t:label>
+
</legend>
<div>
@@ -78,17 +94,20 @@
<div class="listCol">
<input t:id="${listBox}" name="${listBox}" value="${listBox}"
- onclick="eqEnableBoxes( ${readBox}, ${listBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${group.Name}_groupListCheck, ${readBox}, this, '$!{group.Name}', '_listCheck' )"
+ t:type="CheckBox"/>
</div>
<div class="summaryCol">
<input t:id="${summaryBox}" name="${summaryBox}" value="${summaryBox}"
- onclick="eqEnableBoxes( ${readBox}, ${summaryBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${group.Name}_groupSumCheck, ${readBox}, this, '$!{group.Name}', '_sumCheck' )"
+ t:type="CheckBox"/>
</div>
<div class="printCol">
<input t:id="${printBox}" name="${printBox}" value="${printBox}"
- onclick="eqEnableBoxes( ${readBox}, ${printBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${group.Name}_groupPrintCheck, ${readBox}, this, '$!{group.Name}', '_printCheck' )"
+ t:type="CheckBox"/>
</div>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-05 18:49:27
|
Revision: 904
http://equanda.svn.sourceforge.net/equanda/?rev=904&view=rev
Author: brian_reynolds
Date: 2008-12-05 18:49:22 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Add group level list, summary and print boxes.
Improve checkbox javascript.
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-05 15:21:00 UTC (rev 903)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-05 18:49:22 UTC (rev 904)
@@ -150,11 +150,14 @@
#end
-## R+W+L checkboxes for every group Groups
+## RWLSP checkboxes for every group
#foreach( $page in $table.Pages )
#foreach( $group in $page.Groups)
#set ($readBox="${group.Name}_groupReadCheck")
#set ($writeBox="${group.Name}_groupWriteCheck")
+#set ($listBox="${group.Name}_groupListCheck")
+#set ($sumBox="${group.Name}_groupSumCheck")
+#set ($printBox="${group.Name}_groupPrintCheck")
@Persist
private boolean $readBox;
public boolean get$readBox(){ return $readBox; }
@@ -164,11 +167,26 @@
private boolean $writeBox;
public boolean get$writeBox(){ return $writeBox; }
public void set$writeBox( boolean val ){ this.$writeBox = val; }
+
+ @Persist
+ private boolean $listBox;
+ public boolean get$listBox(){ return $listBox; }
+ public void set$listBox( boolean val ){ this.$listBox = val; }
+
+ @Persist
+ private boolean $sumBox;
+ public boolean get$sumBox(){ return $sumBox; }
+ public void set$sumBox( boolean val ){ this.$sumBox = val; }
+
+ @Persist
+ private boolean $printBox;
+ public boolean get$printBox(){ return $printBox; }
+ public void set$printBox( boolean val ){ this.$printBox = val; }
#end
#end
-## R/W/L/P/S checkboxes for every field
+## RWLSP checkboxes for every field
#foreach( $field in $table.Fields)
#set ($readBox="${field.Name}_readCheck")
#set ($writeBox="${field.Name}_writeCheck")
@@ -358,7 +376,38 @@
if( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) )
set${pagePrintBox}( true );
#end
+
+#foreach( $group in $page.Groups)
+#foreach( $field in $group.Fields)
+#set ($readBox="${field.Name}_readCheck")
+#set ($writeBox="${field.Name}_writeCheck")
+#set ($listBox="${field.Name}_listCheck")
+#set ($summaryBox="${field.Name}_sumCheck")
+#set ($printBox="${field.Name}_printCheck")
+ set${readBox}( aacProvider.isReadable( "field.${table.Name}.${field.Name}" ) );
+ set${writeBox}( aacProvider.isWritable( "field.${table.Name}.${field.Name}" ) );
+ set${listBox}( aacProvider.isDisplayList( "field.${table.Name}.${field.Name}" ) );
+ set${summaryBox}( aacProvider.isDisplaySummary( "field.${table.Name}.${field.Name}" ) );
+ set${printBox}( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) );
+#set ($groupReadBox="${group.Name}_groupReadCheck")
+#set ($groupWriteBox="${group.Name}_groupWriteCheck")
+#set ($groupListBox="${group.Name}_groupListCheck")
+#set ($groupSumBox="${group.Name}_groupSumCheck")
+#set ($groupPrintBox="${group.Name}_groupPrintCheck")
+ if( aacProvider.isReadable( "field.${table.Name}.${field.Name}" ) )
+ set${groupReadBox}( true );
+ if( aacProvider.isWritable( "field.${table.Name}.${field.Name}" ) )
+ set${groupWriteBox}( true );
+ if( aacProvider.isDisplayList( "field.${table.Name}.${field.Name}" ) )
+ set${groupListBox}( true );
+ if( aacProvider.isDisplaySummary( "field.${table.Name}.${field.Name}" ) )
+ set${groupSumBox}( true );
+ if( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) )
+ set${groupPrintBox}( true );
+#end
#end
+#end
+
#foreach( $select in $table.SelectsNotHidden)
#set ($selectBox="${select.Name}_selectCheck")
set${selectBox}( aacProvider.isReadable( "select.${table.Name}.${select.Name}" ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-05 15:21:22
|
Revision: 903
http://equanda.svn.sourceforge.net/equanda/?rev=903&view=rev
Author: brian_reynolds
Date: 2008-12-05 15:21:00 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Add page level list, summary and print boxes.
Improve checkbox javascript.
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-05 14:01:32 UTC (rev 902)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-05 15:21:00 UTC (rev 903)
@@ -4,17 +4,20 @@
<legend>
- $!{page.Name}
+ $!{page.Name} |
#set ($readBox="${page.Name}_pageReadCheck")
#set ($writeBox="${page.Name}_pageWriteCheck")
+#set ($listBox="${page.Name}_pageListCheck")
+#set ($sumBox="${page.Name}_pageSumCheck")
+#set ($printBox="${page.Name}_pagePrintCheck")
<input t:id="${readBox}" name="${readBox}" value="${readBox}"
- onclick="eqHandlePageReadBox( ${readBox}, '$!{page.Name}', '_readCheck')" t:type="CheckBox"/>
+ onclick="eqHandlePageBox( ${readBox}, '$!{page.Name}', '_readCheck', '${writeBox}', ${listBox}, ${sumBox}, ${printBox} )" t:type="CheckBox"/>
<t:if test="roleName">
- <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Read} </t:label>
+ <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Read} | </t:label>
<t:parameter name="else">
- <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Visible} </t:label>
+ <t:label for="${readBox}"> ${dollar}{equanda-message:authAndConfig.label.Visible} | </t:label>
</t:parameter>
</t:if>
@@ -24,6 +27,18 @@
<t:label for="${writeBox}"> ${dollar}{equanda-message:authAndConfig.label.Write} </t:label>
</t:if>
-->
+
+ <input t:id="${listBox}" name="${listBox}" value="${listBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_listCheck')" t:type="CheckBox"/>
+ <t:label for="${listBox}"> ${dollar}{equanda-message:authAndConfig.label.List} | </t:label>
+
+ <input t:id="${sumBox}" name="${sumBox}" value="${sumBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_sumCheck')" t:type="CheckBox"/>
+ <t:label for="${sumBox}"> ${dollar}{equanda-message:authAndConfig.label.Summary} | </t:label>
+
+ <input t:id="${printBox}" name="${printBox}" value="${printBox}"
+ onclick="eqHandlePageBox( this, '$!{page.Name}', '_printCheck')" t:type="CheckBox"/>
+ <t:label for="${printBox}"> ${dollar}{equanda-message:authAndConfig.label.Print} | </t:label>
</legend>
@@ -73,17 +88,20 @@
<div class="listCol">
<input t:id="${listBox}" name="${listBox}" value="${listBox}"
- onclick="eqEnableBoxes( ${readBox}, ${listBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${page.Name}_pageListCheck, ${readBox}, this, '$!{page.Name}', '_listCheck' )"
+ t:type="CheckBox"/>
</div>
<div class="summaryCol">
<input t:id="${summaryBox}" name="${summaryBox}" value="${summaryBox}"
- onclick="eqEnableBoxes( ${readBox}, ${summaryBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${page.Name}_pageSumCheck, ${readBox}, this, '$!{page.Name}', '_sumCheck' )"
+ t:type="CheckBox"/>
</div>
<div class="printCol">
<input t:id="${printBox}" name="${printBox}" value="${printBox}"
- onclick="eqEnableBoxes( ${readBox}, ${printBox}, false)" t:type="CheckBox"/>
+ onclick="eqHandleFieldBox( ${page.Name}_pagePrintCheck, ${readBox}, this, '$!{page.Name}', '_printCheck' )"
+ t:type="CheckBox"/>
</div>
</div>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-05 14:01:32 UTC (rev 902)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-05 15:21:00 UTC (rev 903)
@@ -116,10 +116,13 @@
return getIsGuiAdmin() && (getRoleName() != null);
}
- ## R/W checkboxes for every group Pages
+ ## RWLSP checkboxes for every page
#foreach( $page in $table.Pages )
#set ($readBox="${page.Name}_pageReadCheck")
#set ($writeBox="${page.Name}_pageWriteCheck")
+#set ($listBox="${page.Name}_pageListCheck")
+#set ($sumBox="${page.Name}_pageSumCheck")
+#set ($printBox="${page.Name}_pagePrintCheck")
@Persist
private boolean $readBox;
public boolean get$readBox(){ return $readBox; }
@@ -129,10 +132,25 @@
private boolean $writeBox;
public boolean get$writeBox(){ return $writeBox; }
public void set$writeBox( boolean val ){ this.$writeBox = val; }
+
+ @Persist
+ private boolean $listBox;
+ public boolean get$listBox(){ return $listBox; }
+ public void set$listBox( boolean val ){ this.$listBox = val; }
+
+ @Persist
+ private boolean $sumBox;
+ public boolean get$sumBox(){ return $sumBox; }
+ public void set$sumBox( boolean val ){ this.$sumBox = val; }
+
+ @Persist
+ private boolean $printBox;
+ public boolean get$printBox(){ return $printBox; }
+ public void set$printBox( boolean val ){ this.$printBox = val; }
#end
-## R/W checkboxes for every group Groups
+## R+W+L checkboxes for every group Groups
#foreach( $page in $table.Pages )
#foreach( $group in $page.Groups)
#set ($readBox="${group.Name}_groupReadCheck")
@@ -312,7 +330,8 @@
throws EquandaPersistenceException
{
AuthAndConfigProvider aacProvider = getAuthsForSelection();
-#foreach( $field in $table.Fields)
+#foreach( $page in $table.Pages)
+#foreach( $field in $page.Fields)
#set ($readBox="${field.Name}_readCheck")
#set ($writeBox="${field.Name}_writeCheck")
#set ($listBox="${field.Name}_listCheck")
@@ -323,7 +342,23 @@
set${listBox}( aacProvider.isDisplayList( "field.${table.Name}.${field.Name}" ) );
set${summaryBox}( aacProvider.isDisplaySummary( "field.${table.Name}.${field.Name}" ) );
set${printBox}( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) );
+#set ($pageReadBox="${page.Name}_pageReadCheck")
+#set ($pageWriteBox="${page.Name}_pageWriteCheck")
+#set ($pageListBox="${page.Name}_pageListCheck")
+#set ($pageSumBox="${page.Name}_pageSumCheck")
+#set ($pagePrintBox="${page.Name}_pagePrintCheck")
+ if( aacProvider.isReadable( "field.${table.Name}.${field.Name}" ) )
+ set${pageReadBox}( true );
+ if( aacProvider.isWritable( "field.${table.Name}.${field.Name}" ) )
+ set${pageWriteBox}( true );
+ if( aacProvider.isDisplayList( "field.${table.Name}.${field.Name}" ) )
+ set${pageListBox}( true );
+ if( aacProvider.isDisplaySummary( "field.${table.Name}.${field.Name}" ) )
+ set${pageSumBox}( true );
+ if( aacProvider.isDisplayPrint( "field.${table.Name}.${field.Name}" ) )
+ set${pagePrintBox}( true );
#end
+#end
#foreach( $select in $table.SelectsNotHidden)
#set ($selectBox="${select.Name}_selectCheck")
set${selectBox}( aacProvider.isReadable( "select.${table.Name}.${select.Name}" ) );
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js 2008-12-05 14:01:32 UTC (rev 902)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js 2008-12-05 15:21:00 UTC (rev 903)
@@ -60,11 +60,21 @@
{
var writeInput = $$( "input#" + writeBoxName );
if( writeInput.length != 0 )
- writeInput[ 0 ].checked = false;
+ {
+ if( writeInput[ 0 ].checked == true )
+ {
+ writeInput[ 0 ].click();
+ }
+ }
var deleteInput = $$( "input#" + deleteBoxName );
if( deleteInput.length != 0 )
- deleteInput[ 0 ].checked = false;
+ {
+ if( deleteInput[ 0 ].checked == true )
+ {
+ deleteInput[ 0 ].click();
+ }
+ }
}
if( trName != null )
@@ -81,7 +91,7 @@
/**
*
*/
-function eqHandlePageReadBox( pageReadBox, fieldSetId, inputId )
+function eqHandlePageBox( pageReadBox, fieldSetId, inputId, pageWriteCheckStr, pageListCheck, pageSummaryCheck, pagePrintCheck )
{
if( pageReadBox.checked == false )
{
@@ -89,17 +99,27 @@
{
// if pageCheck=true and is clicked again (thus firing this event),
// it enables all field boxes, and stay enabled.
+ pageReadBox.click();
setFieldChecks( true, fieldSetId, inputId );
- pageReadBox.checked = true;
}
else
{
// if any field boxes are already enabled, it should uncheck all field boxes
setFieldChecks( false, fieldSetId, inputId );
}
+
+ // set all page checks off
+ var pageWriteCheck = $$( 'fieldSet#' + fieldSetId + " input#" + pageWriteCheckStr );
+ if( pageWriteCheck.length != 0 )
+ {
+ pageWriteCheck[ 0 ].checked = false;
+ }
+
+ pageListCheck.checked = false;
+ pageSummaryCheck.checked = false;
+ pagePrintCheck.checked = false;
}
-
- if( pageReadBox.checked == true )
+ else if( pageReadBox.checked == true )
{
if( anyFieldsChecked( fieldSetId, inputId ) == false )
{
@@ -118,28 +138,53 @@
{
pageReadCheck.click();
}
-
- if( fieldReadCheck.checked == false )
+ else if( fieldReadCheck.checked == false )
{
var fieldWriteCheck = $$( 'fieldSet#' + fieldSetId + " input#" + fieldWriteCheckStr );
if( fieldWriteCheck.length != 0 )
{
- fieldWriteCheck[0].checked = false;
+ fieldWriteCheck[ 0 ].checked = false;
}
- fieldListCheck.checked=false;
- fieldSummaryCheck.checked=false;
- fieldPrintCheck.checked=false;
+ fieldListCheck.checked = false;
+ fieldSummaryCheck.checked = false;
+ fieldPrintCheck.checked = false;
if( anyFieldsChecked( fieldSetId, inputId ) == false )
- {
+ {
// all fields are off
if( pageReadCheck.checked == true )
{
pageReadCheck.click();
}
}
+ }
+}
+
+/**
+ *
+ */
+function eqHandleFieldBox( pageCheck, fieldReadCheck, fieldCheck, fieldSetId, inputId )
+{
+ // list implies read
+ if( fieldReadCheck.checked == false && fieldCheck.checked == true )
+ {
+ fieldReadCheck.click();
+ }
+
+ // if any fields are checked, the page needs to be checked
+ if( fieldCheck.checked == true && pageCheck.checked == false )
+ {
+ pageCheck.click();
+ }
+ // if all field checks are unchecked, then the page check should be off too.
+ if( fieldCheck.checked == false )
+ {
+ if( anyFieldsChecked( fieldSetId, inputId ) == false && pageCheck.checked == true)
+ {
+ pageCheck.click();
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-05 14:01:56
|
Revision: 902
http://equanda.svn.sourceforge.net/equanda/?rev=902&view=rev
Author: brian_reynolds
Date: 2008-12-05 14:01:32 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Add code to ensure existing AAC values are not thrown away
Modified Paths:
--------------
trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java
trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java
Modified: trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java 2008-12-04 17:31:43 UTC (rev 901)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java 2008-12-05 14:01:32 UTC (rev 902)
@@ -52,6 +52,8 @@
private int value;
public AuthAndConfig( int value ) { this.value = value; }
+
+ protected int getValue(){ return this.value; }
public boolean isReadable() { return ( value & AUTH_READABLE_TEST ) == AUTH_READABLE_TEST; }
Modified: trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java 2008-12-04 17:31:43 UTC (rev 901)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java 2008-12-05 14:01:32 UTC (rev 902)
@@ -77,17 +77,23 @@
public void setDisplayList( String key )
{
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_LIST ) );
+ AuthAndConfig current = getFor( key );
+
+ map.put( key, new AuthAndConfig( current.getValue() | AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_LIST ) );
}
public void setDisplaySummary( String key )
{
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_SUMMARY ) );
+ AuthAndConfig current = getFor( key );
+
+ map.put( key, new AuthAndConfig( current.getValue() | AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_SUMMARY ) );
}
public void setDisplayPrint( String key )
{
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_PRINT ) );
+ AuthAndConfig current = getFor( key );
+
+ map.put( key, new AuthAndConfig( current.getValue() | AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_PRINT ) );
}
public void setHidden( String key )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-04 17:32:01
|
Revision: 901
http://equanda.svn.sourceforge.net/equanda/?rev=901&view=rev
Author: triathlon98
Date: 2008-12-04 17:31:43 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java
trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java
trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/config/checkstyle.xml
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/services/AppModule.java
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml
trunk/equanda-test/test-core/src/main/java/org/equanda/test/TestExceptionCodes.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/AutoFieldsMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/EquandaRoleMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VehicleWithWingsMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/DefaultSample.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java
trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/components/Layout.java
trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/pages/Start.java
trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/services/AppModule.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/export/ExportTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -338,7 +338,6 @@
}
public EquandaList<ELTYPE> clone()
- throws CloneNotSupportedException
{
EquandaList<ELTYPE> clone = new EquandaList<ELTYPE>();
clone.proxySetterUsed = proxySetterUsed;
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -44,18 +44,18 @@
public static final String FILTER_PARAMETER_PREFIX = "equandaFilter";
private ObjectSelector() {}
-
- protected static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery )
+
+ public static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery )
{
return getEquandaQuery( em, equandaQuery, null, true );
}
- protected static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery, String queryString )
+ public static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery, String queryString )
{
return getEquandaQuery( em, equandaQuery, queryString, true );
}
- protected static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery, String queryString,
+ public static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery, String queryString,
boolean setLimits )
{
if ( queryString == null ) queryString = equandaQuery.getQueryString();
@@ -79,7 +79,7 @@
* @param query String representation of query
* @return object name
*/
- protected static String getQueryObject( String query )
+ public static String getQueryObject( String query )
{
String obj;
if ( query.toUpperCase().startsWith( "SELECT " ) )
@@ -243,7 +243,7 @@
* @param fieldName new field for use with ORDER BY
* @return the new calculated query
*/
- protected static String setOrderBy( String queryStr, String fieldName )
+ public static String setOrderBy( String queryStr, String fieldName )
{
if ( fieldName == null || fieldName.length() == 0 ) return queryStr;
TextBuilder builder = TextBuilder.newInstance();
@@ -277,7 +277,7 @@
* @param wherePart stuff which needs to be inserted in the "where" part of the query
* @return the new calculated query
*/
- protected static String setFilter( EquandaQuery equandaQuery, String queryStr, String name, String fromPart,
+ public static String setFilter( EquandaQuery equandaQuery, String queryStr, String name, String fromPart,
String wherePart )
{
String value = SelectorsState.getFilter( name );
Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2008-12-04 17:31:43 UTC (rev 901)
@@ -40,6 +40,7 @@
import org.equanda.persistence.query.EquandaQuery;
import org.equanda.persistence.query.EquandaQueryImpl;
import org.equanda.persistence.Uoid;
+import org.equanda.persistence.ObjectSelector;
import org.equanda.persistence.SelectorsState;
import javax.persistence.EntityManager;
import javax.persistence.Query;
@@ -52,7 +53,6 @@
* $table.Description
*/
public class DM${table.Name}Selector
- extends org.equanda.persistence.ObjectSelector
{
#macro( selectQueryParameters $select )
@@ -145,7 +145,6 @@
{
public int compare(DM${table.Name}Bean obj1, DM${table.Name}Bean obj2)
{
-
int ret=0;
#foreach( $order in $select.OrderFields )
if ( ret == 0 )
@@ -237,10 +236,10 @@
String sorting = SelectorsState.getSorting( "$table.Name" );
Query query;
String queryString = equandaQuery.getQueryString();
- queryString = setOrderBy( queryString, sorting );
+ queryString = ObjectSelector.setOrderBy( queryString, sorting );
queryString = setFilters( equandaQuery, queryString );
- query = getEquandaQuery( em, equandaQuery, queryString );
+ query = ObjectSelector.getEquandaQuery( em, equandaQuery, queryString );
return (List<DM${table.Name}Bean>) query.getResultList();
} finally { equandaQuery.clearExtra(); }
}
@@ -251,7 +250,7 @@
{
EquandaQuery query = EquandaGlobal.getQuery( "${table.Name}.equanda${field.Name}Unique" );
query.setParameter( "${field.VarName}", ${field.VarName} );
- Query q = getEquandaQuery( em, query );
+ Query q = ObjectSelector.getEquandaQuery( em, query );
return (Long)q.getResultList().get( 0 );
}
#end
@@ -270,7 +269,7 @@
query = EquandaGlobal.getQuery( "${table.Name}.equanda${field.Name}UniqueNull" );
}
query.setParameter( "${field.VarName}", ${field.VarName} );
- Query q = getEquandaQuery( em, query );
+ Query q = ObjectSelector.getEquandaQuery( em, query );
return (Long)q.getResultList().get( 0 );
}
#end
@@ -290,7 +289,7 @@
public static String setFilters( EquandaQuery equandaQuery, String queryString )
{
#foreach( $filter in $table.DataFilters )
- queryString = setFilter( equandaQuery, queryString, "$filter.Name", "$filter.FilterQuery.From", "$filter.FilterQuery.Where" );
+ queryString = ObjectSelector.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;
@@ -310,9 +309,9 @@
//em.flush();
Query query;
- String queryString = getRunCountQueryString( equandaQuery );
+ String queryString = ObjectSelector.getRunCountQueryString( equandaQuery );
queryString = setFilters( equandaQuery, queryString );
- query = getEquandaQuery( em, equandaQuery, queryString, false );
+ query = ObjectSelector.getEquandaQuery( em, equandaQuery, queryString, false );
Map<String, Object> parameters = equandaQuery.getParameters();
for ( String name : parameters.keySet() ) query.setParameter( name, parameters.get( name ) );
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2008-12-04 17:31:43 UTC (rev 901)
@@ -299,7 +299,7 @@
if ( !objectEquals( status, proxy.equandaStatus ) )
{
proxy.equandaStatus = status;
- proxy._modifiedEquandaStatus = true;
+ proxy.equandaModifiedEquandaStatus = true;
}
}
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm 2008-12-04 17:31:43 UTC (rev 901)
@@ -98,7 +98,7 @@
public boolean isModified( boolean typeFieldsOnly )
{
- if ( _modifiedEquandaStatus ) return true;
+ if ( equandaModifiedEquandaStatus ) return true;
#foreach( $field in $table.FieldsNotInternalAndNotCalculated )
if ( typeFieldsOnly )
{
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2008-12-04 17:31:43 UTC (rev 901)
@@ -45,6 +45,7 @@
import org.equanda.persistence.EquandaPersistenceException;
import org.equanda.persistence.Uoid;
import org.equanda.persistence.query.EquandaQueryImpl;
+import org.equanda.persistence.ObjectSelector;
import org.equanda.persistence.SelectorsState;
import java.util.ArrayList;
@@ -278,7 +279,7 @@
public long equandaRunUpdateQuery( EquandaQuery query )
throws EquandaPersistenceException
{
- return DM${table.Name}Selector.runUpdateQuery( entityManager, query );
+ return ObjectSelector.runUpdateQuery( entityManager, query );
}
public ${package}.client.${table.Name} selectEquandaSingle( EquandaQuery query )
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2008-12-04 17:31:43 UTC (rev 901)
@@ -71,7 +71,7 @@
String errorField = "";
try
{
- if ( proxy._modifiedEquandaStatus )
+ if ( proxy.equandaModifiedEquandaStatus )
{
errorField = "EquandaStatus";
if ( !objectEquals( proxy.equandaStatus, bean.getEquandaStatus() ) )
Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/config/checkstyle.xml
===================================================================
--- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/config/checkstyle.xml 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/config/checkstyle.xml 2008-12-04 17:31:43 UTC (rev 901)
@@ -35,6 +35,7 @@
<!-- Block checks, see http://checkstyle.sourceforge.net/config_blocks.html -->
+ <!-- disabled because we allow all on one line if it fits
<module name="LeftCurly">
<property name="severity" value="info"/>
<property name="option" value="nl"/>
@@ -43,6 +44,7 @@
<property name="severity" value="info"/>
<property name="option" value="alone"/>
</module>
+ -->
<!--<module name="EmptyBlock"/>-->
<module name="AvoidNestedBlocks"/>
<!--<module name="NeedBraces"/> no braces is allowed when on same line -->
@@ -89,7 +91,9 @@
<!--<module name="AvoidStarImport"/>-->
<module name="IllegalImport"/>
<module name="RedundantImport"/>
- <module name="UnusedImports"/>
+ <module name="UnusedImports">
+ <property name="severity" value="info"/>
+ </module>
<module name="ImportOrder">
<property name="groups" value="be,org"/>
<property name="severity" value="info"/>
@@ -102,12 +106,14 @@
<property name="severity" value="info"/>
<property name="max" value="120"/>
</module>
+ <!--
<module name="FileLength">
<property name="severity" value="info"/>
</module>
<module name="MethodLength">
<property name="severity" value="info"/>
</module>
+ -->
<module name="ParameterNumber">
<property name="severity" value="info"/>
</module>
@@ -169,7 +175,9 @@
<!--<module name="AvoidInlineConditionals"/>-->
<module name="CovariantEquals"/>
<module name="DoubleCheckedLocking"/>
- <module name="EmptyStatement"/>
+ <module name="EmptyStatement">
+ <property name="severity" value="info"/>
+ </module>
<module name="EqualsHashCode"/>
<!--<module name="FinalLocalVariable"/>-->
<module name="HiddenField">
@@ -188,7 +196,9 @@
<property name="severity" value="warning"/>
</module>
<!--<module name="MagicNumber"/>-->
- <module name="MissingSwitchDefault"/>
+ <module name="MissingSwitchDefault">
+ <property name="severity" value="info"/>
+ </module>
<module name="ModifiedControlVariable"/>
<!--<module name="RedundantThrows"/>-->
<module name="SimplifyBooleanExpression"/>
@@ -196,7 +206,7 @@
<module name="StringLiteralEquality"/>
<!--<module name="NestedIfDepth"/>-->
<!--<module name="NestedTryDepth"/>-->
- <module name="SuperClone"/>
+ <!--<module name="SuperClone"/>-->
<module name="SuperFinalize"/>
<!--<module name="IllegalCatch"/>-->
<!--<module name="IllegalThrows"/>-->
@@ -205,7 +215,9 @@
<!--<module name="ReturnCount"/>-->
<!--<module name="IllegalType"/>-->
<!--<module name="DeclarationOrder"/>-->
- <module name="ParameterAssignment"/>
+ <module name="ParameterAssignment">
+ <property name="severity" value="info"/>
+ </module>
<module name="ExplicitInitialization">
<property name="severity" value="info"/>
</module>
@@ -224,7 +236,7 @@
<property name="protectedAllowed" value="true"/>
</module>
<module name="FinalClass"/>
- <module name="InterfaceIsType"/>
+ <!--<module name="InterfaceIsType"/>-->
<module name="HideUtilityClassConstructor"/>
<!--<module name="DesignForExtension"/>-->
<!--<module name="MutableException"/>-->
@@ -233,6 +245,7 @@
<!-- misc, see http://checkstyle.sourceforge.net/config_misc.html -->
<module name="GenericIllegalRegexp">
+ <property name="severity" value="info"/>
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/services/AppModule.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/services/AppModule.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/services/AppModule.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -55,8 +55,10 @@
* This module is automatically included as part of the Tapestry IoC Registry, it's a good place to configure and extend
* Tapestry, or to place your own service definitions.
*/
-public class AppModule
+public final class AppModule
{
+ private AppModule() {}
+
/**
* Bind extra services.
*
@@ -112,7 +114,7 @@
* @param log log
* @return request filter
*/
- public RequestFilter buildTimingFilter( final Logger log )
+ public static RequestFilter buildTimingFilter( final Logger log )
{
return new RequestFilter()
{
@@ -148,7 +150,7 @@
* @param persistentLocale locale to allow chaning to user preference
* @return request filter
*/
- public RequestFilter buildLoginFilter( final Logger log,
+ public static RequestFilter buildLoginFilter( final Logger log,
final RequestGlobals requestGlobals,
final PersistentLocale persistentLocale,
final LoginInfoService loginInfoService )
@@ -211,7 +213,7 @@
* @param timingFilter filter info
* @param loginFilter filter info
*/
- public void contributeRequestHandler( OrderedConfiguration<RequestFilter> configuration,
+ public static void contributeRequestHandler( OrderedConfiguration<RequestFilter> configuration,
@InjectService( "TimingFilter" )RequestFilter timingFilter,
@InjectService( "LoginFilter" )RequestFilter loginFilter )
{
Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml
===================================================================
--- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml 2008-12-04 17:31:43 UTC (rev 901)
@@ -85,6 +85,21 @@
<inherited>false</inherited>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>config/checkstyle.xml</configLocation>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<executions>
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/TestExceptionCodes.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/TestExceptionCodes.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/TestExceptionCodes.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -31,17 +31,17 @@
*/
public interface TestExceptionCodes
{
- public static int EPE_PROBLEM_IN_AUTOPASSPORT = 100001;
- public static int EPE_PROBLEM_IN_AUTOMULTIPLEAUTO = 100002;
- public static int EPE_PROBLEM_IN_AUTOMULTIPLEPASSPORT = 100003;
- public static int EPE_SAME_IDENTIFIER_USED_FOR_EDIT_AND_RUN_ACCESS = 100004;
- public static int EPE_RESULTNAME_CANNOT_BE_NULL = 100005;
- public static int EPE_MERGENAME_MUST_EXIST_CANNOT_BE_NULL = 100006;
- public static int EPE_ROLE_NOT_FOUND = 100007;
+ static int EPE_PROBLEM_IN_AUTOPASSPORT = 100001;
+ static int EPE_PROBLEM_IN_AUTOMULTIPLEAUTO = 100002;
+ static int EPE_PROBLEM_IN_AUTOMULTIPLEPASSPORT = 100003;
+ static int EPE_SAME_IDENTIFIER_USED_FOR_EDIT_AND_RUN_ACCESS = 100004;
+ static int EPE_RESULTNAME_CANNOT_BE_NULL = 100005;
+ static int EPE_MERGENAME_MUST_EXIST_CANNOT_BE_NULL = 100006;
+ static int EPE_ROLE_NOT_FOUND = 100007;
- public static int ECV_NUMBER_NOT_MULTIPLE_OF_100 = 110001;
- public static int ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD = 110002;
- public static int ECV_REMOVE2_NOT_ALOWED_STRING_TO_REMOVE = 110003;
+ static int ECV_NUMBER_NOT_MULTIPLE_OF_100 = 110001;
+ static int ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD = 110002;
+ static int ECV_REMOVE2_NOT_ALOWED_STRING_TO_REMOVE = 110003;
- public static int EDE_TOO_SLOW_FOR_A_VEHICLE_WITH_WINGS = 140001;
+ static int EDE_TOO_SLOW_FOR_A_VEHICLE_WITH_WINGS = 140001;
}
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -65,7 +65,7 @@
{
try
{
- for ( int i = 0 ; i < 10 ; i++ )
+ for ( int i = 0; i < 10 ; i++ )
{
Thread.sleep( 1000 );
System.out.println( i );
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/AutoFieldsMediator.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/AutoFieldsMediator.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/AutoFieldsMediator.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -60,7 +60,7 @@
}
catch ( Exception e )
{
- throw new EquandaPersistenceException( EPE_PROBLEM_IN_AUTOMULTIPLEAUTO, e);
+ throw new EquandaPersistenceException( EPE_PROBLEM_IN_AUTOMULTIPLEAUTO, e );
}
array.add( obj );
return array;
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/EquandaRoleMediator.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/EquandaRoleMediator.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/EquandaRoleMediator.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -25,15 +25,9 @@
package org.equanda.test.dm.server;
import org.equanda.persistence.EquandaPersistenceException;
-import org.equanda.test.dm.client.*;
import org.equanda.test.TestExceptionCodes;
-import org.equanda.validation.EditableRights;
-import org.equanda.validation.RunnableRights;
-import java.util.Collection;
-import java.util.ArrayList;
-
/**
* Mediator for EquandaRole. Implementation for functions mergeRights & mergeRestrictions
*
@@ -58,7 +52,8 @@
}
/*
- private void mixRights( Collection<EquandaRight> col1, Collection<EquandaRight> col2, Collection<EquandaRight> result, boolean restrict )
+ private void mixRights( Collection<EquandaRight> col1, Collection<EquandaRight> col2,
+ Collection<EquandaRight> result, boolean restrict )
throws EquandaPersistenceException
{
for ( EquandaRight right1 : col1 )
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -1,14 +1,38 @@
+/**
+ * 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.test.dm.server;
-import org.equanda.persistence.Uoid;
import org.equanda.persistence.EquandaConstraintViolation;
import org.equanda.persistence.EquandaPersistenceException;
+import org.equanda.persistence.Uoid;
+import static org.equanda.test.TestExceptionCodes.ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD;
import org.equanda.test.dm.server.pm.DMRemove2Bean;
import org.equanda.test.dm.server.pm.DMRemove2Selector;
-import static org.equanda.test.TestExceptionCodes.ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD;
/**
- * Description!!!
+ * Mediator for "Linkable"
*
* @author <a href="mailto:an...@pa...">Andrei Chiritescu</a>
*/
@@ -58,7 +82,7 @@
if ( REMOVE2_NOT_ALOWED_STRING_TO_ADD.equals( obj.getTheString() ) )
{
throw new EquandaConstraintViolation( ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD,
- REMOVE2_NOT_ALOWED_STRING_TO_ADD );
+ REMOVE2_NOT_ALOWED_STRING_TO_ADD );
}
}
}
@@ -72,7 +96,7 @@
if ( REMOVE2_NOT_ALOWED_STRING_TO_REMOVE.equals( obj.getTheString() ) )
{
throw new EquandaConstraintViolation( ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD,
- REMOVE2_NOT_ALOWED_STRING_TO_ADD );
+ REMOVE2_NOT_ALOWED_STRING_TO_ADD );
}
}
}
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VehicleWithWingsMediator.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VehicleWithWingsMediator.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VehicleWithWingsMediator.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -46,11 +46,11 @@
}
try
{
- super.setSpeed( speed );
- }
- catch (Exception e)
- {
- throw new EquandaConstraintViolation(e);
- }
+ super.setSpeed( speed );
+ }
+ catch ( Exception e )
+ {
+ throw new EquandaConstraintViolation( e );
+ }
}
}
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/DefaultSample.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/DefaultSample.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/DefaultSample.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -38,4 +38,4 @@
{
return 1111;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java
===================================================================
--- trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -26,8 +26,8 @@
import org.equanda.validation.EnumerableChoiceAdapter;
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.ArrayList;
/**
Modified: trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/components/Layout.java
===================================================================
--- trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/components/Layout.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/components/Layout.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -38,7 +38,7 @@
public class Layout
{
@Inject
- @Path("context:css/style.css")
+ @Path( "context:css/style.css" )
private Asset style;
@Inject
Modified: trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/pages/Start.java
===================================================================
--- trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/pages/Start.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/pages/Start.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -26,13 +26,11 @@
import java.util.Date;
-/**
- * Start page of application ca-t5gui.
- */
+/** Start page of application ca-t5gui. */
public class Start
{
- public Date getCurrentTime()
- {
- return new Date();
- }
-}
\ No newline at end of file
+ public Date getCurrentTime()
+ {
+ return new Date();
+ }
+}
Modified: trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/services/AppModule.java
===================================================================
--- trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/services/AppModule.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-t5-gui/src/main/java/org/equanda/test/gui/services/AppModule.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -25,14 +25,10 @@
package org.equanda.test.gui.services;
import javassist.runtime.Desc;
-import org.apache.tapestry5.Translator;
-import org.apache.tapestry5.ioc.Configuration;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.ioc.annotations.InjectService;
-import org.apache.tapestry5.ioc.services.Coercion;
-import org.apache.tapestry5.ioc.services.CoercionTuple;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.RequestFilter;
import org.apache.tapestry5.services.RequestHandler;
@@ -45,8 +41,10 @@
* This module is automatically included as part of the Tapestry IoC Registry, it's a good place to configure and extend
* Tapestry, or to place your own service definitions.
*/
-public class AppModule
+public final class AppModule
{
+ private AppModule() {}
+
/**
* Bind extra services.
*
@@ -102,7 +100,7 @@
* @param log log
* @return request filter
*/
- public RequestFilter buildTimingFilter( final Logger log )
+ public static RequestFilter buildTimingFilter( final Logger log )
{
return new RequestFilter()
{
@@ -136,7 +134,7 @@
* @param configuration configuration to add to
* @param filter filter info
*/
- public void contributeRequestHandler( OrderedConfiguration<RequestFilter> configuration,
+ public static void contributeRequestHandler( OrderedConfiguration<RequestFilter> configuration,
@InjectService( "TimingFilter" )
RequestFilter filter )
{
Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/export/ExportTest.java
===================================================================
--- trunk/equanda-test/test-test/src/test/java/org/equanda/test/export/ExportTest.java 2008-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/export/ExportTest.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -242,7 +242,7 @@
}
/*
- * exports the EQUANDA_TYPE of a car
+ * exports the EquandaType of a car
* checks the results
*/
public void testExportEquandaType()
@@ -256,7 +256,7 @@
IniFile ini = new IniFile();
ini.addSection( "Vehicle" );
ini.addValue( "Vehicle", "file", EXPORT_OUTPUT_FILENAME_VEHICLE );
- ini.addValue( "Vehicle", "1", "EQUANDA_TYPE" );
+ ini.addValue( "Vehicle", "1", "EquandaType" );
// export car
exp.export( veh.getEquanda(), veh.getEquanda(), ini, null, true, null );
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-12-04 15:25:02 UTC (rev 900)
+++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java 2008-12-04 17:31:43 UTC (rev 901)
@@ -280,7 +280,7 @@
String name = "Boeing";
int radius = 10;
String lines[] = {
- ":table:Vehicle:EQUANDA_TYPE,Radius,Name",
+ ":table:Vehicle:EquandaType,Radius,Name",
ImportUtil.quote( "AIRP" ) + ',' + radius + ',' + ImportUtil.quote( name )
};
assertNull( ImportUtil.importStrings( lines, URL, getImportCredentials() ) );
@@ -325,7 +325,7 @@
String name = "Boeing3";
int radius = 10;
String lines[] = {
- ":table:VehicleWithWheels:EQUANDA_TYPE,Radius,Name",
+ ":table:VehicleWithWheels:EquandaType,Radius,Name",
ImportUtil.quote( "AIRP" ) + ',' + radius + ',' + ImportUtil.quote( name )
};
assertNull( ImportUtil.importStrings( lines, URL, getImportCredentials() ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-04 15:25:13
|
Revision: 900
http://equanda.svn.sourceforge.net/equanda/?rev=900&view=rev
Author: triathlon98
Date: 2008-12-04 15:25:02 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/DdltoolPlugin.java
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/JarUtil.java
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TemplatePlugin.java
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TranslatePlugin.java
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetype.java
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptor.java
trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptorBuilder.java
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-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/DdltoolPlugin.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -62,9 +62,7 @@
*/
private String database;
- /**
- * @parameter expression="org.firebirdsql.jdbc.FBDriver"
- */
+ /** @parameter expression="org.firebirdsql.jdbc.FBDriver" */
private String dbclass;
/**
@@ -74,19 +72,13 @@
*/
private String dbmap;
- /**
- * @parameter expression="sysdba"
- */
+ /** @parameter expression="sysdba" */
private String dblogin;
- /**
- * @parameter expression="masterkey"
- */
+ /** @parameter expression="masterkey" */
private String dbpassword;
- /**
- * @parameter expression="update defaults indexes"
- */
+ /** @parameter expression="update defaults indexes" */
private String ddltargets;
/**
Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/JarUtil.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/JarUtil.java 2008-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/JarUtil.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -33,8 +33,10 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class JarUtil
+public final class JarUtil
{
+ private JarUtil() {}
+
/**
* Unjar a jar file to a directory, avoiding creation of file which are "overwritten".
*
Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TemplatePlugin.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TemplatePlugin.java 2008-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TemplatePlugin.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -24,18 +24,17 @@
package org.equanda.plugin;
+import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Repository;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.List;
import java.util.Collection;
+import java.util.List;
/**
* Maven plugin for equanda code generation.
Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TranslatePlugin.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TranslatePlugin.java 2008-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/TranslatePlugin.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -40,39 +40,25 @@
public class TranslatePlugin
extends AbstractMojo
{
- /**
- * @parameter expression="dm.xml"
- */
+ /** @parameter expression="dm.xml" */
private String definition;
- /**
- * @parameter expression="${basedir}/../src/main/dm"
- */
+ /** @parameter expression="${basedir}/../src/main/dm" */
private String sourceDirectory;
- /**
- * @parameter expression="true"
- */
+ /** @parameter expression="true" */
private boolean importDbKeysOnly;
- /**
- * @parameter expression="true"
- */
+ /** @parameter expression="true" */
private boolean infrastructure;
- /**
- * @parameter expression="equanda-table"
- */
+ /** @parameter expression="equanda-table" */
private String context;
- /**
- * @parameter expression="equanda-table"
- */
+ /** @parameter expression="equanda-table" */
private String keyPrefixesToKeep;
- /**
- * @parameter expression="${basedir}/src/main/resources/translations.txt"
- */
+ /** @parameter expression="${basedir}/src/main/resources/translations.txt" */
private String translateTarget;
/**
@@ -82,14 +68,10 @@
*/
private String verifyLanguages;
- /**
- * @parameter expression="1000"
- */
+ /** @parameter expression="1000" */
private int width;
- /**
- * @parameter expression="600"
- */
+ /** @parameter expression="600" */
private int height;
public void execute()
@@ -104,10 +86,10 @@
public void uncaughtException( Thread thread, Throwable throwable )
{
SaveException.saveException( throwable, "during equanda:translate" );
- synchronized ( waitFor )
- {
- waitFor.notifyAll();
- }
+ synchronized ( waitFor )
+ {
+ waitFor.notifyAll();
+ }
}
} );
@@ -118,10 +100,10 @@
catch ( Exception ex )
{
SaveException.saveException( ex, "problems while editing translations" );
- synchronized ( waitFor )
- {
- waitFor.notifyAll();
- }
+ synchronized ( waitFor )
+ {
+ waitFor.notifyAll();
+ }
throw new MojoExecutionException( "problems while editing translations", ex );
}
synchronized ( waitFor )
Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetype.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetype.java 2008-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetype.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -24,14 +24,6 @@
package org.equanda.plugin.archetype;
-import java.io.*;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import org.apache.maven.archetype.Archetype;
import org.apache.maven.archetype.ArchetypeDescriptorException;
import org.apache.maven.archetype.ArchetypeNotFoundException;
@@ -62,6 +54,14 @@
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
+import java.io.*;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
/**
* Default Equanda Archetype
*
@@ -79,19 +79,15 @@
private static final String DEFAULT_SOURCE_DIR = "/src/main/java";
- /**
- * @plexus.requirement
- */
+ /** @plexus.requirement */
private VelocityComponent velocity;
- /**
- * @plexus.requirement
- */
+ /** @plexus.requirement */
private Downloader downloader;
public void createArchetype( String archetypeGroupId, String archetypeArtifactId, String archetypeVersion,
- ArtifactRepository localRepository, List remoteRepositories, Map parameters )
- throws ArchetypeNotFoundException, ArchetypeDescriptorException, ArchetypeTemplateProcessingException
+ ArtifactRepository localRepository, List remoteRepositories, Map parameters )
+ throws ArchetypeNotFoundException, ArchetypeDescriptorException, ArchetypeTemplateProcessingException
{
String packageName = (String) parameters.get( "package" );
@@ -118,7 +114,7 @@
try
{
archetype = downloader.download( archetypeGroupId, archetypeArtifactId, archetypeVersion, localRepository,
- remoteRepositories );
+ remoteRepositories );
}
catch ( DownloadException e )
{
@@ -136,8 +132,8 @@
{
getLogger().info( "----------------------------------------------------------------------------" );
getLogger().info(
- "Using following parameters for creating Archetype: " + archetypeArtifactId + ":"
- + archetypeVersion );
+ "Using following parameters for creating Archetype: " + archetypeArtifactId + ":"
+ + archetypeVersion );
getLogger().info( "----------------------------------------------------------------------------" );
Set keys = parameters.keySet();
@@ -174,7 +170,7 @@
if ( is == null )
{
throw new ArchetypeDescriptorException( "The " + ARCHETYPE_DESCRIPTOR
- + " descriptor cannot be found." );
+ + " descriptor cannot be found." );
}
}
String content = IOUtil.toString( is );
@@ -226,7 +222,7 @@
else
{
throw new ArchetypeTemplateProcessingException( outputDirectoryFile.getName()
- + " already exists - please run from a clean directory" );
+ + " already exists - please run from a clean directory" );
}
}
pomFile = new File( outputDirectoryFile, ARCHETYPE_POM );
@@ -339,7 +335,7 @@
}
static boolean addModuleToParentPom( String artifactId, Reader fileReader, Writer fileWriter )
- throws DocumentException, IOException, ArchetypeTemplateProcessingException
+ throws DocumentException, IOException, ArchetypeTemplateProcessingException
{
SAXReader reader = new SAXReader();
Document document = reader.read( fileReader );
@@ -365,7 +361,7 @@
project.addText( "\n" );
}
boolean found = false;
- for ( Iterator i = modules.elementIterator( "module" ); i.hasNext() && !found; )
+ for ( Iterator i = modules.elementIterator( "module" ); i.hasNext() && !found ; )
{
Element module = (Element) i.next();
if ( module.getText().equals( artifactId ) )
@@ -376,7 +372,7 @@
if ( !found )
{
Node lastTextNode = null;
- for ( Iterator i = modules.nodeIterator(); i.hasNext(); )
+ for ( Iterator i = modules.nodeIterator(); i.hasNext() ; )
{
Node node = (Node) i.next();
if ( node.getNodeType() == Node.ELEMENT_NODE )
@@ -405,8 +401,8 @@
}
private void processTemplates( File pomFile, String outputDirectory, Context context,
- EquandaArchetypeDescriptor descriptor, String packageName, Model parentModel )
- throws ArchetypeTemplateProcessingException
+ EquandaArchetypeDescriptor descriptor, String packageName, Model parentModel )
+ throws ArchetypeTemplateProcessingException
{
if ( !pomFile.exists() )
{
@@ -481,8 +477,8 @@
if ( getLogger().isDebugEnabled() )
{
getLogger()
- .debug(
- "********************* Debug info for resources created from generated Model ***********************" );
+ .debug(
+ "********************* Debug info for resources created from generated Model ***********************" );
}
if ( getLogger().isDebugEnabled() )
@@ -567,7 +563,7 @@
}
getLogger().info(
- "********************* End of debug info from resources from generated POM ***********************" );
+ "********************* End of debug info from resources from generated POM ***********************" );
// Main
@@ -628,8 +624,8 @@
}
private void processTemplate( String outputDirectory, Context context, String template,
- EquandaTemplateDescriptor descriptor, boolean packageInFileName, String packageName )
- throws ArchetypeTemplateProcessingException
+ EquandaTemplateDescriptor descriptor, boolean packageInFileName, String packageName )
+ throws ArchetypeTemplateProcessingException
{
processTemplate( outputDirectory, context, template, descriptor, packageInFileName, packageName, null );
}
@@ -637,11 +633,12 @@
private String getOutputDirectory( String outputDirectory, String testResourceDirectory )
{
return outputDirectory
- + ( testResourceDirectory.startsWith( "/" ) ? testResourceDirectory : "/" + testResourceDirectory );
+ + ( testResourceDirectory.startsWith( "/" ) ? testResourceDirectory : "/" + testResourceDirectory );
}
protected void processSources( String outputDirectory, Context context, EquandaArchetypeDescriptor descriptor,
- String packageName, String sourceDirectory ) throws ArchetypeTemplateProcessingException
+ String packageName, String sourceDirectory )
+ throws ArchetypeTemplateProcessingException
{
for ( String template : descriptor.getSources() )
{
@@ -651,7 +648,8 @@
}
protected void processTestSources( String outputDirectory, Context context, EquandaArchetypeDescriptor descriptor,
- String packageName, String testSourceDirectory ) throws ArchetypeTemplateProcessingException
+ String packageName, String testSourceDirectory )
+ throws ArchetypeTemplateProcessingException
{
for ( String template : descriptor.getTestSources() )
{
@@ -661,7 +659,8 @@
}
protected void processResources( String outputDirectory, Context context, EquandaArchetypeDescriptor descriptor,
- String packageName ) throws ArchetypeTemplateProcessingException
+ String packageName )
+ throws ArchetypeTemplateProcessingException
{
for ( String template : descriptor.getResources() )
{
@@ -671,7 +670,8 @@
}
protected void processTestResources( String outputDirectory, Context context,
- EquandaArchetypeDescriptor descriptor, String packageName ) throws ArchetypeTemplateProcessingException
+ EquandaArchetypeDescriptor descriptor, String packageName )
+ throws ArchetypeTemplateProcessingException
{
for ( String template : descriptor.getTestResources() )
{
@@ -681,7 +681,8 @@
}
protected void processSiteResources( String outputDirectory, Context context,
- EquandaArchetypeDescriptor descriptor, String packageName ) throws ArchetypeTemplateProcessingException
+ EquandaArchetypeDescriptor descriptor, String packageName )
+ throws ArchetypeTemplateProcessingException
{
for ( String template : descriptor.getSiteResources() )
{
@@ -691,8 +692,9 @@
}
protected void processTemplate( String outputDirectory, Context context, String template,
- EquandaTemplateDescriptor descriptor, boolean packageInFileName, String packageName, String sourceDirectory )
- throws ArchetypeTemplateProcessingException
+ EquandaTemplateDescriptor descriptor, boolean packageInFileName, String packageName,
+ String sourceDirectory )
+ throws ArchetypeTemplateProcessingException
{
template = StringUtils.replace( template, "\\", "/" );
File f;
@@ -751,7 +753,7 @@
if ( !dirname.startsWith( sourceDirectory ) )
{
throw new ArchetypeTemplateProcessingException( "Template '" + template + "' not in directory '"
- + sourceDirectory + "'" );
+ + sourceDirectory + "'" );
}
String extraPackages = dirname.substring( sourceDirectory.length() );
if ( extraPackages.startsWith( "/" ) )
Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptor.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptor.java 2008-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptor.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -21,6 +21,7 @@
* 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.plugin.archetype;
import java.util.ArrayList;
@@ -30,7 +31,7 @@
/**
* Archetype descriptor
- *
+ *
* @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
*/
public class EquandaArchetypeDescriptor
@@ -50,7 +51,7 @@
private Map<String, EquandaTemplateDescriptor> testResourcesDescriptors;
private Map<String, EquandaTemplateDescriptor> siteResourcesDescriptors;
- public EquandaArchetypeDescriptor ( )
+ public EquandaArchetypeDescriptor()
{
super();
Modified: trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptorBuilder.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptorBuilder.java 2008-12-04 13:10:11 UTC (rev 899)
+++ trunk/equanda-maven-plugin/src/main/java/org/equanda/plugin/archetype/EquandaArchetypeDescriptorBuilder.java 2008-12-04 15:25:02 UTC (rev 900)
@@ -21,20 +21,21 @@
* 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.plugin.archetype;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
import java.io.IOException;
import java.io.Reader;
import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
/**
* Equanda Archetype Description Builder
- *
+ *
* @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
*/
public class EquandaArchetypeDescriptorBuilder
@@ -42,12 +43,14 @@
/**
* Builds archetype descriptor
+ *
* @param reader reader
* @return archetype descriptor
- * @throws IOException
- * @throws XmlPullParserException
+ * @throws IOException oops
+ * @throws XmlPullParserException oops
*/
- public EquandaArchetypeDescriptor build( Reader reader ) throws IOException, XmlPullParserException
+ public EquandaArchetypeDescriptor build( Reader reader )
+ throws IOException, XmlPullParserException
{
EquandaArchetypeDescriptor descriptor = new EquandaArchetypeDescriptor();
Xpp3Dom dom = Xpp3DomBuilder.build( reader );
@@ -68,7 +71,7 @@
if ( sources != null )
{
Xpp3Dom[] sourceList = sources.getChildren( "source" );
- for ( int i = 0; i < sourceList.length; i++ )
+ for ( int i = 0; i < sourceList.length ; i++ )
{
addSourceToDescriptor( sourceList[ i ], descriptor );
}
@@ -79,7 +82,7 @@
if ( resources != null )
{
Xpp3Dom[] resourceList = resources.getChildren( "resource" );
- for ( int i = 0; i < resourceList.length; i++ )
+ for ( int i = 0; i < resourceList.length ; i++ )
{
addResourceToDescriptor( resourceList[ i ], descriptor );
}
@@ -90,7 +93,7 @@
if ( testSources != null )
{
Xpp3Dom[] testSourceList = testSources.getChildren( "source" );
- for ( int i = 0; i < testSourceList.length; i++ )
+ for ( int i = 0; i < testSourceList.length ; i++ )
{
addTestSourceToDescriptor( testSourceList[ i ], descriptor );
}
@@ -102,7 +105,7 @@
{
Xpp3Dom[] testResourceList = testResources.getChildren( "resource" );
- for ( int i = 0; i < testResourceList.length; i++ )
+ for ( int i = 0; i < testResourceList.length ; i++ )
{
addTestResourceToDescriptor( testResourceList[ i ], descriptor );
}
@@ -114,7 +117,7 @@
{
Xpp3Dom[] siteResourceList = siteResources.getChildren( "resource" );
- for ( int i = 0; i < siteResourceList.length; i++ )
+ for ( int i = 0; i < siteResourceList.length ; i++ )
{
addSiteResourceToDescriptor( siteResourceList[ i ], descriptor );
}
@@ -127,13 +130,13 @@
* Adds the source element <code>source</code> to the list of sources in the <code>descriptor</code> and sets
* its <code>EquandaTemplateDescriptor</code> to <i>filtered</i> and with the encoding specified in the
* <code>encoding</code> attribute or the Java virtual machine's default if it is not defined.
- *
+ *
* @param source a <code><source></code> element from the <code><sources></code>
* @param descriptor the <code>ArchetypeDescriptor</code> to add the source template to.
* @throws XmlPullParserException if the encoding specified is not valid or supported.
*/
private static void addSourceToDescriptor( Xpp3Dom source, EquandaArchetypeDescriptor descriptor )
- throws XmlPullParserException
+ throws XmlPullParserException
{
descriptor.addSource( source.getValue() );
EquandaTemplateDescriptor sourceDesc = descriptor.getSourceDescriptor( source.getValue() );
@@ -166,14 +169,14 @@
* Java virtual machine's default if it is not defined. If the <code>resource</code> is a property file (ends in
* <code>.properties</code>) its encoding will be set to <code>iso-8859-1</code> even if some other encoding is
* specified in the attribute.
- *
+ *
* @param resource a <code><resource></code> element from the <code><resources></code>
* @param descriptor the <code>ArchetypeDescriptor</code> to add the resource template to.
* @throws XmlPullParserException if the encoding specified is not valid or supported or if the value of the
- * attribute <code>filtered</code> is no valid.
+ * attribute <code>filtered</code> is no valid.
*/
private static void addResourceToDescriptor( Xpp3Dom resource, EquandaArchetypeDescriptor descriptor )
- throws XmlPullParserException
+ throws XmlPullParserException
{
descriptor.addResource( resource.getValue() );
@@ -203,7 +206,8 @@
}
catch ( UnsupportedCharsetException uce )
{
- throw new XmlPullParserException( resource.getAttribute( "encoding" ) + " is not a supported encoding." );
+ throw new XmlPullParserException(
+ resource.getAttribute( "encoding" ) + " is not a supported encoding." );
}
}
@@ -219,13 +223,13 @@
* Adds the test-source element <code>source</code> to the list of sources in the <code>descriptor</code> and
* sets its <code>EquandaTemplateDescriptor</code> to <i>filtered</i> and with the encoding specified in the
* <code>encoding</code> attribute or the Java virtual machine's default if it is not defined.
- *
+ *
* @param testSource a <code><source></code> element from the <code><testSources></code>
* @param descriptor the <code>ArchetypeDescriptor</code> to add the test-source template to.
* @throws XmlPullParserException if the encoding specified is not valid or supported.
*/
private static void addTestSourceToDescriptor( Xpp3Dom testSource, EquandaArchetypeDescriptor descriptor )
- throws XmlPullParserException
+ throws XmlPullParserException
{
descriptor.addTestSource( testSource.getValue() );
@@ -246,7 +250,7 @@
catch ( UnsupportedCharsetException uce )
{
throw new XmlPullParserException( testSource.getAttribute( "encoding" )
- + " is not a supported encoding." );
+ + " is not a supported encoding." );
}
}
@@ -261,14 +265,14 @@
* <code>encoding</code> attribute or the Java virtual machine's default if it is not defined. If the
* <code>resource</code> is a property file (ends in <code>.properties</code>) its encoding will be set to
* <code>iso-8859-1</code> even if some other encoding is specified in the attribute.
- *
+ *
* @param testResource a <code><resource></code> element from the <code><testResources></code>
* @param descriptor the <code>ArchetypeDescriptor</code> to add the test-resource template to.
* @throws XmlPullParserException if the encoding specified is not valid or supported or if the value of the
- * attribute <code>filtered</code> is no valid.
+ * attribute <code>filtered</code> is no valid.
*/
private static void addTestResourceToDescriptor( Xpp3Dom testResource, EquandaArchetypeDescriptor descriptor )
- throws XmlPullParserException
+ throws XmlPullParserException
{
descriptor.addTestResource( testResource.getValue() );
@@ -294,12 +298,13 @@
}
catch ( IllegalCharsetNameException icne )
{
- throw new XmlPullParserException( testResource.getAttribute( "encoding" ) + " is not a valid encoding." );
+ throw new XmlPullParserException(
+ testResource.getAttribute( "encoding" ) + " is not a valid encoding." );
}
catch ( UnsupportedCharsetException uce )
{
throw new XmlPullParserException( testResource.getAttribute( "encoding" )
- + " is not a supported encoding." );
+ + " is not a supported encoding." );
}
}
@@ -319,14 +324,14 @@
* <code>encoding</code> attribute or the Java virtual machine's default if it is not defined. If the
* <code>resource</code> is a property file (ends in <code>.properties</code>) its encoding will be set to
* <code>iso-8859-1</code> even if some other encoding is specified in the attribute.
- *
+ *
* @param siteResource a <code><resource></code> element from the <code><siteResources></code>
* @param descriptor the <code>ArchetypeDescriptor</code> to add the site-resource template to.
* @throws XmlPullParserException if the encoding specified is not valid or supported or if the value of the
- * attribute <code>filtered</code> is no valid.
+ * attribute <code>filtered</code> is no valid.
*/
private static void addSiteResourceToDescriptor( Xpp3Dom siteResource, EquandaArchetypeDescriptor descriptor )
- throws XmlPullParserException
+ throws XmlPullParserException
{
descriptor.addSiteResource( siteResource.getValue() );
@@ -352,12 +357,13 @@
}
catch ( IllegalCharsetNameException icne )
{
- throw new XmlPullParserException( siteResource.getAttribute( "encoding" ) + " is not a valid encoding." );
+ throw new XmlPullParserException(
+ siteResource.getAttribute( "encoding" ) + " is not a valid encoding." );
}
catch ( UnsupportedCharsetException uce )
{
throw new XmlPullParserException( siteResource.getAttribute( "encoding" )
- + " is not a supported encoding." );
+ + " is not a supported encoding." );
}
}
@@ -381,9 +387,10 @@
}
}
- private static boolean getValueFilteredAttribute( String str ) throws IllegalArgumentException
+ private static boolean getValueFilteredAttribute( String str )
+ throws IllegalArgumentException
{
- boolean ret = false;
+ boolean ret;
if ( str.equals( "true" ) )
{
ret = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-04 13:10:21
|
Revision: 899
http://equanda.svn.sourceforge.net/equanda/?rev=899&view=rev
Author: triathlon98
Date: 2008-12-04 13:10:11 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/import/DatabaseMap.java.vm
trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm
trunk/equanda-server/src/main/java/org/equanda/attachment/AttachmentServlet.java
trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java
trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java
trunk/equanda-server/src/main/java/org/equanda/auth/ParsedAuthAndConfigProvider.java
trunk/equanda-server/src/main/java/org/equanda/cache/EquandaCache.java
trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterBean.java
trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJB.java
trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJBUtil.java
trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaConnection.java
trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaDriver.java
trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaPreparedStatement.java
trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaResultSet.java
trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/CustomExporter.java
trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/DefaultMultipartDecoder.java
trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/FileVirtualizer.java
trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/ReportServlet.java
trunk/equanda-server/src/main/java/org/equanda/translations/TranslatorBean.java
trunk/equanda-server/src/main/java/org/equanda/validation/Default.java
trunk/equanda-server/src/main/java/org/equanda/validation/DisplayPreferences.java
trunk/equanda-server/src/main/java/org/equanda/validation/EditableRights.java
trunk/equanda-server/src/main/java/org/equanda/validation/ISOCountry2Letter.java
trunk/equanda-server/src/main/java/org/equanda/validation/ISOCountry3Letter.java
trunk/equanda-server/src/main/java/org/equanda/validation/ISOCountryCode.java
trunk/equanda-server/src/main/java/org/equanda/validation/ISOLanguage2Letter.java
trunk/equanda-server/src/main/java/org/equanda/validation/RunnableRights.java
trunk/equanda-server/src/main/java/org/equanda/validation/UniqueConverter.java
trunk/equanda-server/src/main/java/org/equanda/ymport/DatabaseMapAdapter.java
trunk/equanda-server/src/main/java/org/equanda/ymport/FieldHandler.java
trunk/equanda-server/src/main/java/org/equanda/ymport/FieldMapAdapter.java
trunk/equanda-server/src/main/java/org/equanda/ymport/FieldParser.java
trunk/equanda-server/src/main/java/org/equanda/ymport/ImportHandler.java
trunk/equanda-server/src/main/java/org/equanda/ymport/ImportParser.java
trunk/equanda-server/src/main/java/org/equanda/ymport/ImportWorkerUtil.java
trunk/equanda-server/src/main/java/org/equanda/ymport/Servlet.java
trunk/equanda-server/src/main/java/org/equanda/ymport/TableHandler.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/IdIndexKey.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/ListGetter.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/SelectedSetter.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/AuthDeleteFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/AuthWritableFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/DisplayListFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/DisplayPrintFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/bindings/DisplaySummaryFactory.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessages.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesSource.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslator.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaMessagesTranslatorImpl.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaSetterCache.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/EquandaSetterCacheImpl.java
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/export/ExportTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LazyInstTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java
Added Paths:
-----------
trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorConstants.java
Added: trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorConstants.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorConstants.java (rev 0)
+++ trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorConstants.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -0,0 +1,36 @@
+/**
+ * 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.translations;
+
+/**
+ * Constants for finding translations
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public interface TranslatorConstants
+{
+ static final String APP_TRANSLATIONS_FILE_NAME = "translations.txt";
+ static final String COMMON_TRANSLATIONS_FILE_NAME = "org/equanda/translations/translations-common.txt";
+}
Modified: trunk/equanda-generate/src/main/velocity/import/DatabaseMap.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/import/DatabaseMap.java.vm 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-generate/src/main/velocity/import/DatabaseMap.java.vm 2008-12-04 13:10:11 UTC (rev 899)
@@ -50,10 +50,10 @@
#foreach( $table in $dm.RootTables )
fieldMap = new ${table.Name}FieldMap();
- fieldsMap.put( "$table.name", fieldMap );
+ FIELDS_MAP.put( "$table.name", fieldMap );
#foreach( $type in $table.getTypes() )
#if ( ${type.Name} != ${table.Name} )
- fieldsMap.put( "$type.Name", fieldMap );
+ FIELDS_MAP.put( "$type.Name", fieldMap );
#end
#end ## foreach type
#end ## foreach table
@@ -98,12 +98,12 @@
#end
}
};
- tablesMap.put("${table.Name}/${select.Name}", tableHandler );
+ TABLES_MAP.put("${table.Name}/${select.Name}", tableHandler );
## use delegate for child tables
#foreach( $type in $table.getTypes() )
#if ( ${type.Name} != ${table.Name} )
- tablesMap.put("${type.Name}/${select.Name}", new Delegator( tableHandler, "${type.Type}" ) );
+ TABLES_MAP.put("${type.Name}/${select.Name}", new Delegator( tableHandler, "${type.Type}" ) );
#end ##
#end ## foreach type
@@ -173,12 +173,12 @@
}
}
};
- selectorsMap.put("${table.Name}/${select.Name}", tableHandler );
+ SELECTORS_MAP.put("${table.Name}/${select.Name}", tableHandler );
## use delegate for child tables
#foreach( $type in $table.getTypes() )
#if ( ${type.Name} != ${table.Name} )
- selectorsMap.put("${type.Name}/${select.Name}", new Delegator( tableHandler, "${type.Type}" ) );
+ SELECTORS_MAP.put("${type.Name}/${select.Name}", new Delegator( tableHandler, "${type.Type}" ) );
#end ##
#end ## foreach type
@@ -219,12 +219,12 @@
return null;
}
};
- tablesMap.put("${table.Name}", tableHandler);
+ TABLES_MAP.put("${table.Name}", tableHandler);
## use delegate for child tables
#foreach( $type in $table.getTypes() )
#if ( ${type.Name} != ${table.Name} )
- tablesMap.put("${type.Name}", new Delegator( tableHandler, "${type.Type}" ) );
+ TABLES_MAP.put("${type.Name}", new Delegator( tableHandler, "${type.Type}" ) );
#end ##
#end ## foreach type
Modified: trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm 2008-12-04 13:10:11 UTC (rev 899)
@@ -1,3 +1,7 @@
+#* @vtlvariable name="dollar" type="java.lang.String" *#
+#* @vtlvariable name="generationdate" type="java.lang.String" *#
+#* @vtlvariable name="table" type="org.equanda.domain.xml.transform.RootTable" *#
+#* @vtlvariable name="field" type="org.equanda.domain.xml.Field" *#
#**
* This file is part of the equanda project.
*
@@ -57,8 +61,8 @@
static
{
- fieldsMap.put( "Id", FieldHandler.Uoid );
- fieldsMap.put( "EquandaType", FieldHandler.EquandaType );
+ fieldsMap.put( "Id", FieldHandler.UOID );
+ fieldsMap.put( "EquandaType", FieldHandler.EQUANDA_TYPE );
#foreach( $field in $table.Fields )
#if( !$field.isAuto() && !$field.isInternal() && !$field.isValueExclude() && !$field.isCalculated() )
@@ -96,8 +100,25 @@
#else##multiple
#set( $par = "")
#if( !$field.isLink() )
-#set( $par = " FieldParser.parse${field.FieldTypeName} " )
+#if( $field.isInt() )
+#set( $par = " FieldParser.PARSE_INT " )
+#elseif( $field.isDouble() )
+#set( $par = " FieldParser.PARSE_DOUBLE " )
+#elseif( $field.isBoolean() )
+#set( $par = " FieldParser.PARSE_BOOLEAN " )
+#elseif( $field.isString() )
+#set( $par = " FieldParser.PARSE_STRING " )
+#elseif( $field.isBlob() )
+#set( $par = " FieldParser.PARSE_BLOB " )
+#elseif( $field.isClob() )
+#set( $par = " FieldParser.PARSE_CLOB " )
+#elseif( $field.isDate() )
+#set( $par = " FieldParser.PARSE_DATE " )
+#elseif( $field.isTimestamp() )
+#set( $par = " FieldParser.PARSE_TIMESTAMP " )
#end
+
+#end
new FieldHandler($par)
{
public void setMultiple( EquandaImportProxy proxy, Collection value )
Modified: trunk/equanda-server/src/main/java/org/equanda/attachment/AttachmentServlet.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/attachment/AttachmentServlet.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/attachment/AttachmentServlet.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -1,3 +1,27 @@
+/**
+ * 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.attachment;
import org.apache.log4j.Logger;
@@ -4,13 +28,14 @@
import org.equanda.persistence.EquandaProxy;
import org.equanda.persistence.EquandaSelector;
import org.equanda.persistence.Uoid;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
+
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
/**
* Description!!!
Modified: trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/AuthAndConfig.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -59,7 +59,7 @@
{
return ( value & AUTH_WRITABLE_TEST ) == AUTH_WRITABLE_TEST;
}
-
+
public boolean isDelete()
{
return ( value & AUTH_DELETE_TEST ) == AUTH_DELETE_TEST;
@@ -70,16 +70,17 @@
public boolean isDisplayList() { return ( value & DISPLAY_LIST_TEST ) == DISPLAY_LIST_TEST; }
public boolean isDisplayPrint() { return ( value & DISPLAY_PRINT_TEST ) == DISPLAY_PRINT_TEST; }
-
- public String toString(){
+
+ public String toString()
+ {
TextBuilder tb = TextBuilder.newInstance();
- if( this.value == 0 )
+ if ( this.value == 0 )
{
tb.append( "H" );
return tb.toString();
}
-
+
if ( ( this.value & AuthAndConfig.AUTH_READABLE ) == AuthAndConfig.AUTH_READABLE )
{
tb.append( "R" );
@@ -89,7 +90,7 @@
{
tb.append( "W" );
}
-
+
if ( ( this.value & AuthAndConfig.AUTH_DELETE ) == AuthAndConfig.AUTH_DELETE )
{
tb.append( "D" );
@@ -104,8 +105,8 @@
{
tb.append( "P" );
}
-
- if ( ( this.value & AuthAndConfig.DISPLAY_SUMMARY) == AuthAndConfig.DISPLAY_SUMMARY )
+
+ if ( ( this.value & AuthAndConfig.DISPLAY_SUMMARY ) == AuthAndConfig.DISPLAY_SUMMARY )
{
tb.append( "S" );
}
Modified: trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -43,10 +43,10 @@
{
map.put( key, value );
}
-
+
public void remove( String key )
{
- map.remove(key);
+ map.remove( key );
}
AuthAndConfig getFor( String key )
@@ -58,40 +58,41 @@
{
return map.keySet();
}
-
+
public void setReadable( String key )
- {
+ {
map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE ) );
}
-
+
public void setWritable( String key )
- {
+ {
map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.AUTH_WRITABLE ) );
}
-
+
public void setDelete( String key )
- {
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.AUTH_WRITABLE | AuthAndConfig.AUTH_DELETE ) );
+ {
+ map.put( key, new AuthAndConfig(
+ AuthAndConfig.AUTH_READABLE | AuthAndConfig.AUTH_WRITABLE | AuthAndConfig.AUTH_DELETE ) );
}
-
+
public void setDisplayList( String key )
- {
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_LIST) );
+ {
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_LIST ) );
}
-
+
public void setDisplaySummary( String key )
{
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_SUMMARY) );
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_SUMMARY ) );
}
-
+
public void setDisplayPrint( String key )
{
- map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_PRINT) );
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE | AuthAndConfig.DISPLAY_PRINT ) );
}
-
+
public void setHidden( String key )
{
- map.put( key, new AuthAndConfig(0) );
+ map.put( key, new AuthAndConfig( 0 ) );
}
-
+
}
Modified: trunk/equanda-server/src/main/java/org/equanda/auth/ParsedAuthAndConfigProvider.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/ParsedAuthAndConfigProvider.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/ParsedAuthAndConfigProvider.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -72,11 +72,11 @@
}
/**
- * Given a full rights string (e.g "Table.table=RW") return the Table.table part
- *
- * @param authString The auth string
- * @return The key part
- */
+ * Given a full rights string (e.g "Table.table=RW") return the Table.table part
+ *
+ * @param authString The auth string
+ * @return The key part
+ */
public String getAuthKey( String data )
{
String key = data;
@@ -91,11 +91,11 @@
}
/**
- * Given a full rights string (e.g "Table.table=RW") return the "RW" part
- *
- * @param authString The auth string
- * @return The value part
- */
+ * Given a full rights string (e.g "Table.table=RW") return the "RW" part
+ *
+ * @param authString The auth string
+ * @return The value part
+ */
public String getAuthValue( String data )
{
String value = "";
@@ -112,14 +112,16 @@
/**
* This method will add a new right, or update an existing
- *
+ *
* @param key The key to be used, e.g table.Table
- * @param aacValue An integer representing the rights.
+ * @param aacValue An integer representing the rights.
*/
public void addOrUpdate( String key, int aacValue )
{
- if( key == null || key.length() == 0)
+ if ( key == null || key.length() == 0 )
+ {
return;
+ }
AuthAndConfig value = new AuthAndConfig( aacValue );
@@ -128,16 +130,16 @@
/**
* This method returns the current full list of rights. Each right is separated by a newline
- *
+ *
* @return A string containing the list of rights.
*/
public String getAuthAndConfigString()
{
TextBuilder tb = new TextBuilder();
- for( String key : getKeys() )
+ for ( String key : getKeys() )
{
- tb.append( key + "=" + getFor(key).toString() + "\n" );
+ tb.append( key + "=" + getFor( key ).toString() + "\n" );
}
return tb.toString();
Modified: trunk/equanda-server/src/main/java/org/equanda/cache/EquandaCache.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/cache/EquandaCache.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/cache/EquandaCache.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -169,4 +169,4 @@
}
return null;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterBean.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterBean.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterBean.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -24,18 +24,19 @@
package org.equanda.reporting.bean;
+import org.apache.log4j.Logger;
import org.equanda.reporting.driver.RecordBatch;
-
import org.jboss.annotation.ejb.RemoteBinding;
-import org.apache.log4j.Logger;
import javax.ejb.*;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import java.io.Serializable;
import java.sql.*;
-import java.sql.Date;
-import java.util.*;
-import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.Random;
/**
* Get data for reporting, accessed by reporting driver
@@ -62,7 +63,7 @@
{
return jndi.lookup( name );
}
- catch( NamingException ex )
+ catch ( NamingException ex )
{
return null;
}
@@ -315,7 +316,7 @@
for ( ; !batch.getEof() && ( k < size ) ; k++ )
{
- Object obj[] = new Object[qi.fieldCount];
+ Object[] obj = new Object[qi.fieldCount];
for ( int i = 0; i < qi.fieldCount ; i++ )
{
obj[ i ] = rs.getObject( i + 1 ); // beware getObject count from 1
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJB.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJB.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJB.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -28,19 +28,16 @@
import javax.ejb.Remote;
-/**
- * Remote interface for ReporterEJB.
- */
+/** Remote interface for ReporterEJB. */
@Remote
public interface ReporterEJB
{
-
int prepare( java.lang.String query );
- RecordBatch execute( int _id )
+ RecordBatch execute( int id )
throws java.sql.SQLException;
- RecordBatch next( int _id )
+ RecordBatch next( int id )
throws java.sql.SQLException;
void close( int id );
@@ -49,25 +46,24 @@
void remove();
- void setInt( int _id, int i, int i1 )
+ void setInt( int id, int i, int i1 )
throws java.sql.SQLException;
- void setDouble( int _id, int i, double v )
+ void setDouble( int id, int i, double v )
throws java.sql.SQLException;
- void setNull( int _id, int i, int i1 )
+ void setNull( int id, int i, int i1 )
throws java.sql.SQLException;
- void setString( int _id, int i, java.lang.String s )
+ void setString( int id, int i, java.lang.String s )
throws java.sql.SQLException;
- void setBoolean( int _id, int i, boolean b )
+ void setBoolean( int id, int i, boolean b )
throws java.sql.SQLException;
- void setDate( int _id, int i, java.sql.Date date )
+ void setDate( int id, int i, java.sql.Date date )
throws java.sql.SQLException;
- void setTimestamp( int _id, int i, java.sql.Timestamp timestamp )
+ void setTimestamp( int id, int i, java.sql.Timestamp timestamp )
throws java.sql.SQLException;
-
}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJBUtil.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJBUtil.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/bean/ReporterEJBUtil.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -30,8 +30,10 @@
/**
* Utility class for ReporterEJB.
*/
-public class ReporterEJBUtil
+public final class ReporterEJBUtil
{
+ private ReporterEJBUtil() {}
+
private static <T> T lookup( java.util.Hashtable environment, String jndiName, Class<T> narrowTo )
throws javax.naming.NamingException
{
@@ -63,5 +65,4 @@
{
return (ReporterEJB) context.lookup( "org.equanda.reporting.bean.ReporterEJB" );
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaConnection.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaConnection.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaConnection.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -24,15 +24,14 @@
package org.equanda.reporting.driver;
+import org.apache.log4j.Logger;
import org.equanda.reporting.bean.ReporterEJB;
import org.equanda.reporting.bean.ReporterEJBUtil;
+import org.jboss.security.SecurityAssociation;
import java.sql.*;
import java.util.Map;
-import org.jboss.security.SecurityAssociation;
-import org.apache.log4j.Logger;
-
/**
* Implementation of java.sql.Connection used by jasper reports
*
@@ -53,14 +52,13 @@
if ( log.isDebugEnabled() )
{
String username = ( SecurityAssociation.getPrincipal() != null )
- ? SecurityAssociation.getPrincipal().getName()
- : "null";
- char credentials[] = (char[]) SecurityAssociation.getCredential();
+ ? SecurityAssociation.getPrincipal().getName() : "null";
+ char[] credentials = (char[]) SecurityAssociation.getCredential();
String password = ( credentials != null ) ? new String( credentials ) : "null";
log.debug( "create new connection " + jndiName + " username=" + username + " password=" + password );
}
bean = ReporterEJBUtil.get();
- if (log.isDebugEnabled()) log.debug( "bean created "+bean);
+ if ( log.isDebugEnabled() ) log.debug( "bean created " + bean );
}
catch ( Exception e )
{
@@ -294,4 +292,4 @@
{
throw new UnsupportedOperationException( "not implemented" );
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaDriver.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaDriver.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaDriver.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -24,10 +24,10 @@
package org.equanda.reporting.driver;
-import java.sql.Driver;
-import java.sql.SQLException;
import java.sql.Connection;
+import java.sql.Driver;
import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
import java.util.Properties;
/**
@@ -39,7 +39,6 @@
public class EquandaDriver
implements Driver
{
-
static
{
try
@@ -85,4 +84,4 @@
{
return null;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaPreparedStatement.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaPreparedStatement.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaPreparedStatement.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -26,11 +26,11 @@
import org.equanda.reporting.bean.ReporterEJB;
-import java.sql.*;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
+import java.sql.*;
import java.util.Calendar;
@@ -43,10 +43,9 @@
public class EquandaPreparedStatement
implements java.sql.PreparedStatement
{
+ private ReporterEJB bean;
+ private int id;
- ReporterEJB bean;
- int id;
-
public EquandaPreparedStatement( ReporterEJB bean, String query )
throws SQLException
{
@@ -69,8 +68,7 @@
public void close()
throws SQLException
- {
- }
+ {}
public void setInt( int i, int i1 )
throws SQLException
@@ -195,9 +193,7 @@
throw new UnsupportedOperationException( "not implemented" );
}
- /**
- * @deprecated
- */
+ /** @deprecated */
public void setUnicodeStream( int i, InputStream inputStream, int i1 )
throws SQLException
{
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaResultSet.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaResultSet.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/driver/EquandaResultSet.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -24,19 +24,20 @@
package org.equanda.reporting.driver;
-import org.equanda.reporting.bean.*;
+import javolution.lang.TextBuilder;
+import org.apache.log4j.Logger;
+import org.equanda.reporting.bean.ReporterEJB;
-import java.sql.*;
-import java.sql.Date;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
-import java.util.*;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
-import javolution.lang.TextBuilder;
-import org.apache.log4j.Logger;
-
/**
* Implementation of java.sql.ResultSet used by jasper reports
*
@@ -155,7 +156,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -179,7 +180,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -201,7 +202,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -223,7 +224,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -255,7 +256,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -278,7 +279,7 @@
catch ( NumberFormatException nfe )
{
throw new SQLException( "Cannot get double value for vield " + s + ", value " + obj +
- " (" + obj.getClass() + ")" );
+ " (" + obj.getClass() + ")" );
}
}
}
@@ -294,7 +295,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -317,7 +318,7 @@
if ( entry == null )
{
throw new SQLException( "unknown field " + s + ", known fields are "
- + fieldIndexes.keySet() );
+ + fieldIndexes.keySet() );
}
int index = ( (Integer) entry ).intValue();
if ( index >= objects.length )
@@ -683,9 +684,7 @@
throw new UnsupportedOperationException( "not implemented" );
}
- /**
- * @deprecated
- */
+ /** @deprecated */
public InputStream getUnicodeStream( int i )
throws SQLException
{
@@ -850,9 +849,7 @@
throw new UnsupportedOperationException( "not implemented" );
}
- /**
- * @deprecated
- */
+ /** @deprecated */
public BigDecimal getBigDecimal( int i, int i1 )
throws SQLException
{
@@ -998,9 +995,7 @@
throw new UnsupportedOperationException( "not implemented" );
}
- /**
- * @deprecated
- */
+ /** @deprecated */
public InputStream getUnicodeStream( String s )
throws SQLException
{
@@ -1067,9 +1062,7 @@
throw new UnsupportedOperationException( "not implemented" );
}
- /**
- * @deprecated
- */
+ /** @deprecated */
public BigDecimal getBigDecimal( String s, int i )
throws SQLException
{
@@ -1201,4 +1194,4 @@
{
throw new UnsupportedOperationException( "not implemented" );
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/CustomExporter.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/CustomExporter.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/CustomExporter.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -25,17 +25,12 @@
package org.equanda.reporting.servlet;
import net.sf.jasperreports.engine.*;
-import net.sf.jasperreports.engine.base.JRVirtualPrintPage;
import net.sf.jasperreports.engine.util.JRLoader;
import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import org.apache.log4j.Logger;
-
/**
* Custom Exporter, does some preprocessing before letting Jasper Reports
* produce the report using the normal exporter.
@@ -142,7 +137,7 @@
}
}
- return currY+addY+height;
+ return currY + addY + height;
}
/* other methods which are forwarded to the delegate object */
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/DefaultMultipartDecoder.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/DefaultMultipartDecoder.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/DefaultMultipartDecoder.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -1,3 +1,27 @@
+/**
+ * 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.reporting.servlet;
/*
@@ -38,45 +62,45 @@
public static final String PART_MAP_ATTRIBUTE_NAME = "org.apache.tapestry5.multipart.part-map";
- private int _maxSize = 10000000;
- private int _thresholdSize = 1024;
- private String _repositoryPath = System.getProperty( "java.io.tmpdir" );
- private static DefaultMultipartDecoder _shared;
+ private int maxSize = 10000000;
+ private int thresholdSize = 1024;
+ private String repositoryPath = System.getProperty( "java.io.tmpdir" );
+ private static DefaultMultipartDecoder SHARED;
public static DefaultMultipartDecoder getSharedInstance()
{
- if ( _shared == null ) _shared = new DefaultMultipartDecoder();
- return _shared;
+ if ( SHARED == null ) SHARED = new DefaultMultipartDecoder();
+ return SHARED;
}
public void setMaxSize( int maxSize )
{
- _maxSize = maxSize;
+ this.maxSize = maxSize;
}
public int getMaxSize()
{
- return _maxSize;
+ return maxSize;
}
public void setThresholdSize( int thresholdSize )
{
- _thresholdSize = thresholdSize;
+ this.thresholdSize = thresholdSize;
}
public int getThresholdSize()
{
- return _thresholdSize;
+ return thresholdSize;
}
public void setRepositoryPath( String repositoryPath )
{
- _repositoryPath = repositoryPath;
+ this.repositoryPath = repositoryPath;
}
public String getRepositoryPath()
{
- return _repositoryPath;
+ return repositoryPath;
}
public static boolean isMultipartRequest( HttpServletRequest request )
@@ -115,7 +139,7 @@
try
{
if ( encoding != null ) upload.setHeaderEncoding( encoding );
- parts = upload.parseRequest( request, _thresholdSize, _maxSize, _repositoryPath );
+ parts = upload.parseRequest( request, thresholdSize, maxSize, repositoryPath );
}
catch ( FileUploadException ex )
{
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/FileVirtualizer.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/FileVirtualizer.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/FileVirtualizer.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -24,23 +24,22 @@
package org.equanda.reporting.servlet;
-import net.sf.jasperreports.engine.JRVirtualizer;
-import net.sf.jasperreports.engine.JRVirtualizable;
import net.sf.jasperreports.engine.JRRuntimeException;
+import net.sf.jasperreports.engine.JRVirtualizable;
+import net.sf.jasperreports.engine.JRVirtualizer;
import net.sf.jasperreports.engine.base.JRVirtualPrintPage;
import org.apache.log4j.Logger;
-import org.jboss.serial.io.JBossObjectOutputStream;
+import org.equanda.util.BoundCache;
+import org.equanda.util.Cache;
import org.jboss.serial.io.JBossObjectInputStream;
+import org.jboss.serial.io.JBossObjectOutputStream;
-import java.util.*;
-import java.io.IOException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
-import org.equanda.util.Cache;
-import org.equanda.util.BoundCache;
-
/**
* File virtualizer, virtualizes report data to the filesystem.
*
@@ -302,4 +301,4 @@
cache.clear();
cache = null;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/ReportServlet.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/ReportServlet.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/reporting/servlet/ReportServlet.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -67,16 +67,16 @@
public static final String PARAMETER_REPORT_CACHE_PAGES = "ReportCachePages";
public static final String PARAMETER_REPORT_CACHE_DIR = "ReportCacheDirectory";
- public static final DateTimeFormatter dateParser = DateTimeFormat.forPattern( "yyyy-MM-dd" );
- public static final DateTimeFormatter timeParser = DateTimeFormat.forPattern( "yyyy-MM-dd HH:mm:ss" );
+ public static final DateTimeFormatter DATE_PARSER = DateTimeFormat.forPattern( "yyyy-MM-dd" );
+ public static final DateTimeFormatter TIME_PARSER = DateTimeFormat.forPattern( "yyyy-MM-dd HH:mm:ss" );
private static final Logger log = Logger.getLogger( ReportServlet.class );
- String sqlDriver;
- String reportExtension;
- String cacheDirectory;
- int cachePages = 10;
+ private String sqlDriver;
+ private String reportExtension;
+ private String cacheDirectory;
+ private int cachePages = 10;
- ServletResolver resolver;
+ private ServletResolver resolver;
public void init()
throws ServletException
@@ -186,15 +186,15 @@
}
else
{
- String path[] = req.getRequestURL().toString().split( "/" );
+ String[] path = req.getRequestURL().toString().split( "/" );
String file = path[ path.length - 1 ];
- String splitByDot[] = file.split( "\\." );
+ String[] splitByDot = file.split( "\\." );
if ( splitByDot.length != 2 )
{
log.error( "Invalid url" );
return;
}
- String splitByUnderline[] = splitByDot[ 0 ].split( "_" );
+ String[] splitByUnderline = splitByDot[ 0 ].split( "_" );
if ( splitByUnderline.length != 2 )
{
log.error( "Invalid url" );
@@ -276,8 +276,8 @@
{
// skip parameters file,type,sql,language,username, password, parameters
if ( !name.equals( "file" ) && !name.equals( "type" ) &&
- !name.equals( "sql" ) && !name.equals( "language" ) && !name.equals( "username" ) &&
- !name.equals( "password" ) && !name.equals( "parameters" ) )
+ !name.equals( "sql" ) && !name.equals( "language" ) && !name.equals( "username" ) &&
+ !name.equals( "password" ) && !name.equals( "parameters" ) )
{
Object paramValue = getParamValue( name, value );
jasperParams.put( name, paramValue );
@@ -349,7 +349,7 @@
{/*ignore*/}
log.info( "report " + filename + ' ' + ( ( System.currentTimeMillis() - startTime ) / 1000 )
- + "s, params " + jasperParams );
+ + "s, params " + jasperParams );
}
}
}
@@ -411,11 +411,11 @@
switch ( name.charAt( 0 ) )
{
- case'i':
+ case 'i':
if ( value == null || value.equals( "" ) ) value = "0";
paramValue = new Integer( value );
break;
- case'f':
+ case 'f':
if ( name.startsWith( "form" ) )
{
paramValue = value;
@@ -426,27 +426,27 @@
paramValue = new Double( value );
}
break;
- case'd':
+ case 'd':
if ( value == null || value.equals( "" ) )
{
paramValue = null;
}
else
{
- paramValue = dateParser.parseDateTime( value ).toDate();
+ paramValue = DATE_PARSER.parseDateTime( value ).toDate();
}
break;
- case't':
+ case 't':
if ( value == null || value.equals( "" ) )
{
paramValue = null;
}
else
{
- paramValue = new Timestamp( timeParser.parseDateTime( value ).getMillis() );
+ paramValue = new Timestamp( TIME_PARSER.parseDateTime( value ).getMillis() );
}
break;
- case'b':
+ case 'b':
paramValue = "true".equalsIgnoreCase( value ) ? Boolean.TRUE : Boolean.FALSE;
break;
default:
Modified: trunk/equanda-server/src/main/java/org/equanda/translations/TranslatorBean.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/translations/TranslatorBean.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/translations/TranslatorBean.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -45,14 +45,10 @@
@LocalBinding( jndiBinding = "org.equanda.translations.TranslatorEJBLocal" )
@TransactionAttribute( value = TransactionAttributeType.REQUIRED )
public class TranslatorBean
- implements TranslatorEJB, Serializable
+ implements TranslatorEJB, TranslatorConstants, Serializable
{
-
private static final Logger log = Logger.getLogger( TranslatorBean.class );
- public static String APP_TRANSLATIONS_FILE_NAME = "translations.txt";
- public static String COMMON_TRANSLATIONS_FILE_NAME = "org/equanda/translations/translations-common.txt";
-
private TreeMap<String, TreeMap<Key, Translation>> translations;
private String[] languages;
@@ -116,7 +112,7 @@
Key key = new Key();
key.setKey( strKey );
- String languagesToTry[];
+ String[] languagesToTry;
if ( !language.equals( languages[ 0 ] ) )
{
languagesToTry = new String[2];
Modified: trunk/equanda-server/src/main/java/org/equanda/validation/Default.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/validation/Default.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/validation/Default.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -35,4 +35,4 @@
{
OBJECT getDefault()
throws EquandaPersistenceException;
-}
\ No newline at end of file
+}
Modified: trunk/equanda-server/src/main/java/org/equanda/validation/DisplayPreferences.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/validation/DisplayPreferences.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/validation/DisplayPreferences.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -41,29 +41,28 @@
public static String DISPLAY = "DISPLAY";
public static String HIDE = "HIDE";
- private static final ArrayList<String> preferences;
+ private static final ArrayList<String> PREFERENCES;
static
{
- preferences = new ArrayList<String>();
- preferences.add( DISPLAY );
- preferences.add( HIDE );
+ PREFERENCES = new ArrayList<String>();
+ PREFERENCES.add( DISPLAY );
+ PREFERENCES.add( HIDE );
}
public boolean isAllowed( String s )
{
- return preferences.contains( s );
+ return PREFERENCES.contains( s );
}
-
public Collection<String> getAllowedStringValues()
{
- return preferences;
+ return PREFERENCES;
}
public Collection<String> getAllowedStringNames()
{
- return preferences;
+ return PREFERENCES;
}
public String getTranslation( String str )
Modified: trunk/equanda-server/src/main/java/org/equanda/validation/EditableRights.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/validation/EditableRights.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/validation/EditableRights.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -42,30 +42,29 @@
public static String VIEW = "VIEW";
public static String NONE = "NONE";
- private static final ArrayList<String> rights;
+ private static final ArrayList<String> RIGHTS;
static
{
- rights = new ArrayList<String>();
- rights.add( EDIT );
- rights.add( VIEW );
- rights.add( NONE );
+ RIGHTS = new ArrayList<String>();
+ RIGHTS.add( EDIT );
+ RIGHTS.add( VIEW );
+ RIGHTS.add( NONE );
}
public boolean isAllowed( String s )
{
- return rights.contains( s );
+ return RIGHTS.contains( s );
}
-
public Collection<String> getAllowedStringValues()
{
- return rights;
+ return RIGHTS;
}
public Collection<String> getAllowedStringNames()
{
- return rights;
+ return RIGHTS;
}
public String getTranslation( String str )
Modified: trunk/equanda-server/src/main/java/org/equanda/validation/ISOCountry2Letter.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/validation/ISOCountry2Letter.java 2008-12-04 08:34:54 UTC (rev 898)
+++ trunk/equanda-server/src/main/java/org/equanda/validation/ISOCountry2Letter.java 2008-12-04 13:10:11 UTC (rev 899)
@@ -38,265 +38,265 @@
implements ChoiceTranslation
{
private static final int COUNTRIES_COUNT = 240;
- private static final LinkedHashSet<String> countries;
+ private static final LinkedHashSet<String> COUNTRIES;
public boolean isAllowed( String s )
{
- return countries.contains( s );
+ return COUNTRIES.contains( s );
}
static
{
- countries = new LinkedHashSet<String>( COUNTRIES_COUNT );
- countries.add( "AF" ); // Afghanistan
- countries.add( "AL" ); // Albania, People's Socialist Republic of
- countries.add( "DZ" ); // Algeria, People's Democratic Republic of
- countries.add( "AS" ); // American Samoa
- countries.add( "AD" ); // Andorra, Principality of
- countries.add( "AO" ); // Angola, Republic of
- countries.add( "AI" ); // Anguilla
- countries.add( "AQ" ); // Antarctica (the territory South of 60 deg S)
- countries.add( "AG" ); // Antigua and Barbuda
- countries.add( "AR" ); // Argentina, Argentine Republic
- countries.add( "AM" ); // Armenia
- countries.add( "AW" ); // Aruba
- countries.add( "AU" ); // Australia, Commonwealth of
- countries.add( "AT" ); // Austria, Republic of
- countries.add( "AZ" ); // Azerbaijan, Republic of
- countries.add( "BS" ); // Bahamas, Commonwealth of the
- countries.add( "BH" ); // Bahrain, Kingdom of
- countries.add( "BD" ); // Bangladesh, People's Republic of
- countries.add( "BB" ); // Barbados
- countries.add( "BY" ); // Belarus
- countries.add( "BE" ); // Belgium, Kingdom of
- countries.add( "BZ" ); // Belize
- countries.add( "BJ" ); // Benin, People's Republic of
- countries.add( "BM" ); // Bermuda
- countries.add( "BT" ); // Bhutan, Kingdom of
- countries.add( "BO" ); // Bolivia, Republic of
- countries.add( "BA" ); // Bosnia and Herzegovina
- countries.add( "BW" ); // Botswana, Republic of
- countries.add( "BV" ); // Bouvet Island (Bouvetoya)
- countries.add( "BR" ); // Brazil, Federative Republic of
- countries.add( "IO" ); // British Indian Ocean Territory (Chagos Archipelago)
- countries.add( "VG" ); // British Virgin Islands
- countries.add( "BN" ); // Brunei Darussalam
- countries.add( "BG" ); // Bulgaria, People's Republic of
- countries.add( "BF" ); // Burkina Faso
- countries.add( "BI" ); // Burundi, Republic of
- countries.add( "KH" ); // Cambodia, Kingdom of
- countries.add( "CM" ); // Cameroon, United Republic of
- countries.add( "CA" ); // Canada
- countries.add( "CV" ); // Cape Verde, Republic of
- countries.add( "KY" ); // Cayman Islands
- countries.add( "CF" ); // Central African Republic
- countries.add( "TD" ); // Chad, Republic of
- countries.add( "CL" ); // Chile, Republic of
- countries.add( "CN" ); // China, People's Republic of
- countries.add( "CX" ); // Christmas Island
- countries.add( "CC" ); // Cocos (Keeling) Islands
- countries.add( "CO" ); // Colombia, Republic of
- countries.add( "KM" ); // Comoros, Union of the
- countries.add( "CD" ); // Congo, Democratic Republic of
- countries.add( "CG" ); // Congo, People's Republic of
- countries.add( "CK" ); // Cook Islands
- countries.add( "CR" ); // Costa Rica, Republic of
- countries.add( "CI" ); // Cote D'Ivoire, Ivory Coast, Republic of the
- countries.add( "CU" ); // Cuba, Republic of
- countries.add( "CY" ); // Cyprus, Republic of
- countries.add( "CZ" ); // Czech Republic
- countries.add( "DK" ); // Denmark, Kingdom of
- countries.add( "DJ" ); // Djibouti, Republic of
- countries.add( "DM" ); // Dominica, Commonwealth of
- countries.add( "DO" ); // Dominican Republic
- countries.add( "EC" ); // Ecuador, Republic of
- countries.add( "EG" ); // Egypt, Arab Republic of
- countries.add( "SV" ); // El Salvador, Republic of
- countries.add( "GQ" ); // Equatorial Guinea, Republic of
- countries.add( "ER" ); // Eritrea
- countries.add( "EE" ); // Estonia
- countries.add( "ET" ); // Ethiopia
- countries.add( "FO" ); // Faeroe Islands
- countries.add( "FK" ); // Falkland Islands (Malvinas)
- countries.add( "FJ" ); // Fiji, Republic of the Fiji Islands
- countries.add( "FI" ); // Finland, Republic of
- countries.add( "FR" ); // France, French Republic
- countries.add( "GF" ); // French Guiana
- countries.add( "PF" ); // French Polynesia
- countries.add( "TF" ); // French Southern Territories
- countries.add( "GA" ); // Gabon, Gabonese Republic
- countries.add( "GM" ); // Gambia, Republic of the
- countries.add( "GE" ); // Georgia
- countries.add( "DE" ); // Germany
- countries.add( "GH" ); // Ghana, Republic of
- countries.add( "GI" ); // Gibraltar
- countries.add( "GR" ); // Greece, Hellenic Republic
- countries.add( "GL" ); // Greenland
- countries.add( "GD" ); // Grenada
- countries.add( "GP" ); // Guadaloupe
- countries.add( "GU" ); // Guam
- countries.add( "GT" ); // Guatemala, Republic of
- countries.add( "GN" ); // Guinea, Revolutionary People's Rep'c of
- countries.add( "GW" ); // Guinea-Bissau, Republic of
- countries.add( "GY" ); // Guyana, Republic of
- countries.add( "HT" ); // Haiti, Republic of
- countries.add( "HM" ); // Heard and McDonald Islands
- countries.add( "VA" ); // Holy See (Vatican City State)
- countries.add( "HN" ); // Honduras, Republic of
- countries.add( "HK" ); // Hong Kong, Special Administrative Region of China
- countries.add( "HR" ); // Hrvatska (Croatia)
- countries.add( "HU" ); // Hungary, Hungarian People's Republic
- countries.add( "IS" ); // Iceland, Republic of
- countries.add( "IN" ); // India, Republic of
- countries.add( "ID" ); // Indonesia, Republic of
- countries.add( "IR" ); // Iran, Islamic Republic of
- countries.add( "IQ" ); // Iraq, Republic of
- countries.add( "IE" ); // Ireland
- countries.add( "IL" ); // Israel, State of
- countries.add( "IT" ); // Italy, Italian Republic
- countries.add( "JM" ); // Jamaica
- countries.add( "JP" ); // Japan
- countries.add( "JO" ); // Jordan, Hashemite Kingdom of
- countries.add( "KZ" ); // Kazakhstan, Republic of
- countries.add( "KE" ); // Kenya, Republic of
- countries.add( "KI" ); // Kiribati, Republic of
- countries.add( "KP" ); // Korea, Democratic People's Republic of
- countries.add( "KR" ); // Korea, Republic of
- countries.add( "KW" ); // Kuwait, State of
- countries.add( "KG" ); // Kyrgyz Republic
- countries.add( "LA" ); // Lao People's Democratic Republic
- countries.add( "LV" ); // Latvia
- countries.add( "LB" ); // Lebanon, Lebanese Republic
- countries.add( "LS" ); // Lesotho, Kingdom of
- countries.add( "LR" ); // Liberia, Republic of
- countries.add( "LY" ); // Libyan Arab Jamahiriya
- countries.add( "LI" ); // Liechtenstein, Principality of
- countries.add( "LT" ); // Lithuania
- countries.add( "LU" ); // Luxembourg, Grand Duchy of
- countries.add( "MO" ); // Macao, Special Administrative Region of China
- countries.add( "MK" ); // Macedonia, the former Yugoslav Republic of
- countries.add( "MG" ); // Madagascar, Republic of
- countries.add( "MW" ); // Malawi, Republic of
- countries.add( "MY" ); // Malaysia
- countries.add( "MV" ); // Maldives, Republic of
- countries.add( "ML" ); // Mali, Republic of
- countries.add( "MT" ); // Malta, Republic of
- countries.add( "MH" ); // Marshall Islands
- countries.add( "MQ" ); // Martinique
- countries.add( "MR" ); // Mauritania, Islamic Republic of
- countries.add( "MU" ); // Mauritius
- countries.add( "YT" ); // Mayotte
- countries.add( "MX" ); // Mexico, United Mexican States
- countries.add( "FM" ); // Micronesia, Federated States of
- countries.add( "MD" ); // Moldova, Republic of
- countries.add( "MC" ); // Monaco, Principality of
- countries.add( "MN" ); // Mongolia, Mongolian People's Republic
- countries.add( "MS" ); // Montserrat
- countries.add( "MA" ); // Morocco, Kingdom of
- countries.add( "MZ" ); // Mozambique, People's Republic of
- countries.add( "MM" ); // Myanmar
- countries.add( "NA" ); // Namibia
- countries.a...
[truncated message content] |
|
From: <tri...@us...> - 2008-12-04 08:35:04
|
Revision: 898
http://equanda.svn.sourceforge.net/equanda/?rev=898&view=rev
Author: triathlon98
Date: 2008-12-04 08:34:54 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -1,3 +1,27 @@
+/**
+ * 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.tapestry5.base;
import org.apache.tapestry5.AbstractOptionModel;
@@ -2,2 +26,7 @@
+/**
+ * Option model.
+ *
+ * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
+ */
public class EquandaOptionModel
@@ -8,12 +37,12 @@
private String label;
private Object value;
- public EquandaOptionModel ( String value )
+ public EquandaOptionModel( String value )
{
this( value, value );
}
- public EquandaOptionModel ( String label, Object value )
+ public EquandaOptionModel( String label, Object value )
{
this.label = label;
this.value = value;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -31,24 +31,29 @@
import java.util.Arrays;
import java.util.List;
+/**
+ * Select model.
+ *
+ * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
+ */
public class EquandaSelectModel
extends AbstractSelectModel
{
private final List<OptionGroupModel> optionGroups;
private final List<OptionModel> optionModels;
- public EquandaSelectModel ( List<OptionGroupModel> optionGroups, List<OptionModel> optionModels )
+ public EquandaSelectModel( List<OptionGroupModel> optionGroups, List<OptionModel> optionModels )
{
this.optionGroups = optionGroups;
this.optionModels = optionModels;
}
- public EquandaSelectModel ( OptionModel... optionModels )
+ public EquandaSelectModel( OptionModel... optionModels )
{
this( null, Arrays.asList( optionModels ) );
}
- public EquandaSelectModel ( OptionGroupModel... groupModels )
+ public EquandaSelectModel( OptionGroupModel... groupModels )
{
this( Arrays.asList( groupModels ), null );
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -44,7 +44,7 @@
public class ManifestBindingPrefix
implements Binding
{
- private static final Map<String, String> cache = new ConcurrentHashMap<String, String>();
+ private static final Map<String, String> CACHE = new ConcurrentHashMap<String, String>();
private String expression;
public ManifestBindingPrefix( String expression )
@@ -57,7 +57,7 @@
try
{
// first try to get the value from the cache (these things don't really change at runtime after all)
- String res = cache.get( expression );
+ String res = CACHE.get( expression );
if ( res != null ) return res;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -70,7 +70,7 @@
URL url = urls.nextElement();
res = get( url );
}
- if ( res != null ) cache.put( expression, res );
+ if ( res != null ) CACHE.put( expression, res );
return res;
}
catch ( Exception ex )
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -24,7 +24,8 @@
package org.equanda.tapestry5.components;
-import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
+import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.equanda.tapestry5.base.TitleContent;
/**
@@ -32,7 +33,8 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-@IncludeJavaScriptLibrary( { "${tapestry.scriptaculous}/prototype.js", "classpath:/org/equanda/tapestry5/resources/accordion.js" } )
+@IncludeJavaScriptLibrary( { "${tapestry.scriptaculous}/prototype.js",
+ "classpath:/org/equanda/tapestry5/resources/accordion.js" } )
@SupportsInformalParameters
public class Accordion
extends TitleContent
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -46,7 +46,7 @@
private ComponentResources resources;
@Inject
- private Environment environment;
+ private Environment environment;
private String formActionLinkTarget;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -49,7 +49,7 @@
private Asset script;
@Environmental
- private RenderSupport renderSupport;
+ private RenderSupport renderSupport;
@BeginRender
boolean doBeginRender( MarkupWriter writer )
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -80,9 +80,7 @@
@Parameter( value = "prop:componentResources.elementName", defaultPrefix = BindingConstants.LITERAL )
private String elementName;
- /**
- * Defines the collection of values for the loop to iterate over.
- */
+ /** Defines the collection of values for the loop to iterate over. */
@Parameter( required = true, principal = true )
private Collection<Object> source;
@@ -105,9 +103,7 @@
// @Persist
private int addedRowCount;
- /**
- * The current value, set before the component renders its body.
- */
+ /** The current value, set before the component renders its body. */
@SuppressWarnings( "unused" )
@Parameter
private Object value;
@@ -118,14 +114,12 @@
*/
@SuppressWarnings( "unused" )
@Parameter
- private boolean _volatile;
+ private boolean volatileLoop;
@Parameter( defaultPrefix = BindingConstants.PROP )
private ObjectCreatorDelegate objectCreatorDelegate;
- /**
- * The index into the source items.
- */
+ /** The index into the source items. */
@Parameter
private int index;
@@ -142,8 +136,8 @@
@SuppressWarnings( "unused" )
@Component( parameters = { "source=pagedSource", "elementName=prop:elementName", "value=inherit:value",
- "volatile=inherit:volatile", "encoder=inherit:encoder", "index=index",
- "additionalRowCount=inherit:additionalRowCount" } )
+ "volatile=inherit:volatile", "encoder=inherit:encoder", "index=index",
+ "additionalRowCount=inherit:additionalRowCount" } )
private Loop loop;
@Component( parameters = { "source=pagedSource", "rowsPerPage=rowsPerPage", "currentPage=currentPage" } )
@@ -196,16 +190,16 @@
{
private static final long serialVersionUID = 6727709013577574475L;
- private final String _addedRowCountHiddenName;
+ private final String addedRowCountHiddenName;
- public SetupAction ( String controlName )
+ public SetupAction( String controlName )
{
- _addedRowCountHiddenName = controlName;
+ addedRowCountHiddenName = controlName;
}
public void execute( JSPagedLoop component )
{
- component.setupAddedRowCountHiddenName( _addedRowCountHiddenName );
+ component.setupAddedRowCountHiddenName( addedRowCountHiddenName );
}
}
@@ -322,7 +316,7 @@
@SetupRender
Object setupRender()
{
- currentPage = 1;
+ currentPage = 1;
rowIds = new ArrayList<String>();
assignedClientId = renderSupport.allocateClientId( clientId );
@@ -339,7 +333,7 @@
if ( objectCreatorDelegate != null )
{
- for ( int i = 0; i < additionalRowCount; i++ )
+ for ( int i = 0; i < additionalRowCount ; i++ )
{
Object object = objectCreatorDelegate.createObject();
pagedSource.add( object );
@@ -405,7 +399,7 @@
if ( objectCreatorDelegate != null )
{
- for ( int i = 0; i < count && i < addedRowsList.size(); i++ )
+ for ( int i = 0; i < count && i < addedRowsList.size() ; i++ )
{
objectCreatorDelegate.addNewObject( addedRowsList.get( i ) );
}
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-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -35,22 +35,18 @@
/**
* Equanda modification of {@link org.apache.tapestry5.corelib.components.GridPager}
- *
+ *
* @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
*/
@IncludeStylesheet( value = { "classpath:/org/equanda/tapestry5/resources/jspager.css" } )
@IncludeJavaScriptLibrary( value = { "classpath:/org/equanda/tapestry5/resources/jspager.js" } )
public class JSPager
{
- /**
- * The source of the data displayed by the JSPagedLoop
- */
+ /** The source of the data displayed by the JSPagedLoop */
@Parameter
private List<Object> source;
- /**
- * The number of rows displayed per page.
- */
+ /** The number of rows displayed per page. */
@Parameter
private int rowsPerPage;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -115,7 +115,7 @@
int i = 0;
for ( Tree node : children )
{
- // TODO check if stopping recursion works.. we probably have to forsee equals and hashCode method on FlattenedTree
+ // TODO check if stopping recursion works.. probably needs equals and hashCode method on FlattenedTree
if ( !list.contains( node ) )
{
buildSourceList( list, node, depth + 1, dotId + "-" + i );
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -34,7 +34,7 @@
/**
* Text Truncate Component
- *
+ *
* @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
*/
@IncludeJavaScriptLibrary( "classpath:/org/equanda/tapestry5/resources/truncate.js" )
@@ -43,40 +43,29 @@
public class Truncate
implements ClientElement
{
-
- /**
- * The text to be truncated
- */
+ /** The text to be truncated */
@Parameter( required = true, defaultPrefix = BindingConstants.PROP )
private String text;
- /**
- * The max length of the text
- */
+ /** The max length of the text */
@Parameter( defaultPrefix = BindingConstants.LITERAL )
private Integer length;
- /**
- * The suffix
- */
+ /** The suffix */
@Parameter( defaultPrefix = BindingConstants.LITERAL )
private String suffix;
- /**
- * Injects SymbolSource object
- */
+ /** Injects SymbolSource object */
@Inject
private SymbolSource symbolSource;
- /**
- * Injects TypeCoercer object
- */
+ /** Injects TypeCoercer object */
@Inject
private TypeCoercer typeCoercer;
/**
* Default binding for length parameter
- *
+ *
* @return default length
*/
public Integer defaultLength()
@@ -86,7 +75,7 @@
/**
* Default binding for suffix parameter
- *
+ *
* @return default suffix
*/
public String defaultSuffix()
@@ -94,9 +83,7 @@
return symbolSource.valueForSymbol( "equanda.truncate.default.suffix" );
}
- /**
- * Mixin that discards body rendering
- */
+ /** Mixin that discards body rendering */
@Mixin
@SuppressWarnings( "unused" )
private DiscardBody discardBody;
@@ -111,7 +98,7 @@
/**
* Truncates text to specified length
- *
+ *
* @return truncated text
*/
public String getTruncatedText()
@@ -133,9 +120,8 @@
/**
* Renders truncated text
- *
- * @param writer
- * MarkupWriter used to render truncated text tag
+ *
+ * @param writer MarkupWriter used to render truncated text tag
*/
@BeginRender
void doBeginRender( MarkupWriter writer )
@@ -143,16 +129,15 @@
String text = getTruncatedText();
if ( null == text ) text = "";
writer.element( resources.getElementName() != null ? resources.getElementName() : "span", "id",
- assignedClientId ).text( text );
+ assignedClientId ).text( text );
resources.renderInformalParameters( writer );
writer.end();
}
/**
* Renders full text tag
- *
- * @param writer
- * MarkupWriter used to render full text tag
+ *
+ * @param writer MarkupWriter used to render full text tag
*/
@AfterRender
void doAfterRender( MarkupWriter writer )
@@ -168,8 +153,8 @@
body = root.find( "body" );
}
}
- String[] args = new String[] { "class", "eqTrunCt", "id", assignedClientId + "_text",
- "style", "visibility: hidden; top: -1000px; left: 0;" };
+ String[] args = new String[]{ "class", "eqTrunCt", "id", assignedClientId + "_text",
+ "style", "visibility: hidden; top: -1000px; left: 0;" };
if ( body != null )
{
Element element = body.element( "div", args );
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -1,3 +1,27 @@
+/**
+ * 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.tapestry5.data;
/**
@@ -3,5 +27,5 @@
* This class is used by the TreeTable component to flatten a given Tree structure
* so that it can be represented in an html table.
- *
+ * <p/>
* A Tree is nested, an html table is flat and this class represent each node of the
* tree, but without nesting. The TreeTable component can then convert a Tree structure
@@ -10,35 +34,41 @@
* The FlattenedTree still remember the position of the node in the original tree in order
* to render the tree correctly in html (reference to javascript used
* by TreeTable component for details).
- *
+ *
* @author Geert Mergan
*/
-public class FlattenedTree implements java.io.Serializable {
-
+public class FlattenedTree
+ implements java.io.Serializable
+{
private Tree tree;
private String dotId;
private int depth;
- public FlattenedTree(Tree tree, int depth, String dotId) {
+ public FlattenedTree( Tree tree, int depth, String dotId )
+ {
super();
this.tree = tree;
this.dotId = dotId;
this.depth = depth;
}
- public Tree getTree() {
+ public Tree getTree()
+ {
return tree;
}
- public String getDotId() {
+ public String getDotId()
+ {
return dotId;
}
- public int getDepth() {
+ public int getDepth()
+ {
return depth;
}
- public boolean isLeaf() {
- return tree.isLeaf();
+ public boolean isLeaf()
+ {
+ return tree.isLeaf();
}
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -1,3 +1,27 @@
+/**
+ * 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.tapestry5.data;
import java.util.List;
@@ -5,16 +29,16 @@
/**
* This interface must be implemented by an object that must be rendered
* in a tapestry page using the TreeTable component.
- *
+ *
* @author Geert Mergan
*/
-public interface Tree {
+public interface Tree
+{
+ List<Tree> getChildren();
- public List<Tree> getChildren();
+ void setChildren( List<Tree> children );
- public void setChildren(List<Tree> children);
+ boolean isLeaf();
- public boolean isLeaf();
-
- public String getLabel();
+ String getLabel();
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -44,8 +44,10 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class EquandaModule
+public final class EquandaModule
{
+ private EquandaModule() {}
+
public static void contributeComponentClassResolver( Configuration<LibraryMapping> configuration )
{
configuration.add( new LibraryMapping( "equanda", "org.equanda.tapestry5" ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 22:10:28
|
Revision: 897
http://equanda.svn.sourceforge.net/equanda/?rev=897&view=rev
Author: triathlon98
Date: 2008-12-03 22:10:23 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-tool/src/main/java/org/equanda/tool/all/Tool.java
trunk/equanda-tool/src/main/java/org/equanda/tool/all/ToolWorker.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/GenericDialect.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/JdbcManager.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java
trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportClient.java
trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportWorker.java
trunk/equanda-tool/src/main/java/org/equanda/tool/export/configuration/ExportSectionSettings.java
trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportContext.java
trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportHelper.java
trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java
trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintClient.java
trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintWorker.java
trunk/equanda-tool/src/main/java/org/equanda/tool/print/Printer.java
trunk/equanda-tool/src/main/java/org/equanda/tool/print/provider/ReportPrintInfo.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Id.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Resolver.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolMain.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/configuration/ConfigurationMain.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientDisplay.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/worker/Worker.java
trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/ImportDialog.java
trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/KeyEditorPanel.java
trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/KeyTable.java
trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/KeyTableModel.java
trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/TranslationsEditor.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ymport/ImportClient.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ymport/ImportWorker.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ymport/PatternMatcher.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ymport/configuration/ImportConfiguration.java
trunk/pom.xml
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/all/Tool.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/all/Tool.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/all/Tool.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -43,9 +43,9 @@
public class Tool
extends ToolMain<AllConfiguration>
{
- public static final Id allId = Id.buildId( "all" );
+ public static final Id ALL_ID = Id.buildId( "all" );
- public static void main( final String args[] )
+ public static void main( final String[] args )
{
Locale.setDefault( new Locale( "xx" ) ); // assure the locale is "known" or at least well defined
ThreadGroup exceptionThreadGroup = new ExceptionGroup();
@@ -72,11 +72,11 @@
public WorkerThread getWorkerThread( AllConfiguration cfg )
throws ToolException
{
- return new WorkerThread<AllConfiguration>( cfg, new ToolWorker( cfg, allId ) );
+ return new WorkerThread<AllConfiguration>( cfg, new ToolWorker( cfg, ALL_ID ) );
}
public Id getId( AllConfiguration allConfiguration )
{
- return allId;
+ return ALL_ID;
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/all/ToolWorker.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/all/ToolWorker.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/all/ToolWorker.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,6 +24,7 @@
package org.equanda.tool.all;
+import org.apache.log4j.Logger;
import org.equanda.tool.all.configuration.AllConfiguration;
import org.equanda.tool.export.ExportClient;
import org.equanda.tool.export.ExportWorker;
@@ -34,6 +35,7 @@
import org.equanda.tool.shared.Id;
import org.equanda.tool.shared.ToolException;
import org.equanda.tool.shared.ToolListener;
+import org.equanda.tool.shared.ToolMain;
import org.equanda.tool.shared.worker.Worker;
import org.equanda.tool.ymport.ImportClient;
import org.equanda.tool.ymport.ImportWorker;
@@ -44,6 +46,8 @@
public class ToolWorker
extends Worker<AllConfiguration>
{
+ private static final Logger log = Logger.getLogger( ToolMain.class );
+
protected ArrayList<WorkerInfo> workers = new ArrayList<WorkerInfo>();
public ToolWorker( AllConfiguration cfg, Id id )
@@ -58,7 +62,7 @@
if ( cExport.exists() && cExport.getExportSectionSettings().getScanPeriod() > 0 )
{
skip = (int) ( cExport.getExportSectionSettings().getScanPeriod() / scan ) - 1;
- ExportWorker worker = new ExportWorker( cExport, ExportClient.exportId );
+ ExportWorker worker = new ExportWorker( cExport, ExportClient.EXPORT_ID );
worker.init( cExport );
workers.add( new WorkerInfo( worker, skip ) );
}
@@ -67,7 +71,7 @@
if ( cImport.exists() && cImport.getImportSectionSettings().getScanPeriod() > 0 )
{
skip = (int) ( cImport.getImportSectionSettings().getScanPeriod() / scan ) - 1;
- ImportWorker worker = new ImportWorker( cImport, ImportClient.importId );
+ ImportWorker worker = new ImportWorker( cImport, ImportClient.IMPORT_ID );
worker.init( cImport );
workers.add( new WorkerInfo( worker, skip ) );
}
@@ -76,7 +80,7 @@
if ( cPrint.exists() && cPrint.getPrintSectionSettings().getScanPeriod() > 0 )
{
skip = (int) ( cPrint.getPrintSectionSettings().getScanPeriod() / scan ) - 1;
- PrintWorker worker = new PrintWorker( cPrint, PrintClient.printId );
+ PrintWorker worker = new PrintWorker( cPrint, PrintClient.PRINT_ID );
worker.init( cPrint );
workers.add( new WorkerInfo( worker, skip ) );
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseDialect.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -42,7 +42,7 @@
String getCreateIndexQuery( DatabaseField field );
String getDropIndexQuery( DatabaseField field );
-
+
String getDropIndexQuery( String index );
String getCreateTableQuery( String table );
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/GenericDialect.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/GenericDialect.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/GenericDialect.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -76,6 +76,8 @@
case DatabaseField.LINK:
query.append( " CHAR(14) " );
break;
+ default:
+ // oops
}
if ( !"".equals( field.getDefaultValue() ) )
{
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-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/JdbcManager.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -583,4 +583,3 @@
public Exception getException()
{ return oops; }
}
-
\ No newline at end of file
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-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -143,8 +143,8 @@
{
if ( args.length < 3 )
{
- log.info(
- "Usage: utitity <location> <driverclass> <username> <password> [class Databasemap] [operations] [file query.sql]" );
+ log.info( "Usage: utitity <location> <driverclass> <username> <password> " +
+ "[class Databasemap] [operations] [file query.sql]" );
log.info( "DatabaseMap - class which contains database information (tables and fields)" );
log.info( "Operations:" );
log.info( "update - create all tables and fields, update definition if possible;" );
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportClient.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportClient.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportClient.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -41,9 +41,9 @@
public class ExportClient
extends ToolMain<ExportConfiguration>
{
- public static final Id exportId = Id.buildId( "export" );
+ public static final Id EXPORT_ID = Id.buildId( "export" );
- public static void main( final String args[] )
+ public static void main( final String[] args )
{
ThreadGroup exceptionThreadGroup = new ExceptionGroup();
new Thread( exceptionThreadGroup, "Init thread" )
@@ -69,11 +69,11 @@
public WorkerThread getWorkerThread( ExportConfiguration cfg )
throws ToolException
{
- return new WorkerThread( cfg, new ExportWorker( cfg, exportId ) );
+ return new WorkerThread( cfg, new ExportWorker( cfg, EXPORT_ID ) );
}
public Id getId( ExportConfiguration exportConfiguration )
{
- return exportId;
+ return EXPORT_ID;
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportWorker.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportWorker.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/ExportWorker.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,6 +24,9 @@
package org.equanda.tool.export;
+import javolution.lang.TextBuilder;
+import murlen.util.fscript.*;
+import org.apache.log4j.Logger;
import org.equanda.persistence.EquandaProxy;
import org.equanda.tool.export.configuration.ExportConfiguration;
import org.equanda.tool.export.object.ExportContext;
@@ -33,13 +36,11 @@
import org.equanda.tool.shared.Id;
import org.equanda.tool.shared.ToolException;
import org.equanda.tool.shared.ToolListener;
-import static org.equanda.tool.shared.ToolMain.i18n;
+import static org.equanda.tool.shared.ToolMain.I18N;
import org.equanda.tool.shared.worker.Worker;
+import org.equanda.util.ExceptionUtil;
import org.equanda.util.accessor.ObjectAccessor;
import org.equanda.util.accessor.ObjectAccessorException;
-import org.equanda.util.ExceptionUtil;
-import javolution.lang.TextBuilder;
-import murlen.util.fscript.*;
import javax.transaction.Status;
import javax.transaction.UserTransaction;
@@ -62,6 +63,7 @@
public class ExportWorker
extends Worker<ExportConfiguration>
{
+ private static final Logger log = Logger.getLogger( ExportWorker.class );
private SelectorList selectorList;
private Map<String, FScript> scripts = new HashMap<String, FScript>(); // all the scripts
private ExportContext exportContext;
@@ -169,13 +171,13 @@
catch ( ToolException ece )
{
listener.notifyInfo( ToolListener.STATUS_ENDED, getNotifyInfo(),
- i18n.txt( "error", workerId ) + ece.getMessage() );
+ I18N.txt( "error", workerId ) + ece.getMessage() );
throw ece;
}
catch ( Exception ex )
{
listener.notifyInfo( ToolListener.STATUS_ENDED, getNotifyInfo(),
- i18n.txt( "error", workerId ) + ex.getMessage() );
+ I18N.txt( "error", workerId ) + ex.getMessage() );
throw new ToolException( "problem while exporting", ex );
}
finally
@@ -302,7 +304,8 @@
if ( lastModified == 0 ) lastModified = -1;
}
}
- if ( lastModified != 0 ) {
+ if ( lastModified != 0 )
+ {
exportContext.setLastModified( lastModified );
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/configuration/ExportSectionSettings.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/configuration/ExportSectionSettings.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/configuration/ExportSectionSettings.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -41,14 +41,10 @@
public class ExportSectionSettings
extends Section
{
- /**
- * section name
- */
+ /** section name */
private static final String INI_SECTION_SETTINGS = "settings";
- /**
- * Settings section attributes
- */
+ /** Settings section attributes */
public static final String INI_SETTINGS_SECTION_ATTRIBUTE_EXPORTDIRECTORY = "exportDirectory"; // default: "."
public static final String INI_SETTINGS_SECTION_ATTRIBUTE_SCANPERIOD = "scanPeriod"; // default: -1
public static final String INI_SETTINGS_SECTION_ATTRIBUTE_EXPORT_INFO = "exportInfo";
@@ -118,7 +114,7 @@
evalScripts = new ArrayList<String>();
boolean hasMore = true;
- for ( int index = 1 ; hasMore ; index++ )
+ for ( int index = 1; hasMore ; index++ )
{
String name = ini.getValue( resolvedSectionId, INI_OBJECT_SECTION_ATTRIBUTE_SCRIPT + index );
if ( name == null || name.equals( "" ) )
@@ -138,9 +134,7 @@
return INI_SECTION_SETTINGS;
}
- /**
- * Getters for the database section attributes
- */
+ /** Getters for the database section attributes */
public long getScanPeriod()
{
return scanPeriod;
@@ -161,9 +155,7 @@
return exportDirectory;
}
- /**
- * Get list of scripts names which can be used to extend the ExportContext evaluator
- */
+ /** Get list of scripts names which can be used to extend the ExportContext evaluator */
public Collection<String> getScripts()
{
return evalScripts;
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportContext.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportContext.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportContext.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,25 +24,23 @@
package org.equanda.tool.export.object;
+import javolution.lang.TextBuilder;
+import murlen.util.fscript.*;
+import org.apache.log4j.Logger;
import org.equanda.export.ExportEvaluatorWithCurrent;
import org.equanda.export.ExportException;
import org.equanda.tool.export.configuration.ExportConfiguration;
import org.equanda.tool.shared.ToolException;
-import javolution.lang.TextBuilder;
-import murlen.util.fscript.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.lang.reflect.Method;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
-import java.lang.reflect.Method;
-import java.io.FileReader;
-import java.io.File;
-import java.io.BufferedReader;
-import java.io.IOException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* Allow the export context. This is used to evaluate the ${xxx} expressions
* Allows something like Iterator behavior :
@@ -55,7 +53,7 @@
public class ExportContext
implements ExportEvaluatorWithCurrent
{
- private static final Log log = LogFactory.getLog( ExportContext.class );
+ private static final Logger log = Logger.getLogger( ExportContext.class );
protected ExportConfiguration cfg;
protected Timestamp startTime = new Timestamp( System.currentTimeMillis() );
@@ -88,7 +86,7 @@
Timestamp ts = new Timestamp( lmContext.get( lmContext.size() - 1 ) );
return new FSObject( ts );
}
- else if ( current !=null )
+ else if ( current != null )
{
try
{
@@ -98,7 +96,7 @@
Method method = current.getClass().getMethod( methodName.toString() );
Object res = method.invoke( current );
if ( res instanceof Integer || res instanceof Double || res instanceof FSObject
- || res instanceof String )
+ || res instanceof String )
{
return res;
}
@@ -167,18 +165,14 @@
}
}
- /**
- * start using context
- */
+ /** start using context */
public void start()
{
startTime.setTime( System.currentTimeMillis() );
context.clear();
}
- /**
- * stop using context
- */
+ /** stop using context */
public void stop()
{
context.clear();
@@ -215,7 +209,7 @@
}
if ( index < 0 ) index = 0;
if ( index >= context.size() ) index = context.size() - 1;
- if (index >=0 ) current = context.get( index );
+ if ( index >= 0 ) current = context.get( index );
try
{
Object res = script.evaluateExpression( expression );
@@ -265,9 +259,7 @@
lmContext.add( startTime.getTime() );
}
- /**
- * Remove last added item from context
- */
+ /** Remove last added item from context */
public void popContext()
{
if ( context.size() > 0 )
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportHelper.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportHelper.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ExportHelper.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,12 +24,11 @@
package org.equanda.tool.export.object;
+import org.apache.log4j.Logger;
import org.equanda.export.Export;
import org.equanda.tool.export.configuration.ExportSectionSettings;
import org.equanda.tool.shared.ToolException;
import org.equanda.util.IniFile;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.sql.Date;
import java.sql.Timestamp;
@@ -44,7 +43,7 @@
* @author NetRom team
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class ExportHelper
+public final class ExportHelper
{
public static final String TYPE_INT = "int";
public static final String TYPE_DOUBLE = "double";
@@ -53,29 +52,29 @@
public static final String TYPE_TIMESTAMP = "Timestamp";
public static final String TYPE_DATE = "Date";
- static Log log = LogFactory.getLog( "org.equanda.tool.export.object.ExportHelper" );
+ private static final Logger log = Logger.getLogger( ExportHelper.class );
- private static Map exportInfo; // Map used by export
- private static IniFile exportIni;
- private static final Export export = new Export();
+ private static Map EXPORT_INFO; // Map used by export
+ private static IniFile EXPORT_INI;
+ private static final Export EXPORT = new Export();
- public static final Hashtable<String, Class> classesMap = new Hashtable<String, Class>();
+ public static final Hashtable<String, Class> CLASSES_MAP = new Hashtable<String, Class>();
static
{
- classesMap.put( TYPE_INT, int.class );
- classesMap.put( TYPE_DOUBLE, double.class );
- classesMap.put( TYPE_BOOLEAN, boolean.class );
- classesMap.put( TYPE_STRING, String.class );
- classesMap.put( TYPE_TIMESTAMP, Timestamp.class );
- classesMap.put( TYPE_DATE, Date.class );
+ CLASSES_MAP.put( TYPE_INT, int.class );
+ CLASSES_MAP.put( TYPE_DOUBLE, double.class );
+ CLASSES_MAP.put( TYPE_BOOLEAN, boolean.class );
+ CLASSES_MAP.put( TYPE_STRING, String.class );
+ CLASSES_MAP.put( TYPE_TIMESTAMP, Timestamp.class );
+ CLASSES_MAP.put( TYPE_DATE, Date.class );
}
- public static final Hashtable<String, Cast> castMap = new Hashtable<String, Cast>();
+ public static final Hashtable<String, Cast> CAST_MAP = new Hashtable<String, Cast>();
static
{
- castMap.put( TYPE_INT, new Cast()
+ CAST_MAP.put( TYPE_INT, new Cast()
{
public Object cast( Object value )
{
@@ -83,7 +82,7 @@
return Integer.valueOf( value.toString() );
}
} );
- castMap.put( TYPE_DOUBLE, new Cast()
+ CAST_MAP.put( TYPE_DOUBLE, new Cast()
{
public Object cast( Object value )
{
@@ -91,7 +90,7 @@
return Double.valueOf( value.toString() );
}
} );
- castMap.put( TYPE_BOOLEAN, new Cast()
+ CAST_MAP.put( TYPE_BOOLEAN, new Cast()
{
public Object cast( Object value )
{
@@ -99,14 +98,14 @@
return Boolean.valueOf( value.toString() );
}
} );
- castMap.put( TYPE_STRING, new Cast()
+ CAST_MAP.put( TYPE_STRING, new Cast()
{
public Object cast( Object value )
{
return value.toString();
}
} );
- castMap.put( TYPE_TIMESTAMP, new Cast()
+ CAST_MAP.put( TYPE_TIMESTAMP, new Cast()
{
public Object cast( Object value )
{
@@ -115,7 +114,7 @@
return Timestamp.valueOf( value.toString() );
}
} );
- castMap.put( TYPE_DATE, new Cast()
+ CAST_MAP.put( TYPE_DATE, new Cast()
{
public Object cast( Object value )
{
@@ -129,28 +128,28 @@
public static void init( ExportSectionSettings settingsExport )
{
- if ( exportInfo == null )
+ if ( EXPORT_INFO == null )
{
// get the ExportInfo map
try
{
- exportInfo =
+ EXPORT_INFO =
(Map) Thread.currentThread().getContextClassLoader().loadClass( settingsExport.getExportInfo() )
.getMethod( "getMap" ).invoke( null );
}
catch ( Exception e )
{
log.error( "Cannot find exportInfo class " + settingsExport.getExportInfo() );
- exportInfo = null;
+ EXPORT_INFO = null;
}
}
- if ( exportIni == null )
+ if ( EXPORT_INI == null )
{
- exportIni = settingsExport.getExportIni();
+ EXPORT_INI = settingsExport.getExportIni();
}
- export.setDirectory( settingsExport.getExportDirectory() );
+ EXPORT.setDirectory( settingsExport.getExportDirectory() );
}
public static boolean export( ExportContext refForName, Object obj, boolean includeDirective,
@@ -161,12 +160,12 @@
{
if ( obj instanceof Collection )
{
- return export
- .export( refForName, (Collection) obj, exportIni, exportInfo, includeDirective, fileMoveMap );
+ return EXPORT
+ .export( refForName, (Collection) obj, EXPORT_INI, EXPORT_INFO, includeDirective, fileMoveMap );
}
else
{
- return export.export( refForName, obj, exportIni, exportInfo, includeDirective, fileMoveMap );
+ return EXPORT.export( refForName, obj, EXPORT_INI, EXPORT_INFO, includeDirective, fileMoveMap );
}
}
catch ( Exception e )
@@ -178,7 +177,7 @@
public static Object cast( String type, Object val )
throws ToolException
{
- Cast cast = castMap.get( type );
+ Cast cast = CAST_MAP.get( type );
if ( cast == null ) throw new ToolException( "Type " + type + " unknown, can't cast" );
try
{
@@ -192,6 +191,6 @@
interface Cast
{
- public Object cast( Object value );
+ Object cast( Object value );
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -25,9 +25,11 @@
package org.equanda.tool.export.object;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.equanda.export.ExportException;
+import org.equanda.persistence.EquandaProxy;
import org.equanda.persistence.Uoid;
-import org.equanda.persistence.EquandaProxy;
import org.equanda.tool.shared.ToolException;
import org.equanda.util.accessor.ObjectAccessor;
import org.equanda.util.accessor.ObjectAccessorException;
@@ -36,10 +38,7 @@
import java.util.ArrayList;
import java.util.Collection;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* Wrapper class for selectors
*
@@ -129,12 +128,13 @@
Class[] param = new Class[selectorParamType.length];
for ( int i = 0; i < param.length ; i++ )
{
- param[ i ] = ExportHelper.classesMap.get( selectorParamType[ i ] );
+ param[ i ] = ExportHelper.CLASSES_MAP.get( selectorParamType[ i ] );
}
try
{
- methodSelect = ObjectAccessor.getMethod( selector.getClass(), "select" + selectorName + "Proxy", param );
+ methodSelect =
+ ObjectAccessor.getMethod( selector.getClass(), "select" + selectorName + "Proxy", param );
methodRemove = ObjectAccessor.getMethod( selector.getClass(), METHOD_REMOVE_SELECTOR, null );
}
catch ( ObjectAccessorException oae )
@@ -269,7 +269,7 @@
if ( log.isDebugEnabled() ) log.debug( "create ejb for " + obj );
ejb = ObjectAccessor.createBean( jndi, name, ObjectAccessor.get( obj, "Uoid" ) );
}
- Class[] param = new Class[]{ ExportHelper.classesMap.get( setFieldType[ i ] ) };
+ Class[] param = new Class[]{ ExportHelper.CLASSES_MAP.get( setFieldType[ i ] ) };
Object[] values = new Object[]{ getParamValue( context, setFieldType[ i ], setFieldValue[ i ] ) };
if ( log.isDebugEnabled() )
{
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintClient.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintClient.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintClient.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -40,14 +40,14 @@
public class PrintClient
extends ToolMain<PrintConfiguration>
{
- public static final Id printId = Id.buildId( "print" );
+ public static final Id PRINT_ID = Id.buildId( "print" );
public String getIniDefault()
{
return "print.ini";
}
- public static void main( final String args[] )
+ public static void main( final String[] args )
{
ThreadGroup exceptionThreadGroup = new ExceptionGroup();
new Thread( exceptionThreadGroup, "Init thread" )
@@ -67,12 +67,12 @@
public Id getId( PrintConfiguration configurationExtra )
{
- return printId;
+ return PRINT_ID;
}
public WorkerThread getWorkerThread( PrintConfiguration cfg )
throws ToolException
{
- return new WorkerThread<PrintConfiguration>( cfg, new PrintWorker( cfg, printId ) );
+ return new WorkerThread<PrintConfiguration>( cfg, new PrintWorker( cfg, PRINT_ID ) );
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintWorker.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintWorker.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/print/PrintWorker.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,18 +24,19 @@
package org.equanda.tool.print;
+import net.sf.jasperreports.engine.JRException;
+import net.sf.jasperreports.engine.JasperPrint;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.log4j.Logger;
import org.equanda.tool.print.configuration.PrintConfiguration;
import org.equanda.tool.print.provider.ReportPrintInfo;
import org.equanda.tool.print.provider.ReportProvider;
import org.equanda.tool.shared.Id;
import org.equanda.tool.shared.ToolException;
import org.equanda.tool.shared.ToolListener;
-import static org.equanda.tool.shared.ToolMain.i18n;
+import static org.equanda.tool.shared.ToolMain.I18N;
import org.equanda.tool.shared.worker.Worker;
-import net.sf.jasperreports.engine.JRException;
-import net.sf.jasperreports.engine.JasperPrint;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.PostMethod;
import javax.print.PrintService;
import java.awt.print.PrinterJob;
@@ -55,6 +56,7 @@
public class PrintWorker
extends Worker<PrintConfiguration>
{
+ private static final Logger log = Logger.getLogger( PrintWorker.class );
public static final String REPORT_TYPE_PRINT = "print";
private URL reportURL;
@@ -77,7 +79,7 @@
throws ToolException
{
setWorkDeadline();
- for ( int i = 0 ; i < classes.size() ; i++ )
+ for ( int i = 0; i < classes.size() ; i++ )
{
if ( stopRequested ) return;
@@ -101,7 +103,10 @@
if ( log.isDebugEnabled() ) log.debug( "start loop to print reports" );
for ( ReportPrintInfo info : provider.getReports() )
{
- if ( log.isDebugEnabled() ) log.debug( "found report for printing " + info.getReportName() + " : " + info );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "found report for printing " + info.getReportName() + " : " + info );
+ }
HttpClient httpConn = new HttpClient();
// set timeout to 5 min
httpConn.setConnectionTimeout( 5 * 60000 );
@@ -113,7 +118,7 @@
post.setParameter( "username", username );
post.setParameter( "password", password );
post.setParameter( "language", info.getReportLanguage() );
-
+
Hashtable<String, String> parameters = info.getParameters();
Enumeration<String> keys = parameters.keys();
while ( keys.hasMoreElements() )
@@ -131,12 +136,15 @@
if ( print.getPages().size() == 0 )
{
- if ( log.isDebugEnabled() ) log.debug( "report has no pages " + info.getReportName() + " : " + info );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "report has no pages " + info.getReportName() + " : " + info );
+ }
listener.notifyInfo( ToolListener.STATUS_ENDED, classes.get( i ),
- i18n.txt( "nopages", workerId ) );
+ I18N.txt( "nopages", workerId ) );
return;
}
- listener.notifyInfo( ToolListener.STATUS_ENDED, classes.get( i ), i18n.txt( "ok", workerId ) );
+ listener.notifyInfo( ToolListener.STATUS_ENDED, classes.get( i ), I18N.txt( "ok", workerId ) );
if ( log.isDebugEnabled() ) log.debug( "print report " + info.getReportName() + " : " + info );
PrintService ps = getPrintService( info.getPrinterName() );
@@ -144,7 +152,10 @@
// add report infos in order to perform the postPrint actions(update/delete)
printedReports.add( info );
- if ( log.isDebugEnabled() ) log.debug( "finished report printing " + info.getReportName() + " : " + info );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "finished report printing " + info.getReportName() + " : " + info );
+ }
}
}
catch ( ClassNotFoundException cnfe )
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/print/Printer.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/print/Printer.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/print/Printer.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -76,19 +76,15 @@
switch ( jasperPrint.getOrientation() )
{
case JRReport.ORIENTATION_LANDSCAPE:
- {
- pageFormat.setOrientation( PageFormat.LANDSCAPE );
- paper.setSize( jasperPrint.getPageHeight(), jasperPrint.getPageWidth() );
- paper.setImageableArea( 0, 0, jasperPrint.getPageHeight(), jasperPrint.getPageWidth() );
- break;
- }
+ pageFormat.setOrientation( PageFormat.LANDSCAPE );
+ paper.setSize( jasperPrint.getPageHeight(), jasperPrint.getPageWidth() );
+ paper.setImageableArea( 0, 0, jasperPrint.getPageHeight(), jasperPrint.getPageWidth() );
+ break;
case JRReport.ORIENTATION_PORTRAIT:
- default :
- {
- pageFormat.setOrientation( PageFormat.PORTRAIT );
- paper.setSize( jasperPrint.getPageWidth(), jasperPrint.getPageHeight() );
- paper.setImageableArea( 0, 0, jasperPrint.getPageWidth(), jasperPrint.getPageHeight() );
- }
+ default:
+ pageFormat.setOrientation( PageFormat.PORTRAIT );
+ paper.setSize( jasperPrint.getPageWidth(), jasperPrint.getPageHeight() );
+ paper.setImageableArea( 0, 0, jasperPrint.getPageWidth(), jasperPrint.getPageHeight() );
}
pageFormat.setPaper( paper );
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/print/provider/ReportPrintInfo.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/print/provider/ReportPrintInfo.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/print/provider/ReportPrintInfo.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -37,16 +37,16 @@
*/
public interface ReportPrintInfo
{
- public static final DateTimeFormatter dateParser = DateTimeFormat.forPattern( "yyyy-MM-dd" );
- public static final DateTimeFormatter timeParser = DateTimeFormat.forPattern( "yyyy-MM-dd HH:mm:ss" );
+ public static final DateTimeFormatter DATE_PARSER = DateTimeFormat.forPattern( "yyyy-MM-dd" );
+ public static final DateTimeFormatter TIME_PARSER = DateTimeFormat.forPattern( "yyyy-MM-dd HH:mm:ss" );
- public String getReportName();
+ String getReportName();
- public String getPrinterName();
+ String getPrinterName();
- public String getReportLanguage();
+ String getReportLanguage();
- public Hashtable<String, String> getParameters();
+ Hashtable<String, String> getParameters();
- public Uoid getId();
+ Uoid getId();
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Id.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Id.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Id.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -26,11 +26,11 @@
/**
- * Id class (used to id threads and applicatin )
+ * Id class (used to id threads and application )
*
* @author NetRom team
*/
-public class Id
+public final class Id
{
private String id;
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Resolver.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Resolver.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/Resolver.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,8 +24,8 @@
package org.equanda.tool.shared;
+import javolution.lang.TextBuilder;
import org.equanda.util.Internationalize;
-import javolution.lang.TextBuilder;
/**
@@ -36,12 +36,13 @@
*/
public class Resolver
{
- private static final Internationalize internat = new Internationalize( true );
+ private static final Internationalize INTERNAT = new Internationalize( true );
/**
* get the i18n string for the given key
*
* @param txt key to be internationalized
+ * @param id id
* @return the internationalized text or the key itself when not found
*/
public String txt( String txt, Id id )
@@ -60,13 +61,13 @@
tb.append( '.' );
tb.append( txt );
String key = tb.toString();
- String res = internat.getResource( key );
+ String res = INTERNAT.getResource( key );
if ( key.equals( res ) )
{
tb.setLength( 0 );
tb.append( "tool:" );
tb.append( txt );
- res = internat.getResource( tb.toString() );
+ res = INTERNAT.getResource( tb.toString() );
}
return res;
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolMain.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolMain.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolMain.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,13 +24,12 @@
package org.equanda.tool.shared;
+import org.apache.log4j.Logger;
import org.equanda.tool.shared.configuration.ConfigurationExtra;
import org.equanda.tool.shared.ui.ToolClient;
import org.equanda.tool.shared.ui.ToolClientDisplay;
import org.equanda.tool.shared.ui.ToolClientHidden;
import org.equanda.tool.shared.worker.WorkerThread;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
* Shared code for the main routine for the tools
@@ -38,11 +37,11 @@
* @author NetRom team
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public abstract class ToolMain <T extends ConfigurationExtra>
+public abstract class ToolMain<T extends ConfigurationExtra>
{
- public static final Resolver i18n = new Resolver();
+ public static final Resolver I18N = new Resolver();
- private static Log log = LogFactory.getLog( ToolMain.class.getName() );
+ private static final Logger log = Logger.getLogger( ToolMain.class );
private WorkerThread worker;
/**
@@ -50,7 +49,7 @@
*
* @param args can contain the location of the .ini file to use (default import.ini)
*/
- public void start( final String args[] )
+ public void start( final String[] args )
{
ToolClient app;
T cfg;
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/configuration/ConfigurationMain.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/configuration/ConfigurationMain.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/configuration/ConfigurationMain.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -42,17 +42,13 @@
*/
public class ConfigurationMain
{
- /**
- * sections
- */
+ /** sections */
SectionGeneral sectionGeneral;
SectionDataBase sectionDataBase;
SectionConfig sectionConfig;
SectionOM sectionOM;
- /**
- * ini file
- */
+ /** ini file */
private IniFile ini;
public ConfigurationMain( String iniFileName )
@@ -69,9 +65,9 @@
init();
}
- public ConfigurationMain( IniFile ini_ )
+ public ConfigurationMain( IniFile newIni )
{
- ini = ini_;
+ ini = newIni;
init();
}
@@ -102,9 +98,7 @@
return ini;
}
- /**
- * getters for sections
- */
+ /* getters for sections */
public SectionGeneral getSectionGeneral()
{
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientDisplay.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientDisplay.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientDisplay.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,21 +24,19 @@
package org.equanda.tool.shared.ui;
+import javolution.lang.TextBuilder;
+import org.apache.log4j.Logger;
import org.equanda.tool.shared.Id;
import org.equanda.tool.shared.ToolException;
import org.equanda.tool.shared.ToolListener;
+import static org.equanda.tool.shared.ToolMain.I18N;
import org.equanda.tool.shared.worker.WorkerThread;
-import javolution.lang.TextBuilder;
import javax.swing.*;
import javax.swing.border.EtchedBorder;
import java.awt.*;
import java.awt.event.WindowEvent;
-import static org.equanda.tool.shared.ToolMain.i18n;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* Client class for tool in the case user wants the window to be displayed
*
@@ -49,24 +47,22 @@
extends JFrame
implements ToolClient
{
- protected Log log = LogFactory.getLog( this.getClass() );
+ private static final Logger log = Logger.getLogger( ToolClientDisplay.class );
- /**
- * local fields
- */
+ /** local fields */
private JTextArea info = new JTextArea();
private JTextArea status = new JTextArea();
private WorkerThread workThread;
private Id appId;
- public ToolClientDisplay( WorkerThread thread, Id appId_, String title )
+ public ToolClientDisplay( WorkerThread thread, Id newAppId, String title )
throws ToolException
{
- super( title == null || title.equals( "" ) ? i18n.txt( "title", appId_ ) : title );
+ super( title == null || title.equals( "" ) ? I18N.txt( "title", newAppId ) : title );
workThread = thread;
workThread.setListener( new ToolAdapter() );
- appId = appId_;
+ appId = newAppId;
try
{
Class plaf = Thread.currentThread().getContextClassLoader().loadClass(
@@ -92,22 +88,22 @@
info.setBackground( UIManager.getColor( "Panel.background" ) );
info.setColumns( 50 );
- info.setText( i18n.txt( "file", appId ) + '\n' + i18n.txt( "results", appId ) );
+ info.setText( I18N.txt( "file", appId ) + '\n' + I18N.txt( "results", appId ) );
GridBagConstraints constr = new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0
- , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+ , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets( 10, 0, 10, 0 ), 0, 0 );
JPanel statusPanel = new JPanel( new GridBagLayout() );
statusPanel.setBorder( new EtchedBorder() );
- statusPanel.add( new JLabel( i18n.txt( "current-status", appId ) ) );
+ statusPanel.add( new JLabel( I18N.txt( "current-status", appId ) ) );
constr.gridy = 1;
constr.insets = new Insets( 10, 0, 10, 0 );
statusPanel.add( status, constr );
JPanel infoPanel = new JPanel( new GridBagLayout() );
infoPanel.setBorder( new EtchedBorder() );
- infoPanel.add( new JLabel( i18n.txt( "info", appId ) ) );
+ infoPanel.add( new JLabel( I18N.txt( "info", appId ) ) );
constr.gridy = 1;
constr.insets = new Insets( 10, 0, 10, 0 );
infoPanel.add( info, constr );
@@ -133,16 +129,16 @@
{
public void run()
{
- int option = JOptionPane.showConfirmDialog( ToolClientDisplay.this, i18n.txt( "are-you-sure",
+ int option = JOptionPane.showConfirmDialog( ToolClientDisplay.this, I18N.txt( "are-you-sure",
appId ),
- i18n.txt( "information", appId ),
+ I18N.txt( "information", appId ),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE );
if ( option == JOptionPane.OK_OPTION )
{
// send only notification to the thread to stop, he will do the actual exit after clean up
workThread.stopWork();
- setStatus( i18n.txt( "waiting-to-shutdown", appId ) );
+ setStatus( I18N.txt( "waiting-to-shutdown", appId ) );
}
}
} );
@@ -151,14 +147,12 @@
}
- /**
- * Set the new worker thread.
- */
+ /** Set the new worker thread. */
public void setWorker( WorkerThread worker )
{
workThread = worker;
}
-
+
private void setInfo( String text )
{
info.setText( text );
@@ -175,9 +169,7 @@
this.setVisible( true );
}
- /**
- * implements the listener
- */
+ /** implements the listener */
class ToolAdapter
implements ToolListener
{
@@ -190,11 +182,11 @@
public void run()
{
TextBuilder output = TextBuilder.newInstance();
- output.append( i18n.txt( status, appId ) );
+ output.append( I18N.txt( status, appId ) );
output.append( ' ' );
output.append( file == null ? "" : file );
output.append( '\n' );
- output.append( i18n.txt( ToolListener.STATUS_ENDED, appId ) );
+ output.append( I18N.txt( ToolListener.STATUS_ENDED, appId ) );
output.append( info == null ? "" : info );
setInfo( output.toString() );
}
@@ -209,7 +201,7 @@
public void run()
{
TextBuilder output = TextBuilder.newInstance();
- output.append( i18n.txt( status, appId ) );
+ output.append( I18N.txt( status, appId ) );
output.append( ' ' );
output.append( file == null ? "" : file );
setStatus( output.toString() );
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -21,12 +21,13 @@
* 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.shared.ui;
import javolution.lang.TextBuilder;
import org.equanda.tool.shared.Id;
import org.equanda.tool.shared.ToolListener;
-import static org.equanda.tool.shared.ToolMain.i18n;
+import static org.equanda.tool.shared.ToolMain.I18N;
import org.equanda.tool.shared.worker.WorkerThread;
/**
@@ -41,11 +42,11 @@
private WorkerThread workThread;
private Id appId;
- public ToolClientHidden( WorkerThread thread, Id appId_ )
+ public ToolClientHidden( WorkerThread thread, Id newAppId )
{
workThread = thread;
workThread.setListener( new ToolAdapter() );
- appId = appId_;
+ appId = newAppId;
/**
* set a shutdown hook
* also catches ^C
@@ -55,8 +56,8 @@
{
public void run()
{
- System.out.println( i18n.txt( "shutdown-command-received", appId ) );
- System.out.println( i18n.txt( "waiting-to-shutdown", appId ) );
+ System.out.println( I18N.txt( "shutdown-command-received", appId ) );
+ System.out.println( I18N.txt( "waiting-to-shutdown", appId ) );
workThread.stopWork();
try
{
@@ -67,7 +68,6 @@
{}
}
} );
-
}
private void setInfo( String text )
@@ -82,32 +82,28 @@
private void showError( String info )
{
- System.out.println( i18n.txt( "error", appId ) + info );
+ System.out.println( I18N.txt( "error", appId ) + info );
}
- /**
- * Set the new worker thread.
- */
+ /** Set the new worker thread. */
public void setWorker( WorkerThread worker )
{
workThread = worker;
- }
+ }
public void startThread()
{
workThread.start();
}
- /**
- * implements the import listener
- */
+ /** implements the import listener */
class ToolAdapter
implements ToolListener
{
public void notifyInfo( final String status, final String file, final String extra )
{
TextBuilder output = TextBuilder.newInstance();
- output.append( i18n.txt( status, appId ) );
+ output.append( I18N.txt( status, appId ) );
output.append( ' ' );
output.append( extra == null ? "" : extra );
setInfo( output.toString() );
@@ -116,7 +112,7 @@
public void notifyStatus( final String status, final String extra )
{
TextBuilder output = TextBuilder.newInstance();
- output.append( i18n.txt( status, appId ) );
+ output.append( I18N.txt( status, appId ) );
output.append( ' ' );
output.append( extra == null ? "" : extra );
setStatus( output.toString() );
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/worker/Worker.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/worker/Worker.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/worker/Worker.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -24,19 +24,18 @@
package org.equanda.tool.shared.worker;
-import org.equanda.tool.shared.Id;
-import org.equanda.tool.shared.ToolException;
-import org.equanda.tool.shared.ToolListener;
-import org.equanda.tool.shared.configuration.ConfigurationExtra;
-import org.equanda.util.script.*;
-import org.equanda.util.alert.AlertUtil;
import javolution.lang.TextBuilder;
import murlen.util.fscript.FSException;
import murlen.util.fscript.FSFastExtension;
import murlen.util.fscript.FSFunctionExtension;
import murlen.util.fscript.FSVarExtension;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
+import org.equanda.tool.shared.Id;
+import org.equanda.tool.shared.ToolException;
+import org.equanda.tool.shared.ToolListener;
+import org.equanda.tool.shared.configuration.ConfigurationExtra;
+import org.equanda.util.alert.AlertUtil;
+import org.equanda.util.script.*;
import javax.transaction.UserTransaction;
import java.io.IOException;
@@ -48,9 +47,9 @@
*
* @author NetRom team
*/
-public abstract class Worker <T extends ConfigurationExtra>
+public abstract class Worker<T extends ConfigurationExtra>
{
- protected Log log = LogFactory.getLog( this.getClass() );
+ private static final Logger log = Logger.getLogger( Worker.class );
protected ToolListener listener;
protected boolean stopRequested;
@@ -89,9 +88,9 @@
/* other methods are reusable (but may need some extending) */
- public Worker( T cfg, Id id_ )
+ public Worker( T cfg, Id newId )
{
- workerId = id_;
+ workerId = newId;
listener = new EmptyListener();
@@ -134,9 +133,9 @@
StringExtension.addExtension( fastExtension );
GeneralExtension.addExtension( fastExtension );
FileExtension.addExtension( fastExtension );
- DMExtension DMExt = new DMExtension( cfg.getMainConfiguration().getIni(), "om,",
- cfg.getMainConfiguration().getSectionOM().getOmConnections() );
- DMExt.addExtension( fastExtension );
+ DMExtension dmExtension = new DMExtension( cfg.getMainConfiguration().getIni(), "om,",
+ cfg.getMainConfiguration().getSectionOM().getOmConnections() );
+ dmExtension.addExtension( fastExtension );
fastExtension.addVarExtension( "stopRequested", new FSVarExtension()
{
public Object getVar( String s )
@@ -254,9 +253,7 @@
return workerId;
}
- /**
- * stops the thread
- */
+ /** stops the thread */
public void stopWork()
{
stopRequested = true;
@@ -342,12 +339,12 @@
private class EmptyListener
implements ToolListener
{
- public void notifyInfo( String status, String file, String info ){}
+ public void notifyInfo( String status, String file, String info ) {}
- public void notifyStatus( String status, String info ){}
+ public void notifyStatus( String status, String info ) {}
- public void notifyError( String info ){}
+ public void notifyError( String info ) {}
- public void notifyFinished(){}
+ public void notifyFinished() {}
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/ImportDialog.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/ImportDialog.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/ImportDialog.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -21,19 +21,20 @@
* 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.translationsEditor;
import org.equanda.translations.Key;
import org.equanda.translations.Translation;
import javax.swing.*;
+import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.Enumeration;
import java.util.Properties;
-import java.util.Enumeration;
import java.util.TreeMap;
/**
@@ -49,7 +50,7 @@
private JCheckBox checkBoxContextFileName = new JCheckBox( "Use file name as context" );
private JCheckBox checkBoxKeysOnly = new JCheckBox( "Import keys only" );
private JCheckBox checkBoxOverwrite = new JCheckBox( "Overwrite if key exists" );
- private String languages[];
+ private String[] languages;
private KeyTableModel model;
public ImportDialog()
@@ -140,10 +141,10 @@
return;
}
- File[] children=file.listFiles();
- for (File child: children)
+ File[] children = file.listFiles();
+ for ( File child : children )
{
- importProperties(child.getAbsolutePath(), context, contextFromFileName, keysOnly, overwrite);
+ importProperties( child.getAbsolutePath(), context, contextFromFileName, keysOnly, overwrite );
}
}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/KeyEditorPanel.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/KeyEditorPanel.java 2008-12-03 17:58:16 UTC (rev 896)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/KeyEditorPanel.java 2008-12-03 22:10:23 UTC (rev 897)
@@ -50,7 +50,7 @@
private JTextField context = new JTextField();
private JTextArea description = new JTextArea();
private TreeMap<String, JTextField[]> translationsTextFields;
- private String languages[];
+ private String[] languages;
private Key key;
private KeyTableModel model;
private DomainModel domainModel;
@@ -64,7 +64,7 @@
this.domainModel = domainModel;
}
- public KeyEditorPanel( String languages[], KeyTableModel model )
+ public KeyEditorPanel( String[] languages, KeyTableModel model )
{
this.languages = languages;
this.model = model;
@@ -78,7 +78,7 @@
GridBagConstraints constr = new GridBagConstraints( 0, 0, 1, 1, 1.0, 1.0
, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
- new Insets( 2, 2, 2, 2 ), 0, 0 );
+ new Insets( 2, 2, 2, 2 ), 0, 0 );
constr.weightx = 1.0;
trans.add( new JLabel( "Context : " ), constr );
@@ -379,7 +379,7 @@
hasChanged.run();
}
- /** Clear the fields. Useful when the last key was removed from the table and there's no other to update the fields. */
+ /** Clear the fields. Useful when last key was removed from the table and there's no other to update the fields. */
public void clear()
{
context.setText( "" );
Modified: tru...
[truncated message content] |
|
From: <tri...@us...> - 2008-12-03 17:58:20
|
Revision: 896
http://equanda.svn.sourceforge.net/equanda/?rev=896&view=rev
Author: triathlon98
Date: 2008-12-03 17:58:16 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/config/checkstyle.xml
trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java
trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaObjectType.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxyState.java
trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java
trunk/equanda-client/src/main/java/org/equanda/persistence/LenientChecksState.java
trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java
trunk/equanda-client/src/main/java/org/equanda/persistence/SelectorsState.java
trunk/equanda-client/src/main/java/org/equanda/persistence/UoidGenerator.java
trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainer.java
trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainerAdapter.java
trunk/equanda-client/src/main/java/org/equanda/subjectory/ISOCountry2LetterTranslator.java
trunk/equanda-client/src/main/java/org/equanda/subjectory/XmlFileContainer.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseMap.java
trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolException.java
trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java
trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/Configuration.java
Modified: trunk/config/checkstyle.xml
===================================================================
--- trunk/config/checkstyle.xml 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/config/checkstyle.xml 2008-12-03 17:58:16 UTC (rev 896)
@@ -236,7 +236,7 @@
<property name="protectedAllowed" value="true"/>
</module>
<module name="FinalClass"/>
- <module name="InterfaceIsType"/>
+ <!--<module name="InterfaceIsType"/>-->
<module name="HideUtilityClassConstructor"/>
<!--<module name="DesignForExtension"/>-->
<!--<module name="MutableException"/>-->
Modified: trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -39,10 +39,12 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class ImportClient
+public final class ImportClient
{
private static final String LOGIN_SERVLET = "j_security_check";
+ private ImportClient() {}
+
public static String importString( String data, String address, final String login, final String password )
throws IOException
{
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -35,7 +35,7 @@
{
public static final String RULES_CHECKS_STATE_CONTEXT = "equanda-CheckRulesStateContext";
- private static ThreadLocal state = new ThreadLocal()
+ private static ThreadLocal STATE = new ThreadLocal()
{
protected Object initialValue()
{
@@ -45,7 +45,7 @@
private CheckRulesState() {}
- public static boolean getCheckRules() { return (Boolean) state.get(); }
+ public static boolean getCheckRules() { return (Boolean) STATE.get(); }
- public static void setCheckRules( boolean value ) { state.set( Boolean.valueOf( value ) ); }
+ public static void setCheckRules( boolean value ) { STATE.set( Boolean.valueOf( value ) ); }
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaObjectType.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaObjectType.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaObjectType.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -71,7 +71,7 @@
/**
* Check whether the given type "is a child of" (or the type itself).
* <p/>
- *
+ * <p/>
* For example, in a hierarchy Object-Vehicle-Car,
* Vehicle.isParentType(Vehicle) returns true
* Vehicle.isParentType(Car) returns true
@@ -80,7 +80,8 @@
* @param type type identifier (four letters) for the type to test
* @return true when it is an "instanceof"
*/
- public boolean isParentType(String type) {
+ public boolean isParentType( String type )
+ {
// sanity checks
if ( type == null ) return false;
if ( type.length() < 4 ) type = type + " ";
@@ -90,7 +91,6 @@
}
-
// provided to implement EnumerableChoice
public boolean isAllowed( boolean b )
{ return false; }
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -48,12 +48,12 @@
private int exceptionCode;
private String appendedParameters;
private String[] injectedParameters;
- private static final List<String> contexts = new ArrayList<String>();
+ private static final List<String> CONTEXTS = new ArrayList<String>();
static
{
- contexts.add( CORE_EXCEPTIONS_CONTEXT );
- contexts.add( APPLICATION_EXCEPTIONS_CONTEXT );
+ CONTEXTS.add( CORE_EXCEPTIONS_CONTEXT );
+ CONTEXTS.add( APPLICATION_EXCEPTIONS_CONTEXT );
}
public EquandaPersistenceException()
@@ -125,7 +125,7 @@
try
{
TranslatorEJB translator = TranslatorEJBUtil.get();
- return translator.translate( "en", message, contexts );
+ return translator.translate( "en", message, CONTEXTS );
}
catch ( Exception ex ) { return message; }
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxyState.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxyState.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxyState.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -42,7 +42,7 @@
public long equandaVersion;
public String equandaStatus;
- public boolean _modifiedEquandaStatus;
+ public boolean equandaModifiedEquandaStatus;
public boolean updateInProgress;
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -31,7 +31,7 @@
*/
public interface ExceptionCodes
{
- // @todo - some of these I can't find in ejb templates so they are either in use in other places, or they can be removed
+ // @todo - some of these I can't find in ejb templates so they are either in use elsewhere, or they can be removed
int UPE_PERSISTENCE_EXCEPTION = 90000;
int UPE_CANNOT_CREATE_SESSION_FACADE = 90001;
int UPE_OBJECT_NOT_FOUND = 90002;
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LenientChecksState.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/LenientChecksState.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/LenientChecksState.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -30,11 +30,11 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class LenientChecksState
+public final class LenientChecksState
{
public static final String LENIENT_CHECKS_STATE_CONTEXT = "equanda-LenientChecksStateContext";
- private static ThreadLocal state = new ThreadLocal()
+ private static ThreadLocal STATE = new ThreadLocal()
{
protected Object initialValue()
{
@@ -42,8 +42,10 @@
}
};
- public static boolean getLenientChecks() { return (Boolean) state.get(); }
+ private LenientChecksState() {}
- public static void setLenientChecks( boolean value ) { state.set( Boolean.valueOf( value ) ); }
+ public static boolean getLenientChecks() { return (Boolean) STATE.get(); }
+ public static void setLenientChecks( boolean value ) { STATE.set( Boolean.valueOf( value ) ); }
+
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -38,11 +38,13 @@
*
* @author NetRom team
*/
-public abstract class ObjectSelector
+public final class ObjectSelector
{
private static final Logger log = Logger.getLogger( ObjectSelector.class );
public static final String FILTER_PARAMETER_PREFIX = "equandaFilter";
+ private ObjectSelector() {}
+
protected static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery )
{
return getEquandaQuery( em, equandaQuery, null, true );
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/SelectorsState.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/SelectorsState.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/SelectorsState.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -29,11 +29,11 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class SelectorsState
+public final class SelectorsState
{
public static final String SELECTORS_STATE_CONTEXT = "equanda-SelectorsStateContext";
- private static ThreadLocal<SelectorsStateType> state =
+ private static ThreadLocal<SelectorsStateType> STATE =
new ThreadLocal<SelectorsStateType>()
{
protected SelectorsStateType initialValue()
@@ -42,25 +42,27 @@
}
};
+ private SelectorsState() {}
+
public static String getSorting( String tableName )
{
- return state.get().getTableOrder( tableName );
+ return STATE.get().getTableOrder( tableName );
}
public static void setSorting( String tableName, String order )
{
- state.get().setTableOrder( tableName, order );
+ STATE.get().setTableOrder( tableName, order );
}
public static String getFilter( String name )
{
- return state.get().getFilter( name );
+ return STATE.get().getFilter( name );
}
public static void setFilter( String name, String value )
{
- state.get().setFilter( name, value );
+ STATE.get().setFilter( name, value );
}
public static boolean isFilterSet( String name )
@@ -68,11 +70,11 @@
return getFilter( name ) != null;
}
- public static SelectorsStateType getSelectorsState() { return state.get(); }
+ public static SelectorsStateType getSelectorsState() { return STATE.get(); }
public static void setSelectorsState( SelectorsStateType stateType )
{
if ( null == stateType ) stateType = new SelectorsStateType();
- state.set( stateType );
+ STATE.set( stateType );
}
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/UoidGenerator.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/UoidGenerator.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/UoidGenerator.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -55,15 +55,15 @@
*/
public final class UoidGenerator
{
- private static Integer lock = new Integer( 0 ); // lock to force sequential access
- private static long time = System.currentTimeMillis(); // time part of high value
- private static boolean initialised; // true when id is initialised
- private static byte[] uoid =
- new byte[ 14 ]; // array to build Uoid in, normally contains high in fourth and following characters
- private static int low; // next value for LOW
- private static int lowLast; // last value for LOW, when low==lowLast then a new high has to be
+ private static final Integer LOCK = 0; // lock to force sequential access
+ private static long TIME = System.currentTimeMillis(); // time part of high value
+ private static boolean INITIALISED; // true when id is initialised
+ private static byte[] UOID =
+ new byte[14]; // array to build Uoid in, normally contains high in fourth and following characters
+ private static int LOW; // next value for LOW
+ private static int LOW_LAST; // last value for LOW, when low==lowLast then a new high has to be
// regenerated (test on increment, increment after use)
- private static final int LOW_MAX = 262144; // max value for LOW (==2^18)
+ private static final int LOW_MAX = 262144; // max value for LOW (==2^18)
private static byte[] BASE64 = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
@@ -74,9 +74,7 @@
'w', 'x', 'y', 'z' };
// purely static class, hide constructor
- private UoidGenerator()
- {
- }
+ private UoidGenerator() {}
/**
* get a new Uoid
@@ -85,9 +83,9 @@
*/
public static Uoid get()
{
- synchronized ( lock )
+ synchronized ( LOCK )
{
- if ( !initialised )
+ if ( !INITIALISED )
{
// generate the random number
Random rnd = new Random(); // @todo need a different seed, this is now time based and I
@@ -95,36 +93,36 @@
// get the random number, instead of getting an integer and converting that to base64 later,
// we get a string and narrow that down to base64, use the top 6 bits of the characters
// as they are more random than the bottom ones...
- rnd.nextBytes( uoid ); // get some random characters
- uoid[ 3 ] = BASE64[ ( ( uoid[ 3 ] >> 2 ) & 0x3f ) ];
- uoid[ 4 ] = BASE64[ ( ( uoid[ 4 ] >> 2 ) & 0x3f ) ];
- uoid[ 5 ] = BASE64[ ( ( uoid[ 5 ] >> 2 ) & 0x3f ) ];
- uoid[ 6 ] = BASE64[ ( ( uoid[ 6 ] >> 2 ) & 0x3f ) ];
- uoid[ 7 ] = BASE64[ ( ( uoid[ 7 ] >> 2 ) & 0x3f ) ];
+ rnd.nextBytes( UOID ); // get some random characters
+ UOID[ 3 ] = BASE64[ ( ( UOID[ 3 ] >> 2 ) & 0x3f ) ];
+ UOID[ 4 ] = BASE64[ ( ( UOID[ 4 ] >> 2 ) & 0x3f ) ];
+ UOID[ 5 ] = BASE64[ ( ( UOID[ 5 ] >> 2 ) & 0x3f ) ];
+ UOID[ 6 ] = BASE64[ ( ( UOID[ 6 ] >> 2 ) & 0x3f ) ];
+ UOID[ 7 ] = BASE64[ ( ( UOID[ 7 ] >> 2 ) & 0x3f ) ];
// complete the time part in the HIGH value of the Uoid
// this also sets the initial low value
completeUOID( rnd );
- initialised = true;
+ INITIALISED = true;
}
// fill in LOW value in id
- int l = low;
- uoid[ 0 ] = BASE64[ ( l & 0x3f ) ];
+ int l = LOW;
+ UOID[ 0 ] = BASE64[ ( l & 0x3f ) ];
l >>= 6;
- uoid[ 1 ] = BASE64[ ( l & 0x3f ) ];
+ UOID[ 1 ] = BASE64[ ( l & 0x3f ) ];
l >>= 6;
- uoid[ 2 ] = BASE64[ ( l & 0x3f ) ];
+ UOID[ 2 ] = BASE64[ ( l & 0x3f ) ];
- Uoid res = new Uoid( uoid );
+ Uoid res = new Uoid( UOID );
// increment LOW
- low++;
- if ( low == LOW_MAX ) low = 0;
- if ( low == lowLast )
+ LOW++;
+ if ( LOW == LOW_MAX ) LOW = 0;
+ if ( LOW == LOW_LAST )
{
- time = System.currentTimeMillis();
+ TIME = System.currentTimeMillis();
completeUOID();
}
@@ -140,14 +138,14 @@
private static void completeUOID( Random rnd )
{
// fill in time part in Uoid string
- long t = time;
- for ( int i = 0; i < 6; i++ )
+ long t = TIME;
+ for ( int i = 0; i < 6 ; i++ )
{
- uoid[ 8 + i ] = BASE64[ ( ( (int) t ) & 0x3f ) ];
+ UOID[ 8 + i ] = BASE64[ ( ( (int) t ) & 0x3f ) ];
t >>= 6;
}
// generate new LOW start value
- lowLast = low = rnd.nextInt( LOW_MAX );
+ LOW_LAST = LOW = rnd.nextInt( LOW_MAX );
}
}
Modified: trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainer.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainer.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainer.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -43,7 +43,8 @@
String getContainerType();
/**
- * Get the string which is referenced by the given xpath expression in the (current location in) the given container.
+ * Get the string which is referenced by the given xpath expression in the (current location in) the given
+ * container.
*
* @param container name of the container to search in
* @param xPathExpr xpath expression to evaluate
@@ -52,7 +53,8 @@
String getString( String container, String xPathExpr );
/**
- * Get the list of nodes which are referenced by the given xpath expression in the (current location in) the given container.
+ * Get the list of nodes which are referenced by the given xpath expression in the (current location in) the
+ * given container.
*
* @param container name of the container to search in
* @param xPathExpr xpath expression to evaluate
Modified: trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainerAdapter.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainerAdapter.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/subjectory/DataContainerAdapter.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -108,7 +108,7 @@
if ( log.isDebugEnabled() )
{
- log.debug( "getXPath for" + container + ". Detected name space uri : " + doc.getNamespaceURI() );
+ log.debug( "getXPath for" + container + ". Detected name space uri : " + doc.getNamespaceURI() );
}
Modified: trunk/equanda-client/src/main/java/org/equanda/subjectory/ISOCountry2LetterTranslator.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/subjectory/ISOCountry2LetterTranslator.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/subjectory/ISOCountry2LetterTranslator.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -35,257 +35,256 @@
public class ISOCountry2LetterTranslator
implements MappingTranslator<String, String>
{
+ private static final OneToOneHashMap<String, String> COUNTRY_CODES = new OneToOneHashMap();
- private static final OneToOneHashMap<String, String> countryCodes = new OneToOneHashMap();
-
static
{
- countryCodes.put( "AD", "Andorra" );
- countryCodes.put( "AE", "United Arab Emirates" );
- countryCodes.put( "AF", "Afghanistan" );
- countryCodes.put( "AG", "Antigua and Barbuda" );
- countryCodes.put( "AI", "Anguilla" );
- countryCodes.put( "AL", "Albania" );
- countryCodes.put( "AM", "Armenia" );
- countryCodes.put( "AN", "Netherlands Antilles" );
- countryCodes.put( "AO", "Angola" );
- countryCodes.put( "AP", "Asia/Pacific Region" );
- countryCodes.put( "AQ", "Antarctica" );
- countryCodes.put( "AR", "Argentina" );
- countryCodes.put( "AS", "American Samoa" );
- countryCodes.put( "AT", "Austria" );
- countryCodes.put( "AU", "Australia" );
- countryCodes.put( "AW", "Aruba" );
- countryCodes.put( "AX", "Aland Islands" );
- countryCodes.put( "AZ", "Azerbaijan" );
- countryCodes.put( "BA", "Bosnia and Herzegovina" );
- countryCodes.put( "BB", "Barbados" );
- countryCodes.put( "BD", "Bangladesh" );
- countryCodes.put( "BE", "Belgium" );
- countryCodes.put( "BF", "Burkina Faso" );
- countryCodes.put( "BG", "Bulgaria" );
- countryCodes.put( "BH", "Bahrain" );
- countryCodes.put( "BI", "Burundi" );
- countryCodes.put( "BJ", "Benin" );
- countryCodes.put( "BM", "Bermuda" );
- countryCodes.put( "BN", "Brunei Darussalam" );
- countryCodes.put( "BO", "Bolivia" );
- countryCodes.put( "BR", "Brazil" );
- countryCodes.put( "BS", "Bahamas" );
- countryCodes.put( "BT", "Bhutan" );
- countryCodes.put( "BV", "Bouvet Island" );
- countryCodes.put( "BW", "Botswana" );
- countryCodes.put( "BY", "Belarus" );
- countryCodes.put( "BZ", "Belize" );
- countryCodes.put( "CA", "Canada" );
- countryCodes.put( "CC", "Cocos (Keeling) Islands" );
- countryCodes.put( "CD", "Congo, The Democratic Republic of the" );
- countryCodes.put( "CF", "Central African Republic" );
- countryCodes.put( "CG", "Congo" );
- countryCodes.put( "CH", "Switzerland" );
- countryCodes.put( "CI", "Cote d'Ivoire" );
- countryCodes.put( "CK", "Cook Islands" );
- countryCodes.put( "CL", "Chile" );
- countryCodes.put( "CM", "Cameroon" );
- countryCodes.put( "CN", "China" );
- countryCodes.put( "CO", "Colombia" );
- countryCodes.put( "CR", "Costa Rica" );
- countryCodes.put( "CU", "Cuba" );
- countryCodes.put( "CV", "Cape Verde" );
- countryCodes.put( "CX", "Christmas Island" );
- countryCodes.put( "CY", "Cyprus" );
- countryCodes.put( "CZ", "Czech Republic" );
- countryCodes.put( "DE", "Germany" );
- countryCodes.put( "DJ", "Djibouti" );
- countryCodes.put( "DK", "Denmark" );
- countryCodes.put( "DM", "Dominica" );
- countryCodes.put( "DO", "Dominican Republic" );
- countryCodes.put( "DZ", "Algeria" );
- countryCodes.put( "EC", "Ecuador" );
- countryCodes.put( "EE", "Estonia" );
- countryCodes.put( "EG", "Egypt" );
- countryCodes.put( "EH", "Western Sahara" );
- countryCodes.put( "ER", "Eritrea" );
- countryCodes.put( "ES", "Spain" );
- countryCodes.put( "ET", "Ethiopia" );
- countryCodes.put( "EU", "Europe" );
- countryCodes.put( "FI", "Finland" );
- countryCodes.put( "FJ", "Fiji" );
- countryCodes.put( "FK", "Falkland Islands (Malvinas)" );
- countryCodes.put( "FM", "Micronesia, Federated States of" );
- countryCodes.put( "FO", "Faroe Islands" );
- countryCodes.put( "FR", "France" );
- countryCodes.put( "GA", "Gabon" );
- countryCodes.put( "GB", "United Kingdom" );
- countryCodes.put( "GD", "Grenada" );
- countryCodes.put( "GE", "Georgia" );
- countryCodes.put( "GF", "French Guiana" );
- countryCodes.put( "GG", "Guernsey" );
- countryCodes.put( "GH", "Ghana" );
- countryCodes.put( "GI", "Gibraltar" );
- countryCodes.put( "GL", "Greenland" );
- countryCodes.put( "GM", "Gambia" );
- countryCodes.put( "GN", "Guinea" );
- countryCodes.put( "GP", "Guadeloupe" );
- countryCodes.put( "GQ", "Equatorial Guinea" );
- countryCodes.put( "GR", "Greece" );
- countryCodes.put( "GS", "South Georgia and the South Sandwich Islands" );
- countryCodes.put( "GT", "Guatemala" );
- countryCodes.put( "GU", "Guam" );
- countryCodes.put( "GW", "Guinea-Bissau" );
- countryCodes.put( "GY", "Guyana" );
- countryCodes.put( "HK", "Hong Kong" );
- countryCodes.put( "HM", "Heard Island and McDonald Islands" );
- countryCodes.put( "HN", "Honduras" );
- countryCodes.put( "HR", "Croatia" );
- countryCodes.put( "HT", "Haiti" );
- countryCodes.put( "HU", "Hungary" );
- countryCodes.put( "ID", "Indonesia" );
- countryCodes.put( "IE", "Ireland" );
- countryCodes.put( "IL", "Israel" );
- countryCodes.put( "IM", "Isle of Man" );
- countryCodes.put( "IN", "India" );
- countryCodes.put( "IO", "British Indian Ocean Territory" );
- countryCodes.put( "IQ", "Iraq" );
- countryCodes.put( "IR", "Iran, Islamic Republic of" );
- countryCodes.put( "IS", "Iceland" );
- countryCodes.put( "IT", "Italy" );
- countryCodes.put( "JE", "Jersey" );
- countryCodes.put( "JM", "Jamaica" );
- countryCodes.put( "JO", "Jordan" );
- countryCodes.put( "JP", "Japan" );
- countryCodes.put( "KE", "Kenya" );
- countryCodes.put( "KG", "Kyrgyzstan" );
- countryCodes.put( "KH", "Cambodia" );
- countryCodes.put( "KI", "Kiribati" );
- countryCodes.put( "KM", "Comoros" );
- countryCodes.put( "KN", "Saint Kitts and Nevis" );
- countryCodes.put( "KP", "Korea, Democratic People's Republic of" );
- countryCodes.put( "KR", "Korea, Republic of" );
- countryCodes.put( "KW", "Kuwait" );
- countryCodes.put( "KY", "Cayman Islands" );
- countryCodes.put( "KZ", "Kazakhstan" );
- countryCodes.put( "LA", "Lao People's Democratic Republic" );
- countryCodes.put( "LB", "Lebanon" );
- countryCodes.put( "LC", "Saint Lucia" );
- countryCodes.put( "LI", "Liechtenstein" );
- countryCodes.put( "LK", "Sri Lanka" );
- countryCodes.put( "LR", "Liberia" );
- countryCodes.put( "LS", "Lesotho" );
- countryCodes.put( "LT", "Lithuania" );
- countryCodes.put( "LU", "Luxembourg" );
- countryCodes.put( "LV", "Latvia" );
- countryCodes.put( "LY", "Libyan Arab Jamahiriya" );
- countryCodes.put( "MA", "Morocco" );
- countryCodes.put( "MC", "Monaco" );
- countryCodes.put( "MD", "Moldova, Republic of" );
- countryCodes.put( "ME", "Montenegro" );
- countryCodes.put( "MG", "Madagascar" );
- countryCodes.put( "MH", "Marshall Islands" );
- countryCodes.put( "MK", "Macedonia" );
- countryCodes.put( "ML", "Mali" );
- countryCodes.put( "MM", "Myanmar" );
- countryCodes.put( "MN", "Mongolia" );
- countryCodes.put( "MO", "Macao" );
- countryCodes.put( "MP", "Northern Mariana Islands" );
- countryCodes.put( "MQ", "Martinique" );
- countryCodes.put( "MR", "Mauritania" );
- countryCodes.put( "MS", "Montserrat" );
- countryCodes.put( "MT", "Malta" );
- countryCodes.put( "MU", "Mauritius" );
- countryCodes.put( "MV", "Maldives" );
- countryCodes.put( "MW", "Malawi" );
- countryCodes.put( "MX", "Mexico" );
- countryCodes.put( "MY", "Malaysia" );
- countryCodes.put( "MZ", "Mozambique" );
- countryCodes.put( "NA", "Namibia" );
- countryCodes.put( "NC", "New Caledonia" );
- countryCodes.put( "NE", "Niger" );
- countryCodes.put( "NF", "Norfolk Island" );
- countryCodes.put( "NG", "Nigeria" );
- countryCodes.put( "NI", "Nicaragua" );
- countryCodes.put( "NL", "Netherlands" );
- countryCodes.put( "NO", "Norway" );
- countryCodes.put( "NP", "Nepal" );
- countryCodes.put( "NR", "Nauru" );
- countryCodes.put( "NU", "Niue" );
- countryCodes.put( "NZ", "New Zealand" );
- countryCodes.put( "OM", "Oman" );
- countryCodes.put( "PA", "Panama" );
- countryCodes.put( "PE", "Peru" );
- countryCodes.put( "PF", "French Polynesia" );
- countryCodes.put( "PG", "Papua New Guinea" );
- countryCodes.put( "PH", "Philippines" );
- countryCodes.put( "PK", "Pakistan" );
- countryCodes.put( "PL", "Poland" );
- countryCodes.put( "PM", "Saint Pierre and Miquelon" );
- countryCodes.put( "PN", "Pitcairn" );
- countryCodes.put( "PR", "Puerto Rico" );
- countryCodes.put( "PS", "Palestinian Territory" );
- countryCodes.put( "PT", "Portugal" );
- countryCodes.put( "PW", "Palau" );
- countryCodes.put( "PY", "Paraguay" );
- countryCodes.put( "QA", "Qatar" );
- countryCodes.put( "RE", "Reunion" );
- countryCodes.put( "RO", "Romania" );
- countryCodes.put( "RS", "Serbia" );
- countryCodes.put( "RU", "Russian Federation" );
- countryCodes.put( "RW", "Rwanda" );
- countryCodes.put( "SA", "Saudi Arabia" );
- countryCodes.put( "SB", "Solomon Islands" );
- countryCodes.put( "SC", "Seychelles" );
- countryCodes.put( "SD", "Sudan" );
- countryCodes.put( "SE", "Sweden" );
- countryCodes.put( "SG", "Singapore" );
- countryCodes.put( "SH", "Saint Helena" );
- countryCodes.put( "SI", "Slovenia" );
- countryCodes.put( "SJ", "Svalbard and Jan Mayen" );
- countryCodes.put( "SK", "Slovakia" );
- countryCodes.put( "SL", "Sierra Leone" );
- countryCodes.put( "SM", "San Marino" );
- countryCodes.put( "SN", "Senegal" );
- countryCodes.put( "SO", "Somalia" );
- countryCodes.put( "SR", "Suriname" );
- countryCodes.put( "ST", "Sao Tome and Principe" );
- countryCodes.put( "SV", "El Salvador" );
- countryCodes.put( "SY", "Syrian Arab Republic" );
- countryCodes.put( "SZ", "Swaziland" );
- countryCodes.put( "TC", "Turks and Caicos Islands" );
- countryCodes.put( "TD", "Chad" );
- countryCodes.put( "TF", "French Southern Territories" );
- countryCodes.put( "TG", "Togo" );
- countryCodes.put( "TH", "Thailand" );
- countryCodes.put( "TJ", "Tajikistan" );
- countryCodes.put( "TK", "Tokelau" );
- countryCodes.put( "TL", "Timor-Leste" );
- countryCodes.put( "TM", "Turkmenistan" );
- countryCodes.put( "TN", "Tunisia" );
- countryCodes.put( "TO", "Tonga" );
- countryCodes.put( "TR", "Turkey" );
- countryCodes.put( "TT", "Trinidad and Tobago" );
- countryCodes.put( "TV", "Tuvalu" );
- countryCodes.put( "TW", "Taiwan" );
- countryCodes.put( "TZ", "Tanzania, United Republic of" );
- countryCodes.put( "UA", "Ukraine" );
- countryCodes.put( "UG", "Uganda" );
- countryCodes.put( "UM", "United States Minor Outlying Islands" );
- countryCodes.put( "US", "United States" );
- countryCodes.put( "UY", "Uruguay" );
- countryCodes.put( "UZ", "Uzbekistan" );
- countryCodes.put( "VA", "Holy See (Vatican City State)" );
- countryCodes.put( "VC", "Saint Vincent and the Grenadines" );
- countryCodes.put( "VE", "Venezuela" );
- countryCodes.put( "VG", "Virgin Islands, British" );
- countryCodes.put( "VI", "Virgin Islands, U.S." );
- countryCodes.put( "VN", "Vietnam" );
- countryCodes.put( "VU", "Vanuatu" );
- countryCodes.put( "WF", "Wallis and Futuna" );
- countryCodes.put( "WS", "Samoa" );
- countryCodes.put( "YE", "Yemen" );
- countryCodes.put( "YT", "Mayotte" );
- countryCodes.put( "ZA", "South Africa" );
- countryCodes.put( "ZM", "Zambia" );
- countryCodes.put( "ZW", "Zimbabwe" );
+ COUNTRY_CODES.put( "AD", "Andorra" );
+ COUNTRY_CODES.put( "AE", "United Arab Emirates" );
+ COUNTRY_CODES.put( "AF", "Afghanistan" );
+ COUNTRY_CODES.put( "AG", "Antigua and Barbuda" );
+ COUNTRY_CODES.put( "AI", "Anguilla" );
+ COUNTRY_CODES.put( "AL", "Albania" );
+ COUNTRY_CODES.put( "AM", "Armenia" );
+ COUNTRY_CODES.put( "AN", "Netherlands Antilles" );
+ COUNTRY_CODES.put( "AO", "Angola" );
+ COUNTRY_CODES.put( "AP", "Asia/Pacific Region" );
+ COUNTRY_CODES.put( "AQ", "Antarctica" );
+ COUNTRY_CODES.put( "AR", "Argentina" );
+ COUNTRY_CODES.put( "AS", "American Samoa" );
+ COUNTRY_CODES.put( "AT", "Austria" );
+ COUNTRY_CODES.put( "AU", "Australia" );
+ COUNTRY_CODES.put( "AW", "Aruba" );
+ COUNTRY_CODES.put( "AX", "Aland Islands" );
+ COUNTRY_CODES.put( "AZ", "Azerbaijan" );
+ COUNTRY_CODES.put( "BA", "Bosnia and Herzegovina" );
+ COUNTRY_CODES.put( "BB", "Barbados" );
+ COUNTRY_CODES.put( "BD", "Bangladesh" );
+ COUNTRY_CODES.put( "BE", "Belgium" );
+ COUNTRY_CODES.put( "BF", "Burkina Faso" );
+ COUNTRY_CODES.put( "BG", "Bulgaria" );
+ COUNTRY_CODES.put( "BH", "Bahrain" );
+ COUNTRY_CODES.put( "BI", "Burundi" );
+ COUNTRY_CODES.put( "BJ", "Benin" );
+ COUNTRY_CODES.put( "BM", "Bermuda" );
+ COUNTRY_CODES.put( "BN", "Brunei Darussalam" );
+ COUNTRY_CODES.put( "BO", "Bolivia" );
+ COUNTRY_CODES.put( "BR", "Brazil" );
+ COUNTRY_CODES.put( "BS", "Bahamas" );
+ COUNTRY_CODES.put( "BT", "Bhutan" );
+ COUNTRY_CODES.put( "BV", "Bouvet Island" );
+ COUNTRY_CODES.put( "BW", "Botswana" );
+ COUNTRY_CODES.put( "BY", "Belarus" );
+ COUNTRY_CODES.put( "BZ", "Belize" );
+ COUNTRY_CODES.put( "CA", "Canada" );
+ COUNTRY_CODES.put( "CC", "Cocos (Keeling) Islands" );
+ COUNTRY_CODES.put( "CD", "Congo, The Democratic Republic of the" );
+ COUNTRY_CODES.put( "CF", "Central African Republic" );
+ COUNTRY_CODES.put( "CG", "Congo" );
+ COUNTRY_CODES.put( "CH", "Switzerland" );
+ COUNTRY_CODES.put( "CI", "Cote d'Ivoire" );
+ COUNTRY_CODES.put( "CK", "Cook Islands" );
+ COUNTRY_CODES.put( "CL", "Chile" );
+ COUNTRY_CODES.put( "CM", "Cameroon" );
+ COUNTRY_CODES.put( "CN", "China" );
+ COUNTRY_CODES.put( "CO", "Colombia" );
+ COUNTRY_CODES.put( "CR", "Costa Rica" );
+ COUNTRY_CODES.put( "CU", "Cuba" );
+ COUNTRY_CODES.put( "CV", "Cape Verde" );
+ COUNTRY_CODES.put( "CX", "Christmas Island" );
+ COUNTRY_CODES.put( "CY", "Cyprus" );
+ COUNTRY_CODES.put( "CZ", "Czech Republic" );
+ COUNTRY_CODES.put( "DE", "Germany" );
+ COUNTRY_CODES.put( "DJ", "Djibouti" );
+ COUNTRY_CODES.put( "DK", "Denmark" );
+ COUNTRY_CODES.put( "DM", "Dominica" );
+ COUNTRY_CODES.put( "DO", "Dominican Republic" );
+ COUNTRY_CODES.put( "DZ", "Algeria" );
+ COUNTRY_CODES.put( "EC", "Ecuador" );
+ COUNTRY_CODES.put( "EE", "Estonia" );
+ COUNTRY_CODES.put( "EG", "Egypt" );
+ COUNTRY_CODES.put( "EH", "Western Sahara" );
+ COUNTRY_CODES.put( "ER", "Eritrea" );
+ COUNTRY_CODES.put( "ES", "Spain" );
+ COUNTRY_CODES.put( "ET", "Ethiopia" );
+ COUNTRY_CODES.put( "EU", "Europe" );
+ COUNTRY_CODES.put( "FI", "Finland" );
+ COUNTRY_CODES.put( "FJ", "Fiji" );
+ COUNTRY_CODES.put( "FK", "Falkland Islands (Malvinas)" );
+ COUNTRY_CODES.put( "FM", "Micronesia, Federated States of" );
+ COUNTRY_CODES.put( "FO", "Faroe Islands" );
+ COUNTRY_CODES.put( "FR", "France" );
+ COUNTRY_CODES.put( "GA", "Gabon" );
+ COUNTRY_CODES.put( "GB", "United Kingdom" );
+ COUNTRY_CODES.put( "GD", "Grenada" );
+ COUNTRY_CODES.put( "GE", "Georgia" );
+ COUNTRY_CODES.put( "GF", "French Guiana" );
+ COUNTRY_CODES.put( "GG", "Guernsey" );
+ COUNTRY_CODES.put( "GH", "Ghana" );
+ COUNTRY_CODES.put( "GI", "Gibraltar" );
+ COUNTRY_CODES.put( "GL", "Greenland" );
+ COUNTRY_CODES.put( "GM", "Gambia" );
+ COUNTRY_CODES.put( "GN", "Guinea" );
+ COUNTRY_CODES.put( "GP", "Guadeloupe" );
+ COUNTRY_CODES.put( "GQ", "Equatorial Guinea" );
+ COUNTRY_CODES.put( "GR", "Greece" );
+ COUNTRY_CODES.put( "GS", "South Georgia and the South Sandwich Islands" );
+ COUNTRY_CODES.put( "GT", "Guatemala" );
+ COUNTRY_CODES.put( "GU", "Guam" );
+ COUNTRY_CODES.put( "GW", "Guinea-Bissau" );
+ COUNTRY_CODES.put( "GY", "Guyana" );
+ COUNTRY_CODES.put( "HK", "Hong Kong" );
+ COUNTRY_CODES.put( "HM", "Heard Island and McDonald Islands" );
+ COUNTRY_CODES.put( "HN", "Honduras" );
+ COUNTRY_CODES.put( "HR", "Croatia" );
+ COUNTRY_CODES.put( "HT", "Haiti" );
+ COUNTRY_CODES.put( "HU", "Hungary" );
+ COUNTRY_CODES.put( "ID", "Indonesia" );
+ COUNTRY_CODES.put( "IE", "Ireland" );
+ COUNTRY_CODES.put( "IL", "Israel" );
+ COUNTRY_CODES.put( "IM", "Isle of Man" );
+ COUNTRY_CODES.put( "IN", "India" );
+ COUNTRY_CODES.put( "IO", "British Indian Ocean Territory" );
+ COUNTRY_CODES.put( "IQ", "Iraq" );
+ COUNTRY_CODES.put( "IR", "Iran, Islamic Republic of" );
+ COUNTRY_CODES.put( "IS", "Iceland" );
+ COUNTRY_CODES.put( "IT", "Italy" );
+ COUNTRY_CODES.put( "JE", "Jersey" );
+ COUNTRY_CODES.put( "JM", "Jamaica" );
+ COUNTRY_CODES.put( "JO", "Jordan" );
+ COUNTRY_CODES.put( "JP", "Japan" );
+ COUNTRY_CODES.put( "KE", "Kenya" );
+ COUNTRY_CODES.put( "KG", "Kyrgyzstan" );
+ COUNTRY_CODES.put( "KH", "Cambodia" );
+ COUNTRY_CODES.put( "KI", "Kiribati" );
+ COUNTRY_CODES.put( "KM", "Comoros" );
+ COUNTRY_CODES.put( "KN", "Saint Kitts and Nevis" );
+ COUNTRY_CODES.put( "KP", "Korea, Democratic People's Republic of" );
+ COUNTRY_CODES.put( "KR", "Korea, Republic of" );
+ COUNTRY_CODES.put( "KW", "Kuwait" );
+ COUNTRY_CODES.put( "KY", "Cayman Islands" );
+ COUNTRY_CODES.put( "KZ", "Kazakhstan" );
+ COUNTRY_CODES.put( "LA", "Lao People's Democratic Republic" );
+ COUNTRY_CODES.put( "LB", "Lebanon" );
+ COUNTRY_CODES.put( "LC", "Saint Lucia" );
+ COUNTRY_CODES.put( "LI", "Liechtenstein" );
+ COUNTRY_CODES.put( "LK", "Sri Lanka" );
+ COUNTRY_CODES.put( "LR", "Liberia" );
+ COUNTRY_CODES.put( "LS", "Lesotho" );
+ COUNTRY_CODES.put( "LT", "Lithuania" );
+ COUNTRY_CODES.put( "LU", "Luxembourg" );
+ COUNTRY_CODES.put( "LV", "Latvia" );
+ COUNTRY_CODES.put( "LY", "Libyan Arab Jamahiriya" );
+ COUNTRY_CODES.put( "MA", "Morocco" );
+ COUNTRY_CODES.put( "MC", "Monaco" );
+ COUNTRY_CODES.put( "MD", "Moldova, Republic of" );
+ COUNTRY_CODES.put( "ME", "Montenegro" );
+ COUNTRY_CODES.put( "MG", "Madagascar" );
+ COUNTRY_CODES.put( "MH", "Marshall Islands" );
+ COUNTRY_CODES.put( "MK", "Macedonia" );
+ COUNTRY_CODES.put( "ML", "Mali" );
+ COUNTRY_CODES.put( "MM", "Myanmar" );
+ COUNTRY_CODES.put( "MN", "Mongolia" );
+ COUNTRY_CODES.put( "MO", "Macao" );
+ COUNTRY_CODES.put( "MP", "Northern Mariana Islands" );
+ COUNTRY_CODES.put( "MQ", "Martinique" );
+ COUNTRY_CODES.put( "MR", "Mauritania" );
+ COUNTRY_CODES.put( "MS", "Montserrat" );
+ COUNTRY_CODES.put( "MT", "Malta" );
+ COUNTRY_CODES.put( "MU", "Mauritius" );
+ COUNTRY_CODES.put( "MV", "Maldives" );
+ COUNTRY_CODES.put( "MW", "Malawi" );
+ COUNTRY_CODES.put( "MX", "Mexico" );
+ COUNTRY_CODES.put( "MY", "Malaysia" );
+ COUNTRY_CODES.put( "MZ", "Mozambique" );
+ COUNTRY_CODES.put( "NA", "Namibia" );
+ COUNTRY_CODES.put( "NC", "New Caledonia" );
+ COUNTRY_CODES.put( "NE", "Niger" );
+ COUNTRY_CODES.put( "NF", "Norfolk Island" );
+ COUNTRY_CODES.put( "NG", "Nigeria" );
+ COUNTRY_CODES.put( "NI", "Nicaragua" );
+ COUNTRY_CODES.put( "NL", "Netherlands" );
+ COUNTRY_CODES.put( "NO", "Norway" );
+ COUNTRY_CODES.put( "NP", "Nepal" );
+ COUNTRY_CODES.put( "NR", "Nauru" );
+ COUNTRY_CODES.put( "NU", "Niue" );
+ COUNTRY_CODES.put( "NZ", "New Zealand" );
+ COUNTRY_CODES.put( "OM", "Oman" );
+ COUNTRY_CODES.put( "PA", "Panama" );
+ COUNTRY_CODES.put( "PE", "Peru" );
+ COUNTRY_CODES.put( "PF", "French Polynesia" );
+ COUNTRY_CODES.put( "PG", "Papua New Guinea" );
+ COUNTRY_CODES.put( "PH", "Philippines" );
+ COUNTRY_CODES.put( "PK", "Pakistan" );
+ COUNTRY_CODES.put( "PL", "Poland" );
+ COUNTRY_CODES.put( "PM", "Saint Pierre and Miquelon" );
+ COUNTRY_CODES.put( "PN", "Pitcairn" );
+ COUNTRY_CODES.put( "PR", "Puerto Rico" );
+ COUNTRY_CODES.put( "PS", "Palestinian Territory" );
+ COUNTRY_CODES.put( "PT", "Portugal" );
+ COUNTRY_CODES.put( "PW", "Palau" );
+ COUNTRY_CODES.put( "PY", "Paraguay" );
+ COUNTRY_CODES.put( "QA", "Qatar" );
+ COUNTRY_CODES.put( "RE", "Reunion" );
+ COUNTRY_CODES.put( "RO", "Romania" );
+ COUNTRY_CODES.put( "RS", "Serbia" );
+ COUNTRY_CODES.put( "RU", "Russian Federation" );
+ COUNTRY_CODES.put( "RW", "Rwanda" );
+ COUNTRY_CODES.put( "SA", "Saudi Arabia" );
+ COUNTRY_CODES.put( "SB", "Solomon Islands" );
+ COUNTRY_CODES.put( "SC", "Seychelles" );
+ COUNTRY_CODES.put( "SD", "Sudan" );
+ COUNTRY_CODES.put( "SE", "Sweden" );
+ COUNTRY_CODES.put( "SG", "Singapore" );
+ COUNTRY_CODES.put( "SH", "Saint Helena" );
+ COUNTRY_CODES.put( "SI", "Slovenia" );
+ COUNTRY_CODES.put( "SJ", "Svalbard and Jan Mayen" );
+ COUNTRY_CODES.put( "SK", "Slovakia" );
+ COUNTRY_CODES.put( "SL", "Sierra Leone" );
+ COUNTRY_CODES.put( "SM", "San Marino" );
+ COUNTRY_CODES.put( "SN", "Senegal" );
+ COUNTRY_CODES.put( "SO", "Somalia" );
+ COUNTRY_CODES.put( "SR", "Suriname" );
+ COUNTRY_CODES.put( "ST", "Sao Tome and Principe" );
+ COUNTRY_CODES.put( "SV", "El Salvador" );
+ COUNTRY_CODES.put( "SY", "Syrian Arab Republic" );
+ COUNTRY_CODES.put( "SZ", "Swaziland" );
+ COUNTRY_CODES.put( "TC", "Turks and Caicos Islands" );
+ COUNTRY_CODES.put( "TD", "Chad" );
+ COUNTRY_CODES.put( "TF", "French Southern Territories" );
+ COUNTRY_CODES.put( "TG", "Togo" );
+ COUNTRY_CODES.put( "TH", "Thailand" );
+ COUNTRY_CODES.put( "TJ", "Tajikistan" );
+ COUNTRY_CODES.put( "TK", "Tokelau" );
+ COUNTRY_CODES.put( "TL", "Timor-Leste" );
+ COUNTRY_CODES.put( "TM", "Turkmenistan" );
+ COUNTRY_CODES.put( "TN", "Tunisia" );
+ COUNTRY_CODES.put( "TO", "Tonga" );
+ COUNTRY_CODES.put( "TR", "Turkey" );
+ COUNTRY_CODES.put( "TT", "Trinidad and Tobago" );
+ COUNTRY_CODES.put( "TV", "Tuvalu" );
+ COUNTRY_CODES.put( "TW", "Taiwan" );
+ COUNTRY_CODES.put( "TZ", "Tanzania, United Republic of" );
+ COUNTRY_CODES.put( "UA", "Ukraine" );
+ COUNTRY_CODES.put( "UG", "Uganda" );
+ COUNTRY_CODES.put( "UM", "United States Minor Outlying Islands" );
+ COUNTRY_CODES.put( "US", "United States" );
+ COUNTRY_CODES.put( "UY", "Uruguay" );
+ COUNTRY_CODES.put( "UZ", "Uzbekistan" );
+ COUNTRY_CODES.put( "VA", "Holy See (Vatican City State)" );
+ COUNTRY_CODES.put( "VC", "Saint Vincent and the Grenadines" );
+ COUNTRY_CODES.put( "VE", "Venezuela" );
+ COUNTRY_CODES.put( "VG", "Virgin Islands, British" );
+ COUNTRY_CODES.put( "VI", "Virgin Islands, U.S." );
+ COUNTRY_CODES.put( "VN", "Vietnam" );
+ COUNTRY_CODES.put( "VU", "Vanuatu" );
+ COUNTRY_CODES.put( "WF", "Wallis and Futuna" );
+ COUNTRY_CODES.put( "WS", "Samoa" );
+ COUNTRY_CODES.put( "YE", "Yemen" );
+ COUNTRY_CODES.put( "YT", "Mayotte" );
+ COUNTRY_CODES.put( "ZA", "South Africa" );
+ COUNTRY_CODES.put( "ZM", "Zambia" );
+ COUNTRY_CODES.put( "ZW", "Zimbabwe" );
}
;
@@ -299,7 +298,7 @@
public String getExternal( String s )
{
if ( null == s ) return null;
- return countryCodes.getValueForKey( s );
+ return COUNTRY_CODES.getValueForKey( s );
}
/**
@@ -311,7 +310,7 @@
public String getInternal( String s )
{
if ( null == s ) return null;
- return countryCodes.getKeyForValue( s );
+ return COUNTRY_CODES.getKeyForValue( s );
}
}
Modified: trunk/equanda-client/src/main/java/org/equanda/subjectory/XmlFileContainer.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/subjectory/XmlFileContainer.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-client/src/main/java/org/equanda/subjectory/XmlFileContainer.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -36,11 +36,11 @@
public class XmlFileContainer
extends DataContainerAdapter
{
- private static final String containerType = "XmlFile";
+ private static final String CONTAINER_TYPE = "XmlFile";
public String getContainerType()
{
- return containerType;
+ return CONTAINER_TYPE;
}
public XmlFileContainer( File file )
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-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/DatabaseMap.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -33,11 +33,11 @@
*/
public interface DatabaseMap
{
- public void init();
+ void init();
- public Collection<String> getTables();
+ Collection<String> getTables();
- public Collection<DatabaseRelation> getRelationTables();
+ Collection<DatabaseRelation> getRelationTables();
- public Collection<DatabaseField> getFields();
+ Collection<DatabaseField> getFields();
}
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-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/ddltool/Utility.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -32,7 +32,6 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-
public class Utility
{
private static final Logger log = Logger.getLogger( Utility.class );
@@ -159,4 +158,4 @@
openManager( args );
}
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolException.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolException.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ToolException.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -51,5 +51,4 @@
{
super( message, t );
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/shared/ui/ToolClientHidden.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -23,11 +23,11 @@
*/
package org.equanda.tool.shared.ui;
+import javolution.lang.TextBuilder;
import org.equanda.tool.shared.Id;
import org.equanda.tool.shared.ToolListener;
+import static org.equanda.tool.shared.ToolMain.i18n;
import org.equanda.tool.shared.worker.WorkerThread;
-import javolution.lang.TextBuilder;
-import static org.equanda.tool.shared.ToolMain.i18n;
/**
* Start class for Import Client in the case the user wants the window to be hidden
@@ -134,4 +134,4 @@
Runtime.getRuntime().halt( 0 );
}
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/Configuration.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/Configuration.java 2008-12-03 17:17:32 UTC (rev 895)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/translationsEditor/Configuration.java 2008-12-03 17:58:16 UTC (rev 896)
@@ -33,13 +33,13 @@
{
String getDefinition();
String getAppdir();
- public boolean getImportDbKeysOnly();
- public boolean getInfrastructure();
- public String getContext();
- public String getKeyPrefixesToKeep();
- public String getTargetFile();
- public String[] getVerifyLanguages();
- public boolean isShowDb();
- public int getWidth();
- public int getHeight();
-}
\ No newline at end of file
+ boolean getImportDbKeysOnly();
+ boolean getInfrastructure();
+ String getContext();
+ String getKeyPrefixesToKeep();
+ String getTargetFile();
+ String[] getVerifyLanguages();
+ boolean isShowDb();
+ int getWidth();
+ int getHeight();
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 17:17:36
|
Revision: 895
http://equanda.svn.sourceforge.net/equanda/?rev=895&view=rev
Author: triathlon98
Date: 2008-12-03 17:17:32 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/config/checkstyle.xml
trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java
trunk/equanda-client/src/main/java/org/equanda/export/Export.java
trunk/equanda-client/src/main/java/org/equanda/export/ExportInfo.java
trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EJBUtil.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaDowngradeException.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaFieldBean.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceError.java
trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectType.java
trunk/equanda-client/src/main/java/org/equanda/persistence/Uoid.java
trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java
trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java
trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJB.java
trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJBUtil.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/AbstractSelect.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Field.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Group.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/IncludeData.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Mapping.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Page.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Parser.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Select.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Table.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Type.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/BooleanTest.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ListFilter.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ObjectGetter.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TemplateUtil.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TransformationUtil.java
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/transform/RootTable.java
Modified: trunk/config/checkstyle.xml
===================================================================
--- trunk/config/checkstyle.xml 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/config/checkstyle.xml 2008-12-03 17:17:32 UTC (rev 895)
@@ -206,7 +206,7 @@
<module name="StringLiteralEquality"/>
<!--<module name="NestedIfDepth"/>-->
<!--<module name="NestedTryDepth"/>-->
- <module name="SuperClone"/>
+ <!--<module name="SuperClone"/>-->
<module name="SuperFinalize"/>
<!--<module name="IllegalCatch"/>-->
<!--<module name="IllegalThrows"/>-->
Modified: trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/client/ImportClient.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -86,4 +86,4 @@
}
return body;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/export/Export.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/export/Export.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/export/Export.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -24,14 +24,14 @@
package org.equanda.export;
-import org.equanda.persistence.Uoid;
+import javolution.lang.TextBuilder;
+import org.apache.log4j.Logger;
import org.equanda.persistence.EquandaProxy;
+import org.equanda.persistence.Uoid;
import org.equanda.util.Base64;
import org.equanda.util.IniFile;
import org.equanda.util.StringSplitter;
import org.equanda.util.StringUtil;
-import javolution.lang.TextBuilder;
-import org.apache.log4j.Logger;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
@@ -53,20 +53,14 @@
{
private static final Logger log = Logger.getLogger( Export.class );
- /**
- * format for outputting dates
- */
- public static final DateTimeFormatter dateFormat = DateTimeFormat.forPattern( "yyyy-MM-dd" );
- /**
- * format for outputting timestamps
- */
- public static final DateTimeFormatter timeFormat = DateTimeFormat.forPattern( "yyyy-MM-dd HH:mm:ss" );
+ /** format for outputting dates */
+ public static final DateTimeFormatter DATE_FORMAT = DateTimeFormat.forPattern( "yyyy-MM-dd" );
+ /** format for outputting timestamps */
+ public static final DateTimeFormatter TIME_FORMAT = DateTimeFormat.forPattern( "yyyy-MM-dd HH:mm:ss" );
- private static final ExportInfo uoidFieldInfo = new ExportInfo( "", "", "Id" );
+ private static final ExportInfo UOID_FIELD_INFO = new ExportInfo( "", "", "Id" );
- /**
- * directory for output file
- */
+ /** directory for output file */
private String dir = "";
public void export( Collection col, IniFile ini )
@@ -169,7 +163,7 @@
if ( !( refForName instanceof ExportEvaluator ) )
{
throw new ExportException( "refForName should be a EquandaProxy or ExportEvaluator object but is a "
- + refForName.getClass().getName() );
+ + refForName.getClass().getName() );
}
ExportEvaluator exportEvaluator = (ExportEvaluator) refForName;
String tableName;
@@ -285,11 +279,11 @@
}
else if ( value instanceof Date )
{
- tbLine.append( dateFormat.print( ( (Date) value ).getTime() ) );
+ tbLine.append( DATE_FORMAT.print( ( (Date) value ).getTime() ) );
}
else if ( value instanceof Timestamp )
{
- tbLine.append( timeFormat.print( ( (Timestamp) value ).getTime() ) );
+ tbLine.append( TIME_FORMAT.print( ( (Timestamp) value ).getTime() ) );
}
else if ( value instanceof Integer || value instanceof Boolean )
{
@@ -336,7 +330,7 @@
catch ( ClassCastException e )
{
throw new ExportException( "Object form Map (" + tableName + '/' + fieldName +
- ") is not an ExportInfo ", e );
+ ") is not an ExportInfo ", e );
}
}
}
@@ -357,7 +351,7 @@
if ( fieldInfo == null )
{
objValue = objToExport;
- fieldInfo = uoidFieldInfo;
+ fieldInfo = UOID_FIELD_INFO;
}
else
{
@@ -391,10 +385,10 @@
throw new ExportException( "Cannot find method selectId in " + objClass.getName(), e );
}
- Object[] param_v = { objToExport };
+ Object[] paramV = { objToExport };
try
{
- objValue = method.invoke( objSelEJB, param_v );
+ objValue = method.invoke( objSelEJB, paramV );
}
catch ( Exception e )
{
@@ -449,19 +443,23 @@
for ( int i = 0; i < fileName.length() ; i++ )
{
if ( ( fileName.charAt( i ) == '$' ) && ( i != fileName.length() - 1 ) &&
- ( fileName.charAt( i + 1 ) == '{' ) )
+ ( fileName.charAt( i + 1 ) == '{' ) )
{
if ( !isVar )
{
isVar = true;
- var.setLength( 0 );// = new TextBuilder();
- i++;
+ var.setLength( 0 );
}
else
{
throw new ExportException( "Nested variable use not allowed" );
}
}
+ else if ( ( fileName.charAt( i ) == '{' ) && ( i > 0 ) && isVar &&
+ ( fileName.charAt( i - 1 ) == '$' ) )
+ {
+ // ok, skip
+ }
else
{
if ( fileName.charAt( i ) == '}' )
Modified: trunk/equanda-client/src/main/java/org/equanda/export/ExportInfo.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/export/ExportInfo.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/export/ExportInfo.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -56,4 +56,4 @@
{
return fieldToExport;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/CheckRulesState.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -31,7 +31,7 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class CheckRulesState
+public final class CheckRulesState
{
public static final String RULES_CHECKS_STATE_CONTEXT = "equanda-CheckRulesStateContext";
@@ -43,8 +43,9 @@
}
};
+ private CheckRulesState() {}
+
public static boolean getCheckRules() { return (Boolean) state.get(); }
public static void setCheckRules( boolean value ) { state.set( Boolean.valueOf( value ) ); }
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EJBUtil.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EJBUtil.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EJBUtil.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -31,8 +31,10 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class EJBUtil
+public final class EJBUtil
{
+ private EJBUtil() {}
+
public static <T> T lookup( String jndiName, Class<T> narrowTo )
throws javax.naming.NamingException
{
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaDowngradeException.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaDowngradeException.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaDowngradeException.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -35,7 +35,7 @@
public class EquandaDowngradeException
extends EquandaConstraintViolation
{
- public static String DEFAULT_MESSAGE = "DOWNGRADE EXCEPTION";
+ public static final String DEFAULT_MESSAGE = "DOWNGRADE EXCEPTION";
public EquandaDowngradeException() {}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -45,6 +45,6 @@
String getEquandaName();
String getEquandaStatus();
void setEquandaStatus( String status );
-
+
void remove();
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaFieldBean.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaFieldBean.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaFieldBean.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -26,8 +26,8 @@
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
+import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
-import javax.persistence.MappedSuperclass;
import java.sql.Timestamp;
/**
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -39,7 +39,7 @@
String getEquandaType();
- public ID getId();
+ ID getId();
java.sql.Timestamp getEquandaModificationDate();
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaList.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -47,7 +47,7 @@
private Set<ElementWrapper> removeSet = new HashSet<ElementWrapper>();
// considered when no objects in list or remove list (otherwise we cannot know if the object was modified or not)
- protected boolean proxySetterUsed = false;
+ protected boolean proxySetterUsed;
public EquandaList()
{
@@ -241,9 +241,9 @@
{
if ( null == elem ) return -1;
int size = list.size();
- for ( int i = size - 1; i >= 0 ; i-- )
- {
- if ( equalsElem( elem, get( i ) ) ) return i;
+ for ( int i = size - 1; i >= 0 ; i-- )
+ {
+ if ( equalsElem( elem, get( i ) ) ) return i;
}
return -1;
}
@@ -318,26 +318,27 @@
private ElementWrapper buildElementWrapper( ELTYPE elem, boolean replaceElem )
{
if ( null == elem ) return null;
- for ( ElementWrapper ew : list )
+ for ( ElementWrapper ew : list )
+ {
+ if ( equalsElem( elem, ew.element ) )
{
- if ( equalsElem( elem, ew.element ) )
- {
- if ( replaceElem ) ew.element = elem;
- return ew;
- }
+ if ( replaceElem ) ew.element = elem;
+ return ew;
}
- for ( ElementWrapper ew : removeSet )
+ }
+ for ( ElementWrapper ew : removeSet )
+ {
+ if ( equalsElem( elem, ew.element ) )
{
- if ( equalsElem( elem, ew.element ) )
- {
- if ( replaceElem ) ew.element = elem;
- return ew;
- }
+ if ( replaceElem ) ew.element = elem;
+ return ew;
}
- return new ElementWrapper( elem, false );
+ }
+ return new ElementWrapper( elem, false );
}
public EquandaList<ELTYPE> clone()
+ throws CloneNotSupportedException
{
EquandaList<ELTYPE> clone = new EquandaList<ELTYPE>();
clone.proxySetterUsed = proxySetterUsed;
@@ -351,7 +352,8 @@
/**
* First tries to see if the objects have id and if so it compares it; otherwise it does the normal equals();
- * This is needed because for proxies the equals method now also compares the modified state and equandaVersion - which is not good for this case;
+ * This is needed because for proxies the equals method now also compares the modified state and equandaVersion -
+ * which is not good for this case;
*
* @param o1 - first object
* @param o2 - second object
@@ -372,8 +374,8 @@
class ElementWrapper
implements Serializable
{
- ELTYPE element;
- boolean isOriginal;
+ private ELTYPE element;
+ private boolean isOriginal;
ElementWrapper() {}
@@ -512,4 +514,4 @@
tb.append( ']' );
return tb.toString();
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -41,24 +41,37 @@
// initialise mediator object
public void init( ENTITY entity, BEAN object, EntityManager em )
{
- this.entity=entity;
- this.object=object;
+ this.entity = entity;
+ this.object = object;
this.em = em;
}
+
public ENTITY getEquandaEntity() { return entity; }
// allow retrieval of the base entity information
- public Uoid getId() { return entity.getId(); }
- public String getEquandaType() { String type=entity.getEquandaType(); if (type.length()>4) type=type.substring(0,4); return type; }
+ public Uoid getId()
+ { return entity.getId(); }
+
+ public String getEquandaType()
+ {
+ String type = entity.getEquandaType();
+ if ( type.length() > 4 ) type = type.substring( 0, 4 );
+ return type;
+ }
+
public java.sql.Timestamp getEquandaModificationDate() { return entity.getEquandaModificationDate(); }
+
public java.sql.Timestamp getEquandaCreationDate() { return entity.getEquandaCreationDate(); }
+
public long getEquandaVersion() { return entity.getEquandaVersion(); }
+
public String getEquandaStatus()
{
String status = entity.getEquandaStatus();
if ( status != null && status.length() > 1 ) status = status.substring( 0, 1 );
return status;
}
+
public void setEquandaStatus( String status ) { entity.setEquandaStatus( status ); }
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceError.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceError.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceError.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -66,4 +66,4 @@
return super.getMessage();
}
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectType.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectType.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/ObjectType.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -93,4 +93,4 @@
* @return arracy of parent types
*/
String[] getParentTypes();
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/Uoid.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/Uoid.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/Uoid.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -95,4 +95,4 @@
if ( id == null ) return 0;
return id.hashCode();
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -145,9 +145,9 @@
return typeFilter;
}
- public EquandaQuery setTypeFilter( ObjectType typeFilter_ )
+ public EquandaQuery setTypeFilter( ObjectType newValue )
{
- this.typeFilter = typeFilter_;
+ this.typeFilter = newValue;
return this;
}
Modified: trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/translations/Parser.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -27,7 +27,6 @@
import org.apache.log4j.Logger;
import java.io.*;
-
import java.util.TreeMap;
/**
@@ -160,7 +159,7 @@
String keyStr;
String contextStr = null;
String value = line.substring( KEY_SECTION.length() );
- String splitted[] = value.split( "/" );
+ String[] splitted = value.split( "/" );
if ( splitted.length == 2 )
{
keyStr = splitted[ 0 ];
@@ -179,7 +178,7 @@
key.setContext( contextStr );
for ( String language : languages )
{
- TreeMap<Key,Translation> currentLanguageMap = maps.get( language );
+ TreeMap<Key, Translation> currentLanguageMap = maps.get( language );
currentLanguageMap.put( key, new Translation() );
}
}
Modified: trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJB.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJB.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJB.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -24,7 +24,6 @@
package org.equanda.translations;
-import javax.ejb.Local;
import javax.ejb.Remote;
import java.util.List;
@@ -36,7 +35,7 @@
@Remote
public interface TranslatorEJB
{
- public String translate( String language, String message, List<String> contexts );
+ String translate( String language, String message, List<String> contexts );
void remove();
}
Modified: trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJBUtil.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJBUtil.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-client/src/main/java/org/equanda/translations/TranslatorEJBUtil.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -21,6 +21,7 @@
* 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.translations;
import org.equanda.persistence.EJBUtil;
@@ -32,8 +33,10 @@
*
* @author Florin
*/
-public class TranslatorEJBUtil
+public final class TranslatorEJBUtil
{
+ private TranslatorEJBUtil() {}
+
public static TranslatorEJB get()
{
try
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/AbstractSelect.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/AbstractSelect.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/AbstractSelect.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -40,7 +40,7 @@
public abstract class AbstractSelect
{
@XStreamOmitField
- private int numberOfParameters = 0;
+ private int numberOfParameters;
@XStreamOmitField
protected String calculatedQuery;
@XStreamOmitField
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Field.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Field.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Field.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -1455,4 +1455,4 @@
}
return false;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Group.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Group.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Group.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -308,4 +308,4 @@
}
return tb.toString();
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/IncludeData.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/IncludeData.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/IncludeData.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -81,4 +81,4 @@
}
public Hide getHide() { return hide; }
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Mapping.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Mapping.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Mapping.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -53,9 +53,9 @@
private void err( Parser parser, String msg, Table table, Field field )
{
- String err =msg;
- if ( null != table) err+=" in table "+table.getName();
- if ( null != field) err+=" field "+field.getName();
+ String err = msg;
+ if ( null != table ) err += " in table " + table.getName();
+ if ( null != field ) err += " field " + field.getName();
parser.addError( err );
}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Page.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Page.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Page.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -43,7 +43,7 @@
public class Page
{
@XStreamAsAttribute
- String name;
+ private String name;
private String description = "";
@XStreamImplicit
@@ -106,9 +106,7 @@
for ( Field field : getFields() ) field.handleValidation( parser );
}
- /**
- * @return an ArrayList with the direct (1 level deep) field children
- */
+ /** @return an ArrayList with the direct (1 level deep) field children */
public List<Field> getFields()
{
if ( fields == null ) fields = new ArrayList<Field>();
@@ -221,4 +219,4 @@
}
return tb.toString();
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Parser.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Parser.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Parser.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -1,3 +1,27 @@
+/**
+ * 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.domain.xml;
import com.thoughtworks.xstream.XStream;
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Select.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Select.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Select.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -86,10 +86,10 @@
ordersAscending = new ArrayList<Boolean>();
if ( hasOrder() )
{
- for ( String fieldName : order.split( "," ) )
+ for ( String loopFieldName : order.split( "," ) )
{
Field field;
- fieldName = fieldName.trim();
+ String fieldName = loopFieldName.trim();
boolean ascending = true;
if ( fieldName.length() > 0 && fieldName.charAt( 0 ) == '-' )
{
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Table.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Table.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Table.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -597,4 +597,4 @@
if ( null == subjectory ) subjectory = new Subjectory();
return subjectory;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Type.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Type.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Type.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -281,4 +281,4 @@
if ( hide == null ) return null;
return hide.getHideIfClass();
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/BooleanTest.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/BooleanTest.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/BooleanTest.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -32,4 +32,4 @@
public interface BooleanTest<T>
{
public boolean test( T object );
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ListFilter.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ListFilter.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ListFilter.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -31,5 +31,5 @@
*/
public interface ListFilter<T>
{
- public boolean isSuitable( T object );
+ boolean isSuitable( T object );
}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ObjectGetter.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ObjectGetter.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/ObjectGetter.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -31,5 +31,5 @@
*/
public interface ObjectGetter<T>
{
- public Object get( T obj );
-}
\ No newline at end of file
+ Object get( T obj );
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TemplateUtil.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TemplateUtil.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TemplateUtil.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -40,4 +40,4 @@
if ( filter == null || filter.isSuitable( one ) ) destination.add( one );
}
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TransformationUtil.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TransformationUtil.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/aid/TransformationUtil.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -35,8 +35,10 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class TransformationUtil
+public final class TransformationUtil
{
+ private TransformationUtil() {}
+
public static String transformDate( Parser parser, String value )
{
if ( value == null ) return null;
@@ -90,7 +92,7 @@
Field field = null;
for ( String fieldName : path.split( "\\." ) )
{
- char chars[] = fieldName.toCharArray();
+ char[] chars = fieldName.toCharArray();
chars[ 0 ] = Character.toUpperCase( chars[ 0 ] );
String fieldNameTransformed = new String( chars );
field = root.getField( fieldNameTransformed );
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/transform/RootTable.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/transform/RootTable.java 2008-12-03 16:51:59 UTC (rev 894)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/transform/RootTable.java 2008-12-03 17:17:32 UTC (rev 895)
@@ -37,8 +37,7 @@
*
* @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
@@ -676,8 +675,10 @@
public boolean equals( Object o )
{
- return ( o instanceof RootTable.PriorityComparator );
+ return ( o instanceof RootTable.PriorityComparator && StringUtil.objectEquals( this, o ) );
}
+
+ public int hashCode() { return super.hashCode(); }
}
public List<Select> getSelects()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-03 16:52:03
|
Revision: 894
http://equanda.svn.sourceforge.net/equanda/?rev=894&view=rev
Author: brian_reynolds
Date: 2008-12-03 16:51:59 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
Improvments in javascript for checkboxes. Fieldset checkbox now switches on/off children correctly. Also fix bugs where not much would work when there was no writeboxes.
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-03 15:56:59 UTC (rev 893)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigField.tml.vm 2008-12-03 16:51:59 UTC (rev 894)
@@ -59,8 +59,9 @@
</div>
<div class="readCol">
- <input t:id="${readBox}" name="${readBox}" value="${readBox}"
- onclick="eqHandleFieldReadBox( ${page.Name}_pageReadCheck, this, ${writeBox}, ${listBox}, ${summaryBox}, ${printBox} )" t:type="CheckBox"/>
+ <input t:id="${readBox}" name="${readBox}" value="${readBox}"
+ onclick="eqHandleFieldReadBox( ${page.Name}_pageReadCheck, '$!{page.Name}', '_readCheck', this, '${writeBox}', ${listBox}, ${summaryBox}, ${printBox} )"
+ t:type="CheckBox"/>
</div>
<t:if test="writeAllowed">
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-03 15:56:59 UTC (rev 893)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/AuthAndConfigGroup.tml.vm 2008-12-03 16:51:59 UTC (rev 894)
@@ -65,13 +65,16 @@
<div class="readCol">
<input t:id="${readBox}" name="${readBox}" value="${readBox}"
- onclick="eqHandleFieldReadBox( ${group.Name}_groupReadCheck, this, ${writeBox}, ${listBox}, ${summaryBox}, ${printBox} )" t:type="CheckBox"/>
+ onclick="eqHandleFieldReadBox( ${group.Name}_groupReadCheck, '$!{group.Name}', '_readCheck', this, '${writeBox}', ${listBox}, ${summaryBox}, ${printBox} )"
+ t:type="CheckBox"/>
</div>
+ <t:if test="writeAllowed">
<div class="writeCol">
<input t:id="${writeBox}" name="${writeBox}" value="${writeBox}"
onclick="eqEnableBoxes( ${readBox}, ${writeBox}, false)" t:type="CheckBox"/>
</div>
+ </t:if>
<div class="listCol">
<input t:id="${listBox}" name="${listBox}" value="${listBox}"
Modified: trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js
===================================================================
--- trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js 2008-12-03 15:56:59 UTC (rev 893)
+++ trunk/equanda-tapestry5/src/main/resources/org/equanda/tapestry5/resources/authandconfig.js 2008-12-03 16:51:59 UTC (rev 894)
@@ -11,11 +11,17 @@
if( check2.checked == true && check1.checked == false )
{
if( readCheck.checked == false )
+ {
readCheck.click();
+ }
+
check1.click();
- if( check2.checked == false ) // may be reset by on of the clickers
+ if( check2.checked == false )
+ {
+ // may be reset by on of the clickers
check2.click();
+ }
}
if( readCheck.checked == false && check1.checked == false && check2.checked == true)
@@ -92,22 +98,48 @@
setFieldChecks( false, fieldSetId, inputId );
}
}
+
+ if( pageReadBox.checked == true )
+ {
+ if( anyFieldsChecked( fieldSetId, inputId ) == false )
+ {
+ // no boxes checked at all - switch them all on
+ setFieldChecks( true, fieldSetId, inputId );
+ }
+ }
}
/**
*
*/
-function eqHandleFieldReadBox( pageReadCheck, fieldReadCheck, fieldWriteCheck, fieldListCheck, fieldSummaryCheck, fieldPrintCheck )
+function eqHandleFieldReadBox( pageReadCheck, fieldSetId, inputId, fieldReadCheck, fieldWriteCheckStr, fieldListCheck, fieldSummaryCheck, fieldPrintCheck )
{
if( pageReadCheck.checked == false && fieldReadCheck.checked == true)
+ {
pageReadCheck.click();
+ }
if( fieldReadCheck.checked == false )
{
- fieldWriteCheck.checked=false;
+ var fieldWriteCheck = $$( 'fieldSet#' + fieldSetId + " input#" + fieldWriteCheckStr );
+ if( fieldWriteCheck.length != 0 )
+ {
+ fieldWriteCheck[0].checked = false;
+ }
+
fieldListCheck.checked=false;
fieldSummaryCheck.checked=false;
fieldPrintCheck.checked=false;
+
+ if( anyFieldsChecked( fieldSetId, inputId ) == false )
+ {
+ // all fields are off
+ if( pageReadCheck.checked == true )
+ {
+ pageReadCheck.click();
+ }
+ }
+
}
}
@@ -177,11 +209,11 @@
function allFieldsChecked( fieldSetId, inputId )
{
var allInputs = $$( 'fieldSet#' + fieldSetId + " input" );
- for( i = 0; i < allInputs.length; i++ )
+ for( j = 0; j < allInputs.length; j++ )
{
- if( allInputs[ i ].name.match( inputId ) )
+ if( allInputs[ j ].name.match( inputId ) )
{
- if( allInputs[ i ].checked == false)
+ if( allInputs[ j ].checked == false)
return false;
}
}
@@ -198,12 +230,12 @@
function setFieldChecks( value, fieldSetId, inputId )
{
var allInputs = $$( 'fieldSet#' + fieldSetId + " input" );
- for( i = 0; i < allInputs.length; i++ )
+ for( x = 0; x < allInputs.length; x++ )
{
- if( allInputs[ i ].name.match( inputId ) )
+ if( allInputs[ x ].name.match( inputId ) )
{
- if( allInputs[ i ].checked != value )
- allInputs[ i ].click();
+ if( allInputs[ x ].checked != value )
+ allInputs[ x ].click();
}
}
}
@@ -215,13 +247,13 @@
{
// var allInputs=$$( 'fieldSet#' + identityString + ' input');
var allInputs=$$( 'input' );
- for(i = 0; i < allInputs.length; i++)
+ for(y = 0; y < allInputs.length; y++)
{
- var inputNameAttr = allInputs[ i ].attributes.getNamedItem( "name" ).nodeValue;
+ var inputNameAttr = allInputs[ y ].attributes.getNamedItem( "name" ).nodeValue;
if( inputNameAttr.match( identityString ) )
{
- if( allInputs[ i ].checked != masterCheck.checked ){
- allInputs[ i ].click();
+ if( allInputs[ y ].checked != masterCheck.checked ){
+ allInputs[ y ].click();
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 15:57:04
|
Revision: 893
http://equanda.svn.sourceforge.net/equanda/?rev=893&view=rev
Author: triathlon98
Date: 2008-12-03 15:56:59 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-util/src/main/java/org/equanda/util/Base64.java
trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java
trunk/equanda-util/src/main/java/org/equanda/util/PrintfFormat.java
trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java
trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java
trunk/equanda-util/src/main/java/org/equanda/util/StringUtil.java
trunk/equanda-util/src/main/java/org/equanda/util/alert/AlertUtil.java
trunk/equanda-util/src/main/java/org/equanda/util/collection/OneToOneHashMap.java
trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java
trunk/equanda-util/src/main/java/org/equanda/util/io/TextBuilderWriter.java
trunk/equanda-util/src/main/java/org/equanda/util/script/DMExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/security/SslUtil.java
Modified: trunk/equanda-util/src/main/java/org/equanda/util/Base64.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/Base64.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/Base64.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -1,3 +1,26 @@
+/**
+ * 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;
@@ -3,5 +26,5 @@
/**
* Encodes and decodes to and from Base64 notation.
- *
+ * <p/>
* <p>
* Change Log:
@@ -33,7 +56,7 @@
* <li>v1.3.4 - Fixed when "improperly padded stream" error was thrown at the wrong time.</li>
* <li>v1.3.3 - Fixed I/O streams which were totally messed up.</li>
* </ul>
- *
+ * <p/>
* <p>
* I am placing this code in the Public Domain. Do with it as you will.
* This software comes with no guarantees or warranties but with
@@ -46,73 +69,53 @@
* @author ro...@ih...
* @version 2.0
*/
-public class Base64
+public final class Base64
{
/* ******** P U B L I C F I E L D S ******** */
- /**
- * No options specified. Value is zero.
- */
+ /** No options specified. Value is zero. */
public final static int NO_OPTIONS = 0;
- /**
- * Specify encoding.
- */
+ /** Specify encoding. */
public final static int ENCODE = 1;
- /**
- * Specify decoding.
- */
+ /** Specify decoding. */
public final static int DECODE = 0;
- /**
- * Specify that data should be gzip-compressed.
- */
+ /** Specify that data should be gzip-compressed. */
public final static int GZIP = 2;
- /**
- * Don't break lines when encoding (violates strict Base64 specification)
- */
+ /** Don't break lines when encoding (violates strict Base64 specification) */
public final static int DONT_BREAK_LINES = 8;
/* ******** P R I V A T E F I E L D S ******** */
- /**
- * Maximum line length (76) of Base64 output.
- */
+ /** Maximum line length (76) of Base64 output. */
private final static int MAX_LINE_LENGTH = 76;
- /**
- * The equals sign (=) as a byte.
- */
+ /** The equals sign (=) as a byte. */
private final static byte EQUALS_SIGN = (byte) '=';
- /**
- * The new line character (\n) as a byte.
- */
+ /** The new line character (\n) as a byte. */
private final static byte NEW_LINE = (byte) '\n';
- /**
- * Preferred encoding.
- */
+ /** Preferred encoding. */
private final static String PREFERRED_ENCODING = "UTF-8";
- /**
- * The 64 valid Base64 values.
- */
+ /** The 64 valid Base64 values. */
private final static byte[] ALPHABET;
- private final static byte[] _NATIVE_ALPHABET = /* May be something funny like EBCDIC */
+ private final static byte[] NATIVE_ALPHABET = /* May be something funny like EBCDIC */
{
(byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G',
(byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N',
@@ -129,18 +132,18 @@
/** Determine which ALPHABET to use. */
static
{
- byte[] __bytes;
+ byte[] bytes;
try
{
- __bytes =
+ bytes =
new String( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ).getBytes(
PREFERRED_ENCODING );
} // end try
catch ( java.io.UnsupportedEncodingException use )
{
- __bytes = _NATIVE_ALPHABET; // Fall back to native encoding
+ bytes = NATIVE_ALPHABET; // Fall back to native encoding
} // end catch
- ALPHABET = __bytes;
+ ALPHABET = bytes;
} // end static
@@ -188,13 +191,10 @@
private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
- /**
- * Defeats instantiation.
- */
- private Base64(){}
+ /** Defeats instantiation. */
+ private Base64() {}
-
/* ******** E N C O D I N G M E T H O D S ******** */
@@ -256,8 +256,8 @@
// We have to shift left 24 in order to flush out the 1's that appear
// when Java treats a value as negative that is cast from a byte to an int.
int inBuff = ( numSigBytes > 0 ? ( ( source[ srcOffset ] << 24 ) >>> 8 ) : 0 )
- | ( numSigBytes > 1 ? ( ( source[ srcOffset + 1 ] << 24 ) >>> 16 ) : 0 )
- | ( numSigBytes > 2 ? ( ( source[ srcOffset + 2 ] << 24 ) >>> 24 ) : 0 );
+ | ( numSigBytes > 1 ? ( ( source[ srcOffset + 1 ] << 24 ) >>> 16 ) : 0 )
+ | ( numSigBytes > 2 ? ( ( source[ srcOffset + 2 ] << 24 ) >>> 24 ) : 0 );
switch ( numSigBytes )
{
@@ -310,15 +310,15 @@
* version of that serialized object. If the object
* cannot be serialized or there is another error,
* the method will return <tt>null</tt>.
- * <p>
+ * <p/>
* Valid options:<pre>
* GZIP: gzip-compresses object before encoding it.
* DONT_BREAK_LINES: don't break lines at 76 characters
* <i>Note: Technically, this makes your encoding non-compliant.</i>
* </pre>
- * <p>
+ * <p/>
* Example: <code>encodeObject( myObj, Base64.GZIP )</code> or
- * <p>
+ * <p/>
* Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
*
* @param serializableObject The object to encode
@@ -420,15 +420,15 @@
/**
* Encodes a byte array into Base64 notation.
- * <p>
+ * <p/>
* Valid options:<pre>
* GZIP: gzip-compresses object before encoding it.
* DONT_BREAK_LINES: don't break lines at 76 characters
* <i>Note: Technically, this makes your encoding non-compliant.</i>
* </pre>
- * <p>
+ * <p/>
* Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
- * <p>
+ * <p/>
* Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
*
* @param source The data to convert
@@ -460,15 +460,15 @@
/**
* Encodes a byte array into Base64 notation.
- * <p>
+ * <p/>
* Valid options:<pre>
* GZIP: gzip-compresses object before encoding it.
* DONT_BREAK_LINES: don't break lines at 76 characters
* <i>Note: Technically, this makes your encoding non-compliant.</i>
* </pre>
- * <p>
+ * <p/>
* Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
- * <p>
+ * <p/>
* Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
*
* @param source The data to convert
@@ -549,9 +549,9 @@
boolean breakLines = dontBreakLines == 0;
int len43 = len * 4 / 3;
- byte[] outBuff = new byte[ ( len43 ) // Main 4:3
- + ( ( len % 3 ) > 0 ? 4 : 0 ) // Account for padding
- + ( breakLines ? ( len43 / MAX_LINE_LENGTH ) : 0 ) ]; // New lines
+ byte[] outBuff = new byte[( len43 ) // Main 4:3
+ + ( ( len % 3 ) > 0 ? 4 : 0 ) // Account for padding
+ + ( breakLines ? ( len43 / MAX_LINE_LENGTH ) : 0 )]; // New lines
int d = 0;
int e = 0;
int len2 = len - 2;
@@ -591,9 +591,6 @@
} // end encodeBytes
-
-
-
/* ******** D E C O D I N G M E T H O D S ******** */
@@ -627,7 +624,7 @@
//int outBuff = ( ( DECODABET[ source[ srcOffset ] ] << 24 ) >>> 6 )
// | ( ( DECODABET[ source[ srcOffset + 1] ] << 24 ) >>> 12 );
int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
- | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 );
+ | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 );
destination[ destOffset ] = (byte) ( outBuff >>> 16 );
return 1;
@@ -641,8 +638,8 @@
// | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
// | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 );
int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
- | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
- | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6 );
+ | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
+ | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6 );
destination[ destOffset ] = (byte) ( outBuff >>> 16 );
destination[ destOffset + 1 ] = (byte) ( outBuff >>> 8 );
@@ -660,9 +657,9 @@
// | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 )
// | ( ( DECODABET[ source[ srcOffset + 3 ] ] << 24 ) >>> 24 );
int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
- | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
- | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6 )
- | ( ( DECODABET[ source[ srcOffset + 3 ] ] & 0xFF ) );
+ | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
+ | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6 )
+ | ( ( DECODABET[ source[ srcOffset + 3 ] ] & 0xFF ) );
destination[ destOffset ] = (byte) ( outBuff >> 16 );
@@ -697,15 +694,15 @@
public static byte[] decode( byte[] source, int off, int len )
{
int len34 = len * 3 / 4;
- byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
+ byte[] outBuff = new byte[len34]; // Upper limit on size of output
int outBuffPosn = 0;
- byte[] b4 = new byte[ 4 ];
+ byte[] b4 = new byte[4];
int b4Posn = 0;
int i;
byte sbiCrop;
byte sbiDecode;
- for ( i = off ; i < off + len ; i++ )
+ for ( i = off; i < off + len ; i++ )
{
sbiCrop = (byte) ( source[ i ] & 0x7f ); // Only the low seven bits
sbiDecode = DECODABET[ sbiCrop ];
@@ -737,7 +734,7 @@
} // end else:
} // each input character
- byte[] out = new byte[ outBuffPosn ];
+ byte[] out = new byte[outBuffPosn];
System.arraycopy( outBuff, 0, out, 0, outBuffPosn );
return out;
} // end decode
@@ -775,12 +772,12 @@
int head = ( (int) bytes[ 0 ] & 0xff ) | ( ( bytes[ 1 ] << 8 ) & 0xff00 );
if ( bytes.length >= 4 && // Don't want to get ArrayIndexOutOfBounds exception
- java.util.zip.GZIPInputStream.GZIP_MAGIC == head )
+ java.util.zip.GZIPInputStream.GZIP_MAGIC == head )
{
java.io.ByteArrayInputStream bais = null;
java.util.zip.GZIPInputStream gzis = null;
java.io.ByteArrayOutputStream baos = null;
- byte[] buffer = new byte[ 2048 ];
+ byte[] buffer = new byte[2048];
int length;
try
@@ -888,7 +885,6 @@
/* ******** I N N E R C L A S S I N P U T S T R E A M ******** */
-
/**
* A {@link Base64#InputStream} will read data from another
* {@link java.io.InputStream}, given in the constructor,
@@ -925,14 +921,14 @@
/**
* Constructs a {@link Base64#InputStream} in
* either ENCODE or DECODE mode.
- * <p>
+ * <p/>
* Valid options:<pre>
* ENCODE or DECODE: Encode or Decode as data is read.
* DONT_BREAK_LINES: don't break lines at 76 characters
* (only meaningful when encoding)
* <i>Note: Technically, this makes your encoding non-compliant.</i>
* </pre>
- * <p>
+ * <p/>
* Example: <code>new Base64.InputStream( in, Base64.DECODE )</code>
*
* @param in the {@link java.io.InputStream} from which to read data.
@@ -948,7 +944,7 @@
this.breakLines = ( options & DONT_BREAK_LINES ) != DONT_BREAK_LINES;
this.encode = ( options & ENCODE ) == ENCODE;
this.bufferLength = encode ? 4 : 3;
- this.buffer = new byte[ bufferLength ];
+ this.buffer = new byte[bufferLength];
this.position = -1;
this.lineLength = 0;
} // end constructor
@@ -968,9 +964,9 @@
{
if ( encode )
{
- byte[] b3 = new byte[ 3 ];
+ byte[] b3 = new byte[3];
int numBinaryBytes = 0;
- for ( int i = 0 ; i < 3 ; i++ )
+ for ( int i = 0; i < 3 ; i++ )
{
try
{
@@ -1010,9 +1006,9 @@
// Else decoding
else
{
- byte[] b4 = new byte[ 4 ];
+ byte[] b4 = new byte[4];
int i;
- for ( i = 0 ; i < 4 ; i++ )
+ for ( i = 0; i < 4 ; i++ )
{
// Read four "meaningful" bytes:
int b;
@@ -1106,7 +1102,7 @@
{
int i;
int b;
- for ( i = 0 ; i < len ; i++ )
+ for ( i = 0; i < len ; i++ )
{
b = read();
@@ -1132,14 +1128,9 @@
} // end inner class InputStream
-
-
-
-
/* ******** I N N E R C L A S S O U T P U T S T R E A M ******** */
-
/**
* A {@link Base64#OutputStream} will write data to another
* {@link java.io.OutputStream}, given in the constructor,
@@ -1176,14 +1167,14 @@
/**
* Constructs a {@link Base64#OutputStream} in
* either ENCODE or DECODE mode.
- * <p>
+ * <p/>
* Valid options:<pre>
* ENCODE or DECODE: Encode or Decode as data is read.
* DONT_BREAK_LINES: don't break lines at 76 characters
* (only meaningful when encoding)
* <i>Note: Technically, this makes your encoding non-compliant.</i>
* </pre>
- * <p>
+ * <p/>
* Example: <code>new Base64.OutputStream( out, Base64.ENCODE )</code>
*
* @param out the {@link java.io.OutputStream} to which data will be written.
@@ -1199,11 +1190,11 @@
this.breakLines = ( options & DONT_BREAK_LINES ) != DONT_BREAK_LINES;
this.encode = ( options & ENCODE ) == ENCODE;
this.bufferLength = encode ? 3 : 4;
- this.buffer = new byte[ bufferLength ];
+ this.buffer = new byte[bufferLength];
this.position = 0;
this.lineLength = 0;
this.suspendEncoding = false;
- this.b4 = new byte[ 4 ];
+ this.b4 = new byte[4];
} // end constructor
@@ -1290,7 +1281,7 @@
return;
} // end if: supsended
- for ( int i = 0 ; i < len ; i++ )
+ for ( int i = 0; i < len ; i++ )
{
write( theBytes[ off + i ] );
} // end for: each byte written
Modified: trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -34,8 +34,9 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class ImageLoader
+public final class ImageLoader
{
+ private ImageLoader() {}
public static Image loadFromResource( String name, Object o )
{
Modified: trunk/equanda-util/src/main/java/org/equanda/util/PrintfFormat.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/PrintfFormat.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/PrintfFormat.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -21,40 +21,40 @@
* 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.
*/
- // (c) 2000 Sun Microsystems, Inc.
- // ALL RIGHTS RESERVED
- //
- // License Grant-
- //
- //
- // Permission to use, copy, modify, and distribute this Software and its
- // documentation for NON-COMMERCIAL or COMMERCIAL purposes and without fee is
- // hereby granted.
- //
- // This Software is provided "AS IS". All express warranties, including any
- // implied warranty of merchantability, satisfactory quality, fitness for a
- // particular purpose, or non-infringement, are disclaimed, except to the extent
- // that such disclaimers are held to be legally invalid.
- //
- // You acknowledge that Software is not designed, licensed or intended for use in
- // the design, construction, operation or maintenance of any nuclear facility
- // ("High Risk Activities"). Sun disclaims any express or implied warranty of
- // fitness for such uses.
- //
- // Please refer to the file http://www.sun.com/policies/trademarks/ for further
- // important trademark information and to
- // http://java.sun.com/nav/business/index.html for further important licensing
- // information for the Java Technology.
- //
+// (c) 2000 Sun Microsystems, Inc.
+// ALL RIGHTS RESERVED
+//
+// License Grant-
+//
+//
+// Permission to use, copy, modify, and distribute this Software and its
+// documentation for NON-COMMERCIAL or COMMERCIAL purposes and without fee is
+// hereby granted.
+//
+// This Software is provided "AS IS". All express warranties, including any
+// implied warranty of merchantability, satisfactory quality, fitness for a
+// particular purpose, or non-infringement, are disclaimed, except to the extent
+// that such disclaimers are held to be legally invalid.
+//
+// You acknowledge that Software is not designed, licensed or intended for use in
+// the design, construction, operation or maintenance of any nuclear facility
+// ("High Risk Activities"). Sun disclaims any express or implied warranty of
+// fitness for such uses.
+//
+// Please refer to the file http://www.sun.com/policies/trademarks/ for further
+// important trademark information and to
+// http://java.sun.com/nav/business/index.html for further important licensing
+// information for the Java Technology.
+//
package org.equanda.util;
import javolution.lang.TextBuilder;
+import java.text.DecimalFormatSymbols;
import java.util.Enumeration;
-import java.util.Vector;
import java.util.Locale;
-import java.text.DecimalFormatSymbols;
+import java.util.Vector;
/**
* PrintfFormat allows the formatting of an array of
@@ -988,9 +988,9 @@
if ( precisionSet && leadingZeros )
{
if ( conversionCharacter == 'd'
- || conversionCharacter == 'i'
- || conversionCharacter == 'o'
- || conversionCharacter == 'x' )
+ || conversionCharacter == 'i'
+ || conversionCharacter == 'o'
+ || conversionCharacter == 'x' )
{
leadingZeros = false;
}
@@ -1281,7 +1281,7 @@
default:
throw new IllegalArgumentException(
"Cannot format a long with a format using a " + conversionCharacter +
- " conversion character." );
+ " conversion character." );
}
return s2;
}
@@ -1315,8 +1315,8 @@
break;
default:
throw new IllegalArgumentException( "Cannot format a double with a format using a "
- + conversionCharacter
- + " conversion character." );
+ + conversionCharacter
+ + " conversion character." );
}
return s2;
}
@@ -1335,16 +1335,16 @@
{
String s2 = "";
if ( conversionCharacter == 's'
- || conversionCharacter == 'S' )
+ || conversionCharacter == 'S' )
{
s2 = printSFormat( s );
}
else
{
throw new IllegalArgumentException( "Cannot " +
- "format a String with a format using a " +
- conversionCharacter
- + " conversion character." );
+ "format a String with a format using a " +
+ conversionCharacter
+ + " conversion character." );
}
return s2;
}
@@ -1362,7 +1362,7 @@
{
String s2 = "";
if ( conversionCharacter == 's'
- || conversionCharacter == 'S' )
+ || conversionCharacter == 'S' )
{
s2 = printSFormat( s.toString() );
}
@@ -1486,7 +1486,7 @@
}
else
{
- p = defaultDigits - 1;
+ p = DEFAULT_DIGITS - 1;
}
char[] ca1 = sx.toCharArray();
char[] ca2 = new char[n1In + n2In];
@@ -1559,7 +1559,7 @@
if ( !carry )
{
if ( alternateForm || !precisionSet
- || precision != 0 )
+ || precision != 0 )
{
ca4 = new char[n1In + expon + p + 1];
}
@@ -1572,7 +1572,7 @@
else
{
if ( alternateForm || !precisionSet
- || precision != 0 )
+ || precision != 0 )
{
ca4 = new char[n1In + expon + p + 2];
}
@@ -1884,17 +1884,17 @@
}
else
{
- p = defaultDigits - 1;
+ p = DEFAULT_DIGITS - 1;
}
if ( rPos != -1 && ePos != -1 )
{
ca1 = ( sx.substring( 0, rPos ) +
- sx.substring( rPos + 1, ePos ) ).toCharArray();
+ sx.substring( rPos + 1, ePos ) ).toCharArray();
}
else if ( rPos != -1 )
{
ca1 = ( sx.substring( 0, rPos ) +
- sx.substring( rPos + 1 ) ).toCharArray();
+ sx.substring( rPos + 1 ) ).toCharArray();
}
else if ( ePos != -1 )
{
@@ -1965,7 +1965,7 @@
if ( ca1[ j ] != '0' ) break;
}
if ( ( ePos != -1 && j < ePos ) ||
- ( ePos == -1 && j < ca1.length ) )
+ ( ePos == -1 && j < ca1.length ) )
{
ca2[ 0 ] = ca1[ j ];
expon -= j;
@@ -2223,7 +2223,7 @@
if ( icarry < ca1.length )
{
if ( ca1[ icarry ] == '6' || ca1[ icarry ] == '7'
- || ca1[ icarry ] == '8' || ca1[ icarry ] == '9' )
+ || ca1[ icarry ] == '8' || ca1[ icarry ] == '9' )
{
carry = true;
}
@@ -2238,8 +2238,8 @@
if ( !carry && icarry > 0 )
{
carry = ( ca1[ icarry - 1 ] == '1' || ca1[ icarry - 1 ] == '3'
- || ca1[ icarry - 1 ] == '5' || ca1[ icarry - 1 ] == '7'
- || ca1[ icarry - 1 ] == '9' );
+ || ca1[ icarry - 1 ] == '5' || ca1[ icarry - 1 ] == '7'
+ || ca1[ icarry - 1 ] == '9' );
}
}
}
@@ -2546,7 +2546,7 @@
}
else
{
- if ( !precisionSet ) precision = defaultDigits;
+ if ( !precisionSet ) precision = DEFAULT_DIGITS;
if ( precision == 0 ) precision = 1;
int ePos = -1;
if ( conversionCharacter == 'g' )
@@ -2755,7 +2755,7 @@
{
int nLeadingZeros = 0;
int nBlanks = 0, n = 0;
- int i = 0, jFirst = 0;
+ int i = 0, jFirst;
boolean neg = sx.charAt( 0 ) == '-';
if ( sx.equals( "0" ) && precisionSet && precision == 0 )
{
@@ -3582,15 +3582,15 @@
int width = fieldWidth;
if ( !fieldWidthSet ) width = nPrint;
char[] ca = new char[width];
- int i = 0;
+ int i;
if ( leftJustify )
{
ca[ 0 ] = x;
- for ( i = 1 ; i <= width - nPrint ; i++ ) ca[ i ] = ' ';
+ for ( i = 1; i <= width - nPrint ; i++ ) ca[ i ] = ' ';
}
else
{
- for ( i = 0 ; i < width - nPrint ; i++ ) ca[ i ] = ' ';
+ for ( i = 0; i < width - nPrint ; i++ ) ca[ i ] = ' ';
ca[ i ] = x;
}
return new String( ca );
@@ -3640,7 +3640,7 @@
n += nPrint;
}
char[] ca = new char[n];
- int i = 0;
+ int i;
if ( leftJustify )
{
if ( nPrint >= x.length() )
@@ -3700,8 +3700,8 @@
{
char c = fmt.charAt( pos );
if ( c == 'i' || c == 'd' || c == 'f' || c == 'g' || c == 'G'
- || c == 'o' || c == 'x' || c == 'X' || c == 'e'
- || c == 'E' || c == 'c' || c == 's' || c == '%' )
+ || c == 'o' || c == 'x' || c == 'X' || c == 'e'
+ || c == 'E' || c == 'c' || c == 's' || c == '%' )
{
conversionCharacter = c;
pos++;
@@ -3746,9 +3746,7 @@
}
}
- /**
- * Set the precision.
- */
+ /** Set the precision. */
private void setPrecision()
{
int firstPos = pos;
@@ -3757,7 +3755,7 @@
{
pos++;
if ( ( pos < fmt.length() )
- && ( fmt.charAt( pos ) == '*' ) )
+ && ( fmt.charAt( pos ) == '*' ) )
{
pos++;
if ( !setPrecisionArgPosition() )
@@ -3765,7 +3763,6 @@
variablePrecision = true;
precisionSet = true;
}
- return;
}
else
{
@@ -3791,16 +3788,14 @@
}
}
- /**
- * Set the field width.
- */
+ /** Set the field width. */
private void setFieldWidth()
{
int firstPos = pos;
fieldWidth = 0;
fieldWidthSet = false;
if ( ( pos < fmt.length() )
- && ( fmt.charAt( pos ) == '*' ) )
+ && ( fmt.charAt( pos ) == '*' ) )
{
pos++;
if ( !setFieldWidthArgPosition() )
@@ -3832,9 +3827,7 @@
}
}
- /**
- * Store the digits <code>n</code> in %n$ forms.
- */
+ /** Store the digits <code>n</code> in %n$ forms. */
private void setArgPosition()
{
int xPos;
@@ -3857,9 +3850,7 @@
}
}
- /**
- * Store the digits <code>n</code> in *n$ forms.
- */
+ /** Store the digits <code>n</code> in *n$ forms. */
private boolean setFieldWidthArgPosition()
{
boolean ret = false;
@@ -3887,6 +3878,8 @@
/**
* Store the digits <code>n</code> in *n$ forms.
+ *
+ * @return true when format with dollar
*/
private boolean setPrecisionArgPosition()
{
@@ -3904,8 +3897,7 @@
if ( fmt.charAt( xPos ) == '$' )
{
positionalPrecision = true;
- argumentPositionForPrecision =
- Integer.parseInt( fmt.substring( pos, xPos ) );
+ argumentPositionForPrecision = Integer.parseInt( fmt.substring( pos, xPos ) );
pos = xPos + 1;
ret = true;
}
@@ -3940,9 +3932,7 @@
return argumentPositionForPrecision;
}
- /**
- * Set flag characters, one of '-+#0 or a space.
- */
+ /** Set flag characters, one of '-+#0 or a space. */
private void setFlagCharacters()
{
/* '-+ #0 */
@@ -4021,22 +4011,20 @@
* conversions, trailing zeros will not be removed
* from the result.
*/
- private boolean alternateForm = false;
+ private boolean alternateForm;
/**
* Flag indicating that left padding with zeroes is
* specified.
*/
- private boolean leadingZeros = false;
+ private boolean leadingZeros;
+ /** Flag indicating that the field width is *. */
+ private boolean variableFieldWidth;
/**
- * Flag indicating that the field width is *.
- */
- private boolean variableFieldWidth = false;
- /**
* If the converted value has fewer bytes than the
* field width, it will be padded with spaces or
* zeroes.
*/
- private int fieldWidth = 0;
+ private int fieldWidth;
/**
* Flag indicating whether or not the field width
* has been set.
@@ -4051,14 +4039,10 @@
* conversions. The maximum number of bytes to be
* printed from a string in s and S conversions.
*/
- private int precision = 0;
- /**
- * Default precision.
- */
- private final static int defaultDigits = 6;
- /**
- * Flag indicating that the precision is *.
- */
+ private int precision;
+ /** Default precision. */
+ private final static int DEFAULT_DIGITS = 6;
+ /** Flag indicating that the precision is *. */
private boolean variablePrecision = false;
/**
* Flag indicating whether or not the precision has
@@ -4091,31 +4075,21 @@
* argument. This is a noop in Java.
*/
private boolean optionalL = false;
- /**
- * Control string type.
- */
+ /** Control string type. */
private char conversionCharacter = '\0';
/**
* Position within the control string. Used by
* the constructor.
*/
private int pos = 0;
- /**
- * Literal or control format string.
- */
+ /** Literal or control format string. */
private String fmt;
}
- /**
- * Vector of control strings and format literals.
- */
+ /** Vector of control strings and format literals. */
private Vector<PrintfFormat.ConversionSpecification> vFmt = new Vector<PrintfFormat.ConversionSpecification>();
- /**
- * Character position. Used by the constructor.
- */
+ /** Character position. Used by the constructor. */
private int cPos = 0;
- /**
- * Character position. Used by the constructor.
- */
+ /** Character position. Used by the constructor. */
private DecimalFormatSymbols dfs = null;
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -40,23 +40,17 @@
*
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
*/
-public class ReflectionUtil
+public final class ReflectionUtil
{
-
/**
- * This is the singleton instance of this {@link ReflectionUtil}. Instead of declaring the methods static, we declare
- * this static instance what gives the same way of access while still allowing a design for extension by inheriting
- * from this class.
+ * This is the singleton instance of this {@link ReflectionUtil}. Instead of declaring the methods static, we
+ * declare this static instance what gives the same way of access while still allowing a design for extension by
+ * inheriting from this class.
*/
public static final ReflectionUtil INSTANCE = new ReflectionUtil();
- /**
- * Forbidden constructor.
- */
- private ReflectionUtil()
- {
- super();
- }
+ /** Forbidden constructor. */
+ private ReflectionUtil() {}
/**
* This method checks and transforms the filename of a potential {@link Class} given by <code>fileName</code>.
@@ -92,8 +86,8 @@
*
* @param packageDirectory is the directory representing the {@link Package}.
* @param classSet is where to add the Java {@link Class}-names to.
- * @param qualifiedNameBuilder is a {@link StringBuilder} containing the qualified prefix (the {@link Package} with a
- * trailing dot).
+ * @param qualifiedNameBuilder is a {@link StringBuilder} containing the qualified prefix (the {@link Package} with
+ * a trailing dot).
* @param qualifiedNamePrefixLength the length of the prefix used to rest the string-builder after reuse.
*/
private static void findClassNamesRecursive( File packageDirectory, Set<String> classSet,
@@ -125,13 +119,13 @@
}
/**
- * This method finds all classes that are located in the package identified by the given <code>packageName</code>.<br>
- * <b>ATTENTION:</b><br> This is a relative expensive operation. Depending on your classpath multiple
+ * This method finds all classes that are located in the package identified by the given <code>packageName</code>.
+ * <br><b>ATTENTION:</b><br> This is a relative expensive operation. Depending on your classpath multiple
* directories,JAR-, and WAR-files may need to be scanned.
*
* @param packageName is the name of the {@link Package} to scan.
- * @param includeSubPackages - if <code>true</code> all sub-packages of the specified {@link Package} will be included
- * in the search.
+ * @param includeSubPackages - if <code>true</code> all sub-packages of the specified {@link Package} will be
+ * included in the search.
* @return a {@link Set} will the fully qualified names of all requested classes.
* @throws java.io.IOException if the operation failed with an I/O error.
*/
@@ -145,13 +139,13 @@
}
/**
- * This method finds all classes that are located in the package identified by the given <code>packageName</code>.<br>
- * <b>ATTENTION:</b><br> This is a relative expensive operation. Depending on your classpath multiple
+ * This method finds all classes that are located in the package identified by the given <code>packageName</code>.
+ * <br><b>ATTENTION:</b><br> This is a relative expensive operation. Depending on your classpath multiple
* directories,JAR-, and WAR-files may need to be scanned.
*
* @param packageName is the name of the {@link Package} to scan.
- * @param includeSubPackages - if <code>true</code> all sub-packages of the specified {@link Package} will be included
- * in the search.
+ * @param includeSubPackages - if <code>true</code> all sub-packages of the specified {@link Package} will be
+ * included in the search.
* @param classSet is where to add the classes.
* @throws IOException if the operation failed with an I/O error.
*/
Modified: trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -32,7 +32,7 @@
/**
* Save exception details to a file
- *
+ * <p/>
* Usage :
* try {
* // insert your code here
@@ -40,10 +40,12 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class SaveException
+public final class SaveException
{
+ private SaveException() {}
+
// test routine
- public static void main( String argv [] )
+ public static void main( String[] argv )
{
try
{
Modified: trunk/equanda-util/src/main/java/org/equanda/util/StringUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/StringUtil.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/StringUtil.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -39,11 +39,10 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class StringUtil
+public final class StringUtil
{
// hide constructor
- private StringUtil()
- {}
+ private StringUtil() {}
public static String format( Object value, String format )
{
Modified: trunk/equanda-util/src/main/java/org/equanda/util/alert/AlertUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/alert/AlertUtil.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/alert/AlertUtil.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -27,24 +27,26 @@
import org.jboss.security.SecurityAssociation;
import org.jboss.security.SimplePrincipal;
+import java.lang.reflect.Method;
import java.util.Properties;
-import java.lang.reflect.Method;
/**
* Utility class to easily create alert messages/instances.
*
* @author Florin
*/
-public class AlertUtil
+public final class AlertUtil
{
private static final Logger log = Logger.getLogger( AlertUtil.class );
- public static String ALERT_TYPE_WARNING = "W";
- public static String ALERT_TYPE_CRITICAL = "C";
+ public static final String ALERT_TYPE_WARNING = "W";
+ public static final String ALERT_TYPE_CRITICAL = "C";
- private static String proxyName;
+ private static String PROXY_NAME;
- public static void init( String server, String login, String password, String _proxyName )
+ private AlertUtil() {}
+
+ public static void init( String server, String login, String password, String proxyName )
{
// login
SecurityAssociation.setPrincipal( new SimplePrincipal( login ) );
@@ -57,18 +59,18 @@
properties.setProperty( "java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
properties.setProperty( "java.naming.factory.url.pkgs", "org.jnp.interfaces" );
properties.setProperty( "java.naming.provider.url", server );
- proxyName = _proxyName;
+ PROXY_NAME = proxyName;
}
public static void createAlert( String cause, String message, String moreInfo, String fileData )
{
- if ( proxyName == null )
+ if ( PROXY_NAME == null )
{
log.warn( "alert proxy name unknown, " + message + '\n' + moreInfo + '\n' + fileData );
}
try
{
- Object proxy = Class.forName( proxyName ).newInstance();
+ Object proxy = Class.forName( PROXY_NAME ).newInstance();
Method methodSetAlertType = proxy.getClass().getMethod( "setAlertType", new Class[]{ String.class } );
methodSetAlertType.invoke( proxy, new Object[]{ ALERT_TYPE_CRITICAL } );
Modified: trunk/equanda-util/src/main/java/org/equanda/util/collection/OneToOneHashMap.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/collection/OneToOneHashMap.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/collection/OneToOneHashMap.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -1,7 +1,25 @@
/**
- * This file is part of the eportfolio-dp project.
+ * This file is part of the equanda project.
*
- * The file is copyrighted by Synergetics nv in Belgium, all rights reserved.
+ * 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.collection;
Modified: trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/io/StreamUtil.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -33,8 +33,9 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class StreamUtil
+public final class StreamUtil
{
+ private 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.
Modified: trunk/equanda-util/src/main/java/org/equanda/util/io/TextBuilderWriter.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/io/TextBuilderWriter.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/io/TextBuilderWriter.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -26,8 +26,8 @@
import javolution.lang.TextBuilder;
+import java.io.IOException;
import java.io.Writer;
-import java.io.IOException;
/**
* Writer implementation which appends into an existing (javolution) TextBuilder
@@ -37,7 +37,7 @@
public class TextBuilderWriter
extends Writer
{
- TextBuilder tb;
+ private TextBuilder tb;
public TextBuilderWriter( TextBuilder builder )
{
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/DMExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/DMExtension.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/DMExtension.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -25,23 +25,25 @@
package org.equanda.util.script;
import murlen.util.fscript.*;
+import org.equanda.util.IniFile;
import org.equanda.util.SaveException;
-import org.equanda.util.IniFile;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+import java.net.MulticastSocket;
+import java.net.SocketTimeoutException;
+import java.sql.Date;
+import java.sql.Timestamp;
+import java.util.ArrayList;
import java.util.Hashtable;
-import java.util.ArrayList;
import java.util.Properties;
-import java.sql.Date;
-import java.sql.Timestamp;
-import java.net.*;
-import java.io.IOException;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
-
/**
* DMExtension, FScript extension to access a equanda genereated domain model
*
@@ -62,8 +64,8 @@
private static final int HEARTBEAT_TIMEOUT = 15000;
private static final int HEARTBEAT_BUFFER = 5;
- private static final FSObject dmTrue = new FSObject( Boolean.TRUE );
- private static final FSObject dmFalse = new FSObject( Boolean.FALSE );
+ private static final FSObject DM_TRUE = new FSObject( Boolean.TRUE );
+ private static final FSObject DM_FALSE = new FSObject( Boolean.FALSE );
private ExceptionListener exceptionListener;
private Hashtable<String, DataModel> dataModels = new Hashtable<String, DataModel>();
@@ -401,7 +403,7 @@
{
if ( !sValue.toUpperCase().startsWith( "N" ) ) value = 1;
}
- return value == 0 ? dmFalse : dmTrue;
+ return value == 0 ? DM_FALSE : DM_TRUE;
}
}
} );
@@ -492,7 +494,7 @@
{
public Object getVar( String name )
{
- return dmTrue;
+ return DM_TRUE;
}
public void setVar( String name, Object value )
@@ -505,7 +507,7 @@
{
public Object getVar( String name )
{
- return dmFalse;
+ return DM_FALSE;
}
public void setVar( String name, Object value )
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -54,7 +54,7 @@
*/
public final class FileExtension
{
- private static ArrayList files = new ArrayList();
+ private static ArrayList FILES = new ArrayList();
private FileExtension() {}
@@ -68,22 +68,22 @@
int n;
if ( params.size() != 2 ) throw new FSException( "open(file,mode) needs two parameters" );
// find unused spot in list of files
- for ( n = 0; n < files.size() ; n++ )
+ for ( n = 0; n < FILES.size() ; n++ )
{
- if ( files.get( n ) == null ) break;
+ if ( FILES.get( n ) == null ) break;
}
- if ( n == files.size() ) files.add( null );
+ if ( n == FILES.size() ) FILES.add( null );
try
{
if ( params.get( 1 ).toString().equals( "r" ) )
{
File file = new File( (String) params.get( 0 ) );
if ( !file.exists() ) return new Integer( -1 );
- files.set( n, new BufferedReader( new FileReader( file ) ) );
+ FILES.set( n, new BufferedReader( new FileReader( file ) ) );
}
else if ( params.get( 1 ).equals( "w" ) )
{
- files.set( n, new BufferedWriter( new FileWriter( (String) params.get( 0 ), true ) ) );
+ FILES.set( n, new BufferedWriter( new FileWriter( (String) params.get( 0 ), true ) ) );
}
else
{
@@ -108,11 +108,11 @@
}
int n = ( (Integer) params.get( 0 ) ).intValue();
if ( n == -1 ) return null;
- if ( n < files.size() )
+ if ( n < FILES.size() )
{
try
{
- Object f = files.get( n );
+ Object f = FILES.get( n );
if ( f instanceof BufferedWriter )
{
( (BufferedWriter) f ).close();
@@ -121,7 +121,7 @@
{
( (BufferedReader) f ).close();
}
- files.set( n, null );
+ FILES.set( n, null );
}
catch ( IOException e )
{
@@ -147,17 +147,17 @@
s += params.get( n );
}
n = ( (Integer) params.get( 0 ) ).intValue();
- if ( files.get( n ) == null )
+ if ( FILES.get( n ) == null )
{
throw new FSException( "Invalid file number passed to write" );
}
- if ( !( files.get( n ) instanceof BufferedWriter ) )
+ if ( !( FILES.get( n ) instanceof BufferedWriter ) )
{
throw new FSException( "Invalid file mode for write" );
}
try
{
- BufferedWriter bw = (BufferedWriter) files.get( n );
+ BufferedWriter bw = (BufferedWriter) FILES.get( n );
bw.write( s, 0, s.length() );
bw.newLine();
}
@@ -180,17 +180,17 @@
int n;
String s;
n = ( (Integer) params.get( 0 ) ).intValue();
- if ( files.get( n ) == null )
+ if ( FILES.get( n ) == null )
{
throw new FSException( "Invalid file number passed to read" );
}
- if ( !( files.get( n ) instanceof BufferedReader ) )
+ if ( !( FILES.get( n ) instanceof BufferedReader ) )
{
throw new FSException( "Invalid file mode for read" );
}
try
{
- s = ( (BufferedReader) files.get( n ) ).readLine();
+ s = ( (BufferedReader) FILES.get( n ) ).readLine();
//dodge eof problems
if ( s == null ) s = "";
return s;
@@ -212,15 +212,15 @@
}
int n = ( (Integer) params.get( 0 ) ).intValue();
if ( n == -1 ) return new Integer( 1 );
- if ( files.get( n ) == null )
+ if ( FILES.get( n ) == null )
{
throw new FSException( "Invalid file number passed to eof" );
}
- if ( !( files.get( n ) instanceof BufferedReader ) )
+ if ( !( FILES.get( n ) instanceof BufferedReader ) )
{
throw new FSException( "eof(fp) needs file opened for read" );
}
- BufferedReader br = (BufferedReader) files.get( n );
+ BufferedReader br = (BufferedReader) FILES.get( n );
try
{
br.mark( 1024 );
Modified: trunk/equanda-util/src/main/java/org/equanda/util/security/SslUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/security/SslUtil.java 2008-12-03 14:27:10 UTC (rev 892)
+++ trunk/equanda-util/src/main/java/org/equanda/util/security/SslUtil.java 2008-12-03 15:56:59 UTC (rev 893)
@@ -34,11 +34,13 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class SslUtil
+public final class SslUtil
{
public static final HostnameVerifier HOSTNAME_VERIFIER = new AllowAllHostnameVerifier();
public static final TrustManager[] TRUST_MANAGERS = new TrustManager[]{ new TrustAllX509TrustManager() };
+ private SslUtil() {}
+
/** Set the default Hostname Verifier to an instance of a fake class that trust all hostnames. */
public static void trustAllHostnames()
{
@@ -104,7 +106,7 @@
{
/** Empty array of certificate authority certificates. */
- private static final X509Certificate[] acceptedIssuers = new X509Certificate[]{ };
+ private static final X509Certificate[] ACCEPTED_ISSUERS = new X509Certificate[]{ };
/**
* Always trust for client SSL chain peer certificate chain with any authType authentication types.
@@ -131,7 +133,7 @@
*/
public X509Certificate[] getAcceptedIssuers()
{
- return ( acceptedIssuers );
+ return ( ACCEPTED_ISSUERS );
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 14:27:13
|
Revision: 892
http://equanda.svn.sourceforge.net/equanda/?rev=892&view=rev
Author: triathlon98
Date: 2008-12-03 14:27:10 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/config/checkstyle.xml
trunk/equanda-util/src/main/java/org/equanda/util/accessor/ObjectAccessor.java
trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Support.java
trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/DateExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java
trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/GeneralExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/xml/XMLSerializer.java
Modified: trunk/config/checkstyle.xml
===================================================================
--- trunk/config/checkstyle.xml 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/config/checkstyle.xml 2008-12-03 14:27:10 UTC (rev 892)
@@ -196,7 +196,9 @@
<property name="severity" value="warning"/>
</module>
<!--<module name="MagicNumber"/>-->
- <module name="MissingSwitchDefault"/>
+ <module name="MissingSwitchDefault">
+ <property name="severity" value="info"/>
+ </module>
<module name="ModifiedControlVariable"/>
<!--<module name="RedundantThrows"/>-->
<module name="SimplifyBooleanExpression"/>
Modified: trunk/equanda-util/src/main/java/org/equanda/util/accessor/ObjectAccessor.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/accessor/ObjectAccessor.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/accessor/ObjectAccessor.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -42,7 +42,7 @@
* @author NetRom team
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class ObjectAccessor
+public final class ObjectAccessor
{
private static final String CLASS_SELECTOR_SUFFIX = "Selector";
private static final String CLASS_SELECTOREJB_SUFFIX = "SelectorEJB";
@@ -54,9 +54,9 @@
private static final String METHOD_ADDER_PREFIX = "set";
private static final long CACHE_MAX_AGE = 300000; // fluch cache every x ms
- protected static final WeakHashMap<String, Method> methodCache = new WeakHashMap<String, Method>();
- protected static long cacheTimeout;
- protected static Class[] uoidClass = new Class[1]; // avoid dependency on equanda core
+ protected static final WeakHashMap<String, Method> METHOD_CACHE = new WeakHashMap<String, Method>();
+ protected static long CACHE_TIMEOUT;
+ protected static Class[] UOID_CLASS = new Class[1]; // avoid dependency on equanda core
private ObjectAccessor() {}
@@ -82,7 +82,7 @@
// avoid dependency on equanda core
try
{
- uoidClass[ 0 ] = Thread.currentThread().getContextClassLoader().loadClass( "org.equanda.persistence.UOID" );
+ UOID_CLASS[ 0 ] = Thread.currentThread().getContextClassLoader().loadClass( "org.equanda.persistence.UOID" );
}
catch ( ClassNotFoundException cnfe )
{
@@ -92,11 +92,11 @@
public static void clean()
{
- methodCache.clear();
+ METHOD_CACHE.clear();
}
public static Object getSelector( String jndi, String name )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
Object selector;
// build the selector home name
@@ -122,7 +122,7 @@
catch ( ClassCastException cce )
{
throw new ObjectAccessorException(
- "Object found for " + jndi + " does not match the type of " + selectorHomeName, cce );
+ "Object found for " + jndi + " does not match the type of " + selectorHomeName, cce );
}
catch ( NamingException ne )
{
@@ -145,7 +145,7 @@
* @throws ObjectAccessorException oops
*/
public static Object createBean( String jndi, String name, Object uoid )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
Object ejb;
// build the ejb home name
@@ -181,7 +181,7 @@
catch ( ClassCastException cce )
{
throw new ObjectAccessorException(
- "Object found for " + jndi + " does not match the type of " + ejbHomeName, cce );
+ "Object found for " + jndi + " does not match the type of " + ejbHomeName, cce );
}
catch ( NamingException ne )
{
@@ -196,7 +196,7 @@
Method init;
try
{
- init = ejb.getClass().getMethod( METHOD_INIT, uoidClass );
+ init = ejb.getClass().getMethod( METHOD_INIT, UOID_CLASS );
}
catch ( Exception e )
{
@@ -224,9 +224,9 @@
* @throws ObjectAccessorException oops
*/
public static Object createProxy( String prefix, String name )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
- String proxyName = getProxyClassName(prefix, name);
+ String proxyName = getProxyClassName( prefix, name );
Class proxyClass = getProxyClass( proxyName );
Method init;
try
@@ -269,9 +269,9 @@
* @throws ObjectAccessorException oops
*/
public static Class getProxyClass( String prefix, String name )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
- return getProxyClass( getProxyClassName(prefix, name) );
+ return getProxyClass( getProxyClassName( prefix, name ) );
}
/**
@@ -282,7 +282,7 @@
* @throws ObjectAccessorException oops
*/
public static Class getProxyClass( String proxyName )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
try
{
@@ -295,7 +295,7 @@
}
public static Object get( Object obj, String fieldName )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
String getterName = TextBuilder.newInstance().append( METHOD_GETTER_PREFIX ).append( fieldName ).toString();
try
@@ -314,7 +314,7 @@
}
public static void set( Object obj, String fieldName, Class[] param, Object[] values )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
String setterName = TextBuilder.newInstance().append( METHOD_SETTER_PREFIX ).append( fieldName ).toString();
try
@@ -333,7 +333,7 @@
}
public static void add( Object obj, String fieldName, Class[] param, Object[] values )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
String setterName = TextBuilder.newInstance().append( METHOD_ADDER_PREFIX ).append( fieldName ).toString();
try
@@ -352,7 +352,7 @@
}
public static Method getMethod( Class objClass, String name, Class[] param )
- throws ObjectAccessorException
+ throws ObjectAccessorException
{
try
{
@@ -367,32 +367,32 @@
catch ( NoSuchMethodException e )
{
throw new ObjectAccessorException(
- "Method " + name + "(" + param + ") not found for class " + objClass.getCanonicalName() );
+ "Method " + name + "(" + param + ") not found for class " + objClass.getCanonicalName() );
}
}
protected static void addToCache( Class clsName, String methodName, Method method )
{
- methodCache.put( clsName.getName() + "." + methodName, method );
- if ( cacheTimeout == 0 ) cacheTimeout = System.currentTimeMillis() + CACHE_MAX_AGE;
+ METHOD_CACHE.put( clsName.getName() + "." + methodName, method );
+ if ( CACHE_TIMEOUT == 0 ) CACHE_TIMEOUT = System.currentTimeMillis() + CACHE_MAX_AGE;
}
protected static Method getFromCache( Class clsName, String methodName )
{
// invalidate the cache every CACHE_MAX_AGE ms to prevent stale data
- if ( System.currentTimeMillis() > cacheTimeout )
+ if ( System.currentTimeMillis() > CACHE_TIMEOUT )
{
// flush cache
- cacheTimeout = 0;
- methodCache.clear();
+ CACHE_TIMEOUT = 0;
+ METHOD_CACHE.clear();
return null;
}
String name = clsName.getName() + "." + methodName;
- return methodCache.get( name );
+ return METHOD_CACHE.get( name );
}
public static UserTransaction startTransaction()
- throws Exception
+ throws Exception
{
InitialContext ctx = new InitialContext();
UserTransaction tx = (UserTransaction) ctx.lookup( "UserTransaction" );
Modified: trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Support.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Support.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Support.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -31,7 +31,7 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class EAN128Support
+public final class EAN128Support
{
/**
* array with the fixed length for the AI's, according to the first digits of the AI.
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -34,7 +34,7 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class BooleanExtension
+public final class BooleanExtension
{
public static final Integer TRUE = new Integer( 1 );
public static final Integer FALSE = new Integer( 0 );
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -56,7 +56,7 @@
private Connection connection = null;
private Hashtable variables = new Hashtable();
private ExceptionListener exceptionListener = null;
- private static JDBCLogger nullLogger = new JDBCLogger()
+ private static JDBCLogger NULL_LOGGER = new JDBCLogger()
{
public final boolean isDebug() { return false; }
@@ -66,7 +66,7 @@
public final void logInfo( String database, String comment ) {}
};
- private JDBCLogger logger = nullLogger;
+ private JDBCLogger logger = NULL_LOGGER;
public DatabaseExtension( Connection connection )
{
@@ -87,7 +87,7 @@
public void setJDBCLogger( JDBCLogger logger )
{
this.logger = logger;
- if ( logger == null ) this.logger = nullLogger;
+ if ( logger == null ) this.logger = NULL_LOGGER;
}
@@ -187,9 +187,7 @@
throw new FSUnsupportedException();
}
- /**
- * ExceptionListener allows proper handling of database access errors
- */
+ /** ExceptionListener allows proper handling of database access errors */
public interface ExceptionListener
{
public void errorOccured( Throwable t, String extra )
@@ -198,9 +196,7 @@
public void recovered();
}
- /**
- * JDBCLogger allows proper handling of database access logging
- */
+ /** JDBCLogger allows proper handling of database access logging */
public interface JDBCLogger
{
public boolean isInfo();
@@ -212,9 +208,7 @@
public void logDebug( String database, String comment );
}
- /**
- * DatabaseVariable contains all the data for a database resultset etc
- */
+ /** DatabaseVariable contains all the data for a database resultset etc */
private class DatabaseVariable
{
private Connection connection;
@@ -286,7 +280,7 @@
if ( fields == null ) fields = new Hashtable();
fields.clear();
if ( logger.isDebug() ) logger.logDebug( database, "get field names" );
- for ( int i = 1 ; i <= colCount ; i++ )
+ for ( int i = 1; i <= colCount ; i++ )
{
fields.put( md.getColumnName( i ).toLowerCase(), new Integer( i ) );
}
@@ -320,9 +314,7 @@
return null;
}
- /**
- * next moves to the next record and returns whether this has succeeded
- */
+ /** next moves to the next record and returns whether this has succeeded */
public Object next()
throws FSException
{
@@ -336,9 +328,10 @@
{
if ( logger.isDebug() ) logger.logDebug( database, "get data" );
// cache results for this row, to allow out of order fetching
- for ( int i = 1 ; i <= colCount ; i++ )
+ for ( int i = 1; i <= colCount ; i++ )
{
- String str = "???"; // make sure we don't get thrown out for fields which don't support getString
+ String str = "???"
+ ; // make sure we don't get thrown out for fields which don't support getString
try
{
str = results.getString( i );
@@ -471,7 +464,7 @@
{
exceptionListener.errorOccured( e,
"dbvar.field(" + params.get( 0 ).toString() + " "
- + params.get( 1 ).toString() );
+ + params.get( 1 ).toString() );
}
}
if ( rs != null )
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/DateExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/DateExtension.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/DateExtension.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -24,9 +24,6 @@
package org.equanda.util.script;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
import murlen.util.fscript.FSException;
import murlen.util.fscript.FSFastExtension;
import murlen.util.fscript.FSFunctionExtension;
@@ -35,12 +32,16 @@
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
/**
* StringExtension, FScript extension, string manipulations
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class DateExtension
+public final class DateExtension
{
public static final DateTimeFormatter DATE_FORMAT = DateTimeFormat.forPattern( "yyyyMMdd" );
public static final DateTimeFormatter TIME_FORMAT = DateTimeFormat.forPattern( "HHmmssSSS" );
@@ -69,7 +70,7 @@
throws FSException
{
if ( params.size() != 2 || !( params.get( 0 ) instanceof String )
- || !( params.get( 1 ) instanceof Integer ) )
+ || !( params.get( 1 ) instanceof Integer ) )
{
throw new FSException( "datecalc(string, integer) wrong parameter count/type" );
}
@@ -156,7 +157,7 @@
throws FSException
{
if ( params.size() != 2 || !( params.get( 0 ) instanceof String ) ||
- !( params.get( 1 ) instanceof Integer ) )
+ !( params.get( 1 ) instanceof Integer ) )
{
throw new FSException( "setdateday(string,integer) wrong parameter count/type" );
}
@@ -184,7 +185,7 @@
throws FSException
{
if ( params.size() != 2 || !( params.get( 0 ) instanceof String ) ||
- !( params.get( 1 ) instanceof Integer ) )
+ !( params.get( 1 ) instanceof Integer ) )
{
throw new FSException( "setdatedaypast(string,integer) wrong parameter count/type" );
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -36,27 +36,27 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class FScriptExtensionPool
+public final class FScriptExtensionPool
implements FSExtension
{
- private static FScriptExtensionPool instance = null;
- private static ArrayList extensions = new ArrayList();
+ private static FScriptExtensionPool INSTANCE = null;
+ private static ArrayList EXTENSIONS = new ArrayList();
private FScriptExtensionPool() {}
public static FScriptExtensionPool getPool()
{
- if ( instance == null ) instance = new FScriptExtensionPool();
- return instance;
+ if ( INSTANCE == null ) INSTANCE = new FScriptExtensionPool();
+ return INSTANCE;
}
public Object getVar( String name )
throws FSException
{
FSExtension ext;
- for ( int i = 0 ; i < extensions.size() ; i++ )
+ for ( int i = 0; i < EXTENSIONS.size() ; i++ )
{
- ext = (FSExtension) extensions.get( i );
+ ext = (FSExtension) EXTENSIONS.get( i );
try
{
return ext.getVar( name );
@@ -71,9 +71,9 @@
throws FSException
{
FSExtension ext;
- for ( int i = 0 ; i < extensions.size() ; i++ )
+ for ( int i = 0; i < EXTENSIONS.size() ; i++ )
{
- ext = (FSExtension) extensions.get( i );
+ ext = (FSExtension) EXTENSIONS.get( i );
try
{
ext.setVar( name, value );
@@ -89,9 +89,9 @@
throws FSException
{
FSExtension ext;
- for ( int i = 0 ; i < extensions.size() ; i++ )
+ for ( int i = 0; i < EXTENSIONS.size() ; i++ )
{
- ext = (FSExtension) extensions.get( i );
+ ext = (FSExtension) EXTENSIONS.get( i );
try
{
return ext.callFunction( name, params );
@@ -106,9 +106,9 @@
throws FSException
{
FSExtension ext;
- for ( int i = 0 ; i < extensions.size() ; i++ )
+ for ( int i = 0; i < EXTENSIONS.size() ; i++ )
{
- ext = (FSExtension) extensions.get( i );
+ ext = (FSExtension) EXTENSIONS.get( i );
try
{
return ext.getVar( name, index );
@@ -123,9 +123,9 @@
throws FSException
{
FSExtension ext;
- for ( int i = 0 ; i < extensions.size() ; i++ )
+ for ( int i = 0; i < EXTENSIONS.size() ; i++ )
{
- ext = (FSExtension) extensions.get( i );
+ ext = (FSExtension) EXTENSIONS.get( i );
try
{
ext.setVar( name, index, value );
@@ -139,6 +139,6 @@
public static void add( FSExtension ext )
{
- extensions.add( ext );
+ EXTENSIONS.add( ext );
}
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/FileExtension.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -24,9 +24,12 @@
package org.equanda.util.script;
+import murlen.util.fscript.FSException;
+import murlen.util.fscript.FSFastExtension;
+import murlen.util.fscript.FSFunctionExtension;
+
+import java.io.*;
import java.util.ArrayList;
-import java.io.*;
-import murlen.util.fscript.*;
/**
* FileExtension, FScript extension, file i/o,
@@ -49,7 +52,7 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class FileExtension
+public final class FileExtension
{
private static ArrayList files = new ArrayList();
@@ -65,7 +68,7 @@
int n;
if ( params.size() != 2 ) throw new FSException( "open(file,mode) needs two parameters" );
// find unused spot in list of files
- for ( n = 0 ; n < files.size() ; n++ )
+ for ( n = 0; n < files.size() ; n++ )
{
if ( files.get( n ) == null ) break;
}
@@ -139,7 +142,7 @@
}
int n;
String s = "";
- for ( n = 1 ; n < params.size() ; n++ )
+ for ( n = 1; n < params.size() ; n++ )
{
s += params.get( n );
}
@@ -257,7 +260,7 @@
throws FSException
{
if ( params.size() != 2 || !( params.get( 0 ) instanceof String )
- || !( params.get( 1 ) instanceof String ) )
+ || !( params.get( 1 ) instanceof String ) )
{
throw new FSException( "rename(from,to) parameter count/type incorrect" );
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/GeneralExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/GeneralExtension.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/GeneralExtension.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -39,8 +39,10 @@
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
* @author <a href="mailto:an...@pa...">Andrei Chiritescu</a>
*/
-public class GeneralExtension
+public final class GeneralExtension
{
+ private GeneralExtension() {}
+
public static void addExtension( FSFastExtension ext )
{
ext.addFunctionExtension( "wait", new FSFunctionExtension()
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -39,7 +39,7 @@
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
* @author <a href="mailto:an...@pa...">Andrei Chiritescu</a>
*/
-public class StringExtension
+public final class StringExtension
{
private StringExtension()
{}
@@ -619,7 +619,7 @@
throws FSException
{
if ( params.size() != 3 || !( params.get( 1 ) instanceof Integer )
- || !( params.get( 2 ) instanceof Integer ) )
+ || !( params.get( 2 ) instanceof Integer ) )
{
throw new FSException( "wordwrap(string,linelen,line) parameter count or type wrong" );
}
@@ -640,8 +640,8 @@
throws FSException
{
if ( params.size() != 2
- || !( params.get( 0 ) instanceof String ) || !( params.get( 1 ) instanceof String )
- || params.get( 0 ) == null || params.get( 1 ) == null )
+ || !( params.get( 0 ) instanceof String ) || !( params.get( 1 ) instanceof String )
+ || params.get( 0 ) == null || params.get( 1 ) == null )
{
throw new FSException(
"split(string stringToSplit, string separator) parameter count or type wrong" );
Modified: trunk/equanda-util/src/main/java/org/equanda/util/xml/XMLSerializer.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/xml/XMLSerializer.java 2008-12-03 14:09:45 UTC (rev 891)
+++ trunk/equanda-util/src/main/java/org/equanda/util/xml/XMLSerializer.java 2008-12-03 14:27:10 UTC (rev 892)
@@ -41,7 +41,6 @@
*/
public class XMLSerializer
{
-
protected Writer writer;
/**
@@ -133,7 +132,7 @@
// write attributes
NamedNodeMap nnm = element.getAttributes();
- for ( int i = 0 ; i < nnm.getLength() ; i++ )
+ for ( int i = 0; i < nnm.getLength() ; i++ )
{
Attr item = (Attr) nnm.item( i );
String name = item.getName();
@@ -236,7 +235,7 @@
private void escape( TextBuilder sb, String text, boolean keepQuote )
{
int length = text.length();
- for ( int i = 0 ; i < length ; ++i )
+ for ( int i = 0; i < length ; ++i )
{
int ch = text.charAt( i );
escapeXMLChar( sb, ch, keepQuote );
@@ -279,7 +278,3 @@
}
}
}
-
-
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 14:09:48
|
Revision: 891
http://equanda.svn.sourceforge.net/equanda/?rev=891&view=rev
Author: triathlon98
Date: 2008-12-03 14:09:45 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/config/checkstyle.xml
trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java
trunk/equanda-client/src/main/java/org/equanda/persistence/ClientEquandaStateInterceptor.java
trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java
trunk/equanda-util/src/main/java/org/equanda/util/ByteBuffer.java
trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java
trunk/equanda-util/src/main/java/org/equanda/util/Internationalize.java
trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java
trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Builder.java
trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Iterator.java
trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java
trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/DateField.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/JButtonNoFocus.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextFieldSelectOnFocus.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextRestricted.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButton.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonContainer.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonListener.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/SwingUtil.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/layout/VerticalFlowLayout.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPalette.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPaletteTranslator.java
trunk/equanda-util/src/main/java/org/equanda/util/swing/tree/IconNodeRenderer.java
trunk/equanda-util/src/main/java/org/equanda/util/ymport/ImportUtil.java
trunk/equanda-util/src/main/java/org/equanda/util/ymport/LenientSslProtocolSocketFactory.java
Modified: trunk/config/checkstyle.xml
===================================================================
--- trunk/config/checkstyle.xml 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/config/checkstyle.xml 2008-12-03 14:09:45 UTC (rev 891)
@@ -35,6 +35,7 @@
<!-- Block checks, see http://checkstyle.sourceforge.net/config_blocks.html -->
+ <!-- disabled because we allow all on one line if it fits
<module name="LeftCurly">
<property name="severity" value="info"/>
<property name="option" value="nl"/>
@@ -43,6 +44,7 @@
<property name="severity" value="info"/>
<property name="option" value="alone"/>
</module>
+ -->
<!--<module name="EmptyBlock"/>-->
<module name="AvoidNestedBlocks"/>
<!--<module name="NeedBraces"/> no braces is allowed when on same line -->
@@ -89,7 +91,9 @@
<!--<module name="AvoidStarImport"/>-->
<module name="IllegalImport"/>
<module name="RedundantImport"/>
- <module name="UnusedImports"/>
+ <module name="UnusedImports">
+ <property name="severity" value="info"/>
+ </module>
<module name="ImportOrder">
<property name="groups" value="be,org"/>
<property name="severity" value="info"/>
@@ -171,7 +175,9 @@
<!--<module name="AvoidInlineConditionals"/>-->
<module name="CovariantEquals"/>
<module name="DoubleCheckedLocking"/>
- <module name="EmptyStatement"/>
+ <module name="EmptyStatement">
+ <property name="severity" value="info"/>
+ </module>
<module name="EqualsHashCode"/>
<!--<module name="FinalLocalVariable"/>-->
<module name="HiddenField">
@@ -207,7 +213,9 @@
<!--<module name="ReturnCount"/>-->
<!--<module name="IllegalType"/>-->
<!--<module name="DeclarationOrder"/>-->
- <module name="ParameterAssignment"/>
+ <module name="ParameterAssignment">
+ <property name="severity" value="info"/>
+ </module>
<module name="ExplicitInitialization">
<property name="severity" value="info"/>
</module>
@@ -235,6 +243,7 @@
<!-- misc, see http://checkstyle.sourceforge.net/config_misc.html -->
<module name="GenericIllegalRegexp">
+ <property name="severity" value="info"/>
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
Modified: trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -40,7 +40,7 @@
private static final Logger log = Logger.getLogger( LoginInfo.class );
private EquandaUserInfo user;
private AuthAndConfigProvider authAndConfig;
- private Object Extra;
+ private Object extra;
private String userName;
private String password;
@@ -103,12 +103,12 @@
public Object getExtra()
{
- return Extra;
+ return extra;
}
public void setExtra( Object extra )
{
- Extra = extra;
+ this.extra = extra;
}
public AuthAndConfigProvider getAuthAndConfig()
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/ClientEquandaStateInterceptor.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/ClientEquandaStateInterceptor.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/ClientEquandaStateInterceptor.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -40,7 +40,7 @@
{
private static final long serialVersionUID = 4536126296845291076L;
- public static final ClientEquandaStateInterceptor singleton = new ClientEquandaStateInterceptor();
+ public static final ClientEquandaStateInterceptor SINGLETON = new ClientEquandaStateInterceptor();
public String getName()
{
@@ -63,6 +63,6 @@
Object readResolve()
throws ObjectStreamException
{
- return singleton;
+ return SINGLETON;
}
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/query/EquandaQueryImpl.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -25,6 +25,7 @@
package org.equanda.persistence.query;
import org.equanda.persistence.ObjectType;
+
import java.util.HashMap;
import java.util.Map;
@@ -59,14 +60,14 @@
init( queryString, -1, -1, countQueryString, new HashMap<String, Object>() );
}
- protected void init( String queryString, int maxResults, int firstResult,
- String countQueryString, Map<String, Object> parameters )
+ protected void init( String queryStr, int maxRes, int firstRes,
+ String countQueryStr, Map<String, Object> params )
{
- this.queryString = queryString;
- this.countQueryString = countQueryString;
- this.maxResults = maxResults;
- this.firstResult = firstResult;
- this.parameters = parameters;
+ this.queryString = queryStr;
+ this.countQueryString = countQueryStr;
+ this.maxResults = maxRes;
+ this.firstResult = firstRes;
+ this.parameters = params;
}
public String getQueryString()
@@ -79,13 +80,13 @@
return countQueryString;
}
- public EquandaQueryImpl setQueryString( String queryString )
+ public EquandaQueryImpl setQueryString( String queryStr )
{
- this.queryString = queryString;
+ this.queryString = queryStr;
return this;
}
- public EquandaQueryImpl setCountQueryString( String countQueryString )
+ public EquandaQueryImpl setCountQueryString( String countQueryStr )
{
this.countQueryString = countQueryString;
return this;
@@ -101,9 +102,9 @@
return maxResults;
}
- public EquandaQuery setMaxResults( int maxResults )
+ public EquandaQuery setMaxResults( int maxRes )
{
- this.maxResults = maxResults;
+ this.maxResults = maxRes;
return this;
}
@@ -112,9 +113,9 @@
return firstResult;
}
- public EquandaQuery setFirstResult( int firstResult )
+ public EquandaQuery setFirstResult( int firstRes )
{
- this.firstResult = firstResult;
+ this.firstResult = firstRes;
return this;
}
@@ -144,9 +145,9 @@
return typeFilter;
}
- public EquandaQuery setTypeFilter( ObjectType typeFilter )
+ public EquandaQuery setTypeFilter( ObjectType typeFilter_ )
{
- this.typeFilter = typeFilter;
+ this.typeFilter = typeFilter_;
return this;
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/ByteBuffer.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ByteBuffer.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ByteBuffer.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -224,4 +224,4 @@
}
buffer[ index ] = value;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ImageLoader.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,10 +24,9 @@
package org.equanda.util;
-import java.net.URL;
-import java.awt.Image;
-import java.awt.Toolkit;
+import java.awt.*;
import java.awt.image.ImageProducer;
+import java.net.URL;
/**
* ImageLoader can be used to load an image
@@ -73,4 +72,4 @@
}
return null;
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/Internationalize.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/Internationalize.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/Internationalize.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,9 +24,9 @@
package org.equanda.util;
+import java.util.Hashtable;
import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.Hashtable;
/**
* Internationalization support
@@ -177,6 +177,4 @@
if ( value.equals( "" ) ) value = stealth ? fullname : name;
return value;
}
-
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/SaveException.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,7 +24,10 @@
package org.equanda.util;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
import java.util.Date;
/**
@@ -131,4 +134,4 @@
System.err.println( "oops, can't write error message to file" );
}
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Builder.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Builder.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Builder.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,13 +24,15 @@
package org.equanda.util.barcode;
+import javolution.lang.TextBuilder;
import org.equanda.util.StringUtil;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Map;
-import javolution.lang.TextBuilder;
-
/**
* abstract class for building EAN 128 barcodes, you should use a renderer specific implementation
*
@@ -107,7 +109,7 @@
barcode.append( start );
charset = C; // begin is always at least two digits, so code C
- for ( int i = 0 ; i < parts.size() ; i++ )
+ for ( int i = 0; i < parts.size() ; i++ )
{
value = parts.get( i );
if ( value.length() > 0 && i != 0 ) barcode.append( fnc1 ); // end of code seperator
@@ -144,7 +146,7 @@
// check if we need to switch to charset C
// this should be done if we have four succesive digits, or two at the end
int j;
- for ( j = 1 ; j < value.length() && Character.isDigit( value.charAt( j ) ) ; j++ ) ;
+ for ( j = 1; j < value.length() && Character.isDigit( value.charAt( j ) ) ; j++ ) ;
if ( j >= 4 || ( j >= 2 && j == value.length() ) )
{
// switch character set, but make digit count even first
@@ -247,16 +249,15 @@
private boolean isCharset( int charset, char c )
{
- if ( charset == C && Character.isDigit( c ) ) return true;
- if ( charset == B && c >= 32 && c <= 127 ) return true;
- if ( charset == A && c >= 0 && c <= 95 ) return true;
- return false;
+ return ( charset == C && Character.isDigit( c ) ) ||
+ ( charset == B && c >= 32 && c <= 127 ) ||
+ ( charset == A && c >= 0 && c <= 95 );
}
/**
* following members and methods should be made concrete by the implementing class
* as they are dependent on the barcode renderer (most printers need different encodings
- *
+ * <p/>
* They should allow all types of renderers
*/
Modified: trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Iterator.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Iterator.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/barcode/EAN128Iterator.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -158,4 +158,4 @@
}
public void remove() { throw new UnsupportedOperationException(); }
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/BooleanExtension.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,7 +24,9 @@
package org.equanda.util.script;
-import murlen.util.fscript.*;
+import murlen.util.fscript.FSException;
+import murlen.util.fscript.FSFastExtension;
+import murlen.util.fscript.FSVarExtension;
/**
@@ -69,4 +71,4 @@
}
} );
}
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/DatabaseExtension.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,14 +24,14 @@
package org.equanda.util.script;
+import murlen.util.fscript.FSException;
+import murlen.util.fscript.FSUnsupportedException;
import org.equanda.util.StringUtil;
+import java.sql.*;
import java.util.ArrayList;
import java.util.Hashtable;
-import java.sql.*;
-import murlen.util.fscript.*;
-
/**
* DatabaseExtension, FScript extension for database access using
* SQL and JDBC
@@ -540,5 +540,4 @@
{
throw new FSUnsupportedException();
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/FScriptExtensionPool.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,7 +24,9 @@
package org.equanda.util.script;
-import murlen.util.fscript.*;
+import murlen.util.fscript.FSException;
+import murlen.util.fscript.FSExtension;
+import murlen.util.fscript.FSUnsupportedException;
import java.util.ArrayList;
@@ -139,5 +141,4 @@
{
extensions.add( ext );
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/script/StringExtension.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,9 +24,9 @@
package org.equanda.util.script;
-import org.equanda.util.StringUtil;
import javolution.lang.TextBuilder;
import murlen.util.fscript.*;
+import org.equanda.util.StringUtil;
import java.util.ArrayList;
import java.util.Arrays;
@@ -650,5 +650,4 @@
}
} );
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/DateField.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/DateField.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/DateField.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,8 +24,8 @@
package org.equanda.util.swing;
-import org.equanda.util.ImageLoader;
import com.toedter.calendar.JCalendar;
+import org.equanda.util.ImageLoader;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
@@ -131,7 +131,7 @@
jcalendar.setCalendar( calendar );
}
catch ( Exception ex )
- {}
+ {/*ignore*/}
finally
{
dateField.setText( df.print( calendar.getTimeInMillis() ) );
@@ -144,7 +144,7 @@
setLayout( new GridBagLayout() );
GridBagConstraints constr = new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0
, GridBagConstraints.WEST, GridBagConstraints.BOTH,
- new Insets( 0, 0, 0, 0 ), 0, 0 );
+ new Insets( 0, 0, 0, 0 ), 0, 0 );
constr.gridx = 1;
add( calendarButton, constr );
constr.gridx = 0;
@@ -156,11 +156,11 @@
public void center( JDialog dialog )
{
Point p = calendarButton.getLocationOnScreen();
- Dimension p_d = calendarButton.getSize();
+ Dimension pd = calendarButton.getSize();
Dimension d = dialog.getSize();
- int x = p.x - d.width + p_d.width;
- int y = p.y + p_d.height;
+ int x = p.x - d.width + pd.width;
+ int y = p.y + pd.height;
dialog.setLocation( x, y );
}
@@ -198,7 +198,7 @@
* it also sends a "daySelected" event in case the day was changed in order exit when a day is choosen
* the base class implementation only sends a "calendar" event for all modifications (including year,month)
*
- * @param evt
+ * @param evt event
*/
public void propertyChange( PropertyChangeEvent evt )
{
@@ -227,5 +227,4 @@
return verify( input );
}
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/JButtonNoFocus.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/JButtonNoFocus.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/JButtonNoFocus.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,7 +24,7 @@
package org.equanda.util.swing;
-import javax.swing.JButton;
+import javax.swing.*;
/**
* JButtonNoFocus is a variant of JButton which can not get the
@@ -35,10 +35,9 @@
public class JButtonNoFocus
extends JButton
{
-
public JButtonNoFocus() { super(); }
public JButtonNoFocus( String text ) { super( text ); }
public boolean isFocusTraversable() { return false; }
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextFieldSelectOnFocus.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextFieldSelectOnFocus.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextFieldSelectOnFocus.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -74,5 +74,5 @@
this.setSelectionEnd( this.getText().length() );
}
- public void focusLost( FocusEvent e ){}
+ public void focusLost( FocusEvent e ) {}
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextRestricted.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextRestricted.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/JTextRestricted.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,12 +24,14 @@
package org.equanda.util.swing;
-import javax.swing.*;
-import javax.swing.text.*;
-
import org.equanda.util.SaveException;
-import java.awt.Toolkit;
+import javax.swing.*;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.PlainDocument;
+import java.awt.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -237,19 +239,19 @@
public void setAllowedPattern( String value )
{
-// assure no pattern on failure or when none given
+ // assure no pattern on failure or when none given
pattern = null;
if ( value != null )
{
try
{
-// remove start and end slash when provided (cfr Perl syntax vs Java regex syntax)
+ // remove start and end slash when provided (cfr Perl syntax vs Java regex syntax)
int ln = value.length() - 1;
if ( ln > 0 && value.charAt( 0 ) == '/' && value.charAt( ln ) == '/' )
{
value = value.substring( 1, ln );
}
-// compile pattern
+ // compile pattern
pattern = Pattern.compile( value );
}
catch ( PatternSyntaxException pse )
@@ -270,10 +272,9 @@
remove( 0, getLength() ); // clear document string
}
catch ( BadLocationException e )
- {}
+ {/*ignored*/}
}
public String getHiddenText() { return hiddenString; }
}
-
-}
\ No newline at end of file
+}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButton.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButton.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButton.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -25,7 +25,6 @@
package org.equanda.util.swing;
import javax.swing.*;
-import java.awt.*;
/**
* ScreenButton used by the ScreenButtonContainer
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonContainer.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonContainer.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonContainer.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,9 +24,9 @@
package org.equanda.util.swing;
+import javolution.lang.TextBuilder;
import org.equanda.util.SaveException;
import org.equanda.util.StringSplitter;
-import javolution.lang.TextBuilder;
import javax.swing.*;
import java.awt.*;
@@ -103,7 +103,7 @@
/**
* Create new buttons, recycling existing buttons as much as possible
*
- * @param txtMap
+ * @param txtMap map with texts to put in buttons
*/
public void refresh( Map txtMap )
{
@@ -140,27 +140,26 @@
buttonPanel.remove( buttonPanel.getComponentCount() - 1 );
}
- Dimension size = new Dimension( 100,
- buttonPanel.getMinimumSize().height
- + scrollPane.getHorizontalScrollBar().getMinimumSize().height );
+ Dimension size = new Dimension( 100, buttonPanel.getMinimumSize().height
+ + scrollPane.getHorizontalScrollBar().getMinimumSize().height );
scrollPane.setMinimumSize( size );
scrollPane.setPreferredSize( size );
}
- public JComponent getButtonsPanel() {return scrollPane;}
+ public JComponent getButtonsPanel() { return scrollPane; }
/**
* Called when a new button has been selected
*
- * @param buttonIndex
+ * @param buttonIndex button index
*/
protected abstract void onButtonSelect( int buttonIndex );
/**
* Factory method used to create a new ScreenButton. May be overrided to provide custom buttons.
*
- * @param idx
- * @param text
+ * @param idx index
+ * @param text text
* @return a new ScreenButton
*/
protected ScreenButton newScreenButton( int idx, String text )
@@ -208,7 +207,7 @@
catch ( Exception ex )
{
SaveException.saveException( ex, "during ScreenButtonContainer.setText\n" + newTxt + '\n'
- + ex.getMessage() );
+ + ex.getMessage() );
}
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonListener.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonListener.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/ScreenButtonListener.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -36,5 +36,5 @@
*
* @param button that the action was performed on
*/
- public void onButtonSelect( ScreenButton button );
+ void onButtonSelect( ScreenButton button );
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/SwingUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/SwingUtil.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/SwingUtil.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -32,7 +32,7 @@
*
* @author NetRom team
*/
-public class SwingUtil
+public final class SwingUtil
{
private SwingUtil() {}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/layout/VerticalFlowLayout.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/layout/VerticalFlowLayout.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/layout/VerticalFlowLayout.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,7 +24,6 @@
package org.equanda.util.swing.layout;
-import java.lang.*;
import java.awt.*;
/**
@@ -211,9 +210,9 @@
return tarsiz;
}
- public void setVerticalFill( boolean vfill )
+ public void setVerticalFill( boolean verticalFill )
{
- this.vfill = vfill;
+ this.vfill = verticalFill;
}
public boolean getVerticalFill()
@@ -221,9 +220,9 @@
return vfill;
}
- public void setHorizontalFill( boolean hfill )
+ public void setHorizontalFill( boolean horizontalFill )
{
- this.hfill = hfill;
+ this.hfill = horizontalFill;
}
public boolean getHorizontalFill()
@@ -237,24 +236,24 @@
*
* @param target the container
* @param x the x coordinate of the area
- * @param y the y coordinate of the area
+ * @param basey the base y coordinate of the area
* @param width the width of the area
* @param height the height of the area
* @param first the first component of the container to place
* @param last the last component of the container to place
*/
- private void placethem( Container target, int x, int y, int width, int height,
+ private void placethem( Container target, int x, int basey, int width, int height,
int first, int last )
{
+ int y = basey;
int align = getAlignment();
//if ( align == this.TOP )
// y = 0;
- Insets insets = target.getInsets();
- if ( align == this.MIDDLE )
+ if ( align == MIDDLE )
{
y += height / 2;
}
- if ( align == this.BOTTOM )
+ if ( align == BOTTOM )
{
y += height;
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPalette.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPalette.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPalette.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,17 +24,18 @@
package org.equanda.util.swing.list;
+import org.equanda.util.swing.JSortedList;
+import org.equanda.util.swing.JSortedListModel;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
-import javax.swing.*;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import org.equanda.util.swing.JSortedList;
-import org.equanda.util.swing.JSortedListModel;
/**
* This components contains two list :
@@ -179,8 +180,7 @@
protected void buildLayout()
{
GridBagConstraints constr = new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0
- , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
- new Insets( 2, 2, 2, 2 ), 0, 0 );
+ , GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 2, 2, 2, 2 ), 0, 0 );
// add available list title
constr.gridy = 0; // row
constr.gridx = 0; // column
@@ -219,9 +219,7 @@
add( removeButton, constr );
}
- /**
- * Cell renderer
- */
+ /** Cell renderer */
private class ListPaletteCellRenderer
extends JLabel
implements ListCellRenderer
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPaletteTranslator.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPaletteTranslator.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/list/ListPaletteTranslator.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -1,3 +1,27 @@
+/**
+ * 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.swing.list;
/**
@@ -7,14 +31,13 @@
*/
public interface ListPaletteTranslator<ELEMENT>
{
+ String getAvailableListTitle();
- public String getAvailableListTitle();
+ String getAssignedListTitle();
- public String getAssignedListTitle();
+ String getAddButtonLabel();
- public String getAddButtonLabel();
+ String getRemoveButtonLabel();
- public String getRemoveButtonLabel();
-
- public String getElementDisplayValue( ELEMENT element );
+ String getElementDisplayValue( ELEMENT element );
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/swing/tree/IconNodeRenderer.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/swing/tree/IconNodeRenderer.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/swing/tree/IconNodeRenderer.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -24,10 +24,10 @@
package org.equanda.util.swing.tree;
-import java.util.*;
+import javax.swing.*;
+import javax.swing.tree.DefaultTreeCellRenderer;
import java.awt.*;
-import javax.swing.*;
-import javax.swing.tree.*;
+import java.util.Map;
/**
Modified: trunk/equanda-util/src/main/java/org/equanda/util/ymport/ImportUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ymport/ImportUtil.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ymport/ImportUtil.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -47,8 +47,10 @@
* @author NetRom team
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class ImportUtil
+public final class ImportUtil
{
+ private ImportUtil() {}
+
/**
* sends strings to the import servlet
*
@@ -134,7 +136,7 @@
httpConn.executeMethod( post );
responseBody = post.getResponseBodyAsString();
post.releaseConnection();
-
+
return responseBody.startsWith( "OK" ) ? null : responseBody;
}
@@ -173,15 +175,16 @@
*/
public static String quote( String in )
{
+ String calc = in;
StringBuilder res = new StringBuilder( "\"" );
int pos;
- while ( ( pos = in.indexOf( '\"' ) ) >= 0 )
+ while ( ( pos = calc.indexOf( '\"' ) ) >= 0 )
{
- res.append( in.substring( 0, pos ) );
+ res.append( calc.substring( 0, pos ) );
res.append( "\"\"" );
- in = in.substring( pos + 1 );
+ calc = calc.substring( pos + 1 );
}
- res.append( in );
+ res.append( calc );
res.append( '\"' );
return res.toString();
}
Modified: trunk/equanda-util/src/main/java/org/equanda/util/ymport/LenientSslProtocolSocketFactory.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ymport/LenientSslProtocolSocketFactory.java 2008-12-03 12:57:46 UTC (rev 890)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ymport/LenientSslProtocolSocketFactory.java 2008-12-03 14:09:45 UTC (rev 891)
@@ -40,7 +40,7 @@
/**
* A ssl socket factory for commons-httpclient which accepts self-signed certificates.
* Needs to be registered before use
- *
+ * <p/>
* Protocol myhttps = new Protocol( "https", new LenientSslProtocolSocketFactory(), 443 );
* Protocol.registerProtocol( "https", myhttps );
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 12:57:50
|
Revision: 890
http://equanda.svn.sourceforge.net/equanda/?rev=890&view=rev
Author: triathlon98
Date: 2008-12-03 12:57:46 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-287 documentation improvements
Modified Paths:
--------------
trunk/src/site/wiki/index.wiki
Modified: trunk/src/site/wiki/index.wiki
===================================================================
--- trunk/src/site/wiki/index.wiki 2008-12-03 12:55:58 UTC (rev 889)
+++ trunk/src/site/wiki/index.wiki 2008-12-03 12:57:46 UTC (rev 890)
@@ -100,7 +100,7 @@
It is possible to generate code which can be used to import data from a CVS-like text file.
-[More details about the generated import data.|equanda-generate/templates/import.html]
+[More details about the generated import data.|templates/import.html]
h3. ddltool
@@ -122,7 +122,7 @@
- [generate|generate.html] : module which handles the code generation, processing the domain model and contains the templates.
- maven-plugin : maven plugin which allows the generation to be done as part of a maven build cycle, but also for editing the translations and doing a database update
- [tapestry5|equanda-tapestry5/index.html] : collection of tapestry5 components which can also be used outside of equanda applications
-- [t5gui|t5gui.wiki] : collection of tapestry5 components which are specific for equanda generated applications
+- [t5gui|t5gui.html] : collection of tapestry5 components which are specific for equanda generated applications
- tool : tool provided for import, export, remote printing of reports
- util : contains several utility classes containing (amongst others) ean128 barcode support, [FScript|http://fscript.sf.net/] extensions, useful Swing classes
- test : this module is used to do integration testing. It is only included when the "-Dfulltest" switch is used in maven.
@@ -147,5 +147,5 @@
h2. Thanks to
- Equanda is based on [Uni-d|http://sf.net/projects/uni-d], for which the development was sponsored by [CAB-software|http://www.cab-software.be/]. The principles have proven themselves there for the implementation of [IC-trace|http://ic-trace.org].
-- The development is supported by [synergetics|http://www.synergetics.be/] where equanda is used for the development of the competency analyzer.
+- The development is supported by [synergetics|http://www.synergetics.be/] where equanda is used for the development of the competency analyzer and employability portfolio.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bri...@us...> - 2008-12-03 12:56:03
|
Revision: 889
http://equanda.svn.sourceforge.net/equanda/?rev=889&view=rev
Author: brian_reynolds
Date: 2008-12-03 12:55:58 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
Refactor pages to implement the AuthAndConfigPages interface
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
Added Paths:
-----------
trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigPages.java
Added: trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigPages.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigPages.java (rev 0)
+++ trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigPages.java 2008-12-03 12:55:58 UTC (rev 889)
@@ -0,0 +1,54 @@
+/**
+ * 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.client;
+
+/**
+ * Configuration for a specific page.
+ *
+ * @author <a href="mailto:bri...@ri...">Brian Reynolds</a>
+ */
+public interface AuthAndConfigPages
+{
+ /**
+ * Set whether this page has GUI Administration rights
+ *
+ * @param isGuiAdmin The value to set the GUI Admin flag to
+ */
+ void setIsGuiAdmin( boolean isGuiAdmin );
+
+ /**
+ * Set the role being used
+ *
+ * @param roleName The name of the role to be used, or null if no role selected
+ */
+ void setRoleName( String roleName );
+
+ /**
+ * Set the return page which is displayed when OK/Cancel is selected
+ *
+ * @param page The page to be set as the return page.
+ */
+ void setReturnPage( Object page );
+}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.java.vm 2008-12-03 11:49:04 UTC (rev 888)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.java.vm 2008-12-03 12:55:58 UTC (rev 889)
@@ -43,7 +43,6 @@
import org.apache.log4j.Logger;
import org.apache.tapestry5.*;
-import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.ioc.annotations.Inject;
@@ -53,17 +52,16 @@
import org.equanda.t5gui.services.LoginInfoService;
import org.equanda.auth.ParsedAuthAndConfigProvider;
import org.equanda.client.AuthAndConfigProvider;
+import org.equanda.client.AuthAndConfigPages;
$!{engine.getTemplateConfig("page-class-annotation" )}
@IncludeJavaScriptLibrary( { "classpath:/org/equanda/tapestry5/resources/authandconfig.js" } )
-public class AuthAndConfigTables
+public class AuthAndConfigTables
+ implements AuthAndConfigPages
{
private static final Logger logger = Logger.getLogger( AuthAndConfigTables.class );
private static final String noRoleIndicator = "__no_role__";
- @Environmental
- private ValidationTracker validationTracker;
-
@Inject
private LoginInfoService loginInfoService;
@@ -79,13 +77,21 @@
{
return roleName;
}
-
+ public void setRoleName( String roleName )
+ {
+ this.roleName = roleName;
+ }
+
@Persist
private boolean isGuiAdmin;
public boolean getIsGuiAdmin()
{
return isGuiAdmin;
}
+ public void setIsGuiAdmin( boolean isGuiAdmin )
+ {
+ this.isGuiAdmin = isGuiAdmin;
+ }
private boolean writeAllowed;
public boolean getWriteAllowed()
@@ -108,8 +114,8 @@
public void initPage( String roleName, boolean isGuiAdmin )
{
- this.roleName = roleName;
- this.isGuiAdmin = isGuiAdmin;
+ setRoleName( roleName );
+ setIsGuiAdmin( isGuiAdmin );
}
#foreach( $table in $dm.RootTables )
#set ($readBox="${table.Name}_readCheck")
@@ -280,23 +286,16 @@
{
if( context.length == 3 )
{
- Component page = source.getPage( context[0] + "/AuthAndConfig" );
+ AuthAndConfigPages page = (AuthAndConfigPages)source.getPage( context[0] + "/AuthAndConfig" );
String roleName = (String)context[1];
String isGuiAdmin = (String)context[2];
try
{
- Class pageClass = page.getClass();
-
- java.lang.reflect.Method m1 = pageClass.getMethod( "setIsGuiAdmin", new Class[] { boolean.class } );
- m1.invoke( page, isGuiAdmin.equals("off") ? false : true );
-
- java.lang.reflect.Method m2 = pageClass.getMethod( "setRoleName", new Class[] { String.class } );
- m2.invoke( page, roleName.equals(noRoleIndicator) ? null : roleName );
-
- java.lang.reflect.Method m3 = pageClass.getMethod( "setReturnPage", new Class[] { Object.class } );
- m3.invoke( page, resources.getPage() );
+ page.setIsGuiAdmin( isGuiAdmin.equals("off") ? false : true );
+ page.setRoleName( roleName.equals(noRoleIndicator) ? null : roleName );
+ page.setReturnPage( resources.getPage() );
}
catch( Exception e )
{
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-03 11:49:04 UTC (rev 888)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm 2008-12-03 12:55:58 UTC (rev 889)
@@ -50,6 +50,7 @@
import org.apache.tapestry5.annotations.Environmental;
import org.equanda.auth.ParsedAuthAndConfigProvider;
import org.equanda.client.AuthAndConfigProvider;
+import org.equanda.client.AuthAndConfigPages;
import org.equanda.client.LoginInfo;
import org.equanda.persistence.*;
import org.equanda.t5gui.services.LoginInfoService;
@@ -58,6 +59,7 @@
$!{engine.getTemplateConfig("page-class-annotation" )}
@IncludeJavaScriptLibrary( { "classpath:/org/equanda/tapestry5/resources/authandconfig.js" } )
public class AuthAndConfig
+ implements AuthAndConfigPages
{
private static final Logger logger = Logger.getLogger( AuthAndConfig.class );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 12:22:23
|
Revision: 886
http://equanda.svn.sourceforge.net/equanda/?rev=886&view=rev
Author: triathlon98
Date: 2008-12-03 11:38:48 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-287 documentation improvements
Modified Paths:
--------------
trunk/config/checkstyle.xml
trunk/pom.xml
trunk/src/site/wiki/gettingstarted.wiki
trunk/src/site/wiki/index.wiki
Added Paths:
-----------
trunk/src/site/wiki/tool/
trunk/src/site/wiki/tool/accordion.wiki
trunk/src/site/wiki/tool/breadcrumbs.wiki
trunk/src/site/wiki/tool/formactionlink.wiki
trunk/src/site/wiki/tool/formsupport.wiki
trunk/src/site/wiki/tool/formtraversal.wiki
trunk/src/site/wiki/tool/jspagedloop.wiki
trunk/src/site/wiki/tool/manifest.wiki
trunk/src/site/wiki/tool/script.wiki
trunk/src/site/wiki/tool/tabs.wiki
trunk/src/site/wiki/tool/truncate.wiki
trunk/src/site/wiki/tool/validationtrackerdelegate.wiki
trunk/src/site/wiki/tools.wiki
Removed Paths:
-------------
trunk/equanda-tapestry5/src/site/wiki/accordion.wiki
trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki
trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki
trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki
trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki
trunk/equanda-tapestry5/src/site/wiki/manifest.wiki
trunk/equanda-tapestry5/src/site/wiki/script.wiki
trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
trunk/equanda-tapestry5/src/site/wiki/truncate.wiki
trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki
Modified: trunk/config/checkstyle.xml
===================================================================
--- trunk/config/checkstyle.xml 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/config/checkstyle.xml 2008-12-03 11:38:48 UTC (rev 886)
@@ -102,12 +102,14 @@
<property name="severity" value="info"/>
<property name="max" value="120"/>
</module>
+ <!--
<module name="FileLength">
<property name="severity" value="info"/>
</module>
<module name="MethodLength">
<property name="severity" value="info"/>
</module>
+ -->
<module name="ParameterNumber">
<property name="severity" value="info"/>
</module>
Deleted: trunk/equanda-tapestry5/src/site/wiki/accordion.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/accordion.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/accordion.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,70 +0,0 @@
-h1. Accordion
-
-An accordion component integrates nicely in tapestry.
-
-You have to pass the title and content panes as parameters to the accordion component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
-Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
-The currently selected pane is remembered between requests.
-- For the *Accordion* component this is done via a cookie that is identified by the component's id. This implies that accordion components with the same id on different pages will share this cookie. If this is not wanted than each accordion component should get a unique id, even if they are on different page, or use MemAccordion.
-{private}
-- For the *MemAccordion* component the state is persisted in the session and updated using an ajax request when you change tab.
-
-{private}
-
-{code}
- <span t:type="equanda/Accordion" t:id="accordion">
- <t:parameter name="title1">First title</t:parameter>
- <t:parameter name="content1">
- <p>This is the content for the first pane</p>
- <p>With some more text</p>
- </t:parameter>
- <t:parameter name="title2">Another title pane</t:parameter>
- <t:parameter name="content2">
- <p>With even more content</p>
- </t:parameter>
- <t:parameter name="title3">Latin text</t:parameter>
- <t:parameter name="content3">
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
- <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
- </t:parameter>
- </span>
-{code}
-
-The component automatically handles the hiding of all (except one) panel at the start, and making sure the correct pane is selected when the title is clicked on.
-
-How the accordion is displayed is handled using CSS. The classes which are used depend on the accordion component id. This also assures it will work when there are several accordion components on a page (just assure they have a different id).
-
-{code}
-.accordion_tit {
- background-color: lightgray;
- color: black;
- height: 15px;
- font-weight: normal;
- padding-left: 5px;
- padding-top: 3px;
- padding-bottom: 3px;
- cursor: pointer;
-}
-
-.accordion_tit a:link,
-.accordion_tit a:visited,
-.accordion_tit a:active,
-.accordion_tit a:hover {
- color: black;
- text-decoration: none;
-}
-
-.accordion_atit {
- font-weight: bold;
-}
-
-.accordion_ct {
- padding-top: 10px;
- padding-bottom: 10px;
- padding-left: 10px;
- padding-right: 2px;
- background-color: beige;
- overflow: auto;
- height: 200px;
-}
-{code}
Deleted: trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,49 +0,0 @@
-h1. Breadcrumbs
-
-The breadcrumbs components displays a list of links that have been visited as the user navigates through the tapestry pages. The user can select a previously visited crumb which will take them back to that page without losing any of their session information. When moving to a crumb, this will also reset the breadcrumbs to the state at the time the page was visited.
-
-{code}
- <t:type="equanda/Breadcrumb" t:id="breadcrumb"/>
-{code}
-
-As the user navigates through the pages, the page they are coming from is appended to the end of the breadcrumbs (done by the application code). The breadcrumb name appended is the page title.
-Certain links should clear the breadcrumbs component when clicked. A variant of the pagelink component which has this behaviour should be provided.
-
-*Session retrieval*
-As the list of breadcrumbs grows, it should be possible to select any of the crumbs. When this happens, the current breadcrumb list should be shortened to indicate that the current page is the last crumb in the list. Also, the current state of this page (and the entire web session) should be as it was when the user left it.
-
-To support the latter, a conversation ID must be added as a query on the URL. E.g
-{code}
-http://localhost:8080/eportfolio-dp/assertionedit/srX8M5rTTo1RRn?cid=00112233445566
-{code}
-This will be a 14-digit code (UOID can be used). When a new page is selected, the existing session is serialized (using JBoss serialization library) and added to the EquandaNavigation table. This session can then be retrieved once the CID is known.
-
-h2. Implementation
-
-h3. BreadCrumbs Component
-
-A new BreadCrumbs component will be created. This will store the state in a ASO (application state object).
-This ASO should provide at least the following methods :
-- clear
-- add page : add using a link (with correct handling of the conversation), title and context. The context is used to determine whether the most recent page from the breadcrumb should be replaced or not. This is for example useful when switching between different selector pages for a table.
-
-h3. Conversation filter
-
-The conversation filter serves two purposes.
-- assure the session state is restored when clinking a link in the breadcrumbs.
-- allow multi-tabbed use inside the application (and hopefully also correct back button handling).
-
-The principle is simple, the session state is stored in the EquandaNavigation table (see org.equanda.infrastructure.infrastructure.xml, currently commented).
-When a page is visited, if the conversion id is retrieved, the session state is restored based on the conversation id to assure correct session state.
-
-This should be implementable using a request filter.
-
-When a page request comes in, the conversation id is retrieved. This is done first by looking at the url, and if that fails the "Referer" header is examined to see if that contains a conversaton id.
-If a conversation id was found, the session state is replaced by the stored stated from the conversation.
-The conversation is then investigate to see if it was marked as "starting". In that case a new EquandaNavigation object is created, the session state copied into it and the "starting" state set. A http redirect is then returned with the requesting url with the id of the new navigation object as new location (302 status with "Location" header).
-
-On the outbound path of the page request, the session state should be stored in a new EquandaNavigation object (serialized using JBoss serialization) and the "starting" flag is cleared.
-
-For requests which are not page requests, an attempt should be made to figure out the conversation state from the request and referer url. If a conversation id is found, then the session should be replaced based on that.
-
-It will need to be verified that ajax requests will be fully functional when two conversations are ongoing in different tabs in the browser.
Deleted: trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,25 +0,0 @@
-h1. FormActionLink
-
-This is a component which looks and feels like a standard Tapestry [ActionLink|http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html]. However, this is supposed to be used inside a equanda/Form component and then assures that the form is submitted (and thus state saved) before actually processing the action.
-
-This component only works when embedded in a ["equanda/FormSupport"|formsupport.html] component which is correctly intergrated. Otherwise it does nothing.
-
-Simple example of use :
-{code}
-<t:form>
- <div t:id="formSupport">
-
- <t:errors/>
-
- <t:equanda.formactionlink t:id="DoSomething">Do something</t:equanda.formactionlink>
-
- </div>
-</t:form>
-{code}
-And in the code, just act as a normal actionlink :
-{code}
-Object onActionFromDoSomething()
-{
- // now something should be done :-)
-}
-{code}
Deleted: trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,29 +0,0 @@
-h1. FormSupport
-
-This component needs to be integrated in a form to allow the [FormActionLink|formactionlink.html] component to work.
-It needs to be integrated both in your template and some support code added in the page or component class which includes it.
-
-This handles the magic which assures the FormActionLinks actually work.
-
-How to include in the template:
-{code}
-<t:form>
- <div t:id="formSupport">
-
- <t:errors/>
-
- <!-- include your form content here -->
-
- </div>
-</t:form>
-{code}
-In the component of page class, the following needs to be put.
-{code}
-@Component
-private FormSupport formSupport;
-
-public Object onSubmit()
-{
- return formSupport.getLinkTarget();
-}
-{code}
Deleted: trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,54 +0,0 @@
-h1. FormTraversal
-
-This component is intended to give consistent user interface behaviour which allows easy and efficient form completion without using a mouse.
-It achieves this by
-- assuring focus starts in the first editable input element on the page
-- allow traversing the (useable) form elements using tab or enter
-- allow page submit by pressing ctrl-enter
-
-To use it, include the following snippet in your template (probably the layout).
-It is recommended to include this is late as possible in your layout to assure the focus is not changed by script code which is executed after this.
-
-{code}
-<span t:type="equanda/FormTraversal"/>
-{code}
-
-To assure the first item on the focus receives focus (as controlled by this component), you need to turn off the tapestry built-in autofocus behaviour.
-This can be done by definint your form like this.
-{code}
-<t:form autofocus="false">
- ....
-</t:form>
-{code}
-
-The exact behaviour is influenced by the class on the elements.
-- defaultSubmit : the first element which can be found with this class is "clicked on" when the user presses ctrl-enter.
-- eqTravSkip : any element marked with this class never receives focus (skip)
-- eqTravFw : when going forward through the form using tab or enter, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
-- eqTravBw : when going backward through the form using shift-tab, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
-- eqTravMove : when an element is encountered with this class, then searching the next object continues at the object with the id given in the "href" attribute for the element (optionally preceded by a hash).
-- eqTravEnter : when a textarea is marked using this class, then enter jumps to a new line in the form.
-
-
-h2. ctrl-enter
-
-This key is used to submit the form. It looks for (the first) DOM object with class "defaultSubmit" and invokes that. You probably want to highlight that button.
-{code}
-.defaultSubmit {
- font-weight: bold;
-}
-{code}
-
-h2. enter
-
-To assure behaviour is consistent, pressing enter is (normally) considered the same as pressing tab.
-When inside a textarea (which is not marked with the class "eqTravEnter"), the user should press shift-enter to go to a new line.
-
-Differences with tab behaviour are
-- shift-enter does not move backwards
-- when pressing enter on an element marked with the class "defaultButton" then that element is "clicked on".
-- when pressing enter in a textarea, focus is still moved to the next element, except when the element is marked using the "eqTravEnter" class.
-
-h2. tab
-
-This moves forward or backward through the page. It only considers visible, enabled links, buttons and form elements, with the extra handling based on the classes as mentioned above.
\ No newline at end of file
Deleted: trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,28 +0,0 @@
-h1. Tabs
-
-JSPagedLoop component loops an iterable list of values and allows you to immediately jump to a particular page index within the overall data set without page submit.
-The component also allows you to add hidden items which can be displayed by clickin the "Add" link (again, without form submit).
-
-Parameters of the component :
-- clientId : the client id.
-- source : defines the collection of values for the loop to iterate over.
-- value : the current value.
-- volatile : same as standard Loop component.
-- index : the index into the source items.
-- elementName : The element to render. If not null, then the loop will render the indicated element around its body (on each pass through the loop). The default is derived from the component template.
-- rowsPerPage : the number of rows of data displayed on each page.
-- additionalRowCount : additional rows which can by dynamically added by Java Script.
-- addRowLinkTitle : title of the "Add" link.
-- objectCreatorDelegate : instance of _org.equanda.tapestry5.base.ObjectCreatorDelegate_ which allows to create new object and add it to the collection.
-
-To component can be passed set of block parameters: "empty" and "bottomBlock". "empty" block will be displayed when value collection is empty. "bottomBlock" will be displayed instead of the Java Script "Add" link when all additional rows are visible.
-
-{code}
-<div t:id="pagedLoop" t:type="equanda/JSPagedLoop" source="1..10" value="current" volatile="true" index="index" rowsPerPage="2" additionalRowCount="2" addRowLinkTitle="Add" objectCreatorDelegate="prop:this">
- <t:parameter name="empty"></t:parameter>
- <t:parameter name="bottomBlock">
- <t:equanda.formactionlink t:id="Add">Add</t:equanda.formactionlink>
- </t:parameter>
- <p>Current loop value is: ${current}</p>
-</div>
-{code}
\ No newline at end of file
Deleted: trunk/equanda-tapestry5/src/site/wiki/manifest.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/manifest.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/manifest.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,49 +0,0 @@
-h1. manifest binding prefix
-
-This binding allows you to include values from the manifest file. It will search through all manifest files, and on the first occurence of the key, the value will be returned.
-
-For example the following
-{code}
-${manifest:Build-Jdk}
-{code}
-will display the jdk which was used to build the jar containing the first manifest which contains the key.
-
-It is most practical for displaying version numbers etc. When the master pom for the project contains the following (here taken from equanda itself)
-{code}
-<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>create</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <doCheck>false</doCheck>
- <doUpdate>false</doUpdate>
- </configuration>
-</plugin>
-<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <equanda-build>${buildNumber}</equanda-build>
- <equanda-version>${project.version}</equanda-version>
- </manifestEntries>
- </archive>
- </configuration>
-</plugin>
-{code}
-The including
-{code}
-equanda version used ${manifest:equanda-version}, build ${manifest:equanda-build}
-{code}
-Will display the data which was included at compile time.
Deleted: trunk/equanda-tapestry5/src/site/wiki/script.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/script.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/script.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,36 +0,0 @@
-h1. equanda provided scripts
-
-h2. equanda.js
-
-Can be used by adding the following in your page class :
-{code}
-@Inject
-@Path( "classpath:/org/equanda/tapestry5/resources/equanda.js" )
-private Asset equandaJs;
-
-public Asset getEquandaJs() { return equandaJs; }
-{code}
-And using this in your template as (in the "head" section) :
-{code}
-<script src="${equandaJs}" language="javascript" type="text/javascript" />
-{code}
-
-It provides the following javascript functions
-
-h3. equandaWindowHeight()
-
-Get the browser window height (browser independent). This can for example be used to assure an [Accordion|accordion.html] fills the height of the window.
-
-h3. equandaWindowWidth()
-
-Get the browser window width (browser independent).
-
-h3. eqCC() (equandaConvertCase)
-
-This function allow automatic case conversion on a input field. Use by adding a onkeyup event (extra parameter) handler on the input component.
-{code}
-onkeyup="eqCC( this, 2);"
-{code}
-This function eight does expects the form element to work on, and a value indicating how to convert the case.
-- 1 : convert everything to lower case
-- 2 : convert everything to upper case
Deleted: trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,99 +0,0 @@
-h1. Tabs / MemTabs
-
-A tabs component which allows grouping objects in tab pages.
-
-You have to pass the title and content panes as parameters to the tabs component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
-You can specify a "titleIcon" parameter block which allows display a icon (or something else) on each tab.
-Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
-The currently selected pane is remembered between requests.
-- For the *Tabs* component this is done via a cookie that is identified by the component's id. This implies that tabs components with the same id on different pages will share this cookie. If this is not wanted than each tabs should get a unique id, even if they are on different page, or use MemTabs.
-- For the *MemTabs* component the state is persisted in the session and updated using an ajax request when you change tab.
-Using "contentAll" it is possible to have a banner displayed at the top of each tab page.
-
-The component has some built in features to function well in combination with the [FormTraversal|formtraversal.html] component. Specifically, moving between the fields on the form (using tab or enter) will also traverse to the next ir previous tb page when needed. You probably want to use CSS to hide the links which accomplish this.
-
-{code}
- <span t:type="equanda/Tabs" t:id="tabs" t:exclude="-1">
- <t:parameter name="title1">First title</t:parameter>
- <t:parameter name="content1">
- <p>This is the content for the first tab</p>
- <p>With some more text</p>
- </t:parameter>
- <t:parameter name="title2">Another title pane</t:parameter>
- <t:parameter name="content2">
- <p>With even more content</p>
- </t:parameter>
- <t:parameter name="title3">Latin text</t:parameter>
- <t:parameter name="content3">
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
- <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
- </t:parameter>
- <t:parameter name="title4">Excluded Title</t:parameter>
- <t:parameter name="content4">
- Excluded content
- </t:parameter>
- <t:parameter name="contentAll">
- <p>This banner should be repeated on all pages.</p>
- </t:parameter>
- </span>
-{code}
-
-How the tabs are displayed is handled using CSS. Below is an example of styling for the CSS.
-
-{code}
-.eqTabs {
- padding:0 3em;
- width:80%;
-}
-.eqTabsT {
- float:left;
- width:100%;
- margin: 0 0 0 0;
- list-style:none;
-}
-.eqTabsT li {
- float:left;
- padding:0 .5em 0 0;
-}
-.eqTabsT a:link,
-.eqTabsT a:visited,
-.eqTabsT a:active,
-.eqTabsT a:hover {
- width: 8em;
- padding: .2em 1em;
- display: block;
- background: lightgray;
- color: black;
- font-weight: bold;
- text-decoration: none;
-}
-.eqTabsT a:hover {
- background: gray;
- color: white;
-}
-.eqTabsP {
- border: solid 1px;
- clear: both;
- width: auto;
-}
-.eqTabsAll {
- border-bottom: solid 1px;
- background: beige;
- padding: 1em;
-}
-.eqTabsPC {
- background: white;
- padding: 1em;
-}
-a.eqTabsA:link,
-a.eqTabsA:visited,
-a.eqTabsA:active,
-a.eqTabsA:hover {
- background:black;
- color:white;
-}
-.eqTravFw,
-.eqTravBw {
- display: none;
-}
-{code}
Deleted: trunk/equanda-tapestry5/src/site/wiki/truncate.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/truncate.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/truncate.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,38 +0,0 @@
-h1. Truncate
-
-Component which allows truncating text to a maximum length. When the text is longer than the limitation, the full text is still displayed on mouse-over.
-
-You have to pass the text, length and suffix as parameters to the truncate component.
-
-{code}
-<span t:type="equanda/Truncate" t:length="20" t:suffix="..." t:text="literal:Very very long text very very long text very very long text"/>
-{code}
-
-Length and suffix are optional parameters. Default values are 30 and "...".
-These can be overwritten in your AppModule using code like
-{code}
- public static void contributeDefaults( MappedConfiguration<String, String> configuration )
- {
- configuration.add( "equanda.truncate.default.length", "30" );
- configuration.add( "equanda.truncate.default.suffix", "..." );
- }
-{code}
-
-
-Style can be overridden by declaring CSS class eqTrunCt.
-
-Default style is:
-
-{code}
-.eqTrunCt {
- position: absolute;
- padding: 5px;
- border: 1px solid black;
- font: normal 12px Verdana;
- line-height: 18px;
- z-index: 100;
- background-color: white;
- width: 250px;
- filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=140,Strength=4);
-}
-{code}
\ No newline at end of file
Deleted: trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -1,44 +0,0 @@
-h1. ValidationTrackerDelegate
-
-This is a component which can help you forward messages to the validation tracker.
-
-It can for example be used when you have a page (or it can be a component surrounding your form) where the onActivate or beginRender phases can produce messaged which need to be displayed in the validation tracker in your page.
-
-In your page you have to add the validationdelegate component to add allow the propagation of the messages
-{code}
-<t:form>
- <t:equanda.ValidationTrackerDelegate/>
- <t:errors/>
-
- .....
-
-</t:form>
-{code}
-
-Please note that the _ValidationTrackerDelegate_ should be before the _t:errors_ component.
-
-In your page or component, you do something like the following
-{code}
-@Inject
-private Environment environment;
-
-private String keepMessage;
-
-public void onActivate()
-{
- .... do whatever needs to be done
-
- .... if there is a problem do the following
- keepMessage = "error message";
-}
-
-void beginRender()
-{
- if ( null != keepMessage ) environment.push( MessageContainer.class, new MessageContainer( keepMessage ) );
-}
-
-void afterRender()
-{
- if ( null != keepMessage ) environment.pop( MessageContainer.class );
-}
-{code}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/pom.xml 2008-12-03 11:38:48 UTC (rev 886)
@@ -576,7 +576,7 @@
<properties>
<tapestry-release-version>5.0.17</tapestry-release-version>
<tapestry-commons-version>0.5.15</tapestry-commons-version>
- <staticwiki-release-version>0.9</staticwiki-release-version>
+ <staticwiki-release-version>0.9.1-SNAPSHOT</staticwiki-release-version>
</properties>
</project>
Modified: trunk/src/site/wiki/gettingstarted.wiki
===================================================================
--- trunk/src/site/wiki/gettingstarted.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/src/site/wiki/gettingstarted.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -10,7 +10,7 @@
This will create a mostly empty example project in the "example" subdirectory. The base package for the classes is "org.equanda.example".
-For more details about the archetype, [see here|equanda-maven-plugin/archetype.html].
+For more details about the archetype, [see here|plugin/archetype.html].
The archetype create a project with everything in place to start using equanda, bu also has some features that will be useful when your want to use more of the features.
Modified: trunk/src/site/wiki/index.wiki
===================================================================
--- trunk/src/site/wiki/index.wiki 2008-12-03 10:04:57 UTC (rev 885)
+++ trunk/src/site/wiki/index.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -46,7 +46,7 @@
The following aspects of the application can be generated.
-h3. [EJB3 persistence layer|equanda-generate/templates/ejb3.html]
+h3. EJB3 persistence layer
Domain model description options
- (multiple) inheritance
@@ -68,8 +68,10 @@
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).
-h3. [tapestry5 user interface|equanda-generate/templates/t5gui.html]
+[More details about the generated EJB3 persistence layer.|templates/ejb3.html]
+h3. tapestry5 user interface
+
- thin client, all browsers, no need for ActiveX activation of client side java
- easy/efficient keyboard navigation
- powerful automatic cross linking of records
@@ -86,33 +88,43 @@
(*) ^Items marked like this are available in the old tapestry4 version and will be available again for the tapestry5 version.^
-h3. [user management support|equanda-generate/templates/login.html]
+[More details about the generated tapestry5 user interface.|templates/t5gui.html]
+h3. user management support
+
equanda uses an internal mechanism to configure the very granular access rights for the user interface. This is based on user information in the database. This module allows you to generate a login module which prevents duplication of user information between the application and the JAAS module.
-h3. [import data|equanda-generate/templates/import.html]
+[More details about the generated user management support.|templates/login.html]
+h3. import data
+
It is possible to generate code which can be used to import data from a CVS-like text file.
-h3. [ddltool|equanda-generate/templates/ddltool.html]
+[More details about the generated import data.|equanda-generate/templates/import.html]
+h3. ddltool
+
This allows generation of a tool which handles database update (and optionally partial cleanup).
-h3. [domain model documentation|equanda-generate/templates/docs.html]
+[More details about the generated ddltool.|templates/ddltool.html]
+h3. domain model documentation
+
Documentation for the domain model can be generated. This includes html documentation, a Freemind mindmap and owl.
+[More details about the generated domain model documentation.|templates/docs.html]
+
h2. equanda modules
equanda contains several modules.
-- [client|equanda-client/index.html] : client side code. This module needs to be included by the client components for equanda applications.
-- [server|equanda-server/index.html] : server side code which is needed for the equanda framework
-- [generate|equanda-generate/index.html] : module which handles the code generation, processing the domain model and contains the templates.
-- [maven-plugin|equanda-maven-plugin/index.html] : maven plugin which allows the generation to be done as part of a maven build cycle, but also for editing the translations and doing a database update
+- client : client side code. This module needs to be included by the client components for equanda applications.
+- server : server side code which is needed for the equanda framework
+- [generate|generate.html] : module which handles the code generation, processing the domain model and contains the templates.
+- maven-plugin : maven plugin which allows the generation to be done as part of a maven build cycle, but also for editing the translations and doing a database update
- [tapestry5|equanda-tapestry5/index.html] : collection of tapestry5 components which can also be used outside of equanda applications
-- [t5gui|equanda-t5gui/index.html] : collection of tapestry5 components which are specific for equanda generated applications
-- [tool|equanda-tool/index.html] : tool provided for import, export, remote printing of reports
-- [util|equanda-util/index.html] : contains several utility classes containing (amongst others) ean128 barcode support, [FScript|http://fscript.sf.net/] extensions, useful Swing classes
+- [t5gui|t5gui.wiki] : collection of tapestry5 components which are specific for equanda generated applications
+- tool : tool provided for import, export, remote printing of reports
+- util : contains several utility classes containing (amongst others) ean128 barcode support, [FScript|http://fscript.sf.net/] extensions, useful Swing classes
- test : this module is used to do integration testing. It is only included when the "-Dfulltest" switch is used in maven.
Copied: trunk/src/site/wiki/tool/accordion.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/accordion.wiki)
===================================================================
--- trunk/src/site/wiki/tool/accordion.wiki (rev 0)
+++ trunk/src/site/wiki/tool/accordion.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,70 @@
+h1. Accordion
+
+An accordion component integrates nicely in tapestry.
+
+You have to pass the title and content panes as parameters to the accordion component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
+Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
+The currently selected pane is remembered between requests.
+- For the *Accordion* component this is done via a cookie that is identified by the component's id. This implies that accordion components with the same id on different pages will share this cookie. If this is not wanted than each accordion component should get a unique id, even if they are on different page, or use MemAccordion.
+{private}
+- For the *MemAccordion* component the state is persisted in the session and updated using an ajax request when you change tab.
+
+{private}
+
+{code}
+ <span t:type="equanda/Accordion" t:id="accordion">
+ <t:parameter name="title1">First title</t:parameter>
+ <t:parameter name="content1">
+ <p>This is the content for the first pane</p>
+ <p>With some more text</p>
+ </t:parameter>
+ <t:parameter name="title2">Another title pane</t:parameter>
+ <t:parameter name="content2">
+ <p>With even more content</p>
+ </t:parameter>
+ <t:parameter name="title3">Latin text</t:parameter>
+ <t:parameter name="content3">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
+ <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
+ </t:parameter>
+ </span>
+{code}
+
+The component automatically handles the hiding of all (except one) panel at the start, and making sure the correct pane is selected when the title is clicked on.
+
+How the accordion is displayed is handled using CSS. The classes which are used depend on the accordion component id. This also assures it will work when there are several accordion components on a page (just assure they have a different id).
+
+{code}
+.accordion_tit {
+ background-color: lightgray;
+ color: black;
+ height: 15px;
+ font-weight: normal;
+ padding-left: 5px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ cursor: pointer;
+}
+
+.accordion_tit a:link,
+.accordion_tit a:visited,
+.accordion_tit a:active,
+.accordion_tit a:hover {
+ color: black;
+ text-decoration: none;
+}
+
+.accordion_atit {
+ font-weight: bold;
+}
+
+.accordion_ct {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ padding-left: 10px;
+ padding-right: 2px;
+ background-color: beige;
+ overflow: auto;
+ height: 200px;
+}
+{code}
Copied: trunk/src/site/wiki/tool/breadcrumbs.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki)
===================================================================
--- trunk/src/site/wiki/tool/breadcrumbs.wiki (rev 0)
+++ trunk/src/site/wiki/tool/breadcrumbs.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,49 @@
+h1. Breadcrumbs
+
+The breadcrumbs components displays a list of links that have been visited as the user navigates through the tapestry pages. The user can select a previously visited crumb which will take them back to that page without losing any of their session information. When moving to a crumb, this will also reset the breadcrumbs to the state at the time the page was visited.
+
+{code}
+ <t:type="equanda/Breadcrumb" t:id="breadcrumb"/>
+{code}
+
+As the user navigates through the pages, the page they are coming from is appended to the end of the breadcrumbs (done by the application code). The breadcrumb name appended is the page title.
+Certain links should clear the breadcrumbs component when clicked. A variant of the pagelink component which has this behaviour should be provided.
+
+*Session retrieval*
+As the list of breadcrumbs grows, it should be possible to select any of the crumbs. When this happens, the current breadcrumb list should be shortened to indicate that the current page is the last crumb in the list. Also, the current state of this page (and the entire web session) should be as it was when the user left it.
+
+To support the latter, a conversation ID must be added as a query on the URL. E.g
+{code}
+http://localhost:8080/eportfolio-dp/assertionedit/srX8M5rTTo1RRn?cid=00112233445566
+{code}
+This will be a 14-digit code (UOID can be used). When a new page is selected, the existing session is serialized (using JBoss serialization library) and added to the EquandaNavigation table. This session can then be retrieved once the CID is known.
+
+h2. Implementation
+
+h3. BreadCrumbs Component
+
+A new BreadCrumbs component will be created. This will store the state in a ASO (application state object).
+This ASO should provide at least the following methods :
+- clear
+- add page : add using a link (with correct handling of the conversation), title and context. The context is used to determine whether the most recent page from the breadcrumb should be replaced or not. This is for example useful when switching between different selector pages for a table.
+
+h3. Conversation filter
+
+The conversation filter serves two purposes.
+- assure the session state is restored when clinking a link in the breadcrumbs.
+- allow multi-tabbed use inside the application (and hopefully also correct back button handling).
+
+The principle is simple, the session state is stored in the EquandaNavigation table (see org.equanda.infrastructure.infrastructure.xml, currently commented).
+When a page is visited, if the conversion id is retrieved, the session state is restored based on the conversation id to assure correct session state.
+
+This should be implementable using a request filter.
+
+When a page request comes in, the conversation id is retrieved. This is done first by looking at the url, and if that fails the "Referer" header is examined to see if that contains a conversaton id.
+If a conversation id was found, the session state is replaced by the stored stated from the conversation.
+The conversation is then investigate to see if it was marked as "starting". In that case a new EquandaNavigation object is created, the session state copied into it and the "starting" state set. A http redirect is then returned with the requesting url with the id of the new navigation object as new location (302 status with "Location" header).
+
+On the outbound path of the page request, the session state should be stored in a new EquandaNavigation object (serialized using JBoss serialization) and the "starting" flag is cleared.
+
+For requests which are not page requests, an attempt should be made to figure out the conversation state from the request and referer url. If a conversation id is found, then the session should be replaced based on that.
+
+It will need to be verified that ajax requests will be fully functional when two conversations are ongoing in different tabs in the browser.
Copied: trunk/src/site/wiki/tool/formactionlink.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki)
===================================================================
--- trunk/src/site/wiki/tool/formactionlink.wiki (rev 0)
+++ trunk/src/site/wiki/tool/formactionlink.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,25 @@
+h1. FormActionLink
+
+This is a component which looks and feels like a standard Tapestry [ActionLink|http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html]. However, this is supposed to be used inside a equanda/Form component and then assures that the form is submitted (and thus state saved) before actually processing the action.
+
+This component only works when embedded in a ["equanda/FormSupport"|formsupport.html] component which is correctly intergrated. Otherwise it does nothing.
+
+Simple example of use :
+{code}
+<t:form>
+ <div t:id="formSupport">
+
+ <t:errors/>
+
+ <t:equanda.formactionlink t:id="DoSomething">Do something</t:equanda.formactionlink>
+
+ </div>
+</t:form>
+{code}
+And in the code, just act as a normal actionlink :
+{code}
+Object onActionFromDoSomething()
+{
+ // now something should be done :-)
+}
+{code}
Copied: trunk/src/site/wiki/tool/formsupport.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki)
===================================================================
--- trunk/src/site/wiki/tool/formsupport.wiki (rev 0)
+++ trunk/src/site/wiki/tool/formsupport.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,29 @@
+h1. FormSupport
+
+This component needs to be integrated in a form to allow the [FormActionLink|formactionlink.html] component to work.
+It needs to be integrated both in your template and some support code added in the page or component class which includes it.
+
+This handles the magic which assures the FormActionLinks actually work.
+
+How to include in the template:
+{code}
+<t:form>
+ <div t:id="formSupport">
+
+ <t:errors/>
+
+ <!-- include your form content here -->
+
+ </div>
+</t:form>
+{code}
+In the component of page class, the following needs to be put.
+{code}
+@Component
+private FormSupport formSupport;
+
+public Object onSubmit()
+{
+ return formSupport.getLinkTarget();
+}
+{code}
Copied: trunk/src/site/wiki/tool/formtraversal.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki)
===================================================================
--- trunk/src/site/wiki/tool/formtraversal.wiki (rev 0)
+++ trunk/src/site/wiki/tool/formtraversal.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,54 @@
+h1. FormTraversal
+
+This component is intended to give consistent user interface behaviour which allows easy and efficient form completion without using a mouse.
+It achieves this by
+- assuring focus starts in the first editable input element on the page
+- allow traversing the (useable) form elements using tab or enter
+- allow page submit by pressing ctrl-enter
+
+To use it, include the following snippet in your template (probably the layout).
+It is recommended to include this is late as possible in your layout to assure the focus is not changed by script code which is executed after this.
+
+{code}
+<span t:type="equanda/FormTraversal"/>
+{code}
+
+To assure the first item on the focus receives focus (as controlled by this component), you need to turn off the tapestry built-in autofocus behaviour.
+This can be done by definint your form like this.
+{code}
+<t:form autofocus="false">
+ ....
+</t:form>
+{code}
+
+The exact behaviour is influenced by the class on the elements.
+- defaultSubmit : the first element which can be found with this class is "clicked on" when the user presses ctrl-enter.
+- eqTravSkip : any element marked with this class never receives focus (skip)
+- eqTravFw : when going forward through the form using tab or enter, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
+- eqTravBw : when going backward through the form using shift-tab, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
+- eqTravMove : when an element is encountered with this class, then searching the next object continues at the object with the id given in the "href" attribute for the element (optionally preceded by a hash).
+- eqTravEnter : when a textarea is marked using this class, then enter jumps to a new line in the form.
+
+
+h2. ctrl-enter
+
+This key is used to submit the form. It looks for (the first) DOM object with class "defaultSubmit" and invokes that. You probably want to highlight that button.
+{code}
+.defaultSubmit {
+ font-weight: bold;
+}
+{code}
+
+h2. enter
+
+To assure behaviour is consistent, pressing enter is (normally) considered the same as pressing tab.
+When inside a textarea (which is not marked with the class "eqTravEnter"), the user should press shift-enter to go to a new line.
+
+Differences with tab behaviour are
+- shift-enter does not move backwards
+- when pressing enter on an element marked with the class "defaultButton" then that element is "clicked on".
+- when pressing enter in a textarea, focus is still moved to the next element, except when the element is marked using the "eqTravEnter" class.
+
+h2. tab
+
+This moves forward or backward through the page. It only considers visible, enabled links, buttons and form elements, with the extra handling based on the classes as mentioned above.
\ No newline at end of file
Copied: trunk/src/site/wiki/tool/jspagedloop.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki)
===================================================================
--- trunk/src/site/wiki/tool/jspagedloop.wiki (rev 0)
+++ trunk/src/site/wiki/tool/jspagedloop.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,28 @@
+h1. Tabs
+
+JSPagedLoop component loops an iterable list of values and allows you to immediately jump to a particular page index within the overall data set without page submit.
+The component also allows you to add hidden items which can be displayed by clickin the "Add" link (again, without form submit).
+
+Parameters of the component :
+- clientId : the client id.
+- source : defines the collection of values for the loop to iterate over.
+- value : the current value.
+- volatile : same as standard Loop component.
+- index : the index into the source items.
+- elementName : The element to render. If not null, then the loop will render the indicated element around its body (on each pass through the loop). The default is derived from the component template.
+- rowsPerPage : the number of rows of data displayed on each page.
+- additionalRowCount : additional rows which can by dynamically added by Java Script.
+- addRowLinkTitle : title of the "Add" link.
+- objectCreatorDelegate : instance of _org.equanda.tapestry5.base.ObjectCreatorDelegate_ which allows to create new object and add it to the collection.
+
+To component can be passed set of block parameters: "empty" and "bottomBlock". "empty" block will be displayed when value collection is empty. "bottomBlock" will be displayed instead of the Java Script "Add" link when all additional rows are visible.
+
+{code}
+<div t:id="pagedLoop" t:type="equanda/JSPagedLoop" source="1..10" value="current" volatile="true" index="index" rowsPerPage="2" additionalRowCount="2" addRowLinkTitle="Add" objectCreatorDelegate="prop:this">
+ <t:parameter name="empty"></t:parameter>
+ <t:parameter name="bottomBlock">
+ <t:equanda.formactionlink t:id="Add">Add</t:equanda.formactionlink>
+ </t:parameter>
+ <p>Current loop value is: ${current}</p>
+</div>
+{code}
\ No newline at end of file
Copied: trunk/src/site/wiki/tool/manifest.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/manifest.wiki)
===================================================================
--- trunk/src/site/wiki/tool/manifest.wiki (rev 0)
+++ trunk/src/site/wiki/tool/manifest.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,49 @@
+h1. manifest binding prefix
+
+This binding allows you to include values from the manifest file. It will search through all manifest files, and on the first occurence of the key, the value will be returned.
+
+For example the following
+{code}
+${manifest:Build-Jdk}
+{code}
+will display the jdk which was used to build the jar containing the first manifest which contains the key.
+
+It is most practical for displaying version numbers etc. When the master pom for the project contains the following (here taken from equanda itself)
+{code}
+<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <doCheck>false</doCheck>
+ <doUpdate>false</doUpdate>
+ </configuration>
+</plugin>
+<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <equanda-build>${buildNumber}</equanda-build>
+ <equanda-version>${project.version}</equanda-version>
+ </manifestEntries>
+ </archive>
+ </configuration>
+</plugin>
+{code}
+The including
+{code}
+equanda version used ${manifest:equanda-version}, build ${manifest:equanda-build}
+{code}
+Will display the data which was included at compile time.
Copied: trunk/src/site/wiki/tool/script.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/script.wiki)
===================================================================
--- trunk/src/site/wiki/tool/script.wiki (rev 0)
+++ trunk/src/site/wiki/tool/script.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,36 @@
+h1. equanda provided scripts
+
+h2. equanda.js
+
+Can be used by adding the following in your page class :
+{code}
+@Inject
+@Path( "classpath:/org/equanda/tapestry5/resources/equanda.js" )
+private Asset equandaJs;
+
+public Asset getEquandaJs() { return equandaJs; }
+{code}
+And using this in your template as (in the "head" section) :
+{code}
+<script src="${equandaJs}" language="javascript" type="text/javascript" />
+{code}
+
+It provides the following javascript functions
+
+h3. equandaWindowHeight()
+
+Get the browser window height (browser independent). This can for example be used to assure an [Accordion|accordion.html] fills the height of the window.
+
+h3. equandaWindowWidth()
+
+Get the browser window width (browser independent).
+
+h3. eqCC() (equandaConvertCase)
+
+This function allow automatic case conversion on a input field. Use by adding a onkeyup event (extra parameter) handler on the input component.
+{code}
+onkeyup="eqCC( this, 2);"
+{code}
+This function eight does expects the form element to work on, and a value indicating how to convert the case.
+- 1 : convert everything to lower case
+- 2 : convert everything to upper case
Copied: trunk/src/site/wiki/tool/tabs.wiki (from rev 883, trunk/equanda-tapestry5/src/site/wiki/tabs.wiki)
===================================================================
--- trunk/src/site/wiki/tool/tabs.wiki (rev 0)
+++ trunk/src/site/wiki/tool/tabs.wiki 2008-12-03 11:38:48 UTC (rev 886)
@@ -0,0 +1,99 @@
+h1. Tabs / MemTabs
+
+A tabs component which allows grouping objects in tab pages.
+
+You have to pass the title and content panes as parameters to the tabs component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
+You can specify a "titleIcon" parameter block which allows display a icon (or something else) on each tab.
+Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
+The currently selected pane is remembered between requests.
+- For the *Tabs* component this is done via a cookie that is identified by the component's id. This implies that tabs components with the same id on different pages will share this cookie. If this is not wanted than each tabs should get a unique id, even if they are on different page, or use MemTabs.
+- For the *MemTabs* component the state is persisted in the session and updated using an ajax request when you change tab.
+Using "contentAll" it is possible to have a banner displayed at the top of each tab page.
+
+The component has some built in features to function well in combination with the [FormTraversal|formtraversal.html] component. Specifically, moving between the fields on the form (using tab or enter) will also traverse to the next ir previous tb page when needed. You probably want to use CSS to hide the links which accomplish this.
+
+{code}
+ <span t:type="equanda/Tabs" t:id="tabs" t:exclude="-1">
+ <t:parameter name="title1">First title</t:parameter>
+ <t:parameter name="content1">
+ <p>This is the content for the first tab</p>
+ <p>With some more text</p>
+ </t:parameter>
+ <t:parameter name="title2">Another title pane</t:parameter>
+ <t:parameter name="content2">
+ <p>With even more content</p>
+ </t:parameter>
+ <t:parameter name="title3">Latin text</t:parameter>
+ <t:parameter name="content3">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
+ <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
+ </t:parameter>
+ <t:parameter name="title4">Excluded Title</t:parameter>
+ <t:parameter name="content4">
+ Excluded content
+ </t:parameter>
+ <t:parameter name="contentAll">
+ <p>This banner should be repeated on all pages.</p>
+ </t:parameter>
+ </span>
+{code}
+
+How the tabs are displayed is handled using CSS....
[truncated message content] |
|
From: <tri...@us...> - 2008-12-03 11:51:03
|
Revision: 888
http://equanda.svn.sourceforge.net/equanda/?rev=888&view=rev
Author: triathlon98
Date: 2008-12-03 11:49:04 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-287 documentation improvements
Modified Paths:
--------------
trunk/equanda-tool/src/site/wiki/index.wiki
trunk/src/site/site.xml
Added Paths:
-----------
trunk/src/site/wiki/tool/ExportFileFormat.wiki
trunk/src/site/wiki/tool/ImportFileFormat.wiki
trunk/src/site/wiki/tool/ImportServlet.wiki
trunk/src/site/wiki/tool/export.wiki
trunk/src/site/wiki/tool/fscript.wiki
trunk/src/site/wiki/tool/import.wiki
trunk/src/site/wiki/tool/print.wiki
trunk/src/site/wiki/tool/tool.wiki
trunk/src/site/wiki/tool/translations.wiki
Removed Paths:
-------------
trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki
trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki
trunk/equanda-tool/src/site/wiki/ImportServlet.wiki
trunk/equanda-tool/src/site/wiki/export.wiki
trunk/equanda-tool/src/site/wiki/fscript.wiki
trunk/equanda-tool/src/site/wiki/import.wiki
trunk/equanda-tool/src/site/wiki/print.wiki
trunk/equanda-tool/src/site/wiki/tool.wiki
trunk/equanda-tool/src/site/wiki/translations.wiki
Deleted: trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,39 +0,0 @@
-h1. File format for export description
-
-This file format is used by the export tool and export classes.
-It allows you to describe which fields need to be exported from which table,
-and the order of the fields and the export filename.
-
-The file has the shape and form of a (case sensitive) .ini file.
-
-The sections in the file indicate the tables which can be exported.
-
-For each section you can specify the following :
-
-- file : name of the file in which the exported object is saved.
-- suppressHeaderLines : when "true" the header lines is not saved in the file.
-- suppressDuplicateLines : when "true" a line is only appended in the file if it was not yet present.
-- _number_ : field which needs exporting, count starts from 1. Needs to be consecutive.
-
-For the filename, you can use a field from the reference object in the filename.
-This is done using the ${_fieldname_} syntax.
-
-For the fields, a special syntax "FieldName$expression" can be used. In that case the given fieldname if used as field name, and the [FScript|fscript.html] expression is used to calculate the field value. If the special fieldname "NOQUOTES" is used, then the result string is not processed (quoted) before exporting. This can be useful when calculating the entire export line.
-
-Example
-{code}
-[WeightGroup]
-file=WG${Reference}.txt
-1=Reference
-2=LocalReference
-3=Client
-4=Date
-5=Today$datesys()
-
-[Weight]
-file=WG${Reference}.txt
-1=Reference
-2=Count
-3=WeightNet
-4=Sale
-{code}
Deleted: trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,124 +0,0 @@
-h1. Import file format
-
-This document describes the file format to import data into equanda applications.
-This file format applies both to the [ImportServlet] and to the [Import] tool.
-
-The equanda import file format is roughly based on CSV files.
-However, many extensions have been provided to make the import file self-contained,
-provide for powerful features like multiple fields and links,
-to allow data for different tables to be sent in one connection
-and that the table and field names can be specified.
-
-h2. General rules
-
-- Empty lines are discarded
-- Lines starting with a semicolon or hash are comments and are also discarded
-- Lines starting with a colon are directives.
-- All other lines are considered as data
-
-h2. File structure
-
-- The file can contain zero or more data blocks.
-- A data block starts with a table directive, followed by data lines
-
-h2. Table directives
-
-- A table directive starts with ":table:" followed by the (root) table name (possibly surrounded by whitespace, and optionally including a selector), followed by another semicolon and the list of field names which are included in the data lines.
-- The field names are separated by a comma.
-- Apart from the real field names, "UOID" may be used to indicate the uoid, and "equandaType" can be used to indicate the record type.
-- Whitespace around the fieldname is discarded.
-- Field names are case sensitive (exactly the same as the definition in equanda).
-- For linked fields, the field name has to either include the selector to select the linked record(s) or a list of fields (between square brackets) or both. When linking multiple fields which are specified using fields, the field names should be in double square brackets ("[[" and "]]", with no space in between).
-- Only root table names can be used. You have to use equandaType to distinguish between variants of a root type.
-
-Some example table directives :
-{code}
-:table:Company:equandaType,Reference,Name
-:table:Company/Company: Reference, Name, PersonName, Address, Zip, City, Country, VAT, Customer, Supplier
-:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo/EECNumber
-:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo[Activity,EECNumber,OfficialRegistrationNumber]
-{code}
-
-_NOTE_ for the selectors, you can only use those selectors which select only fields from the table itself.
-If the selector includes referenced fields from other tables, it cannot be used to select the records in the import file.
-
-h2. Data line structure
-
-- No data line may occur in the file before the first table directive.
-- Field values are comma separated
-- String field values are enclosed in double quotes. Any double quotes inside the field value have to be doubled.
-- When a string value is not quoted, all whitespace in it is discarded.
-- Inside a quoted string, quotes, newlines, carriage returns and tabs can be indicated with a backslash followed by a double quote, 'n', 'r', 't' respectively. Any backslashes which should be part of the actual value need to be doubled.
-- Numeric fields are included with a dot as decimal point.
-- Whitespace around the field values is discarded
-- Null can be represented by "null" (without quotes). To use the string value "null", the null has to be quoted.
-- Fields may be skipped (that is no value or just whitespace, but with sperating comma), in which case this is interpreted as if the field was not declared in the table directive. If no field values follow, then the commas may also be discarded.
-- Multiple fields which have more than one value need to have their values enclosed in square brackets (same rules for quoting, whitespace etc). Eg '["val", "bla" , "alb" ]'
-- Linked fields are indicated by the selector parameters (if more than one parameter, then the different parameters have to be in square brackets again).
-
-
-h2. Import / Update
-
-The import servlet / tool can be used both for importing and for updating data.
-
-When a record is specified, equanda uses the specified selector to check whether the record already exists.
-If it does, then the fields are updated, otherwise a new record is inserted.
-
-When no selector is specified, equanda tries to see whether the data line included a unique field.
-If it does, this field is used to check for existence of the record.
-When more than one unique field is included,
-it is not defined which field will be used first to try to select a matching record.
-
-
-h2. Linked records
-
-The data line can include linked records either using a selector, or by specifying the actual value.
-
-When using a selector name, the value is the list of parameters for the selector.
-If there is more than one parameter then this list needs to be enclosed in square brackets.
-If the field is single linked, and the selector returns more than one record, then the import fails.
-
-Alternatively, you may use a field list (optionally combined with a selector).
-This will create or update the record and link it.
-
-
-h2. Examples
-
-A couple of simple examples for some fictive tables (definition not included and may be different for each example).
-
-{code}
-:table: JustAString : Value
-Simple test
-{code}
-
-This will include the string "Simpletest" without space, as spaces are discarded when the value is not quoted.
-
-{code}
-:table:Address: Reference, Street, Location
-"addr1", "Mechelbaan", "Putte"
-:table:Person: Name, Address/Reference
-"Joachim", "addr1"
-{code}
-
-Simple example of a linked record.
-
-{code}
-:table:Person: Name, Address[Street, Location]
-"Joachim", ["Mechelbaan", "Putte"]
-{code}
-
-Simple example of a multiple linked record.
-
-{code}
-:table:Person: Name, Address[[Street, Location]]
-"Wim", [ ["Kerklaan", "Putte"], ["Heistraat", "Bree"] ]
-{code}
-
-Use of the automatic creation of linked records.
-
-{code}
-:table:Person: Name, Address[ Street, Location/Zip[Zip,City] ]
-"Joachim", [ "Mechelbaan", [ "2580", "Putte" ] ]
-{code}
-
-Advanced linked record with nesting and combined selector and fieldlist for "Location".
Deleted: trunk/equanda-tool/src/site/wiki/ImportServlet.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/ImportServlet.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/ImportServlet.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,74 +0,0 @@
-h1. Import servlet
-
-The actual data can be sent to the equanda generated application using a servlet. Alternatively a web page can be provided (and by default it is), where you can cut and past the import file.
-
-The servlet can be called with code like the following :
-
-{code}
-URLConnection cnx=url.openConnection();
-
-// Set connection parameters
-cnx.setDoInput(true);
-cnx.setDoOutput(true);
-cnx.setUseCaches(false);
-cnx.setRequestProperty("Content-Type", "text/plain");
-
-// write the request
-Writer out=new BufferedWriter(new OutputStreamWriter(cnx.getOutputStream()));
-// write the data
-out.flush();
-out.close();
-
-// now read the response
-BufferedInputStream in=new BufferedInputStream(cnx.getInputStream());
-// handle the reply
-in.close();
-{code}
-
-If the data file starts with "data=� then this is removed from the data (this is done to allow the data to come from a form).
-
-The servlet send a short replies with "OK" if the file was processed properly.
-If there was a problem during the import, the reply is "FAILED " followed by a human readable reason of failure.
-
-If your servlet is secured (it should be), then it is best to use the org.equanda.client.ImportClient class.
-This will handle the login both in case of BASIC and FORM based authentication.
-
-The actual servlet can be generated with a ant task like the following :
-
-{code}
- <equanda
- appdir="${rootdir}/build/om"
- definition="dm.xml"
- outputdir="${build.generate.dir}"
- package="test.ymport"
- template="import"
- generateAll="${equanda.generate-all}">
- <config name="extra">
- <attribute name="ejb-package" value="test"/>
- </config>
- </equanda>
-{code}
-
-Note that "import� is a reserved word in Java and thus cannot be used as package name.
-
-To use the servlet, a definition like the example which follows has to be added to your web.xml file in your web archive.
-
-{code}
- <servlet>
- <servlet-name>Import</servlet-name>
- <servlet-class>org.equanda.ymport.Servlet</servlet-class>
- <init-param>
- <param-name>DatabaseMap</param-name>
- <param-value>test.ymport.DatabaseMap</param-value>
- </init-param>
- </servlet>
-{code}
-
-Obviously, this servlet also has to be mapped to a URL, but that�s all there is to it.
-
-
-h2. Charset issues
-
-On the servlet connection, it is possible to indicate the character encoding which is used in the communication.
-This can be modified as needed on the client side to match the charset for the text file.
-
Deleted: trunk/equanda-tool/src/site/wiki/export.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/export.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/export.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,239 +0,0 @@
-h1. Export tool
-
-The export tool allows you to export data from a equanda generated application to text (ascii).
-Alternatively, the data which is exported can be processed using a script which then handles it further.
-This option is typically used to synchronize with another application
-(one-way synchronization, use the [Import] tool for the other direction).
-
-h2. General configuration
-
-The export program expects the name of the configuration .ini file as parameter.
-If this parameter is not given, a file called "export.ini" in the current directory is used.
-
-The export can be configured using a .ini file with the following base format :
-
-{code}
-[general]
-scanPeriod=30
-
-exportDirectory=c:\export
-exportInfo=exportInfo=org.ictrace.demo.maps.ExportMap
-exportIni=exportConfig.ini
-
-window=display
-
-server=192.168.0.252
-login=myname
-password=mypass
-{code}
-
-- scanPeriod : time in seconds between attempts to pick up files to import, default 120
-- exportDirectory : directory where the export files need to be written
-- window : indicates whether a window needs to be displayed or not (values "display" or "hidden")
-- exportInfo : full class name of the ExportInfo map needed for export
-- exportIni : defines the [ExportFileFormat] which should be used
-- server : name or ip address of server
-- login : login to connect to the equanda application
-- password : password to connect to the equanda application
-
-
-h2. What to export
-
-The .ini file also defines what to export.
-This is done by specifying the objects which need to be selected.
-For each object selected, you can have selections of secondary (related) objects which are also exported.
-After the export, the tool can automatically update one of the fields to mark that the export was succesful.
-
-For example
-{code}
-[object,1]
-
-selectorJndi=IC-trace/WeightGroupSelector
-selectorName=org.ictrace.client.WeightGroupSelector
-
-selectorName=ImportStatus
-selectorParamType1=String
-selectorParamValue1=Y
-
-setField1=ERPImportStatus
-setFieldType1=String
-setFieldValue1=D
-
-script=WeightGroup.esc
-
-[object,1,1]
-
-selectorJndi=IC-trace/WeightGroupTotalSelector
-selectorName=org.ictrace.client.WeightGroupTotalSelector
-
-selectorName=WeightGroup
-selectorParamType1=String
-selectorParamValue1=${Reference}
-
-script=WeightGroup.esc
-{code}
-
-This excerpt shows all the options.
-The first (and only) primary selector is indicated in the [object,1] section.
-The secondary selections for these are in the [object,1,X] sections, with "X" a number from one upwards.
-
-For each section, you can specify the JNDI name and classname for the bean to use.
-The classname should be without trailing "EJB" or "EJBHome".
-You can also specify the selector to be used, and the type and value for each paramater.
-For secondary objects, fields from the primary object can be used to as parameter value using the "${FieldName}" syntax.
-
-For each object, you can also optionally spacify fields which need to be set when the import was successful.
-You can also choose whether the export is to a file,
-or whether a user defined [FScript|fscript.html] script should handle the export (in which case the file is not generated).
-
-*Key Set Details*
-
-- selectorJndi : JNDI name whether the object which is selected can be found, normally a prefix followed by the table name.
-- selectorName : full name of the selector class (without trailing "EJB")
-
-- selectorName : the name of the selector to be used
-- selectorParamTypeX : type of the selector's Xth parameter, can be _String_, _int_, _double_, _boolean_, _Timestamp_, _Date_
-- selectorParamValueX : value of the selector's Xth parameter
-
-- setFieldX : name of the field to be set (after the object is exported)
-- setFieldTypeX : type of the field to be set, same choices as selectorParamType
-- setFieldValue1X : value for the field to be set
-
-- script : name of the script which is used to export the object
-
-_NOTE:_ All keys are _case sensitive_ !!!
-
-
-h2. Using scripts in export
-
-Like in [Import|import.html] you can also use scripts to export the data,
-possibly including the data directly into a different database.
-
-The program accepts [FScript|fscript.html] scripts to build the data to be exported.
-The script should have the following structure (example with some debug info) :
-
-{code}
-func primary(object prim)
- debug("primary called for "+prim)
- return TRUE
-endfunc
-
-func primary_done(object prim)
- debug("primary_done called for "+prim)
- display("importing "+prim)
- return TRUE
-endfunc
-
-func secondary(object prim, object sec)
- debug("secondary called for "+prim+":"+sec)
- return FALSE
-endfunc{code}
-
-The [FScript|fscript.html] extensions from the util module are available.
-
-The functions should return "TRUE" or "FALSE" depending on whether the export was successful or not.
-If the export was not successful, then the variables which need to be set are not modified.
-
-When you return "FALSE" for the primary object, then the secondary objects are not exported.
-When one of the secondary objects returned "FALSE", then the fields for the primary object are not set.
-
-If the primary and all the secondary objects have been successfully imported,
-then the "primary_done" function is called. This can be used for cleanup, or to mark that the export has finished.
-
-{private}
-old export.ini as example :
-[general]
-title=Export
-usePrefix=false
-window=display
-;window=hidden
-login=local
-password=local
-scanPeriod=10
-debug=true
-server=localhost
-port=8080
-protocol=http
-alertProxyName=org.ictrace.client.equandaAlertProxy
-
-[database]
-name1=IC-TRACE.FDB
-;driver1=sun.jdbc.odbc.JdbcOdbcDriver
-;location1=jdbc:odbc:CodeBase Datasource;database=c:\data\db
-driver1=org.firebirdsql.jdbc.FBDriver
-location1=jdbc:firebirdsql:localhost/3050:C:\data\ic-trace\IC-TRACE.FDB
-user1=sysdba
-password1=masterkey
-
-[config]
-AankoopbonPrefix=AANK-
-BestelbonPrefix=VERK-
-KlantPrefix=K-
-LeverancierPrefix=L-
-
-[settings]
-script1=company.isc
-server=127.0.0.1
-exportDirectory=c:\
-exportInfo=org.ictrace.tool.export.maps.ExportMap
-exportIni=exportConfig.ini
-
-[object,1]
-
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=testCompany
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=Something
-
-setField2=Phone
-setFieldType2=String
-setFieldValue2=123456
-
-[object,1,1]
-
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=${NameAlt}
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=SomethingElse
-
-old exportConfig.ini as example
-[WeightGroup]
-file=WG${Reference}.txt
-1=Reference
-2=LocalReference
-
-[Weight]
-file=WG${Reference}.txt
-1=Reference
-2=Count
-3=WeightNet
-4=Sale
-
-[WeightGroupTotal]
-file=WG${Reference}.txt
-1=UOID
-2=LineIdentifier
-3=WeightGroup
-4=WeightObtained
-5=CountObtained
-
-[Company]
-file=Company${Reference}.txt
-1=Name
-2=NameAlt
-3=PersonName
-4=TraceId
-5=Phone
-{private}
\ No newline at end of file
Deleted: trunk/equanda-tool/src/site/wiki/fscript.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/fscript.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/fscript.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,6 +0,0 @@
-h1. Fscript
-
-FScript is a very simple scripting language which is available on sourceforge,
-see http://fscript.sourceforge.net/index.html.
-
-~~Placeholder, should include details of all FScript related classes in util~~
Deleted: trunk/equanda-tool/src/site/wiki/import.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/import.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/import.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,150 +0,0 @@
-h1. Import tool
-
-This is a tool which can be used to easy importing data into a equanda application.
-The program scans a directory for import files to appear (very configurable) and imports them using [ImportServlet].
-There is special handling to allow errors to be caught and corrected.
-Alternatively, this program can also execute scripts which can be used to build the import file at runtime
-(thus allowing a direct link with JDBC data sources etc).
-This option is typically used to synchronize with another application
-(one-way synchronization, use the [Export] tool for the other direction).
-
-
-h2. Usage
-
-The import tool can either scan directories for import files to appear,
-or can run scripts which produce the import file (probably by reading data from a proprietary system).
-
-The file format for importing is [ImportFileFormat].
-
-
-h2. General configuration
-
-The tool (class org.equanda.tool.ymport.ImportClient) accepts one optional parameter,
-the name of an .ini file which is used for the configuration.
-If no parameter is given, the program tries to open "import.ini".
-
-The .ini file has the following format
-
-{code}
- [general]
- scanPeriod=30
- outputExtension=err
- window=display
- search=local
- importURL=http://192.168.0.252:8080/admin/import/import
-
- [mail]
- server=mail.paragon-software.ro
- port=110
- use...@pa...
- password=testtest
- directory=/data/
- acc...@pa...;kun...@ya...
- connectionTimeout=30
- socketTimeout=30
-
- [scan]
- dir1=c:\import
- input1=*.txt
- charset1=ISO-8859-1
- dir2=g:\import
- input2=*.import
- script2=import.isc
-
- [script]
- debug=false
- script1=weight.isc
- script2=article.isc
-
- [database]
- name1=vlees
- driver1=sun.jdbc.odbc.JdbcOdbcDriver
- location1=jdbc:odbc:CodeBase Datasource;database=C:\dbf\
- user1=
- password1=
-{code}
-
-This has the following meaning
-
-h3. general section
-- scanPeriod : time in seconds between attempts to pick up files to import or attempt to run the import scripts. Defaults to 60s.
-- outputExtension : extension for output (error) files. The extension of the input file is replaced, or the extension is added if the input file had no extension.
-- window : indicates whether a window needs to be displayed or not (values "display" or "hidden").
-- search : indicates whether the program should only scan in the scan directories, or also in subsidrectories. Possible values are: "deep" and "local".
-
-h3. mail section
-This allows mails to be read which can then be imported. The attachments will be placed in the chosen location for further processing (scanning). Only mails from the list of allowed senders are accepted (slight security measure as anyboy could send mails to the designated mailbox.
- {warning}
- Accepting data to be imported from mails is always a security risc as sender addresses are very easy to forge. Once somebody knows the mail address and sender address top use, they can inject and overwrite anything in the database.
- {warning}
-- _server_ : mail server to get mails from
-- _user_ : user to get mails for
-- _password_ : password for the user
-- _accept_ : senders for which the emails are accepted
-- _directory_ : location where the attachments need to be saved
-- _connectionTimeout_, _socketTimeout_ : timeouts for connection, in seconds, default is 30
-
-h3. scan section
-- This can contain the directories which have to be scanned for input files (scanX with X a number) and a regular expression (inputX) indicating the files which need to be imported (default is *), for the directory with the same number
-- It may also contain the charset to be used for the files from the matching directory. When charset is not set, the system default is used.
-- For each level, an import script file can be specified. The "build(string filename)" function is called in this script to allow conversion from other types of files.
-
-h3. script section
-- debug : can be "true" or "false". Normally the data which is built is immediately sent to the import servlet. However, when debug is "true", then the data is not imported but simply written to an output file in the current directory.
-- scriptX (with X a number) : name of a script file which builds the data to be imported.
-
-- database section
-- As with script and scan, the names need to end with a number to indicate what belongs together. Counting starts at one and should be continuous. The database section is only relevant for import scripts.
-- name : name for the database, as used in "Dbset(var[,name])"
-- driver : JDBC driver class
-- location : database url for connection with the database
-- user, password : username and password for the connection
-
-h3. config section
-- In the config section extra kay/value pairs can be put which can be retrieved in the scripts using "config(key)".
-
-
-h2. Program functioning
-
-The import itself starts by computing the name of the error file
-(the extension (everything after the last dot, if any) is replaced by "outputExtension").
-If the error file exists, the import file is skipped.
-It then tries to open the import file in read/write mode.
-If that fails, the file is skipped (it will be picked up again in the next scan).
-When the file is opened, the contents is sent to the import servlet.
-If the import was successful, then the input file is deleted.
-If the import failed, the return message from the servlet is written in the error file.
-
-
-h2. Script handling
-
-The program accepts [FScript|fscript.html] scripts to build the data to be imported.
-The script should have the following structure :
-
-{code}
-func build()
- # this functions is called to builds the import file
- # You have the following commands for this
- # table(selectorName, commaSeperatedFields)
- # field(data) : add a field value
- # line([string]) : next line or add line with given text
- # quote(string) : quote a string using single quotes, doubles the single quotes in the string
- # import() : import the current data, returns whther the import was succesful
- # (allows forcing import halfway through the script)
- # if references need storing,
- # use the "list" variable (of type "List")
-endfunc
-
-func onSuccess()
- # this function is called when the import was succesful
- # can be used to mark te data as imported
- # (again, referencing the contents of "list")
-endfunc
-
-func onError(string error)
- # this function is called if the import failed
- # the "list" data is still available
-endfunc
-{code}
-
-The [FScript|fscript.html] extensions from the util module are available.
Modified: trunk/equanda-tool/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/index.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/index.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,10 +1,7 @@
-h1. equanda-tool module
+h1. equanda-tool
-This module contains some tools which are useful for equanda generated applications.
-The following tools currently exist.
+The equanda-tool module contains some tools which are very handy in combinations with equanda applications.
-- [Import|import.html] : tool to import data based on a text file or a script.
-- [Export|export.html] : tool to export data into a text file or into a script.
-- [Print|print.html] : tool for automatically printing (scheduling) reports.
-- [Combined|tool.html] : tool for combining the tools above.
-- [Translations|translations.html] : tool for editing and manaing the translations file.
+For more information about the the contents of this module can be found on the [project site|http://equanda.org/].
+
+equanda is a tool which helps you to build enterprise grade (JEE based) applications with minimal effort. Through code generation, a useful and functional base skeleton is created from the domain model. This application can be customized and the customizations remain active when the domain model changes and the skeleton is regenerated. This way, the cost of maintaining an evolving application is reduced by eliminating repetitive coding and assuring a consistent code base and user interface.
Deleted: trunk/equanda-tool/src/site/wiki/print.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/print.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/print.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,25 +0,0 @@
-h1. Print tool
-
-.....
-
-{code}
-[general]
-title=Print
-usePrefix=false
-window=display
-;window=hidden
-login=local
-password=local
-scanPeriod=10
-debug=true
-server=localhost
-port=8080
-protocol=http
-alertProxyName=org.ictrace.client.equandaAlertProxy
-
-[settings]
-reportURL=report/report
-
-[scan]
-class1=org.ictrace.tool.report.ReportProviderImpl
-{code}
\ No newline at end of file
Deleted: trunk/equanda-tool/src/site/wiki/tool.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/tool.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/tool.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,107 +0,0 @@
-h1. Combined tool
-
-You can also run all the tools in one go. You then have one combined configuration file which configure the settings for each of the individual tools.
-
-{code}
-;;;;;;;;;;;;;;;;;;;;;;;;;; General Section ;;;;;;;;;;;;;;;;;;;;;;
-[general]
-title=Export-Import-Print
-usePrefix=true
-window=display
-;window=hidden
-login=local
-password=local
-scanPeriod=10
-debug=true
-server=localhost
-port=8080
-protocol=http
-alertProxyName=org.ictrace.client.equandaAlertProxy
-
-[database]
-name1=IC-TRACE.FDB
-;driver1=sun.jdbc.odbc.JdbcOdbcDriver
-;location1=jdbc:odbc:CodeBase Datasource;database=c:\data\db
-driver1=org.firebirdsql.jdbc.FBDriver
-location1=jdbc:firebirdsql:localhost/3050:C:\data\ic-trace\IC-TRACE.FDB
-user1=sysdba
-password1=masterkey
-
-[config]
-AankoopbonPrefix=AANK-
-BestelbonPrefix=VERK-
-KlantPrefix=K-
-LeverancierPrefix=L-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;; Print Section ;;;;;;;;;;;;;;;;;;;;;;;;
-[print,settings]
-scanPeriod=50
-reportURL=report/report
-
-[print,scan]
-class1=org.ictrace.tool.report.ReportProviderImpl
-
-;;;;;;;;;;;;;;;;;;;;;;;;;; Import Section ;;;;;;;;;;;;;;;;;;;;;;;
-[import,settings]
-scanPeriod=40
-outputExtension=err
-search=deep
-;search=local
-importURL=import/import
-
-[import,scan]
-dir1=/import
-input1=*.*
-charset1=ISO-8859-1
-;dir2=c:\ic-trace\
-;input2=*.import
-
-[import,mail]
-server=mail.paragon-software.ro
-port=110
-use...@pa...
-password=testtest
-directory=/data/
-acc...@pa...;kun...@ya...
-connectionTimeout=30
-socketTimeout=30
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;; Export Section ;;;;;;;;;;;;;;;;;;;;;;;
-[export,settings]
-script1=company.isc
-scanPeriod=30
-server=127.0.0.1
-exportDirectory=c:\
-exportInfo=org.ictrace.tool.export.maps.ExportMap
-exportIni=exportConfig.ini
-
-[export,object,1]
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=testCompany
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=Something
-
-setField2=Phone
-setFieldType2=String
-setFieldValue2=123456
-
-[export,object,1,1]
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=${NameAlt}
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=SomethingElse
-{code}
\ No newline at end of file
Deleted: trunk/equanda-tool/src/site/wiki/translations.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/translations.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/translations.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,27 +0,0 @@
-h1. Translations editor
-
-Though this tool is normally run using the maven plugin (which gets all the configuration from the pom), it is also possible to use the translations tool directly. In that case, you have to pass the ini file which contains the settngs.
-
-{code}
-[config]
-# the file to be edited
-target-file=/java/equanda/test/src/etc/site_tapestry/site.war/translations.txt
-# the lack of labels will be checked (and the table lines coloured) only for these languages
-verify-languages=en;fr;nl;ro
-# should the menus for importing from db description be available?
-show-db=true
-
-[gui]
-width=1000
-height=600
-
-# settings for the import of keys from xml descriptions of the database
-[equanda]
-appdir=/java/equanda/test/src/equanda/xejb
-definition=dm.xml
-import-db-keys-only=false
-infrastructure=true
-context=equanda-table
-# there may be some extra keys in the equanda-table context, not representing db items. Don't want to remove these when checking if items are still in the database
-key-prefixes-to-keep=
-{code}
\ No newline at end of file
Modified: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/src/site/site.xml 2008-12-03 11:49:04 UTC (rev 888)
@@ -64,6 +64,14 @@
<item name="Import" href="plugin/import.html"/>
</menu>
+ <menu name="tool">
+ <item name="Import" href="tool/import.html"/>
+ <item name="Export" href="tool/export.html"/>
+ <item name="Print" href="tool/print.html"/>
+ <item name="Combined" href="tool/tool.html"/>
+ <item name="Translations" href="tool/translations.html"/>
+ </menu>
+
<menu ref="modules" />
<menu ref="reports" />
</body>
Copied: trunk/src/site/wiki/tool/ExportFileFormat.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki)
===================================================================
--- trunk/src/site/wiki/tool/ExportFileFormat.wiki (rev 0)
+++ trunk/src/site/wiki/tool/ExportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,39 @@
+h1. File format for export description
+
+This file format is used by the export tool and export classes.
+It allows you to describe which fields need to be exported from which table,
+and the order of the fields and the export filename.
+
+The file has the shape and form of a (case sensitive) .ini file.
+
+The sections in the file indicate the tables which can be exported.
+
+For each section you can specify the following :
+
+- file : name of the file in which the exported object is saved.
+- suppressHeaderLines : when "true" the header lines is not saved in the file.
+- suppressDuplicateLines : when "true" a line is only appended in the file if it was not yet present.
+- _number_ : field which needs exporting, count starts from 1. Needs to be consecutive.
+
+For the filename, you can use a field from the reference object in the filename.
+This is done using the ${_fieldname_} syntax.
+
+For the fields, a special syntax "FieldName$expression" can be used. In that case the given fieldname if used as field name, and the [FScript|fscript.html] expression is used to calculate the field value. If the special fieldname "NOQUOTES" is used, then the result string is not processed (quoted) before exporting. This can be useful when calculating the entire export line.
+
+Example
+{code}
+[WeightGroup]
+file=WG${Reference}.txt
+1=Reference
+2=LocalReference
+3=Client
+4=Date
+5=Today$datesys()
+
+[Weight]
+file=WG${Reference}.txt
+1=Reference
+2=Count
+3=WeightNet
+4=Sale
+{code}
Copied: trunk/src/site/wiki/tool/ImportFileFormat.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki)
===================================================================
--- trunk/src/site/wiki/tool/ImportFileFormat.wiki (rev 0)
+++ trunk/src/site/wiki/tool/ImportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,124 @@
+h1. Import file format
+
+This document describes the file format to import data into equanda applications.
+This file format applies both to the [ImportServlet] and to the [Import] tool.
+
+The equanda import file format is roughly based on CSV files.
+However, many extensions have been provided to make the import file self-contained,
+provide for powerful features like multiple fields and links,
+to allow data for different tables to be sent in one connection
+and that the table and field names can be specified.
+
+h2. General rules
+
+- Empty lines are discarded
+- Lines starting with a semicolon or hash are comments and are also discarded
+- Lines starting with a colon are directives.
+- All other lines are considered as data
+
+h2. File structure
+
+- The file can contain zero or more data blocks.
+- A data block starts with a table directive, followed by data lines
+
+h2. Table directives
+
+- A table directive starts with ":table:" followed by the (root) table name (possibly surrounded by whitespace, and optionally including a selector), followed by another semicolon and the list of field names which are included in the data lines.
+- The field names are separated by a comma.
+- Apart from the real field names, "UOID" may be used to indicate the uoid, and "equandaType" can be used to indicate the record type.
+- Whitespace around the fieldname is discarded.
+- Field names are case sensitive (exactly the same as the definition in equanda).
+- For linked fields, the field name has to either include the selector to select the linked record(s) or a list of fields (between square brackets) or both. When linking multiple fields which are specified using fields, the field names should be in double square brackets ("[[" and "]]", with no space in between).
+- Only root table names can be used. You have to use equandaType to distinguish between variants of a root type.
+
+Some example table directives :
+{code}
+:table:Company:equandaType,Reference,Name
+:table:Company/Company: Reference, Name, PersonName, Address, Zip, City, Country, VAT, Customer, Supplier
+:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo/EECNumber
+:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo[Activity,EECNumber,OfficialRegistrationNumber]
+{code}
+
+_NOTE_ for the selectors, you can only use those selectors which select only fields from the table itself.
+If the selector includes referenced fields from other tables, it cannot be used to select the records in the import file.
+
+h2. Data line structure
+
+- No data line may occur in the file before the first table directive.
+- Field values are comma separated
+- String field values are enclosed in double quotes. Any double quotes inside the field value have to be doubled.
+- When a string value is not quoted, all whitespace in it is discarded.
+- Inside a quoted string, quotes, newlines, carriage returns and tabs can be indicated with a backslash followed by a double quote, 'n', 'r', 't' respectively. Any backslashes which should be part of the actual value need to be doubled.
+- Numeric fields are included with a dot as decimal point.
+- Whitespace around the field values is discarded
+- Null can be represented by "null" (without quotes). To use the string value "null", the null has to be quoted.
+- Fields may be skipped (that is no value or just whitespace, but with sperating comma), in which case this is interpreted as if the field was not declared in the table directive. If no field values follow, then the commas may also be discarded.
+- Multiple fields which have more than one value need to have their values enclosed in square brackets (same rules for quoting, whitespace etc). Eg '["val", "bla" , "alb" ]'
+- Linked fields are indicated by the selector parameters (if more than one parameter, then the different parameters have to be in square brackets again).
+
+
+h2. Import / Update
+
+The import servlet / tool can be used both for importing and for updating data.
+
+When a record is specified, equanda uses the specified selector to check whether the record already exists.
+If it does, then the fields are updated, otherwise a new record is inserted.
+
+When no selector is specified, equanda tries to see whether the data line included a unique field.
+If it does, this field is used to check for existence of the record.
+When more than one unique field is included,
+it is not defined which field will be used first to try to select a matching record.
+
+
+h2. Linked records
+
+The data line can include linked records either using a selector, or by specifying the actual value.
+
+When using a selector name, the value is the list of parameters for the selector.
+If there is more than one parameter then this list needs to be enclosed in square brackets.
+If the field is single linked, and the selector returns more than one record, then the import fails.
+
+Alternatively, you may use a field list (optionally combined with a selector).
+This will create or update the record and link it.
+
+
+h2. Examples
+
+A couple of simple examples for some fictive tables (definition not included and may be different for each example).
+
+{code}
+:table: JustAString : Value
+Simple test
+{code}
+
+This will include the string "Simpletest" without space, as spaces are discarded when the value is not quoted.
+
+{code}
+:table:Address: Reference, Street, Location
+"addr1", "Mechelbaan", "Putte"
+:table:Person: Name, Address/Reference
+"Joachim", "addr1"
+{code}
+
+Simple example of a linked record.
+
+{code}
+:table:Person: Name, Address[Street, Location]
+"Joachim", ["Mechelbaan", "Putte"]
+{code}
+
+Simple example of a multiple linked record.
+
+{code}
+:table:Person: Name, Address[[Street, Location]]
+"Wim", [ ["Kerklaan", "Putte"], ["Heistraat", "Bree"] ]
+{code}
+
+Use of the automatic creation of linked records.
+
+{code}
+:table:Person: Name, Address[ Street, Location/Zip[Zip,City] ]
+"Joachim", [ "Mechelbaan", [ "2580", "Putte" ] ]
+{code}
+
+Advanced linked record with nesting and combined selector and fieldlist for "Location".
Copied: trunk/src/site/wiki/tool/ImportServlet.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/ImportServlet.wiki)
===================================================================
--- trunk/src/site/wiki/tool/ImportServlet.wiki (rev 0)
+++ trunk/src/site/wiki/tool/ImportServlet.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,74 @@
+h1. Import servlet
+
+The actual data can be sent to the equanda generated application using a servlet. Alternatively a web page can be provided (and by default it is), where you can cut and past the import file.
+
+The servlet can be called with code like the following :
+
+{code}
+URLConnection cnx=url.openConnection();
+
+// Set connection parameters
+cnx.setDoInput(true);
+cnx.setDoOutput(true);
+cnx.setUseCaches(false);
+cnx.setRequestProperty("Content-Type", "text/plain");
+
+// write the request
+Writer out=new BufferedWriter(new OutputStreamWriter(cnx.getOutputStream()));
+// write the data
+out.flush();
+out.close();
+
+// now read the response
+BufferedInputStream in=new BufferedInputStream(cnx.getInputStream());
+// handle the reply
+in.close();
+{code}
+
+If the data file starts with "data=� then this is removed from the data (this is done to allow the data to come from a form).
+
+The servlet send a short replies with "OK" if the file was processed properly.
+If there was a problem during the import, the reply is "FAILED " followed by a human readable reason of failure.
+
+If your servlet is secured (it should be), then it is best to use the org.equanda.client.ImportClient class.
+This will handle the login both in case of BASIC and FORM based authentication.
+
+The actual servlet can be generated with a ant task like the following :
+
+{code}
+ <equanda
+ appdir="${rootdir}/build/om"
+ definition="dm.xml"
+ outputdir="${build.generate.dir}"
+ package="test.ymport"
+ template="import"
+ generateAll="${equanda.generate-all}">
+ <config name="extra">
+ <attribute name="ejb-package" value="test"/>
+ </config>
+ </equanda>
+{code}
+
+Note that "import� is a reserved word in Java and thus cannot be used as package name.
+
+To use the servlet, a definition like the example which follows has to be added to your web.xml file in your web archive.
+
+{code}
+ <servlet>
+ <servlet-name>Import</servlet-name>
+ <servlet-class>org.equanda.ymport.Servlet</servlet-class>
+ <init-param>
+ <param-name>DatabaseMap</param-name>
+ <param-value>test.ymport.DatabaseMap</param-value>
+ </init-param>
+ </servlet>
+{code}
+
+Obviously, this servlet also has to be mapped to a URL, but that�s all there is to it.
+
+
+h2. Charset issues
+
+On the servlet connection, it is possible to indicate the character encoding which is used in the communication.
+This can be modified as needed on the client side to match the charset for the text file.
+
Copied: trunk/src/site/wiki/tool/export.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/export.wiki)
===================================================================
--- trunk/src/site/wiki/tool/export.wiki (rev 0)
+++ trunk/src/site/wiki/tool/export.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,239 @@
+h1. Export tool
+
+The export tool allows you to export data from a equanda generated application to text (ascii).
+Alternatively, the data which is exported can be processed using a script which then handles it further.
+This option is typically used to synchronize with another application
+(one-way synchronization, use the [Import] tool for the other direction).
+
+h2. General configuration
+
+The export program expects the name of the configuration .ini file as parameter.
+If this parameter is not given, a file called "export.ini" in the current directory is used.
+
+The export can be configured using a .ini file with the following base format :
+
+{code}
+[general]
+scanPeriod=30
+
+exportDirectory=c:\export
+exportInfo=exportInfo=org.ictrace.demo.maps.ExportMap
+exportIni=exportConfig.ini
+
+window=display
+
+server=192.168.0.252
+login=myname
+password=mypass
+{code}
+
+- scanPeriod : time in seconds between attempts to pick up files to import, default 120
+- exportDirectory : directory where the export files need to be written
+- window : indicates whether a window needs to be displayed or not (values "display" or "hidden")
+- exportInfo : full class name of the ExportInfo map needed for export
+- exportIni : defines the [ExportFileFormat] which should be used
+- server : name or ip address of server
+- login : login to connect to the equanda application
+- password : password to connect to the equanda application
+
+
+h2. What to export
+
+The .ini file also defines what to export.
+This is done by specifying the objects which need to be selected.
+For each object selected, you can have selections of secondary (related) objects which are also exported.
+After the export, the tool can automatically update one of the fields to mark that the export was succesful.
+
+For example
+{code}
+[object,1]
+
+selectorJndi=IC-trace/WeightGroupSelector
+selectorName=org.ictrace.client.WeightGroupSelector
+
+selectorName=ImportStatus
+selectorParamType1=String
+selectorParamValue1=Y
+
+setField1=ERPImportStatus
+setFieldType1=String
+setFieldValue1=D
+
+script=WeightGroup.esc
+
+[object,1,1]
+
+selectorJndi=IC-trace/WeightGroupTotalSelector
+selectorName=org.ictrace.client.WeightGroupTotalSelector
+
+selectorName=WeightGroup
+selectorParamType1=String
+selectorParamValue1=${Reference}
+
+script=WeightGroup.esc
+{code}
+
+This excerpt shows all the options.
+The first (and only) primary selector is indicated in the [object,1] section.
+The secondary selections for these are in the [object,1,X] sections, with "X" a number from one upwards.
+
+For each section, you can specify the JNDI name and classname for the bean to use.
+The classname should be without trailing "EJB" or "EJBHome".
+You can also specify the selector to be used, and the type and value for each paramater.
+For secondary objects, fields from the primary object can be used to as parameter value using the "${FieldName}" syntax.
+
+For each object, you can also optionally spacify fields which need to be set when the import was successful.
+You can also choose whether the export is to a file,
+or whether a user defined [FScript|fscript.html] script should handle the export (in which case the file is not generated).
+
+*Key Set Details*
+
+- selectorJndi : JNDI name whether the object which is selected can be found, normally a prefix followed by the table name.
+- selectorName : full name of the selector class (without trailing "EJB")
+
+- selectorName : the name of the selector to be used
+- selectorParamTypeX : type of the selector's Xth parameter, can be _String_, _int_, _double_, _boolean_, _Timestamp_, _Date_
+- selectorParamValueX : value of the selector's Xth parameter
+
+- setFieldX : name of the field to be set (after the object is exported)
+- setFieldTypeX : type of the field to be set, same choices as selectorParamType
+- setFieldValue1X : value for the field to be set
+
+- script : name of the script which is used to export the object
+
+_NOTE:_ All keys are _case sensitive_ !!!
+
+
+h2. Using scripts in export
+
+Like in [Import|import.html] you can also use scripts to export the data,
+possibly including the data directly into a different database.
+
+The program accepts [FScript|fscript.html] scripts to build the data to be exported.
+The script should have the following structure (example with some debug info) :
+
+{code}
+func primary(object prim)
+ debug("primary called for "+prim)
+ return TRUE
+endfunc
+
+func primary_done(object prim)
+ debug("primary_done called for "+prim)
+ display("importing "+prim)
+ return TRUE
+endfunc
+
+func secondary(object prim, object sec)
+ debug("secondary called for "+prim+":"+sec)
+ return FALSE
+endfunc{code}
+
+The [FScript|fscript.html] extensions from the util module are available.
+
+The functions should return "TRUE" or "FALSE" depending on whether the export was successful or not.
+If the export was not successful, then the variables which need to be set are not modified.
+
+When you return "FALSE" for the primary object, then the secondary objects are not exported.
+When one of the secondary objects returned "FALSE", then the fields for the primary object are not set.
+
+If the primary and all the secondary objects have been successfully imported,
+then the "primary_done" function is called. This can be used for cleanup, or to mark that the export has finished.
+
+{private}
+old export.ini as example :
+[general]
+title=Export
+usePrefix=false
+window=display
+;window=hidden
+login=local
+password=local
+scanPeriod=10
+debug=true
+server=localhost
+port=8080
+protocol=http
+alertProxyName=org.ictrace.client.equandaAlertProxy
+
+[database]
+name1=IC-TRACE.FDB
+;driver1=sun.jdbc.odbc.JdbcOdbcDriver
+;location1=jdbc:odbc:CodeBase Datasource;database=c:\data\db
+driver1=org.firebirdsql.jdbc.FBDriver
+location1=jdbc:firebirdsql:localhost/3050:C:\data\ic-trace\IC-TRACE.FDB
+user1=sysdba
+password1=masterkey
+
+[config]
+AankoopbonPrefix=AANK-
+BestelbonPrefix=VERK-
+KlantPrefix=K-
+LeverancierPrefix=L-
+
+[settings]
+script1=company.isc
+server=127.0.0.1
+exportDirectory=c:\
+exportInfo=org.ictrace.tool.export.maps.ExportMap
+exportIni=exportConfig.ini
+
+[object,1]
+
+selectorJndi=IC-trace/CompanySelector
+selectorName=org.ictrace.client.CompanySelector
+
+selectorName=Name
+selectorParamType1=String
+selectorParamValue1=testCompany
+
+setField1=PersonName
+setFieldType1=String
+setFieldValue1=Something
+
+setField2=Phone
+setFieldType2=String
+setFieldValue2=123456
+
+[object,1,1]
+
+selectorJndi=IC-trace/CompanySelector
+selectorName=org.ictrace.client.CompanySelector
+
+selectorName=Name
+selectorParamType1=String
+selectorParamValue1=${NameAlt}
+
+setField1=PersonName
+setFieldType1=String
+setFieldValue1=SomethingElse
+
+old exportConfig.ini as example
+[WeightGroup]
+file=WG${Reference}.txt
+1=Reference
+2=LocalReference
+
+[Weight]
+file=WG${Reference}.txt
+1=Reference
+2=Count
+3=WeightNet
+4=Sale
+
+[WeightGroupTotal]
+file=WG${Reference}.txt
+1=UOID
+2=LineIdentifier
+3=WeightGroup
+4=WeightObtained
+5=CountObtained
+
+[Company]
+file=Company${Reference}.txt
+1=Name
+2=NameAlt
+3=PersonName
+4=TraceId
+5=Phone
+{private}
\ No newline at end of file
Copied: trunk/src/site/wiki/tool/fscript.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/fscript.wiki)
===================================================================
--- trunk/src/site/wiki/tool/fscript.wiki (rev 0)
+++ trunk/src/site/wiki/tool/fscript.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,6 @@
+h1. Fscript
+
+FScript is a very simple scripting language which is available on sourceforge,
+see http://fscript.sourceforge.net/index.html.
+
+~~Placeholder, should include details of all FScript related classes in util~~
Copied: trunk/src/site/wiki/tool/import.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/import.wiki)
===================================================================
--- trunk/src/site/wiki/tool/import.wiki (rev 0)
+++ trunk/src/site/wiki/tool/import.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,150 @@
+h1. Import tool
+
+This is a tool which can be used to easy importing data into a equanda application.
+The program scans a directory for import files to appear (very configurable) and imports them using [ImportServlet].
+There is special handling to allow errors to be caught and corrected.
+Alternatively, this program can also execute scripts which can be used to build the import file at runtime
+(thus allowing a direct link with JDBC data sources etc).
+This option is typically used to synchronize with another application
+(one-way synchronization, use the [Export] tool for the other direction).
+
+
+h2. Usage
+
+The import tool can either scan directories for import files to appear,
+or can run scripts which produce the import file (probably by reading data from a proprietary system).
+
+The file format for importing is [ImportFileFormat].
+
+
+h2. General configuration
+
+The tool (class org.equanda.tool.ymport.ImportClient) accepts one optional parameter,
+the name of an .ini file which is used for the configuration.
+If no parameter is given, the program tries to open "import.ini".
+
+The .ini file has the following format
+
+{code}
+ [general]
+ scanPeriod=30
+ outputExtension=err
+ window=display
+ search=local
+ importURL=http://192.168.0.252:8080/admin/import/import
+
+ [mail]
+ server=mail.paragon-software.ro
+ port=110
+ use...@pa...
+ password=testtest
+ directory=/data/
+ acc...@pa...;kun...@ya...
+ connectionTimeout=30
+ socketTimeout=30
+
+ [scan]
+ dir1=c:\import
+ input1=*.txt
+ charset1=ISO-8859-1
+ dir2=g:\import
+ input2=*.import
+ script2=import.isc
+
+ [script]
+ debug=false
+ script1=weight.isc
+ script2=article.isc
+
+ [database]
+ name1=vlees
+ driver1=sun.jdbc.odbc.JdbcOdbcDriver
+ location1=jdbc:odbc:CodeBase Datasource;database=C:\dbf\
+ user1=
+ password1=
+{code}
+
+This has the following meaning
+
+h3. general section
+- scanPeriod : time in seconds between attempts to pick up files to import or attempt to run the import scripts. Defaults to 60s.
+- outputExtension : extension for output (error) files. The extension of the input file is replaced, or the extension is added if the input file had no extension.
+- window : indicates whether a window needs to be displayed or not (values "display" or "hidden").
+- search : indicates whether the program should only scan in the scan directories, or also in subsidrectories. Possible values are: "deep" and "local".
+
+h3. mail section
+This allows mails to be read which can then be imported. The attachments will be placed in the chosen location for further processing (scanning). Only mails from the list of allowed senders are accepted (slight security measure as anyboy could send mails to the designated mailbox.
+ {warning}
+ Accepting data to be imported from mails is always a security risc as sender addresses are very easy to forge. Once somebody knows the mail address and sender address top use, they can inject and overwrite anything in the database.
+ {warning}
+- _server_ : mail server to get mails from
+- _user_ : user to get mails for
+- _password_ : password for the user
+- _accept_ : senders for which the emails are accepted
+- _directory_ : location where the attachments need to be saved
+- _connectionTimeout_, _socketTimeout_ : timeouts for connection, in seconds, default is 30
+
+h3. scan section
+- This can contain the directories which have to be scanned for input files (scanX with X a number) and a regular expression (inputX) indicating the files which need to be imported (default is *), for the directory with the same number
+- It may also contain the charset to be used for the files from the matching directory. When charset is not set, the system default is used.
+- For each level, an import script file can be specified. The "build(string filename)" function is called in this script to allow conversion from other types of files.
+
+h3. script section
+- debug : can be "true" or "false". Normally the data which is built is immediately sent to the import servlet. However, when debug is "true", then the data is not imported but simply written to an output file in the current directory.
+- scriptX (with X a number) : name of a script file which builds the data to be imported.
+
+- database section
+- As with script and scan, the names need to end with a number to indicate what belongs together. Counting starts at one and should be continuous. The database section is only relevant for import scripts.
+- name : name for the database, as used in "Dbset(var[,name])"
+- driver : JDBC driver class
+- location : database url for connection with the database
+- user, password : username and password for the connection
+
+h3. config section
+- In the config section extra kay/value pairs can be put which can be retrieved in the scripts using "config(key)".
+
+
+h2. Program functioning
+
+The import itself starts by computing the name of the error file
+(the extension (everything after the last dot, if any) is replaced by "outputExtension").
+If the error file exists, the import file is skipped.
+It then tries to open the import file in read/write mode.
+If that fails, the file is skipped (it will be picked up again in the next scan).
+When the file is opened, the contents is sent to the import servlet.
+If the import was successful, then the input file is deleted.
+If the import failed, the return message from the servlet is written in the error file.
+
+
+h2. Script handling
+
+The program accepts [FScript|fscript.html] scripts to build the data to be imported.
+The script should have the following structure :
+
+{code}
+func build()
+ # this functions is called to builds the import file
+ # You have the following commands for this
+ # table(selectorName, commaSeperatedFields)
+ # field(data) : add a field value
+ # line([string]) : next line or add line with given text
+ # quote(string) : quote a string using single quotes, doubles the single quotes in the string
+ # import() : import the current data, returns whther the import was succesful
+ # (allows forcing import halfway through th...
[truncated message content] |
|
From: <tri...@us...> - 2008-12-03 11:51:02
|
Revision: 887
http://equanda.svn.sourceforge.net/equanda/?rev=887&view=rev
Author: triathlon98
Date: 2008-12-03 11:44:47 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-287 documentation improvements
Added Paths:
-----------
trunk/equanda-tapestry5/src/site/wiki/accordion.wiki
trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki
trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki
trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki
trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki
trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki
trunk/equanda-tapestry5/src/site/wiki/manifest.wiki
trunk/equanda-tapestry5/src/site/wiki/script.wiki
trunk/equanda-tapestry5/src/site/wiki/tabs.wiki
trunk/equanda-tapestry5/src/site/wiki/truncate.wiki
trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki
Removed Paths:
-------------
trunk/src/site/wiki/tool/accordion.wiki
trunk/src/site/wiki/tool/breadcrumbs.wiki
trunk/src/site/wiki/tool/formactionlink.wiki
trunk/src/site/wiki/tool/formsupport.wiki
trunk/src/site/wiki/tool/formtraversal.wiki
trunk/src/site/wiki/tool/jspagedloop.wiki
trunk/src/site/wiki/tool/manifest.wiki
trunk/src/site/wiki/tool/script.wiki
trunk/src/site/wiki/tool/tabs.wiki
trunk/src/site/wiki/tool/truncate.wiki
trunk/src/site/wiki/tool/validationtrackerdelegate.wiki
Copied: trunk/equanda-tapestry5/src/site/wiki/accordion.wiki (from rev 886, trunk/src/site/wiki/tool/accordion.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/accordion.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/accordion.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,70 @@
+h1. Accordion
+
+An accordion component integrates nicely in tapestry.
+
+You have to pass the title and content panes as parameters to the accordion component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
+Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
+The currently selected pane is remembered between requests.
+- For the *Accordion* component this is done via a cookie that is identified by the component's id. This implies that accordion components with the same id on different pages will share this cookie. If this is not wanted than each accordion component should get a unique id, even if they are on different page, or use MemAccordion.
+{private}
+- For the *MemAccordion* component the state is persisted in the session and updated using an ajax request when you change tab.
+
+{private}
+
+{code}
+ <span t:type="equanda/Accordion" t:id="accordion">
+ <t:parameter name="title1">First title</t:parameter>
+ <t:parameter name="content1">
+ <p>This is the content for the first pane</p>
+ <p>With some more text</p>
+ </t:parameter>
+ <t:parameter name="title2">Another title pane</t:parameter>
+ <t:parameter name="content2">
+ <p>With even more content</p>
+ </t:parameter>
+ <t:parameter name="title3">Latin text</t:parameter>
+ <t:parameter name="content3">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
+ <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
+ </t:parameter>
+ </span>
+{code}
+
+The component automatically handles the hiding of all (except one) panel at the start, and making sure the correct pane is selected when the title is clicked on.
+
+How the accordion is displayed is handled using CSS. The classes which are used depend on the accordion component id. This also assures it will work when there are several accordion components on a page (just assure they have a different id).
+
+{code}
+.accordion_tit {
+ background-color: lightgray;
+ color: black;
+ height: 15px;
+ font-weight: normal;
+ padding-left: 5px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ cursor: pointer;
+}
+
+.accordion_tit a:link,
+.accordion_tit a:visited,
+.accordion_tit a:active,
+.accordion_tit a:hover {
+ color: black;
+ text-decoration: none;
+}
+
+.accordion_atit {
+ font-weight: bold;
+}
+
+.accordion_ct {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ padding-left: 10px;
+ padding-right: 2px;
+ background-color: beige;
+ overflow: auto;
+ height: 200px;
+}
+{code}
Copied: trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki (from rev 886, trunk/src/site/wiki/tool/breadcrumbs.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/breadcrumbs.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,49 @@
+h1. Breadcrumbs
+
+The breadcrumbs components displays a list of links that have been visited as the user navigates through the tapestry pages. The user can select a previously visited crumb which will take them back to that page without losing any of their session information. When moving to a crumb, this will also reset the breadcrumbs to the state at the time the page was visited.
+
+{code}
+ <t:type="equanda/Breadcrumb" t:id="breadcrumb"/>
+{code}
+
+As the user navigates through the pages, the page they are coming from is appended to the end of the breadcrumbs (done by the application code). The breadcrumb name appended is the page title.
+Certain links should clear the breadcrumbs component when clicked. A variant of the pagelink component which has this behaviour should be provided.
+
+*Session retrieval*
+As the list of breadcrumbs grows, it should be possible to select any of the crumbs. When this happens, the current breadcrumb list should be shortened to indicate that the current page is the last crumb in the list. Also, the current state of this page (and the entire web session) should be as it was when the user left it.
+
+To support the latter, a conversation ID must be added as a query on the URL. E.g
+{code}
+http://localhost:8080/eportfolio-dp/assertionedit/srX8M5rTTo1RRn?cid=00112233445566
+{code}
+This will be a 14-digit code (UOID can be used). When a new page is selected, the existing session is serialized (using JBoss serialization library) and added to the EquandaNavigation table. This session can then be retrieved once the CID is known.
+
+h2. Implementation
+
+h3. BreadCrumbs Component
+
+A new BreadCrumbs component will be created. This will store the state in a ASO (application state object).
+This ASO should provide at least the following methods :
+- clear
+- add page : add using a link (with correct handling of the conversation), title and context. The context is used to determine whether the most recent page from the breadcrumb should be replaced or not. This is for example useful when switching between different selector pages for a table.
+
+h3. Conversation filter
+
+The conversation filter serves two purposes.
+- assure the session state is restored when clinking a link in the breadcrumbs.
+- allow multi-tabbed use inside the application (and hopefully also correct back button handling).
+
+The principle is simple, the session state is stored in the EquandaNavigation table (see org.equanda.infrastructure.infrastructure.xml, currently commented).
+When a page is visited, if the conversion id is retrieved, the session state is restored based on the conversation id to assure correct session state.
+
+This should be implementable using a request filter.
+
+When a page request comes in, the conversation id is retrieved. This is done first by looking at the url, and if that fails the "Referer" header is examined to see if that contains a conversaton id.
+If a conversation id was found, the session state is replaced by the stored stated from the conversation.
+The conversation is then investigate to see if it was marked as "starting". In that case a new EquandaNavigation object is created, the session state copied into it and the "starting" state set. A http redirect is then returned with the requesting url with the id of the new navigation object as new location (302 status with "Location" header).
+
+On the outbound path of the page request, the session state should be stored in a new EquandaNavigation object (serialized using JBoss serialization) and the "starting" flag is cleared.
+
+For requests which are not page requests, an attempt should be made to figure out the conversation state from the request and referer url. If a conversation id is found, then the session should be replaced based on that.
+
+It will need to be verified that ajax requests will be fully functional when two conversations are ongoing in different tabs in the browser.
Copied: trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki (from rev 886, trunk/src/site/wiki/tool/formactionlink.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/formactionlink.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,25 @@
+h1. FormActionLink
+
+This is a component which looks and feels like a standard Tapestry [ActionLink|http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html]. However, this is supposed to be used inside a equanda/Form component and then assures that the form is submitted (and thus state saved) before actually processing the action.
+
+This component only works when embedded in a ["equanda/FormSupport"|formsupport.html] component which is correctly intergrated. Otherwise it does nothing.
+
+Simple example of use :
+{code}
+<t:form>
+ <div t:id="formSupport">
+
+ <t:errors/>
+
+ <t:equanda.formactionlink t:id="DoSomething">Do something</t:equanda.formactionlink>
+
+ </div>
+</t:form>
+{code}
+And in the code, just act as a normal actionlink :
+{code}
+Object onActionFromDoSomething()
+{
+ // now something should be done :-)
+}
+{code}
Copied: trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki (from rev 886, trunk/src/site/wiki/tool/formsupport.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/formsupport.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,29 @@
+h1. FormSupport
+
+This component needs to be integrated in a form to allow the [FormActionLink|formactionlink.html] component to work.
+It needs to be integrated both in your template and some support code added in the page or component class which includes it.
+
+This handles the magic which assures the FormActionLinks actually work.
+
+How to include in the template:
+{code}
+<t:form>
+ <div t:id="formSupport">
+
+ <t:errors/>
+
+ <!-- include your form content here -->
+
+ </div>
+</t:form>
+{code}
+In the component of page class, the following needs to be put.
+{code}
+@Component
+private FormSupport formSupport;
+
+public Object onSubmit()
+{
+ return formSupport.getLinkTarget();
+}
+{code}
Copied: trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki (from rev 886, trunk/src/site/wiki/tool/formtraversal.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/formtraversal.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,54 @@
+h1. FormTraversal
+
+This component is intended to give consistent user interface behaviour which allows easy and efficient form completion without using a mouse.
+It achieves this by
+- assuring focus starts in the first editable input element on the page
+- allow traversing the (useable) form elements using tab or enter
+- allow page submit by pressing ctrl-enter
+
+To use it, include the following snippet in your template (probably the layout).
+It is recommended to include this is late as possible in your layout to assure the focus is not changed by script code which is executed after this.
+
+{code}
+<span t:type="equanda/FormTraversal"/>
+{code}
+
+To assure the first item on the focus receives focus (as controlled by this component), you need to turn off the tapestry built-in autofocus behaviour.
+This can be done by definint your form like this.
+{code}
+<t:form autofocus="false">
+ ....
+</t:form>
+{code}
+
+The exact behaviour is influenced by the class on the elements.
+- defaultSubmit : the first element which can be found with this class is "clicked on" when the user presses ctrl-enter.
+- eqTravSkip : any element marked with this class never receives focus (skip)
+- eqTravFw : when going forward through the form using tab or enter, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
+- eqTravBw : when going backward through the form using shift-tab, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
+- eqTravMove : when an element is encountered with this class, then searching the next object continues at the object with the id given in the "href" attribute for the element (optionally preceded by a hash).
+- eqTravEnter : when a textarea is marked using this class, then enter jumps to a new line in the form.
+
+
+h2. ctrl-enter
+
+This key is used to submit the form. It looks for (the first) DOM object with class "defaultSubmit" and invokes that. You probably want to highlight that button.
+{code}
+.defaultSubmit {
+ font-weight: bold;
+}
+{code}
+
+h2. enter
+
+To assure behaviour is consistent, pressing enter is (normally) considered the same as pressing tab.
+When inside a textarea (which is not marked with the class "eqTravEnter"), the user should press shift-enter to go to a new line.
+
+Differences with tab behaviour are
+- shift-enter does not move backwards
+- when pressing enter on an element marked with the class "defaultButton" then that element is "clicked on".
+- when pressing enter in a textarea, focus is still moved to the next element, except when the element is marked using the "eqTravEnter" class.
+
+h2. tab
+
+This moves forward or backward through the page. It only considers visible, enabled links, buttons and form elements, with the extra handling based on the classes as mentioned above.
\ No newline at end of file
Copied: trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki (from rev 886, trunk/src/site/wiki/tool/jspagedloop.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/jspagedloop.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,28 @@
+h1. Tabs
+
+JSPagedLoop component loops an iterable list of values and allows you to immediately jump to a particular page index within the overall data set without page submit.
+The component also allows you to add hidden items which can be displayed by clickin the "Add" link (again, without form submit).
+
+Parameters of the component :
+- clientId : the client id.
+- source : defines the collection of values for the loop to iterate over.
+- value : the current value.
+- volatile : same as standard Loop component.
+- index : the index into the source items.
+- elementName : The element to render. If not null, then the loop will render the indicated element around its body (on each pass through the loop). The default is derived from the component template.
+- rowsPerPage : the number of rows of data displayed on each page.
+- additionalRowCount : additional rows which can by dynamically added by Java Script.
+- addRowLinkTitle : title of the "Add" link.
+- objectCreatorDelegate : instance of _org.equanda.tapestry5.base.ObjectCreatorDelegate_ which allows to create new object and add it to the collection.
+
+To component can be passed set of block parameters: "empty" and "bottomBlock". "empty" block will be displayed when value collection is empty. "bottomBlock" will be displayed instead of the Java Script "Add" link when all additional rows are visible.
+
+{code}
+<div t:id="pagedLoop" t:type="equanda/JSPagedLoop" source="1..10" value="current" volatile="true" index="index" rowsPerPage="2" additionalRowCount="2" addRowLinkTitle="Add" objectCreatorDelegate="prop:this">
+ <t:parameter name="empty"></t:parameter>
+ <t:parameter name="bottomBlock">
+ <t:equanda.formactionlink t:id="Add">Add</t:equanda.formactionlink>
+ </t:parameter>
+ <p>Current loop value is: ${current}</p>
+</div>
+{code}
\ No newline at end of file
Copied: trunk/equanda-tapestry5/src/site/wiki/manifest.wiki (from rev 886, trunk/src/site/wiki/tool/manifest.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/manifest.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/manifest.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,49 @@
+h1. manifest binding prefix
+
+This binding allows you to include values from the manifest file. It will search through all manifest files, and on the first occurence of the key, the value will be returned.
+
+For example the following
+{code}
+${manifest:Build-Jdk}
+{code}
+will display the jdk which was used to build the jar containing the first manifest which contains the key.
+
+It is most practical for displaying version numbers etc. When the master pom for the project contains the following (here taken from equanda itself)
+{code}
+<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <doCheck>false</doCheck>
+ <doUpdate>false</doUpdate>
+ </configuration>
+</plugin>
+<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <equanda-build>${buildNumber}</equanda-build>
+ <equanda-version>${project.version}</equanda-version>
+ </manifestEntries>
+ </archive>
+ </configuration>
+</plugin>
+{code}
+The including
+{code}
+equanda version used ${manifest:equanda-version}, build ${manifest:equanda-build}
+{code}
+Will display the data which was included at compile time.
Copied: trunk/equanda-tapestry5/src/site/wiki/script.wiki (from rev 886, trunk/src/site/wiki/tool/script.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/script.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/script.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,36 @@
+h1. equanda provided scripts
+
+h2. equanda.js
+
+Can be used by adding the following in your page class :
+{code}
+@Inject
+@Path( "classpath:/org/equanda/tapestry5/resources/equanda.js" )
+private Asset equandaJs;
+
+public Asset getEquandaJs() { return equandaJs; }
+{code}
+And using this in your template as (in the "head" section) :
+{code}
+<script src="${equandaJs}" language="javascript" type="text/javascript" />
+{code}
+
+It provides the following javascript functions
+
+h3. equandaWindowHeight()
+
+Get the browser window height (browser independent). This can for example be used to assure an [Accordion|accordion.html] fills the height of the window.
+
+h3. equandaWindowWidth()
+
+Get the browser window width (browser independent).
+
+h3. eqCC() (equandaConvertCase)
+
+This function allow automatic case conversion on a input field. Use by adding a onkeyup event (extra parameter) handler on the input component.
+{code}
+onkeyup="eqCC( this, 2);"
+{code}
+This function eight does expects the form element to work on, and a value indicating how to convert the case.
+- 1 : convert everything to lower case
+- 2 : convert everything to upper case
Copied: trunk/equanda-tapestry5/src/site/wiki/tabs.wiki (from rev 886, trunk/src/site/wiki/tool/tabs.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/tabs.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/tabs.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,99 @@
+h1. Tabs / MemTabs
+
+A tabs component which allows grouping objects in tab pages.
+
+You have to pass the title and content panes as parameters to the tabs component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
+You can specify a "titleIcon" parameter block which allows display a icon (or something else) on each tab.
+Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
+The currently selected pane is remembered between requests.
+- For the *Tabs* component this is done via a cookie that is identified by the component's id. This implies that tabs components with the same id on different pages will share this cookie. If this is not wanted than each tabs should get a unique id, even if they are on different page, or use MemTabs.
+- For the *MemTabs* component the state is persisted in the session and updated using an ajax request when you change tab.
+Using "contentAll" it is possible to have a banner displayed at the top of each tab page.
+
+The component has some built in features to function well in combination with the [FormTraversal|formtraversal.html] component. Specifically, moving between the fields on the form (using tab or enter) will also traverse to the next ir previous tb page when needed. You probably want to use CSS to hide the links which accomplish this.
+
+{code}
+ <span t:type="equanda/Tabs" t:id="tabs" t:exclude="-1">
+ <t:parameter name="title1">First title</t:parameter>
+ <t:parameter name="content1">
+ <p>This is the content for the first tab</p>
+ <p>With some more text</p>
+ </t:parameter>
+ <t:parameter name="title2">Another title pane</t:parameter>
+ <t:parameter name="content2">
+ <p>With even more content</p>
+ </t:parameter>
+ <t:parameter name="title3">Latin text</t:parameter>
+ <t:parameter name="content3">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
+ <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
+ </t:parameter>
+ <t:parameter name="title4">Excluded Title</t:parameter>
+ <t:parameter name="content4">
+ Excluded content
+ </t:parameter>
+ <t:parameter name="contentAll">
+ <p>This banner should be repeated on all pages.</p>
+ </t:parameter>
+ </span>
+{code}
+
+How the tabs are displayed is handled using CSS. Below is an example of styling for the CSS.
+
+{code}
+.eqTabs {
+ padding:0 3em;
+ width:80%;
+}
+.eqTabsT {
+ float:left;
+ width:100%;
+ margin: 0 0 0 0;
+ list-style:none;
+}
+.eqTabsT li {
+ float:left;
+ padding:0 .5em 0 0;
+}
+.eqTabsT a:link,
+.eqTabsT a:visited,
+.eqTabsT a:active,
+.eqTabsT a:hover {
+ width: 8em;
+ padding: .2em 1em;
+ display: block;
+ background: lightgray;
+ color: black;
+ font-weight: bold;
+ text-decoration: none;
+}
+.eqTabsT a:hover {
+ background: gray;
+ color: white;
+}
+.eqTabsP {
+ border: solid 1px;
+ clear: both;
+ width: auto;
+}
+.eqTabsAll {
+ border-bottom: solid 1px;
+ background: beige;
+ padding: 1em;
+}
+.eqTabsPC {
+ background: white;
+ padding: 1em;
+}
+a.eqTabsA:link,
+a.eqTabsA:visited,
+a.eqTabsA:active,
+a.eqTabsA:hover {
+ background:black;
+ color:white;
+}
+.eqTravFw,
+.eqTravBw {
+ display: none;
+}
+{code}
Copied: trunk/equanda-tapestry5/src/site/wiki/truncate.wiki (from rev 886, trunk/src/site/wiki/tool/truncate.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/truncate.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/truncate.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,38 @@
+h1. Truncate
+
+Component which allows truncating text to a maximum length. When the text is longer than the limitation, the full text is still displayed on mouse-over.
+
+You have to pass the text, length and suffix as parameters to the truncate component.
+
+{code}
+<span t:type="equanda/Truncate" t:length="20" t:suffix="..." t:text="literal:Very very long text very very long text very very long text"/>
+{code}
+
+Length and suffix are optional parameters. Default values are 30 and "...".
+These can be overwritten in your AppModule using code like
+{code}
+ public static void contributeDefaults( MappedConfiguration<String, String> configuration )
+ {
+ configuration.add( "equanda.truncate.default.length", "30" );
+ configuration.add( "equanda.truncate.default.suffix", "..." );
+ }
+{code}
+
+
+Style can be overridden by declaring CSS class eqTrunCt.
+
+Default style is:
+
+{code}
+.eqTrunCt {
+ position: absolute;
+ padding: 5px;
+ border: 1px solid black;
+ font: normal 12px Verdana;
+ line-height: 18px;
+ z-index: 100;
+ background-color: white;
+ width: 250px;
+ filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=140,Strength=4);
+}
+{code}
\ No newline at end of file
Copied: trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki (from rev 886, trunk/src/site/wiki/tool/validationtrackerdelegate.wiki)
===================================================================
--- trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki (rev 0)
+++ trunk/equanda-tapestry5/src/site/wiki/validationtrackerdelegate.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -0,0 +1,44 @@
+h1. ValidationTrackerDelegate
+
+This is a component which can help you forward messages to the validation tracker.
+
+It can for example be used when you have a page (or it can be a component surrounding your form) where the onActivate or beginRender phases can produce messaged which need to be displayed in the validation tracker in your page.
+
+In your page you have to add the validationdelegate component to add allow the propagation of the messages
+{code}
+<t:form>
+ <t:equanda.ValidationTrackerDelegate/>
+ <t:errors/>
+
+ .....
+
+</t:form>
+{code}
+
+Please note that the _ValidationTrackerDelegate_ should be before the _t:errors_ component.
+
+In your page or component, you do something like the following
+{code}
+@Inject
+private Environment environment;
+
+private String keepMessage;
+
+public void onActivate()
+{
+ .... do whatever needs to be done
+
+ .... if there is a problem do the following
+ keepMessage = "error message";
+}
+
+void beginRender()
+{
+ if ( null != keepMessage ) environment.push( MessageContainer.class, new MessageContainer( keepMessage ) );
+}
+
+void afterRender()
+{
+ if ( null != keepMessage ) environment.pop( MessageContainer.class );
+}
+{code}
Deleted: trunk/src/site/wiki/tool/accordion.wiki
===================================================================
--- trunk/src/site/wiki/tool/accordion.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/accordion.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,70 +0,0 @@
-h1. Accordion
-
-An accordion component integrates nicely in tapestry.
-
-You have to pass the title and content panes as parameters to the accordion component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
-Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
-The currently selected pane is remembered between requests.
-- For the *Accordion* component this is done via a cookie that is identified by the component's id. This implies that accordion components with the same id on different pages will share this cookie. If this is not wanted than each accordion component should get a unique id, even if they are on different page, or use MemAccordion.
-{private}
-- For the *MemAccordion* component the state is persisted in the session and updated using an ajax request when you change tab.
-
-{private}
-
-{code}
- <span t:type="equanda/Accordion" t:id="accordion">
- <t:parameter name="title1">First title</t:parameter>
- <t:parameter name="content1">
- <p>This is the content for the first pane</p>
- <p>With some more text</p>
- </t:parameter>
- <t:parameter name="title2">Another title pane</t:parameter>
- <t:parameter name="content2">
- <p>With even more content</p>
- </t:parameter>
- <t:parameter name="title3">Latin text</t:parameter>
- <t:parameter name="content3">
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
- <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
- </t:parameter>
- </span>
-{code}
-
-The component automatically handles the hiding of all (except one) panel at the start, and making sure the correct pane is selected when the title is clicked on.
-
-How the accordion is displayed is handled using CSS. The classes which are used depend on the accordion component id. This also assures it will work when there are several accordion components on a page (just assure they have a different id).
-
-{code}
-.accordion_tit {
- background-color: lightgray;
- color: black;
- height: 15px;
- font-weight: normal;
- padding-left: 5px;
- padding-top: 3px;
- padding-bottom: 3px;
- cursor: pointer;
-}
-
-.accordion_tit a:link,
-.accordion_tit a:visited,
-.accordion_tit a:active,
-.accordion_tit a:hover {
- color: black;
- text-decoration: none;
-}
-
-.accordion_atit {
- font-weight: bold;
-}
-
-.accordion_ct {
- padding-top: 10px;
- padding-bottom: 10px;
- padding-left: 10px;
- padding-right: 2px;
- background-color: beige;
- overflow: auto;
- height: 200px;
-}
-{code}
Deleted: trunk/src/site/wiki/tool/breadcrumbs.wiki
===================================================================
--- trunk/src/site/wiki/tool/breadcrumbs.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/breadcrumbs.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,49 +0,0 @@
-h1. Breadcrumbs
-
-The breadcrumbs components displays a list of links that have been visited as the user navigates through the tapestry pages. The user can select a previously visited crumb which will take them back to that page without losing any of their session information. When moving to a crumb, this will also reset the breadcrumbs to the state at the time the page was visited.
-
-{code}
- <t:type="equanda/Breadcrumb" t:id="breadcrumb"/>
-{code}
-
-As the user navigates through the pages, the page they are coming from is appended to the end of the breadcrumbs (done by the application code). The breadcrumb name appended is the page title.
-Certain links should clear the breadcrumbs component when clicked. A variant of the pagelink component which has this behaviour should be provided.
-
-*Session retrieval*
-As the list of breadcrumbs grows, it should be possible to select any of the crumbs. When this happens, the current breadcrumb list should be shortened to indicate that the current page is the last crumb in the list. Also, the current state of this page (and the entire web session) should be as it was when the user left it.
-
-To support the latter, a conversation ID must be added as a query on the URL. E.g
-{code}
-http://localhost:8080/eportfolio-dp/assertionedit/srX8M5rTTo1RRn?cid=00112233445566
-{code}
-This will be a 14-digit code (UOID can be used). When a new page is selected, the existing session is serialized (using JBoss serialization library) and added to the EquandaNavigation table. This session can then be retrieved once the CID is known.
-
-h2. Implementation
-
-h3. BreadCrumbs Component
-
-A new BreadCrumbs component will be created. This will store the state in a ASO (application state object).
-This ASO should provide at least the following methods :
-- clear
-- add page : add using a link (with correct handling of the conversation), title and context. The context is used to determine whether the most recent page from the breadcrumb should be replaced or not. This is for example useful when switching between different selector pages for a table.
-
-h3. Conversation filter
-
-The conversation filter serves two purposes.
-- assure the session state is restored when clinking a link in the breadcrumbs.
-- allow multi-tabbed use inside the application (and hopefully also correct back button handling).
-
-The principle is simple, the session state is stored in the EquandaNavigation table (see org.equanda.infrastructure.infrastructure.xml, currently commented).
-When a page is visited, if the conversion id is retrieved, the session state is restored based on the conversation id to assure correct session state.
-
-This should be implementable using a request filter.
-
-When a page request comes in, the conversation id is retrieved. This is done first by looking at the url, and if that fails the "Referer" header is examined to see if that contains a conversaton id.
-If a conversation id was found, the session state is replaced by the stored stated from the conversation.
-The conversation is then investigate to see if it was marked as "starting". In that case a new EquandaNavigation object is created, the session state copied into it and the "starting" state set. A http redirect is then returned with the requesting url with the id of the new navigation object as new location (302 status with "Location" header).
-
-On the outbound path of the page request, the session state should be stored in a new EquandaNavigation object (serialized using JBoss serialization) and the "starting" flag is cleared.
-
-For requests which are not page requests, an attempt should be made to figure out the conversation state from the request and referer url. If a conversation id is found, then the session should be replaced based on that.
-
-It will need to be verified that ajax requests will be fully functional when two conversations are ongoing in different tabs in the browser.
Deleted: trunk/src/site/wiki/tool/formactionlink.wiki
===================================================================
--- trunk/src/site/wiki/tool/formactionlink.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/formactionlink.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,25 +0,0 @@
-h1. FormActionLink
-
-This is a component which looks and feels like a standard Tapestry [ActionLink|http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html]. However, this is supposed to be used inside a equanda/Form component and then assures that the form is submitted (and thus state saved) before actually processing the action.
-
-This component only works when embedded in a ["equanda/FormSupport"|formsupport.html] component which is correctly intergrated. Otherwise it does nothing.
-
-Simple example of use :
-{code}
-<t:form>
- <div t:id="formSupport">
-
- <t:errors/>
-
- <t:equanda.formactionlink t:id="DoSomething">Do something</t:equanda.formactionlink>
-
- </div>
-</t:form>
-{code}
-And in the code, just act as a normal actionlink :
-{code}
-Object onActionFromDoSomething()
-{
- // now something should be done :-)
-}
-{code}
Deleted: trunk/src/site/wiki/tool/formsupport.wiki
===================================================================
--- trunk/src/site/wiki/tool/formsupport.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/formsupport.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,29 +0,0 @@
-h1. FormSupport
-
-This component needs to be integrated in a form to allow the [FormActionLink|formactionlink.html] component to work.
-It needs to be integrated both in your template and some support code added in the page or component class which includes it.
-
-This handles the magic which assures the FormActionLinks actually work.
-
-How to include in the template:
-{code}
-<t:form>
- <div t:id="formSupport">
-
- <t:errors/>
-
- <!-- include your form content here -->
-
- </div>
-</t:form>
-{code}
-In the component of page class, the following needs to be put.
-{code}
-@Component
-private FormSupport formSupport;
-
-public Object onSubmit()
-{
- return formSupport.getLinkTarget();
-}
-{code}
Deleted: trunk/src/site/wiki/tool/formtraversal.wiki
===================================================================
--- trunk/src/site/wiki/tool/formtraversal.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/formtraversal.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,54 +0,0 @@
-h1. FormTraversal
-
-This component is intended to give consistent user interface behaviour which allows easy and efficient form completion without using a mouse.
-It achieves this by
-- assuring focus starts in the first editable input element on the page
-- allow traversing the (useable) form elements using tab or enter
-- allow page submit by pressing ctrl-enter
-
-To use it, include the following snippet in your template (probably the layout).
-It is recommended to include this is late as possible in your layout to assure the focus is not changed by script code which is executed after this.
-
-{code}
-<span t:type="equanda/FormTraversal"/>
-{code}
-
-To assure the first item on the focus receives focus (as controlled by this component), you need to turn off the tapestry built-in autofocus behaviour.
-This can be done by definint your form like this.
-{code}
-<t:form autofocus="false">
- ....
-</t:form>
-{code}
-
-The exact behaviour is influenced by the class on the elements.
-- defaultSubmit : the first element which can be found with this class is "clicked on" when the user presses ctrl-enter.
-- eqTravSkip : any element marked with this class never receives focus (skip)
-- eqTravFw : when going forward through the form using tab or enter, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
-- eqTravBw : when going backward through the form using shift-tab, and an element with this class is encountered, then the element is "clicked on". This is for example used in the [Tabs|tabs.html] component to automatically move to the next tab.
-- eqTravMove : when an element is encountered with this class, then searching the next object continues at the object with the id given in the "href" attribute for the element (optionally preceded by a hash).
-- eqTravEnter : when a textarea is marked using this class, then enter jumps to a new line in the form.
-
-
-h2. ctrl-enter
-
-This key is used to submit the form. It looks for (the first) DOM object with class "defaultSubmit" and invokes that. You probably want to highlight that button.
-{code}
-.defaultSubmit {
- font-weight: bold;
-}
-{code}
-
-h2. enter
-
-To assure behaviour is consistent, pressing enter is (normally) considered the same as pressing tab.
-When inside a textarea (which is not marked with the class "eqTravEnter"), the user should press shift-enter to go to a new line.
-
-Differences with tab behaviour are
-- shift-enter does not move backwards
-- when pressing enter on an element marked with the class "defaultButton" then that element is "clicked on".
-- when pressing enter in a textarea, focus is still moved to the next element, except when the element is marked using the "eqTravEnter" class.
-
-h2. tab
-
-This moves forward or backward through the page. It only considers visible, enabled links, buttons and form elements, with the extra handling based on the classes as mentioned above.
\ No newline at end of file
Deleted: trunk/src/site/wiki/tool/jspagedloop.wiki
===================================================================
--- trunk/src/site/wiki/tool/jspagedloop.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/jspagedloop.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,28 +0,0 @@
-h1. Tabs
-
-JSPagedLoop component loops an iterable list of values and allows you to immediately jump to a particular page index within the overall data set without page submit.
-The component also allows you to add hidden items which can be displayed by clickin the "Add" link (again, without form submit).
-
-Parameters of the component :
-- clientId : the client id.
-- source : defines the collection of values for the loop to iterate over.
-- value : the current value.
-- volatile : same as standard Loop component.
-- index : the index into the source items.
-- elementName : The element to render. If not null, then the loop will render the indicated element around its body (on each pass through the loop). The default is derived from the component template.
-- rowsPerPage : the number of rows of data displayed on each page.
-- additionalRowCount : additional rows which can by dynamically added by Java Script.
-- addRowLinkTitle : title of the "Add" link.
-- objectCreatorDelegate : instance of _org.equanda.tapestry5.base.ObjectCreatorDelegate_ which allows to create new object and add it to the collection.
-
-To component can be passed set of block parameters: "empty" and "bottomBlock". "empty" block will be displayed when value collection is empty. "bottomBlock" will be displayed instead of the Java Script "Add" link when all additional rows are visible.
-
-{code}
-<div t:id="pagedLoop" t:type="equanda/JSPagedLoop" source="1..10" value="current" volatile="true" index="index" rowsPerPage="2" additionalRowCount="2" addRowLinkTitle="Add" objectCreatorDelegate="prop:this">
- <t:parameter name="empty"></t:parameter>
- <t:parameter name="bottomBlock">
- <t:equanda.formactionlink t:id="Add">Add</t:equanda.formactionlink>
- </t:parameter>
- <p>Current loop value is: ${current}</p>
-</div>
-{code}
\ No newline at end of file
Deleted: trunk/src/site/wiki/tool/manifest.wiki
===================================================================
--- trunk/src/site/wiki/tool/manifest.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/manifest.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,49 +0,0 @@
-h1. manifest binding prefix
-
-This binding allows you to include values from the manifest file. It will search through all manifest files, and on the first occurence of the key, the value will be returned.
-
-For example the following
-{code}
-${manifest:Build-Jdk}
-{code}
-will display the jdk which was used to build the jar containing the first manifest which contains the key.
-
-It is most practical for displaying version numbers etc. When the master pom for the project contains the following (here taken from equanda itself)
-{code}
-<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>create</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <doCheck>false</doCheck>
- <doUpdate>false</doUpdate>
- </configuration>
-</plugin>
-<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <equanda-build>${buildNumber}</equanda-build>
- <equanda-version>${project.version}</equanda-version>
- </manifestEntries>
- </archive>
- </configuration>
-</plugin>
-{code}
-The including
-{code}
-equanda version used ${manifest:equanda-version}, build ${manifest:equanda-build}
-{code}
-Will display the data which was included at compile time.
Deleted: trunk/src/site/wiki/tool/script.wiki
===================================================================
--- trunk/src/site/wiki/tool/script.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/script.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,36 +0,0 @@
-h1. equanda provided scripts
-
-h2. equanda.js
-
-Can be used by adding the following in your page class :
-{code}
-@Inject
-@Path( "classpath:/org/equanda/tapestry5/resources/equanda.js" )
-private Asset equandaJs;
-
-public Asset getEquandaJs() { return equandaJs; }
-{code}
-And using this in your template as (in the "head" section) :
-{code}
-<script src="${equandaJs}" language="javascript" type="text/javascript" />
-{code}
-
-It provides the following javascript functions
-
-h3. equandaWindowHeight()
-
-Get the browser window height (browser independent). This can for example be used to assure an [Accordion|accordion.html] fills the height of the window.
-
-h3. equandaWindowWidth()
-
-Get the browser window width (browser independent).
-
-h3. eqCC() (equandaConvertCase)
-
-This function allow automatic case conversion on a input field. Use by adding a onkeyup event (extra parameter) handler on the input component.
-{code}
-onkeyup="eqCC( this, 2);"
-{code}
-This function eight does expects the form element to work on, and a value indicating how to convert the case.
-- 1 : convert everything to lower case
-- 2 : convert everything to upper case
Deleted: trunk/src/site/wiki/tool/tabs.wiki
===================================================================
--- trunk/src/site/wiki/tool/tabs.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/tabs.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,99 +0,0 @@
-h1. Tabs / MemTabs
-
-A tabs component which allows grouping objects in tab pages.
-
-You have to pass the title and content panes as parameters to the tabs component. There is currently a limitation of fifty panels. Only panels which have both a title and content parameter block are displayed, however the indexes do not need to be sequential (hence the need for a limit).
-You can specify a "titleIcon" parameter block which allows display a icon (or something else) on each tab.
-Parameter "exclude" allows to skip rendering of specified tab indicated by it's index. Negative "exclude" value will remove last N tabs;
-The currently selected pane is remembered between requests.
-- For the *Tabs* component this is done via a cookie that is identified by the component's id. This implies that tabs components with the same id on different pages will share this cookie. If this is not wanted than each tabs should get a unique id, even if they are on different page, or use MemTabs.
-- For the *MemTabs* component the state is persisted in the session and updated using an ajax request when you change tab.
-Using "contentAll" it is possible to have a banner displayed at the top of each tab page.
-
-The component has some built in features to function well in combination with the [FormTraversal|formtraversal.html] component. Specifically, moving between the fields on the form (using tab or enter) will also traverse to the next ir previous tb page when needed. You probably want to use CSS to hide the links which accomplish this.
-
-{code}
- <span t:type="equanda/Tabs" t:id="tabs" t:exclude="-1">
- <t:parameter name="title1">First title</t:parameter>
- <t:parameter name="content1">
- <p>This is the content for the first tab</p>
- <p>With some more text</p>
- </t:parameter>
- <t:parameter name="title2">Another title pane</t:parameter>
- <t:parameter name="content2">
- <p>With even more content</p>
- </t:parameter>
- <t:parameter name="title3">Latin text</t:parameter>
- <t:parameter name="content3">
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero ipsum, volutpat nec, posuere vitae, pulvinar ut, quam. Morbi fringilla pulvinar nisi. Cras luctus leo sed orci. In id mi eget nunc blandit nonummy. Morbi at lacus. Ut sed elit. Donec libero. Sed feugiat tempor erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Nam lorem mi, accumsan id, commodo sit amet, interdum sit amet, augue.</p>
- <p>Cras massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum accumsan neque vitae odio. Phasellus luctus arcu quis nibh. Maecenas leo. Ut aliquam hendrerit odio. Vestibulum luctus diam nec enim. Nam mi. Etiam eros turpis, ultrices et, ullamcorper nec, posuere sed, nisi. Integer placerat risus sit amet purus. Nulla elit purus, consequat sed, blandit in, feugiat bibendum, quam. In hac habitasse platea dictumst. Ut vel lorem. Ut pharetra leo. Sed sit amet felis. Nunc sed eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed elit metus, euismod sed, laoreet a, aliquam a, enim.</p>
- </t:parameter>
- <t:parameter name="title4">Excluded Title</t:parameter>
- <t:parameter name="content4">
- Excluded content
- </t:parameter>
- <t:parameter name="contentAll">
- <p>This banner should be repeated on all pages.</p>
- </t:parameter>
- </span>
-{code}
-
-How the tabs are displayed is handled using CSS. Below is an example of styling for the CSS.
-
-{code}
-.eqTabs {
- padding:0 3em;
- width:80%;
-}
-.eqTabsT {
- float:left;
- width:100%;
- margin: 0 0 0 0;
- list-style:none;
-}
-.eqTabsT li {
- float:left;
- padding:0 .5em 0 0;
-}
-.eqTabsT a:link,
-.eqTabsT a:visited,
-.eqTabsT a:active,
-.eqTabsT a:hover {
- width: 8em;
- padding: .2em 1em;
- display: block;
- background: lightgray;
- color: black;
- font-weight: bold;
- text-decoration: none;
-}
-.eqTabsT a:hover {
- background: gray;
- color: white;
-}
-.eqTabsP {
- border: solid 1px;
- clear: both;
- width: auto;
-}
-.eqTabsAll {
- border-bottom: solid 1px;
- background: beige;
- padding: 1em;
-}
-.eqTabsPC {
- background: white;
- padding: 1em;
-}
-a.eqTabsA:link,
-a.eqTabsA:visited,
-a.eqTabsA:active,
-a.eqTabsA:hover {
- background:black;
- color:white;
-}
-.eqTravFw,
-.eqTravBw {
- display: none;
-}
-{code}
Deleted: trunk/src/site/wiki/tool/truncate.wiki
===================================================================
--- trunk/src/site/wiki/tool/truncate.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/truncate.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,38 +0,0 @@
-h1. Truncate
-
-Component which allows truncating text to a maximum length. When the text is longer than the limitation, the full text is still displayed on mouse-over.
-
-You have to pass the text, length and suffix as parameters to the truncate component.
-
-{code}
-<span t:type="equanda/Truncate" t:length="20" t:suffix="..." t:text="literal:Very very long text very very long text very very long text"/>
-{code}
-
-Length and suffix are optional parameters. Default values are 30 and "...".
-These can be overwritten in your AppModule using code like
-{code}
- public static void contributeDefaults( MappedConfiguration<String, String> configuration )
- {
- configuration.add( "equanda.truncate.default.length", "30" );
- configuration.add( "equanda.truncate.default.suffix", "..." );
- }
-{code}
-
-
-Style can be overridden by declaring CSS class eqTrunCt.
-
-Default style is:
-
-{code}
-.eqTrunCt {
- position: absolute;
- padding: 5px;
- border: 1px solid black;
- font: normal 12px Verdana;
- line-height: 18px;
- z-index: 100;
- background-color: white;
- width: 250px;
- filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=140,Strength=4);
-}
-{code}
\ No newline at end of file
Deleted: trunk/src/site/wiki/tool/validationtrackerdelegate.wiki
===================================================================
--- trunk/src/site/wiki/tool/validationtrackerdelegate.wiki 2008-12-03 11:38:48 UTC (rev 886)
+++ trunk/src/site/wiki/tool/validationtrackerdelegate.wiki 2008-12-03 11:44:47 UTC (rev 887)
@@ -1,44 +0,0 @@
-h1. ValidationTrackerDelegate
-
-This is a component which can help you forward messages to the validation tracker.
-
-It can for example be used when you have a page (or it can be a component surrounding your form) where the onActivate or beginRender phases can produce messaged which need to be displayed in the validation tracker in your page.
-
-In your page you have to add the validationdelegate component to add allow the propagation of the messages
-{code}
-<t:form>
- <t:equanda.ValidationTrackerDelegate/>
- <t:errors/>
-
- .....
-
-</t:form>
-{code}
-
-Please note that the _ValidationTrackerDelegate_ should be before the _t:errors_ component.
-
-In your page or component, you do something like the following
-{code}
-@Inject
-private Environment environment;
-
-private String keepMessage;
-
-public void onActivate()
-{
- .... do whatever needs to be done
-
- .... if there is a problem do the following
- keepMessage = "error message";
-}
-
-void beginRender()
-{
- if ( null != keepMessage ) environment.push( MessageContainer.class, new MessageContainer( keepMessage ) );
-}
-
-void afterRender()
-{
- if ( null != keepMessage ) environment.pop( MessageContainer.class );
-}
-{code}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2008-12-03 10:05:02
|
Revision: 885
http://equanda.svn.sourceforge.net/equanda/?rev=885&view=rev
Author: triathlon98
Date: 2008-12-03 10:04:57 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-287 documentation improvements
Modified Paths:
--------------
trunk/equanda-server/src/site/wiki/index.wiki
trunk/equanda-t5gui/src/site/wiki/index.wiki
trunk/src/site/site.xml
Added Paths:
-----------
trunk/src/site/wiki/t5gui.wiki
trunk/src/site/wiki/translation.wiki
Removed Paths:
-------------
trunk/equanda-t5gui/src/site/wiki/translation.wiki
Modified: trunk/equanda-server/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-server/src/site/wiki/index.wiki 2008-12-03 09:23:54 UTC (rev 884)
+++ trunk/equanda-server/src/site/wiki/index.wiki 2008-12-03 10:04:57 UTC (rev 885)
@@ -0,0 +1,7 @@
+h1. equanda-server
+
+The equanda-server module contains the classes are only used server side and are not needed on the client side.
+
+For more information about the the contents of this module can be found on the [project site|http://equanda.org/].
+
+equanda is a tool which helps you to build enterprise grade (JEE based) applications with minimal effort. Through code generation, a useful and functional base skeleton is created from the domain model. This application can be customized and the customizations remain active when the domain model changes and the skeleton is regenerated. This way, the cost of maintaining an evolving application is reduced by eliminating repetitive coding and assuring a consistent code base and user interface.
Modified: trunk/equanda-t5gui/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-t5gui/src/site/wiki/index.wiki 2008-12-03 09:23:54 UTC (rev 884)
+++ trunk/equanda-t5gui/src/site/wiki/index.wiki 2008-12-03 10:04:57 UTC (rev 885)
@@ -1,26 +1,7 @@
-h1. t5gui
+h1. equanda-t5gui
-These are classes which are used to build and equanda generated tapestry5 (crud) user interface for the domain model.
-Contrary to the tapestry5 component, this is equanda specific and not intended to be used without dependencies on the rest of equanda.
+The equanda-t5gui module contains some tapestry modules which can only be used as part of an equanda application.
-h2. Components
+For more information about the the contents of this module can be found on the [project site|http://equanda.org/].
-h2. Services
-
-h2. Coercions
-
-- java.util.Date <-> java.sql.Date : to allow using java.sql.Date objects with the (core) components
-- java.util.Date <-> java.sql.Timestamp : to allow using java.sql.Timestamp objects with the (core) components
-- String <-> UOID
-
-h2. Translators
-
-- UoidTranslator
-
-h2 Translation support
-
-The t5gui module defines a binding which can be used to use the translations as defined in the equanda specific translations files.
-This can be accessed using the "equanda-message" binding prefix (and the key as value).
-For details see [this page|translation.html].
-
-h2. Utility classes
\ No newline at end of file
+equanda is a tool which helps you to build enterprise grade (JEE based) applications with minimal effort. Through code generation, a useful and functional base skeleton is created from the domain model. This application can be customized and the customizations remain active when the domain model changes and the skeleton is regenerated. This way, the cost of maintaining an evolving application is reduced by eliminating repetitive coding and assuring a consistent code base and user interface.
Deleted: trunk/equanda-t5gui/src/site/wiki/translation.wiki
===================================================================
--- trunk/equanda-t5gui/src/site/wiki/translation.wiki 2008-12-03 09:23:54 UTC (rev 884)
+++ trunk/equanda-t5gui/src/site/wiki/translation.wiki 2008-12-03 10:04:57 UTC (rev 885)
@@ -1,60 +0,0 @@
-h1. Message Translation
-
-h2. equanda-message
-
-Equanda Message Translation is intended to translate messages to user's locale.
-
-In the page and component templates it uses "equanda-message" binding to identify the message to be translated.
-
-An example of using tapestry component with "equanda-message" binding:
-{code}
- <input t:type="TextField" t:label="equanda-message:edit.value.label" t:value="value"/>
-{code}
-
-also it can be used as simple property:
-
-{code}
- ${equanda-message:default.error.message}
-{code}
-
-Translated messages can be used in the java code of the page or component.
-To do this you need to inject EquandaMessages interface:
-
-{code}
- // Injecting messages
- @Inject
- private EquandaMessages messages;
-
- // Using EquandaMessages to translate message
- public String getErrorMessage()
- {
- return messages.get( "error" );
- }
-{code}
-
-Default translation dictionary in the translations-common.txt file and can be extended by creating a custom translations.txt file.
-
-Translator uses contexts to find specific messages.
-Default contexts is:
- /page-name/,
- "equanda-table",
- "equanda-fixed",
- "equanda-exceptions",
- "app"
- "app-exceptions"
-and they can be replaced in the tapestry pages by implementing EquandaMessagesGroup interface and using getMessagesGroups() method.
-
-When overriding the message groups, it is recommended to include these anyway.
-In principle, you should add translations are in the page specific or "app" contexts (or exceptions in "app-exceptions".
-The translations which are in the "equanda-table" context can be deleted from the translations file using the translations tool when that key is no longer relevant based on the domain model.
-
-
-h2. has-equanda-message
-
-There is a specific binding which only tests whether there is a message for a given string. It's purpose is to combine with the tapestry if component.
-For example in the field template.
-{code}
-<t:if test="has-equanda-message:field.${table.Name}.${field.Name}.help">
-<div class="eqFldC">${dollar}{equanda-message:field.${table.Name}.${field.Name}.help}</div>
-</t:if>
-{code}
Modified: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2008-12-03 09:23:54 UTC (rev 884)
+++ trunk/src/site/site.xml 2008-12-03 10:04:57 UTC (rev 885)
@@ -47,6 +47,15 @@
<item name="docs" href="templates/docs.html"/>
</menu>
+ <menu name="tapestry5">
+ <item name="tapestry5" href="equanda-tapestry5/index.html"/>
+ </menu>
+
+ <menu name="t5gui">
+ <item name="t5gui" href="t5gui.html"/>
+ <item name="Translate" href="translation.html"/>
+ </menu>
+
<menu name="maven-plugin">
<item name="Generate" href="plugin/generate.html"/>
<item name="Translate" href="plugin/translate.html"/>
Added: trunk/src/site/wiki/t5gui.wiki
===================================================================
--- trunk/src/site/wiki/t5gui.wiki (rev 0)
+++ trunk/src/site/wiki/t5gui.wiki 2008-12-03 10:04:57 UTC (rev 885)
@@ -0,0 +1,26 @@
+h1. t5gui
+
+These are classes which are used to build and equanda generated tapestry5 (crud) user interface for the domain model.
+Contrary to the tapestry5 component, this is equanda specific and not intended to be used without dependencies on the rest of equanda.
+
+h2. Components
+
+h2. Services
+
+h2. Coercions
+
+- java.util.Date <-> java.sql.Date : to allow using java.sql.Date objects with the (core) components
+- java.util.Date <-> java.sql.Timestamp : to allow using java.sql.Timestamp objects with the (core) components
+- String <-> UOID
+
+h2. Translators
+
+- UoidTranslator
+
+h2 Translation support
+
+The t5gui module defines a binding which can be used to use the translations as defined in the equanda specific translations files.
+This can be accessed using the "equanda-message" binding prefix (and the key as value).
+For details see [this page|translation.html].
+
+h2. Utility classes
\ No newline at end of file
Copied: trunk/src/site/wiki/translation.wiki (from rev 883, trunk/equanda-t5gui/src/site/wiki/translation.wiki)
===================================================================
--- trunk/src/site/wiki/translation.wiki (rev 0)
+++ trunk/src/site/wiki/translation.wiki 2008-12-03 10:04:57 UTC (rev 885)
@@ -0,0 +1,60 @@
+h1. Message Translation
+
+h2. equanda-message
+
+Equanda Message Translation is intended to translate messages to user's locale.
+
+In the page and component templates it uses "equanda-message" binding to identify the message to be translated.
+
+An example of using tapestry component with "equanda-message" binding:
+{code}
+ <input t:type="TextField" t:label="equanda-message:edit.value.label" t:value="value"/>
+{code}
+
+also it can be used as simple property:
+
+{code}
+ ${equanda-message:default.error.message}
+{code}
+
+Translated messages can be used in the java code of the page or component.
+To do this you need to inject EquandaMessages interface:
+
+{code}
+ // Injecting messages
+ @Inject
+ private EquandaMessages messages;
+
+ // Using EquandaMessages to translate message
+ public String getErrorMessage()
+ {
+ return messages.get( "error" );
+ }
+{code}
+
+Default translation dictionary in the translations-common.txt file and can be extended by creating a custom translations.txt file.
+
+Translator uses contexts to find specific messages.
+Default contexts is:
+ /page-name/,
+ "equanda-table",
+ "equanda-fixed",
+ "equanda-exceptions",
+ "app"
+ "app-exceptions"
+and they can be replaced in the tapestry pages by implementing EquandaMessagesGroup interface and using getMessagesGroups() method.
+
+When overriding the message groups, it is recommended to include these anyway.
+In principle, you should add translations are in the page specific or "app" contexts (or exceptions in "app-exceptions".
+The translations which are in the "equanda-table" context can be deleted from the translations file using the translations tool when that key is no longer relevant based on the domain model.
+
+
+h2. has-equanda-message
+
+There is a specific binding which only tests whether there is a message for a given string. It's purpose is to combine with the tapestry if component.
+For example in the field template.
+{code}
+<t:if test="has-equanda-message:field.${table.Name}.${field.Name}.help">
+<div class="eqFldC">${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.
|