You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(51) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ola H. T. <ol...@st...> - 2005-02-28 14:59:26
|
jakobjp er oppe, prøvde å ringe, men ikke no svar. -- regards, Ola Hodne Titlestad HISP University of Oslo --------------------- > Hei, > > av det som står under kan det virke som om vi selv er ansvarlige for å ta > backup. Eller er det automatiske rutiner de står for i Tyskland? > > Ellers så hadde jeg planer om å ringe denne Jakob nå, men nå var også > jakobjp.com nede (så tlf nr der før idag, men noterte det selvsagt ikke) > > Håper for faen ikke denne Jakob er et spøkelse som er blitt borte for oss > nå.... > > Når er du på kontoret igjen Knut? > > Ola > > >> --- Jakob Jensen Pruehs <ma...@ja...> skrev: >>> Tema: Serverdata >>> Dato: Fri, 31 Dec 2004 12:34:38 +0100 >>> Fra: "Jakob Jensen Pruehs" <ma...@ja...> >>> Til: <kn...@if...> >>> >>> Kære Kunde >>> >>> Din T1 server er blevet oprettet. >>> >>> Servernavn: h59622.serverkompetenz.net >>> >>> (Der kan godt gå noget tid, inden domænet er kommet igennem hos alle >>> DNS Servere) >>> >>> IP-Adresse: 81.169.174.228 >>> >>> Styresystem: Debian >>> >>> Brugernavn til SSH: root >>> >>> Kodeord til root og backup: E2mSNcDd >>> >>> Adresse til FTP-Backupspace: backup.serverkompetenz.de >>> >>> Brugernavn til FTP-Backupspace: b005576 >>> >>> Kodeord til FTP-Backupspace: (Samme som kodeordet til root) >>> >>> Bemærk følgende ved Backupserveren: >>> >>> - Trafik mellem din server og backup-serveren er "intern" trafik, og >>> er derfor gratis. >>> >>> - Det kan godt tage et par timer, inden din backupaccount er klar. >>> >>> - Af sikkerhedsmæssige årsager, kan man ikke forbinde til >>> backupserveren udefra. Det er således kun via din egen server, at du >>> kan oprette en forbindelse til din backupplads. >>> >>> God fornøjelse ;-) >>> >>> Mvh >>> >>> Jakobjp.com >>> >>> >> >> >> ------------------------------------------------------- >> The SF.Net email is sponsored by: Beat the post-holiday blues >> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. >> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt >> _______________________________________________ >> Jdhis-inf5750 mailing list >> Jdh...@li... >> https://lists.sourceforge.net/lists/listinfo/jdhis-inf5750 >> > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Jdhis-inf5750 mailing list > Jdh...@li... > https://lists.sourceforge.net/lists/listinfo/jdhis-inf5750 > |
From: Ola H. T. <ol...@st...> - 2005-02-28 14:55:16
|
Hei, av det som står under kan det virke som om vi selv er ansvarlige for å ta backup. Eller er det automatiske rutiner de står for i Tyskland? Ellers så hadde jeg planer om å ringe denne Jakob nå, men nå var også jakobjp.com nede (så tlf nr der før idag, men noterte det selvsagt ikke) Håper for faen ikke denne Jakob er et spøkelse som er blitt borte for oss nå.... Når er du på kontoret igjen Knut? Ola > --- Jakob Jensen Pruehs <ma...@ja...> skrev: >> Tema: Serverdata >> Dato: Fri, 31 Dec 2004 12:34:38 +0100 >> Fra: "Jakob Jensen Pruehs" <ma...@ja...> >> Til: <kn...@if...> >> >> Kære Kunde >> >> Din T1 server er blevet oprettet. >> >> Servernavn: h59622.serverkompetenz.net >> >> (Der kan godt gå noget tid, inden domænet er kommet igennem hos alle >> DNS Servere) >> >> IP-Adresse: 81.169.174.228 >> >> Styresystem: Debian >> >> Brugernavn til SSH: root >> >> Kodeord til root og backup: E2mSNcDd >> >> Adresse til FTP-Backupspace: backup.serverkompetenz.de >> >> Brugernavn til FTP-Backupspace: b005576 >> >> Kodeord til FTP-Backupspace: (Samme som kodeordet til root) >> >> Bemærk følgende ved Backupserveren: >> >> - Trafik mellem din server og backup-serveren er "intern" trafik, og >> er derfor gratis. >> >> - Det kan godt tage et par timer, inden din backupaccount er klar. >> >> - Af sikkerhedsmæssige årsager, kan man ikke forbinde til >> backupserveren udefra. Det er således kun via din egen server, at du >> kan oprette en forbindelse til din backupplads. >> >> God fornøjelse ;-) >> >> Mvh >> >> Jakobjp.com >> >> > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Jdhis-inf5750 mailing list > Jdh...@li... > https://lists.sourceforge.net/lists/listinfo/jdhis-inf5750 > |
From: <ol...@st...> - 2005-01-31 10:56:00
|
Author: olati Date: 2005-01-31 11:55:37 +0100 (Mon, 31 Jan 2005) New Revision: 64 Added: code/svnexample/ Log: o added a test dir for use in class |
Author: trygvela Date: 2005-01-26 10:04:41 +0100 (Wed, 26 Jan 2005) New Revision: 63 Added: code/dhis-2/LICENSE.txt code/dhis-2/checkstyle-license.txt code/dhis-2/checkstyle.xml code/dhis-2/dhis-cli/LICENSE.txt code/dhis-2/dhis-cli/project.properties code/dhis-2/dhis-core/LICENSE.txt code/dhis-2/dhis-core/project.properties code/dhis-2/dhis-data-store/LICENSE.txt code/dhis-2/dhis-data-store/project.properties code/dhis-2/dhis-form/LICENSE.txt code/dhis-2/dhis-form/project.properties code/dhis-2/dhis-support-hibernate/LICENSE.txt code/dhis-2/dhis-support-hibernate/project.properties code/dhis-2/dhis-support-test/LICENSE.txt code/dhis-2/dhis-support-test/project.properties code/dhis-2/project.properties Modified: code/dhis-2/dhis-cli/project.xml code/dhis-2/dhis-core/project.xml code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml code/dhis-2/dhis-data-store/project.xml code/dhis-2/dhis-form/project.xml code/dhis-2/dhis-support-hibernate/project.xml code/dhis-2/dhis-support-test/project.xml code/dhis-2/project.xml Log: Added: code/dhis-2/LICENSE.txt =================================================================== --- code/dhis-2/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/checkstyle-license.txt =================================================================== --- code/dhis-2/checkstyle-license.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/checkstyle-license.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,28 @@ + + +/* + * Copyright (c) 2004-2005, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the <ORGANIZATION> nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ Added: code/dhis-2/checkstyle.xml =================================================================== --- code/dhis-2/checkstyle.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/checkstyle.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,176 @@ +<?xml version="1.0"?> +<!-- +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + --> + +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.1//EN" + "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> + +<!-- + Checkstyle checks configured for Maven. +--> + +<module name="Checker"> + + <!-- Checks that a package.html file exists for each package. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> + <module name="PackageHtml"/> + + <!-- Checks whether files end with a new line. --> + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> + <module name="NewlineAtEndOfFile"/> + + <!-- Checks that property files contain the same keys. --> + <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> + <module name="Translation"/> + + <module name="TreeWalker"> + + <property name="cacheFile" value="${checkstyle.cache.file}"/> + + <!-- ************************************************************** --> + <!-- Checks that are different from the sun coding conventions ones --> + <!-- ************************************************************** --> + <module name="Header"> + <property name="headerFile" value="${maven.checkstyle.header.file}"/> + <property name="ignoreLines" value="1,2,3,4,5,6"/> + </module> + <property name="tabWidth" value="4"/> + <module name="LeftCurly"> + <property name="option" value="nl"/> + </module> + <module name="RightCurly"> + <property name="option" value="alone"/> + </module> + <module name="LineLength"> + <property name="max" value="132"/> + </module> + <module name="MethodLength"> + <property name="max" value="175"/> + </module> + <!-- No Paren pad check + <module name="ParenPad"/> + --> + <module name="ConstantName"> + <property name="format" value="log|^[a-zA-Z][a-zA-Z0-9_]*$"/> + </module> + + <!-- ************************************************************** --> + <!-- Default Sun coding conventions checks --> + <!-- ************************************************************** --> + + <!-- Checks for Javadoc comments. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html --> + <!-- trygvela + <module name="JavadocMethod"/> + <module name="JavadocType"/> + <module name="JavadocVariable"/> + --> + + + <!-- Checks for Naming Conventions. --> + <!-- See http://checkstyle.sf.net/config_naming.html --> + <module name="LocalFinalVariableName"/> + <module name="LocalVariableName"/> + <module name="MethodName"/> + <module name="PackageName"/> + <module name="ParameterName"/> + <module name="StaticVariableName"/> + <module name="TypeName"/> + <module name="MemberName"/> + + <!-- Checks for imports --> + <!-- See http://checkstyle.sf.net/config_import.html --> + <module name="AvoidStarImport"/> + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + + + <!-- Checks for Size Violations. --> + <!-- See http://checkstyle.sf.net/config_sizes.html --> + <module name="FileLength"/> + <module name="ParameterNumber"/> + + + <!-- Checks for whitespace --> + <!-- See http://checkstyle.sf.net/config_whitespace.html --> + <module name="EmptyForIteratorPad"/> + <module name="NoWhitespaceAfter"/> + <module name="NoWhitespaceBefore"/> + <module name="OperatorWrap"/> + <module name="TabCharacter"/> + <module name="WhitespaceAfter"/> + <module name="WhitespaceAround"/> + + + <!-- Modifier Checks --> + <!-- See http://checkstyle.sf.net/config_modifiers.html --> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + + + <!-- Checks for blocks. You know, those {}'s --> + <!-- See http://checkstyle.sf.net/config_blocks.html --> + <module name="AvoidNestedBlocks"/> + <module name="EmptyBlock"/> + + <module name="NeedBraces"/> + + + <!-- Checks for common coding problems --> + <!-- See http://checkstyle.sf.net/config_coding.html --> + <module name="AvoidInlineConditionals"/> + <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> + <module name="EmptyStatement"/> + <module name="EqualsHashCode"/> + <module name="HiddenField"> + <property name="ignoreSetter" value="true"/> + <property name="ignoreConstructorParameter" value="true"/> + </module> + <module name="IllegalInstantiation"/> + <module name="InnerAssignment"/> + <module name="MagicNumber"/> + <module name="MissingSwitchDefault"/> + <!--<module name="RedundantThrows"/>--> + <module name="SimplifyBooleanExpression"/> + <module name="SimplifyBooleanReturn"/> + + <!-- Checks for class design --> + <!-- See http://checkstyle.sf.net/config_design.html --> + <!--<module name="DesignForExtension"/>--> + <module name="FinalClass"/> + <module name="HideUtilityClassConstructor"/> + <module name="InterfaceIsType"/> + <module name="VisibilityModifier"/> + + + <!-- Miscellaneous other checks. --> + <!-- See http://checkstyle.sf.net/config_misc.html --> + <module name="ArrayTypeStyle"/> + <!-- <module name="FinalParameters"/> --> + <module name="GenericIllegalRegexp"> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> + <module name="TodoComment"/> + <module name="UpperEll"/> + + </module> + +</module> Added: code/dhis-2/dhis-cli/LICENSE.txt =================================================================== --- code/dhis-2/dhis-cli/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-cli/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/dhis-cli/project.properties =================================================================== --- code/dhis-2/dhis-cli/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-cli/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,2 @@ +maven.checkstyle.properties = ${basedir}/../checkstyle.xml +maven.checkstyle.header.file = ${basedir}/../checkstyle-license.txt Modified: code/dhis-2/dhis-cli/project.xml =================================================================== --- code/dhis-2/dhis-cli/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-cli/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -5,6 +5,11 @@ <artifactId>dhis-cli</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS Command Line Interface</name> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-cli</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-cli</developerConnection> + <url>http://svn.dhis.hisp.info/dhis-cli</url> + </repository> <dependencies> <!-- DHIS CLI --> <dependency> Added: code/dhis-2/dhis-core/LICENSE.txt =================================================================== --- code/dhis-2/dhis-core/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/dhis-core/project.properties =================================================================== --- code/dhis-2/dhis-core/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,2 @@ +maven.checkstyle.properties = ${basedir}/../checkstyle.xml +maven.checkstyle.header.file = ${basedir}/../checkstyle-license.txt Modified: code/dhis-2/dhis-core/project.xml =================================================================== --- code/dhis-2/dhis-core/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -5,6 +5,11 @@ <artifactId>dhis-core</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS Core</name> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-core</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-core</developerConnection> + <url>http://svn.dhis.hisp.info/dhis-core</url> + </repository> <dependencies> <!-- --> <dependency> Modified: code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java =================================================================== --- code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java 2005-01-26 09:04:41 UTC (rev 63) @@ -1,5 +1,32 @@ package org.hisp.dhis.transaction; +/* + * Copyright (c) 2004-2005, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the <ORGANIZATION> nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; @@ -38,7 +65,7 @@ return ret; } - catch( Throwable t ) + catch ( Throwable t ) { System.err.println( "Aborting transaction because of: " + t.getMessage() ); Modified: code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java =================================================================== --- code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java 2005-01-26 09:04:41 UTC (rev 63) @@ -1,5 +1,32 @@ package org.hisp.dhis.transaction; +/* + * Copyright (c) 2004-2005, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the <ORGANIZATION> nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + /** * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> * @version $Id:$ Modified: code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java =================================================================== --- code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java 2005-01-26 09:04:41 UTC (rev 63) @@ -1,5 +1,32 @@ package org.hisp.dhis.transaction; +/* + * Copyright (c) 2004-2005, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the <ORGANIZATION> nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + /** * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> * @version $Id:$ Modified: code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml =================================================================== --- code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -6,7 +6,7 @@ <beans> <bean id="transactionInterceptor" - class="org.hisp.dhis.transaction.TransactionInterceptor"> + class="org.hisp.dhis.transaction.TransactionInterceptor"> <property name="transactionManager"> <ref bean="org.hisp.dhis.transaction.TransactionManager"/> </property> Added: code/dhis-2/dhis-data-store/LICENSE.txt =================================================================== --- code/dhis-2/dhis-data-store/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-data-store/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/dhis-data-store/project.properties =================================================================== --- code/dhis-2/dhis-data-store/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-data-store/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,2 @@ +maven.checkstyle.properties = ${basedir}/../checkstyle.xml +maven.checkstyle.header.file = ${basedir}/../checkstyle-license.txt Modified: code/dhis-2/dhis-data-store/project.xml =================================================================== --- code/dhis-2/dhis-data-store/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-data-store/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -5,6 +5,11 @@ <groupId>dhis</groupId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS Data Store</name> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-data-store</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-data-store</developerConnection> + <url>http://svn.dhis.hisp.info/dhis-data-store</url> + </repository> <dependencies> <!-- DHIS --> <dependency> Added: code/dhis-2/dhis-form/LICENSE.txt =================================================================== --- code/dhis-2/dhis-form/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-form/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/dhis-form/project.properties =================================================================== --- code/dhis-2/dhis-form/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-form/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,2 @@ +maven.checkstyle.properties = ${basedir}/../checkstyle.xml +maven.checkstyle.header.file = ${basedir}/../checkstyle-license.txt Modified: code/dhis-2/dhis-form/project.xml =================================================================== --- code/dhis-2/dhis-form/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-form/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -5,6 +5,11 @@ <artifactId>dhis-form</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS Form</name> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-form</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-form</developerConnection> + <url>http://svn.dhis.hisp.info/dhis-form</url> + </repository> <dependencies> <!-- DHIS --> <dependency> Added: code/dhis-2/dhis-support-hibernate/LICENSE.txt =================================================================== --- code/dhis-2/dhis-support-hibernate/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-support-hibernate/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/dhis-support-hibernate/project.properties =================================================================== --- code/dhis-2/dhis-support-hibernate/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-support-hibernate/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,2 @@ +maven.checkstyle.properties = ${basedir}/../checkstyle.xml +maven.checkstyle.header.file = ${basedir}/../checkstyle-license.txt Modified: code/dhis-2/dhis-support-hibernate/project.xml =================================================================== --- code/dhis-2/dhis-support-hibernate/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-support-hibernate/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -5,6 +5,11 @@ <artifactId>dhis-support-hibernate</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS Hibernate Support</name> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-support-hibernate</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-support-hibernate</developerConnection> + <url>http://svn.dhis.hisp.info/dhis-support-hibernate</url> + </repository> <dependencies> <!-- DHIS --> <dependency> Added: code/dhis-2/dhis-support-test/LICENSE.txt =================================================================== --- code/dhis-2/dhis-support-test/LICENSE.txt 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-support-test/LICENSE.txt 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,24 @@ +Copyright (c) 2004-2005, University of Oslo +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the <ORGANIZATION> nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: code/dhis-2/dhis-support-test/project.properties =================================================================== --- code/dhis-2/dhis-support-test/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-support-test/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,2 @@ +maven.checkstyle.properties = ${basedir}/../checkstyle.xml +maven.checkstyle.header.file = ${basedir}/../checkstyle-license.txt Modified: code/dhis-2/dhis-support-test/project.xml =================================================================== --- code/dhis-2/dhis-support-test/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/dhis-support-test/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -5,6 +5,11 @@ <artifactId>dhis-support-test</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS Testing Support</name> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-support-test</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/dhis-support-test</developerConnection> + <url>http://svn.dhis.hisp.info/dhis-support-test</url> + </repository> <dependencies> <!-- Spring --> <dependency> Added: code/dhis-2/project.properties =================================================================== --- code/dhis-2/project.properties 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/project.properties 2005-01-26 09:04:41 UTC (rev 63) @@ -0,0 +1,8 @@ +maven.checkstyle.properties = ${basedir}/checkstyle.xml +maven.checkstyle.header.file = ${basedir}/checkstyle-license.txt + +maven.xdoc.date = left +maven.xdoc.date.format = dd MMMM yyyy HH:mm z +maven.xdoc.poweredby.image=maven-propaganda.png + +maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory Modified: code/dhis-2/project.xml =================================================================== --- code/dhis-2/project.xml 2005-01-19 09:16:21 UTC (rev 62) +++ code/dhis-2/project.xml 2005-01-26 09:04:41 UTC (rev 63) @@ -4,6 +4,22 @@ <artifactId>dhis</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> <name>DHIS 2</name> + <package>org.hisp.dhis</package> + <organization> + <name>Health Information System Programme</name> + <url>http://www.hisp.info</url> + <!-- + <logo></logo> + --> + </organization> + <inceptionYear>2004</inceptionYear> + <siteAddress>dhis.hisp.info</siteAddress> + <siteDirectory>/home/projects/dhis/public_html</siteDirectory> + <repository> + <connection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/</connection> + <developerConnection>scm:svn:svn+ssh://svn.dhis.hisp.info/home/projects/dhis/scm:/</developerConnection> + <url>http://svn.dhis.hisp.info/</url> + </repository> <build> <sourceDirectory>src/main/java</sourceDirectory> <unitTestSourceDirectory>src/test/java</unitTestSourceDirectory> |
From: <ol...@st...> - 2005-01-19 09:16:33
|
Author: olati Date: 2005-01-19 10:16:21 +0100 (Wed, 19 Jan 2005) New Revision: 62 Removed: code/assignments/dhis-oblig-1-trygvela/ Log: |
From: Ola H. T. <ol...@st...> - 2005-01-16 11:03:33
|
Ups, var litt kjapp på send-avtrekkern i stad. Var meninga å skrive litt også. Trygve, hva er status på subversion og Qmail på servern vår. Vi må ha det på plass så fort som mulig nå. Som Knut skriver under, det haster mtp vietnameserne også. Ola > > -- > regards, > Ola Hodne Titlestad > HISP > University of Oslo > --------------------- > > > ---------------------------- Original Message ---------------------------- > Subject: Fwd: Re: Plan for HCMC > From: "Knut Staring" <kn...@ya...> > Date: Sun, January 16, 2005 2:08 am > To: jb...@if... > "Kristian" <kr...@st...> > ol...@st... > -------------------------------------------------------------------------- > > Hei Ola, > > Hanoi er temmelig kaldt naa (trodde Thanh overdrev), men artig aa vaere > her. Skal til Halong Bay i dag (igjen litt feil sesong, men,men). > > Kristian og jeg kommer til aa sette oss i morgen og tirsdag for aa komme > under huden paa jasper og tilliggende herligheter foer Hue paa onsdag. > Ogsaa viktig aa se det i sammenheng med det som gjoeres i India - jeg skal > gi Trond og Lars spekk i morra. > > En viktig sak: Vi boer vel snarest faa Subversion opp i tyskland, saa alle > kan faa tilgang? > > Knut > > --- Ola Hodne Titlestad <ol...@st...> skrev: >> Dato: Fri, 14 Jan 2005 10:29:21 +0100 (CET) >> Tema: Re: Plan for HCMC >> Fra: "Ola Hodne Titlestad" <ol...@st...> >> Til: "Knut Staring" <kn...@ya...> >> >> Kikka på planen, så bra ut den. >> >> Har lagt til Lars sin plan for RD modulen. >> >> Har ikke planlagt å trekke inn fler norske i de to modulene der, så det >> er >> ikke så mye å synche. Samarbeid med Hue blir viktigere. Der skal de lage >> en rapport modul som lager/genererer rapportene (dvs. JasperReports med >> eget GUI og lit bruker input), og denne rapport modulen skal jo kunne > bruke rapport designene/templates (XML filene) fra RD modulen. Så for å >> kunne gjøre no skikkelig testing på RD trenger man en simpel rapport > generator, en enkel versjon av rapport modulen til Hue. >> >> Har noen tanker om passende test-caser for RD modulen. Ser spesielt for >> meg to caser: >> >> 1. Designe standard rapportene for de tre programmene DHIS brukes til i > HCM: >> 1. Family Planning >> 2. Children care >> 3. Vaccination >> >> Disse tre rapportene er allerede laget/hardkodet i en VB modul, så >> dette >> er en fin første-test. >> >> 2. Designe en skreddersydd rapport for lokal bruk i et gitt >> distriktskontor >> >> Sitte sammen men Dr. Hung på District 4 og lage en rapport han kan bruke >> i >> rutinemessige møter med sine underansatte. Han har nevnt et ønske om å >> kunne ha med grafer i rapportene. >> >> Skal selvsagt skrive dette inn i Confluence seinere, bare litt >> brainstorming foreløpig. >> >> Stå på og hils troppene >> >> Ola >> >> >> -- >> regards, >> Ola Hodne Titlestad >> HISP >> University of Oslo >> --------------------- >> >> > Hei, >> > >> > Som du veit maser'em om planer her. Kristian og jeg har slengt >> sammen >> > noe foreløpig i Confluence, fint om du tar en titt. Skal diskutere >> det >> > med Thanh, Ho og studentene om 10 minutter....Men det viktigste er >> hva >> > de gjør mens vi er borte, regner med at planen må både forfines og > omstruktureres om noen uker, når vi veit mer om deres innsikt, hvor > fort ting går, problemer etc. >> > >> > Ta en titt på >> > http://www.hisp.info/confluence/display/DHIS2/Plan+for+HCMC+team >> > >> > Knut >> > >> >> >> > > > |
From: Ola H. T. <ol...@st...> - 2005-01-16 10:59:25
|
-- regards, Ola Hodne Titlestad HISP University of Oslo --------------------- ---------------------------- Original Message ---------------------------- Subject: Fwd: Re: Plan for HCMC From: "Knut Staring" <kn...@ya...> Date: Sun, January 16, 2005 2:08 am To: jb...@if... "Kristian" <kr...@st...> ol...@st... -------------------------------------------------------------------------- Hei Ola, Hanoi er temmelig kaldt naa (trodde Thanh overdrev), men artig aa vaere her. Skal til Halong Bay i dag (igjen litt feil sesong, men,men). Kristian og jeg kommer til aa sette oss i morgen og tirsdag for aa komme under huden paa jasper og tilliggende herligheter foer Hue paa onsdag. Ogsaa viktig aa se det i sammenheng med det som gjoeres i India - jeg skal gi Trond og Lars spekk i morra. En viktig sak: Vi boer vel snarest faa Subversion opp i tyskland, saa alle kan faa tilgang? Knut --- Ola Hodne Titlestad <ol...@st...> skrev: > Dato: Fri, 14 Jan 2005 10:29:21 +0100 (CET) > Tema: Re: Plan for HCMC > Fra: "Ola Hodne Titlestad" <ol...@st...> > Til: "Knut Staring" <kn...@ya...> > > Kikka på planen, så bra ut den. > > Har lagt til Lars sin plan for RD modulen. > > Har ikke planlagt å trekke inn fler norske i de to modulene der, så det er > ikke så mye å synche. Samarbeid med Hue blir viktigere. Der skal de lage > en rapport modul som lager/genererer rapportene (dvs. JasperReports med > eget GUI og lit bruker input), og denne rapport modulen skal jo kunne bruke rapport designene/templates (XML filene) fra RD modulen. Så for å > kunne gjøre no skikkelig testing på RD trenger man en simpel rapport generator, en enkel versjon av rapport modulen til Hue. > > Har noen tanker om passende test-caser for RD modulen. Ser spesielt for > meg to caser: > > 1. Designe standard rapportene for de tre programmene DHIS brukes til i HCM: > 1. Family Planning > 2. Children care > 3. Vaccination > > Disse tre rapportene er allerede laget/hardkodet i en VB modul, så dette > er en fin første-test. > > 2. Designe en skreddersydd rapport for lokal bruk i et gitt > distriktskontor > > Sitte sammen men Dr. Hung på District 4 og lage en rapport han kan bruke i > rutinemessige møter med sine underansatte. Han har nevnt et ønske om å > kunne ha med grafer i rapportene. > > Skal selvsagt skrive dette inn i Confluence seinere, bare litt > brainstorming foreløpig. > > Stå på og hils troppene > > Ola > > > -- > regards, > Ola Hodne Titlestad > HISP > University of Oslo > --------------------- > > > Hei, > > > > Som du veit maser'em om planer her. Kristian og jeg har slengt > sammen > > noe foreløpig i Confluence, fint om du tar en titt. Skal diskutere > det > > med Thanh, Ho og studentene om 10 minutter....Men det viktigste er > hva > > de gjør mens vi er borte, regner med at planen må både forfines og omstruktureres om noen uker, når vi veit mer om deres innsikt, hvor fort ting går, problemer etc. > > > > Ta en titt på > > http://www.hisp.info/confluence/display/DHIS2/Plan+for+HCMC+team > > > > Knut > > > > > |
From: Knut S. <kn...@ya...> - 2005-01-11 13:13:42
|
--- "jakobjp.com - Support" <su...@ja...> skrev: > Til: Knut Staring <kn...@if...> > Tema: Ny hjemmeside med Support-Center hos jakobjp.com! > Fra: jakobjp.com - Support <su...@ja...> > Dato: Mon, 10 Jan 2005 00:07:55 +0100 (CET) > > Kære Knut Staring > > Du modtager denne informationsmail som kunde hos jakobjp.com. > > I denne weekend har vi sat vores nye hjemmeside online. > Den byder på et bedre overblik over vores produkter og ydelser, samt > et integreret Support-Center. > I Support-Centeret kan du se dine kunde-, produkt- og faktura-data, > og du kan til enhver tid downloade dine regninger som PDF. > Dette er kun det første skridt på vejen til at lave et meget > omfattende Support-Center :-) > > Hvis du på et tidspunkt ønsker at bestille et produkt mere hos os, så > er det vigtigt at du først logger dig ind i Support-Centeret, > hvorefter du bestiller det ønskede produkt. > På den måde vil dine kundedate allerede være kendt i > bestillingssystemet, og du behøver ikke indtaste dem igen! > > Vigtigt: > Første gang du vil logge dig ind i Support-Centeret, skal du bruge > "Glemt kodeord" funktionen. > Indtast da dit (nye) kundenummer og den e-mail adresse der er gemt i > vores database (samme som har modtaget denne e-mail). > Du vil så få et kodeord tilsendt per e-mail. > > ------------------------- > > Udover dette er der også sket nogle andre forandringer: > > 1) Dit kundenummer > Dit kundenummer er blevet sat 1.000 op! Det betyder at hvis du havde > kundenr. 567 før, så har du nr. 1567 nu! > Vi har gjort dette for at samtlige kundenumre nu er 4-cifrede, i > stedet for en blanding af 3 og 4 cifrede kundenumre. > > 2) Priser > Der er sket en del forandringer på vores priser! Det gælder næsten > alle produkter. > Se vores hjemmeside for yderligere informationer. > > 3) Trafik > T-Serien har fået yderligere 100 GB fri trafik per måned oveni! > Naturligvis uden at det har haft negativ indflydelse på prisen. > Da vi startede T-Serien (T1, T2 og T3) for ca. 1/2 år siden havde de > tre servermodeller 100, 150 og 200 GB fri trafik. > Nu er de oppe på 300, 400 og 500 GB fri trafik! > R-Serien har fået 50% mere trafik på trods af at prisen er faldet med > ca. 20%! > R1-pakken har nu 30 GB, og R2-pakken har nu 40 GB fri trafik per > måned. > > (Pris- og trafik-forandringer gælder kun for nye bestillinger) > > ------------------------- > > Tilbud: FLATRATE-Server!!! > Vi har et specielt tilbud til alle dem, som virkelig har brug for > meget trafik! > En dedikeret server med 10 Mbit flatrate! > Hardwaresammensætningen kan ske individuelt. > Der kan fås Suse 9, Debian 3, Windows 2003 Web og Windows 2003 Std. > Edition. > Derudover kan man få administrationsprogrammet Plesk til både Linux > og Windows. > > Eksempel 1: > 2,0 Ghz Intel Celeron > 256 MB RAM > 40 GB HD > Linux OS > 10 Mbit flatrate > Pris: 1.200,- DKK > Oprettelse: 600,- DKK > > Eksempel 2: > 3,0 Ghz Intel P4 > 2048 MB RAM > 160 GB HD > Linux OS > 10 Mbit flatrate > Pris: 1.600,- DKK > Oprettelse: 1200,- DKK > > Flatrate-Serverne kan kun bestilles indtil den 01.02.2005. > Bestillingen sker via e-mail til ma...@ja..., hvor man blot > behøver at skrive sit "ønske-system" op - så modtager du et > individuelt tilbud fra os! > For yderligere informationer kan du skrive til os. > > ------------------------- > > Vi ønsker dig fortsat god fornøjelse med din server! > > Med venlig hilsen > Jakobjp.com > > > > |
Author: trygvela Date: 2005-01-10 03:48:39 +0100 (Mon, 10 Jan 2005) New Revision: 61 Added: code/dhis-2/dhis-core/ code/dhis-2/dhis-core/project.xml code/dhis-2/dhis-core/src/ code/dhis-2/dhis-core/src/main/ code/dhis-2/dhis-core/src/main/java/ code/dhis-2/dhis-core/src/main/java/org/ code/dhis-2/dhis-core/src/main/java/org/hisp/ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java code/dhis-2/dhis-core/src/main/resources/ code/dhis-2/dhis-core/src/main/resources/META-INF/ code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/ code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml code/dhis-2/dhis-core/src/test/ code/dhis-2/dhis-core/src/test/java/ code/dhis-2/dhis-core/src/test/java/org/ code/dhis-2/dhis-core/src/test/java/org/hisp/ code/dhis-2/dhis-core/src/test/java/org/hisp/dhis/ code/dhis-2/dhis-core/src/test/java/org/hisp/dhis/transaction/ code/dhis-2/dhis-core/src/test/resources/ code/dhis-2/dhis-support-hibernate/src/main/java/org/hisp/dhis/transaction/ code/dhis-2/dhis-support-hibernate/src/main/java/org/hisp/dhis/transaction/HibernateTransactionManager.java code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/transaction/ code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/transaction/HibernateTransactionManagerTest.java Modified: code/dhis-2/dhis-cli/project.xml code/dhis-2/dhis-data-store/project.xml code/dhis-2/dhis-data-store/src/main/resources/META-INF/dhis/beans.xml code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java code/dhis-2/dhis-form/project.xml code/dhis-2/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java code/dhis-2/dhis-support-hibernate/project.xml code/dhis-2/dhis-support-hibernate/src/main/resources/META-INF/dhis/beans.xml Log: o Adding dhis-core for all core interfaces. o Adding a transaction manager. o Adding a hibernate implementation of the transaction manager. There are still some TODOs to resolve. o Adding a transaction interceptor that will intercept all calls and call TransactionManager.enter() before all calls to the intercepted interface and equally call TransactionManager.leave() after all calls. In case of a exception TransactionManager.abort() will be called. o With this tx manager all of the tests using the store has become hibernate independent, cleaner and more "correct" with respect to production use of the code. Modified: code/dhis-2/dhis-cli/project.xml =================================================================== --- code/dhis-2/dhis-cli/project.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-cli/project.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -15,6 +15,14 @@ <!-- DHIS --> <dependency> <groupId>dhis</groupId> + <artifactId>dhis-core</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> + </dependency> + <dependency> + <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> <properties> @@ -25,11 +33,17 @@ <groupId>dhis</groupId> <artifactId>dhis-support-test</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <dependency> <groupId>dhis</groupId> <artifactId>dhis-data-store</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <!-- Misc --> <dependency> Property changes on: code/dhis-2/dhis-core ___________________________________________________________________ Name: svn:ignore + target *~ *.log .classpath .project *.ipr *.iws *.iml Added: code/dhis-2/dhis-core/project.xml =================================================================== --- code/dhis-2/dhis-core/project.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-core/project.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,16 @@ +<project> + <pomVersion>3</pomVersion> + <extend>../project.xml</extend> + <groupId>dhis</groupId> + <artifactId>dhis-core</artifactId> + <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> + <name>DHIS Core</name> + <dependencies> + <!-- --> + <dependency> + <groupId>aopalliance</groupId> + <artifactId>aopalliance</artifactId> + <version>1.0</version> + </dependency> + </dependencies> +</project> Added: code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java =================================================================== --- code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionInterceptor.java 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,50 @@ +package org.hisp.dhis.transaction; + +import org.aopalliance.intercept.MethodInterceptor; +import org.aopalliance.intercept.MethodInvocation; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class TransactionInterceptor + implements MethodInterceptor +{ + private TransactionManager transactionManager; + + // ---------------------------------------------------------------------- + // Setters + // ---------------------------------------------------------------------- + + public void setTransactionManager( TransactionManager transactionManager ) + { + this.transactionManager = transactionManager; + } + + // ---------------------------------------------------------------------- + // MethodInterceptor Implementation + // ---------------------------------------------------------------------- + + public Object invoke( MethodInvocation methodInvocation ) + throws Throwable + { + transactionManager.enter(); + + try + { + Object ret = methodInvocation.proceed(); + + transactionManager.leave(); + + return ret; + } + catch( Throwable t ) + { + System.err.println( "Aborting transaction because of: " + t.getMessage() ); + + transactionManager.abort(); + + throw t; + } + } +} Added: code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java =================================================================== --- code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManager.java 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,17 @@ +package org.hisp.dhis.transaction; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public interface TransactionManager +{ + String ID = TransactionManager.class.getName(); + + void enter() + throws TransactionManagerException; + + void leave(); + + void abort(); +} Added: code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java =================================================================== --- code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-core/src/main/java/org/hisp/dhis/transaction/TransactionManagerException.java 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,19 @@ +package org.hisp.dhis.transaction; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class TransactionManagerException + extends Exception +{ + public TransactionManagerException( String message ) + { + super( message ); + } + + public TransactionManagerException( String message, Throwable cause ) + { + super( message, cause ); + } +} Added: code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml =================================================================== --- code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-core/src/main/resources/META-INF/dhis/beans.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE beans PUBLIC + "-//SPRING//DTD BEAN//EN" + "http://www.springframework.org/dtd/spring-beans.dtd"> + +<beans> + <bean id="transactionInterceptor" + class="org.hisp.dhis.transaction.TransactionInterceptor"> + <property name="transactionManager"> + <ref bean="org.hisp.dhis.transaction.TransactionManager"/> + </property> + </bean> +</beans> Modified: code/dhis-2/dhis-data-store/project.xml =================================================================== --- code/dhis-2/dhis-data-store/project.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-data-store/project.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -9,6 +9,14 @@ <!-- DHIS --> <dependency> <groupId>dhis</groupId> + <artifactId>dhis-core</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> + </dependency> + <dependency> + <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> <properties> Modified: code/dhis-2/dhis-data-store/src/main/resources/META-INF/dhis/beans.xml =================================================================== --- code/dhis-2/dhis-data-store/src/main/resources/META-INF/dhis/beans.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-data-store/src/main/resources/META-INF/dhis/beans.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -5,9 +5,23 @@ "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> - <bean id="org.hisp.dhis.datastore.DataStore" class="org.hisp.dhis.datastore.hibernate.HibernateDataStore"> - <property name="sessionManager"> - <ref bean="org.hisp.dhis.hibernate.HibernateSessionManager"/> + <bean id="org.hisp.dhis.datastore.DataStore" + class="org.springframework.aop.framework.ProxyFactoryBean"> + <property name="target"> + <bean id="target" + class="org.hisp.dhis.datastore.hibernate.HibernateDataStore"> + <property name="sessionManager"> + <ref bean="org.hisp.dhis.hibernate.HibernateSessionManager"/> + </property> + </bean> </property> + <property name="proxyInterfaces"> + <value>org.hisp.dhis.datastore.DataStore</value> + </property> + <property name="interceptorNames"> + <list> + <value>transactionInterceptor</value> + </list> + </property> </bean> </beans> Modified: code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java =================================================================== --- code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java 2005-01-10 02:48:39 UTC (rev 61) @@ -5,16 +5,11 @@ import java.util.Iterator; import java.util.Set; -import net.sf.hibernate.Session; -import net.sf.hibernate.Transaction; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.hisp.dhis.DhisSpringTest; import org.hisp.dhis.datastore.DataStore; import org.hisp.dhis.datastore.DataStoreException; import org.hisp.dhis.datastore.PeriodType; -import org.hisp.dhis.hibernate.HibernateSessionManager; +import org.hisp.dhis.transaction.TransactionManager; /** * @author kristian @@ -23,16 +18,12 @@ public class HibernateDataStoreTest extends DhisSpringTest { - protected static Log log = LogFactory.getLog( HibernateDataStoreTest.class ); + private TransactionManager transactionManager; - private HibernateSessionManager sessionManager; - - private Transaction tx; - public void setUpTest() throws Exception { - sessionManager = (HibernateSessionManager) getBean( HibernateSessionManager.ID ); + transactionManager = (TransactionManager) getBean( TransactionManager.ID ); } // ---------------------------------------------------------------------- @@ -42,51 +33,26 @@ public void testAddPeriodType() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); String periodTypeName = "testAddPeriodType.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - assertNotNull( dataStore.getPeriodType( periodTypeName ) ); - - tx.commit(); - sessionManager.closeSession(); } public void testDelPeriodType() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); String periodTypeName = "testDelPeriodType.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - dataStore.delPeriodType( periodTypeName ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - try { dataStore.getPeriodType( periodTypeName ); @@ -96,48 +62,34 @@ { // expected } - - tx.commit(); - sessionManager.closeSession(); } public void testGetAllPeriodTypes() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + String periodTypeName1 = "name1"; String periodTypeName2 = "name2"; String periodTypeName3 = "name3"; - + Set periodTypeNames = new HashSet(); periodTypeNames.add( periodTypeName1 ); periodTypeNames.add( periodTypeName2 ); periodTypeNames.add( periodTypeName3 ); - - DataStore dataStore = (DataStore) getBean( DataStore.ID ); + dataStore.addPeriodType( periodTypeName1 ); dataStore.addPeriodType( periodTypeName2 ); dataStore.addPeriodType( periodTypeName3 ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + Iterator i = dataStore.getAllPeriodTypes(); while( i.hasNext() ) { PeriodType periodType = (PeriodType) i.next(); assertTrue( periodTypeNames.contains( periodType.getName() ) ); } - - tx.commit(); - sessionManager.closeSession(); } - + // ---------------------------------------------------------------------- // Period // ---------------------------------------------------------------------- @@ -145,59 +97,42 @@ public void testAddPeriod() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + transactionManager.enter(); + String periodTypeName = "testAddPeriod.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); Date startDate = new Date(); Date endDate = new Date(); dataStore.addPeriod( periodTypeName, startDate, endDate ); - tx.commit(); - sessionManager.closeSession(); + transactionManager.leave(); - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - assertNotNull( dataStore.getPeriod( periodTypeName, startDate ) ); - - tx.commit(); - sessionManager.closeSession(); } public void testDelPeriod() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + transactionManager.enter(); + String periodTypeName = "testDelPeriod.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); Date startDate = new Date(); Date endDate = new Date(); dataStore.addPeriod( periodTypeName, startDate, endDate ); - tx.commit(); - sessionManager.closeSession(); + transactionManager.leave(); - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - dataStore.delPeriod( periodTypeName, startDate, endDate ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - try { dataStore.getPeriod( periodTypeName, startDate ); @@ -207,9 +142,6 @@ { // expected } - - tx.commit(); - sessionManager.closeSession(); } // ---------------------------------------------------------------------- @@ -219,53 +151,28 @@ public void testAddDataElement() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); String dataElementId = "testAddDataElement.id"; String dataElementName = "testAddDataElement.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addDataElement( dataElementId, dataElementName, true ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - assertNotNull( dataStore.getDataElement( dataElementId ) ); - - tx.commit(); - sessionManager.closeSession(); } public void testDelDataElement() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); String dataElementId = "testDelDataElement.id"; String dataElementName = "testDelDataElement.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addDataElement( dataElementId, dataElementName, true ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - dataStore.delDataElement( dataElementId ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - try { dataStore.getDataElement( dataElementId ); @@ -275,43 +182,22 @@ { // expected } - - tx.commit(); - sessionManager.closeSession(); } public void testUpdateDataElement() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); String dataElementId = "testUpdateDataElement.id"; String dataElementName = "testUpdateDataElement.name"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addDataElement( dataElementId, dataElementName, true ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - String dataElementNameUpdated = "testUpdateDataElement.nameUpdated"; dataStore.updateDataElement( dataElementId, dataElementNameUpdated, false ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - - assertTrue( dataStore.getDataElement( dataElementId ).getName() - == dataElementNameUpdated ); - - tx.commit(); - sessionManager.closeSession(); + assertTrue( dataStore.getDataElement( dataElementId ).getName() == dataElementNameUpdated ); } // ---------------------------------------------------------------------- @@ -321,12 +207,12 @@ public void testAddDataValue() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + transactionManager.enter(); + String periodTypeName = "testAddDataValue.periodTypeName"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); Date startDate = new Date(); @@ -341,27 +227,20 @@ String value = "testAddDataValue.value"; dataStore.addDataValue( dataElementId, periodTypeName, startDate, endDate, source, value ); - tx.commit(); - sessionManager.closeSession(); + transactionManager.leave(); - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - assertNotNull( dataStore.getDataValue( dataElementId, periodTypeName, startDate, endDate, source ) ); - - tx.commit(); - sessionManager.closeSession(); } public void testDelDataValue() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + transactionManager.enter(); + String periodTypeName = "testDelDataValue.periodTypeName"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); Date startDate = new Date(); @@ -376,20 +255,10 @@ String value = "testDelDataValue.value"; dataStore.addDataValue( dataElementId, periodTypeName, startDate, endDate, source, value ); - tx.commit(); - sessionManager.closeSession(); + transactionManager.leave(); - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - dataStore.delDataValue( dataElementId, periodTypeName, startDate, endDate, source ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - try { dataStore.getDataValue( dataElementId, periodTypeName, startDate, endDate, source ); @@ -399,20 +268,17 @@ { // expected } - - tx.commit(); - sessionManager.closeSession(); } public void testUpdateDataValue() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + transactionManager.enter(); + String periodTypeName = "testUpdateDataValue.periodTypeName"; - DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); Date startDate = new Date(); @@ -427,24 +293,11 @@ String value = "testUpdateDataValue.value"; dataStore.addDataValue( dataElementId, periodTypeName, startDate, endDate, source, value ); - tx.commit(); - sessionManager.closeSession(); + transactionManager.leave(); - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - String valueUpdated = "testUpdateDataValue.valueUpdated"; dataStore.updateDataValue( dataElementId, periodTypeName, startDate, endDate, source, valueUpdated ); - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - assertTrue( dataStore.getDataValue( dataElementId, periodTypeName, startDate, endDate, source ).getValue() == valueUpdated ); - - tx.commit(); - sessionManager.closeSession(); } -} \ No newline at end of file +} Modified: code/dhis-2/dhis-form/project.xml =================================================================== --- code/dhis-2/dhis-form/project.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-form/project.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -9,6 +9,14 @@ <!-- DHIS --> <dependency> <groupId>dhis</groupId> + <artifactId>dhis-core</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> + </dependency> + <dependency> + <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> <properties> Modified: code/dhis-2/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java =================================================================== --- code/dhis-2/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-10 02:48:39 UTC (rev 61) @@ -9,99 +9,75 @@ import java.util.ArrayList; import java.util.List; -import net.sf.hibernate.Session; -import net.sf.hibernate.Transaction; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.hisp.dhis.DhisSpringTest; import org.hisp.dhis.datastore.DataStore; import org.hisp.dhis.form.FormElement; import org.hisp.dhis.form.FormManager; import org.hisp.dhis.form.FormManagerException; -import org.hisp.dhis.hibernate.HibernateSessionManager; +import org.hisp.dhis.transaction.TransactionManager; /** * @author kristian - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + * @version $Id$ */ public class HibernateFormManagerTest extends DhisSpringTest { - protected static Log log = LogFactory.getLog( HibernateFormManagerTest.class ); + private TransactionManager transactionManager; - private HibernateSessionManager sessionManager; + private DataStore dataStore; - private Transaction tx; - public void setUpTest() throws Exception { - sessionManager = (HibernateSessionManager) getBean( HibernateSessionManager.ID ); + transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + dataStore = (DataStore) getBean( DataStore.ID ); } - + // ---------------------------------------------------------------------- // Form // ---------------------------------------------------------------------- - + public void testAddForm() - throws Exception + throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - - DataStore dataStore = (DataStore) getBean( DataStore.ID ); - + transactionManager.enter(); + String periodTypeName = "testAddForm.name"; dataStore.addPeriodType( periodTypeName ); - + FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "testAddForm.name"; formManager.addForm( formName, periodTypeName ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + assertNotNull( formManager.getForm( formName ) ); - - tx.commit(); - sessionManager.closeSession(); } - + public void testDelForm() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + transactionManager.enter(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); - + String periodTypeName = "testDelForm.name"; dataStore.addPeriodType( periodTypeName ); - + FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "testDelForm.name"; formManager.addForm( formName, periodTypeName ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + + transactionManager.enter(); + formManager.delForm( formName ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + try { formManager.getForm( formName ); @@ -111,145 +87,108 @@ { // expected } - - tx.commit(); - sessionManager.closeSession(); } - + // ---------------------------------------------------------------------- // FormElement // ---------------------------------------------------------------------- - + public void testAddFormElement() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + transactionManager.enter(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); - + String periodTypeName = "name"; dataStore.addPeriodType( periodTypeName ); - + String dataElementId = "id"; String dataElementName = "name"; dataStore.addDataElement( dataElementId, dataElementName, true ); - + FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "name"; formManager.addForm( formName, periodTypeName ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + formManager.addFormElement( dataElementId, formManager.getForm( formName ).getName() ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + assertTrue( formManager.getForm( formName ).getFormElements().size() == 1 ); - - tx.commit(); - sessionManager.closeSession(); } - + public void testDelFormElement() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + transactionManager.enter(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); - + String periodTypeName = "name"; dataStore.addPeriodType( periodTypeName ); - + String dataElementId = "id"; String dataElementName = "name"; dataStore.addDataElement( dataElementId, dataElementName, true ); - + FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "name"; formManager.addForm( formName, periodTypeName ); - + formManager.addFormElement( dataElementId, formManager.getForm( formName ).getName() ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + formManager.delFormElement( dataElementId, formManager.getForm( formName ).getName() ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + assertTrue( formManager.getForm( formName ).getFormElements().size() == 0 ); - - tx.commit(); - sessionManager.closeSession(); } - + public void testUpdateFormElementsOrder() throws Exception { - Session session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + transactionManager.enter(); + DataStore dataStore = (DataStore) getBean( DataStore.ID ); - + String periodTypeName = "name"; dataStore.addPeriodType( periodTypeName ); - + String dataElementId1 = "id1"; String dataElementName1 = "name1"; dataStore.addDataElement( dataElementId1, dataElementName1, true ); String dataElementId2 = "id2"; String dataElementName2 = "name2"; dataStore.addDataElement( dataElementId2, dataElementName2, true ); - + FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "name"; formManager.addForm( formName, periodTypeName ); - + formManager.addFormElement( dataElementId1, formManager.getForm( formName ).getName() ); formManager.addFormElement( dataElementId2, formManager.getForm( formName ).getName() ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + + transactionManager.enter(); + assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 0 ) ).getDataElement().getId().equals( "id1" ) ); assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 1 ) ).getDataElement().getId().equals( "id2" ) ); - + List newOrder = new ArrayList(); newOrder.add( dataElementId2 ); newOrder.add( dataElementId1 ); - + formManager.updateFormElementsOrder( formName, newOrder ); - - tx.commit(); - sessionManager.closeSession(); - - session = sessionManager.getCurrentSession(); - tx = session.beginTransaction(); - + + transactionManager.leave(); + + transactionManager.enter(); + assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 0 ) ).getDataElement().getId().equals( "id2" ) ); assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 1 ) ).getDataElement().getId().equals( "id1" ) ); - tx.commit(); - sessionManager.closeSession(); + transactionManager.leave(); } } \ No newline at end of file Modified: code/dhis-2/dhis-support-hibernate/project.xml =================================================================== --- code/dhis-2/dhis-support-hibernate/project.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-support-hibernate/project.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -9,6 +9,14 @@ <!-- DHIS --> <dependency> <groupId>dhis</groupId> + <artifactId>dhis-core</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> + </dependency> + <dependency> + <groupId>dhis</groupId> <artifactId>dhis-support-test</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> <properties> Added: code/dhis-2/dhis-support-hibernate/src/main/java/org/hisp/dhis/transaction/HibernateTransactionManager.java =================================================================== --- code/dhis-2/dhis-support-hibernate/src/main/java/org/hisp/dhis/transaction/HibernateTransactionManager.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-support-hibernate/src/main/java/org/hisp/dhis/transaction/HibernateTransactionManager.java 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,252 @@ +package org.hisp.dhis.transaction; + +import net.sf.hibernate.Transaction; +import net.sf.hibernate.HibernateException; +import net.sf.hibernate.Session; + +import org.hisp.dhis.transaction.TransactionManager; +import org.hisp.dhis.transaction.TransactionManagerException; +import org.hisp.dhis.transaction.TransactionManagerException; +import org.hisp.dhis.hibernate.HibernateSessionManager; + +/** + * TODO: Add checks for unbalanced enter()/leave() calls. + * TODO: Add a monitor for logging. + * + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class HibernateTransactionManager + implements TransactionManager +{ + private ThreadLocal threadState = new ThreadLocal(); + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + private static class State + { + private int level; + + private Transaction tx; + + public State( Transaction tx ) + { + this.tx = tx; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + public void enter() + { + level++; + } + + public void leave() + { + if ( level == 0 ) + { + throw new RuntimeException( "Unbalanced enter()/leave(). State: " + toString() + "." ); + } + + level--; + } + + public void abort() + { + tx = null; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + public boolean hasAborted() + { + return tx == null; + } + + public int getLevel() + { + return level; + } + + public Transaction getTransaction() + { + return tx; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + public String toString() + { + return "[level: " + level + ", inside tx: " + (tx != null) + "]"; + } + } + + // ---------------------------------------------------------------------- + // Dependencies + // ---------------------------------------------------------------------- + + private HibernateSessionManager sessionManager; + + // ---------------------------------------------------------------------- + // Setters + // ---------------------------------------------------------------------- + + public void setSessionManager( HibernateSessionManager sessionManager ) + { + this.sessionManager = sessionManager; + } + + // ---------------------------------------------------------------------- + // TransactionManager Implementation + // ---------------------------------------------------------------------- + + public void enter() + throws TransactionManagerException + { + State state = (State) threadState.get(); + + if ( state == null ) + { + try + { + Transaction tx = sessionManager.getCurrentSession().beginTransaction(); + + state = new State( tx ); + } + catch ( HibernateException e ) + { + throw new TransactionManagerException( "enter(): Error while starting transaction.", e ); + } + + System.err.println( "enter(): Created new transaction, state: " + state + "." ); + + threadState.set( state ); + } + else + { + System.err.println( "enter(): Entering transaction, state: " + state + "." ); + } + + state.enter(); + } + + public void leave() + { + State state = getState(); + + state.leave(); + + if ( state.hasAborted() ) + { + System.err.println( "leave(): The transaction has been aborted, state: " + state + "." ); + + return; + } + + if ( state.getLevel() == 0 ) + { + System.err.println( "leave(): Committing transaction. State: " + state + "." ); + + try + { + state.getTransaction().commit(); + } + catch ( HibernateException e ) + { + // TODO: Log somewhere + System.err.println( "leave(): Error while committing transaction. State: " + state + "." ); + + e.printStackTrace(); + } + + closeSession(); + + threadState.set( null ); + } + else + { + System.err.println( "leave(): Leaving transaction. State: " + state + "." ); + } + } + + public void abort() + { + State state = getState(); + + state.leave(); + + if ( state.hasAborted() ) + { + System.err.println( "abort(): Transaction already aborted, State: " + state + "." ); + + return; + } + + System.err.println( "abort(): Aborting transaction. State: " + state + "." ); + + try + { + state.getTransaction().rollback(); + } + catch ( HibernateException e ) + { + // TODO: Log somewhere or just swallow + System.err.println( "abort(): Error while aborting transaction. State: " + state + "." ); + + e.printStackTrace(); + } + + closeSession(); + + state.abort(); + + if ( state.getLevel() == 0 ) + { + threadState.set( null ); + } + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + private State getState() + { + State state = (State) threadState.get(); + + if ( state == null ) + { + throw new RuntimeException( "Not inside a transaction." ); + } + + return state; + } + + private void closeSession() + { + try + { + Session session = sessionManager.getCurrentSession(); + + if ( session.isOpen() ) + { + sessionManager.closeSession(); + } + } + catch ( HibernateException e ) + { + // TODO: Log somewhere + System.err.println( "Error while closing session." ); + + e.printStackTrace(); + } + } +} Modified: code/dhis-2/dhis-support-hibernate/src/main/resources/META-INF/dhis/beans.xml =================================================================== --- code/dhis-2/dhis-support-hibernate/src/main/resources/META-INF/dhis/beans.xml 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-support-hibernate/src/main/resources/META-INF/dhis/beans.xml 2005-01-10 02:48:39 UTC (rev 61) @@ -20,4 +20,14 @@ <value>/hibernate.cfg.xml</value> </property> </bean> + + <!-- + | The Hibernate transaction manager + |--> + <bean id="org.hisp.dhis.transaction.TransactionManager" + class="org.hisp.dhis.transaction.HibernateTransactionManager"> + <property name="sessionManager"> + <ref bean="org.hisp.dhis.hibernate.HibernateSessionManager"/> + </property> + </bean> </beans> Added: code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/transaction/HibernateTransactionManagerTest.java =================================================================== --- code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/transaction/HibernateTransactionManagerTest.java 2005-01-09 22:05:09 UTC (rev 60) +++ code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/transaction/HibernateTransactionManagerTest.java 2005-01-10 02:48:39 UTC (rev 61) @@ -0,0 +1,105 @@ +package org.hisp.dhis.transaction; + +import org.hisp.dhis.DhisSpringTest; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class HibernateTransactionManagerTest + extends DhisSpringTest +{ + public void testEnterAndLeave() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.leave(); + } + + public void testEnterAndLeave_EnterAndLeave() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.leave(); + + transactionManager.enter(); + + transactionManager.leave(); + } + + public void testEnterAndAbort() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.abort(); + } + + public void testEnterAndAbort_EnterAndLeave() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.abort(); + + transactionManager.enter(); + + transactionManager.leave(); + } + + public void testEnterAndLeave_EnterAndAbort_EnterAndLeave() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.leave(); + + transactionManager.enter(); + + transactionManager.abort(); + + transactionManager.enter(); + + transactionManager.leave(); + } + + public void testEnterEnterLeaveLeave() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.enter(); + + transactionManager.leave(); + + transactionManager.leave(); + } + + public void testEnterEnterAbortLeave() + throws Exception + { + TransactionManager transactionManager = (TransactionManager) getBean( TransactionManager.ID ); + + transactionManager.enter(); + + transactionManager.enter(); + + transactionManager.abort(); + + transactionManager.leave(); + } +} |
From: <kr...@st...> - 2005-01-09 22:05:25
|
Author: krin Date: 2005-01-09 23:05:09 +0100 (Sun, 09 Jan 2005) New Revision: 60 Modified: code/dhis-2/dhis2.dia Log: o updated class diagram Modified: code/dhis-2/dhis2.dia =================================================================== (Binary files differ) |
From: <kr...@st...> - 2005-01-09 19:38:45
|
Author: krin Date: 2005-01-09 20:38:34 +0100 (Sun, 09 Jan 2005) New Revision: 59 Modified: code/dhis-2/dhis-cli/project.xml code/dhis-2/dhis-data-store/project.xml code/dhis-2/dhis-form/project.xml code/dhis-2/dhis-support-hibernate/project.xml Log: o defined dhis dependencies as eclipse projects in the POM Modified: code/dhis-2/dhis-cli/project.xml =================================================================== --- code/dhis-2/dhis-cli/project.xml 2005-01-09 18:04:21 UTC (rev 58) +++ code/dhis-2/dhis-cli/project.xml 2005-01-09 19:38:34 UTC (rev 59) @@ -17,6 +17,9 @@ <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <dependency> <groupId>dhis</groupId> Modified: code/dhis-2/dhis-data-store/project.xml =================================================================== --- code/dhis-2/dhis-data-store/project.xml 2005-01-09 18:04:21 UTC (rev 58) +++ code/dhis-2/dhis-data-store/project.xml 2005-01-09 19:38:34 UTC (rev 59) @@ -11,11 +11,17 @@ <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <dependency> <groupId>dhis</groupId> <artifactId>dhis-support-test</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <!-- Misc --> <dependency> Modified: code/dhis-2/dhis-form/project.xml =================================================================== --- code/dhis-2/dhis-form/project.xml 2005-01-09 18:04:21 UTC (rev 58) +++ code/dhis-2/dhis-form/project.xml 2005-01-09 19:38:34 UTC (rev 59) @@ -11,16 +11,25 @@ <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <dependency> <groupId>dhis</groupId> <artifactId>dhis-support-test</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <dependency> <groupId>dhis</groupId> <artifactId>dhis-data-store</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <!-- Misc --> <dependency> Modified: code/dhis-2/dhis-support-hibernate/project.xml =================================================================== --- code/dhis-2/dhis-support-hibernate/project.xml 2005-01-09 18:04:21 UTC (rev 58) +++ code/dhis-2/dhis-support-hibernate/project.xml 2005-01-09 19:38:34 UTC (rev 59) @@ -11,6 +11,9 @@ <groupId>dhis</groupId> <artifactId>dhis-support-test</artifactId> <version>2.0-alpha-1-SNAPSHOT</version> + <properties> + <eclipse.dependency>true</eclipse.dependency> + </properties> </dependency> <!-- Misc --> <dependency> |
From: <kr...@st...> - 2005-01-09 18:04:32
|
Author: krin Date: 2005-01-09 19:04:21 +0100 (Sun, 09 Jan 2005) New Revision: 58 Removed: code/dhis-2/test Modified: code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java code/dhis-2/dhis-form/.classpath Log: o added test for getAllPeriodTypes() Modified: code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java =================================================================== --- code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java 2005-01-09 16:50:30 UTC (rev 57) +++ code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java 2005-01-09 18:04:21 UTC (rev 58) @@ -1,6 +1,9 @@ package org.hisp.dhis.datastore.hibernate; import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; import net.sf.hibernate.Session; import net.sf.hibernate.Transaction; @@ -10,6 +13,7 @@ import org.hisp.dhis.DhisSpringTest; import org.hisp.dhis.datastore.DataStore; import org.hisp.dhis.datastore.DataStoreException; +import org.hisp.dhis.datastore.PeriodType; import org.hisp.dhis.hibernate.HibernateSessionManager; /** @@ -97,6 +101,43 @@ sessionManager.closeSession(); } + public void testGetAllPeriodTypes() + throws Exception + { + Session session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + String periodTypeName1 = "name1"; + String periodTypeName2 = "name2"; + String periodTypeName3 = "name3"; + + Set periodTypeNames = new HashSet(); + periodTypeNames.add( periodTypeName1 ); + periodTypeNames.add( periodTypeName2 ); + periodTypeNames.add( periodTypeName3 ); + + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + dataStore.addPeriodType( periodTypeName1 ); + dataStore.addPeriodType( periodTypeName2 ); + dataStore.addPeriodType( periodTypeName3 ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + Iterator i = dataStore.getAllPeriodTypes(); + while( i.hasNext() ) + { + PeriodType periodType = (PeriodType) i.next(); + assertTrue( periodTypeNames.contains( periodType.getName() ) ); + } + + tx.commit(); + sessionManager.closeSession(); + } + // ---------------------------------------------------------------------- // Period // ---------------------------------------------------------------------- Modified: code/dhis-2/dhis-form/.classpath =================================================================== --- code/dhis-2/dhis-form/.classpath 2005-01-09 16:50:30 UTC (rev 57) +++ code/dhis-2/dhis-form/.classpath 2005-01-09 18:04:21 UTC (rev 58) @@ -4,10 +4,10 @@ <classpathentry kind="src" path="src/main/resources"/> <classpathentry kind="src" path="src/test/resources"/> <classpathentry output="target/test-classes" kind="src" path="src/test/java"/> + <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry exported="true" kind="src" path="/dhis-data-store"/> <classpathentry exported="true" kind="src" path="/dhis-support-hibernate"/> <classpathentry exported="true" kind="src" path="/dhis-support-test"/> - <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="var" path="MAVEN_REPO/dhis/jars/dhis-support-hibernate-2.0-alpha-1-SNAPSHOT.jar"/> <classpathentry kind="var" path="MAVEN_REPO/dhis/jars/dhis-support-test-2.0-alpha-1-SNAPSHOT.jar"/> Deleted: code/dhis-2/test =================================================================== --- code/dhis-2/test 2005-01-09 16:50:30 UTC (rev 57) +++ code/dhis-2/test 2005-01-09 18:04:21 UTC (rev 58) @@ -1 +0,0 @@ -t |
Author: trygvela Date: 2005-01-09 17:50:30 +0100 (Sun, 09 Jan 2005) New Revision: 57 Modified: code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStore.java code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java Log: o Adding DataStore.getAllPeriodTypes(). Modified: code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStore.java =================================================================== --- code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStore.java 2005-01-09 16:49:45 UTC (rev 56) +++ code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStore.java 2005-01-09 16:50:30 UTC (rev 57) @@ -1,6 +1,7 @@ package org.hisp.dhis.datastore; import java.util.Date; +import java.util.Iterator; /** * @author kristian @@ -13,7 +14,7 @@ // ---------------------------------------------------------------------- // PeriodType // ---------------------------------------------------------------------- - + void addPeriodType( String name ) throws DataStoreException; @@ -23,6 +24,9 @@ PeriodType getPeriodType( String name ) throws DataStoreException; + Iterator getAllPeriodTypes() + throws DataStoreException; + // ---------------------------------------------------------------------- // Period // ---------------------------------------------------------------------- Modified: code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java =================================================================== --- code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java 2005-01-09 16:49:45 UTC (rev 56) +++ code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java 2005-01-09 16:50:30 UTC (rev 57) @@ -1,6 +1,7 @@ package org.hisp.dhis.datastore.hibernate; import java.util.Date; +import java.util.Iterator; import java.util.List; import net.sf.hibernate.Criteria; @@ -8,8 +9,6 @@ import net.sf.hibernate.Session; import net.sf.hibernate.expression.Example; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.hisp.dhis.datastore.DataElement; import org.hisp.dhis.datastore.DataStore; import org.hisp.dhis.datastore.DataStoreException; @@ -25,8 +24,6 @@ public class HibernateDataStore implements DataStore { - private static Log log = LogFactory.getLog( HibernateDataStore.class ); - private HibernateSessionManager sessionManager; // ---------------------------------------------------------------------- @@ -92,6 +89,23 @@ } } + public Iterator getAllPeriodTypes() + throws DataStoreException + { + try + { + Session session = sessionManager.getCurrentSession(); + + List periodTypes = session.find( "from " + PeriodType.class.getName() ); + + return periodTypes.iterator(); + } + catch ( HibernateException ex ) + { + throw new DataStoreException( "Error while getting all period types.", ex ); + } + } + // ---------------------------------------------------------------------- // Period // ---------------------------------------------------------------------- @@ -230,7 +244,6 @@ { throw new DataStoreException( "Could not get data element", ex ); } - } // ---------------------------------------------------------------------- Modified: code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java =================================================================== --- code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java 2005-01-09 16:49:45 UTC (rev 56) +++ code/dhis-2/dhis-data-store/src/test/java/org/hisp/dhis/datastore/hibernate/HibernateDataStoreTest.java 2005-01-09 16:50:30 UTC (rev 57) @@ -40,9 +40,9 @@ { Session session = sessionManager.getCurrentSession(); tx = session.beginTransaction(); - + String periodTypeName = "testAddPeriodType.name"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); @@ -65,7 +65,7 @@ tx = session.beginTransaction(); String periodTypeName = "testDelPeriodType.name"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); @@ -108,7 +108,7 @@ tx = session.beginTransaction(); String periodTypeName = "testAddPeriod.name"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); @@ -133,7 +133,7 @@ { Session session = sessionManager.getCurrentSession(); tx = session.beginTransaction(); - + String periodTypeName = "testDelPeriod.name"; DataStore dataStore = (DataStore) getBean( DataStore.ID ); @@ -183,7 +183,7 @@ String dataElementId = "testAddDataElement.id"; String dataElementName = "testAddDataElement.name"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addDataElement( dataElementId, dataElementName, true ); @@ -207,7 +207,7 @@ String dataElementId = "testDelDataElement.id"; String dataElementName = "testDelDataElement.name"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addDataElement( dataElementId, dataElementName, true ); @@ -216,7 +216,7 @@ session = sessionManager.getCurrentSession(); tx = session.beginTransaction(); - + dataStore.delDataElement( dataElementId ); tx.commit(); @@ -247,7 +247,7 @@ String dataElementId = "testUpdateDataElement.id"; String dataElementName = "testUpdateDataElement.name"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addDataElement( dataElementId, dataElementName, true ); @@ -284,7 +284,7 @@ tx = session.beginTransaction(); String periodTypeName = "testAddDataValue.periodTypeName"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); @@ -295,7 +295,7 @@ String dataElementId = "testAddDataValue.dataElementId"; String dataElementName = "testAddDataValue.dataElementName"; dataStore.addDataElement( dataElementId, dataElementName, true ); - + String source = "testAddDataValue.source"; String value = "testAddDataValue.value"; dataStore.addDataValue( dataElementId, periodTypeName, startDate, endDate, source, value ); @@ -319,7 +319,7 @@ tx = session.beginTransaction(); String periodTypeName = "testDelDataValue.periodTypeName"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); @@ -330,7 +330,7 @@ String dataElementId = "testDelDataValue.dataElementId"; String dataElementName = "testDelDataValue.dataElementName"; dataStore.addDataElement( dataElementId, dataElementName, true ); - + String source = "testDelDataValue.source"; String value = "testDelDataValue.value"; dataStore.addDataValue( dataElementId, periodTypeName, startDate, endDate, source, value ); @@ -340,7 +340,7 @@ session = sessionManager.getCurrentSession(); tx = session.beginTransaction(); - + dataStore.delDataValue( dataElementId, periodTypeName, startDate, endDate, source ); tx.commit(); @@ -370,7 +370,7 @@ tx = session.beginTransaction(); String periodTypeName = "testUpdateDataValue.periodTypeName"; - + DataStore dataStore = (DataStore) getBean( DataStore.ID ); dataStore.addPeriodType( periodTypeName ); @@ -381,7 +381,7 @@ String dataElementId = "testUpdateDataValue.dataElementId"; String dataElementName = "testUpdateDataValue.dataElementName"; dataStore.addDataElement( dataElementId, dataElementName, true ); - + String source = "testUpdateDataValue.source"; String value = "testUpdateDataValue.value"; dataStore.addDataValue( dataElementId, periodTypeName, startDate, endDate, source, value ); @@ -391,7 +391,7 @@ session = sessionManager.getCurrentSession(); tx = session.beginTransaction(); - + String valueUpdated = "testUpdateDataValue.valueUpdated"; dataStore.updateDataValue( dataElementId, periodTypeName, startDate, endDate, source, valueUpdated ); |
From: <try...@st...> - 2005-01-09 16:49:52
|
Author: trygvela Date: 2005-01-09 17:49:45 +0100 (Sun, 09 Jan 2005) New Revision: 56 Modified: code/dhis-2/dhis-data-store/project.xml code/dhis-2/dhis-form/project.xml code/dhis-2/dhis-support-hibernate/project.xml code/dhis-2/dhis-support-test/project.xml code/dhis-2/project.xml Log: o Setting <name>s in the maven projects. Modified: code/dhis-2/dhis-data-store/project.xml =================================================================== --- code/dhis-2/dhis-data-store/project.xml 2005-01-09 16:47:45 UTC (rev 55) +++ code/dhis-2/dhis-data-store/project.xml 2005-01-09 16:49:45 UTC (rev 56) @@ -4,6 +4,7 @@ <artifactId>dhis-data-store</artifactId> <groupId>dhis</groupId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> + <name>DHIS Data Store</name> <dependencies> <!-- DHIS --> <dependency> Modified: code/dhis-2/dhis-form/project.xml =================================================================== --- code/dhis-2/dhis-form/project.xml 2005-01-09 16:47:45 UTC (rev 55) +++ code/dhis-2/dhis-form/project.xml 2005-01-09 16:49:45 UTC (rev 56) @@ -1,9 +1,10 @@ <project> <pomVersion>3</pomVersion> <extend>../project.xml</extend> + <groupId>dhis</groupId> <artifactId>dhis-form</artifactId> - <groupId>dhis</groupId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> + <name>DHIS Form</name> <dependencies> <!-- DHIS --> <dependency> Modified: code/dhis-2/dhis-support-hibernate/project.xml =================================================================== --- code/dhis-2/dhis-support-hibernate/project.xml 2005-01-09 16:47:45 UTC (rev 55) +++ code/dhis-2/dhis-support-hibernate/project.xml 2005-01-09 16:49:45 UTC (rev 56) @@ -4,6 +4,7 @@ <groupId>dhis</groupId> <artifactId>dhis-support-hibernate</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> + <name>DHIS Hibernate Support</name> <dependencies> <!-- DHIS --> <dependency> Modified: code/dhis-2/dhis-support-test/project.xml =================================================================== --- code/dhis-2/dhis-support-test/project.xml 2005-01-09 16:47:45 UTC (rev 55) +++ code/dhis-2/dhis-support-test/project.xml 2005-01-09 16:49:45 UTC (rev 56) @@ -4,6 +4,7 @@ <groupId>dhis</groupId> <artifactId>dhis-support-test</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> + <name>DHIS Testing Support</name> <dependencies> <!-- Spring --> <dependency> Modified: code/dhis-2/project.xml =================================================================== --- code/dhis-2/project.xml 2005-01-09 16:47:45 UTC (rev 55) +++ code/dhis-2/project.xml 2005-01-09 16:49:45 UTC (rev 56) @@ -3,7 +3,7 @@ <groupId>dhis</groupId> <artifactId>dhis</artifactId> <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> - <type>pom</type> + <name>DHIS 2</name> <build> <sourceDirectory>src/main/java</sourceDirectory> <unitTestSourceDirectory>src/test/java</unitTestSourceDirectory> |
Author: trygvela Date: 2005-01-09 17:47:45 +0100 (Sun, 09 Jan 2005) New Revision: 55 Added: code/dhis-2/dhis-cli/src/main/conf/log4j.properties code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/CliCommand.java code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/DumpDataStoreCliCommand.java code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/InitializeDataStoreCliCommand.java code/dhis-2/dhis-cli/src/main/resources/META-INF/ code/dhis-2/dhis-cli/src/main/resources/META-INF/dhis/ code/dhis-2/dhis-cli/src/main/resources/META-INF/dhis/beans.xml code/dhis-2/dhis-cli/src/main/resources/hibernate.cfg.xml Modified: code/dhis-2/dhis-cli/maven.xml code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java Log: o More runtime stuff. Modified: code/dhis-2/dhis-cli/maven.xml =================================================================== --- code/dhis-2/dhis-cli/maven.xml 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/maven.xml 2005-01-09 16:47:45 UTC (rev 55) @@ -26,7 +26,9 @@ |--> <core:set var="classworlds" value="${pom.getDependencyPath('classworlds:classworlds')}"/> <ant:copy file="${classworlds}" todir="${core}"/> - <ant:copy file="src/main/conf/classworlds.conf" todir="${conf}"/> + <ant:copy todir="${conf}"> + <ant:fileset dir="src/main/conf"/> + </ant:copy> <!-- | Copy the artifact Added: code/dhis-2/dhis-cli/src/main/conf/log4j.properties =================================================================== --- code/dhis-2/dhis-cli/src/main/conf/log4j.properties 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/conf/log4j.properties 2005-01-09 16:47:45 UTC (rev 55) @@ -0,0 +1,5 @@ +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern=%d %p %c - %m%n + +log4j.rootCategory = WARN, console Added: code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/CliCommand.java =================================================================== --- code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/CliCommand.java 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/CliCommand.java 2005-01-09 16:47:45 UTC (rev 55) @@ -0,0 +1,11 @@ +package org.hisp.dhis.cli; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public interface CliCommand +{ + void execute( String[] args ) + throws Exception; +} Modified: code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java =================================================================== --- code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java 2005-01-09 16:47:45 UTC (rev 55) @@ -1,13 +1,136 @@ package org.hisp.dhis.cli; +import net.sf.hibernate.HibernateException; +import net.sf.hibernate.Session; +import net.sf.hibernate.Transaction; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import org.hisp.dhis.datastore.DataStore; +import org.hisp.dhis.hibernate.HibernateSessionManager; + /** * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> * @version $Id:$ */ public class DhisCli { + private ApplicationContext context; + + private Transaction tx; + + // ---------------------------------------------------------------------- + // Dependencies + // ---------------------------------------------------------------------- + + private DataStore dataStore; + + private HibernateSessionManager sessionManager; + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + public DhisCli( ApplicationContext context ) + { + this.context = context; + + dataStore = (DataStore) context.getBean( DataStore.ID ); + + sessionManager = (HibernateSessionManager) context.getBean( HibernateSessionManager.ID ); + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + public static void main( String[] args ) + throws Exception { - System.err.println( "Welcome to DHIS!" ); + ClassPathXmlApplicationContext context; + + String[] locations = { + "classpath*:/META-INF/dhis/beans.xml", + }; + + context = new ClassPathXmlApplicationContext( locations ); + + DhisCli cli = new DhisCli( context ); + + cli.work( args ); } + + // ---------------------------------------------------------------------- + // The entrypoint for the CLI + // ---------------------------------------------------------------------- + + public void work( String[] args ) + throws Exception + { + executeCommand( "initializeDataStore", args ); + + executeCommand( "dumpDataStore", args ); + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + private void executeCommand( String commandKey, String[] args ) + { + CliCommand command = (CliCommand) context.getBean( CliCommand.class.getName() + "_" + commandKey ); + + if ( command == null ) + { + throw new RuntimeException( "No such command: '" + commandKey + "'." ); + } + + startTx(); + + try + { + command.execute( args ); + } + catch ( Exception e ) + { + System.err.println( "Error while executing command." ); + + e.printStackTrace(); + } + + endTx(); + } + + // ---------------------------------------------------------------------- + // Transaction Handling + // ---------------------------------------------------------------------- + + public void startTx() + { + try + { + Session session = sessionManager.getCurrentSession(); + + tx = session.beginTransaction(); + } + catch ( HibernateException e ) + { + throw new RuntimeException( "Error while starting transaction.", e ); + } + } + + public void endTx() + { + try + { + tx.commit(); + + sessionManager.closeSession(); + } + catch ( HibernateException e ) + { + throw new RuntimeException( "Error while starting transaction.", e ); + } + } } Added: code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/DumpDataStoreCliCommand.java =================================================================== --- code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/DumpDataStoreCliCommand.java 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/DumpDataStoreCliCommand.java 2005-01-09 16:47:45 UTC (rev 55) @@ -0,0 +1,44 @@ +package org.hisp.dhis.cli.command; + +import java.util.Iterator; + +import org.hisp.dhis.cli.CliCommand; +import org.hisp.dhis.datastore.DataStore; +import org.hisp.dhis.datastore.PeriodType; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class DumpDataStoreCliCommand + implements CliCommand +{ + private DataStore dataStore; + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + public void setDataStore( DataStore dataStore ) + { + this.dataStore = dataStore; + } + + // ---------------------------------------------------------------------- + // CliCommand Implementation + // ---------------------------------------------------------------------- + + public void execute( String[] args ) + throws Exception + { + Iterator it = dataStore.getAllPeriodTypes(); + + System.err.println( "All period types:" ); + while ( it.hasNext() ) + { + PeriodType periodType = (PeriodType) it.next(); + + System.err.println( " " + periodType.getName() ); + } + } +} Added: code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/InitializeDataStoreCliCommand.java =================================================================== --- code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/InitializeDataStoreCliCommand.java 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/command/InitializeDataStoreCliCommand.java 2005-01-09 16:47:45 UTC (rev 55) @@ -0,0 +1,37 @@ +package org.hisp.dhis.cli.command; + +import org.hisp.dhis.cli.CliCommand; +import org.hisp.dhis.datastore.DataStore; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class InitializeDataStoreCliCommand + implements CliCommand +{ + private DataStore dataStore; + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + public void setDataStore( DataStore dataStore ) + { + this.dataStore = dataStore; + } + + // ---------------------------------------------------------------------- + // CliCommand Implementation + // ---------------------------------------------------------------------- + + public void execute( String[] args ) + throws Exception + { + dataStore.addPeriodType( "yearly" ); + dataStore.addPeriodType( "quarterly" ); + dataStore.addPeriodType( "monthly" ); + dataStore.addPeriodType( "weekly" ); + dataStore.addPeriodType( "daily" ); + } +} Added: code/dhis-2/dhis-cli/src/main/resources/META-INF/dhis/beans.xml =================================================================== --- code/dhis-2/dhis-cli/src/main/resources/META-INF/dhis/beans.xml 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/resources/META-INF/dhis/beans.xml 2005-01-09 16:47:45 UTC (rev 55) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE beans PUBLIC + "-//SPRING//DTD BEAN//EN" + "http://www.springframework.org/dtd/spring-beans.dtd"> + +<beans> + <bean id="org.hisp.dhis.cli.CliCommand_initializeDataStore" + class="org.hisp.dhis.cli.command.InitializeDataStoreCliCommand"> + <property name="dataStore"> + <ref bean="org.hisp.dhis.datastore.DataStore"/> + </property> + </bean> + <bean id="org.hisp.dhis.cli.CliCommand_dumpDataStore" + class="org.hisp.dhis.cli.command.DumpDataStoreCliCommand"> + <property name="dataStore"> + <ref bean="org.hisp.dhis.datastore.DataStore"/> + </property> + </bean> +</beans> Added: code/dhis-2/dhis-cli/src/main/resources/hibernate.cfg.xml =================================================================== --- code/dhis-2/dhis-cli/src/main/resources/hibernate.cfg.xml 2005-01-08 19:15:36 UTC (rev 54) +++ code/dhis-2/dhis-cli/src/main/resources/hibernate.cfg.xml 2005-01-09 16:47:45 UTC (rev 55) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!DOCTYPE hibernate-configuration + PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" + "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> + +<hibernate-configuration> + <session-factory> + <property name="show_sql">false</property> + <property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property> + <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> + <property name="hibernate.connection.url">jdbc:hsqldb:db-dhis-datastore</property> + <property name="hibernate.connection.username">sa</property> + <property name="hibernate.connection.password"></property> + <property name="hibernate.connection.pool_size">10</property> + <property name="hibernate.hbm2ddl.auto">create-drop</property> + <mapping resource="org/hisp/dhis/datastore/hibernate/DataElement.hbm.xml"/> + <mapping resource="org/hisp/dhis/datastore/hibernate/PeriodType.hbm.xml"/> + <mapping resource="org/hisp/dhis/datastore/hibernate/Period.hbm.xml"/> + <mapping resource="org/hisp/dhis/datastore/hibernate/DataValue.hbm.xml"/> + </session-factory> +</hibernate-configuration> |
From: <try...@st...> - 2005-01-08 19:15:49
|
Author: trygvela Date: 2005-01-08 20:15:36 +0100 (Sat, 08 Jan 2005) New Revision: 54 Added: code/dhis-2/dhis-cli/ code/dhis-2/dhis-cli/maven.xml code/dhis-2/dhis-cli/project.xml code/dhis-2/dhis-cli/src/ code/dhis-2/dhis-cli/src/main/ code/dhis-2/dhis-cli/src/main/bash/ code/dhis-2/dhis-cli/src/main/bash/dhis.sh code/dhis-2/dhis-cli/src/main/conf/ code/dhis-2/dhis-cli/src/main/conf/classworlds.conf code/dhis-2/dhis-cli/src/main/java/ code/dhis-2/dhis-cli/src/main/java/org/ code/dhis-2/dhis-cli/src/main/java/org/hisp/ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java code/dhis-2/dhis-cli/src/main/resources/ Log: o Adding a DHIS runtime. This artifact will produce a standalone tarball. Property changes on: code/dhis-2/dhis-cli ___________________________________________________________________ Name: svn:ignore + target *~ *.log .classpath .project *.ipr *.iws *.iml Added: code/dhis-2/dhis-cli/maven.xml =================================================================== --- code/dhis-2/dhis-cli/maven.xml 2005-01-07 13:18:39 UTC (rev 53) +++ code/dhis-2/dhis-cli/maven.xml 2005-01-08 19:15:36 UTC (rev 54) @@ -0,0 +1,52 @@ +<project + xmlns:ant="jelly:ant" + xmlns:core="jelly:core"> + + <goal name="dhis:runtime" prereqs="jar:install"> + <ant:echo>Building DHIS runtime in ${runtime}</ant:echo> + + <!-- + | Set up paths + |--> + <core:set var="runtime" value="${maven.build.dir}/runtime"/> + <core:set var="conf" value="${runtime}/conf"/> + <core:set var="core" value="${runtime}/core"/> + <core:set var="bin" value="${runtime}/bin"/> + <core:set var="lib" value="${runtime}/lib"/> + + <!-- + | Make directories + |--> + <ant:mkdir dir="${conf}"/> + <ant:mkdir dir="${bin}"/> + <ant:mkdir dir="${lib}"/> + + <!-- + | Make the /core + |--> + <core:set var="classworlds" value="${pom.getDependencyPath('classworlds:classworlds')}"/> + <ant:copy file="${classworlds}" todir="${core}"/> + <ant:copy file="src/main/conf/classworlds.conf" todir="${conf}"/> + + <!-- + | Copy the artifact + |--> + <ant:copy file="${maven.build.dir}/${maven.final.name}.jar" todir="${lib}"/> + + <!-- + | Copy the dependencies + |--> + <core:forEach var="dep" items="${pom.artifacts}"> + <core:if test="${dep.dependency.groupId != 'classworlds'}"> + <ant:copy file="${dep.path}" todir="${lib}"/> + </core:if> + </core:forEach> + + <!-- + | + |--> + <ant:copy file="src/main/bash/dhis.sh" todir="${bin}"/> + <ant:chmod file="${bin}/dhis.sh" perm="a+x"/> + </goal> + +</project> Added: code/dhis-2/dhis-cli/project.xml =================================================================== --- code/dhis-2/dhis-cli/project.xml 2005-01-07 13:18:39 UTC (rev 53) +++ code/dhis-2/dhis-cli/project.xml 2005-01-08 19:15:36 UTC (rev 54) @@ -0,0 +1,111 @@ +<project> + <pomVersion>3</pomVersion> + <extend>../project.xml</extend> + <groupId>dhis</groupId> + <artifactId>dhis-cli</artifactId> + <currentVersion>2.0-alpha-1-SNAPSHOT</currentVersion> + <name>DHIS Command Line Interface</name> + <dependencies> + <!-- DHIS CLI --> + <dependency> + <groupId>classworlds</groupId> + <artifactId>classworlds</artifactId> + <version>1.1-alpha-1</version> + </dependency> + <!-- DHIS --> + <dependency> + <groupId>dhis</groupId> + <artifactId>dhis-support-hibernate</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>dhis</groupId> + <artifactId>dhis-support-test</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>dhis</groupId> + <artifactId>dhis-data-store</artifactId> + <version>2.0-alpha-1-SNAPSHOT</version> + </dependency> + <!-- Misc --> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.3</version> + </dependency> + <!-- Spring --> + <dependency> + <groupId>springframework</groupId> + <artifactId>spring</artifactId> + <version>1.1.3</version> + </dependency> + <!-- Hibernate --> + <dependency> + <groupId>hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>2.1.6</version> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.4</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.8</version> + </dependency> + <dependency> + <groupId>ehcache</groupId> + <artifactId>ehcache</artifactId> + <version>0.7</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.1</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.0</version> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + <version>2.0.2</version> + </dependency> + <dependency> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>odmg</groupId> + <artifactId>odmg</artifactId> + <version>3.0</version> + </dependency> + <dependency> + <groupId>aopalliance</groupId> + <artifactId>aopalliance</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-jta</artifactId> + <version>1.0-M1</version> + </dependency> + <!-- Test --> + <dependency> + <groupId>hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>1.7.2.2</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + </dependency> + </dependencies> +</project> Added: code/dhis-2/dhis-cli/src/main/bash/dhis.sh =================================================================== --- code/dhis-2/dhis-cli/src/main/bash/dhis.sh 2005-01-07 13:18:39 UTC (rev 53) +++ code/dhis-2/dhis-cli/src/main/bash/dhis.sh 2005-01-08 19:15:36 UTC (rev 54) @@ -0,0 +1,24 @@ +#!/bin/bash -e + +dirname=`dirname $0` +dirname=`dirname $dirname` +basedir=`readlink -f $dirname` + +java=`which java` + +if [ ! -x "$java" ] +then + echo "'java' isn't in the PATH." + exit -1 +fi + +CLASSWORLDS_MAIN_CLASS=org.codehaus.classworlds.Launcher +CLASSWORLDS_CONF=$basedir/conf/classworlds.conf + +CP= + +java -cp $basedir/core/classworlds-*.jar \ + -Dclassworlds.conf=${CLASSWORLDS_CONF} \ + -Ddhis.core=$basedir/core \ + -Ddhis.lib=$basedir/lib \ + $CLASSWORLDS_MAIN_CLASS "$@" Added: code/dhis-2/dhis-cli/src/main/conf/classworlds.conf =================================================================== --- code/dhis-2/dhis-cli/src/main/conf/classworlds.conf 2005-01-07 13:18:39 UTC (rev 53) +++ code/dhis-2/dhis-cli/src/main/conf/classworlds.conf 2005-01-08 19:15:36 UTC (rev 54) @@ -0,0 +1,5 @@ +main is org.hisp.dhis.cli.DhisCli from dhis.core + +[dhis.core] +load ${dhis.lib}/*.jar + Added: code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java =================================================================== --- code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java 2005-01-07 13:18:39 UTC (rev 53) +++ code/dhis-2/dhis-cli/src/main/java/org/hisp/dhis/cli/DhisCli.java 2005-01-08 19:15:36 UTC (rev 54) @@ -0,0 +1,13 @@ +package org.hisp.dhis.cli; + +/** + * @author <a href="mailto:tr...@in...">Trygve Laugstøl</a> + * @version $Id:$ + */ +public class DhisCli +{ + public static void main( String[] args ) + { + System.err.println( "Welcome to DHIS!" ); + } +} |
Author: olati Date: 2005-01-07 14:18:39 +0100 (Fri, 07 Jan 2005) New Revision: 53 Added: code/assignments/ code/assignments/dhis-oblig-1-stuff/ code/assignments/dhis-oblig-1-trygvela/ code/dhis-2/ Removed: code/dhis-oblig-1-stuff/ code/dhis-oblig-1-trygvela/ code/dhis/ Modified: code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStoreException.java code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/hibernate/Parent.java Log: Made changes in the file structure. Dhis 2.0 files are now in dhis-2 and all assignments in f5750 are in the assignments folder under code. Copied: code/assignments/dhis-oblig-1-stuff (from rev 51, code/dhis-oblig-1-stuff) Copied: code/assignments/dhis-oblig-1-trygvela (from rev 51, code/dhis-oblig-1-trygvela) Copied: code/dhis-2 (from rev 51, code/dhis) Modified: code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStoreException.java =================================================================== --- code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStoreException.java 2005-01-07 09:30:18 UTC (rev 51) +++ code/dhis-2/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataStoreException.java 2005-01-07 13:18:39 UTC (rev 53) @@ -2,7 +2,7 @@ /** * @author kristian - * @version $Id:$ + * @version $Id$ */ public class DataStoreException extends Exception Modified: code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/hibernate/Parent.java =================================================================== --- code/dhis/dhis-support-hibernate/src/test/java/org/hisp/dhis/hibernate/Parent.java 2005-01-07 09:30:18 UTC (rev 51) +++ code/dhis-2/dhis-support-hibernate/src/test/java/org/hisp/dhis/hibernate/Parent.java 2005-01-07 13:18:39 UTC (rev 53) @@ -2,7 +2,7 @@ /** * @author kristian - * @version $Id:$ + * @version $Id$ */ public class Parent { |
From: <ol...@st...> - 2005-01-07 12:49:00
|
Author: olati Date: 2005-01-07 13:48:44 +0100 (Fri, 07 Jan 2005) New Revision: 52 Removed: code/svn-commit-test Log: o delested sv-commit-test, not needed. Deleted: code/svn-commit-test =================================================================== --- code/svn-commit-test 2005-01-07 09:30:18 UTC (rev 51) +++ code/svn-commit-test 2005-01-07 12:48:44 UTC (rev 52) @@ -1 +0,0 @@ -5 |
From: <kr...@st...> - 2005-01-07 09:30:31
|
Author: krin Date: 2005-01-07 10:30:18 +0100 (Fri, 07 Jan 2005) New Revision: 51 Removed: code/dhis/dhis-data-store/src/main/resources/org/hisp/dhis/datastore/hibernate/DataSet.hbm.xml Modified: code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataValue.java code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/Period.java code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java Log: o Cleaned up value objects, making default constructors protected Modified: code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataValue.java =================================================================== --- code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataValue.java 2005-01-05 17:13:25 UTC (rev 50) +++ code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/DataValue.java 2005-01-07 09:30:18 UTC (rev 51) @@ -9,12 +9,32 @@ public class DataValue implements Serializable { + private DataElement dataElement; private Period period; private String source; + protected DataValue() + { + } + + /** + * @param dataElement + * @param period + * @param source + * @param value + */ + public DataValue( DataElement dataElement, Period period, String source, String value ) + { + super(); + this.dataElement = dataElement; + this.period = period; + this.source = source; + this.value = value; + } + private String value; public boolean equals( Object other ) @@ -24,21 +44,18 @@ if ( !(other instanceof DataValue) ) return false; final DataValue that = (DataValue) other; - return this.dataElement.getName().equals( that.dataElement.getName() ) + return this.dataElement.getName().equals( that.dataElement.getName() ) & this.period.getPeriodType().getName().equals( that.period.getPeriodType().getName() ) & this.period.getStartDate().equals( that.period.getStartDate() ) - & this.period.getEndDate().equals( that.period.getEndDate() ) - & this.source.equals( that.source ); + & this.period.getEndDate().equals( that.period.getEndDate() ) & this.source.equals( that.source ); } public int hashCode() { - return this.period.getPeriodType().getName().hashCode() - + this.period.getStartDate().hashCode() - + this.period.getEndDate().hashCode() - + this.source.hashCode(); + return this.period.getPeriodType().getName().hashCode() + this.period.getStartDate().hashCode() + + this.period.getEndDate().hashCode() + this.source.hashCode(); } - + /** * @return Returns the dataElement. */ @@ -48,7 +65,8 @@ } /** - * @param dataElement The dataElement to set. + * @param dataElement + * The dataElement to set. */ public void setDataElement( DataElement dataElement ) { @@ -64,7 +82,8 @@ } /** - * @param period The period to set. + * @param period + * The period to set. */ public void setPeriod( Period period ) { @@ -80,7 +99,8 @@ } /** - * @param source The source to set. + * @param source + * The source to set. */ public void setSource( String source ) { @@ -96,7 +116,8 @@ } /** - * @param value The value to set. + * @param value + * The value to set. */ public void setValue( String value ) { Modified: code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/Period.java =================================================================== --- code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/Period.java 2005-01-05 17:13:25 UTC (rev 50) +++ code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/Period.java 2005-01-07 09:30:18 UTC (rev 51) @@ -10,6 +10,14 @@ public class Period implements Serializable { + /** + * + */ + protected Period() + { + super(); + } + private PeriodType periodType; private Date startDate; @@ -17,7 +25,8 @@ private Date endDate; /** - * @param endDate The end to set. + * @param endDate + * The end to set. */ public void setEndDate( Date endDate ) { @@ -58,7 +67,8 @@ } /** - * @param startDate The start to set. + * @param startDate + * The start to set. */ public void setStartDate( Date startDate ) { @@ -76,7 +86,7 @@ return true; } - if ( !( other instanceof Period ) ) + if ( !(other instanceof Period) ) { return false; } @@ -84,12 +94,24 @@ Period that = (Period) other; return this.periodType.getName().equals( that.periodType.getName() ) - & this.startDate.equals( that.getStartDate() ); + & this.startDate.equals( that.getStartDate() ); } public int hashCode() { - return this.periodType.getName().hashCode() + - this.startDate.hashCode(); + return this.periodType.getName().hashCode() + this.startDate.hashCode(); } + + /** + * @param periodType + * @param startDate + * @param endDate + */ + public Period( PeriodType periodType, Date startDate, Date endDate ) + { + super(); + this.periodType = periodType; + this.startDate = startDate; + this.endDate = endDate; + } } Modified: code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java =================================================================== --- code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java 2005-01-05 17:13:25 UTC (rev 50) +++ code/dhis/dhis-data-store/src/main/java/org/hisp/dhis/datastore/hibernate/HibernateDataStore.java 2005-01-07 09:30:18 UTC (rev 51) @@ -99,10 +99,7 @@ public void addPeriod( String periodTypeName, Date startDate, Date endDate ) throws DataStoreException { - Period period = new Period(); - period.setPeriodType( getPeriodType( periodTypeName ) ); - period.setStartDate( startDate ); - period.setEndDate( endDate ); + Period period = new Period( getPeriodType( periodTypeName ), startDate, endDate ); try { @@ -118,10 +115,7 @@ public void delPeriod( String periodTypeName, Date startDate, Date endDate ) throws DataStoreException { - Period examplePeriod = new Period(); - examplePeriod.setPeriodType( getPeriodType( periodTypeName ) ); - examplePeriod.setStartDate( startDate ); - examplePeriod.setEndDate( endDate ); + Period examplePeriod = new Period( getPeriodType( periodTypeName ), startDate, endDate ); try { @@ -143,9 +137,7 @@ public Period getPeriod( String periodTypeName, Date startDate ) throws DataStoreException { - Period examplePeriod = new Period(); - examplePeriod.setPeriodType( getPeriodType( periodTypeName ) ); - examplePeriod.setStartDate( startDate ); + Period examplePeriod = new Period( getPeriodType( periodTypeName ), startDate, new Date() ); try { @@ -248,11 +240,7 @@ public void addDataValue( String dataElementId, String periodTypeName, Date startDate, Date endDate, String source, String value ) throws DataStoreException { - DataValue dataValue = new DataValue(); - dataValue.setDataElement( getDataElement( dataElementId ) ); - dataValue.setPeriod( getPeriod( periodTypeName, startDate ) ); - dataValue.setSource( source ); - dataValue.setValue( value ); + DataValue dataValue = new DataValue( getDataElement( dataElementId ), getPeriod( periodTypeName, startDate ), source, value ); try { @@ -268,10 +256,7 @@ public void delDataValue( String dataElementId, String periodTypeName, Date startDate, Date endDate, String source ) throws DataStoreException { - DataValue exampleDataValue = new DataValue(); - exampleDataValue.setDataElement( getDataElement( dataElementId ) ); - exampleDataValue.setPeriod( getPeriod( periodTypeName, startDate ) ); - exampleDataValue.setSource( source ); + DataValue exampleDataValue = new DataValue( getDataElement( dataElementId ), getPeriod( periodTypeName, startDate ), source, null ); try { @@ -311,10 +296,7 @@ public DataValue getDataValue( String dataElementId, String periodTypeName, Date startDate, Date endDate, String source ) throws DataStoreException { - DataValue exampleDataValue = new DataValue(); - exampleDataValue.setDataElement( getDataElement( dataElementId ) ); - exampleDataValue.setPeriod( getPeriod( periodTypeName, startDate ) ); - exampleDataValue.setSource( source ); + DataValue exampleDataValue = new DataValue( getDataElement( dataElementId ), getPeriod( periodTypeName, startDate ), source, null ); try { Deleted: code/dhis/dhis-data-store/src/main/resources/org/hisp/dhis/datastore/hibernate/DataSet.hbm.xml =================================================================== --- code/dhis/dhis-data-store/src/main/resources/org/hisp/dhis/datastore/hibernate/DataSet.hbm.xml 2005-01-05 17:13:25 UTC (rev 50) +++ code/dhis/dhis-data-store/src/main/resources/org/hisp/dhis/datastore/hibernate/DataSet.hbm.xml 2005-01-07 09:30:18 UTC (rev 51) @@ -1,20 +0,0 @@ -<?xml version="1.0"?> - -<!DOCTYPE hibernate-mapping - PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" - "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> - -<hibernate-mapping> - <class name="org.hisp.dhis.datastore.DataSet" table="dataset"> - <id name="Id" type="integer" column="id" unsaved-value="0"> - <meta attribute="scope-set">protected</meta> - <generator class="native"/> - </id> - <property name="startDate" type="date" column="startdate"/> - <property name="endDate" type="date" column="enddate"/> - <set name="dataElements" table="dataelement" lazy="true" cascade="all-delete-orphan"> - <key column="id"/> - <one-to-many class="org.hisp.dhis.datastore.DataElement"/> - </set> - </class> -</hibernate-mapping> Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-05 17:13:25 UTC (rev 50) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-07 09:30:18 UTC (rev 51) @@ -165,6 +165,7 @@ { FormElement formElement; FormElement tmpFormElement; + try { Form form = getForm( formName ); |
From: <kr...@st...> - 2005-01-05 17:13:40
|
Author: krin Date: 2005-01-05 18:13:25 +0100 (Wed, 05 Jan 2005) New Revision: 50 Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java Log: o finnished the current HibernateFormManager Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-04 20:16:12 UTC (rev 49) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-05 17:13:25 UTC (rev 50) @@ -164,21 +164,39 @@ throws FormManagerException { FormElement formElement; + FormElement tmpFormElement; try { Form form = getForm( formName ); - ArrayList formElements = (ArrayList) form.getFormElements(); + List formElements = form.getFormElements(); Iterator i = dataElementIds.iterator(); + int c = 0; while( i.hasNext() ) { formElement = new FormElement( dataStore.getDataElement( (String) i.next() ), form ); - - } + int index = form.getFormElements().indexOf( formElement ); + // next line is necessary for keeping the objects persistent state + formElement = (FormElement) form.getFormElements().get( index ); + tmpFormElement = (FormElement) form.getFormElements().get( c ); + if ( !formElement.equals( tmpFormElement ) ) + { + form.getFormElements().set( c, formElement ); + form.getFormElements().set( index, tmpFormElement ); + } + c++; + } + + Session session = sessionManager.getCurrentSession(); + session.update( form ); } catch ( DataStoreException ex ) { throw new FormManagerException( "Could not update DataElements sort order", ex ); } + catch ( HibernateException ex ) + { + throw new FormManagerException( "Could not update DataElements sort order", ex ); + } } } \ No newline at end of file Modified: code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java =================================================================== --- code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-04 20:16:12 UTC (rev 49) +++ code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-05 17:13:25 UTC (rev 50) @@ -7,6 +7,7 @@ package org.hisp.dhis.form.hibernate; import java.util.ArrayList; +import java.util.List; import net.sf.hibernate.Session; import net.sf.hibernate.Transaction; @@ -15,7 +16,6 @@ import org.apache.commons.logging.LogFactory; import org.hisp.dhis.DhisSpringTest; import org.hisp.dhis.datastore.DataStore; -import org.hisp.dhis.form.Form; import org.hisp.dhis.form.FormElement; import org.hisp.dhis.form.FormManager; import org.hisp.dhis.form.FormManagerException; @@ -199,4 +199,57 @@ tx.commit(); sessionManager.closeSession(); } + + public void testUpdateFormElementsOrder() + throws Exception + { + Session session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + + String periodTypeName = "name"; + dataStore.addPeriodType( periodTypeName ); + + String dataElementId1 = "id1"; + String dataElementName1 = "name1"; + dataStore.addDataElement( dataElementId1, dataElementName1, true ); + String dataElementId2 = "id2"; + String dataElementName2 = "name2"; + dataStore.addDataElement( dataElementId2, dataElementName2, true ); + + FormManager formManager = (FormManager) getBean( FormManager.ID ); + String formName = "name"; + formManager.addForm( formName, periodTypeName ); + + formManager.addFormElement( dataElementId1, formManager.getForm( formName ).getName() ); + formManager.addFormElement( dataElementId2, formManager.getForm( formName ).getName() ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 0 ) ).getDataElement().getId().equals( "id1" ) ); + assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 1 ) ).getDataElement().getId().equals( "id2" ) ); + + List newOrder = new ArrayList(); + newOrder.add( dataElementId2 ); + newOrder.add( dataElementId1 ); + + formManager.updateFormElementsOrder( formName, newOrder ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 0 ) ).getDataElement().getId().equals( "id2" ) ); + assertTrue( ( (FormElement) formManager.getForm( formName ).getFormElements().get( 1 ) ).getDataElement().getId().equals( "id1" ) ); + + tx.commit(); + sessionManager.closeSession(); + } } \ No newline at end of file |
Author: krin Date: 2005-01-04 21:16:12 +0100 (Tue, 04 Jan 2005) New Revision: 49 Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/Form.java code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java Log: o Stuff on the HibernateFormManager and tests, missing update method for FormElements sort order Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/Form.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/Form.java 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/Form.java 2005-01-04 20:16:12 UTC (rev 49) @@ -1,8 +1,8 @@ package org.hisp.dhis.form; import java.io.Serializable; -import java.util.HashSet; -import java.util.Set; +import java.util.ArrayList; +import java.util.List; import org.hisp.dhis.datastore.PeriodType; @@ -17,7 +17,7 @@ private PeriodType periodType; - private Set formElements = new HashSet(); + private List formElements = new ArrayList(); /** * @@ -32,7 +32,7 @@ * @param periodType * @param dataElements */ - public Form( String name, PeriodType periodType, Set formElements ) + public Form( String name, PeriodType periodType, List formElements ) { super(); this.name = name; @@ -43,7 +43,7 @@ /** * @return Returns the formElements. */ - public Set getFormElements() + public List getFormElements() { return formElements; } @@ -52,7 +52,7 @@ * @param formElements * The formElements to set. */ - public void setFormElements( Set formElements ) + public void setFormElements( List formElements ) { this.formElements = formElements; } Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java 2005-01-04 20:16:12 UTC (rev 49) @@ -21,8 +21,6 @@ private Form form; - private int sortOrder; - /** * */ @@ -34,14 +32,12 @@ /** * @param dataElement * @param form - * @param sortOrder */ - protected FormElement( DataElement dataElement, Form form, int sortOrder ) + public FormElement( DataElement dataElement, Form form ) { super(); this.dataElement = dataElement; this.form = form; - this.sortOrder = sortOrder; } public boolean equals( Object other ) @@ -59,25 +55,8 @@ { return this.dataElement.getName().hashCode() + this.form.getName().hashCode(); } - - /** - * @return Returns the sortOrder. - */ - public int getSortOrder() - { - return sortOrder; - } /** - * @param sortOrder - * The sortOrder to set. - */ - public void setSortOrder( int sortOrder ) - { - this.sortOrder = sortOrder; - } - - /** * @return Returns the dataElement. */ public DataElement getDataElement() Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java 2005-01-04 20:16:12 UTC (rev 49) @@ -6,7 +6,10 @@ */ package org.hisp.dhis.form; +import java.util.List; + + /** * @author kristian * @@ -33,4 +36,13 @@ // ---------------------------------------------------------------------- // FormElement // ---------------------------------------------------------------------- + + void addFormElement( String dataElementId, String formName ) + throws FormManagerException; + + void delFormElement( String dataElementId, String formName ) + throws FormManagerException; + + void updateFormElementsOrder( String formName, List dataElementIds ) + throws FormManagerException; } \ No newline at end of file Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-04 20:16:12 UTC (rev 49) @@ -6,7 +6,9 @@ */ package org.hisp.dhis.form.hibernate; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; @@ -17,6 +19,7 @@ import org.hisp.dhis.datastore.DataStoreException; import org.hisp.dhis.datastore.PeriodType; import org.hisp.dhis.form.Form; +import org.hisp.dhis.form.FormElement; import org.hisp.dhis.form.FormManager; import org.hisp.dhis.form.FormManagerException; import org.hisp.dhis.hibernate.HibernateSessionManager; @@ -64,7 +67,7 @@ try { PeriodType periodType = dataStore.getPeriodType( periodTypeName ); - Form form = new Form( formName, periodType, new HashSet() ); + Form form = new Form( formName, periodType, new ArrayList() ); Session session = sessionManager.getCurrentSession(); session.save( form ); @@ -108,4 +111,74 @@ throw new FormManagerException( "Could not get Form", ex ); } } + + // ---------------------------------------------------------------------- + // FormElement + // ---------------------------------------------------------------------- + + public void addFormElement( String dataElementId, String formName ) + throws FormManagerException + { + try + { + Form form = getForm( formName ); + FormElement formElement = new FormElement( dataStore.getDataElement( dataElementId ), form ); + form.getFormElements().add( formElement ); + + Session session = sessionManager.getCurrentSession(); + session.update( form ); + } + catch ( DataStoreException ex ) + { + throw new FormManagerException( "Could not add FormElement", ex ); + } + catch ( HibernateException ex ) + { + throw new FormManagerException( "Could not add FormElement", ex ); + } + } + + public void delFormElement( String dataElementId, String formName ) + throws FormManagerException + { + try + { + Form form = getForm( formName ); + FormElement formElement = new FormElement( dataStore.getDataElement( dataElementId ), form ); + form.getFormElements().remove( formElement ); + + Session session = sessionManager.getCurrentSession(); + session.update( form ); + } + catch ( DataStoreException ex ) + { + throw new FormManagerException( "Could not delete FormElement", ex ); + } + catch ( HibernateException ex ) + { + throw new FormManagerException( "Could not delete FormElement", ex ); + } + } + + public void updateFormElementsOrder( String formName, List dataElementIds ) + throws FormManagerException + { + FormElement formElement; + try + { + Form form = getForm( formName ); + ArrayList formElements = (ArrayList) form.getFormElements(); + + Iterator i = dataElementIds.iterator(); + while( i.hasNext() ) + { + formElement = new FormElement( dataStore.getDataElement( (String) i.next() ), form ); + + } + } + catch ( DataStoreException ex ) + { + throw new FormManagerException( "Could not update DataElements sort order", ex ); + } + } } \ No newline at end of file Modified: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml =================================================================== --- code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml 2005-01-04 20:16:12 UTC (rev 49) @@ -17,13 +17,13 @@ class="org.hisp.dhis.datastore.PeriodType" not-null="true"/> - <set name="formElements" + <list name="formElements" table="formelement" lazy="false" - cascade="all-delete-orphan" - order-by="sortorder asc"> + cascade="all-delete-orphan"> <key column="id"/> + <index column="sortorder"/> <one-to-many class="org.hisp.dhis.form.FormElement"/> - </set> + </list> </class> </hibernate-mapping> \ No newline at end of file Modified: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml =================================================================== --- code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml 2005-01-04 20:16:12 UTC (rev 49) @@ -8,6 +8,5 @@ <key-many-to-one name="form" class="org.hisp.dhis.form.Form"/> <key-many-to-one name="dataElement" class="org.hisp.dhis.datastore.DataElement"/> </composite-id> - <property name="sortOrder" type="int" not-null="true"/> </class> </hibernate-mapping> \ No newline at end of file Modified: code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java =================================================================== --- code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-04 15:18:10 UTC (rev 48) +++ code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-04 20:16:12 UTC (rev 49) @@ -6,6 +6,8 @@ */ package org.hisp.dhis.form.hibernate; +import java.util.ArrayList; + import net.sf.hibernate.Session; import net.sf.hibernate.Transaction; @@ -13,7 +15,8 @@ import org.apache.commons.logging.LogFactory; import org.hisp.dhis.DhisSpringTest; import org.hisp.dhis.datastore.DataStore; -import org.hisp.dhis.datastore.DataStoreException; +import org.hisp.dhis.form.Form; +import org.hisp.dhis.form.FormElement; import org.hisp.dhis.form.FormManager; import org.hisp.dhis.form.FormManagerException; import org.hisp.dhis.hibernate.HibernateSessionManager; @@ -53,10 +56,6 @@ String periodTypeName = "testAddForm.name"; dataStore.addPeriodType( periodTypeName ); - - String dataElementId = "testAddForm.id"; - String dataElementName = "testAddForm.name"; - dataStore.addDataElement( dataElementId, dataElementName, true ); FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "testAddForm.name"; @@ -84,10 +83,6 @@ String periodTypeName = "testDelForm.name"; dataStore.addPeriodType( periodTypeName ); - - String dataElementId = "testDelForm.id"; - String dataElementName = "testDelForm.name"; - dataStore.addDataElement( dataElementId, dataElementName, true ); FormManager formManager = (FormManager) getBean( FormManager.ID ); String formName = "testDelForm.name"; @@ -120,4 +115,88 @@ tx.commit(); sessionManager.closeSession(); } + + // ---------------------------------------------------------------------- + // FormElement + // ---------------------------------------------------------------------- + + public void testAddFormElement() + throws Exception + { + Session session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + + String periodTypeName = "name"; + dataStore.addPeriodType( periodTypeName ); + + String dataElementId = "id"; + String dataElementName = "name"; + dataStore.addDataElement( dataElementId, dataElementName, true ); + + FormManager formManager = (FormManager) getBean( FormManager.ID ); + String formName = "name"; + formManager.addForm( formName, periodTypeName ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + formManager.addFormElement( dataElementId, formManager.getForm( formName ).getName() ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + assertTrue( formManager.getForm( formName ).getFormElements().size() == 1 ); + + tx.commit(); + sessionManager.closeSession(); + } + + public void testDelFormElement() + throws Exception + { + Session session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + + String periodTypeName = "name"; + dataStore.addPeriodType( periodTypeName ); + + String dataElementId = "id"; + String dataElementName = "name"; + dataStore.addDataElement( dataElementId, dataElementName, true ); + + FormManager formManager = (FormManager) getBean( FormManager.ID ); + String formName = "name"; + formManager.addForm( formName, periodTypeName ); + + formManager.addFormElement( dataElementId, formManager.getForm( formName ).getName() ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + formManager.delFormElement( dataElementId, formManager.getForm( formName ).getName() ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + assertTrue( formManager.getForm( formName ).getFormElements().size() == 0 ); + + tx.commit(); + sessionManager.closeSession(); + } } \ No newline at end of file |
From: Knut S. <kn...@ya...> - 2005-01-04 15:28:34
|
Diskusjon om Open Source model driven architecture tool (MDA) med støtte for Hibernate, Spring og Maven. http://theserverside.com/news/thread.tss?thread_id=30877 Knut |
From: <kr...@st...> - 2005-01-04 15:18:24
|
Author: krin Date: 2005-01-04 16:18:10 +0100 (Tue, 04 Jan 2005) New Revision: 48 Added: code/dhis/dhis-form/src/main/resources/META-INF/ code/dhis/dhis-form/src/main/resources/META-INF/dhis/ code/dhis/dhis-form/src/main/resources/META-INF/dhis/beans.xml Log: o dhis-form spring config Added: code/dhis/dhis-form/src/main/resources/META-INF/dhis/beans.xml =================================================================== --- code/dhis/dhis-form/src/main/resources/META-INF/dhis/beans.xml 2005-01-04 15:17:30 UTC (rev 47) +++ code/dhis/dhis-form/src/main/resources/META-INF/dhis/beans.xml 2005-01-04 15:18:10 UTC (rev 48) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE beans PUBLIC + "-//SPRING//DTD BEAN//EN" + "http://www.springframework.org/dtd/spring-beans.dtd"> + +<beans> + <bean id="org.hisp.dhis.form.FormManager" class="org.hisp.dhis.form.hibernate.HibernateFormManager"> + <property name="sessionManager"> + <ref bean="org.hisp.dhis.hibernate.HibernateSessionManager"/> + </property> + <property name="dataStore"> + <ref bean="org.hisp.dhis.datastore.DataStore"/> + </property> + </bean> +</beans> Property changes on: code/dhis/dhis-form/src/main/resources/META-INF/dhis/beans.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:keywords + Id Name: svn:eol-style + native |
From: <kr...@st...> - 2005-01-04 15:17:50
|
Author: krin Date: 2005-01-04 16:17:30 +0100 (Tue, 04 Jan 2005) New Revision: 47 Added: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml code/dhis/dhis-form/src/test/java/org/ code/dhis/dhis-form/src/test/java/org/hisp/ code/dhis/dhis-form/src/test/java/org/hisp/dhis/ code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/ code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/ code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java code/dhis/dhis-form/src/test/resources/hibernate.cfg.xml code/dhis/dhis-form/src/test/resources/log4j.properties Removed: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/Form.hbm.xml code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/FormElement.hbm.xml Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java Log: o Mapped Form and FormElement o Added the Form part of HibernateFormManager with tests Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormElement.java 2005-01-04 15:17:30 UTC (rev 47) @@ -6,6 +6,8 @@ */ package org.hisp.dhis.form; +import java.io.Serializable; + import org.hisp.dhis.datastore.DataElement; /** @@ -13,6 +15,7 @@ * go to Window - Preferences - Java - Code Style - Code Templates */ public class FormElement + implements Serializable { private DataElement dataElement; @@ -41,6 +44,22 @@ this.sortOrder = sortOrder; } + public boolean equals( Object other ) + { + if ( this == other ) + return true; + if ( !( other instanceof FormElement ) ) + return false; + final FormElement that = (FormElement) other; + return this.dataElement.getName().equals( that.dataElement.getName() ) + & this.form.getName().equals( that.form.getName() ); + } + + public int hashCode() + { + return this.dataElement.getName().hashCode() + this.form.getName().hashCode(); + } + /** * @return Returns the sortOrder. */ Modified: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/FormManager.java 2005-01-04 15:17:30 UTC (rev 47) @@ -6,7 +6,6 @@ */ package org.hisp.dhis.form; -import java.util.Set; /** * @author kristian @@ -22,12 +21,15 @@ // Form // ---------------------------------------------------------------------- - void addForm( String name, String periodTypeName, Set formElements ) + void addForm( String name, String periodTypeName ) throws FormManagerException; - void delForm( String name ) + void delForm( String formName ) throws FormManagerException; + Form getForm( String formName ) + throws FormManagerException; + // ---------------------------------------------------------------------- // FormElement // ---------------------------------------------------------------------- Added: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java =================================================================== --- code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java 2005-01-04 15:17:30 UTC (rev 47) @@ -0,0 +1,111 @@ +/* + * Created on Jan 4, 2005 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.hisp.dhis.form.hibernate; + +import java.util.HashSet; + +import net.sf.hibernate.HibernateException; +import net.sf.hibernate.Session; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hisp.dhis.datastore.DataStore; +import org.hisp.dhis.datastore.DataStoreException; +import org.hisp.dhis.datastore.PeriodType; +import org.hisp.dhis.form.Form; +import org.hisp.dhis.form.FormManager; +import org.hisp.dhis.form.FormManagerException; +import org.hisp.dhis.hibernate.HibernateSessionManager; + +/** + * @author kristian + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class HibernateFormManager + implements FormManager +{ + private static Log log = LogFactory.getLog( HibernateFormManager.class ); + + private HibernateSessionManager sessionManager; + + private DataStore dataStore; + + // ---------------------------------------------------------------------- + // Dependency Setters + // ---------------------------------------------------------------------- + + public void setSessionManager( HibernateSessionManager sessionManager ) + { + this.sessionManager = sessionManager; + } + + public void setDataStore( DataStore dataStore ) + { + this.dataStore = dataStore; + } + + // ---------------------------------------------------------------------- + // FormManager Implementation + // ---------------------------------------------------------------------- + + // ---------------------------------------------------------------------- + // Form + // ---------------------------------------------------------------------- + + public void addForm( String formName, String periodTypeName ) + throws FormManagerException + { + try + { + PeriodType periodType = dataStore.getPeriodType( periodTypeName ); + Form form = new Form( formName, periodType, new HashSet() ); + + Session session = sessionManager.getCurrentSession(); + session.save( form ); + } + catch ( DataStoreException ex ) + { + throw new FormManagerException( "Could not get PeriodType from DataStore", ex ); + } + catch ( HibernateException ex ) + { + throw new FormManagerException( "Could not add form", ex ); + } + } + + public void delForm( String formName ) + throws FormManagerException + { + Form form = getForm( formName ); + try + { + Session session = sessionManager.getCurrentSession(); + session.delete( form ); + } + catch ( HibernateException ex ) + { + throw new FormManagerException( "Could not delete Form", ex ); + } + } + + public Form getForm( String formName ) + throws FormManagerException + { + try + { + Session session = sessionManager.getCurrentSession(); + Form form = (Form) session.load( Form.class, formName ); + return form; + } + catch ( HibernateException ex ) + { + throw new FormManagerException( "Could not get Form", ex ); + } + } +} \ No newline at end of file Property changes on: code/dhis/dhis-form/src/main/java/org/hisp/dhis/form/hibernate/HibernateFormManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Deleted: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/Form.hbm.xml =================================================================== --- code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/Form.hbm.xml 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/Form.hbm.xml 2005-01-04 15:17:30 UTC (rev 47) @@ -1,26 +0,0 @@ -<?xml version="1.0"?> - -<!DOCTYPE hibernate-mapping - PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" - "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> - -<hibernate-mapping> - <class name="org.hisp.dhis.datastore.DataElement" table="dataelement"> - <id name="name" type="string" column="name" unsaved-value="0" access="field"> - <meta attribute="scope-set">protected</meta> - <generator class="native"/> - </id> - - <many-to-one - name="periodType" - column="periodtype" - class="org.hisp.dhis.datastore.PeriodType" - not-null="true"/> - - <set name="formElements" table="formelement" lazy="false" cascade="all-delete-orphan" sort="natural"> - <key column="id"/> - <index column="sortorder"/> - <one-to-many class="org.hisp.dhis.datastore.FormElement"/> - </set> - </class> -</hibernate-mapping> Deleted: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/FormElement.hbm.xml =================================================================== --- code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/FormElement.hbm.xml 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/FormElement.hbm.xml 2005-01-04 15:17:30 UTC (rev 47) @@ -1,13 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE hibernate-mapping - PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" - "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> -<hibernate-mapping> - <class name="org.hisp.dhis.form.FormElement" table="formelement"> - <composite-id unsaved-value="any"> - <key-many-to-one name="form" class="org.hisp.dhis.form.Form" column="formid"/> - <key-many-to-one name="dataElement" class="org.hisp.dhis.datastore.DataElement"/> - </composite-id> - <property name="sortOrder" type="int" not-null="true"/> - </class> -</hibernate-mapping> \ No newline at end of file Copied: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml (from rev 46, code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/Form.hbm.xml) =================================================================== --- code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/Form.hbm.xml 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/Form.hbm.xml 2005-01-04 15:17:30 UTC (rev 47) @@ -0,0 +1,29 @@ +<?xml version="1.0"?> + +<!DOCTYPE hibernate-mapping + PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" + "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> + +<hibernate-mapping> + <class name="org.hisp.dhis.form.Form" table="form"> + <id name="name" type="string" column="name" access="field"> + <meta attribute="scope-set">protected</meta> + <generator class="assigned"/> + </id> + + <many-to-one + name="periodType" + column="periodtype" + class="org.hisp.dhis.datastore.PeriodType" + not-null="true"/> + + <set name="formElements" + table="formelement" + lazy="false" + cascade="all-delete-orphan" + order-by="sortorder asc"> + <key column="id"/> + <one-to-many class="org.hisp.dhis.form.FormElement"/> + </set> + </class> +</hibernate-mapping> \ No newline at end of file Copied: code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml (from rev 46, code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/FormElement.hbm.xml) =================================================================== --- code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/FormElement.hbm.xml 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/main/resources/org/hisp/dhis/form/hibernate/FormElement.hbm.xml 2005-01-04 15:17:30 UTC (rev 47) @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<!DOCTYPE hibernate-mapping + PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" + "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> +<hibernate-mapping> + <class name="org.hisp.dhis.form.FormElement" table="formelement"> + <composite-id unsaved-value="any"> + <key-many-to-one name="form" class="org.hisp.dhis.form.Form"/> + <key-many-to-one name="dataElement" class="org.hisp.dhis.datastore.DataElement"/> + </composite-id> + <property name="sortOrder" type="int" not-null="true"/> + </class> +</hibernate-mapping> \ No newline at end of file Added: code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java =================================================================== --- code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java 2005-01-04 15:17:30 UTC (rev 47) @@ -0,0 +1,123 @@ +/* + * Created on Jan 4, 2005 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.hisp.dhis.form.hibernate; + +import net.sf.hibernate.Session; +import net.sf.hibernate.Transaction; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hisp.dhis.DhisSpringTest; +import org.hisp.dhis.datastore.DataStore; +import org.hisp.dhis.datastore.DataStoreException; +import org.hisp.dhis.form.FormManager; +import org.hisp.dhis.form.FormManagerException; +import org.hisp.dhis.hibernate.HibernateSessionManager; + +/** + * @author kristian + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class HibernateFormManagerTest + extends DhisSpringTest +{ + protected static Log log = LogFactory.getLog( HibernateFormManagerTest.class ); + + private HibernateSessionManager sessionManager; + + private Transaction tx; + + public void setUpTest() + throws Exception + { + sessionManager = (HibernateSessionManager) getBean( HibernateSessionManager.ID ); + } + + // ---------------------------------------------------------------------- + // Form + // ---------------------------------------------------------------------- + + public void testAddForm() + throws Exception + { + Session session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + + String periodTypeName = "testAddForm.name"; + dataStore.addPeriodType( periodTypeName ); + + String dataElementId = "testAddForm.id"; + String dataElementName = "testAddForm.name"; + dataStore.addDataElement( dataElementId, dataElementName, true ); + + FormManager formManager = (FormManager) getBean( FormManager.ID ); + String formName = "testAddForm.name"; + formManager.addForm( formName, periodTypeName ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + assertNotNull( formManager.getForm( formName ) ); + + tx.commit(); + sessionManager.closeSession(); + } + + public void testDelForm() + throws Exception + { + Session session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + DataStore dataStore = (DataStore) getBean( DataStore.ID ); + + String periodTypeName = "testDelForm.name"; + dataStore.addPeriodType( periodTypeName ); + + String dataElementId = "testDelForm.id"; + String dataElementName = "testDelForm.name"; + dataStore.addDataElement( dataElementId, dataElementName, true ); + + FormManager formManager = (FormManager) getBean( FormManager.ID ); + String formName = "testDelForm.name"; + formManager.addForm( formName, periodTypeName ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + formManager.delForm( formName ); + + tx.commit(); + sessionManager.closeSession(); + + session = sessionManager.getCurrentSession(); + tx = session.beginTransaction(); + + try + { + formManager.getForm( formName ); + fail( "Expected FormManagerException" ); + } + catch ( FormManagerException ex ) + { + // expected + } + + tx.commit(); + sessionManager.closeSession(); + } +} \ No newline at end of file Property changes on: code/dhis/dhis-form/src/test/java/org/hisp/dhis/form/hibernate/HibernateFormManagerTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: code/dhis/dhis-form/src/test/resources/hibernate.cfg.xml =================================================================== --- code/dhis/dhis-form/src/test/resources/hibernate.cfg.xml 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/test/resources/hibernate.cfg.xml 2005-01-04 15:17:30 UTC (rev 47) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!DOCTYPE hibernate-configuration + PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" + "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> + +<hibernate-configuration> + <session-factory> + <property name="show_sql">false</property> + <property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property> + <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> + <property name="hibernate.connection.url">jdbc:hsqldb:.</property> + <property name="hibernate.connection.username">sa</property> + <property name="hibernate.connection.password"></property> + <property name="hibernate.connection.pool_size">10</property> + <property name="hibernate.hbm2ddl.auto">create-drop</property> + <mapping resource="org/hisp/dhis/form/hibernate/Form.hbm.xml"/> + <mapping resource="org/hisp/dhis/form/hibernate/FormElement.hbm.xml"/> + <mapping resource="org/hisp/dhis/datastore/hibernate/DataElement.hbm.xml"/> + <mapping resource="org/hisp/dhis/datastore/hibernate/PeriodType.hbm.xml"/> + </session-factory> +</hibernate-configuration> Property changes on: code/dhis/dhis-form/src/test/resources/hibernate.cfg.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:keywords + Id Name: svn:eol-style + native Added: code/dhis/dhis-form/src/test/resources/log4j.properties =================================================================== --- code/dhis/dhis-form/src/test/resources/log4j.properties 2005-01-04 00:14:04 UTC (rev 46) +++ code/dhis/dhis-form/src/test/resources/log4j.properties 2005-01-04 15:17:30 UTC (rev 47) @@ -0,0 +1,5 @@ +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern=%d %p %c - %m%n + +log4j.rootCategory = WARN, console Property changes on: code/dhis/dhis-form/src/test/resources/log4j.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native |
From: Knut S. <kn...@ya...> - 2005-01-04 10:11:46
|
Ut i fra svaret under, registrerte jeg hisp.info til ns1.hisp.info og numbat.inamo.no. Ser ikke ut til å virke ennå (men det står jo at ting kan ta opptil 48 timer). Knut --- Support <su...@su...> skrev: > Dato: Mon, 3 Jan 2005 04:36:41 -0700 (MST) > Til: kn...@if... > Fra: Support <su...@su...> > Tema: Total DNS Control [Incident: 050102-000796] > Response (KADE P.) - 01/03/2005 04:36 AM > Dear Knut Staring, > > Thank you for contacting customer support. Unfortunately the reason > why you hypothetical nameserver worked was because it was not based > on the Verisign based regisried domain name extensions. > h59622.serverkompetenz.net is not a verified nameserver. You can > register your nameservers under your account's Domain Host Summary > section. Registering your name server IP addresses allows you to > define a name for your server based on your domain name. You can > register any host name within this format: > host.domain.tld (example: "nameserver1.godaddy.com") > > If you understand what is involved and have made the necessary > preparations, please follow the steps below to register your name > servers. > > First, log into your customer account: > > Go to the <a > href="https://www.godaddy.com/gdshop/shopper_lookup.asp?isc=webjsb">Go > Daddy Account Login Page</a> > Log in using your account username (which may be the same as your > customer number) and password > > If you have trouble logging in, our password reset form may help you. > You can find this form through the following link: > <a > href="https://mya.godaddy.com/account/AccountRetrieval/retrieveaccount.aspx?isc=webjsb">Account > Retrieval Page</a> > > Once logged in just follow these steps: > > Select 'Manage Domains' from the 'Domain Names' menu > Click on the domain you wish to configure name servers for > Click the '+' next to 'Domain Host Summary' from the menu that > appears to the right > Click on the link named 'Click here to see details or to modify' > Enter the first name server with its IP address > Click the green 'Save Changes' button > Click 'Add New Host' to register additional server names > > Note: > Changes to the settings of a domain including the registration of > name server names can take an average of 48 hours due to the number > of networks involved. These networks are controlled by many > different entities and are updated independently. |