Changeset 1343
- Timestamp:
- Nov 29, 2005, 4:37:58 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 21 added
- 17 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r1194 r1343 413 413 414 414 <!-- Define the hibernatedoclet task --> 415 <path id="xdoclet.classpath">416 <fileset dir="${build_lib}/">417 <include name="*.jar"/>418 </fileset>419 </path>420 421 <taskdef name="hibernatedoclet"422 classname="xdoclet.modules.hibernate.HibernateDocletTask">423 <classpath refid="xdoclet.classpath"/>424 </taskdef>415 <path id="xdoclet.classpath"> 416 <fileset dir="${build_lib}/"> 417 <include name="*.jar"/> 418 </fileset> 419 </path> 420 421 <taskdef name="hibernatedoclet" 422 classname="xdoclet.modules.hibernate.HibernateDocletTask"> 423 <classpath refid="xdoclet.classpath"/> 424 </taskdef> 425 425 426 426 <!-- Execute the hibernatedoclet task --> … … 432 432 </hibernatedoclet> 433 433 434 <!-- Upgrade grammar from Hibernate 1 to Hibernate2-->435 <replace dir=" .">436 <include name=" *.hbm.xml"/>434 <!-- Upgrade grammar from Hibernate2 to Hibernate3 --> 435 <replace dir="${build}"> 436 <include name="org/proteios/core/element/*.hbm.xml"/> 437 437 <replacefilter token="readonly=" value="inverse="/> 438 438 <replacefilter token="role=" value="name="/> 439 <replacefilter token="hibernate-mapping.dtd" value="hibernate-mapping-2.0.dtd"/> 439 <replacefilter token="Hibernate Mapping DTD 2.0" value="Hibernate Mapping DTD 3.0"/> 440 <replacefilter token="hibernate-mapping-2.0.dtd" value="hibernate-mapping-3.0.dtd"/> 440 441 </replace> 441 442 </target> -
trunk/dist/batchProteios.bat
r1338 r1343 1 java -Xmx1000m -cp .;.\bin;.\proteios\conf;.\proteios\ conf\0.8;.\proteios\lib\c3p0.jar;.\proteios\lib\cglib2.jar;.\proteios\lib\commons-collections.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j.jar;.\proteios\lib\ehcache.jar;.\proteios\lib\hibernate2.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\jgroups.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.8.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache.jar;.\proteios\lib\proxool.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xerces.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql.jar;.\proteios\lib\postgresql.jar;.\proteios\lib\lsid-client-1.1.1.jar;.\proteios\lib\axis.jar;.\proteios\lib\activation.jar;.\proteios\lib\mail.jar;.\proteios\lib\dnsjava-1.3.2.jar;.\proteios\lib\castor-0.9.5.jar;.\proteios\lib\saaj.jar;.\proteios\lib\jaxrpc.jar;.\proteios\lib\wsdl4j.jar;.\proteios\lib\commons-discovery-0.2.jar org.proteios.batch.BMain %*1 java -Xmx1000m -cp .;.\bin;.\proteios\conf;.\proteios\lib\c3p0-0.9.0.jar;.\proteios\lib\asm-attrs.jar;.\proteios\lib\asm.jar;.\proteios\lib\cglib-2.1.jar;.\proteios\lib\commons-collections-2.1.1.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging-1.0.4.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j-1.6.jar;.\proteios\lib\ehcache-1.1.jar;.\proteios\lib\hibernate3.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\antlr-2.7.5H3.jar;.\proteios\lib\jgroups-2.2.7.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.9.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache-2.1.jar;.\proteios\lib\proxool-0.8.3.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xerces.jar;.\proteios\lib\jaxen-1.1-beta-4.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql-connector-java-3.1.10-bin.jar;.\proteios\lib\postgresql.jar;.\proteios\lib\lsid-client-1.1.1.jar;.\proteios\lib\axis.jar;.\proteios\lib\activation.jar;.\proteios\lib\mail.jar;.\proteios\lib\dnsjava-1.3.2.jar;.\proteios\lib\castor-0.9.5.jar;.\proteios\lib\saaj.jar;.\proteios\lib\jaxrpc.jar;.\proteios\lib\wsdl4j-1.5.1.jar;.\proteios\lib\commons-discovery-0.2.jar org.proteios.batch.BMain %* -
trunk/dist/batchProteios.sh
r1338 r1343 1 java -Xmx1000m -cp .:./bin:./proteios/conf:./proteios/ conf/0.8:./proteios/lib/c3p0.jar:./proteios/lib/cglib2.jar:./proteios/lib/commons-collections.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j.jar:./proteios/lib/ehcache.jar:./proteios/lib/hibernate2.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/jgroups.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.8.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache.jar:./proteios/lib/proxool.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xerces.jar:./proteios/lib/xml-apis.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql.jar:./proteios/lib/postgresql.jar:./proteios/lib/lsid-client-1.1.1.jar:./proteios/lib/axis.jar:./proteios/lib/activation.jar:./proteios/lib/mail.jar:./proteios/lib/dnsjava-1.3.2.jar:./proteios/lib/castor-0.9.5.jar:./proteios/lib/saaj.jar:./proteios/lib/jaxrpc.jar:./proteios/lib/wsdl4j.jar:./proteios/lib/commons-discovery-0.2.jar org.proteios.batch.BMain $*1 java -Xmx1000m -cp .:./bin:./proteios/conf:./proteios/lib/c3p0-0.9.0.jar:./proteios/lib/asm-attrs.jar:./proteios/lib/asm.jar:./proteios/lib/cglib-2.1.jar:./proteios/lib/commons-collections-2.1.1.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging-1.0.4.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j-1.6.jar:./proteios/lib/ehcache-1.1.jar:./proteios/lib/hibernate3.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/antlr-2.7.5H3.jar:./proteios/lib/jgroups-2.2.7.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.9.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache-2.1.jar:./proteios/lib/proxool-0.8.3.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xerces.jar:./proteios/lib/jaxen-1.1-beta-4.jar:./proteios/lib/xml-apis.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql-connector-java-3.1.10-bin.jar:./proteios/lib/postgresql.jar:./proteios/lib/lsid-client-1.1.1.jar:./proteios/lib/axis.jar:./proteios/lib/activation.jar:./proteios/lib/mail.jar:./proteios/lib/dnsjava-1.3.2.jar:./proteios/lib/castor-0.9.5.jar:./proteios/lib/saaj.jar:./proteios/lib/jaxrpc.jar:./proteios/lib/wsdl4j-1.5.1.jar:./proteios/lib/commons-discovery-0.2.jar org.proteios.batch.BMain $* -
trunk/dist/initDatabase.bat
r1130 r1343 1 java -cp .;.\bin;.\proteios\conf;.\proteios\lib\c3p0 .jar;.\proteios\lib\cglib2.jar;.\proteios\lib\commons-collections.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j.jar;.\proteios\lib\ehcache.jar;.\proteios\lib\hibernate2.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\jgroups.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.8.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache.jar;.\proteios\lib\proxool.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xerces.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql.jar;.\proteios\lib\postgresql.jar org.proteios.core.InitDatabase %*1 java -cp .;.\bin;.\proteios\conf;.\proteios\lib\c3p0-0.9.0.jar;.\proteios\lib\cglib-2.1.jar;.\proteios\lib\commons-collections-2.1.1.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging-1.0.4.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j-1.6.jar;.\proteios\lib\ehcache-1.1.jar;.\proteios\lib\hibernate3.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\jgroups-2.2.7.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.9.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache-2.1.jar;.\proteios\lib\proxool-0.8.3.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xerces.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql-connector-java-3.1.10-bin.jar;.\proteios\lib\postgresql.jar org.proteios.core.InitDatabase %* -
trunk/dist/initDatabase.sh
r1130 r1343 1 java -cp .:./bin:./proteios/conf:./proteios/lib/c3p0 .jar:./proteios/lib/cglib2.jar:./proteios/lib/commons-collections.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j.jar:./proteios/lib/ehcache.jar:./proteios/lib/hibernate2.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/jgroups.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.8.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache.jar:./proteios/lib/proxool.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xerces.jar:./proteios/lib/xml-apis.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql.jar:./proteios/lib/postgresql.jar org.proteios.core.InitDatabase $*1 java -cp .:./bin:./proteios/conf:./proteios/lib/c3p0-0.9.0.jar:./proteios/lib/asm.jar:./proteios/lib/asm-attrs.jar:./proteios/lib/cglib-2.1.jar:./proteios/lib/commons-collections-2.1.1.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging-1.0.4.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j-1.6.jar:./proteios/lib/ehcache-1.1.jar:./proteios/lib/hibernate3.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/jgroups-2.2.7.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.9.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache-2.1.jar:./proteios/lib/proxool-0.8.3.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xerces.jar:./proteios/lib/jaxen-1.1-beta-4.jar:./proteios/lib/xml-apis.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql-connector-java-3.1.10-bin.jar:./proteios/lib/postgresql.jar org.proteios.core.InitDatabase $* -
trunk/dist/run_proteios.bat
r1338 r1343 1 java -Xmx1000m -cp .;.\bin;.\proteios\conf;.\proteios\lib\c3p0 .jar;.\proteios\lib\cglib2.jar;.\proteios\lib\commons-collections.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j.jar;.\proteios\lib\ehcache.jar;.\proteios\lib\hibernate2.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\jgroups.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.8.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache.jar;.\proteios\lib\proxool.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\xercesImpl.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql.jar;.\proteios\lib\postgresql.jar;.\proteios\lib\lsid-client-1.1.1.jar;.\proteios\lib\axis.jar;.\proteios\lib\activation.jar;.\proteios\lib\mail.jar;.\proteios\lib\dnsjava-1.3.2.jar;.\proteios\lib\castor-0.9.5.jar;.\proteios\lib\saaj.jar;.\proteios\lib\jaxrpc.jar;.\proteios\lib\wsdl4j.jar;.\proteios\lib\commons-discovery-0.2.jar org.proteios.gui.main.GMain1 java -Xmx1000m -cp .;.\bin;.\proteios\conf;.\proteios\lib\c3p0-0.9.0.jar;.\proteios\lib\asm-attrs.jar;.\proteios\lib\asm.jar;.\proteios\lib\cglib-2.1.jar;.\proteios\lib\commons-collections-2.1.1.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging-1.0.4.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j-1.6.jar;.\proteios\lib\ehcache-1.1.jar;.\proteios\lib\hibernate3.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\antlr-2.7.5H3.jar;.\proteios\lib\jgroups-2.2.7.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.9.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache-2.1.jar;.\proteios\lib\proxool-0.8.3.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\xercesImpl.jar;.\proteios\lib\jaxen-1.1-beta-4.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql-connector-java-3.1.10-bin.jar;.\proteios\lib\postgresql.jar;.\proteios\lib\lsid-client-1.1.1.jar;.\proteios\lib\axis.jar;.\proteios\lib\activation.jar;.\proteios\lib\mail.jar;.\proteios\lib\dnsjava-1.3.2.jar;.\proteios\lib\castor-0.9.5.jar;.\proteios\lib\saaj.jar;.\proteios\lib\jaxrpc.jar;.\proteios\lib\wsdl4j-1.5.1.jar;.\proteios\lib\commons-discovery-0.2.jar org.proteios.gui.main.GMain -
trunk/dist/run_proteios.sh
r1338 r1343 1 java -Xmx100 m -cp .:./bin:./proteios/conf:./proteios/conf/0.8:./proteios/lib/c3p0.jar:./proteios/lib/cglib2.jar:./proteios/lib/commons-collections.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j.jar:./proteios/lib/ehcache.jar:./proteios/lib/hibernate2.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/jgroups.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.8.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache.jar:./proteios/lib/proxool.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xml-apis.jar:./proteios/lib/xercesImpl.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql.jar:./proteios/lib/postgresql.jar:./proteios/lib/lsid-client-1.1.1.jar:./proteios/lib/axis.jar:./proteios/lib/activation.jar:./proteios/lib/mail.jar:./proteios/lib/dnsjava-1.3.2.jar:./proteios/lib/castor-0.9.5.jar:./proteios/lib/saaj.jar:./proteios/lib/jaxrpc.jar:./proteios/lib/wsdl4j.jar:./proteios/lib/commons-discovery-0.2.jar org.proteios.gui.main.GMain1 java -Xmx1000m -cp .:./bin:./proteios/conf:./proteios/lib/c3p0-0.9.0.jar:./proteios/lib/asm-attrs.jar:./proteios/lib/asm.jar:./proteios/lib/cglib-2.1.jar:./proteios/lib/commons-collections-2.1.1.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging-1.0.4.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j-1.6.jar:./proteios/lib/ehcache-1.1.jar:./proteios/lib/hibernate3.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/antlr-2.7.5H3.jar:./proteios/lib/jgroups-2.2.7.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.9.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache-2.1.jar:./proteios/lib/proxool-0.8.3.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xml-apis.jar:./proteios/lib/xercesImpl.jar:./proteios/lib/jaxen-1.1-beta-4.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql-connector-java-3.1.10-bin.jar:./proteios/lib/postgresql.jar:./proteios/lib/lsid-client-1.1.1.jar:./proteios/lib/axis.jar:./proteios/lib/activation.jar:./proteios/lib/mail.jar:./proteios/lib/dnsjava-1.3.2.jar:./proteios/lib/castor-0.9.5.jar:./proteios/lib/saaj.jar:./proteios/lib/jaxrpc.jar:./proteios/lib/wsdl4j-1.5.1.jar:./proteios/lib/commons-discovery-0.2.jar org.proteios.gui.main.GMain -
trunk/dist/xmlrpcServer.bat
r1338 r1343 1 java -Xmx1000m -cp .;.\bin;.\proteios\conf;.\proteios\ conf\0.8;.\proteios\lib\c3p0.jar;.\proteios\lib\cglib2.jar;.\proteios\lib\commons-collections.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j.jar;.\proteios\lib\ehcache.jar;.\proteios\lib\hibernate2.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\jgroups.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.8.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache.jar;.\proteios\lib\proxool.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xerces.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql.jar;.\proteios\lib\postgresql.jar;.\proteios\lib\xmlrpc.jar;.\proteios\lib\commons-codec-1.3.jar;.\proteios\lib\lsid-client-1.1.1.jar;.\proteios\lib\axis.jar;.\proteios\lib\activation.jar;.\proteios\lib\mail.jar;.\proteios\lib\dnsjava-1.3.2.jar;.\proteios\lib\castor-0.9.5.jar;.\proteios\lib\saaj.jar;.\proteios\lib\jaxrpc.jar;.\proteios\lib\wsdl4j.jar;.\proteios\lib\commons-discovery-0.2.jar org.proteios.server.XMLRPCServer %*1 java -Xmx1000m -cp .;.\bin;.\proteios\conf;.\proteios\lib\c3p0-0.9.0.jar;.\proteios\lib\asm-attrs.jar;.\proteios\lib\asm.jar;.\proteios\lib\cglib-2.1.jar;.\proteios\lib\commons-collections-2.1.1.jar;.\proteios\lib\commons-dbcp.jar;.\proteios\lib\commons-lang.jar;.\proteios\lib\commons-logging-1.0.4.jar;.\proteios\lib\commons-pool.jar;.\proteios\lib\concurrent.jar;.\proteios\lib\connector.jar;.\proteios\lib\dom4j-1.6.jar;.\proteios\lib\ehcache-1.1.jar;.\proteios\lib\hibernate3.jar;.\proteios\lib\jaas.jar;.\proteios\lib\jcs.jar;.\proteios\lib\jdbc2_0-stdext.jar;.\proteios\lib\antlr-2.7.5H3.jar;.\proteios\lib\jgroups-2.2.7.jar;.\proteios\lib\jta.jar;.\proteios\lib\log4j-1.2.9.jar;.\proteios\lib\odmg.jar;.\proteios\lib\optional.jar;.\proteios\lib\oscache-2.1.jar;.\proteios\lib\proxool-0.8.3.jar;.\proteios\lib\swarmcache.jar;.\proteios\lib\xalan.jar;.\proteios\lib\xerces.jar;.\proteios\lib\jaxen-1.1-beta-4.jar;.\proteios\lib\xml-apis.jar;.\proteios\lib\jdom.jar;.\proteios\lib\mysql-connector-java-3.1.10-bin.jar;.\proteios\lib\postgresql.jar;.\proteios\lib\xmlrpc.jar;.\proteios\lib\commons-codec-1.3.jar;.\proteios\lib\lsid-client-1.1.1.jar;.\proteios\lib\axis.jar;.\proteios\lib\activation.jar;.\proteios\lib\mail.jar;.\proteios\lib\dnsjava-1.3.2.jar;.\proteios\lib\castor-0.9.5.jar;.\proteios\lib\saaj.jar;.\proteios\lib\jaxrpc.jar;.\proteios\lib\wsdl4j-1.5.1.jar;.\proteios\lib\commons-discovery-0.2.jar org.proteios.server.XMLRPCServer %* -
trunk/dist/xmlrpcServer.sh
r1338 r1343 1 java -Xmx1000m -cp .:./bin:./proteios/conf:./proteios/ conf/0.8:./proteios/lib/c3p0.jar:./proteios/lib/cglib2.jar:./proteios/lib/commons-collections.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j.jar:./proteios/lib/ehcache.jar:./proteios/lib/hibernate2.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/jgroups.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.8.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache.jar:./proteios/lib/proxool.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xerces.jar:./proteios/lib/xml-apis.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql.jar:./proteios/lib/postgresql.jar:./proteios/lib/xmlrpc.jar:./proteios/lib/commons-codec-1.3.jar:./proteios/lib/lsid-client-1.1.1.jar:./proteios/lib/axis.jar:./proteios/lib/activation.jar:./proteios/lib/mail.jar:./proteios/lib/dnsjava-1.3.2.jar:./proteios/lib/castor-0.9.5.jar:./proteios/lib/saaj.jar:./proteios/lib/jaxrpc.jar:./proteios/lib/wsdl4j.jar:./proteios/lib/commons-discovery-0.2.jar org.proteios.server.XMLRPCServer $*1 java -Xmx1000m -cp .:./bin:./proteios/conf:./proteios/lib/c3p0-0.9.0.jar:./proteios/lib/asm-attrs.jar:./proteios/lib/asm.jar:./proteios/lib/cglib-2.1.jar:./proteios/lib/commons-collections-2.1.1.jar:./proteios/lib/commons-dbcp.jar:./proteios/lib/commons-lang.jar:./proteios/lib/commons-logging-1.0.4.jar:./proteios/lib/commons-pool.jar:./proteios/lib/concurrent.jar:./proteios/lib/connector.jar:./proteios/lib/dom4j-1.6.jar:./proteios/lib/ehcache-1.1.jar:./proteios/lib/hibernate3.jar:./proteios/lib/jaas.jar:./proteios/lib/jcs.jar:./proteios/lib/jdbc2_0-stdext.jar:./proteios/lib/antlr-2.7.5H3.jar:./proteios/lib/jgroups-2.2.7.jar:./proteios/lib/jta.jar:./proteios/lib/log4j-1.2.9.jar:./proteios/lib/odmg.jar:./proteios/lib/optional.jar:./proteios/lib/oscache-2.1.jar:./proteios/lib/proxool-0.8.3.jar:./proteios/lib/swarmcache.jar:./proteios/lib/xalan.jar:./proteios/lib/xerces.jar:./proteios/lib/jaxen-1.1-beta-4.jar:./proteios/lib/xml-apis.jar:./proteios/lib/jdom.jar:./proteios/lib/mysql-connector-java-3.1.10-bin.jar:./proteios/lib/postgresql.jar:./proteios/lib/xmlrpc.jar:./proteios/lib/commons-codec-1.3.jar:./proteios/lib/lsid-client-1.1.1.jar:./proteios/lib/axis.jar:./proteios/lib/activation.jar:./proteios/lib/mail.jar:./proteios/lib/dnsjava-1.3.2.jar:./proteios/lib/castor-0.9.5.jar:./proteios/lib/saaj.jar:./proteios/lib/jaxrpc.jar:./proteios/lib/wsdl4j-1.5.1.jar:./proteios/lib/commons-discovery-0.2.jar org.proteios.server.XMLRPCServer $* -
trunk/src/org/proteios/core/CMain.java
r787 r1343 22 22 import java.io.*; 23 23 24 import net.sf.hibernate.Hibernate; 25 import net.sf.hibernate.HibernateException; 26 import net.sf.hibernate.Session; 27 import net.sf.hibernate.SessionFactory; 28 import net.sf.hibernate.cfg.Configuration; 29 import net.sf.hibernate.tool.hbm2ddl.SchemaExport; 24 import org.hibernate.HibernateException; 25 import org.hibernate.SessionFactory; 26 import org.hibernate.cfg.Configuration; 30 27 31 28 import org.proteios.core.element.ProteiosElementFactory; … … 54 51 File[] propFiles; 55 52 56 try 57 { 58 ProteiosElementFactory elementFactory = new ProteiosElementFactory(); 59 60 configuration = new Configuration(); 61 List classList = elementFactory.getAllClasses(); 62 for(int i=0; i<classList.size(); ++i) 53 databaseNames = (new File("proteios/conf/hibernate/databases")).list(); 54 propFiles = (new File("proteios/conf/hibernate/databases")).listFiles(); 55 56 // Fill up the list of all Proteios standard element classes. 57 element_classes.addAll(ElementFactory.getAllClasses()); 58 // Any properties file is OK to set up MetaData - Only do it once. 59 boolean done_meta_data = false; 60 61 // Make sure meta data is set up correctly before connecting to any db:s. 62 for (int i = 0; !done_meta_data && i < databaseNames.length; ++i) 63 { 64 if(databaseNames[i].endsWith(".properties")) 63 65 { 64 configuration.addClass((Class) classList.get(i)); 66 try 67 { 68 File propFile = propFiles[i]; 69 FileInputStream infile = new FileInputStream(propFile); 70 Properties props = new Properties(); 71 props.load(infile); 72 // Make sure our configuration is properly set up. 73 configuration.setProperties(props); 74 done_meta_data = setMetaData(); 75 } 76 catch (FileNotFoundException e) 77 { 78 // Try next properties file. 79 } 80 catch (IOException e) 81 { 82 // Try next properties file. 83 } 84 catch (HibernateException e) 85 { 86 // Try next properties file. 87 } 65 88 } 66 67 Element.setMetaData(new MetaData(configuration.buildSessionFactory(), classList)); 68 69 connections = new ArrayList(); 70 71 databaseNames = (new File("proteios/conf/hibernate/databases")).list(); 72 propFiles = (new File("proteios/conf/hibernate/databases")).listFiles(); 73 } 74 catch(HibernateException e) 75 { 76 throw new CoreException(e.getMessage()); 77 } 78 89 } 90 91 if (!done_meta_data) 92 { 93 // No fun Proteios without elements... 94 throw new CoreException("Unable to set up meta data."); 95 } 96 97 // Now we can connect to databases. 79 98 for(int i=0; i<databaseNames.length; ++i) 80 99 { … … 85 104 try 86 105 { 87 SessionFactory sf = changeConfiguration(propFile);106 SessionFactory sf = setConfiguration(propFile); 88 107 DataConnection db = new SQLConnection(databaseName, sf); 89 108 connections.add(db); … … 120 139 121 140 122 private SessionFactory changeConfiguration(File file)141 private SessionFactory setConfiguration(File file) 123 142 throws CoreException 124 143 { … … 137 156 throw new CoreException(e.getMessage()); 138 157 } 139 140 141 142 143 144 145 146 158 catch (IOException e) 159 { 160 throw new CoreException(e.getMessage()); 161 } 162 catch (HibernateException e) 163 { 164 throw new CoreException(e.getMessage()); 165 } 147 166 148 167 return retval; 149 168 } 150 169 170 /** 171 * Add Hibernate metadata for Proteios elements to current configuration. 172 * 173 * @return true if meta data could be set up without problems. 174 */ 175 private final boolean setMetaData() 176 { 177 boolean retval = false; 178 179 try 180 { 181 for(int i=0; i<element_classes.size(); ++i) 182 { 183 configuration.addClass((Class) element_classes.get(i)); 184 } 185 Element.setMetaData(new MetaData(configuration.buildSessionFactory(), element_classes)); 186 retval = true; 187 } 188 catch(HibernateException e) 189 { 190 // TODO: Report mapping errors already here. 191 } 192 catch (CoreException e) 193 { 194 // TODO: Report mapping errors already here. 195 } 196 197 return retval; 198 } 199 151 200 private List connections; 152 private Properties props; 153 private Configuration configuration; 201 /** One configuration used to set up all connections. */ 202 private Configuration configuration = new Configuration(); 203 /** Element factory to set up all elements - all connections same mapping. */ 204 private final ProteiosElementFactory element_factory = new ProteiosElementFactory(); 205 /** Proteios has one single specific set of element classes. */ 206 private final List element_classes = new ArrayList(100); 154 207 } -
trunk/src/org/proteios/core/Element.java
r1256 r1343 1 1 // $Id$ 2 // Copyright (C) 2005 Per G �rd�n, Jari H�kkinen, Rikard Alm - proteios.org2 // Copyright (C) 2005 Per Gärdén, Jari Häkkinen, Rikard Alm - proteios.org 3 3 // 4 4 // This program is free software; you can redistribute it and/or … … 295 295 throws CoreException 296 296 { 297 synchronized ( getDataConnection())297 synchronized (dataConnection) 298 298 { 299 299 List children; … … 302 302 if (parent != null && parent instanceof Element) 303 303 { 304 parent_class.add( parent.getClass());304 parent_class.add(ElementFactory.getElementClass(((Element) parent).getElementName())); 305 305 } 306 306 … … 349 349 // Stupid Hibernate always renames its entities to begin with lower case! 350 350 cs = Character.toLowerCase(cs.charAt(0)) + cs.substring(1); 351 List children = meta_data.getAssociations(getClass()); 351 Class elt_class = ElementFactory.getElementClass(element_name); 352 List children = meta_data.getAssociations(elt_class); 352 353 // Is the child on the one side in many-to-one? 353 354 retval = children.contains(cs); 354 355 // Is the child on the many side in a one-to-many? 355 children = meta_data.getCollections( getClass());356 children = meta_data.getCollections(elt_class); 356 357 for (int i = 0; !retval && i < children.size(); ++i) 357 358 { … … 374 375 { 375 376 // Don't add ancestor Analyte, i.e. proposed child is an ancestor.. 376 retval = !(isAncestor(child, child ));377 retval = !(isAncestor(child, child, 0)); 377 378 } 378 379 catch (CoreException e) … … 396 397 * @param parent parent to give tree direction in the graph - may be null. 397 398 * @param ancestor the Element to look out for. 399 * @param level level during recursion. 398 400 * @return true if ancestor could be located anywhere in the tree. else false. 399 401 */ 400 public boolean isAncestor(Object parent, Element ancestor )402 public boolean isAncestor(Object parent, Element ancestor, int level) 401 403 throws CoreException 402 404 { 403 405 boolean retval = false; 404 406 405 List children = getChildren(parent); 406 Element child = null; 407 for (int i = 0; !retval && i < children.size(); i++) 408 { 409 child = (Element) children.get(i); 410 retval = ancestor.equalElement(child); 411 if (!retval) 412 { 413 // Next level. 414 retval = child.isAncestor(this, ancestor); 407 if (level < MAX_ANCESTOR_DEPTH) 408 { 409 List children = getChildren(parent); 410 Element child = null; 411 for (int i = 0; !retval && i < children.size(); i++) 412 { 413 child = (Element) children.get(i); 414 retval = ancestor.equalElement(child); 415 if (!retval) 416 { 417 // Next level. 418 retval = child.isAncestor(this, ancestor, ++level); 419 } 415 420 } 416 421 } … … 430 435 { 431 436 List retval = new ArrayList(); 432 List connected = meta_data.getCollections(getClass()); 437 Class elt_class = ElementFactory.getElementClass(element_name); 438 List connected = meta_data.getCollections(elt_class); 433 439 List related = new ArrayList(); 434 440 … … 450 456 451 457 // Add all associated element names 452 related.addAll(meta_data.getAssociations( getClass()));458 related.addAll(meta_data.getAssociations(elt_class)); 453 459 454 460 // Cater for Hibernate naming mess up … … 639 645 DataConnection.setCurrentDataConnection(dataConnection); 640 646 reconnect(); 641 boolean b = meta_data.hasEntityName( this.getClass(), name);647 boolean b = meta_data.hasEntityName(ElementFactory.getElementClass(this.element_name), name); 642 648 disconnect(); 643 649 return b; … … 724 730 DataConnection.setCurrentDataConnection(dataConnection); 725 731 reconnect(); 726 List list = meta_data.getEntityNames( this.getClass());732 List list = meta_data.getEntityNames(ElementFactory.getElementClass(this.element_name)); 727 733 disconnect(); 728 734 return list; … … 779 785 } 780 786 781 782 //* generator-class="native"783 //* generator-class="hilo"784 787 785 788 /** … … 900 903 catch (Exception e) 901 904 { 902 throw new CoreException("Element copy error: " + e.getMessage()); 905 String elt_name = "Element"; 906 if (c != null) 907 { 908 elt_name = ((Element) c).getElementName(); 909 } 910 throw new CoreException(elt_name + " copy error: " + e.getMessage()); 903 911 } 904 912 disconnect(); … … 941 949 /** 942 950 * Compare two elements entity by entity. Elements are considered equal if 943 * they are inst ences of the same element class and all their entities are951 * they are instances of the same element class and all their entities are 944 952 * exactly the same. 945 953 * <P>Elements can differ in any other respects than class and … … 954 962 { 955 963 // Might be equal if class is the same. 956 boolean retval = elt.getClass().getName().equals( getClass().getName());964 boolean retval = elt.getClass().getName().equals(ElementFactory.getElementClass(element_name).getName()); 957 965 958 966 if (retval) … … 1222 1230 if(parent!=null) 1223 1231 { 1224 parent_class.add( parent.getClass());1232 parent_class.add(ElementFactory.getElementClass(parent.getElementName())); 1225 1233 } 1226 1234 reconnect(); … … 1239 1247 // Many-to-one or many-to-many connection between this and child? <=> 1240 1248 // child has a collection if this' type 1241 if (meta_data.hasCollection( child.getClass(), this.getClass()))1249 if (meta_data.hasCollection(ElementFactory.getElementClass(child.getElementName()), ElementFactory.getElementClass(this.element_name))) 1242 1250 { 1243 1251 // Many-to-many connection between this and child? … … 1303 1311 /** OK to edit entity values? Recomendation, not enforced in this class.*/ 1304 1312 protected boolean editable = false; 1305 pr ivateString element_name;1313 protected String element_name; 1306 1314 private String identifier_name; 1307 1315 /** Ability to dynamically connect elements demands a data model */ … … 1309 1317 /** Date format to base XML schema date time string on. */ 1310 1318 private static SimpleDateFormat date_time_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 1319 /** Depth at which bail out during recursion in Proteios cyclic graph. */ 1320 private final static int MAX_ANCESTOR_DEPTH = 18; 1311 1321 } -
trunk/src/org/proteios/core/ElementFactory.java
r1340 r1343 290 290 } 291 291 292 293 /** 294 * Fetch CLass object, corresponding to a root class creatable by this 295 * factory. 296 * 297 * @param element_name whose class we wish to retrieve. 298 * @return element class. 299 */ 300 static Class getElementClass(String element_name) 301 { 302 Class retval = null; 303 304 Object element_class = nameClassMap.get(element_name); 305 if (element_class != null) 306 { 307 retval = (Class) element_class; 308 } 309 310 return retval; 311 } 312 313 292 314 /** 293 315 * Recursively create elements from nodes (not all nodes may have -
trunk/src/org/proteios/core/EntityChoiceElement.java
r969 r1343 156 156 try 157 157 { 158 entity_names = new ArrayList(getMetaData().getEntityNames(this.getClass())); 158 entity_names = new ArrayList(); 159 List md_ent_names = getMetaData().getEntityNames(ElementFactory.getElementClass(this.element_name)); 160 if (md_ent_names != null) 161 { 162 entity_names.addAll(md_ent_names); 163 } 159 164 } 160 165 catch (CoreException e) -
trunk/src/org/proteios/core/InitDatabase.java
r787 r1343 21 21 import java.util.*; 22 22 import java.io.*; 23 import java.sql.DriverManager; 23 24 import java.sql.Connection; 24 25 import java.sql.Statement; 25 26 import java.sql.SQLException; 26 27 27 import net.sf.hibernate.Hibernate; 28 import net.sf.hibernate.HibernateException; 29 import net.sf.hibernate.Session; 30 import net.sf.hibernate.cfg.Configuration; 31 import net.sf.hibernate.tool.hbm2ddl.SchemaExport; 28 import org.hibernate.HibernateException; 29 import org.hibernate.Session; 30 import org.hibernate.cfg.Configuration; 31 import org.hibernate.tool.hbm2ddl.SchemaExport; 32 32 33 33 … … 55 55 Configuration configuration = new Configuration(); 56 56 57 List classList = elementFactory.getAllClasses();57 List classList = ElementFactory.getAllClasses(); 58 58 for(int i=0; i<classList.size(); ++i) 59 59 { … … 95 95 { 96 96 System.out.println(e.getMessage()); 97 e.printStackTrace(System.out); 97 98 } 98 99 } … … 125 126 db_creator.drop(dump, !dump); 126 127 127 Session sess = configuration.buildSessionFactory().openSession(); 128 org.hibernate.SessionFactory session_factory = configuration.buildSessionFactory(); 129 Session sess = session_factory.openSession(); 128 130 // Resort to JDBC - Hibernate only allows its own SQL!!! 129 Connection jdbc_conn = sess.connection();131 Connection jdbc_conn = sess.connection(); 130 132 Statement stmt = jdbc_conn.createStatement(); 131 133 try … … 138 140 while ((s = br.readLine()) != null) 139 141 { 140 if (!(s.endsWith("hibernate_unique_key"))) 142 // SchemaExport gone haywire with Hibernate3 - make sure only drop! 143 if ((s.startsWith("drop table")) && !(s.endsWith("hibernate_unique_key"))) 141 144 { 142 145 // Execute all drop statements set up by Hibernate. … … 156 159 throw new HibernateException(e.getMessage()); 157 160 } 161 catch (Exception e) 162 { 163 throw new HibernateException(e.getMessage()); 164 } 158 165 finally 159 166 { 160 167 // Done! 161 jdbc_conn.close(); 168 if (jdbc_conn != null) 169 { 170 jdbc_conn.close(); 171 } 162 172 } 163 173 } 174 164 175 } -
trunk/src/org/proteios/core/MetaData.java
r1256 r1343 1 1 // $Id$ 2 // Copyright (C) 2005 Per G �rd�n, Jari H�kkinen, Rikard Alm - proteios.org2 // Copyright (C) 2005 Per Gärdén, Jari Häkkinen, Rikard Alm - proteios.org 3 3 // 4 4 // This program is free software; you can redistribute it and/or … … 20 20 import java.util.*; 21 21 22 import net.sf.hibernate.metadata.ClassMetadata; 23 import net.sf.hibernate.type.Type; 24 import net.sf.hibernate.SessionFactory; 25 import net.sf.hibernate.HibernateException; 26 import net.sf.hibernate.LazyInitializationException; 22 import org.hibernate.EntityMode; 23 import org.hibernate.metadata.ClassMetadata; 24 import org.hibernate.type.Type; 25 import org.hibernate.SessionFactory; 26 import org.hibernate.HibernateException; 27 import org.hibernate.LazyInitializationException; 27 28 28 29 … … 112 113 throws CoreException 113 114 { 115 org.hibernate.type.Type type = null; 114 116 try 115 117 { … … 119 121 try 120 122 { 123 type = cm.getPropertyType(entityName); 121 124 cm.setPropertyValue(element, entityName, 122 125 cm.getPropertyType(entityName). 123 126 getReturnedClass(). 124 127 getDeclaredConstructor(new Class[]{String.class}). 125 newInstance(new Object[]{value}) );128 newInstance(new Object[]{value}), EntityMode.POJO); 126 129 } 127 130 catch(NoSuchMethodException e) … … 145 148 else 146 149 { 147 cm.setPropertyValue(element, entityName, value );148 } 149 } 150 catch( net.sf.hibernate.HibernateException e)150 cm.setPropertyValue(element, entityName, value, EntityMode.POJO); 151 } 152 } 153 catch(org.hibernate.HibernateException e) 151 154 { 152 155 throw new CoreException(e.getMessage()); … … 167 170 try 168 171 { 169 res = getClassMetadata(element.getClass()).getPropertyValue(element, entityName );172 res = getClassMetadata(element.getClass()).getPropertyValue(element, entityName, EntityMode.POJO); 170 173 } 171 174 catch (HibernateException e) … … 236 239 public boolean hasCollection(Class elementClass, Class collectionClass) 237 240 { 238 return ((Map) assCollectionMap.get(elementClass)).containsKey(collectionClass); 241 boolean retval = false; 242 243 if (elementClass != null && collectionClass != null) 244 { 245 Map ass_collection_map = (Map) assCollectionMap.get(elementClass); 246 retval = (ass_collection_map != null && ass_collection_map.containsKey(collectionClass)); 247 } 248 249 return retval; 239 250 } 240 251 … … 258 269 { 259 270 String propName = (String) ((Map) assCollectionMap.get(element.getClass())).get(toBeRemoved.getClass()); 260 Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, propName );271 Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, propName, EntityMode.POJO); 261 272 status = coll.remove(toBeRemoved); 262 getClassMetadata(element.getClass()).setPropertyValue(element, propName, coll); 263 } 273 getClassMetadata(element.getClass()).setPropertyValue(element, propName, coll, EntityMode.POJO); 274 } 275 } 276 catch (LazyInitializationException e) 277 { 278 throw new CoreException(e.getMessage()); 264 279 } 265 280 catch (HibernateException e) 266 {267 throw new CoreException(e.getMessage());268 }269 catch (LazyInitializationException e)270 281 { 271 282 throw new CoreException(e.getMessage()); … … 293 304 { 294 305 String propName = (String) ((Map) associationMap.get(element.getClass())).get(toBeRemoved.getClass()); 295 getClassMetadata(element.getClass()).setPropertyValue(element, propName, null );306 getClassMetadata(element.getClass()).setPropertyValue(element, propName, null, EntityMode.POJO); 296 307 status = true; 297 308 } … … 326 337 { 327 338 String propName = (String) ((Map) assCollectionMap.get(element.getClass())).get(toBeAdded.getClass()); 328 Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, propName );339 Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, propName, EntityMode.POJO); 329 340 coll.add(toBeAdded); 330 getClassMetadata(element.getClass()).setPropertyValue(element, propName, coll );341 getClassMetadata(element.getClass()).setPropertyValue(element, propName, coll, EntityMode.POJO); 331 342 // System.out.println(toBeAdded.getElementName() + " was added to " + element.getElementName() + "'s collection"); 332 343 status = true; … … 366 377 { 367 378 String propName = (String) ((Map) associationMap.get(element.getClass())).get(toBeAdded.getClass()); 368 getClassMetadata(element.getClass()).setPropertyValue(element, propName, toBeAdded );379 getClassMetadata(element.getClass()).setPropertyValue(element, propName, toBeAdded, EntityMode.POJO); 369 380 status = true; 370 381 // System.out.println(toBeAdded.getElementName() + " was added to " + element.getElementName() + "'s association"); … … 426 437 try 427 438 { 428 if (parent != null) 429 { 430 Map classAssName = (Map) associationMap.get(element.getClass()); 431 Class keyClass = parent.getClass(); 439 if (parent != null && parent instanceof Element) 440 { 441 Class elt_class = ElementFactory.getElementClass(element.getElementName()); 442 Map classAssName = (Map) associationMap.get(elt_class); 443 Class keyClass = ElementFactory.getElementClass(((Element) parent).getElementName()); 432 444 if ((classAssName != null) && (classAssName.containsKey(keyClass))) 433 445 { 434 Element child = (Element) getClassMetadata(el ement.getClass()).getPropertyValue(element, (String) classAssName.get(keyClass));446 Element child = (Element) getClassMetadata(elt_class).getPropertyValue(element, (String) classAssName.get(keyClass), EntityMode.POJO); 435 447 // OK to add a child that exists and is not of parent type 436 if ((child != null) && (!( child.getClass().isInstance(parent))))448 if ((child != null) && (!(ElementFactory.getElementClass(child.getElementName()).isInstance(parent)))) 437 449 { 438 450 children.add(child); … … 441 453 } 442 454 } 443 catch( net.sf.hibernate.HibernateException e)455 catch(org.hibernate.HibernateException e) 444 456 { 445 457 throw new CoreException(e.getMessage()); … … 467 479 if (parent != null) 468 480 { 469 Map classCollName = (Map) assCollectionMap.get(element.getClass()); 481 Class elt_class = ElementFactory.getElementClass(element.getElementName()); 482 Map classCollName = (Map) assCollectionMap.get(elt_class); 470 483 Class keyClass = parent.getClass(); 471 if(classCollName.containsKey(keyClass)) 472 { 473 Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, (String) classCollName.get(keyClass)); 474 for(Iterator childIt=coll.iterator(); childIt.hasNext();) 484 if (classCollName != null && classCollName.containsKey(keyClass)) 485 { 486 Collection coll = (Collection) getClassMetadata(elt_class).getPropertyValue(element, (String) classCollName.get(keyClass), EntityMode.POJO); 487 Iterator childIt=coll.iterator(); 488 while (childIt.hasNext()) 475 489 { 476 490 Element child = (Element) childIt.next(); … … 480 494 } 481 495 } 482 catch( net.sf.hibernate.HibernateException e)496 catch(org.hibernate.HibernateException e) 483 497 { 484 498 throw new CoreException(e.getMessage()); … … 506 520 try 507 521 { 508 Map classCollName = (Map) assCollectionMap.get(element.getClass()); 522 Class elt_class = ElementFactory.getElementClass(element.getElementName()); 523 Map classCollName = (Map) assCollectionMap.get(elt_class); 509 524 if (classCollName != null) 510 525 { … … 513 528 { 514 529 Class keyClass = (Class) it.next(); 530 // System.out.println("Proposed child is: " + keyClass); 515 531 if(!unwanted.contains(keyClass)) 516 532 { 517 Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, (String) classCollName.get(keyClass)); 533 String class_coll_name = (String) classCollName.get(keyClass); 534 ClassMetadata clsmd = getClassMetadata(elt_class); 535 Collection coll = (Collection) clsmd.getPropertyValue(element, class_coll_name, EntityMode.POJO); 536 // Collection coll = (Collection) getClassMetadata(element.getClass()).getPropertyValue(element, (String) classCollName.get(keyClass), EntityMode.POJO); 518 537 519 538 Iterator childIt = coll.iterator(); … … 527 546 } 528 547 } 529 catch(HibernateException e)530 {531 throw new CoreException(e.getMessage());532 }533 548 catch(LazyInitializationException e) 534 549 { 535 550 // This is the most likely cause. 536 551 throw new CoreException("Database unreachable or incompatible with Proteios metadata."); 552 } 553 catch(HibernateException e) 554 { 555 throw new CoreException(e.getMessage()); 537 556 } 538 557 … … 561 580 if (classAssName != null) 562 581 { 563 // System.out.println(element.getElementName() + ":");564 // ClassMetadata cm = getClassMetadata(element.getClass());565 // String[] properties = cm.getPropertyNames();566 // for (int i = 0; i < properties.length; ++i)567 // {568 // System.out.print("\t" + properties[i] + "=" + cm.getPropertyValue(element, properties[i]));569 // }570 // System.out.println();571 572 582 Iterator it=classAssName.keySet().iterator(); 573 583 while (it.hasNext()) … … 576 586 if (!unwanted.contains(keyClass)) 577 587 { 578 Element child = (Element) getClassMetadata( element.getClass()).getPropertyValue(element, (String) classAssName.get(keyClass));588 Element child = (Element) getClassMetadata(ElementFactory.getElementClass(element.getElementName())).getPropertyValue(element, (String) classAssName.get(keyClass), EntityMode.POJO); 579 589 if (child != null) 580 590 { … … 585 595 } 586 596 } 587 catch( net.sf.hibernate.HibernateException e)597 catch(org.hibernate.HibernateException e) 588 598 { 589 599 throw new CoreException(e.getMessage()); … … 614 624 615 625 616 617 /** 618 * Fetch the Hibernate metadata as net.sf.hibernate.metadata.ClassMetadata for 626 /** 627 * Fetch the Hibernate metadata as org.hibernate.metadata.ClassMetadata for 619 628 * a specific element class. 620 629 * … … 657 666 if(propertyTypes[i].isAssociationType()) 658 667 { 659 if(propertyTypes[i].is PersistentCollectionType())668 if(propertyTypes[i].isCollectionType()) 660 669 { 661 670 Class keyClass = sess.getCollectionMetadata(elementClass.getName() + "." + propertyNames[i]).getElementType().getReturnedClass(); … … 696 705 assCollectionMap.put(elementClass, classCollName); 697 706 } 698 catch( net.sf.hibernate.HibernateException e)707 catch(org.hibernate.HibernateException e) 699 708 { 700 709 // throw new CoreException(e.getMessage()); … … 728 737 Experiment can have several Samples. */ 729 738 private Map assCollectionMap; 739 /** Storage mode for all our objects is "Plain old Java Objects", POJO. */ 740 // private final static EntityMode EntityMode.POJO = new EntityMode("pojo"); 730 741 } 731 742 -
trunk/src/org/proteios/core/SQLConnection.java
r1256 r1343 22 22 import java.io.*; 23 23 24 import net.sf.hibernate.Hibernate;25 import net.sf.hibernate.HibernateException;26 import net.sf.hibernate.FlushMode;27 import net.sf.hibernate.Session;28 import net.sf.hibernate.SessionFactory;29 import net.sf.hibernate.Transaction;24 import org.hibernate.Hibernate; 25 import org.hibernate.HibernateException; 26 import org.hibernate.FlushMode; 27 import org.hibernate.Session; 28 import org.hibernate.SessionFactory; 29 import org.hibernate.Transaction; 30 30 31 31 import org.proteios.core.element.ProteiosElementFactory; … … 47 47 currentSession = sessionFactory.openSession(); 48 48 // Don't flush before query. Only at end of transaction. 49 currentSession.setFlushMode(FlushMode.COMMIT);49 // currentSession.setFlushMode(FlushMode.AUTO); 50 50 tx = currentSession.beginTransaction(); 51 51 currentSession.disconnect(); … … 101 101 try 102 102 { 103 roots = currentSession.find("from " + rootType);103 roots = (currentSession.createQuery("from " + rootType)).list(); 104 104 } 105 105 catch (Exception e) … … 160 160 tx.commit(); 161 161 currentSession.flush(); 162 tx = currentSession.beginTransaction(); 162 163 } 163 164 catch(HibernateException e) … … 186 187 throws CoreException 187 188 { 189 // getRootElements(); 188 190 reconnect(); 189 191 try … … 192 194 tx.rollback(); 193 195 currentSession.flush(); 196 tx = currentSession.beginTransaction(); 194 197 } 195 198 catch(HibernateException e) -
trunk/src/org/proteios/core/XMLConnection.java
r1256 r1343 1 1 // $Id$ 2 // Copyright (C) 2005 Per G �rd�n, Jari H�kkinen, Rikard Alm - proteios.org2 // Copyright (C) 2005 Per Gärdén, Jari Häkkinen, Rikard Alm - proteios.org 3 3 // 4 4 // This program is free software; you can redistribute it and/or … … 19 19 package org.proteios.core; 20 20 21 22 21 import java.io.*; 23 22 import java.util.*; 24 25 import net.sf.hibernate.Databinder;26 import net.sf.hibernate.Hibernate;27 import net.sf.hibernate.HibernateException;28 import net.sf.hibernate.Session;29 import net.sf.hibernate.SessionFactory;30 import net.sf.hibernate.cfg.Configuration;31 import net.sf.hibernate.Transaction;32 import net.sf.hibernate.metadata.ClassMetadata;33 import net.sf.hibernate.metadata.CollectionMetadata;34 import net.sf.hibernate.type.Type;35 23 36 24 import org.proteios.core.element.ProteiosElementFactory; -
trunk/src/org/proteios/core/element/AbstractParam.java
r989 r1343 14 14 // You should have received a copy of the GNU General Public License 15 15 // along with this program; if not, write to the Free Software 16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 17 17 18 18 package org.proteios.core.element; 19 19 20 import java.util.List; 21 20 22 import org.proteios.core.ProteiosElement; 23 import org.proteios.core.SQLConnection; 24 import org.proteios.core.CoreException; 21 25 22 26 … … 25 29 * section of the proteios data model. 26 30 * @hibernate.class 27 * 31 * table="`ProcessingParam`" 28 32 */ 29 33 public abstract class AbstractParam … … 37 41 super(element_name, "name"); 38 42 } 39 43 44 40 45 /** 41 46 * @hibernate.property 42 * 47 * column="`name`" 43 48 */ 44 49 public String getName() … … 53 58 /** 54 59 * @hibernate.property 55 * 60 * column="`value`" 56 61 */ 57 62 public String getValue() -
trunk/src/org/proteios/core/element/GelItem.java
r1297 r1343 38 38 public int compareTo(Object o) 39 39 { 40 return id - ((GelItem) o).getId(); 40 // Hibernate 3 refuses to accept id as "int" => voodo. 41 return (int) (id - ((GelItem) o).getId()); 41 42 } 42 43 … … 213 214 214 215 /** 215 * @hibernate.property 216 * column="`id`" 217 */ 218 public int getId() 216 * Hibernate 3 refuses to accept id as "int" => voodo. 217 * 218 * @hibernate.property 219 * column="`id`" 220 */ 221 public long getId() 219 222 { 220 223 return id; 221 224 } 222 private void setId( intid)225 private void setId(long id) 223 226 { 224 227 this.id = id; 225 228 } 226 229 227 228 230 /** 229 231 * @hibernate.property … … 421 423 } 422 424 423 protected intid;425 protected long id; 424 426 protected double area; 425 427 protected double intensity; -
trunk/src/org/proteios/core/element/Peak.java
r1190 r1343 1 1 // $Id$ 2 // Copyright (C) 2005 Per G �rd�n, Jari H�kkinen, Rikard Alm - proteios.org2 // Copyright (C) 2005 Per Gärdén, Jari Häkkinen, Rikard Alm - proteios.org 3 3 // 4 4 // This program is free software; you can redistribute it and/or … … 41 41 private Double ion_current; 42 42 private Double signal_to_noise; 43 private Double max_intensity;44 private Double min_intensity;45 private Double accumulated_intensity;46 private Double fwhm_mass;47 private Double max_mass;48 private Double min_mass;49 private Double cluster_score;50 private Boolean calibration_point;51 private Integer cluster_count;52 43 private Set peakSpecificChromatogramIntegrationCollection; 53 44 private Set chromatogramPointCollection; … … 90 81 91 82 // Defer graph cycles by not adding any children already in connection. 92 if (retval )83 if (retval && (dataConnection == child.getDataConnection())) 93 84 { 94 85 try … … 243 234 244 235 /** 245 * @hibernate.property246 * column="`max_intensity`"247 */248 public Double getMax_intensity()249 {250 return max_intensity;251 }252 private void setMax_intensity(Double max_intensity)253 {254 this.max_intensity = max_intensity;255 }256 257 /**258 * @hibernate.property259 * column="`min_intensity`"260 */261 public Double getMin_intensity()262 {263 return min_intensity;264 }265 private void setMin_intensity(Double min_intensity)266 {267 this.min_intensity = min_intensity;268 }269 270 /**271 * @hibernate.property272 * column="`accumulated_intensity`"273 */274 public Double getAccumulated_intensity()275 {276 return accumulated_intensity;277 }278 private void setAccumulated_intensity(Double accumulated_intensity)279 {280 this.accumulated_intensity = accumulated_intensity;281 }282 283 /**284 * @hibernate.property285 * column="`fwhm_mass`"286 */287 public Double getFwhm_mass()288 {289 return fwhm_mass;290 }291 private void setFwhm_mass(Double fwhm_mass)292 {293 this.fwhm_mass = fwhm_mass;294 }295 296 297 /**298 * @hibernate.property299 * column="`max_mass`"300 */301 public Double getMax_mass()302 {303 return max_mass;304 }305 private void setMax_mass(Double max_mass)306 {307 this.max_mass = max_mass;308 }309 310 /**311 * @hibernate.property312 * column="`min_mass`"313 */314 public Double getMin_mass()315 {316 return min_mass;317 }318 private void setMin_mass(Double min_mass)319 {320 this.min_mass = min_mass;321 }322 323 /**324 * @hibernate.property325 * column="`cluster_score`"326 */327 public Double getCluster_score()328 {329 return cluster_score;330 }331 private void setCluster_score(Double cluster_score)332 {333 this.cluster_score = cluster_score;334 }335 336 /**337 * @hibernate.property338 * column="`calibration_point`"339 */340 public Boolean getCalibration_point()341 {342 return calibration_point;343 }344 private void setCalibration_point(Boolean calibration_point)345 {346 this.calibration_point = calibration_point;347 }348 349 /**350 * @hibernate.property351 * column="`cluster_count`"352 */353 public Integer getCluster_count()354 {355 return cluster_count;356 }357 private void setCluster_count(Integer cluster_count)358 {359 this.cluster_count = cluster_count;360 }361 362 /**363 236 * @hibernate.set 364 237 * inverse="true" -
trunk/src/org/proteios/core/element/PeakList.java
r1280 r1343 90 90 91 91 // Defer graph cycles by not adding any non Peak children already in conn. 92 if (retval && !(child instanceof Peak) )92 if (retval && !(child instanceof Peak) && (dataConnection == child.getDataConnection())) 93 93 { 94 94 try -
trunk/src/org/proteios/core/element/Protein.java
r1339 r1343 264 264 try 265 265 { 266 retval = new URL("http://www.expasy.org/ uniprot/" + identifier + ".txt");266 retval = new URL("http://www.expasy.org/cgi-bin/niceprot.pl/printable?ac=" + identifier); 267 267 } 268 268 catch (Exception e) … … 271 271 } 272 272 } 273 273 274 return retval; 274 275 } -
trunk/src/org/proteios/core/element/Sample.java
r1263 r1343 49 49 } 50 50 51 // /**52 // * @hibernate.id53 // * generator-class="native"54 // * column="`sid`"55 // */56 // public Long getAuto_id()57 // {58 // return auto_id;59 // }60 //61 // private void setAuto_id(Long id)62 // {63 // this.auto_id = id;64 // }65 51 66 52 /** -
trunk/src/org/proteios/core/element/Spectrum.java
r1287 r1343 46 46 This element represents an individual spectrum. The spectrum consists of an 47 47 array of acquisitions. Peak list are in Proteios stored as peaks under PeakList. 48 48 Upon MzData export the mass to charge and intensities are base64 encoded and 49 49 and exported in the MzArrayBinary and IntenArrayBinary elements. These are never 50 50 stored in the Proteios database. In addition to 51 51 this data, a spectrum element may also contain an arbitrary number of 52 52 supplementary data, stored in supDataArray and supDataArrayBinary elements. … … 66 66 public int compareTo(Object o) 67 67 { 68 Integer id2 = ((Spectrum)o).getId(); 69 return id.compareTo(id2); 68 int retval = 0; 69 70 if ((o instanceof Spectrum) && (o != null)) 71 { 72 retval = (int) (id - ((Spectrum) o).getId()); 73 } 74 return retval; 70 75 } 71 76 72 73 74 75 76 77 77 /** 78 Get children by type. If mzArrayBinaary or IntenArrayBinary are 79 asked for they are generated by this function. 80 @param type Name of the children 81 @param parent The parent of this object 82 @return List of elements. 78 83 */ 79 84 public List getChildren( String type, Object parent ) … … 291 296 292 297 /** 293 Get the id for this element. 294 @hibernate.property column="`id`" 295 */ 296 public Integer getId() 298 * Hibernate 3 refuses to accept id as "int" => voodo. 299 * 300 * @hibernate.property 301 * column="`id`" 302 */ 303 public long getId() 297 304 { 298 305 return id; 299 306 } 300 private void setId( Integerid)307 private void setId(long id) 301 308 { 302 309 this.id = id; … … 309 316 private Set sup_data_array_binarys = new HashSet(); 310 317 private Set sup_descs = new HashSet(); 311 private Integer id = new Integer(0);318 private long id; 312 319 } -
trunk/src/org/proteios/core/element/SupDataArray.java
r787 r1343 62 62 63 63 /** 64 Get the id for this element. 65 @hibernate.property column="`id`" 66 */ 67 public Integer getId() 64 * Hibernate 3 refuses to accept id as "int" => voodo. 65 * 66 * @hibernate.property 67 * column="`id`" 68 */ 69 public long getId() 68 70 { 69 71 return id; 70 72 } 71 private void setId( Integerid)73 private void setId(long id) 72 74 { 73 75 this.id = id; … … 234 236 235 237 private Spectrum spectrum; 236 String array_name = "";237 Integer id = new Integer(0);238 Integer length = new Integer(0);239 Integer offset;240 Boolean indexed = new Boolean(false);241 242 List float_collection = new LinkedList();243 List boolean_collection = new LinkedList();244 List double_collection = new LinkedList();245 List int_collection = new LinkedList();246 List string_collection = new LinkedList();247 List uri_collection = new LinkedList();248 List time_collection = new LinkedList();238 private long id; 239 private String array_name = ""; 240 private Integer length = new Integer(0); 241 private Integer offset; 242 private Boolean indexed = new Boolean(false); 243 244 private List float_collection = new LinkedList(); 245 private List boolean_collection = new LinkedList(); 246 private List double_collection = new LinkedList(); 247 private List int_collection = new LinkedList(); 248 private List string_collection = new LinkedList(); 249 private List uri_collection = new LinkedList(); 250 private List time_collection = new LinkedList(); 249 251 } -
trunk/src/org/proteios/core/element/SupDataArrayBinary.java
r787 r1343 60 60 61 61 /** 62 Get the id for this element. 63 @hibernate.property column="`id`" 62 * Hibernate 3 refuses to accept id as "int" => voodo. 63 * 64 * @hibernate.property 65 * column="`id`" 64 66 */ 65 public intgetId()67 public long getId() 66 68 { 67 69 return id; 68 70 } 69 private void setId( intid)71 private void setId(long id) 70 72 { 71 73 this.id = id; … … 94 96 private Spectrum spectrum; 95 97 private String array_name = new String(); 96 private intid;98 private long id; 97 99 } -
trunk/src/org/proteios/gui/importer/GImport.java
r1342 r1343 1 1 // $Id$ 2 // Copyright (C) 2005 Per G �rd�n, Jari H�kkinen, Rikard Alm - proteios.org2 // Copyright (C) 2005 Per Gärdén, Jari Häkkinen, Rikard Alm - proteios.org 3 3 // 4 4 // This program is free software; you can redistribute it and/or … … 64 64 * This class provides a graphical user interface to Proteios data import 65 65 * 66 * @author Per G �rd�n66 * @author Per Gärdén 67 67 * @version September 2004. 68 68 * … … 74 74 { 75 75 /** Creates new form GImport */ 76 public GImport(GImportParent parent , CMain main)76 public GImport(GImportParent parent) 77 77 { 78 78 super(); 79 79 // Keep track of which GMain we're contained in 80 80 this.parent = parent; 81 this.importer = main;82 81 initComponents(); 83 82 } … … 225 224 * - Initialise the source tree view with database resources and file import 226 225 * option 226 * <BR> 227 * - Create and connect to a CMain in an underlying proteios core layer 227 228 */ 228 229 public void init() … … 260 261 try 261 262 { 263 importer = new CMain(); 262 264 // Get connected resources from CMain 263 265 List resources = importer.getConnections(); … … 388 390 389 391 /** The import API should be thread safe, so we only need one object */ 390 private CMain importer ;392 private CMain importer = null; 391 393 /** The most recently started import thread */ 392 394 // private GImportThread importThread; -
trunk/src/org/proteios/gui/main/GMain.java
r1342 r1343 26 26 import java.util.Properties; 27 27 28 import java.awt.Dimension; 29 28 30 import javax.swing.JFrame; 29 31 import javax.swing.JPanel; 32 import javax.swing.SwingUtilities; 30 33 import javax.swing.JFileChooser; 31 import javax.swing.JDialog; 32 import javax.swing.border.EtchedBorder; 33 import java.awt.*; 34 import java.awt.event.*; 35 import javax.swing.*; 34 import javax.swing.filechooser.FileFilter; 36 35 37 36 import org.apache.log4j.Logger; … … 40 39 import org.apache.log4j.RollingFileAppender; 41 40 42 import org.proteios.core.CoreException;43 import org.proteios.core.CMain;44 41 import org.proteios.core.Element; 45 42 import org.proteios.core.ProteiosElement; … … 69 66 props = new Properties(); 70 67 initLogging(); 71 72 // Prompt user for login data73 Properties defaultProps = new Properties();74 try75 {76 FileInputStream defaultStream = new FileInputStream(USER_PROPERTIES_FILE);77 defaultProps.load(defaultStream);78 defaultStream.close();79 }80 catch (Exception e)81 {82 // If no default properties could be loaded, just ignore it83 }84 LoginData loginData = new LoginData();85 if (defaultProps.getProperty("username") != null)86 {87 loginData.username = defaultProps.getProperty("username");88 }89 if (defaultProps.getProperty("url") != null)90 {91 loginData.url = defaultProps.getProperty("url");92 }93 94 JDialog login = new LoginDialog(this, loginData);95 login.setVisible(true);96 // Save user login data97 if (loginData.username != null)98 {99 defaultProps.setProperty("username", loginData.username);100 }101 if (loginData.url != null)102 {103 defaultProps.setProperty("url", loginData.url);104 }105 try106 {107 FileOutputStream defaultsOut = new FileOutputStream(USER_PROPERTIES_FILE);108 defaultProps.store(defaultsOut, "### Proteios login user properties ###");109 defaultsOut.close();110 }111 catch (Exception e)112 {113 // If unable to save default login data, just ignore it114 }115 116 // Use login data to fetch database connection info from login server117 System.out.println("Connecting to " + loginData.url);118 119 CMain main = null;120 try121 {122 main = new CMain();123 }124 catch (CoreException e)125 {126 LOGGER.error(e.getMessage());127 getLog().addMessage(GMainLog.ERROR, e.getMessage());128 }129 sourcePanel = new GImport(this, main);130 68 initComponents(); 131 69 initProperties(); 132 70 } 133 134 71 135 72 … … 525 462 } 526 463 527 /**528 * This dialog window is shown at startup of GMain, and will query529 * the user for login info.530 * @author linus531 */532 private class LoginDialog extends JDialog533 {534 LoginDialog (JFrame parent, LoginData indata)535 {536 super(parent, "Proteios login", true);537 538 loginData = indata;539 540 ActionListener listener = new MyActionListener();541 542 setBackground(new java.awt.Color(102, 204, 255));543 setSize(new java.awt.Dimension(320, 350));544 setResizable(false);545 setLocation(430, 300);546 setLayout(new java.awt.GridLayout(1, 1));547 Container cp = getContentPane();548 549 /* The main panel containing all other panels */550 JPanel main = new JPanel();551 main.setLayout(new java.awt.GridLayout(3, 1));552 main.setBackground(new java.awt.Color(255, 255, 255));553 cp.add(main);554 555 556 /* Logo panel */557 JPanel logoPanel = new JPanel();558 logoPanel.setBackground(new java.awt.Color(102, 204, 255));559 ImageIcon icon = new ImageIcon(PROTEIOS_LOGO_PATH);560 JLabel iconLabel = new JLabel("Proteios 1.0", icon, JLabel.CENTER);561 logoPanel.add(iconLabel);562 main.add(logoPanel);563 564 /* The input panel */565 JPanel inputPanel = new JPanel();566 inputPanel.setLayout(new java.awt.GridLayout(2, 1));567 inputPanel.setBackground(new java.awt.Color(102, 204, 255));568 main.add(inputPanel);569 570 /* The username panel */571 JPanel usernamePanel = new JPanel();572 usernamePanel.setBackground(new java.awt.Color(102, 204, 255));573 usernamePanel.add(new JLabel("Username: "));574 usernameField = new JTextField(13);575 usernameField.setText(loginData.username);576 usernamePanel.add(usernameField);577 inputPanel.add(usernamePanel);578 579 /* The password panel */580 JPanel passwordPanel = new JPanel();581 passwordPanel.setBackground(new java.awt.Color(102, 204, 255));582 passwordPanel.add(new JLabel("Password: "));583 passwordField = new JTextField(13);584 passwordPanel.add(passwordField);585 inputPanel.add(passwordPanel);586 587 /* URL and button panel */588 JPanel urlAndButtonPanel = new JPanel();589 urlAndButtonPanel.setLayout(new java.awt.GridLayout(2, 1));590 urlAndButtonPanel.setBackground(new java.awt.Color(102, 204, 255));591 main.add(urlAndButtonPanel);592 593 /* The login server URL panel */594 JPanel urlPanel = new JPanel();595 urlPanel.setBackground(new java.awt.Color(102, 204, 255));596 urlPanel.add(new JLabel("URL for login:"));597 urlField = new JTextField(13);598 urlField.setText(loginData.url);599 urlPanel.add(urlField);600 urlAndButtonPanel.add(urlPanel);601 602 /* The button panel */603 JPanel buttonPanel = new JPanel();604 buttonPanel.setBackground(new java.awt.Color(102, 204, 255));605 JButton cancel = new JButton("Cancel");606 cancel.setActionCommand("cancel");607 cancel.addActionListener(listener);608 buttonPanel.add(cancel);609 buttonPanel.add(new JLabel(" "));610 JButton accept = new JButton("Login");611 accept.setActionCommand("accept");612 accept.addActionListener(listener);613 buttonPanel.add(accept);614 urlAndButtonPanel.add(buttonPanel);615 616 this.pack();617 if (loginData.username != null)618 {619 passwordField.requestFocusInWindow();620 }621 }622 623 /**624 * A listener that puts login data from the dialog fields625 * into a loginData object.626 * @author linus627 *628 */629 private class MyActionListener implements ActionListener630 {631 public void actionPerformed(ActionEvent event)632 {633 if ("cancel".equals(event.getActionCommand()))634 {635 loginData = null;636 dispose();637 }638 if ("accept".equals(event.getActionCommand()))639 {640 loginData.username = usernameField.getText();641 loginData.password = passwordField.getText();642 loginData.url = urlField.getText();643 dispose();644 }645 }646 };647 648 649 final String PROTEIOS_LOGO_PATH = "proteios" + File.separator + "icons" + File.separator + "proteios.png";650 private JTextField usernameField, passwordField, urlField;651 private LoginData loginData;652 }653 654 /**655 * A data container for login data.656 * @author linus657 *658 */659 private class LoginData660 {661 String username, password, url;662 }663 464 664 465 public static Logger LOGGER; 665 private JPanel sourcePanel;466 private final JPanel sourcePanel = new GImport(this); 666 467 private final JPanel dataPanel = new ViewerController(this); 667 468 private final JPanel workspace = new Workspace(this); 668 469 private final JPanel logPanel = new GMainLog(); 669 private final String USER_PROPERTIES_FILE = "proteios" + File.separator + "conf" + File.separator + "user.properties";670 470 // Variables declaration - do not modify//GEN-BEGIN:variables 671 471 private final javax.swing.JMenu adminMenu = new javax.swing.JMenu(); -
trunk/src/org/proteios/importer/ImporterUtil.java
r1260 r1343 1 1 package org.proteios.importer; 2 2 3 import net.sf.hibernate.*;3 import org.hibernate.*; 4 4 import org.proteios.core.ImportException; 5 5 import org.proteios.core.SQLConnection; -
trunk/src/org/proteios/query/ProteinHitsReportQuery.java
r1273 r1343 224 224 throw new org.proteios.core.CoreException("Could not parse id_date: " + currentDBSearch.getId_date() + " is not a valid XML dateTime format."); 225 225 } 226 row.spotId = currentGelItem.getId();226 row.spotId = (int) currentGelItem.getId(); 227 227 row.MPId = currentGelItem.getMPId(); 228 228 row.MPLabel = currentGelItem.getMPLabel();
Note: See TracChangeset
for help on using the changeset viewer.