diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..2897384 --- /dev/null +++ b/.classpath @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..a374bb8 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,6 @@ +velocity.log +velocity.log.* +build.properties +TEST-REPORT.txt +bin +build diff --git a/.project b/.project new file mode 100644 index 0000000..c992bc4 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + tcms + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/1483.pdf b/1483.pdf new file mode 100644 index 0000000..3edf07d Binary files /dev/null and b/1483.pdf differ diff --git a/1597.pdf b/1597.pdf new file mode 100644 index 0000000..3cbcd93 Binary files /dev/null and b/1597.pdf differ diff --git a/1599.pdf b/1599.pdf new file mode 100644 index 0000000..048adf6 Binary files /dev/null and b/1599.pdf differ diff --git a/2525.html b/2525.html new file mode 100644 index 0000000..b00a3cb --- /dev/null +++ b/2525.html @@ -0,0 +1 @@ + Errata for 582-3 Asleson (corrected in the second printing)

Errata 125-9 Sam-Bodden (corrected in the 2nd printing)

Page

Original Sentence

Corrected Sentence

 10

Likewise, there can be an increase in quality because the framework and library has been already thoroughly test and debugged by many developers and users.

Likewise, there can be an increase in quality because the framework and and libraries have already been thoroughly tested and debugged by many developers

and users.

 14

just like the authors and readers, who make it easier to relate

just like the authors and readers, which make it easier to relate

 86

For more on the debate over XML in Ant see the ÒAntÕs FutureÓ section later in this chapter.

 

(None-sentence was removed)

404

The marketing around the JDO specification sounds like it could become one of the main alternatives to CMP EJBs for those who are looking for a portable persistence

solution.

The marketing around the JDO specification makes it sound like it could become one of the main alternatives to CMP EJBs for those who are looking for a portable

persistence solution.

 

404

Behind-thescenes JDO works with existing objects

Behind-the-scenes JDO works with existing objects

404

to other persistence solutions.

to other persistence solutions if most of the limitations are overcome in newer releases.

..............................................................................................................................

ix

PresePntation Tier

Presentation Tier

v

MVC Frameworks and the PresePntation Tier

MVC Frameworks and the Presentation Tier

 

\ No newline at end of file diff --git a/914.html b/914.html new file mode 100644 index 0000000..06f2786 --- /dev/null +++ b/914.html @@ -0,0 +1,12 @@ +Chapter 1 The Open Source and Java Synergy
+Chapter 2 Design with ArgoUML
+Chapter 3 Development and Build System with Ant
+Chapter 4 Testing
+Chapter 5 Business Tier with JBoss
+Chapter 6 Data Storage Options
+Chapter 7 Object-Relational Mapping
+Chapter 8 MVC Frameworks and the PresePntation Tier
+Chapter 9 Web Services and Mobile Clients
+Chapter 10 Rich Clients with the SWT and JFace
+Appendix A Open Source Catalog
+Appendix B CVS Primer \ No newline at end of file diff --git a/9781590591253.jpg b/9781590591253.jpg new file mode 100644 index 0000000..64e9fd0 Binary files /dev/null and b/9781590591253.jpg differ diff --git a/CVS/Entries b/CVS/Entries new file mode 100644 index 0000000..6b22012 --- /dev/null +++ b/CVS/Entries @@ -0,0 +1,9 @@ +/.cvsignore/1.5/Thu Jun 5 18:59:47 2003// +/build.properties.sample/1.3/Mon Dec 29 20:41:53 2003// +/build.xml/1.38/Mon Jan 5 00:58:41 2004/-kb/ +D/dist//// +D/lib//// +/project.xml/1.1/Fri Nov 14 07:29:07 2003/-kb/ +/read-me.txt/1.1/Tue May 13 19:29:32 2003/-kb/ +D/setup//// +D/src//// diff --git a/CVS/Repository b/CVS/Repository new file mode 100644 index 0000000..06a0fa4 --- /dev/null +++ b/CVS/Repository @@ -0,0 +1 @@ +tcms diff --git a/CVS/Root b/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ed41fc3 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2004 Brian Sam-Bodden and Christopher M Judd + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a user’s educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..b482000 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*Enterprise Java Development on a Budget*](http://www.apress.com/9781590591253) by Brian Sam-Bodden and Christopher M Judd (Apress, 2004). + +![Cover image](9781590591253.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..955ae6f --- /dev/null +++ b/build.properties @@ -0,0 +1,40 @@ +// app +app.name=tcms +database.type=hsqldb + +// jboss specific +jboss.home=F:/java/jboss-3.2.1 +jboss.server=${app.name} +jboss.datasource=java:/DefaultDS +jboss.datasource.mapping=Hypersonic SQL +java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory +java.naming.provider.url=jnp://localhost:1099 + +# physical JNDI name of the queue used by xpetstore.services.mail.MailerMDB +jboss.queue.mail=queue/mail +# physical JNDI name of the javax.jms.MailSession +jboss.mail.session=java:/Mail + +// middlegen +mgen.gui=false + +// db properties +global.db.url=jdbc:hsqldb:hsql://localhost:1701 +global.db.userid=sa +global.db.password= +global.db.driver=org.hsqldb.jdbcDriver +global.db.driver.file=${jboss.home}/server/${jboss.server}/lib/hsqldb.jar + +// middlegen db properties +mgen.db.url=jdbc:hsqldb:${build}/hsqldb/${jboss.server} +mgen.db.userid=sa +mgen.db.password= +mgen.db.driver=org.hsqldb.jdbcDriver +mgen.db.driver.file=${lib-dev}/middlegen/util/hsqldb.jar + +// middlegen CMP properties +mgen.cmp.package=com.ejdoab.tcms.entities + +// J2ME +wtk.home=F:/java/Borland/JBuilder9/j2mewtk1.0.4 +midp-obfuscate=false \ No newline at end of file diff --git a/build.properties.sample b/build.properties.sample new file mode 100644 index 0000000..38ebc31 --- /dev/null +++ b/build.properties.sample @@ -0,0 +1,36 @@ +// app +app.name=tcms +database.type=hsqldb + +// jboss specific +jboss.home=C:/java/jboss-3.2.2RC2_jetty-4.2.11 +jboss.server=${app.name} +jboss.datasource=java:/DefaultDS +jboss.datasource.mapping=Hypersonic SQL +java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory +java.naming.provider.url=jnp://localhost:1099 + +# physical JNDI name of the queue used by xpetstore.services.mail.MailerMDB +jboss.queue.mail=queue/mail +# physical JNDI name of the javax.jms.MailSession +jboss.mail.session=java:/Mail + +// middlegen +mgen.gui=false + +// db properties +global.db.url=jdbc:hsqldb:hsql://localhost:1701 +global.db.userid=sa +global.db.password= +global.db.driver=org.hsqldb.jdbcDriver +global.db.driver.file=${jboss.home}/server/${jboss.server}/lib/hsqldb.jar + +// middlegen db properties +mgen.db.url=jdbc:hsqldb:${build}/hsqldb/${jboss.server} +mgen.db.userid=sa +mgen.db.password= +mgen.db.driver=org.hsqldb.jdbcDriver +mgen.db.driver.file=${lib-dev}/middlegen/util/hsqldb.jar + +// middlegen CMP properties +mgen.cmp.package=com.ejdoab.tcms.entities diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..5dc2de7 --- /dev/null +++ b/build.xml @@ -0,0 +1,1202 @@ + + + + + This build script was developed to be a generic enterprise developemnt build script + using ANT 1.5.3 (ant.apache.org). To customize it or use it for other project modify + the build.properties file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + db.url=${global.db.url} + db.driver=${global.db.driver} + db.user=${global.db.userid} + db.password=${global.db.password} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${ant.project.name}]]> + Copyright © 2003 All Rights Reserved.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

CheckStyle Audit

Designed for use with CheckStyle and Ant.
+
+ + + +
+ + + +
+ + + + + +

+

+ +


+ + + + + + + + + +

Files

+ + + + + + + + + + + + + + +
NameErrors
+
+ + + + +

File

+ + + + + + + + + + + + + +
Error DescriptionLine
+ Back to top +
+ + + +

Summary

+ + + + + + + + + + + + +
FilesErrors
+
+ + + + a + b + + + + + diff --git a/lib/development/checkstyle/checkstyle-noframes.xsl b/lib/development/checkstyle/checkstyle-noframes.xsl new file mode 100644 index 0000000..5ea69d8 --- /dev/null +++ b/lib/development/checkstyle/checkstyle-noframes.xsl @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

CheckStyle Audit

Designed for use with CheckStyle and Ant.
+
+ + + +
+ + + +
+ + + + + +

+

+ +


+ + + + +
+ + + + +

Files

+ + + + + + + + + + + + + + +
NameErrors
+
+ + + + +

File

+ + + + + + + + + + + + + +
Error DescriptionLine
+ Back to top +
+ + + +

Summary

+ + + + + + + + + + + + +
FilesErrors
+
+ + + + a + b + + +
+ + diff --git a/lib/development/checkstyle/checkstyle-simple.xsl b/lib/development/checkstyle/checkstyle-simple.xsl new file mode 100644 index 0000000..0bcf5a8 --- /dev/null +++ b/lib/development/checkstyle/checkstyle-simple.xsl @@ -0,0 +1,71 @@ + + + + + + + + Sun Coding Style Violations + + +

Coding Style Check Results

+ + + + + + + + + + + + + + + + + + + + +
Summary
Total files checked
Files with errors
Total errors
Errors per file
+
+

The following are violations of the Sun Coding-Style Standards:

+

+ + + + + + + + + + + +
File: + +
+ + + + + + +
Line Number Error Message
+

+ + + + + + + + + + + + + + diff --git a/lib/development/checkstyle/checkstyle-text.xsl b/lib/development/checkstyle/checkstyle-text.xsl new file mode 100644 index 0000000..a0ed65f --- /dev/null +++ b/lib/development/checkstyle/checkstyle-text.xsl @@ -0,0 +1,26 @@ + + + + + +Coding Style Check Results +-------------------------- +Total files checked: + Files with errors: + Total errors: + Errors per file: + + + + +File: + + + + + +: - + + + + \ No newline at end of file diff --git a/lib/development/checkstyle/checkstyle_checks.xml b/lib/development/checkstyle/checkstyle_checks.xml new file mode 100644 index 0000000..abadcbe --- /dev/null +++ b/lib/development/checkstyle/checkstyle_checks.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/development/checkstyle/sun_checks.xml b/lib/development/checkstyle/sun_checks.xml new file mode 100644 index 0000000..ddb029a --- /dev/null +++ b/lib/development/checkstyle/sun_checks.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/development/jalopy/CVS/Entries b/lib/development/jalopy/CVS/Entries new file mode 100644 index 0000000..1d2afe1 --- /dev/null +++ b/lib/development/jalopy/CVS/Entries @@ -0,0 +1,9 @@ +/aelfred-1.2.jar/1.1/Sat Jul 5 17:19:37 2003/-kb/ +/jalopy-1.0b10.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/jalopy-ant-0.6.1.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/jalopy-sun-convention.xml/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/jaxp-1.2.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/jdom-1.0b8.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/log4j-1.2.6.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/oro-2.0.6.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ +/sax-2.0.1.jar/1.1/Sat Jul 5 17:19:38 2003/-kb/ diff --git a/lib/development/jalopy/CVS/Repository b/lib/development/jalopy/CVS/Repository new file mode 100644 index 0000000..f2d5a17 --- /dev/null +++ b/lib/development/jalopy/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/jalopy diff --git a/lib/development/jalopy/CVS/Root b/lib/development/jalopy/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/jalopy/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/jalopy/aelfred-1.2.jar b/lib/development/jalopy/aelfred-1.2.jar new file mode 100644 index 0000000..9bfe9ea Binary files /dev/null and b/lib/development/jalopy/aelfred-1.2.jar differ diff --git a/lib/development/jalopy/jalopy-1.0b10.jar b/lib/development/jalopy/jalopy-1.0b10.jar new file mode 100644 index 0000000..e9b3688 Binary files /dev/null and b/lib/development/jalopy/jalopy-1.0b10.jar differ diff --git a/lib/development/jalopy/jalopy-ant-0.6.1.jar b/lib/development/jalopy/jalopy-ant-0.6.1.jar new file mode 100644 index 0000000..e76a0a3 Binary files /dev/null and b/lib/development/jalopy/jalopy-ant-0.6.1.jar differ diff --git a/lib/development/jalopy/jalopy-sun-convention.xml b/lib/development/jalopy/jalopy-sun-convention.xml new file mode 100644 index 0000000..433e934 --- /dev/null +++ b/lib/development/jalopy/jalopy-sun-convention.xml @@ -0,0 +1,387 @@ + + + + + 14 + + + + + false + + + [A-Z][a-zA-Z0-9]+ + [A-Z][a-zA-Z0-9]+ + + + [a-z][\w]+ + [a-z][\w]+ + [a-zA-Z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-zA-Z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-zA-Z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-zA-Z][\w]+ + + [A-Z][a-zA-Z0-9]+ + \w+ + + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + [a-z][\w]+ + + [a-z]+(?:\.[a-z]+)* + + [a-z][\w]+ + [a-z][\w]+ + + [a-z][\w]* + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + 6 + + + + 30000 + 30000 + 30000 + 30000 + 30000 + 30000 + + true + + + 1 + + + + true + false + true + false + false + + + bak + 0 + + + + 1 + 0 + 1 + 0 +

1
+
1
+ 1 + 2 + 1 + 1 + + + 1 + 0 + 1 + + 1 + 1 + 1 + + 1 + 1 +
0
+
0
+
+ 1 + + + + false + false + + + false + false + true + false + + + true + false + false + false + false + + + false + false + + + + true + true + + + + false + + + + true + false + true + + true + + 1 + 5 + 1 + 5 + + false + + + + + + /**| * DOCUMENT ME!| *| * @author $author$| * @version $Revision$| */ + + */ + * @throws $exceptionType$ DOCUMENT ME! + * @param $paramType$ DOCUMENT ME! + /**| * Creates a new $objectType$ object. + + /**| * DOCUMENT ME!| *| * @author $author$| * @version $Revision$| */ + + */ + * @throws $exceptionType$ DOCUMENT ME! + * @param $paramType$ DOCUMENT ME! + * @return DOCUMENT ME! + /**| * DOCUMENT ME! + + /** DOCUMENT ME! */ + + + + false + false + false + + + - + false + false + + Inner Classes + Constructors + Instance fields + Instance initializers + Inner Interfaces + Methods + Static fields/initializers + + + + +
+ + 0 + false +
+
+ Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd + 0 + /* ========================================================================= *| * *| * Enterprise Java Development on a Budget *| * Technology Conference Management System *| * www.ejdoab.com *| * Licensed under The Apache Software License, Version 1.1 *| * *| * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd *| * All rights reserved. *| * *| * ========================================================================= */ + true +
+ + disabled + + + + 3 + *:0|gnu:2|java:2|javax:2 + + disabled + true + + + true + + true + false + + true + + + false + + + 1 + 1 + 0 + 1 + 4 + 55 + -1 + 4 + -1 + 0 + 8 + -1 + 1 + + + false + false + + + + false + false + true + false + true + false + + + + false + false + true + false + false + static|field|initializer|constructor|method|interface|class + false + + + false + public|protected|private|abstract|static|final|synchronized|transient|volatile|native|strictfp + + + + + true + true + true + + + true + false + false + false + + false + + + false + false + true + + + + true + false + + true + true + true + true + true + true + + false + false + + + + + + 0 + false + false + false + + false + + false + false + + false + + + false + false + false + false + + + false + false + false + + + + false + true + 80 + + + + false + false + false + + false + false + false + + + + false + + false + + + + + diff --git a/lib/development/jalopy/jaxp-1.2.jar b/lib/development/jalopy/jaxp-1.2.jar new file mode 100644 index 0000000..22f2905 Binary files /dev/null and b/lib/development/jalopy/jaxp-1.2.jar differ diff --git a/lib/development/jalopy/jdom-1.0b8.jar b/lib/development/jalopy/jdom-1.0b8.jar new file mode 100644 index 0000000..2734fd2 Binary files /dev/null and b/lib/development/jalopy/jdom-1.0b8.jar differ diff --git a/lib/development/jalopy/log4j-1.2.6.jar b/lib/development/jalopy/log4j-1.2.6.jar new file mode 100644 index 0000000..be4a917 Binary files /dev/null and b/lib/development/jalopy/log4j-1.2.6.jar differ diff --git a/lib/development/jalopy/oro-2.0.6.jar b/lib/development/jalopy/oro-2.0.6.jar new file mode 100644 index 0000000..62df73e Binary files /dev/null and b/lib/development/jalopy/oro-2.0.6.jar differ diff --git a/lib/development/jalopy/sax-2.0.1.jar b/lib/development/jalopy/sax-2.0.1.jar new file mode 100644 index 0000000..7ed3b35 Binary files /dev/null and b/lib/development/jalopy/sax-2.0.1.jar differ diff --git a/lib/development/java2html/CVS/Entries b/lib/development/java2html/CVS/Entries new file mode 100644 index 0000000..6087381 --- /dev/null +++ b/lib/development/java2html/CVS/Entries @@ -0,0 +1 @@ +/java2html.jar/1.1/Sat Jul 5 17:21:07 2003/-kb/ diff --git a/lib/development/java2html/CVS/Repository b/lib/development/java2html/CVS/Repository new file mode 100644 index 0000000..c31d3cf --- /dev/null +++ b/lib/development/java2html/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/java2html diff --git a/lib/development/java2html/CVS/Root b/lib/development/java2html/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/java2html/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/java2html/java2html.jar b/lib/development/java2html/java2html.jar new file mode 100644 index 0000000..f8e9d13 Binary files /dev/null and b/lib/development/java2html/java2html.jar differ diff --git a/lib/development/javancss/CVS/Entries b/lib/development/javancss/CVS/Entries new file mode 100644 index 0000000..f813130 --- /dev/null +++ b/lib/development/javancss/CVS/Entries @@ -0,0 +1,4 @@ +/ccl.jar/1.1/Sat Jul 5 17:22:21 2003/-kb/ +/javancss.jar/1.1/Sat Jul 5 17:22:21 2003/-kb/ +/jhbasic.jar/1.1/Sat Jul 5 17:22:21 2003/-kb/ +D/xslt//// diff --git a/lib/development/javancss/CVS/Repository b/lib/development/javancss/CVS/Repository new file mode 100644 index 0000000..70ffd0f --- /dev/null +++ b/lib/development/javancss/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/javancss diff --git a/lib/development/javancss/CVS/Root b/lib/development/javancss/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/javancss/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/javancss/ccl.jar b/lib/development/javancss/ccl.jar new file mode 100644 index 0000000..5100c72 Binary files /dev/null and b/lib/development/javancss/ccl.jar differ diff --git a/lib/development/javancss/javancss.jar b/lib/development/javancss/javancss.jar new file mode 100644 index 0000000..86b45f8 Binary files /dev/null and b/lib/development/javancss/javancss.jar differ diff --git a/lib/development/javancss/jhbasic.jar b/lib/development/javancss/jhbasic.jar new file mode 100644 index 0000000..064d3fb Binary files /dev/null and b/lib/development/javancss/jhbasic.jar differ diff --git a/lib/development/javancss/xslt/CVS/Entries b/lib/development/javancss/xslt/CVS/Entries new file mode 100644 index 0000000..ec6063e --- /dev/null +++ b/lib/development/javancss/xslt/CVS/Entries @@ -0,0 +1,6 @@ +/javancss2document11.xsl/1.1/Sat Jul 5 17:22:21 2003/-kb/ +/javancss2html.xsl/1.1/Sat Jul 5 17:22:21 2003/-kb/ +/javancss2text.xsl/1.1/Sat Jul 5 17:22:21 2003/-kb/ +/javancss_no_functions_overloading.xsl/1.1/Sat Jul 5 17:22:21 2003/-kb/ +D/svg//// +/xmltest.xsl/1.1/Sat Jul 5 17:22:21 2003/-kb/ diff --git a/lib/development/javancss/xslt/CVS/Repository b/lib/development/javancss/xslt/CVS/Repository new file mode 100644 index 0000000..db0c211 --- /dev/null +++ b/lib/development/javancss/xslt/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/javancss/xslt diff --git a/lib/development/javancss/xslt/CVS/Root b/lib/development/javancss/xslt/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/javancss/xslt/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/javancss/xslt/javancss2document11.xsl b/lib/development/javancss/xslt/javancss2document11.xsl new file mode 100644 index 0000000..ec105b6 --- /dev/null +++ b/lib/development/javancss/xslt/javancss2document11.xsl @@ -0,0 +1,150 @@ + + + + + + + + +
+ Java Non Commenting Source Statements - Analysis +
+ + + + +
+

The metrics on this page are calculated by counting the comment lines and Non Commenting Source Statements (NCSS). Statements are not statements as specified in the Java Language Specification but include all kinds of declarations too. Roughly spoken, NCSS is approximately equivalent to counting ';' and '{' characters in Java source files.

+

SLCs and MLCs correspond to Sinle Line and Multi Line comments, whilst CCN is the Cyclomatic Complexity Number.

+

For more information about these metrics see the JavaNCSS home page.

+
+
+

Generated by JavaNCSS,javaNCSS2Ant and Ant

+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameClassesMethodsMethods/ClassNCSSComm/NCSS
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
NameMethodsNCSSNCSS/Method
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
NameNCSSCCNNCSS/CCN
+
+
+ +
diff --git a/lib/development/javancss/xslt/javancss2html.xsl b/lib/development/javancss/xslt/javancss2html.xsl new file mode 100644 index 0000000..8114f52 --- /dev/null +++ b/lib/development/javancss/xslt/javancss2html.xsl @@ -0,0 +1,254 @@ + + + + + + + JavaNCSS Analysis + + + +

+ JavaNCSS Analysis +

+

Designed for use with JavaNCSS and Ant.

+
+ + + +
+ +

Packages

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Nr.ClassesFunctionsNCSSJavadocsPackage
      
 Total
+

+ + + + + + + + + + + + + + + + + +
+

+ + + + + + + + + + + + + + + + + + | + +   + + + + + + | + +   + + + + + + +

Objects

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nr.NCSSFunctionsClassesJavadocsClass
Average Object NCSS:
Average Object Functions:
Average Object Inner Classes:
Average Object Javadoc Comments:
Program NCSS:
+

+ + + + + + + + + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Nr.NCSSCCNJavadocFunction
Average Function NCSS:
Average Function CCN:
Average Function Javadocs:
Program NCSS:
+

+ + + + + + #ff0000 + #000000 + + + + + #ff0000 + #000000 + + + + + + + + + + + + + + diff --git a/lib/development/javancss/xslt/javancss2text.xsl b/lib/development/javancss/xslt/javancss2text.xsl new file mode 100644 index 0000000..ea45730 --- /dev/null +++ b/lib/development/javancss/xslt/javancss2text.xsl @@ -0,0 +1,149 @@ + + + + + + + Classes Functions NCSS Javadocs Package + + + + + + --------- --------- --------- --------- + + + + + + + + + + + + Total + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ------------------------------------------------------------- + + + + + + + | + + + + + + + + + + + + + NCSS Functions Classes Javadocs Class + + + Average Object NCSS: + + +Average Object Functions: + + +Average Object Inner Classes: + + +Average Object Javadoc Comments: + + +Program NCSS: + + + + + + + + + + + + + + + + + + + + + + + + + NCSS CCN JVDC Function + + + Average Function NCSS: + + +Average Function CCN: + + +Average Function JVDC: + + +Program NCSS: + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/development/javancss/xslt/javancss_no_functions_overloading.xsl b/lib/development/javancss/xslt/javancss_no_functions_overloading.xsl new file mode 100644 index 0000000..7c18acf --- /dev/null +++ b/lib/development/javancss/xslt/javancss_no_functions_overloading.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/development/javancss/xslt/svg/CVS/Entries b/lib/development/javancss/xslt/svg/CVS/Entries new file mode 100644 index 0000000..70ae97c --- /dev/null +++ b/lib/development/javancss/xslt/svg/CVS/Entries @@ -0,0 +1,11 @@ +/README.TXT/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_ccn.svg/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_ccn.xsl/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_function_package.svg/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_function_package.xsl/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_ncss.svg/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_ncss.xsl/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_ncss_package.svg/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/chart_ncss_package.xsl/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/javancss_graph.xsl/1.1/Sat Jul 5 17:23:50 2003/-kb/ +/javancss_out.html/1.1/Sat Jul 5 17:23:50 2003/-kb/ diff --git a/lib/development/javancss/xslt/svg/CVS/Repository b/lib/development/javancss/xslt/svg/CVS/Repository new file mode 100644 index 0000000..5ab69e0 --- /dev/null +++ b/lib/development/javancss/xslt/svg/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/javancss/xslt/svg diff --git a/lib/development/javancss/xslt/svg/CVS/Root b/lib/development/javancss/xslt/svg/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/javancss/xslt/svg/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/javancss/xslt/svg/README.TXT b/lib/development/javancss/xslt/svg/README.TXT new file mode 100644 index 0000000..1464b7b --- /dev/null +++ b/lib/development/javancss/xslt/svg/README.TXT @@ -0,0 +1,13 @@ +Thanks to Yves Coene +for these xslt stylesheets to produce svg diagrams out of javancss xml output. +I like them very much. +The svg files in this directory are example files. + +Use e.g. batik as an svg viewer to see the content. + +Generate your own with your favorite xslt transformer like: +javancss -xml -all -recursively java_source_dir > temp.xml +xslt -in temp.xml -xsl chart_XY.xsl > temp.svg +batik temp.svg + +Chr. Clemens Lee, 2002-09-03. diff --git a/lib/development/javancss/xslt/svg/chart_ccn.svg b/lib/development/javancss/xslt/svg/chart_ccn.svg new file mode 100644 index 0000000..63d4e8b --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_ccn.svg @@ -0,0 +1,5 @@ + +Distribution CyclomaticComplexity per Function (CCN)Cyclomatic ComplexityAverage Cyclomatic Complexity = + 2.02Total Functions = + 2247Total Cyclomatic Complexity = + 4546Functions 0%10%20%30%40%50%60%70%80%90%100%012345678910 \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_ccn.xsl b/lib/development/javancss/xslt/svg/chart_ccn.xsl new file mode 100644 index 0000000..b8c749e --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_ccn.xsl @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + +]> + + + + + + Distribution Cyclomatic + Complexity per Function (CCN) + Functions + Cyclomatic Complexity + + + 35 + + + 220 + + + 464 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Average = + + + Total = + + + Total = + + + + + + + + 0% + 10% + 20% + 30% + 40% + 50% + 60% + 70% + 80% + 90% + 100% + + + + + + + + + + 0 + 10 + + + + + + + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_function_package.svg b/lib/development/javancss/xslt/svg/chart_function_package.svg new file mode 100644 index 0000000..55bbf87 --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_function_package.svg @@ -0,0 +1,5 @@ + +Distribution Functionsper PackageFunctionsAverage Functions = + 112.20Total Packages = + 20Total Functions = + 2244Packages 0%10%20%30%40%50%60%70%80%90%100%04590135180225270315360405450 \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_function_package.xsl b/lib/development/javancss/xslt/svg/chart_function_package.xsl new file mode 100644 index 0000000..6c338ae --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_function_package.xsl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + +]> + + + + + + Distribution Functions + per Package + Packages + Functions + + + 35 + + + 220 + + + 464 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Average = + + + Total = + + + Total = + + + + + + + + 0% + 10% + 20% + 30% + 40% + 50% + 60% + 70% + 80% + 90% + 100% + + + + + + + + + + 0 + 10 + + + + + + + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_ncss.svg b/lib/development/javancss/xslt/svg/chart_ncss.svg new file mode 100644 index 0000000..2bef572 --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_ncss.svg @@ -0,0 +1,5 @@ + +Distribution Java Source Statementsper Function (NCSS)Java NCSSAverage Java NCSS = + 5.18Total Functions = + 2247Total Java NCSS = + 11642Functions 0%10%20%30%40%50%60%70%80%90%100%036912151821242730 \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_ncss.xsl b/lib/development/javancss/xslt/svg/chart_ncss.xsl new file mode 100644 index 0000000..0f7e681 --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_ncss.xsl @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + +]> + + + + + + Distribution Java Source Statements + per Function (NCSS) + Functions + Java NCSS + + + 35 + + + 220 + + + 464 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Average = + + + Total = + + + Total = + + + + + + + + 0% + 10% + 20% + 30% + 40% + 50% + 60% + 70% + 80% + 90% + 100% + + + + + + + + + + 0 + 10 + + + + + + + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_ncss_package.svg b/lib/development/javancss/xslt/svg/chart_ncss_package.svg new file mode 100644 index 0000000..9de115c --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_ncss_package.svg @@ -0,0 +1,5 @@ + +Distribution Java Source Statementsper Package (NCSS)Java NCSSAverage Java NCSS = + 740.40Total Packages = + 20Total Java NCSS = + 14808Packages 0%10%20%30%40%50%60%70%80%90%100%02975948911188148517822079237626732970 \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/chart_ncss_package.xsl b/lib/development/javancss/xslt/svg/chart_ncss_package.xsl new file mode 100644 index 0000000..40bae09 --- /dev/null +++ b/lib/development/javancss/xslt/svg/chart_ncss_package.xsl @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + +]> + + + + + + Distribution Java Source Statements + per Package (NCSS) + Packages + Java NCSS + + + 35 + + + 220 + + + 464 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Average = + + + Total = + + + Total = + + + + + + + + 0% + 10% + 20% + 30% + 40% + 50% + 60% + 70% + 80% + 90% + 100% + + + + + + + + + + 0 + 10 + + + + + + + + + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/javancss_graph.xsl b/lib/development/javancss/xslt/svg/javancss_graph.xsl new file mode 100644 index 0000000..ddc3399 --- /dev/null +++ b/lib/development/javancss/xslt/svg/javancss_graph.xsl @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + ncss + + + + + + + + + + + + + + + + + + + + + + + + + <!--[if !mso]> + <style> + v\:* {behavior:url(#default#VML);} + o\:* {behavior:url(#default#VML);} + .shape {behavior:url(#default#VML);} + </style> + <![endif]--> + + + + + JavaNCSS Analysis + + + + + + + +

JavaNCSS Analysis

+

Designed for use with JavaNCSS.

+
+


+ + + + + + 0 + 10 + + +
NCSSFunctionsPercent
+ + + + + + 0 + 10 + +
CCNFunctionsPercent
+ +

+ + +
+ + + + + + 0 + 0 + 0 + + +

+

+ + + <v:rect style='width: + + + + + pt;height:8pt'fillcolor="red" ></v:rect> + + + +
+ + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/lib/development/javancss/xslt/svg/javancss_out.html b/lib/development/javancss/xslt/svg/javancss_out.html new file mode 100644 index 0000000..a519a50 --- /dev/null +++ b/lib/development/javancss/xslt/svg/javancss_out.html @@ -0,0 +1,99 @@ + + + + + JavaNCSS Analysis

JavaNCSS Analysis

Designed for use with JavaNCSS.


NCSSFunctionsPercent
0

1522

67.73%

+ +
3

212

9.43%

+ +
6

104

4.63%

+ +
9

99

4.41%

+ +
12

89

3.96%

+ +
15

83

3.69%

+ +
18

29

1.29%

+ +
21

16

0.71%

+ +
24

22

0.98%

+ +
27

15

0.67%

+ +
30

56

2.49%

+ +
CCNFunctionsPercent
0

0

0.00%

+ +
1

1753

78.02%

+ +
2

58

2.58%

+ +
3

102

4.54%

+ +
4

57

2.54%

+ +
5

69

3.07%

+ +
6

50

2.23%

+ +
7

56

2.49%

+ +
8

34

1.51%

+ +
9

20

0.89%

+ +
10

48

2.14%

+ +

\ No newline at end of file diff --git a/lib/development/javancss/xslt/xmltest.xsl b/lib/development/javancss/xslt/xmltest.xsl new file mode 100644 index 0000000..13c6512 --- /dev/null +++ b/lib/development/javancss/xslt/xmltest.xsl @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/lib/development/middlegen/CVS/Entries b/lib/development/middlegen/CVS/Entries new file mode 100644 index 0000000..2eb2740 --- /dev/null +++ b/lib/development/middlegen/CVS/Entries @@ -0,0 +1,7 @@ +/middlegen-2.0-b1.jar/1.1/Sat May 10 19:06:49 2003/-kb/ +/middlegen-entitybean-plugin-2.0-b1.jar/1.1/Sat May 10 19:06:49 2003/-kb/ +/middlegen-html-plugin-2.0-b1.jar/1.1/Sat May 10 19:06:49 2003/-kb/ +/middlegen-jdo-plugin-2.0-b1.jar/1.1/Sat May 10 19:06:49 2003/-kb/ +/middlegen-servlet-plugin-2.0-b1.jar/1.1/Sat May 10 19:06:49 2003/-kb/ +/middlegen-struts-plugin-2.0-b1.jar/1.1/Sat May 10 19:06:49 2003/-kb/ +D/util//// diff --git a/lib/development/middlegen/CVS/Repository b/lib/development/middlegen/CVS/Repository new file mode 100644 index 0000000..1c7e918 --- /dev/null +++ b/lib/development/middlegen/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/middlegen diff --git a/lib/development/middlegen/CVS/Root b/lib/development/middlegen/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/middlegen/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/middlegen/middlegen-2.0-b1.jar b/lib/development/middlegen/middlegen-2.0-b1.jar new file mode 100644 index 0000000..522c695 Binary files /dev/null and b/lib/development/middlegen/middlegen-2.0-b1.jar differ diff --git a/lib/development/middlegen/middlegen-entitybean-plugin-2.0-b1.jar b/lib/development/middlegen/middlegen-entitybean-plugin-2.0-b1.jar new file mode 100644 index 0000000..a447af7 Binary files /dev/null and b/lib/development/middlegen/middlegen-entitybean-plugin-2.0-b1.jar differ diff --git a/lib/development/middlegen/middlegen-html-plugin-2.0-b1.jar b/lib/development/middlegen/middlegen-html-plugin-2.0-b1.jar new file mode 100644 index 0000000..9630620 Binary files /dev/null and b/lib/development/middlegen/middlegen-html-plugin-2.0-b1.jar differ diff --git a/lib/development/middlegen/middlegen-jdo-plugin-2.0-b1.jar b/lib/development/middlegen/middlegen-jdo-plugin-2.0-b1.jar new file mode 100644 index 0000000..06bd89c Binary files /dev/null and b/lib/development/middlegen/middlegen-jdo-plugin-2.0-b1.jar differ diff --git a/lib/development/middlegen/middlegen-servlet-plugin-2.0-b1.jar b/lib/development/middlegen/middlegen-servlet-plugin-2.0-b1.jar new file mode 100644 index 0000000..fc22071 Binary files /dev/null and b/lib/development/middlegen/middlegen-servlet-plugin-2.0-b1.jar differ diff --git a/lib/development/middlegen/middlegen-struts-plugin-2.0-b1.jar b/lib/development/middlegen/middlegen-struts-plugin-2.0-b1.jar new file mode 100644 index 0000000..a69ac15 Binary files /dev/null and b/lib/development/middlegen/middlegen-struts-plugin-2.0-b1.jar differ diff --git a/lib/development/middlegen/util/CVS/Entries b/lib/development/middlegen/util/CVS/Entries new file mode 100644 index 0000000..5c6b473 --- /dev/null +++ b/lib/development/middlegen/util/CVS/Entries @@ -0,0 +1,40 @@ +/commons-collections.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/commons-logging.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/ejb.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/hsqldb.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/jdbc2_0-stdext.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/jdo.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/log4j.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/middlegen-entitybean.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/middlegen-html.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/middlegen-jdo.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/middlegen-servlet.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/middlegen-struts.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/middlegen.jar/1.1/Sat May 10 19:07:32 2003/-kb/ +/mysql-connector-java-3.0.0-beta-bin.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/postgresql.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/servlet.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/struts.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/velocity-1.3.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-apache-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-bea-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-caucho-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-ejb-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-exolab-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-hp-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-ibm-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-java-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-jboss-module.jar/1.1/Sat May 10 19:07:33 2003/-kb/ +/xdoclet-jdo-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-jmx-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-macromedia-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-mvcsoft-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-mx4j-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-objectweb-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-orion-module.jar/1.1/Sat May 10 19:07:34 2003/-kb/ +/xdoclet-pramati-module.jar/1.1/Sat May 10 19:07:35 2003/-kb/ +/xdoclet-web-module.jar/1.1/Sat May 10 19:07:35 2003/-kb/ +/xdoclet-webwork-module.jar/1.1/Sat May 10 19:07:35 2003/-kb/ +/xdoclet-xdoclet-module.jar/1.1/Sat May 10 19:07:35 2003/-kb/ +/xdoclet.jar/1.1/Sat May 10 19:07:35 2003/-kb/ +/xjavadoc.jar/1.1/Sat May 10 19:07:35 2003/-kb/ diff --git a/lib/development/middlegen/util/CVS/Repository b/lib/development/middlegen/util/CVS/Repository new file mode 100644 index 0000000..6b86871 --- /dev/null +++ b/lib/development/middlegen/util/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/middlegen/util diff --git a/lib/development/middlegen/util/CVS/Root b/lib/development/middlegen/util/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/middlegen/util/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/middlegen/util/commons-collections.jar b/lib/development/middlegen/util/commons-collections.jar new file mode 100644 index 0000000..6f2c191 Binary files /dev/null and b/lib/development/middlegen/util/commons-collections.jar differ diff --git a/lib/development/middlegen/util/commons-logging.jar b/lib/development/middlegen/util/commons-logging.jar new file mode 100644 index 0000000..c64e88c Binary files /dev/null and b/lib/development/middlegen/util/commons-logging.jar differ diff --git a/lib/development/middlegen/util/ejb.jar b/lib/development/middlegen/util/ejb.jar new file mode 100644 index 0000000..cfd4056 Binary files /dev/null and b/lib/development/middlegen/util/ejb.jar differ diff --git a/lib/development/middlegen/util/hsqldb.jar b/lib/development/middlegen/util/hsqldb.jar new file mode 100644 index 0000000..9efa7d2 Binary files /dev/null and b/lib/development/middlegen/util/hsqldb.jar differ diff --git a/lib/development/middlegen/util/jdbc2_0-stdext.jar b/lib/development/middlegen/util/jdbc2_0-stdext.jar new file mode 100644 index 0000000..ddafa13 Binary files /dev/null and b/lib/development/middlegen/util/jdbc2_0-stdext.jar differ diff --git a/lib/development/middlegen/util/jdo.jar b/lib/development/middlegen/util/jdo.jar new file mode 100644 index 0000000..d31dc30 Binary files /dev/null and b/lib/development/middlegen/util/jdo.jar differ diff --git a/lib/development/middlegen/util/log4j.jar b/lib/development/middlegen/util/log4j.jar new file mode 100644 index 0000000..dc2d758 Binary files /dev/null and b/lib/development/middlegen/util/log4j.jar differ diff --git a/lib/development/middlegen/util/middlegen-entitybean.jar b/lib/development/middlegen/util/middlegen-entitybean.jar new file mode 100644 index 0000000..bc9628a Binary files /dev/null and b/lib/development/middlegen/util/middlegen-entitybean.jar differ diff --git a/lib/development/middlegen/util/middlegen-html.jar b/lib/development/middlegen/util/middlegen-html.jar new file mode 100644 index 0000000..1278aa9 Binary files /dev/null and b/lib/development/middlegen/util/middlegen-html.jar differ diff --git a/lib/development/middlegen/util/middlegen-jdo.jar b/lib/development/middlegen/util/middlegen-jdo.jar new file mode 100644 index 0000000..e80fe22 Binary files /dev/null and b/lib/development/middlegen/util/middlegen-jdo.jar differ diff --git a/lib/development/middlegen/util/middlegen-servlet.jar b/lib/development/middlegen/util/middlegen-servlet.jar new file mode 100644 index 0000000..5d44995 Binary files /dev/null and b/lib/development/middlegen/util/middlegen-servlet.jar differ diff --git a/lib/development/middlegen/util/middlegen-struts.jar b/lib/development/middlegen/util/middlegen-struts.jar new file mode 100644 index 0000000..5e31f74 Binary files /dev/null and b/lib/development/middlegen/util/middlegen-struts.jar differ diff --git a/lib/development/middlegen/util/middlegen.jar b/lib/development/middlegen/util/middlegen.jar new file mode 100644 index 0000000..ad1535e Binary files /dev/null and b/lib/development/middlegen/util/middlegen.jar differ diff --git a/lib/development/middlegen/util/mysql-connector-java-3.0.0-beta-bin.jar b/lib/development/middlegen/util/mysql-connector-java-3.0.0-beta-bin.jar new file mode 100644 index 0000000..f090d97 Binary files /dev/null and b/lib/development/middlegen/util/mysql-connector-java-3.0.0-beta-bin.jar differ diff --git a/lib/development/middlegen/util/postgresql.jar b/lib/development/middlegen/util/postgresql.jar new file mode 100644 index 0000000..98cd658 Binary files /dev/null and b/lib/development/middlegen/util/postgresql.jar differ diff --git a/lib/development/middlegen/util/servlet.jar b/lib/development/middlegen/util/servlet.jar new file mode 100644 index 0000000..fc2549c Binary files /dev/null and b/lib/development/middlegen/util/servlet.jar differ diff --git a/lib/development/middlegen/util/struts.jar b/lib/development/middlegen/util/struts.jar new file mode 100644 index 0000000..d8fefc4 Binary files /dev/null and b/lib/development/middlegen/util/struts.jar differ diff --git a/lib/development/middlegen/util/velocity-1.3.jar b/lib/development/middlegen/util/velocity-1.3.jar new file mode 100644 index 0000000..ad89b5d Binary files /dev/null and b/lib/development/middlegen/util/velocity-1.3.jar differ diff --git a/lib/development/middlegen/util/xdoclet-apache-module.jar b/lib/development/middlegen/util/xdoclet-apache-module.jar new file mode 100644 index 0000000..a65cd39 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-apache-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-bea-module.jar b/lib/development/middlegen/util/xdoclet-bea-module.jar new file mode 100644 index 0000000..1d0fa60 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-bea-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-caucho-module.jar b/lib/development/middlegen/util/xdoclet-caucho-module.jar new file mode 100644 index 0000000..4db380e Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-caucho-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-ejb-module.jar b/lib/development/middlegen/util/xdoclet-ejb-module.jar new file mode 100644 index 0000000..eaca325 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-ejb-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-exolab-module.jar b/lib/development/middlegen/util/xdoclet-exolab-module.jar new file mode 100644 index 0000000..a45b72a Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-exolab-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-hp-module.jar b/lib/development/middlegen/util/xdoclet-hp-module.jar new file mode 100644 index 0000000..7b20433 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-hp-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-ibm-module.jar b/lib/development/middlegen/util/xdoclet-ibm-module.jar new file mode 100644 index 0000000..c05c17e Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-ibm-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-java-module.jar b/lib/development/middlegen/util/xdoclet-java-module.jar new file mode 100644 index 0000000..9c7ca8e Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-java-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-jboss-module.jar b/lib/development/middlegen/util/xdoclet-jboss-module.jar new file mode 100644 index 0000000..cc0ae73 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-jboss-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-jdo-module.jar b/lib/development/middlegen/util/xdoclet-jdo-module.jar new file mode 100644 index 0000000..a2c7502 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-jdo-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-jmx-module.jar b/lib/development/middlegen/util/xdoclet-jmx-module.jar new file mode 100644 index 0000000..d835fa6 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-jmx-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-macromedia-module.jar b/lib/development/middlegen/util/xdoclet-macromedia-module.jar new file mode 100644 index 0000000..6665656 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-macromedia-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-mvcsoft-module.jar b/lib/development/middlegen/util/xdoclet-mvcsoft-module.jar new file mode 100644 index 0000000..038bc37 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-mvcsoft-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-mx4j-module.jar b/lib/development/middlegen/util/xdoclet-mx4j-module.jar new file mode 100644 index 0000000..861c8d8 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-mx4j-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-objectweb-module.jar b/lib/development/middlegen/util/xdoclet-objectweb-module.jar new file mode 100644 index 0000000..8113e8e Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-objectweb-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-orion-module.jar b/lib/development/middlegen/util/xdoclet-orion-module.jar new file mode 100644 index 0000000..ba91fb3 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-orion-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-pramati-module.jar b/lib/development/middlegen/util/xdoclet-pramati-module.jar new file mode 100644 index 0000000..5c575a3 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-pramati-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-web-module.jar b/lib/development/middlegen/util/xdoclet-web-module.jar new file mode 100644 index 0000000..5546f8c Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-web-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-webwork-module.jar b/lib/development/middlegen/util/xdoclet-webwork-module.jar new file mode 100644 index 0000000..8916718 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-webwork-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet-xdoclet-module.jar b/lib/development/middlegen/util/xdoclet-xdoclet-module.jar new file mode 100644 index 0000000..2d72cb1 Binary files /dev/null and b/lib/development/middlegen/util/xdoclet-xdoclet-module.jar differ diff --git a/lib/development/middlegen/util/xdoclet.jar b/lib/development/middlegen/util/xdoclet.jar new file mode 100644 index 0000000..12bb92a Binary files /dev/null and b/lib/development/middlegen/util/xdoclet.jar differ diff --git a/lib/development/middlegen/util/xjavadoc.jar b/lib/development/middlegen/util/xjavadoc.jar new file mode 100644 index 0000000..18bf2de Binary files /dev/null and b/lib/development/middlegen/util/xjavadoc.jar differ diff --git a/lib/development/xdoclet-not-used-yet/CVS/Entries b/lib/development/xdoclet-not-used-yet/CVS/Entries new file mode 100644 index 0000000..ae01896 --- /dev/null +++ b/lib/development/xdoclet-not-used-yet/CVS/Entries @@ -0,0 +1,25 @@ +/log4j.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/maven-xdoclet-plugin-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-apache-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-bea-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-borland-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-caucho-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-exolab-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-hibernate-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-hp-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-ibm-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-java-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-jdo-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-libelis-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-macromedia-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-mvcsoft-module-1.2b2.jar/1.1/Sat May 10 19:08:31 2003/-kb/ +/xdoclet-mx4j-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-objectweb-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-orion-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-pramati-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-solarmetric-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-sybase-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-tjdo-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-webwork-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-xdoclet-module-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ +/xdoclet-xjavadoc-uc-1.2b2.jar/1.1/Sat May 10 19:08:32 2003/-kb/ diff --git a/lib/development/xdoclet-not-used-yet/CVS/Repository b/lib/development/xdoclet-not-used-yet/CVS/Repository new file mode 100644 index 0000000..8f9a1af --- /dev/null +++ b/lib/development/xdoclet-not-used-yet/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/xdoclet-not-used-yet diff --git a/lib/development/xdoclet-not-used-yet/CVS/Root b/lib/development/xdoclet-not-used-yet/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/xdoclet-not-used-yet/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/xdoclet-not-used-yet/log4j.jar b/lib/development/xdoclet-not-used-yet/log4j.jar new file mode 100644 index 0000000..1595a56 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/log4j.jar differ diff --git a/lib/development/xdoclet-not-used-yet/maven-xdoclet-plugin-1.2b2.jar b/lib/development/xdoclet-not-used-yet/maven-xdoclet-plugin-1.2b2.jar new file mode 100644 index 0000000..615e0ed Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/maven-xdoclet-plugin-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-apache-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-apache-module-1.2b2.jar new file mode 100644 index 0000000..e35ea47 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-apache-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-bea-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-bea-module-1.2b2.jar new file mode 100644 index 0000000..f7e7d39 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-bea-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-borland-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-borland-module-1.2b2.jar new file mode 100644 index 0000000..122e126 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-borland-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-caucho-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-caucho-module-1.2b2.jar new file mode 100644 index 0000000..2ba08bd Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-caucho-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-exolab-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-exolab-module-1.2b2.jar new file mode 100644 index 0000000..60f201a Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-exolab-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-hibernate-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-hibernate-module-1.2b2.jar new file mode 100644 index 0000000..2cca8ce Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-hibernate-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-hp-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-hp-module-1.2b2.jar new file mode 100644 index 0000000..0e41c28 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-hp-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-ibm-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-ibm-module-1.2b2.jar new file mode 100644 index 0000000..15fe849 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-ibm-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-java-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-java-module-1.2b2.jar new file mode 100644 index 0000000..8c2e2a7 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-java-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-jdo-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-jdo-module-1.2b2.jar new file mode 100644 index 0000000..25a44af Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-jdo-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-libelis-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-libelis-module-1.2b2.jar new file mode 100644 index 0000000..a729994 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-libelis-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-macromedia-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-macromedia-module-1.2b2.jar new file mode 100644 index 0000000..40c08b8 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-macromedia-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-mvcsoft-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-mvcsoft-module-1.2b2.jar new file mode 100644 index 0000000..bea0ba5 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-mvcsoft-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-mx4j-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-mx4j-module-1.2b2.jar new file mode 100644 index 0000000..6883760 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-mx4j-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-objectweb-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-objectweb-module-1.2b2.jar new file mode 100644 index 0000000..68b05f8 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-objectweb-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-orion-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-orion-module-1.2b2.jar new file mode 100644 index 0000000..96d4bc7 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-orion-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-pramati-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-pramati-module-1.2b2.jar new file mode 100644 index 0000000..c9804aa Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-pramati-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-solarmetric-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-solarmetric-module-1.2b2.jar new file mode 100644 index 0000000..4f20250 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-solarmetric-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-sybase-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-sybase-module-1.2b2.jar new file mode 100644 index 0000000..b773986 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-sybase-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-tjdo-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-tjdo-module-1.2b2.jar new file mode 100644 index 0000000..0922b6d Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-tjdo-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-webwork-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-webwork-module-1.2b2.jar new file mode 100644 index 0000000..c1d5f28 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-webwork-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-xdoclet-module-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-xdoclet-module-1.2b2.jar new file mode 100644 index 0000000..d44fc81 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-xdoclet-module-1.2b2.jar differ diff --git a/lib/development/xdoclet-not-used-yet/xdoclet-xjavadoc-uc-1.2b2.jar b/lib/development/xdoclet-not-used-yet/xdoclet-xjavadoc-uc-1.2b2.jar new file mode 100644 index 0000000..1bb2728 Binary files /dev/null and b/lib/development/xdoclet-not-used-yet/xdoclet-xjavadoc-uc-1.2b2.jar differ diff --git a/lib/development/xdoclet/CVS/Entries b/lib/development/xdoclet/CVS/Entries new file mode 100644 index 0000000..07105e4 --- /dev/null +++ b/lib/development/xdoclet/CVS/Entries @@ -0,0 +1,11 @@ +/commons-collections-2.0.jar/1.1/Sat May 10 19:07:58 2003/-kb/ +/commons-logging.jar/1.1/Sat May 10 19:07:58 2003/-kb/ +/xdoclet-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xdoclet-apache-module-1.2.jar/1.1/Sat Dec 20 07:24:48 2003/-kb/ +/xdoclet-ejb-module-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xdoclet-java-module-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xdoclet-jboss-module-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xdoclet-jmx-module-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xdoclet-web-module-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xdoclet-xdoclet-module-1.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ +/xjavadoc-1.0.2.jar/1.1/Sat Jan 3 18:27:18 2004/-kb/ diff --git a/lib/development/xdoclet/CVS/Repository b/lib/development/xdoclet/CVS/Repository new file mode 100644 index 0000000..45f4190 --- /dev/null +++ b/lib/development/xdoclet/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/development/xdoclet diff --git a/lib/development/xdoclet/CVS/Root b/lib/development/xdoclet/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/development/xdoclet/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/development/xdoclet/commons-collections-2.0.jar b/lib/development/xdoclet/commons-collections-2.0.jar new file mode 100644 index 0000000..4f4f97b Binary files /dev/null and b/lib/development/xdoclet/commons-collections-2.0.jar differ diff --git a/lib/development/xdoclet/commons-logging.jar b/lib/development/xdoclet/commons-logging.jar new file mode 100644 index 0000000..aca1e41 Binary files /dev/null and b/lib/development/xdoclet/commons-logging.jar differ diff --git a/lib/development/xdoclet/xdoclet-1.2.jar b/lib/development/xdoclet/xdoclet-1.2.jar new file mode 100644 index 0000000..f681c35 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-apache-module-1.2.jar b/lib/development/xdoclet/xdoclet-apache-module-1.2.jar new file mode 100644 index 0000000..654d0ea Binary files /dev/null and b/lib/development/xdoclet/xdoclet-apache-module-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-ejb-module-1.2.jar b/lib/development/xdoclet/xdoclet-ejb-module-1.2.jar new file mode 100644 index 0000000..c5cf7d3 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-ejb-module-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-java-module-1.2.jar b/lib/development/xdoclet/xdoclet-java-module-1.2.jar new file mode 100644 index 0000000..0230e72 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-java-module-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-jboss-module-1.2.jar b/lib/development/xdoclet/xdoclet-jboss-module-1.2.jar new file mode 100644 index 0000000..e5196a4 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-jboss-module-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-jmx-module-1.2.jar b/lib/development/xdoclet/xdoclet-jmx-module-1.2.jar new file mode 100644 index 0000000..653d980 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-jmx-module-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-web-module-1.2.jar b/lib/development/xdoclet/xdoclet-web-module-1.2.jar new file mode 100644 index 0000000..d2b24c9 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-web-module-1.2.jar differ diff --git a/lib/development/xdoclet/xdoclet-xdoclet-module-1.2.jar b/lib/development/xdoclet/xdoclet-xdoclet-module-1.2.jar new file mode 100644 index 0000000..2f06d09 Binary files /dev/null and b/lib/development/xdoclet/xdoclet-xdoclet-module-1.2.jar differ diff --git a/lib/development/xdoclet/xjavadoc-1.0.2.jar b/lib/development/xdoclet/xjavadoc-1.0.2.jar new file mode 100644 index 0000000..560294f Binary files /dev/null and b/lib/development/xdoclet/xjavadoc-1.0.2.jar differ diff --git a/lib/dtdparser.jar b/lib/dtdparser.jar new file mode 100644 index 0000000..fdb85a4 Binary files /dev/null and b/lib/dtdparser.jar differ diff --git a/lib/exml.jar b/lib/exml.jar new file mode 100644 index 0000000..53e4b34 Binary files /dev/null and b/lib/exml.jar differ diff --git a/lib/jface/CVS/Entries b/lib/jface/CVS/Entries new file mode 100644 index 0000000..f88c1ca --- /dev/null +++ b/lib/jface/CVS/Entries @@ -0,0 +1,6 @@ +/boot.jar/1.1/Wed Aug 6 05:17:40 2003/-kb/ +/compare.jar/1.1/Mon Aug 11 06:26:42 2003/-kb/ +/jface.jar/1.1/Wed Aug 6 05:17:41 2003/-kb/ +/resources.jar/1.1/Fri Aug 8 17:52:38 2003/-kb/ +/runtime.jar/1.1/Wed Aug 6 05:17:40 2003/-kb/ +/workbench.jar/1.1/Wed Aug 6 05:17:41 2003/-kb/ diff --git a/lib/jface/CVS/Repository b/lib/jface/CVS/Repository new file mode 100644 index 0000000..d37ea2f --- /dev/null +++ b/lib/jface/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/jface diff --git a/lib/jface/CVS/Root b/lib/jface/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/jface/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/jface/boot.jar b/lib/jface/boot.jar new file mode 100644 index 0000000..d59f56f Binary files /dev/null and b/lib/jface/boot.jar differ diff --git a/lib/jface/compare.jar b/lib/jface/compare.jar new file mode 100644 index 0000000..9f416fc Binary files /dev/null and b/lib/jface/compare.jar differ diff --git a/lib/jface/jface.jar b/lib/jface/jface.jar new file mode 100644 index 0000000..713bb6e Binary files /dev/null and b/lib/jface/jface.jar differ diff --git a/lib/jface/resources.jar b/lib/jface/resources.jar new file mode 100644 index 0000000..c75446e Binary files /dev/null and b/lib/jface/resources.jar differ diff --git a/lib/jface/runtime.jar b/lib/jface/runtime.jar new file mode 100644 index 0000000..8cd8dcb Binary files /dev/null and b/lib/jface/runtime.jar differ diff --git a/lib/jface/workbench.jar b/lib/jface/workbench.jar new file mode 100644 index 0000000..83fd3f1 Binary files /dev/null and b/lib/jface/workbench.jar differ diff --git a/lib/junit.jar b/lib/junit.jar new file mode 100644 index 0000000..674d71e Binary files /dev/null and b/lib/junit.jar differ diff --git a/lib/log4j.jar b/lib/log4j.jar new file mode 100644 index 0000000..1607ce4 Binary files /dev/null and b/lib/log4j.jar differ diff --git a/lib/read-me.txt b/lib/read-me.txt new file mode 100644 index 0000000..0603250 --- /dev/null +++ b/lib/read-me.txt @@ -0,0 +1,5 @@ +Directory: lib +Contents: location of all runtime libraries + +commons-validator.jar in this directory is version 1.0.2 +commons-validator.jar in struts directory is an older version \ No newline at end of file diff --git a/lib/struts/CVS/Entries b/lib/struts/CVS/Entries new file mode 100644 index 0000000..d4030cf --- /dev/null +++ b/lib/struts/CVS/Entries @@ -0,0 +1,11 @@ +/commons-beanutils.jar/1.1/Mon Jul 7 16:16:39 2003/-kb/ +/commons-collections.jar/1.1/Mon Jul 7 16:16:39 2003/-kb/ +/commons-digester.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ +/commons-fileupload.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ +/commons-lang.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ +/commons-logging.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ +/commons-validator.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ +/jakarta-oro.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ +/jstl.jar/1.1/Sun Jul 13 22:04:35 2003/-kb/ +/standard.jar/1.1/Sun Jul 13 22:04:58 2003/-kb/ +/struts.jar/1.1/Mon Jul 7 16:16:38 2003/-kb/ diff --git a/lib/struts/CVS/Repository b/lib/struts/CVS/Repository new file mode 100644 index 0000000..94b4a7c --- /dev/null +++ b/lib/struts/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/struts diff --git a/lib/struts/CVS/Root b/lib/struts/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/struts/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/struts/commons-beanutils.jar b/lib/struts/commons-beanutils.jar new file mode 100644 index 0000000..795655a Binary files /dev/null and b/lib/struts/commons-beanutils.jar differ diff --git a/lib/struts/commons-collections.jar b/lib/struts/commons-collections.jar new file mode 100644 index 0000000..f66c6d2 Binary files /dev/null and b/lib/struts/commons-collections.jar differ diff --git a/lib/struts/commons-digester.jar b/lib/struts/commons-digester.jar new file mode 100644 index 0000000..c2a7d9d Binary files /dev/null and b/lib/struts/commons-digester.jar differ diff --git a/lib/struts/commons-fileupload.jar b/lib/struts/commons-fileupload.jar new file mode 100644 index 0000000..1ca4a9c Binary files /dev/null and b/lib/struts/commons-fileupload.jar differ diff --git a/lib/struts/commons-lang.jar b/lib/struts/commons-lang.jar new file mode 100644 index 0000000..37ddb9b Binary files /dev/null and b/lib/struts/commons-lang.jar differ diff --git a/lib/struts/commons-logging.jar b/lib/struts/commons-logging.jar new file mode 100644 index 0000000..b99c937 Binary files /dev/null and b/lib/struts/commons-logging.jar differ diff --git a/lib/struts/commons-validator.jar b/lib/struts/commons-validator.jar new file mode 100644 index 0000000..096a7f4 Binary files /dev/null and b/lib/struts/commons-validator.jar differ diff --git a/lib/struts/jakarta-oro.jar b/lib/struts/jakarta-oro.jar new file mode 100644 index 0000000..346504c Binary files /dev/null and b/lib/struts/jakarta-oro.jar differ diff --git a/lib/struts/jstl.jar b/lib/struts/jstl.jar new file mode 100644 index 0000000..6d02845 Binary files /dev/null and b/lib/struts/jstl.jar differ diff --git a/lib/struts/standard.jar b/lib/struts/standard.jar new file mode 100644 index 0000000..f457646 Binary files /dev/null and b/lib/struts/standard.jar differ diff --git a/lib/struts/struts.jar b/lib/struts/struts.jar new file mode 100644 index 0000000..db32f9f Binary files /dev/null and b/lib/struts/struts.jar differ diff --git a/lib/swt/CVS/Entries b/lib/swt/CVS/Entries new file mode 100644 index 0000000..d85ae62 --- /dev/null +++ b/lib/swt/CVS/Entries @@ -0,0 +1,2 @@ +/swt-win32-2135.dll/1.1/Mon Aug 4 03:49:30 2003/-kb/ +/swt.jar/1.1/Mon Aug 4 03:49:31 2003/-kb/ diff --git a/lib/swt/CVS/Repository b/lib/swt/CVS/Repository new file mode 100644 index 0000000..d86864a --- /dev/null +++ b/lib/swt/CVS/Repository @@ -0,0 +1 @@ +tcms/lib/swt diff --git a/lib/swt/CVS/Root b/lib/swt/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/lib/swt/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/lib/swt/swt-win32-2135.dll b/lib/swt/swt-win32-2135.dll new file mode 100644 index 0000000..901253b Binary files /dev/null and b/lib/swt/swt-win32-2135.dll differ diff --git a/lib/swt/swt.jar b/lib/swt/swt.jar new file mode 100644 index 0000000..72d2400 Binary files /dev/null and b/lib/swt/swt.jar differ diff --git a/project.xml b/project.xml new file mode 100644 index 0000000..b7c0714 --- /dev/null +++ b/project.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/read-me.txt b/read-me.txt new file mode 100644 index 0000000..0702561 --- /dev/null +++ b/read-me.txt @@ -0,0 +1,3 @@ +ant db-setup-middlegen +ant db-setup-runtime +ant \ No newline at end of file diff --git a/server-config.wsdd b/server-config.wsdd new file mode 100644 index 0000000..58e4944 --- /dev/null +++ b/server-config.wsdd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://xml.apache.org/axis/wsdd/ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/setup/CVS/Entries b/setup/CVS/Entries new file mode 100644 index 0000000..38b7f9a --- /dev/null +++ b/setup/CVS/Entries @@ -0,0 +1,3 @@ +D/app-server//// +D/db//// +/read-me.txt/1.1/Sat May 10 19:05:42 2003/-kb/ diff --git a/setup/CVS/Repository b/setup/CVS/Repository new file mode 100644 index 0000000..8799d15 --- /dev/null +++ b/setup/CVS/Repository @@ -0,0 +1 @@ +tcms/setup diff --git a/setup/CVS/Root b/setup/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/app-server/CVS/Entries b/setup/app-server/CVS/Entries new file mode 100644 index 0000000..f349153 --- /dev/null +++ b/setup/app-server/CVS/Entries @@ -0,0 +1 @@ +D/jboss//// diff --git a/setup/app-server/CVS/Repository b/setup/app-server/CVS/Repository new file mode 100644 index 0000000..1e2808f --- /dev/null +++ b/setup/app-server/CVS/Repository @@ -0,0 +1 @@ +tcms/setup/app-server diff --git a/setup/app-server/CVS/Root b/setup/app-server/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/app-server/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/app-server/jboss/CVS/Entries b/setup/app-server/jboss/CVS/Entries new file mode 100644 index 0000000..4828b69 --- /dev/null +++ b/setup/app-server/jboss/CVS/Entries @@ -0,0 +1,2 @@ +D/hsqldb//// +D/jms//// diff --git a/setup/app-server/jboss/CVS/Repository b/setup/app-server/jboss/CVS/Repository new file mode 100644 index 0000000..76e61d1 --- /dev/null +++ b/setup/app-server/jboss/CVS/Repository @@ -0,0 +1 @@ +tcms/setup/app-server/jboss diff --git a/setup/app-server/jboss/CVS/Root b/setup/app-server/jboss/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/app-server/jboss/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/app-server/jboss/hsqldb/CVS/Entries b/setup/app-server/jboss/hsqldb/CVS/Entries new file mode 100644 index 0000000..0ce3655 --- /dev/null +++ b/setup/app-server/jboss/hsqldb/CVS/Entries @@ -0,0 +1 @@ +/hsqldb-ds.xml/1.1/Wed Aug 20 14:49:11 2003// diff --git a/setup/app-server/jboss/hsqldb/CVS/Repository b/setup/app-server/jboss/hsqldb/CVS/Repository new file mode 100644 index 0000000..2e0d0d4 --- /dev/null +++ b/setup/app-server/jboss/hsqldb/CVS/Repository @@ -0,0 +1 @@ +tcms/setup/app-server/jboss/hsqldb diff --git a/setup/app-server/jboss/hsqldb/CVS/Root b/setup/app-server/jboss/hsqldb/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/app-server/jboss/hsqldb/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/app-server/jboss/hsqldb/hsqldb-ds.xml b/setup/app-server/jboss/hsqldb/hsqldb-ds.xml new file mode 100644 index 0000000..311c60a --- /dev/null +++ b/setup/app-server/jboss/hsqldb/hsqldb-ds.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + jboss:service=Hypersonic + DefaultDS + + jdbc:hsqldb:hsql://localhost:1701 + + + + + org.hsqldb.jdbcDriver + sa + + + + + + + + + + 5 + HsqlDbRealm + + + + + jboss:service=Hypersonic2 + tcmsDS + + jdbc:hsqldb:hsql://localhost:1476 + + + + + org.hsqldb.jdbcDriver + sa + + + + + + + + + + 5 + HsqlDbRealm + + + + + 1701 + true + default + false + true + + + + 1476 + true + default + false + true + + diff --git a/setup/app-server/jboss/jms/CVS/Entries b/setup/app-server/jboss/jms/CVS/Entries new file mode 100644 index 0000000..87f4282 --- /dev/null +++ b/setup/app-server/jboss/jms/CVS/Entries @@ -0,0 +1 @@ +/jbossmq-destinations-service.xml/1.1/Fri Aug 22 16:49:41 2003// diff --git a/setup/app-server/jboss/jms/CVS/Repository b/setup/app-server/jboss/jms/CVS/Repository new file mode 100644 index 0000000..0103bd0 --- /dev/null +++ b/setup/app-server/jboss/jms/CVS/Repository @@ -0,0 +1 @@ +tcms/setup/app-server/jboss/jms diff --git a/setup/app-server/jboss/jms/CVS/Root b/setup/app-server/jboss/jms/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/app-server/jboss/jms/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/app-server/jboss/jms/jbossmq-destinations-service.xml b/setup/app-server/jboss/jms/jbossmq-destinations-service.xml new file mode 100644 index 0000000..1016750 --- /dev/null +++ b/setup/app-server/jboss/jms/jbossmq-destinations-service.xml @@ -0,0 +1,97 @@ + + + + + + + + + + jboss.mq:service=DestinationManager + jboss.mq:service=SecurityManager + + + + + + + + + + + jboss.mq:service=DestinationManager + jboss.mq:service=SecurityManager + + + + + + + + + jboss.mq:service=DestinationManager + jboss.mq:service=SecurityManager + + + + + + + + + + + jboss.mq:service=DestinationManager + jboss.mq:service=SecurityManager + + + + + + + + + + jboss.mq:service=DestinationManager + + + jboss.mq:service=DestinationManager + + + jboss.mq:service=DestinationManager + + + jboss.mq:service=DestinationManager + + + jboss.mq:service=DestinationManager + + + + + queue/mail + jboss.mq:service=DestinationManager + + + + diff --git a/setup/db/CVS/Entries b/setup/db/CVS/Entries new file mode 100644 index 0000000..e191648 --- /dev/null +++ b/setup/db/CVS/Entries @@ -0,0 +1 @@ +D/hsqldb//// diff --git a/setup/db/CVS/Repository b/setup/db/CVS/Repository new file mode 100644 index 0000000..3917e23 --- /dev/null +++ b/setup/db/CVS/Repository @@ -0,0 +1 @@ +tcms/setup/db diff --git a/setup/db/CVS/Root b/setup/db/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/db/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/db/hsqldb/CVS/Entries b/setup/db/hsqldb/CVS/Entries new file mode 100644 index 0000000..f9bc172 --- /dev/null +++ b/setup/db/hsqldb/CVS/Entries @@ -0,0 +1,3 @@ +/tcms-create.sql/1.3/Tue Dec 30 23:16:49 2003/-kb/ +/tcms-drop.sql/1.4/Tue Dec 30 23:16:53 2003/-kb/ +/tcms-populate.sql/1.7/Fri Aug 22 05:43:17 2003/-kb/ diff --git a/setup/db/hsqldb/CVS/Repository b/setup/db/hsqldb/CVS/Repository new file mode 100644 index 0000000..744ca2f --- /dev/null +++ b/setup/db/hsqldb/CVS/Repository @@ -0,0 +1 @@ +tcms/setup/db/hsqldb diff --git a/setup/db/hsqldb/CVS/Root b/setup/db/hsqldb/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/setup/db/hsqldb/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/setup/db/hsqldb/tcms-create.sql b/setup/db/hsqldb/tcms-create.sql new file mode 100644 index 0000000..78f8bd5 --- /dev/null +++ b/setup/db/hsqldb/tcms-create.sql @@ -0,0 +1,219 @@ +CREATE TABLE Addresses ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + StreetAddress VARCHAR(64), + AptNumber VARCHAR(32), + City VARCHAR(32), + State CHAR(2), + ZipCode VARCHAR(10) +); + +CREATE TABLE Venues ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_AddressId INTEGER, + Name VARCHAR(32), + Phone VARCHAR(12), + Fax VARCHAR(12), + CONSTRAINT VenuesAddressesFK FOREIGN KEY(fk_AddressId) REFERENCES Addresses(pk_Id) +); + +CREATE TABLE Conferences ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Name varchar(64), + Description LONGVARCHAR, + StartDate DATETIME, + EndDate DATETIME, + AbstractSubmissionStartDate DATETIME, + AbstractSubmissionEndDate DATETIME, + fk_VenueId int, + CONSTRAINT ConferencesVenuesFK FOREIGN KEY(fk_VenueId) REFERENCES Venues(pk_Id) +); + +CREATE TABLE Tracks ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_ConferenceId INTEGER, + Title VARCHAR(32), + Subtitle VARCHAR(32), + Description LONGVARCHAR, + CONSTRAINT TracksConferencesFK FOREIGN KEY(fk_ConferenceId) REFERENCES Conferences(pk_Id) +); + +CREATE TABLE Rooms ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_VenueId INTEGER, + Name VARCHAR(32), + Notes VARCHAR(64), + Capacity INTEGER, + CONSTRAINT RoomsVenuesFK FOREIGN KEY(fk_VenueId) REFERENCES Venues(pk_Id) +); + +CREATE TABLE Booths ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_VenueId INTEGER, + Notes VARCHAR(64), + Size VARCHAR(32), + CONSTRAINT BoothsVenuesFK FOREIGN KEY(fk_VenueId) REFERENCES Venues(pk_Id) +); + +CREATE TABLE AbstractStatus ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Name VARCHAR(16) NOT NULL +); + +CREATE TABLE Users ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Password VARCHAR(16), + FirstName VARCHAR(32), + LastName VARCHAR(32), + Email VARCHAR(64), + HomePhone VARCHAR(12), + WorkPhone VARCHAR(12), + Fax VARCHAR(12), + fk_AddressId INTEGER, + CONSTRAINT UsersAddressesFK FOREIGN KEY(fk_AddressId) REFERENCES Addresses(pk_Id), + CONSTRAINT UniqueEmail UNIQUE(Email) +); + +CREATE TABLE Presenters ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_UserId INTEGER, + Company VARCHAR(64), + Bio VARCHAR(255), + CONSTRAINT PresentersUsersFK FOREIGN KEY(fk_UserId) REFERENCES Users(pk_Id), + CONSTRAINT UniqueUserIds UNIQUE(fk_UserId) +); + +CREATE TABLE Abstracts ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Title VARCHAR(64), + Type INTEGER, + Topic INTEGER, + Level INTEGER, + Body LONGVARCHAR, + Status INTEGER, + fk_PresenterId INTEGER, + CONSTRAINT PresentationsPresentersFK FOREIGN KEY(fk_PresenterId) REFERENCES Presenters(pk_Id) +); + +CREATE TABLE Attendees ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_UserId INTEGER, + CONSTRAINT PresentersUsersFK FOREIGN KEY(fk_UserId) REFERENCES Users(pk_Id), + CONSTRAINT UniqueUserIds UNIQUE(fk_UserId) +); + +CREATE TABLE PresentationTypes ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Name VARCHAR(16) NOT NULL, + Description VARCHAR(64) +); + +CREATE TABLE PresentationLevels ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Name VARCHAR(16) NOT NULL, + Description VARCHAR(64) +); + +CREATE TABLE PresentationTopics ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Name VARCHAR(16) NOT NULL, + Description VARCHAR(64) +); + +CREATE TABLE Presentations ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_AbstractId INTEGER, + CONSTRAINT PresentationsAbstractsFK FOREIGN KEY(fk_AbstractId) REFERENCES Abstracts(pk_Id) +); + +CREATE TABLE Sessions ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_PresentationId INTEGER, + fk_RoomId INTEGER, + DateTimeBegin DATETIME, + DateTimeEnd DATETIME, + CONSTRAINT SessionsPresentationsFK FOREIGN KEY(fk_PresentationId) REFERENCES Presentations(pk_Id), + CONSTRAINT SessionsRoomsFK FOREIGN KEY(fk_RoomId) REFERENCES Rooms(pk_Id) +); + +CREATE TABLE ScheduleEntries ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Name VARCHAR(64), + Description VARCHAR(32), + fk_SessionId INTEGER, + fk_UserId INTEGER, + CONSTRAINT ScheduleEntriesSessionsFK FOREIGN KEY(fk_SessionId) REFERENCES Sessions(pk_Id), + CONSTRAINT ScheduleEntriesUsersFK FOREIGN KEY(fk_UserId) REFERENCES Users(pk_Id) +); + +CREATE TABLE Roles ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + RoleName VARCHAR(16) NOT NULL, + Description VARCHAR(64) +); + +CREATE TABLE UserRoles ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_UserId INTEGER, + fk_Role INTEGER, + CONSTRAINT UserRolesUsersFK FOREIGN KEY(fk_UserId) REFERENCES Users(pk_Id) +); + +CREATE TABLE Reminders ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_ScheduleEntryId INTEGER, + fk_UserId INTEGER, + Message VARCHAR(64), + DateAndTime DATETIME NOT NULL, + CONSTRAINT RemindersScheduleEntriesFK FOREIGN KEY(fk_ScheduleEntryId) REFERENCES ScheduleEntries(pk_Id), + CONSTRAINT RemindersUsersFK FOREIGN KEY(fk_UserId) REFERENCES Users(pk_Id) +); + +CREATE TABLE RegistrationDatePricingRules ( + pk_PricingModel VARCHAR(16) NOT NULL PRIMARY KEY, + StartDate DATETIME NOT NULL, + EndDate DATETIME NOT NULL, + Price DOUBLE NOT NULL +); + +CREATE TABLE GroupPricingRules ( + pk_RuleName VARCHAR(16) NOT NULL PRIMARY KEY, + MinimumAttendees INTEGER, + MaximumAttendees INTEGER, + DiscountPerAttendee DOUBLE +); + +CREATE TABLE Questions ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + QuestionText LONGVARCHAR, + QuestionType INTEGER NOT NULL, + QuestionChoices LONGVARCHAR +); + +CREATE TABLE Questionnaires ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_QuestionId INTEGER NOT NULL, + fk_PresentationId INTEGER NOT NULL, + CONSTRAINT QuestionnairesQuestionsFK FOREIGN KEY(fk_QuestionId) REFERENCES Questions(pk_Id), + CONSTRAINT QuestionnairesPresentationsFK FOREIGN KEY(fk_PresentationId) REFERENCES Presentations(pk_Id) +); + +CREATE TABLE Answers ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + fk_UserId INTEGER NOT NULL, + fk_QuestionnaireId INTEGER NOT NULL, + CONSTRAINT AnswersUsersFK FOREIGN KEY(fk_UserId) REFERENCES Users(pk_Id), + CONSTRAINT AnswersQuestionnairesFK FOREIGN KEY(fk_QuestionnaireId) REFERENCES Questionnaires(pk_Id) +); + +CREATE TABLE News ( + pk_Id INTEGER NOT NULL PRIMARY KEY, + Date DATETIME NOT NULL, + RemoveDate DATETIME NOT NULL, + CreationDate DATETIME NOT NULL, + Published BIT NOT NULL, + Title VARCHAR(32), + Body LONGVARCHAR +); + + + diff --git a/setup/db/hsqldb/tcms-drop.sql b/setup/db/hsqldb/tcms-drop.sql new file mode 100644 index 0000000..2eb672c --- /dev/null +++ b/setup/db/hsqldb/tcms-drop.sql @@ -0,0 +1,30 @@ +DROP TABLE Answers; +DROP TABLE Questionnaires +DROP TABLE Questions; +DROP TABLE GroupPricingRules; +DROP TABLE RegistrationDatePricingRules; +DROP TABLE Reminders; +DROP TABLE UserRoles; +DROP TABLE Roles; +DROP TABLE ScheduleEntries; +DROP TABLE Sessions; +DROP TABLE Presentations; +DROP TABLE PresentationTopics; +DROP TABLE PresentationLevels; +DROP TABLE PresentationTypes; +DROP TABLE Attendees; +DROP TABLE Abstracts; +DROP TABLE Presenters; +DROP TABLE Users; +DROP TABLE AbstractStatus; +DROP TABLE Booths; +DROP TABLE Rooms; +DROP TABLE Tracks; +DROP TABLE Conferences; +DROP TABLE Venues; +DROP TABLE Addresses; +DROP TABLE News; + +-- Middlegen Sequence Block Pattern Table +-- Never drop an autogenerated table just clean it +DELETE FROM SEQ_BLOCK; \ No newline at end of file diff --git a/setup/db/hsqldb/tcms-populate.sql b/setup/db/hsqldb/tcms-populate.sql new file mode 100644 index 0000000..c26d7d8 --- /dev/null +++ b/setup/db/hsqldb/tcms-populate.sql @@ -0,0 +1,224 @@ +-- Cleanup +DELETE FROM Answers; +DELETE FROM Questionnaires +DELETE FROM Questions; +DELETE FROM RegistrationDatePricingRules; +DELETE FROM GroupPricingRules; +DELETE FROM Reminders; +DELETE FROM UserRoles; +DELETE FROM Roles; +DELETE FROM ScheduleEntries; +DELETE FROM Sessions; +DELETE FROM Presentations; +DELETE FROM PresentationTopics; +DELETE FROM PresentationLevels; +DELETE FROM PresentationTypes; +DELETE FROM Attendees; +DELETE FROM Presenters; +DELETE FROM Users; +DELETE FROM Abstracts; +DELETE FROM AbstractStatus; +DELETE FROM Booths; +DELETE FROM Rooms; +DELETE FROM Tracks; +DELETE FROM Conferences; +DELETE FROM Venues; +DELETE FROM Addresses; +DELETE FROM News; + +-- Populate +INSERT INTO Addresses ( pk_Id, StreetAddress, City, State, ZipCode ) + VALUES( 0, '747 Howard Street', 'San Francisco', 'CA', '94103' ); +INSERT INTO Addresses ( pk_Id, StreetAddress, City, State, ZipCode ) + VALUES( 1, '204 Bluestone Ct.', 'Westerville', 'OH', '43081' ); +INSERT INTO Addresses ( pk_Id, StreetAddress, City, State, ZipCode ) + VALUES( 2, '685 Farrington Drive', 'Worthington', 'OH', '43085' ); +INSERT INTO Addresses ( pk_Id, StreetAddress, City, State, ZipCode ) + VALUES( 3, '204 Bluestone Ct.', 'Westerville', 'OH', '43081' ); +INSERT INTO Addresses ( pk_Id, StreetAddress, City, State, ZipCode ) + VALUES( 4, '685 Farrington Drive', 'Worthington', 'OH', '43085' ); + +INSERT INTO Venues ( pk_Id, fk_AddressId, Name, Phone, Fax ) + VALUES ( 0, 0, 'The Moscone Center', '415.974.4000', '415.974.4073' ); + +INSERT INTO Conferences ( pk_Id, Name, fk_VenueId ) + VALUES ( 0, 'Open Source Java Conference', 0 ); + +INSERT INTO Tracks ( pk_Id, fk_ConferenceId, Title, Subtitle, Description ) + VALUES ( 0, 0, 'J2SE', 'The Java 2 Standard Edition', ''); +INSERT INTO Tracks ( pk_Id, fk_ConferenceId, Title, Subtitle, Description ) + VALUES ( 1, 0, 'J2EE', 'The Java 2 Enterprise Edition', ''); +INSERT INTO Tracks ( pk_Id, fk_ConferenceId, Title, Subtitle, Description ) + VALUES ( 2, 0, 'J2ME', 'The Java 2 Micro Edition', ''); +INSERT INTO Tracks ( pk_Id, fk_ConferenceId, Title, Subtitle, Description ) + VALUES ( 3, 0, 'JINI', 'The Jini Network Technology', ''); + +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 0, 0, 'Blue Room', '', 250 ); +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 1, 0, 'Red Room', '', 40 ); +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 2, 0, 'Yellow Room', '', 25 ); +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 3, 0, 'Pink Room', '', 150 ); +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 4, 0, 'Brown Room', '', 200 ); +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 5, 0, 'Green Room', '', 225 ); +INSERT INTO Rooms ( pk_Id, fk_VenueId, Name, Notes, Capacity ) + VALUES ( 6, 0, 'Purple Room', '', 100 ); + +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 0, 0, '', '10x10' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 1, 0, '', '12x18' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 2, 0, '', '12x18' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 3, 0, '', '10x10' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 4, 0, '', '10x20' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 5, 0, '', '8x10' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 6, 0, '', '10x10' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 7, 0, '', '8x10' ); +INSERT INTO Booths ( pk_Id, fk_VenueId, Notes, Size ) VALUES ( 8, 0, '', '8x10' ); + +INSERT INTO AbstractStatus ( pk_Id, Name ) VALUES ( 0, 'IN-REVIEW' ); +INSERT INTO AbstractStatus ( pk_Id, Name ) VALUES ( 1, 'ACCEPTED' ); +INSERT INTO AbstractStatus ( pk_Id, Name ) VALUES ( 2, 'REJECTED' ); + +INSERT INTO Users + ( pk_Id, Password, FirstName, LastName, Email, HomePhone, WorkPhone, Fax, fk_AddressId ) +VALUES + ( 0, 'pswd', 'Anne', 'Sam', 'aks@isllc.com', '555.5777', '555.5919', '', 1 ); + +INSERT INTO Users + ( pk_Id, Password, FirstName, LastName, Email, HomePhone, WorkPhone, Fax, fk_AddressId ) VALUES + ( 1, 'pswd', 'Sue', 'Judd', 'sjudd@jsllc.com', '555.4119', '555.4119', '', 2 ); + +INSERT INTO Users + ( pk_Id, Password, FirstName, LastName, Email, HomePhone, WorkPhone, Fax, fk_AddressId ) VALUES + ( 2, 'pswd', 'Brian', 'Sam-Bodden', 'bsb@isllc.com', '555.0154', '', '', 3 ); + +INSERT INTO Users + ( pk_Id, Password, FirstName, LastName, Email, HomePhone, WorkPhone, Fax, fk_AddressId ) VALUES + ( 3, 'pswd', 'Christopher', 'Judd', 'cjudd@js.com', '555.4119', '555.4119', '', 4 ); + +INSERT INTO Presenters ( pk_Id, fk_UserId, Company, Bio) VALUES (0, 2, 'Integrallis Software, LLC.', 'Brian knows Java'); +INSERT INTO Presenters ( pk_Id, fk_UserId, Company, Bio) VALUES (1, 3, 'Judd Solutions, LLC.', 'Chris also knows Java'); + +INSERT INTO Attendees ( pk_Id, fk_UserId ) VALUES ( 0, 0 ); +INSERT INTO Attendees ( pk_Id, fk_UserId ) VALUES ( 1, 1 ); + +INSERT INTO PresentationTypes ( pk_Id, Name, Description ) + VALUES ( 0, 'REGULAR', 'Regular Session' ); +INSERT INTO PresentationTypes ( pk_Id, Name, Description ) + VALUES ( 1, 'TUTORIAL', 'Preconference Tutorial' ); +INSERT INTO PresentationTypes ( pk_Id, Name, Description ) + VALUES ( 2, 'PANEL', 'Panel Discussion' ); +INSERT INTO PresentationTypes ( pk_Id, Name, Description ) + VALUES ( 3, 'CASE', 'Case Study' ); +INSERT INTO PresentationTypes ( pk_Id, Name, Description ) + VALUES ( 4, 'KEYNOTE', 'Keynote' ); +INSERT INTO PresentationTypes ( pk_Id, Name, Description ) + VALUES ( 5, 'BOF', 'Birds of a Feather' ); + +INSERT INTO PresentationLevels ( pk_Id, Name, Description ) + VALUES ( 0, 'Beginner', 'For Greenhorns' ); +INSERT INTO PresentationLevels ( pk_Id, Name, Description ) + VALUES ( 1, 'Intermediate', 'For those who make a living out of it' ); +INSERT INTO PresentationLevels ( pk_Id, Name, Description ) + VALUES ( 2, 'Advanced', 'For Gurus' ); + +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 0, 'Performance', '' ); +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 1, 'Profiling', '' ); +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 2, 'Testing', '' ); +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 3, 'Design', '' ); +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 4, 'Productivity', '' ); +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 5, 'Management', '' ); +INSERT INTO PresentationTopics ( pk_Id, Name, Description ) VALUES ( 6, 'Development', '' ); + + +INSERT INTO Roles ( pk_Id, RoleName, Description ) VALUES ( 0, 'ATTENDEE', 'Attendees' ); +INSERT INTO Roles ( pk_Id, RoleName, Description ) VALUES ( 1, 'PRESENTER', 'Presenters' ); + +INSERT INTO UserRoles ( pk_Id, fk_UserId, fk_Role ) VALUES ( 0, 0, 0 ); +INSERT INTO UserRoles ( pk_Id, fk_UserId, fk_Role ) VALUES ( 1, 1, 0 ); +INSERT INTO UserRoles ( pk_Id, fk_UserId, fk_Role ) VALUES ( 2, 2, 1 ); +INSERT INTO UserRoles ( pk_Id, fk_UserId, fk_Role ) VALUES ( 3, 3, 1 ); + +-- sqldb format 'yyyy-mm-dd hh:mm:ss.fffffffff' +INSERT INTO RegistrationDatePricingRules ( pk_PricingModel, StartDate, EndDate, Price ) VALUES ( 'Early Bird', '2004-01-01 00:00:00.000000000', '2004-02-01 00:00:00.000000000', '1850.00'); + +INSERT INTO RegistrationDatePricingRules ( pk_PricingModel, StartDate, EndDate, Price ) VALUES ( 'Pre-Registration', '2004-02-02 00:00:00.000000000', '2004-03-01 00:00:00.000000000', '1975.00'); + +INSERT INTO RegistrationDatePricingRules ( pk_PricingModel, StartDate, EndDate, Price ) VALUES ( 'On-site', '2004-03-02 00:00:00.000000000', '2004-04-01 00:00:00.000000000', '2000.00' ); + +INSERT INTO GroupPricingRules + ( pk_RuleName, MinimumAttendees, MaximumAttendees, DiscountPerAttendee ) + VALUES ('5to10', 5, 10, '50.00' ); +INSERT INTO GroupPricingRules + ( pk_RuleName, MinimumAttendees, MaximumAttendees, DiscountPerAttendee ) +VALUES ('10to20', 10, 20, '100.00' ); +INSERT INTO GroupPricingRules + ( pk_RuleName, MinimumAttendees, MaximumAttendees, DiscountPerAttendee ) +VALUES ('20orMore', 20, 10000, '200.00' ); + +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (0, 'Generics in JavaTM', 0, 6, 0, 'Generic types are slated for incorporation into the JavaTM programming language in JDKTM 1.5 release. In this talk, we highlight key features of the generics extension and discuss tradeoffs between functionality, compatibility, and performance.', 1, 0); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (1, 'Advanced RMI', 0, 6, 0, 'Tricks, strategies, and idioms that JavaTM Remote Method Invocation (Java RMI) programmers use in the field to achieve high performance and reliability.', 1, 1); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (2, 'JCP', 0, 6, 0, 'The JCP services defines a process of proposing, developing, and maintaining new Java technology standards.', 1, 0); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (3, 'Concurrency Utilities', 0, 6, 0, 'Many programs become clearer, shorter, faster, easier to write, and more reliable if, instead of starting from scratch, you use higher-level synchronization and coordination constructs.', 1, 1); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (4, 'Five Secrets to Faster Code', 0, 6, 0, 'This session explores ways to ensure that your code performs at its peak with real-world lessons', 1, 0); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (5, 'Performance Tuning J2EE', 0, 6, 0, 'A scalable and extensible framework in which JavaTM technology performance tuning can be automated for enterprise applications.', 1, 1); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (6, 'Open Source J2EE Gems', 0, 6, 0, 'Reviews the most prominent Open Source J2EE Tools', 1, 0); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (7, 'Logging with Log4J', 0, 6, 0, 'Efficient logging in J2EE with Log4J', 1, 1); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (8, 'Struts 101', 0, 6, 0, 'Building the Web Tier with Struts', 1, 0); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (9, 'Middlegen', 0, 6, 0, 'CMP Entity Bean generation with Middlegen', 1, 1); +INSERT INTO Abstracts (pk_Id, Title, Type, Topic, Level, Body, Status, fk_PresenterId) + VALUES (10, 'J2EE Testing with Cactus', 0, 6, 0, 'In-server Testing techniques with Cactus', 1, 0); + + +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (0, 0); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (1, 1); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (2, 2); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (3, 3); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (4, 4); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (5, 5); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (6, 6); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (7, 7); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (8, 8); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (9, 9); +INSERT INTO Presentations (pk_Id, fk_AbstractId) VALUES (10, 10); + +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (0, 0, 0, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (1, 1, 1, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (2, 2, 2, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (3, 3, 3, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (4, 4, 4, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (5, 5, 5, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (6, 6, 6, '2004-05-01 12:00:00.000000000', '2004-05-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (7, 7, 0, '2004-05-02 13:45:00.000000000', '2004-05-02 14:45:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (8, 8, 1, '2004-05-02 13:45:00.000000000', '2004-05-02 14:45:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (9, 9, 2, '2004-05-02 13:45:00.000000000', '2004-05-02 14:45:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (10, 10, 3, '2004-05-01 13:45:00.000000000', '2004-05-01 14:45:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (11, 3, 3, '2004-06-01 12:00:00.000000000', '2004-06-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (12, 4, 4, '2004-06-01 12:00:00.000000000', '2004-06-01 13:00:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (13, 7, 0, '2004-06-02 13:45:00.000000000', '2004-06-02 14:45:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (14, 8, 1, '2004-06-02 13:45:00.000000000', '2004-06-02 14:45:00.000000000'); +INSERT INTO Sessions (pk_Id, fk_PresentationId, fk_RoomId, DateTimeBegin, DateTimeEnd) VALUES (15, 9, 2, '2004-06-02 13:45:00.000000000', '2004-06-02 14:45:00.000000000'); + +INSERT INTO News (pk_Id, Date, RemoveDate, CreationDate, Published, Title, Body) VALUES (0, '2004-06-02 00:00:00.000000000', '2004-06-02 00:00:00.000000000', '2004-06-02 00:00:00.000000000', 'true', 'News 0', 'News Item Number 0'); +INSERT INTO News (pk_Id, Date, RemoveDate, CreationDate, Published, Title, Body) VALUES (1, '2004-06-03 00:00:00.000000000', '2004-06-02 00:00:00.000000000', '2004-06-02 00:00:00.000000000', 'true', 'News 1', 'News Item Number 1'); +INSERT INTO News (pk_Id, Date, RemoveDate, CreationDate, Published, Title, Body) VALUES (2, '2004-06-04 00:00:00.000000000', '2004-06-02 00:00:00.000000000', '2004-06-02 00:00:00.000000000', 'true', 'News 2', 'News Item Number 2'); +INSERT INTO News (pk_Id, Date, RemoveDate, CreationDate, Published, Title, Body) VALUES (3, '2004-06-04 00:00:00.000000000', '2004-06-02 00:00:00.000000000', '2004-06-02 00:00:00.000000000', 'true', 'News 3', 'News Item Number 3'); +INSERT INTO News (pk_Id, Date, RemoveDate, CreationDate, Published, Title, Body) VALUES (4, '2004-06-05 00:00:00.000000000', '2004-06-02 00:00:00.000000000', '2004-06-02 00:00:00.000000000', 'true', 'News 4', 'News Item Number 4'); + + + + + diff --git a/setup/read-me.txt b/setup/read-me.txt new file mode 100644 index 0000000..ef81df2 --- /dev/null +++ b/setup/read-me.txt @@ -0,0 +1,2 @@ +Directory: setup +Contents: location of app server and db configuration files. \ No newline at end of file diff --git a/src/CVS/Entries b/src/CVS/Entries new file mode 100644 index 0000000..a9c2bd2 --- /dev/null +++ b/src/CVS/Entries @@ -0,0 +1,7 @@ +D/conf//// +D/gui//// +D/java//// +D/middlegen//// +D/midp//// +D/test//// +D/web//// diff --git a/src/CVS/Repository b/src/CVS/Repository new file mode 100644 index 0000000..0ba4f80 --- /dev/null +++ b/src/CVS/Repository @@ -0,0 +1 @@ +tcms/src diff --git a/src/CVS/Root b/src/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/conf/CVS/Entries b/src/conf/CVS/Entries new file mode 100644 index 0000000..662543a --- /dev/null +++ b/src/conf/CVS/Entries @@ -0,0 +1,2 @@ +/application.xml/1.1/Mon Jul 7 16:11:27 2003// +/web.xml/1.5/Tue Dec 30 23:14:17 2003// diff --git a/src/conf/CVS/Repository b/src/conf/CVS/Repository new file mode 100644 index 0000000..a9883ca --- /dev/null +++ b/src/conf/CVS/Repository @@ -0,0 +1 @@ +tcms/src/conf diff --git a/src/conf/CVS/Root b/src/conf/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/conf/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/conf/application.xml b/src/conf/application.xml new file mode 100644 index 0000000..7a95e79 --- /dev/null +++ b/src/conf/application.xml @@ -0,0 +1,14 @@ + + + + TCMS Application + + + tcms.war + tcms + + + + tcms-ejb.jar + + diff --git a/src/conf/web.xml b/src/conf/web.xml new file mode 100644 index 0000000..b4296d0 --- /dev/null +++ b/src/conf/web.xml @@ -0,0 +1,82 @@ + + + + + + TCMS Web Application + + + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + + application + com.ejdoab.tcms.web.ApplicationResources + + 1 + + + + AxisServlet + Apache-Axis Servlet + org.apache.axis.transport.http.AxisServlet + + + + AdminServlet + Axis Admin Servlet + org.apache.axis.transport.http.AdminServlet + 100 + + + + action + *.do + + + + AxisServlet + /services/* + + + + AdminServlet + /servlet/AdminServlet + + + + wsdl + text/xml + + + + + struts-html + /WEB-INF/struts-html.tld + + + struts-tiles + /WEB-INF/struts-tiles.tld + + + struts-bean + /WEB-INF/struts-bean.tld + + + struts-logic + /WEB-INF/struts-logic.tld + + + jstl-core + /WEB-INF/c.tld + + + jstl-format + /WEB-INF/fmt.tld + + \ No newline at end of file diff --git a/src/gui/CVS/Entries b/src/gui/CVS/Entries new file mode 100644 index 0000000..14c4561 --- /dev/null +++ b/src/gui/CVS/Entries @@ -0,0 +1,2 @@ +D/com//// +D/media//// diff --git a/src/gui/CVS/Repository b/src/gui/CVS/Repository new file mode 100644 index 0000000..116d455 --- /dev/null +++ b/src/gui/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui diff --git a/src/gui/CVS/Root b/src/gui/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/CVS/Entries b/src/gui/com/CVS/Entries new file mode 100644 index 0000000..53b9cc0 --- /dev/null +++ b/src/gui/com/CVS/Entries @@ -0,0 +1 @@ +D/ejdoab//// diff --git a/src/gui/com/CVS/Repository b/src/gui/com/CVS/Repository new file mode 100644 index 0000000..7be6617 --- /dev/null +++ b/src/gui/com/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com diff --git a/src/gui/com/CVS/Root b/src/gui/com/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/CVS/Entries b/src/gui/com/ejdoab/CVS/Entries new file mode 100644 index 0000000..c4c4690 --- /dev/null +++ b/src/gui/com/ejdoab/CVS/Entries @@ -0,0 +1,2 @@ +D/swt//// +D/tcms//// diff --git a/src/gui/com/ejdoab/CVS/Repository b/src/gui/com/ejdoab/CVS/Repository new file mode 100644 index 0000000..de26e86 --- /dev/null +++ b/src/gui/com/ejdoab/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab diff --git a/src/gui/com/ejdoab/CVS/Root b/src/gui/com/ejdoab/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/swt/CVS/Entries b/src/gui/com/ejdoab/swt/CVS/Entries new file mode 100644 index 0000000..1319525 --- /dev/null +++ b/src/gui/com/ejdoab/swt/CVS/Entries @@ -0,0 +1 @@ +D/util//// diff --git a/src/gui/com/ejdoab/swt/CVS/Repository b/src/gui/com/ejdoab/swt/CVS/Repository new file mode 100644 index 0000000..f1633eb --- /dev/null +++ b/src/gui/com/ejdoab/swt/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab/swt diff --git a/src/gui/com/ejdoab/swt/CVS/Root b/src/gui/com/ejdoab/swt/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/swt/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/swt/util/CVS/Entries b/src/gui/com/ejdoab/swt/util/CVS/Entries new file mode 100644 index 0000000..f5b1b20 --- /dev/null +++ b/src/gui/com/ejdoab/swt/util/CVS/Entries @@ -0,0 +1 @@ +/SWTUtil.java/1.6/Mon Sep 8 04:58:38 2003// diff --git a/src/gui/com/ejdoab/swt/util/CVS/Repository b/src/gui/com/ejdoab/swt/util/CVS/Repository new file mode 100644 index 0000000..b4de92e --- /dev/null +++ b/src/gui/com/ejdoab/swt/util/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab/swt/util diff --git a/src/gui/com/ejdoab/swt/util/CVS/Root b/src/gui/com/ejdoab/swt/util/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/swt/util/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/swt/util/SWTUtil.java b/src/gui/com/ejdoab/swt/util/SWTUtil.java new file mode 100644 index 0000000..cb25d68 --- /dev/null +++ b/src/gui/com/ejdoab/swt/util/SWTUtil.java @@ -0,0 +1,352 @@ +package com.ejdoab.swt.util; + +import org.eclipse.compare.CompareViewerPane; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.List; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; + +/** + * Miscellaneous static methods to create and manipulate SWT and JFace widgets + * @author Brian Sam-Bodden + */ +public class SWTUtil { + + // + // static initializations + // + static { + initializeColors(); + } + + /** + * Uninstantiable class + */ + private SWTUtil() {} + + // + // shell utilities + // + + /** + * Centers a Shell on the given Display + * + * @param shell + * @param display + */ + public static void centerShellOnDisplay(Shell shell, Display display) { + Rectangle bounds = display.getBounds(); + Rectangle rect = shell.getBounds(); + int x = bounds.x + (bounds.width - rect.width) / 2; + int y = bounds.y + (bounds.height - rect.height) / 2; + shell.setLocation(x, y); + } + + // + // tableviewer utilities + // + + /** + * Adds a column to a table viewer + * + * @param tableViewer + * @param title + * @param width + * @return + */ + public static TableColumn addTableColumn( + TableViewer tableViewer, + String title, + int width) { + TableColumn column = addTableColumn(tableViewer, title); + column.setWidth(width); + return column; + } + + public static TableColumn addTableColumn( + TableViewer tableViewer, + String title) { + TableColumn column = new TableColumn(tableViewer.getTable(), SWT.LEFT); + column.setText(title); + return column; + } + + public static TableColumn addTableColumn( + final TableViewer tableViewer, + String title, + int width, + final ViewerSorter sorter) { + TableColumn column = addTableColumn(tableViewer, title, width); + column.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + tableViewer.setSorter(sorter); + } + }); + return column; + } + + + // + // label utilities + // + + /** + * @param parent + * @param text + * @return + */ + public static Label createLabel(Composite parent, String text) { + return createLabel(parent, text, SWT.NONE); + } + + /** + * @param parent + * @param text + * @param style + * @return + */ + public static Label createLabel(Composite parent, String text, int style) { + Label label = new Label(parent, style); + if (text != null) + label.setText(text); + return label; + } + + /** + * @param parent + * @param text + * @param style + * @param bkcolor + * @return + */ + public static Label createLabel(Composite parent, String text, int style, int bkcolor) { + Label label = createLabel(parent, text, style); + label.setBackground(getColor(label, bkcolor)); + return label; + } + + // + // text utilities + // + + /** + * @param parent + * @return + */ + public static Text createText(Composite parent) { + return createText(parent, "", SWT.BORDER | SWT.SINGLE); + } + + /** + * @param parent + * @param value + * @return + */ + public static Text createText(Composite parent, String value) { + return createText(parent, value, SWT.BORDER | SWT.SINGLE); + } + + /** + * @param parent + * @param value + * @param style + * @return + */ + public static Text createText(Composite parent, String value, int style) { + Text text = new Text(parent, style); + text.setText(value); + return text; + } + + /** + * @param parent + * @param value + * @param style + * @param bkcolor + * @return + */ + public static Text createText(Composite parent, String value, int style, int bkcolor) { + Text text = createText(parent, value, style); + text.setBackground(getColor(text, bkcolor)); + return text; + } + + // + // color utilities + // + + /** + * @param color + * @return + */ + public static Color getColor(Control c, int color) { + return c.getDisplay().getSystemColor(color); + } + + /** + * Returns a system color identified by a SWT constant. + * + * @param color + * @return + */ + public static Color getSystemColor(int color) { + Display display = Display.getDefault(); + return display.getSystemColor(color); + } + + + // + // font utilities + // + + /** + * @param font + * @return + */ + public static Font getFont(String font) { + return JFaceResources.getFontRegistry().get(font); + } + + // + // gradient colors and percentages + // + + public static Color[] GRADIENT_COLORS; + public static int[] GRADIENT_PERCENTAGES; + + private static void initializeColors() { + // Define active view gradient using same OS title gradient colors. + Color low = getSystemColor(SWT.COLOR_TITLE_BACKGROUND); + Color medium = getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT); + Color high = getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); + GRADIENT_COLORS = new Color[] {low, medium, high}; + GRADIENT_PERCENTAGES = new int[] {50, 100}; + } + + // + // CompareViewerPane utilities + // + + /** + * FocusListener implementation that mimicks the OS gradient on focus behaviour + */ + public static class CLabelFocusListener implements FocusListener { + private CLabel _clabel; + + public CLabelFocusListener(CompareViewerPane cwp) { + _clabel = (CLabel) cwp.getTopLeft(); + } + + public void focusGained(FocusEvent e) { + _clabel.setForeground(SWTUtil.getSystemColor(SWT.COLOR_TITLE_FOREGROUND)); + _clabel.setBackground(GRADIENT_COLORS, GRADIENT_PERCENTAGES); + } + + public void focusLost(FocusEvent e) { + _clabel.setForeground(SWTUtil.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); + _clabel.setBackground(null, null); + } + + } + + /** + * + */ + public static class CLabelMouseAdapter extends MouseAdapter { + private CLabel _clabel; + private CompareViewerPane _cwp; + + public CLabelMouseAdapter(CompareViewerPane cwp) { + _cwp = cwp; + _clabel = (CLabel) cwp.getTopLeft(); + //TODO is this a good or bad practice + // assigning the listener in the constructor? + _clabel.addMouseListener(this); + } + + public void removeMouseListener() { + _clabel.removeMouseListener(this); + } + + public void mouseDown(MouseEvent event) { + _cwp.getContent().setFocus(); + } + } + + + public static void createHorizontalGridSeparator(Composite parent) { + Layout layout = parent.getLayout(); + if (layout instanceof GridLayout) { + GridLayout gridLayout = (GridLayout)layout; + Label line = new Label(parent, SWT.SEPARATOR|SWT.HORIZONTAL|SWT.BOLD); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = gridLayout.numColumns; + line.setLayoutData(gridData); + } + } + + /** + * This method blocks until the Shell is disposed subsequently + * disposing the parent Display + * + * @param display + * @param shell + */ + public static void eventLoop(Display display, Shell shell) { + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) { + display.sleep(); + } + } + display.dispose(); + } + + /** + * This method blocks until all Shells are disposed subsequently + * disposing the parent Display + * + * @param display + * @param shell + */ + public static void eventLoop(Display display, Shell[] shells) { + boolean shellsDisposed = true; + while (!shellsDisposed) { + if (!display.readAndDispatch()) { + display.sleep(); + } + for (int i = 0; i < shells.length; i++) { + shellsDisposed = shellsDisposed && (shells[i].isDisposed()); + } + } + display.dispose(); + } + + public static void addStrings(String[] strings, List list) { + for (int i = 0; i < strings.length; i++) { + list.add(strings[i]); + } + } + + +} diff --git a/src/gui/com/ejdoab/tcms/CVS/Entries b/src/gui/com/ejdoab/tcms/CVS/Entries new file mode 100644 index 0000000..0624877 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/CVS/Entries @@ -0,0 +1 @@ +D/admin//// diff --git a/src/gui/com/ejdoab/tcms/CVS/Repository b/src/gui/com/ejdoab/tcms/CVS/Repository new file mode 100644 index 0000000..84201cb --- /dev/null +++ b/src/gui/com/ejdoab/tcms/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab/tcms diff --git a/src/gui/com/ejdoab/tcms/CVS/Root b/src/gui/com/ejdoab/tcms/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/tcms/admin/AboutDialog.java b/src/gui/com/ejdoab/tcms/admin/AboutDialog.java new file mode 100644 index 0000000..bcf0c2c --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/AboutDialog.java @@ -0,0 +1,194 @@ +package com.ejdoab.tcms.admin; + +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.TitleAreaDialog; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyleRange; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.swt.widgets.Table; + +import com.ejdoab.swt.util.SWTUtil; + +/** + * @author Brian Sam-Bodden + */ +public class AboutDialog extends TitleAreaDialog { + + TabFolder _tabs; + Composite _toolPage; + Composite _systemPage; + StyledText _text; + TableViewer _tableViewer; + + /** + * @param arg0 + */ + protected AboutDialog(Shell shell) { + super(shell); + } + + protected void configureShell(Shell shell) { + super.configureShell(shell); + shell.setText("TCMS Admin"); + } + + protected Control createContents(Composite parent) { + Control contents = super.createContents(parent); + + setTitle("About TCMS Admin"); + setMessage("Information about the tool's version and the system's state"); + + return contents; + } + + protected Control createDialogArea(Composite parent) { + Composite outer = (Composite) super.createDialogArea(parent); + Composite c = new Composite(outer, SWT.NONE); + c.setLayoutData(new GridData(GridData.FILL_BOTH)); // API Failure, how does the user know that is it a grid? + + FormLayout formLayout = new FormLayout(); + formLayout.marginHeight = 10; + formLayout.marginWidth = 10; + c.setLayout(formLayout); + + FormData formData = new FormData(); + formData.top = new FormAttachment(0,0); + formData.bottom = new FormAttachment(100,0); + formData.left = new FormAttachment(0,0); + formData.right = new FormAttachment(100,0); + + _tabs = new TabFolder(c, SWT.FLAT); + _tabs.setLayoutData(formData); + + TabItem toolTab = new TabItem (_tabs, SWT.NULL); + toolTab.setText("Tool"); + Composite toolPage = buildToolPage(_tabs); + toolTab.setControl(toolPage); + + TabItem systemTab = new TabItem(_tabs, SWT.NULL); + systemTab.setText("System"); + Composite systemPage = buildSystemPage(_tabs); + systemTab.setControl(systemPage); + + return c; + } + + protected void createButtonsForButtonBar(Composite parent) { + // create Close button + createButton( + parent, + IDialogConstants.CLOSE_ID, + IDialogConstants.CLOSE_LABEL, + true); + } + + protected void buttonPressed(int buttonId) { + super.buttonPressed(buttonId); + if (IDialogConstants.CLOSE_ID == buttonId) { + okPressed(); + } + } + + /** + * @param c + * @return + */ + private Composite buildToolPage(Composite c) { + Composite page = new Composite(c, SWT.NONE); + + FormLayout formLayout = new FormLayout(); + formLayout.marginHeight = 20; + formLayout.marginWidth = 20; + page.setLayout(formLayout); + + _text = new StyledText(page, SWT.MULTI | SWT.READ_ONLY); + _text.setBackground(page.getBackground()); + _text.setCaret(null); + _text.setFont(c.getFont()); + _text.setCursor(null); + + FormData formData = new FormData(); + formData.top = new FormAttachment(0,0); + formData.bottom = new FormAttachment(100,0); + formData.left = new FormAttachment(0,0); + formData.right = new FormAttachment(100,0); + + _text.setLayoutData(formData); + + String LINE_SEP = _text.getLineDelimiter(); + String title = "TCMS Admin 1.0"; + StringBuffer sb = new StringBuffer(); + sb.append(title) + .append(LINE_SEP) + .append("Enterprise Java Development on a Budget") + .append(LINE_SEP) + .append("Technology Conference Management System") + .append(LINE_SEP) + .append("http://www.ejdoab.com") + .append(LINE_SEP) + .append("Licensed under The Apache Software License, Version 1.1") + .append(LINE_SEP) + .append("Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd") + .append(LINE_SEP) + .append("All rights reserved."); + _text.setText(sb.toString()); + + StyleRange styleRange = new StyleRange(); + styleRange.start = 0; + styleRange.length = title.length(); + styleRange.fontStyle = SWT.BOLD; + _text.setStyleRange(styleRange); + + return page; + } + + /** + * @param c + * @return + */ + private Composite buildSystemPage(Composite c) { + Composite page = new Composite(c, SWT.NONE); + + FormLayout formLayout = new FormLayout(); + formLayout.marginHeight = 20; + formLayout.marginWidth = 20; + page.setLayout(formLayout); + + _tableViewer = new TableViewer(page, SWT.BORDER); + _tableViewer.setContentProvider(new SystemPropertiesTableContentProvider()); + _tableViewer.setLabelProvider(new SystemPropertiesTableLabelProvider()); + + Table table = _tableViewer.getTable(); + table.setLinesVisible(true); + table.setHeaderVisible(true); + + SWTUtil.addTableColumn(_tableViewer, "Property", 210); + SWTUtil.addTableColumn(_tableViewer, "Value", 500); + + FormData formData = new FormData(); + formData.top = new FormAttachment(0,0); + formData.bottom = new FormAttachment(100,0); + formData.left = new FormAttachment(0,0); + formData.right = new FormAttachment(100,0); + formData.width = 320; + formData.height = 200; + + _tableViewer.getTable().setLayoutData(formData); + + _tableViewer.setInput(System.getProperties()); + + return page; + } + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/BaseTCMSView.java b/src/gui/com/ejdoab/tcms/admin/BaseTCMSView.java new file mode 100644 index 0000000..893ef37 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/BaseTCMSView.java @@ -0,0 +1,32 @@ +package com.ejdoab.tcms.admin; + +import org.eclipse.swt.widgets.Composite; + +/** + * @author Brian Sam-Bodden + */ +public class BaseTCMSView extends Composite implements TCMSView { + + /** + * @param arg0 + * @param arg1 + */ + public BaseTCMSView(Composite parent, int style) { + super(parent, style); + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.admin.TCMSView#loadData(java.lang.Object[]) + */ + public void loadData(Object[] items) { + // do nothing + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.admin.TCMSView#getViewName() + */ + public String getViewName() { + return this.getClass().getName(); + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/CVS/Entries b/src/gui/com/ejdoab/tcms/admin/CVS/Entries new file mode 100644 index 0000000..628fa86 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/CVS/Entries @@ -0,0 +1,13 @@ +/AboutDialog.java/1.3/Thu Sep 11 16:11:23 2003// +/BaseTCMSView.java/1.1/Mon Sep 1 03:56:56 2003// +/Resources.java/1.1/Mon Sep 1 03:56:56 2003// +/Splash.java/1.1/Mon Sep 1 03:56:56 2003// +/SystemPropertiesTableContentProvider.java/1.1/Mon Sep 1 03:56:55 2003// +/SystemPropertiesTableLabelProvider.java/1.1/Mon Sep 1 03:56:56 2003// +/TCMSAdmin.java/1.12/Fri Sep 12 18:55:46 2003// +/TCMSView.java/1.1/Mon Sep 1 03:56:55 2003// +D/abstracts//// +D/news//// +D/presenters//// +D/registration//// +D/remote//// diff --git a/src/gui/com/ejdoab/tcms/admin/CVS/Repository b/src/gui/com/ejdoab/tcms/admin/CVS/Repository new file mode 100644 index 0000000..582f5fb --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab/tcms/admin diff --git a/src/gui/com/ejdoab/tcms/admin/CVS/Root b/src/gui/com/ejdoab/tcms/admin/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/tcms/admin/Resources.java b/src/gui/com/ejdoab/tcms/admin/Resources.java new file mode 100644 index 0000000..8427d06 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/Resources.java @@ -0,0 +1,171 @@ +package com.ejdoab.tcms.admin; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * @author Brian Sam-Bodden + */ +public class Resources { + private static Log log = LogFactory.getLog(Resources.class); + + private static String[] _extensions = { "gif", "jpg", "jpeg" }; + private static ImageRegistry _images; + private static Display _display; + + private static final URL _iconsFolder = + Resources.class.getResource("/media/icons/"); + private static final URL _imagesFolder = + Resources.class.getResource("/media/"); + + + private static Map _imageFolders = new HashMap(); + + // static initializer + static { + _imageFolders.put("icons", _iconsFolder); + _imageFolders.put("image", _imagesFolder); + } + + /** + * Non-instantiable static library + */ + private Resources() { + } + + /** + * SWT Display objec used to initialize the + * Image registry and also as a central location + * to get the application's main Display object is needed + * + * @param display + */ + public static void setDisplay(Display display) { + _display = display; + initializeImageRegistry(); + } + + public static Display getDisplay() { + return _display; + } + + private static void initializeImageRegistry() { + if ((_images == null) && (_display != null)) { + _images = new ImageRegistry(_display); + // loop throught the image directory and add all images to the registry + // take the image name sans extension as the key for the registry + + Set keys = _imageFolders.keySet(); + Iterator i = keys.iterator(); + + // loop through the different image folders and add the images to the registry + for (int index = 0, n = keys.size(); index < n; index++) { + String key = (String) i.next(); + URL location = (URL) _imageFolders.get(key); + + // Convert a URL to a URI + URI uri = null; + try { + uri = new URI(location.toString()); + } catch (URISyntaxException e) { + } + + if (uri != null) { + File directory = new File(uri); + + // if it is a directory go throught all the files of a given type and add them + // to the registry + if (directory.isDirectory()) { + String[] files = + FileUtils.getFilesFromExtension( + directory.getAbsolutePath(), + _extensions); + for (int j = 0; j < files.length; j++) { + File file = FileUtils.getFile(files[j]); + + try { + ImageDescriptor desc = ImageDescriptor.createFromURL(file.toURL()); + String registryEntry = + key + "_" + FileUtils.removeExtension(file.getName()); + log.info("adding image file " + file.getName() + " as " + registryEntry); + System.out.println("adding image file " + file.getName() + " as " + registryEntry); + _images.put(registryEntry, desc); + + } catch (MalformedURLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } else { + // if the 'single' file is of a given type add it to the registry + System.out.println("single file"); + } + } + } + + } + } + + /** + * @return + */ + public static ImageRegistry getImageRegistry() { + return _images; + } + + public static void main(String[] args) { + Display display = new Display(); + + Resources.setDisplay(display); + Resources.initializeImageRegistry(); + + final Shell shell = new Shell(display); + shell.setSize(640, 480); + shell.setLayout(new FillLayout()); + + Label label = new Label(shell, SWT.NONE); + + Image image = Resources.getImageRegistry().get("icons_application"); + + if (image != null) { + label.setImage(image); + } + + label.addListener(SWT.MouseDown, new Listener() { + public void handleEvent(Event e) { + shell.dispose(); + } + }); + + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + } + + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/Splash.java b/src/gui/com/ejdoab/tcms/admin/Splash.java new file mode 100644 index 0000000..be61553 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/Splash.java @@ -0,0 +1,54 @@ +package com.ejdoab.tcms.admin; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.ProgressBar; + +/** + * @author Brian Sam-Bodden + */ +public class Splash extends Composite { + + ProgressBar _bar; + Label _label; + + int _increment; + + /** + * @param arg0 + * @param arg1 + */ + public Splash(Composite parent, int style) { + super(parent, style); + + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + + setLayout(layout); + + _label = new Label(this, SWT.NONE); + _label.setImage(Resources.getImageRegistry().get("image_splash")); + + GridData gridData = new GridData(); + gridData.horizontalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + + _bar = new ProgressBar(this, SWT.NONE); + _bar.setLayoutData(gridData); + + this.pack(); + } + + public void configureProgressBar(int maximum, int increment) { + _increment = increment; + _bar.setMaximum(maximum); + } + + public void increment() { + _bar.setSelection(_bar.getSelection() + _increment); + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/SystemPropertiesTableContentProvider.java b/src/gui/com/ejdoab/tcms/admin/SystemPropertiesTableContentProvider.java new file mode 100644 index 0000000..12ad15e --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/SystemPropertiesTableContentProvider.java @@ -0,0 +1,68 @@ +package com.ejdoab.tcms.admin; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.Viewer; + +import com.ejdoab.tcms.util.NameValue; + +/** + * @author Brian Sam-Bodden + */ +public class SystemPropertiesTableContentProvider + implements IStructuredContentProvider { + + private List properties = new ArrayList(); + + public SystemPropertiesTableContentProvider() { + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) + */ + public Object[] getElements(Object element) { + if (element instanceof Properties) { + loadProperties((Properties)element); + } + return properties.toArray(); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) + */ + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + if (oldInput != null) { + properties.clear(); + } + + if (newInput != null) { + Properties newModel = (Properties) newInput; + loadProperties(newModel); + } + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IContentProvider#dispose() + */ + public void dispose() { + } + + private void loadProperties(Properties props) { + Iterator i = props.keySet().iterator(); + + for (int index = 0, n = props.size(); index < n; index++) { + String name = (String) i.next(); + String value = props.getProperty(name); + NameValue nv = new NameValue(name, value); + System.out.println(nv); + properties.add(nv); + } + } + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/SystemPropertiesTableLabelProvider.java b/src/gui/com/ejdoab/tcms/admin/SystemPropertiesTableLabelProvider.java new file mode 100644 index 0000000..bec5ab8 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/SystemPropertiesTableLabelProvider.java @@ -0,0 +1,68 @@ +package com.ejdoab.tcms.admin; + +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Image; + +import com.ejdoab.tcms.util.NameValue; + +/** + * @author Brian Sam-Bodden + */ +public class SystemPropertiesTableLabelProvider + implements ITableLabelProvider { + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) + */ + public Image getColumnImage(Object element, int column) { + return null; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) + */ + public String getColumnText(Object element, int column) { + String result = null; + if (element instanceof NameValue) { + NameValue nv = (NameValue)element; + switch (column) { + case 0 : + result = nv.getName(); + break; + case 1 : + result = nv.getValue(); + break; + } + } + System.out.println("getColumnText =" + result); + return result; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) + */ + public void addListener(ILabelProviderListener arg0) { + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() + */ + public void dispose() { + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) + */ + public boolean isLabelProperty(Object arg0, String arg1) { + return false; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) + */ + public void removeListener(ILabelProviderListener arg0) { + } + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/TCMSAdmin.java b/src/gui/com/ejdoab/tcms/admin/TCMSAdmin.java new file mode 100644 index 0000000..f64dde3 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/TCMSAdmin.java @@ -0,0 +1,830 @@ +package com.ejdoab.tcms.admin; + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.preference.PreferenceDialog; +import org.eclipse.jface.preference.PreferenceManager; +import org.eclipse.jface.preference.PreferenceNode; +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.preference.PreferenceStore; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.jface.window.ApplicationWindow; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.swt.widgets.ToolItem; +import org.eclipse.swt.widgets.Widget; +import org.eclipse.ui.part.PageBook; + +import com.ejdoab.swt.util.SWTUtil; +import com.ejdoab.tcms.admin.abstracts.AbstractsPage; +import com.ejdoab.tcms.admin.news.NewsPage; +import com.ejdoab.tcms.admin.remote.ConferenceServicesProxy; +import com.ejdoab.tcms.admin.remote.RemoteServerException; +import com.ejdoab.tcms.admin.remote.ServiceProxyFactory; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; + +/** + * Main Application Window of the TCMSAdmin Application + * + * @author Brian Sam-Bodden + */ +public class TCMSAdmin extends ApplicationWindow { + private boolean showShortcutBar = true; + private boolean showStatusLine = true; + private boolean showToolBar = true; + + private ToolBarManager shortcutBar; + + // static fields for inner classes. + static final int VGAP = 0; + static final int CLIENT_INSET = 3; + static final int BAR_SIZE = 23; + + private Label separator1; + private Label separator2; + private Label separator3; + + private Shell _shell; + + private PageBook _pages; + private AbstractsPage _abstracts; + private NewsPage _news; + + private TCMSView _activeView; + + private AboutAction aboutAction = new AboutAction(); + private ShowAbstractsPageAction conferencesAction = new ShowAbstractsPageAction(); + private ShowNewsPageAction newsAction = new ShowNewsPageAction(); + private RefreshDataAction refreshAction = new RefreshDataAction(); + private ShowPreferencesAction preferencesAction = new ShowPreferencesAction(); + private ExitAction exitAction = new ExitAction(this); + + + private static String REMOTE_HOST = "localhost"; + private static String REMOTE_PORT = "1099"; + + private ServiceProxyFactory _serviceFactory; + private ConferenceServicesProxy _conferenceService; + + private PreferenceStore _preferenceStore; + + /** + * @param shell + */ + public TCMSAdmin(Shell shell) { + super(null); + _shell = shell; + + setDefaultImage(Resources.getImageRegistry().get("icons_application")); + + addMenuBar(); + addToolBar(SWT.FLAT | SWT.WRAP); + addStatusLine(); + addShortcutBar(SWT.FLAT | SWT.WRAP | SWT.VERTICAL); + + setBlockOnOpen(true); + } + + /** + * Sets the ApplicationWindows's content layout. + * This layout supports a fixed size Toolbar area, a separator line, + * the variable size content area, + * and a fixed size status line. + */ + protected void configureShell(Shell shell) { + super.configureShell(shell); + shell.setLayout(getLayout()); + shell.setText("TCMS Admin"); + + separator1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL); + separator2 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL); + separator3 = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL); + + createShortcutBar(shell); + + shortcutBar.add(conferencesAction); + shortcutBar.add(newsAction); + shortcutBar.update(false); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite) + */ + protected Control createContents(Composite parent) { + Composite c = new Composite(parent, SWT.NONE); + c.setLayout(new FillLayout()); + + _pages = new PageBook(c, SWT.NONE); + + _abstracts = new AbstractsPage(_pages, SWT.NONE); + _news = new NewsPage(_pages, SWT.NONE); + + return c; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#initializeBounds() + */ + protected void initializeBounds() { + _shell.setSize(1024, 768); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.window.ApplicationWindow#createMenuManager() + */ + protected MenuManager createMenuManager() { + MenuManager menuManager = new MenuManager(); + menuManager.add(buildFileMenu()); + menuManager.add(buildViewMenu()); + menuManager.add(buildHelpMenu()); + return menuManager; + } + + /** + * @return + */ + private MenuManager buildFileMenu() { + MenuManager fileMenu = new MenuManager("&File"); + fileMenu.add(preferencesAction); + fileMenu.add(refreshAction); + fileMenu.add(exitAction); + return fileMenu; + } + + /** + * @return + */ + private MenuManager buildViewMenu() { + MenuManager viewMenu = new MenuManager("&View"); + viewMenu.add(conferencesAction); + viewMenu.add(newsAction); + return viewMenu; + } + + /** + * @return + */ + private MenuManager buildHelpMenu() { + MenuManager helpMenu = new MenuManager("&Help"); + helpMenu.add(aboutAction); + return helpMenu; + } + + /** + * Create the shortcut toolbar control + */ + private void createShortcutBar(Shell shell) { + // Create control. + if (shortcutBar == null) + return; + shortcutBar.createControl(shell); + + ToolBar tb = shortcutBar.getControl(); + } + + /** + * Sets whether the shortcut bar should be visible. + * + * @param show true to show it, false to hide it + */ + public void setShowShortcutBar(boolean show) { + showShortcutBar = show; + } + + /** + * Sets whether the status line should be visible. + * + * @param show true to show it, false to hide it + */ + public void setShowStatusLine(boolean show) { + showStatusLine = show; + } + + /** + * Sets whether the tool bar should be visible. + * + * @param show true to show it, false to hide it + */ + public void setShowToolBar(boolean show) { + showToolBar = show; + } + + /** + * Configures this window to have a shortcut bar. + * Does nothing if it already has one. + * This method must be called before this window's shell is created. + */ + protected void addShortcutBar(int style) { + if ((getShell() == null) && (shortcutBar == null)) { + shortcutBar = new ToolBarManager(style); + } + } + + /** + * Returns the shortcut bar. + */ + public ToolBarManager getShortcutBar() { + return shortcutBar; + } + + /** + * Returns the separator2 control. + */ + protected Label getSeperator1() { + return separator1; + } + + /** + * Returns the separator2 control. + */ + protected Label getSeparator2() { + return separator2; + } + + /** + * Returns the separator3 control. + */ + protected Label getSeparator3() { + return separator3; + } + + /** + * Returns whether the tool bar should be shown. + * + * @return true to show it, false to hide it + */ + public boolean getShowToolBar() { + return showToolBar; + } + + /** + * Returns whether the status bar should be shown. + * + * @return true to show it, false to hide it + */ + public boolean getShowStatusLine() { + return showStatusLine; + } + + /** + * Returns whether the shortcut bar should be shown. + * + * @return true to show it, false to hide it + */ + public boolean getShowShortcutBar() { + return showShortcutBar; + } + + /** + * Get the workbench client area. + */ + protected Composite getClientComposite() { + return (Composite) getContents(); + } + + /** + * Returns the layout for the shell. + * + * @return the layout for the shell + */ + protected Layout getLayout() { + return new TCMSWindowLayout(); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.window.ApplicationWindow#createToolBarManager(int) + */ + protected ToolBarManager createToolBarManager(int style) { + ToolBarManager toolBarManager = new ToolBarManager(style); + toolBarManager.add(preferencesAction); + toolBarManager.add(refreshAction); + + return toolBarManager; + } + + // + // actions + // + + private class AboutAction extends Action { + + public AboutAction() { + setToolTipText("About this Application"); + setText("&About"); + setImageDescriptor(Resources.getImageRegistry().getDescriptor("icons_about")); + } + + public void run() { + AboutDialog dialog = new AboutDialog(getShell()); + dialog.open(); + } + } + + private class ShowAbstractsPageAction extends Action { + + public ShowAbstractsPageAction() { + setToolTipText("Switch to the Abstract's Page"); + setText("&Abstracts@Alt+A"); + setImageDescriptor(Resources.getImageRegistry().getDescriptor("icons_abstracts")); + } + + public void run() { + _pages.showPage(_abstracts); + _activeView = (TCMSView)_abstracts; + setStatus("Abstracts Page Loaded"); + } + } + + private class ShowNewsPageAction extends Action { + + public ShowNewsPageAction() { + setToolTipText("Switch to the News Page"); + setText("&News@Alt+N"); + setImageDescriptor(Resources.getImageRegistry().getDescriptor("icons_news")); + } + + public void run() { + _pages.showPage(_news); + _activeView = (TCMSView)_news; + setStatus("News Page Loaded"); + } + } + + private class ShowPreferencesAction extends Action { + public ShowPreferencesAction() { + setToolTipText("Brings up the Application Preferences Dialog"); + setText("&Preferences"); + setImageDescriptor(Resources.getImageRegistry().getDescriptor("icons_preferences")); + } + + public void run() { + PreferenceStore store = getPreferenceStore(); + + try { + store.load(); + } catch (IOException ex) { + ; + } + PreferenceManager manager = new PreferenceManager(); + + PreferencePage serverPage = new ServerPreferencesPage(); + PreferenceNode serverNode = new PreferenceNode("serverNode"); + serverNode.setPage(serverPage); + + manager.addToRoot(serverNode); + + PreferenceDialog dialog = new PreferenceDialog(getShell(), manager); + dialog.setPreferenceStore(store); + + dialog.open(); + } + } + + private class RefreshDataAction extends Action { + + public RefreshDataAction() { + setToolTipText("Refresh the Active Page Data from the Server"); + setText("&Refresh@Alt+R"); + setImageDescriptor(Resources.getImageRegistry().getDescriptor("icons_refresh")); + } + + public void run() { + ProgressMonitorDialog dialog = + new ProgressMonitorDialog(getShell()); + try { + dialog.setCancelable(false); + dialog.run(true, true, new LoadData()); + } catch (InvocationTargetException ex) { + ex.printStackTrace(); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + } + + private class ExitAction extends Action { + ApplicationWindow _window; + + public ExitAction(ApplicationWindow window) { + _window = window; + setText("E&xit@Ctrl+X"); + setToolTipText("Exit TCMS Admin"); + } + + public void run() { + _window.close(); + } + } + + // + // Progress + // + private class LoadData implements IRunnableWithProgress { + + /* (non-Javadoc) + * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) + */ + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + monitor.beginTask("Contacting Server", IProgressMonitor.UNKNOWN); + if (_activeView != null) { + try { + Object[] data = null; + String[] topics = null; + String[] levels = null; + String[] types = null; + String[] status = null; + + if (_serviceFactory == null) { + PreferenceStore store = getPreferenceStore(); + String host = store.getString("host"); + String port = store.getString("port"); + _serviceFactory = new ServiceProxyFactory(host, port); + monitor.subTask("Obtained Service Proxy Factory"); + } + + if (_serviceFactory != null) { + _conferenceService = _serviceFactory.getConferencesServices(); + monitor.subTask("Obtained Conference Service Proxy"); + + if (_activeView.equals(_abstracts)) { + _abstracts.setService(_conferenceService); + data = _conferenceService.getAbstractAsArray(); + monitor.subTask("Retrieved Abstracts List"); + topics = _conferenceService.getValidTopics(); + monitor.subTask("Retrieved Topics"); + levels = _conferenceService.getValidLevels(); + monitor.subTask("Retrieved Levels"); + types = _conferenceService.getValidTypes(); + monitor.subTask("Retrieved Types"); + status = + _conferenceService.getValidAbstractStatus(); + monitor.subTask("Retrieve Status"); + + _shell.getDisplay().syncExec(new AbstractsViewUpdater(_abstracts, data, topics, levels, types, status)); + } else if (_activeView.equals(_news)) { + _news.setService(_conferenceService); + data = _conferenceService.getNewsAsArray(); + monitor.subTask("Retrieved News Articles"); + _shell.getDisplay().syncExec(new NewsViewUpdater(_news, data)); + } + } + monitor.subTask("Data Loaded"); + monitor.done(); + } catch (RemoteServerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (DTOCreateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + class AbstractsViewUpdater implements Runnable { + Object[] _data; + String[] _topics; + String[] _levels; + String[] _types; + String[] _status; + AbstractsPage _abstracts; + + public AbstractsViewUpdater( + AbstractsPage abstracts, + Object[] data, + String[] topics, + String[] levels, + String[] types, + String[] status) { + _abstracts = abstracts; + _data = data; + _topics = topics; + _levels = levels; + _types = types; + _status = status; + } + + /* (non-Javadoc) + * @see java.lang.Runnable#run() + */ + public void run() { + _abstracts.setTopics(_topics); + _abstracts.setLevels(_levels); + _abstracts.setTypes(_types); + _abstracts.setStatus(_status); + _abstracts.loadData(_data); + } + } + + class NewsViewUpdater implements Runnable { + Object[] _data; + NewsPage _news; + + /** + * + */ + public NewsViewUpdater(NewsPage news, Object[] data) { + _news = news; + _data = data; + } + + /* (non-Javadoc) + * @see java.lang.Runnable#run() + */ + public void run() { + _news.loadData(_data); + } + } + } + + /** + * Preferences + */ + private static class ServerPreferencesPage extends FieldEditorPreferencePage { + public ServerPreferencesPage() { + super("Server", FieldEditorPreferencePage.GRID); + } + + protected void createFieldEditors() { + addField( + new StringFieldEditor( + "host", + "&Host:", + getFieldEditorParent())); + addField( + new IntegerFieldEditor( + "port", + "&Port:", + getFieldEditorParent())); + } + + } + + /** + * The layout for the TCMS Admin window shell. + */ + class TCMSWindowLayout extends Layout { + + protected Point computeSize( + Composite composite, + int wHint, + int hHint, + boolean flushCache) { + if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) + return new Point(wHint, hHint); + + Point result = new Point(0, 0); + Control[] ws = composite.getChildren(); + for (int i = 0; i < ws.length; i++) { + Control w = ws[i]; + boolean skip = false; + if (w == getToolBarControl()) { + skip = true; + result.y += BAR_SIZE; + } else if ( + getShortcutBar() != null + && w == getShortcutBar().getControl()) { + skip = true; + } + if (!skip) { + Point e = w.computeSize(wHint, hHint, flushCache); + result.x = Math.max(result.x, e.x); + result.y += e.y + VGAP; + } + } + + result.x += BAR_SIZE; // For shortcut bar. + if (wHint != SWT.DEFAULT) + result.x = wHint; + if (hHint != SWT.DEFAULT) + result.y = hHint; + return result; + } + + protected void layout(Composite composite, boolean flushCache) { + Rectangle clientArea = composite.getClientArea(); + + //Null on carbon + if (getSeperator1() != null) { + //Layout top seperator + Point sep1Size = + getSeperator1().computeSize( + SWT.DEFAULT, + SWT.DEFAULT, + flushCache); + getSeperator1().setBounds( + clientArea.x, + clientArea.y, + clientArea.width, + sep1Size.y); + clientArea.y += sep1Size.y; + clientArea.height -= sep1Size.y; + } + + int toolBarWidth = clientArea.width; + + //Layout the toolbar + Control toolBar = getToolBarControl(); + if (toolBar != null) { + if (getShowToolBar()) { + int height = BAR_SIZE; + + if (toolBarChildrenExist()) { + Point toolBarSize = + toolBar.computeSize( + clientArea.width, + SWT.DEFAULT, + flushCache); + height = toolBarSize.y; + } + toolBar.setBounds( + clientArea.x, + clientArea.y, + toolBarWidth, + height); + clientArea.y += height; + clientArea.height -= height; + } else + getToolBarControl().setBounds(0, 0, 0, 0); + } + + //Layout side seperator + Control sep2 = getSeparator2(); + if (sep2 != null) { + if (getShowToolBar()) { + Point sep2Size = + sep2.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache); + sep2.setBounds( + clientArea.x, + clientArea.y, + clientArea.width, + sep2Size.y); + clientArea.y += sep2Size.y; + clientArea.height -= sep2Size.y; + } else + sep2.setBounds(0, 0, 0, 0); + } + + if (getStatusLineManager() != null) { + Control statusLine = getStatusLineManager().getControl(); + if (statusLine != null) { + if (getShowStatusLine()) { + + int width = 0; + if (getShortcutBar() != null && getShowShortcutBar()) { + Widget shortcutBar = getShortcutBar().getControl(); + if (shortcutBar != null + && shortcutBar instanceof ToolBar) { + ToolBar bar = (ToolBar) shortcutBar; + if (bar.getItemCount() > 0) { + ToolItem item = bar.getItem(0); + width = item.getWidth(); + Rectangle trim = + bar.computeTrim(0, 0, width, width); + width = trim.width; + } + } + } + + Point statusLineSize = + statusLine.computeSize( + SWT.DEFAULT, + SWT.DEFAULT, + flushCache); + statusLine.setBounds( + clientArea.x + width, + clientArea.y + clientArea.height - statusLineSize.y, + clientArea.width - width, + statusLineSize.y); + clientArea.height -= statusLineSize.y + VGAP; + } else + getStatusLineManager().getControl().setBounds( + 0, + 0, + 0, + 0); + } + } + + if (getShortcutBar() != null) { + Control shortCutBar = getShortcutBar().getControl(); + if (shortCutBar != null) { + if (getShowShortcutBar()) { + + int width = BAR_SIZE; + if (shortCutBar instanceof ToolBar) { + ToolBar bar = (ToolBar) shortCutBar; + if (bar.getItemCount() > 0) { + ToolItem item = bar.getItem(0); + width = item.getWidth(); + Rectangle trim = + bar.computeTrim(0, 0, width, width); + width = trim.width; + } + } + shortCutBar.setBounds( + clientArea.x, + clientArea.y, + width, + clientArea.height); + clientArea.x += width + VGAP; + clientArea.width -= width + VGAP; + } else + getShortcutBar().getControl().setBounds(0, 0, 0, 0); + } + } + + Control sep3 = getSeparator3(); + + if (sep3 != null) { + if (getShowShortcutBar()) { + Point sep3Size = + sep3.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache); + sep3.setBounds( + clientArea.x, + clientArea.y, + sep3Size.x, + clientArea.height); + clientArea.x += sep3Size.x; + } else + sep3.setBounds(0, 0, 0, 0); + } + + if (getClientComposite() != null) + getClientComposite().setBounds( + clientArea.x + CLIENT_INSET, + clientArea.y + CLIENT_INSET + VGAP, + clientArea.width - (2 * CLIENT_INSET), + clientArea.height - VGAP - (2 * CLIENT_INSET)); + + } + } + + /** + * @param args + */ + public static void main(String[] args) { + final Display display = new Display(); + Resources.setDisplay(display); + + // splash shell + final int loops = 15; + + final Shell splashShell = new Shell(SWT.ON_TOP); + final Splash splash = new Splash(splashShell, SWT.NONE); + splash.configureProgressBar(loops, 1); + splashShell.pack(); + SWTUtil.centerShellOnDisplay(splashShell, display); + + splashShell.open(); + + display.asyncExec(new Runnable() { + public void run() { + for (int i = 0; i < loops; i++) { + splash.increment(); + try { + Thread.sleep(500); + } catch (Throwable e) { + } + } + splashShell.close(); + splashShell.dispose(); + } + }); + + + Shell shell = new Shell(display); + ApplicationWindow window = new TCMSAdmin(shell); + window.open(); + } + + /** + * @return + */ + public PreferenceStore getPreferenceStore() { + if (_preferenceStore == null) { + _preferenceStore = new PreferenceStore("tcms-gui.properties"); + _preferenceStore.setDefault("host", REMOTE_HOST); + _preferenceStore.setDefault("port", Integer.parseInt(REMOTE_PORT)); + } + return _preferenceStore; + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/TCMSView.java b/src/gui/com/ejdoab/tcms/admin/TCMSView.java new file mode 100644 index 0000000..9ac0a41 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/TCMSView.java @@ -0,0 +1,9 @@ +package com.ejdoab.tcms.admin; + +/** + * @author Brian Sam-Bodden + */ +public interface TCMSView { + void loadData(Object[] items); + String getViewName(); +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractTableLabelProvider.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractTableLabelProvider.java new file mode 100644 index 0000000..c7e1d70 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractTableLabelProvider.java @@ -0,0 +1,84 @@ +package com.ejdoab.tcms.admin.abstracts; + +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Image; + +import com.ejdoab.tcms.admin.Resources; +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; + +/** + * @author Brian Sam-Bodden + */ +public class AbstractTableLabelProvider + implements ITableLabelProvider { + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) + */ + public Image getColumnImage(Object element, int column) { + if (column == 0) { + return Resources.getImageRegistry().get("icons_abstract"); + } + return null; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) + */ + public String getColumnText(Object element, int column) { + String result = null; + if (element instanceof ConferenceAbstractDTO) { + ConferenceAbstractDTO dto = (ConferenceAbstractDTO)element; + + switch (column) { + case 0 : + result = dto.getTitle(); + break; + case 1 : + result = dto.getType(); + break; + case 2 : + result = dto.getLevel(); + break; + case 3 : + result = dto.getPresenter(); + break; + } + } + + return result; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) + */ + public void addListener(ILabelProviderListener arg0) { + // TODO Auto-generated method stub + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() + */ + public void dispose() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) + */ + public boolean isLabelProperty(Object arg0, String arg1) { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) + */ + public void removeListener(ILabelProviderListener arg0) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/Abstracts.java b/src/gui/com/ejdoab/tcms/admin/abstracts/Abstracts.java new file mode 100644 index 0000000..c0345cd --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/Abstracts.java @@ -0,0 +1,151 @@ +package com.ejdoab.tcms.admin.abstracts; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.window.ApplicationWindow; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +import com.ejdoab.tcms.admin.Resources; +import com.ejdoab.tcms.admin.remote.ConferenceServicesProxy; +import com.ejdoab.tcms.admin.remote.RemoteServerException; +import com.ejdoab.tcms.admin.remote.ServiceProxyFactory; +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; + +/** + * Enables the creation of a new abstract + * Enables to edit and change the status of a submited abstract + * + * @author Brian Sam-Bodden + */ +public class Abstracts extends ApplicationWindow { + + AbstractsPage page; + Shell _shell; + + /** + * + */ + public Abstracts() { + super(null); + addMenuBar(); + } + + protected MenuManager createMenuManager() { + MenuManager mm = new MenuManager(""); + MenuManager fileMenu = new MenuManager("&File"); + mm.add(fileMenu); + fileMenu.add(loadDataAction); + return mm; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell(Shell shell) { + super.configureShell(shell); + _shell = shell; + _shell.setText("TCMS - Conference Abstracts"); + } + + protected void initializeBounds() { + _shell.setSize(1024, 768); + } + + protected Control createContents(Composite parent) { + + Composite c = new Composite(parent, SWT.NONE); + c.setLayout(new FillLayout()); + page = new AbstractsPage(c, SWT.NONE); + + return c; + } + + public static ConferenceAbstractDTO[] abstracts = null; + public static String[] topics = null; + public static String[] levels = null; + public static String[] types = null; + public static String[] status = null; + + /** + * @param args + */ + private static ConferenceServicesProxy service; + + public static void main(String[] args) { + ServiceProxyFactory factory = + new ServiceProxyFactory("localhost", "1099"); + try { + service = factory.getConferencesServices(); + abstracts = service.getAbstractAsArray(); + topics = service.getValidTopics(); + levels = service.getValidLevels(); + types = service.getValidTypes(); + status = service.getValidAbstractStatus(); + + System.out.println("\nTOPICS"); + for (int i = 0; i < topics.length; i++) { + System.out.println(topics[i]); + } + + System.out.println("\nLEVELS"); + for (int i = 0; i < levels.length; i++) { + System.out.println(levels[i]); + } + + System.out.println("\nTYPES"); + for (int i = 0; i < types.length; i++) { + System.out.println(types[i]); + } + + System.out.println("\nSTATUS"); + for (int i = 0; i < status.length; i++) { + System.out.println(status[i]); + } + + } catch (DTOCreateException dce) { + // TODO Auto-generated catch block + dce.printStackTrace(); + } catch (RemoteServerException rse) { + // TODO Auto-generated catch block + rse.printStackTrace(); + } + + + + Display display = new Display(); + Resources.setDisplay(display); + + Abstracts window = new Abstracts(); + + window.setBlockOnOpen(true); + window.open(); + Display.getCurrent().dispose(); } + + // + // + private IAction loadDataAction = new LoadDataAction(); + private class LoadDataAction extends Action { + public LoadDataAction() { + setToolTipText("Load Sample Data"); + setText("&Load"); + } + + public void run() { + page.setService(service); + page.setLevels(levels); + page.setTopics(topics); + page.setStatus(status); + page.setTypes(types); + page.loadData(Abstracts.abstracts); + } + } + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsDetailsWidget.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsDetailsWidget.java new file mode 100644 index 0000000..3f26d3e --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsDetailsWidget.java @@ -0,0 +1,326 @@ +package com.ejdoab.tcms.admin.abstracts; + +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.ejdoab.swt.util.SWTUtil; +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; + +/** + * An example of a custom composite widget + * + * @author Brian Sam-Bodden + */ +public class AbstractsDetailsWidget extends ScrolledComposite { + + private Text _title; + private CCombo _type; + private CCombo _topic; + private CCombo _level; + private CCombo _status; + private Button _presentations; + private Text _presenter; + + private ConferenceAbstractDTO _model; + + private boolean _modified = false; + + /** + * + */ + public AbstractsDetailsWidget(Composite parent) { + super(parent, SWT.H_SCROLL | SWT.V_SCROLL); + + // take as much client area as possible + setExpandHorizontal(true); + setExpandVertical(true); + + // internal composite in which to layout the children widgets + // using a grid layout + Composite grid = new Composite(this, SWT.NONE); + + // set the background color + grid.setBackground(SWTUtil.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); + + // create and set the grid layout + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + layout.verticalSpacing = 4; + layout.horizontalSpacing = 6; + grid.setLayout(layout); + + // add a title label + Label label = + SWTUtil.createLabel( + grid, + "Abstract Information:", + SWT.WRAP, + SWT.COLOR_LIST_BACKGROUND); + label.setFont(SWTUtil.getFont(JFaceResources.BANNER_FONT)); + + // separator + Composite separator = new Composite(grid, SWT.NONE); + separator.setBackground( + SWTUtil.getColor(separator, SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); + + GridData separatorGridData = new GridData(); + separatorGridData.horizontalSpan = 2; + separatorGridData.horizontalAlignment = GridData.FILL; + separatorGridData.grabExcessHorizontalSpace = true; + separatorGridData.verticalAlignment = GridData.BEGINNING; + separatorGridData.heightHint = 2; + separator.setLayoutData(separatorGridData); + + // title field + GridData titleGridData = new GridData(); + titleGridData.widthHint = 215; + + SWTUtil.createLabel(grid, "Title", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _title = SWTUtil.createText(grid, "", SWT.SINGLE | SWT.BORDER); + _title.setLayoutData(titleGridData); + + // type field + GridData typeGridData = new GridData(); + typeGridData.widthHint = 200; + + SWTUtil.createLabel(grid, "Type", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _type = new CCombo(grid, SWT.FLAT | SWT.BORDER); + _type.setLayoutData(typeGridData); + + // topic field + GridData topicGridData = new GridData(); + topicGridData.widthHint = 200; + + SWTUtil.createLabel(grid, "Topic", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _topic = new CCombo(grid, SWT.FLAT | SWT.BORDER); + + _topic.setLayoutData(topicGridData); + + // level field + GridData levelGridData = new GridData(); + levelGridData.widthHint = 200; + + SWTUtil.createLabel(grid, "Level", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _level = new CCombo(grid, SWT.FLAT | SWT.BORDER); + + _level.setLayoutData(levelGridData); + + // status field + GridData statusGridData = new GridData(); + statusGridData.widthHint = 200; + + SWTUtil.createLabel( + grid, + "Status", + SWT.FLAT, + SWT.COLOR_LIST_BACKGROUND); + _status = new CCombo(grid, SWT.FLAT | SWT.BORDER); + + _status.setLayoutData(statusGridData); + + // presentations field + SWTUtil.createLabel( + grid, + "has Presentations", + SWT.FLAT, + SWT.COLOR_LIST_BACKGROUND); + _presentations = new Button(grid, SWT.CHECK | SWT.FLAT); + _presentations.setBackground( + SWTUtil.getColor(_presentations, SWT.COLOR_LIST_BACKGROUND)); + _presentations.setText(""); + _presentations.setSelection(true); + _presentations.setEnabled(false); + + // presenter field + GridData presenterGridData = new GridData(); + presenterGridData.widthHint = 215; + + SWTUtil.createLabel( + grid, + "Presenter", + SWT.FLAT, + SWT.COLOR_LIST_BACKGROUND); + _presenter = SWTUtil.createText(grid, ""); + _presenter.setLayoutData(presenterGridData); + + // create and set internal listeners + ModifyListener modifyListener = new ModifyListener() { + public void modifyText(ModifyEvent e) { + onTextModified(e); + } + }; + + FocusListener focusListener = new FocusListener() { + public void focusGained(FocusEvent e) { + onFocusGained(e); + } + + public void focusLost(FocusEvent e) { + onFocusLost(e); + } + }; + + MouseListener mouseListener = new MouseAdapter() { + public void mouseDown(MouseEvent event) { + notifyListeners(SWT.FocusIn, new Event()); + _title.setFocus(); + } + }; + + _title.addModifyListener(modifyListener); + _type.addModifyListener(modifyListener); + _topic.addModifyListener(modifyListener); + _level.addModifyListener(modifyListener); + _status.addModifyListener(modifyListener); + _presenter.addModifyListener(modifyListener); + + _title.addFocusListener(focusListener); + _type.addFocusListener(focusListener); + _topic.addFocusListener(focusListener); + _level.addFocusListener(focusListener); + _status.addFocusListener(focusListener); + _presenter.addFocusListener(focusListener); + + label.addMouseListener(mouseListener); + grid.addMouseListener(mouseListener); + + // to ensure that scrollbars show up when needed + Point pt = grid.computeSize(SWT.DEFAULT, SWT.DEFAULT); + setMinWidth(pt.x); + setMinHeight(pt.y); + + // add the grid to the widget + setContent(grid); + } + + /** + * Pass contained widgets focus lost event + * to the parent + * + * @param event + */ + protected void onFocusLost(FocusEvent event) { + notifyListeners(SWT.FocusOut, new Event()); + } + + /** + * Pass contained widgets focus gained event + * to the parent + * + * @param event + */ + protected void onFocusGained(FocusEvent event) { + notifyListeners(SWT.FocusIn, new Event()); + } + + /** + * @param e + */ + protected void onTextModified(ModifyEvent e) { + _modified = !_loading; + } + + public void applyChanges() { + if (_modified && (!_loading)) { + _model.setTitle(_title.getText()); + _model.setLevel(_level.getItem(_level.getSelectionIndex())); + _model.setStatus(_status.getItem(_status.getSelectionIndex())); + _model.setTopic(_topic.getItem(_topic.getSelectionIndex())); + _model.setType(_type.getItem(_type.getSelectionIndex())); + } + } + + public ConferenceAbstractDTO getModel() { + return _model; + } + + public void setModel(ConferenceAbstractDTO model) { + _model = model; + populateData(); + } + + boolean _loading = false; + + protected void populateData() { + if (_model != null) { + _loading = true; + _title.setText(_model.getTitle()); + _presentations.setSelection(_model.hasPresentations()); + _presenter.setText(_model.getPresenter()); + _type.select(_type.indexOf(_model.getType())); + _topic.select(_topic.indexOf(_model.getTopic())); + _level.select(_level.indexOf(_model.getLevel())); + _status.select(_status.indexOf(_model.getStatus())); + _loading = false; + } + } + + /** + * @param strings + */ + public void setLevels(String[] strings) { + _level.setItems(strings); + } + + /** + * @param strings + */ + public void setStatus(String[] strings) { + _status.setItems(strings); + } + + /** + * @param strings + */ + public void setTopics(String[] strings) { + _topic.setItems(strings); + } + + /** + * @param strings + */ + public void setTypes(String[] strings) { + _type.setItems(strings); + } + + /** + * @return + */ + public boolean isModified() { + return _modified; + } + + /** + * @param b + */ + public void setModified(boolean b) { + _modified = b; + } + + /* Focus request are passed to the first editable field in + * this composite widget + * + * (non-Javadoc) + * @see org.eclipse.swt.widgets.Control#setFocus() + */ + public boolean setFocus() { + return _title.setFocus(); + } +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsModel.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsModel.java new file mode 100644 index 0000000..509a10c --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsModel.java @@ -0,0 +1,65 @@ +package com.ejdoab.tcms.admin.abstracts; + +import java.util.ArrayList; +import java.util.List; + +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; +import org.apache.commons.collections.CollectionUtils; + +/** + * @author Brian Sam-Bodden + * + */ +public class AbstractsModel { + List _abstracts; + AbstractsModelListener _listener; + + public AbstractsModel(Object[] abstracts) { + _abstracts = new ArrayList(); + CollectionUtils.addAll(_abstracts, abstracts); + } + + public Object[] getElements() { + return _abstracts.toArray(); + } + + public void addAbstract(ConferenceAbstractDTO dto) { + _abstracts.add(dto); + fireStructureChanged(); + } + + public void removeAbstract(ConferenceAbstractDTO dto) { + _abstracts.remove(dto); + fireStructureChanged(); + } + + public void setModified() { + fireStructureChanged(); + } + + /** + * + */ + private void fireStructureChanged() { + if (_listener != null) { + _listener.structureChanged(); + } + } + + // + // Listener methods + // + + public void addListener(AbstractsModelListener listener) { + _listener = listener; + } + + public void removeListener(AbstractsModelListener listener) { + if (_listener.equals(listener)) { + _listener = null; + } + } + + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsModelListener.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsModelListener.java new file mode 100644 index 0000000..1f24b7a --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsModelListener.java @@ -0,0 +1,14 @@ +package com.ejdoab.tcms.admin.abstracts; + + +/** + * @author Brian Sam-Bodden + */ +public interface AbstractsModelListener { + + /** + * + */ + void structureChanged(); + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsPage.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsPage.java new file mode 100644 index 0000000..71b2e0e --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsPage.java @@ -0,0 +1,304 @@ +package com.ejdoab.tcms.admin.abstracts; + +import org.eclipse.compare.CompareViewerPane; +import org.eclipse.compare.Splitter; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; + +import com.ejdoab.swt.util.SWTUtil; +import com.ejdoab.tcms.admin.BaseTCMSView; +import com.ejdoab.tcms.admin.Resources; +import com.ejdoab.tcms.admin.remote.ConferenceServicesProxy; +import com.ejdoab.tcms.admin.remote.RemoteServerException; +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; + +/** + * + * @author Brian Sam-Bodden + */ +public class AbstractsPage extends BaseTCMSView { + TableViewer _tableViewer = null; + + Splitter _subForm; + Splitter _mainForm; + + CompareViewerPane _detailsForm; + Composite _detailsSubForm; + + CompareViewerPane _textForm; + Composite _textSubForm; + + CompareViewerPane _abstractsTableForm; + Composite _abstractsTableSubForm; + + StyledText _text; + + AbstractsDetailsWidget _details; + + AbstractsModel _model; + + private ConferenceAbstractDTO _selected = null; + private boolean _textModified = false; + + /** + * @param arg0 + * @param arg1 + */ + public AbstractsPage(Composite parent, int style) { + super(parent, style); + setLayout(new FillLayout()); + + _mainForm = new Splitter(this, SWT.HORIZONTAL); + createTableViewForm(_mainForm); + + _subForm = new Splitter(_mainForm, SWT.VERTICAL); + createTextEditorForm(_subForm); + createDetailsForm(_subForm); + } + + /** + * @param sashForm + */ + private void createTableViewForm(SashForm sashForm) { + _abstractsTableForm = new CompareViewerPane(sashForm, SWT.BORDER); + _abstractsTableForm.setText("Abstracts"); + _abstractsTableForm.setImage(Resources.getImageRegistry().get("icons_abstracts")); + + SWTUtil.CLabelFocusListener gradientHandler = + new SWTUtil.CLabelFocusListener(_abstractsTableForm); + SWTUtil.CLabelMouseAdapter cma = + new SWTUtil.CLabelMouseAdapter(_abstractsTableForm); + + _abstractsTableSubForm = new Composite(_abstractsTableForm, SWT.NONE); + _abstractsTableSubForm.setLayout(new FillLayout()); + + _tableViewer = new TableViewer(_abstractsTableSubForm, SWT.BORDER); + _tableViewer.setContentProvider( + new AbstractsTableContentProvider()); + _tableViewer.setLabelProvider( + new AbstractTableLabelProvider()); + + SWTUtil.addTableColumn( + _tableViewer, + "Title", + 140, + new AbstractsViewerSorter( + AbstractsViewerSorter.SORT_CRITERIA_TITLE)); + + SWTUtil.addTableColumn( + _tableViewer, + "Type", + 60, + new AbstractsViewerSorter( + AbstractsViewerSorter.SORT_CRITERIA_TYPE)); + + SWTUtil.addTableColumn( + _tableViewer, + "Level", + 60, + new AbstractsViewerSorter( + AbstractsViewerSorter.SORT_CRITERIA_LEVEL)); + + SWTUtil.addTableColumn( + _tableViewer, + "Presenter", + 140, + new AbstractsViewerSorter( + AbstractsViewerSorter.SORT_CRITERIA_PRESENTER)); + + _tableViewer.getTable().setHeaderVisible(true); + + _tableViewer + .addSelectionChangedListener(new ISelectionChangedListener() { + + public void selectionChanged(SelectionChangedEvent event) { + if (_details.isModified() || _textModified) { + // prompt to save modifications + checkToSave(_selected); + } + IStructuredSelection selection = + (IStructuredSelection) event.getSelection(); + _selected = (ConferenceAbstractDTO) selection.getFirstElement(); + _text.removeModifyListener(_textModifiedListener); + if (_selected != null) { + _text.setText(_selected.getBody()); + _text.addModifyListener(_textModifiedListener); + _details.setModel(_selected); + } + } + }); + + _tableViewer.getTable().addFocusListener(gradientHandler); + + _abstractsTableForm.setContent(_abstractsTableSubForm); + } + + + + private class TextModifiedListener implements ModifyListener { + + public void modifyText(ModifyEvent event) { + _textModified = true; + _selected.setBody(_text.getText()); + } + } + + private TextModifiedListener _textModifiedListener = new TextModifiedListener(); + + /** + * @param sashForm + */ + private void createTextEditorForm(SashForm sashForm) { + _textForm = new CompareViewerPane(sashForm, SWT.BORDER); + _textForm.setText("Abstract's Text"); + _textForm.setImage(Resources.getImageRegistry().get("icons_abstract_edit")); + SWTUtil.CLabelFocusListener gradientHandler = + new SWTUtil.CLabelFocusListener(_textForm); + SWTUtil.CLabelMouseAdapter cma = + new SWTUtil.CLabelMouseAdapter(_textForm); + _textSubForm = new Composite(_textForm, SWT.NONE); + _textSubForm.setLayout(new FillLayout()); + + _text = + new StyledText( + _textSubForm, + SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.WRAP); + _text.addFocusListener(gradientHandler); + _textForm.setContent(_textSubForm); + } + + /** + * @param sashForm + */ + private void createDetailsForm(SashForm sashForm) { + _detailsForm = new CompareViewerPane(sashForm, SWT.BORDER); + _detailsForm.setText("Details"); + _detailsForm.setImage(Resources.getImageRegistry().get("icons_details")); + SWTUtil.CLabelFocusListener gradientHandler = + new SWTUtil.CLabelFocusListener(_detailsForm); + SWTUtil.CLabelMouseAdapter cma = + new SWTUtil.CLabelMouseAdapter(_detailsForm); + + _detailsSubForm = new Composite(_detailsForm, SWT.NONE); + _detailsSubForm.setLayout(new FillLayout()); + + _details = new AbstractsDetailsWidget(_detailsSubForm); + _details.addFocusListener(gradientHandler); + _detailsForm.setContent(_detailsSubForm); + } + + public static Object[] abstracts = null; + public String[] topics = null; + public String[] levels = null; + public String[] types = null; + public String[] status = null; + + /** + * @param args + */ + private ConferenceServicesProxy _service; + + private void checkToSave(ConferenceAbstractDTO selected) { + MessageDialog dialog = + new MessageDialog( + this.getShell(), + "Abstract Modified", + null, + "Abstract Information for [" + + selected.getTitle() + + "] has been modified. Commit changes to the server?", + MessageDialog.QUESTION, + new String[] { + "&Commit", + "&Ignore Changes", + IDialogConstants.CANCEL_LABEL }, + 0); + + dialog.open(); + int rc = dialog.getReturnCode(); + switch (rc) { + case 0 : // save the changes + try { + System.out.println("Commit selected"); + if (_details.isModified()) { + _details.applyChanges(); + } + + if (_service.submitAbstract(selected)) { + System.out.println("commit succeded"); + _details.setModified(false); + _textModified = false; + _model.setModified(); + } + + } catch (DTOUpdateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (RemoteServerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + break; + case 1 : // don't save the changes + _details.setModified(false); + _textModified = false; + case 2 : // cancel + break; + } + } + + /** + * @param strings + */ + public void setLevels(String[] strings) { + _details.setLevels(strings); + } + + /** + * @param strings + */ + public void setStatus(String[] strings) { + _details.setStatus(strings); + } + + /** + * @param strings + */ + public void setTopics(String[] strings) { + _details.setTopics(strings); + } + + /** + * @param strings + */ + public void setTypes(String[] strings) { + _details.setTypes(strings); + } + + public void loadData(Object[] data) { + if (_tableViewer != null) { + _model = new AbstractsModel(data); + _tableViewer.setInput(_model); + } + } + + /** + * @param proxy + */ + public void setService(ConferenceServicesProxy proxy) { + _service = proxy; + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsTableContentProvider.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsTableContentProvider.java new file mode 100644 index 0000000..61f0273 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsTableContentProvider.java @@ -0,0 +1,60 @@ +package com.ejdoab.tcms.admin.abstracts; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; + +import com.ejdoab.tcms.util.Arrays; + +/** + * @author Brian Sam-Bodden + */ +public class AbstractsTableContentProvider + implements IStructuredContentProvider, AbstractsModelListener { + + AbstractsModel _model; + TableViewer _viewer; + + public AbstractsTableContentProvider() { + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) + */ + public Object[] getElements(Object element) { + if (_model != null) { + return _model.getElements(); + } + + return Arrays.EMPTY_OBJECT_ARRAY; + } + + public void dispose() { + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + _viewer = (TableViewer) viewer; + + if (oldInput != null) { + AbstractsModel oldModel = (AbstractsModel) oldInput; + oldModel.removeListener(this); + _model = null; + } + + if (newInput != null) { + AbstractsModel newModel = (AbstractsModel) newInput; + newModel.addListener(this); + _model = newModel; + } + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.admin.abstracts.AbstractsModelListener#structureChanged() + */ + public void structureChanged() { + _viewer.refresh(); + } + + + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsViewerSorter.java b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsViewerSorter.java new file mode 100644 index 0000000..888037e --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/AbstractsViewerSorter.java @@ -0,0 +1,56 @@ +package com.ejdoab.tcms.admin.abstracts; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerSorter; + +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; + +/** + * Used by the table viewer to reorder the elements provided by its + * content provider. + + * @author Brian Sam-Bodden + */ +public class AbstractsViewerSorter extends ViewerSorter { + + public final static int SORT_CRITERIA_TITLE = 0; + public final static int SORT_CRITERIA_TYPE = 1; + public final static int SORT_CRITERIA_LEVEL = 2; + public final static int SORT_CRITERIA_PRESENTER = 3; + + private int _criteria; + + public AbstractsViewerSorter(int criteria) { + super(); + _criteria = criteria; + } + + public int compare(Viewer viewer, Object o1, Object o2) { + + ConferenceAbstractDTO dto1 = (ConferenceAbstractDTO) o1; + ConferenceAbstractDTO dto2 = (ConferenceAbstractDTO) o2; + + switch (_criteria) { + case SORT_CRITERIA_TITLE : + return collator.compare(dto1.getTitle(), dto2.getTitle()); + case SORT_CRITERIA_TYPE : + return collator.compare(dto1.getType(), dto2.getType()); + case SORT_CRITERIA_LEVEL : + return collator.compare(dto1.getLevel(), dto2.getLevel()); + case SORT_CRITERIA_PRESENTER : + return collator.compare(dto1.getPresenter(), dto2.getPresenter()); + default: + return 0; + } + } + + /** + * Returns the sort criteria of this this sorter. + * + * @return the sort criterion + */ + public int getCriteria() { + return _criteria; + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Entries b/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Entries new file mode 100644 index 0000000..6aec6c8 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Entries @@ -0,0 +1,8 @@ +/AbstractTableLabelProvider.java/1.1/Mon Sep 1 03:56:58 2003// +/Abstracts.java/1.1/Mon Sep 1 03:56:59 2003// +/AbstractsDetailsWidget.java/1.1/Mon Sep 1 03:56:59 2003// +/AbstractsModel.java/1.2/Thu Sep 11 04:13:05 2003// +/AbstractsModelListener.java/1.1/Mon Sep 1 03:56:58 2003// +/AbstractsPage.java/1.1/Mon Sep 1 03:56:58 2003// +/AbstractsTableContentProvider.java/1.1/Mon Sep 1 03:56:59 2003// +/AbstractsViewerSorter.java/1.1/Mon Sep 1 03:56:59 2003// diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Repository b/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Repository new file mode 100644 index 0000000..8158175 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab/tcms/admin/abstracts diff --git a/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Root b/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/abstracts/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/tcms/admin/news/CVS/Entries b/src/gui/com/ejdoab/tcms/admin/news/CVS/Entries new file mode 100644 index 0000000..e23b94a --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/CVS/Entries @@ -0,0 +1,8 @@ +/News.java/1.4/Mon Sep 1 03:56:53 2003// +/NewsItemDetailsWidget.java/1.3/Mon Sep 1 03:56:53 2003// +/NewsItemWizard.java/1.5/Fri Sep 12 13:00:03 2003// +/NewsModel.java/1.1/Mon Sep 1 03:56:53 2003// +/NewsModelListener.java/1.1/Mon Sep 1 03:56:53 2003// +/NewsPage.java/1.4/Fri Sep 12 13:00:03 2003// +/NewsTreeContentProvider.java/1.2/Mon Sep 1 03:56:53 2003// +/NewsTreeLabelProvider.java/1.2/Mon Sep 1 03:56:53 2003// diff --git a/src/gui/com/ejdoab/tcms/admin/news/CVS/Repository b/src/gui/com/ejdoab/tcms/admin/news/CVS/Repository new file mode 100644 index 0000000..c48b115 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/CVS/Repository @@ -0,0 +1 @@ +tcms/src/gui/com/ejdoab/tcms/admin/news diff --git a/src/gui/com/ejdoab/tcms/admin/news/CVS/Root b/src/gui/com/ejdoab/tcms/admin/news/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/gui/com/ejdoab/tcms/admin/news/News.java b/src/gui/com/ejdoab/tcms/admin/news/News.java new file mode 100644 index 0000000..cd9dce0 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/News.java @@ -0,0 +1,127 @@ +package com.ejdoab.tcms.admin.news; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.window.ApplicationWindow; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +import com.ejdoab.tcms.admin.Resources; +import com.ejdoab.tcms.admin.remote.ConferenceServicesProxy; +import com.ejdoab.tcms.admin.remote.RemoteServerException; +import com.ejdoab.tcms.admin.remote.ServiceProxyFactory; +import com.ejdoab.tcms.services.dto.NewsItemDTO; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; + +/** + * Enables the creation of a new abstract + * Enables to edit and change the status of a submited abstract + * + * @author Brian Sam-Bodden + */ +public class News extends ApplicationWindow { + + private Shell _shell; + + + NewsPage page; + + /** + * + */ + public News() { + super(null); + addMenuBar(); + } + + protected MenuManager createMenuManager() { + MenuManager mm = new MenuManager(""); + MenuManager fileMenu = new MenuManager("&File"); + mm.add(fileMenu); + fileMenu.add(loadDataAction); + return mm; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell(Shell shell) { + super.configureShell(shell); + _shell = shell; + _shell.setText("TCMS - News"); + } + + protected void initializeBounds() { + _shell.setSize(1024, 768); + } + + protected Control createContents(Composite parent) { + + Composite c = new Composite(parent, SWT.NONE); + c.setLayout(new FillLayout()); + page = new NewsPage(c, SWT.NONE); + + return c; + } + + public static NewsItemDTO[] news = null; + + + /** + * @param args + */ + private static ConferenceServicesProxy service; + + public static void main(String[] args) { + ServiceProxyFactory factory = + new ServiceProxyFactory("localhost", "1099"); + try { + service = factory.getConferencesServices(); + news = service.getNewsAsArray(); + } catch (DTOCreateException dce) { + // TODO Auto-generated catch block + dce.printStackTrace(); + } catch (RemoteServerException rse) { + // TODO Auto-generated catch block + rse.printStackTrace(); + } + + Display display = new Display(); + Resources.setDisplay(display); + + News window = new News(); + NewsPage page = window.getPage(); + + window.setBlockOnOpen(true); + window.open(); + Display.getCurrent().dispose(); + } + + // + // + private IAction loadDataAction = new LoadDataAction(); + private class LoadDataAction extends Action { + public LoadDataAction() { + setToolTipText("Load Sample Data"); + setText("&Load"); + } + + public void run() { + page.setService(service); + page.loadData(news); + } + } + + /** + * @return + */ + public NewsPage getPage() { + return page; + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/news/NewsItemDetailsWidget.java b/src/gui/com/ejdoab/tcms/admin/news/NewsItemDetailsWidget.java new file mode 100644 index 0000000..50b3183 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/NewsItemDetailsWidget.java @@ -0,0 +1,271 @@ +package com.ejdoab.tcms.admin.news; + +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.ejdoab.swt.util.SWTUtil; +import com.ejdoab.tcms.services.dto.NewsItemDTO; +import com.ejdoab.tcms.util.Dates; + +/** + * An example of a custom composite widget + * + * @author Brian Sam-Bodden + */ +public class NewsItemDetailsWidget extends ScrolledComposite { + + private Text _title; + private Text _removeDate; + private Text _creationDate; + private Button _published; + + private NewsItemDTO _model; + + private boolean _modified = false; + + /** + * + */ + public NewsItemDetailsWidget(Composite parent) { + super(parent, SWT.H_SCROLL | SWT.V_SCROLL); + + // take as much client area as possible + setExpandHorizontal(true); + setExpandVertical(true); + + // internal composite in which to layout the children widgets + // using a grid layout + Composite grid = new Composite(this, SWT.NONE); + + // set the background color + grid.setBackground(SWTUtil.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); + + // create and set the grid layout + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + layout.verticalSpacing = 4; + layout.horizontalSpacing = 6; + grid.setLayout(layout); + + // add a title label + Label label = + SWTUtil.createLabel( + grid, + "News Item Information:", + SWT.WRAP, + SWT.COLOR_LIST_BACKGROUND); + label.setFont(SWTUtil.getFont(JFaceResources.BANNER_FONT)); + + // separator + Composite separator = new Composite(grid, SWT.NONE); + separator.setBackground( + SWTUtil.getColor(separator, SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); + + GridData separatorGridData = new GridData(); + separatorGridData.horizontalSpan = 2; + separatorGridData.horizontalAlignment = GridData.FILL; + separatorGridData.grabExcessHorizontalSpace = true; + separatorGridData.verticalAlignment = GridData.BEGINNING; + separatorGridData.heightHint = 2; + separator.setLayoutData(separatorGridData); + + // title field + GridData titleGridData = new GridData(); + titleGridData.widthHint = 215; + + SWTUtil.createLabel(grid, "Title", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _title = SWTUtil.createText(grid, "", SWT.SINGLE | SWT.BORDER); + _title.setLayoutData(titleGridData); + + // removal date field + GridData typeGridData = new GridData(); + typeGridData.widthHint = 215; + + SWTUtil.createLabel(grid, "Removal Date", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _removeDate = SWTUtil.createText(grid, "", SWT.SINGLE | SWT.BORDER); + _removeDate.setLayoutData(typeGridData); + + // creation date field + GridData topicGridData = new GridData(); + topicGridData.widthHint = 215; + + SWTUtil.createLabel(grid, "Creation Date:", SWT.FLAT, SWT.COLOR_LIST_BACKGROUND); + _creationDate = SWTUtil.createText(grid, "", SWT.SINGLE | SWT.BORDER); + _creationDate.setLayoutData(topicGridData); + + // is published field + SWTUtil.createLabel( + grid, + "Has been Published?", + SWT.FLAT, + SWT.COLOR_LIST_BACKGROUND); + _published = new Button(grid, SWT.CHECK | SWT.FLAT); + _published.setBackground( + SWTUtil.getColor(_published, SWT.COLOR_LIST_BACKGROUND)); + _published.setText(""); + + // create and set internal listeners + ModifyListener modifyListener = new ModifyListener() { + public void modifyText(ModifyEvent e) { + onTextModified(e); + } + }; + + SelectionListener selectionListener = new SelectionListener() { + + public void widgetSelected(SelectionEvent e) { + onPublished(e); + } + + public void widgetDefaultSelected(SelectionEvent e) { + onPublished(e); + } + }; + + FocusListener focusListener = new FocusListener() { + public void focusGained(FocusEvent e) { + onFocusGained(e); + } + + public void focusLost(FocusEvent e) { + onFocusLost(e); + } + }; + + MouseListener mouseListener = new MouseAdapter() { + public void mouseDown(MouseEvent event) { + notifyListeners(SWT.FocusIn, new Event()); + _title.setFocus(); + } + }; + + _title.addModifyListener(modifyListener); + _removeDate.addModifyListener(modifyListener); + _creationDate.addModifyListener(modifyListener); + _published.addSelectionListener(selectionListener); + + _title.addFocusListener(focusListener); + _removeDate.addFocusListener(focusListener); + _creationDate.addFocusListener(focusListener); + + label.addMouseListener(mouseListener); + grid.addMouseListener(mouseListener); + + // to ensure that scrollbars show up when needed + Point pt = grid.computeSize(SWT.DEFAULT, SWT.DEFAULT); + setMinWidth(pt.x); + setMinHeight(pt.y); + + // add the grid to the widget + setContent(grid); + } + + /** + * Pass contained widgets focus lost event + * to the parent + * + * @param event + */ + protected void onFocusLost(FocusEvent event) { + notifyListeners(SWT.FocusOut, new Event()); + } + + /** + * Pass contained widgets focus gained event + * to the parent + * + * @param event + */ + protected void onFocusGained(FocusEvent event) { + notifyListeners(SWT.FocusIn, new Event()); + } + + /** + * @param e + */ + protected void onTextModified(ModifyEvent e) { + _modified = !_loading; + } + + /** + * @param e + */ + protected void onPublished(SelectionEvent e) { + _modified = !_loading; + } + + public NewsItemDTO getModel() { + return _model; + } + + public void applyChanges() { + if (_modified && (!_loading)) { + _model.setTitle(_title.getText()); + _model.setCreationDate(Dates.getDate(_creationDate.getText(), Dates.DATE_MMddyyyy)); + _model.setRemoveDate(Dates.getDate(_removeDate.getText(), Dates.DATE_MMddyyyy)); + _model.setPublished(_published.getSelection()); + } + } + + public void setModel(NewsItemDTO model) { + _model = model; + populateData(); + } + + boolean _loading = false; + + protected void populateData() { + if (_model != null) { + _loading = true; + _title.setText(_model.getTitle()); + _published.setSelection(_model.isPublished()); + _published.setEnabled(!_model.isPublished()); + + _creationDate.setText(Dates.format(_model.getCreationdate(), Dates.DATE_MMddyyyy)); + _removeDate.setText(Dates.format(_model.getRemovedate(), Dates.DATE_MMddyyyy)); + _loading = false; + } + } + + /** + * @return + */ + public boolean isModified() { + return _modified; + } + + /** + * @param b + */ + public void setModified(boolean b) { + _modified = b; + } + + /* Focus request are passed to the first editable field in + * this composite widget + * + * (non-Javadoc) + * @see org.eclipse.swt.widgets.Control#setFocus() + */ + public boolean setFocus() { + return _title.setFocus(); + } +} diff --git a/src/gui/com/ejdoab/tcms/admin/news/NewsItemWizard.java b/src/gui/com/ejdoab/tcms/admin/news/NewsItemWizard.java new file mode 100644 index 0000000..af147d6 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/NewsItemWizard.java @@ -0,0 +1,488 @@ +package com.ejdoab.tcms.admin.news; + +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.util.Date; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.io.FileUtils; +import org.eclipse.jface.preference.FileFieldEditor; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Text; + +import com.ejdoab.swt.util.SWTUtil; +import com.ejdoab.tcms.util.Dates; + +import com.ejdoab.tcms.admin.remote.ConferenceServicesProxy; +import com.ejdoab.tcms.admin.remote.RemoteServerException; +import com.ejdoab.tcms.services.dto.NewsItemDTO; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; + +/** + * @author Brian Sam-Bodden + */ +public class NewsItemWizard extends Wizard { + + // wizard page instances + private NewsItemBasicInfoPage basicInfoPage = new NewsItemBasicInfoPage(); + private NewsItemTextPage textPage = new NewsItemTextPage(); + + private ConferenceServicesProxy _service; + private NewsModel _model; + private String _dateString; + private Date _date; + + public NewsItemWizard(NewsModel model, String date) { + _model = model; + _dateString = date; + + DateFormat format = Dates.createDateFormat(Dates.DATE_MMddyyyy); + try { + _date = format.parse(_dateString); + } catch (ParseException e) { + //TODO what do we do here? + } + setWindowTitle("New News Article"); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.IWizard#addPages() + */ + public void addPages() { + addPage(basicInfoPage); + addPage(textPage); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.IWizard#performFinish() + */ + public boolean performFinish() { + String title = basicInfoPage.getArticleTitle(); + Date creationDate = basicInfoPage.getCreationDateAsDate(); + String creationDateAsString = basicInfoPage.getCreationDate(); + Date removalDate = basicInfoPage.getRemoveDateAsDate(); + String removalDateAsString = basicInfoPage.getRemoveDate(); + String body = textPage.getArticleBody(); + + System.out.println( + "Creating new article " + + title + + '\n' + + "created on " + + creationDateAsString + + '\n' + + "to be removed on " + + removalDateAsString + + '\n' + + " contents: \n" + + body); + + boolean submitted = false; + + NewsItemDTO dto = new NewsItemDTO(-1, _date, removalDate, creationDate, false, title, body); + if (_service != null) { + try { + submitted = _service.submitNewsItem(dto); + if (submitted) { + _model.add(dto); + } + } catch (DTOUpdateException e) { + submitted = false; + } catch (RemoteServerException e) { + submitted = false; + } + } + else { + //TODO log that there was no remote service available + } + + + return submitted; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.IWizard#canFinish() + */ + public boolean canFinish() { + return basicInfoPage.canFlipToNextPage() + && (StringUtils.isNotEmpty(textPage.getArticleBody())); + } + + /** + * Convenience utility method to display the Wizard + */ + public void showWizard() { + WizardDialog dialog = new WizardDialog(getShell(), this); + dialog.open(); + } + + /** + * @param proxy + */ + public void setService(ConferenceServicesProxy proxy) { + _service = proxy; + } + + // ------------------------------------------------------------------------ + // Wizard Pages + // ------------------------------------------------------------------------ + + // + // NewsItemBasicInfoPage Wizard Page + // + private class NewsItemBasicInfoPage + extends WizardPage + implements Listener { + public NewsItemBasicInfoPage() { + super("NewsItemBasicInfoPage"); + setTitle("News Article"); + setDescription(""); //TODO where does this show up? + setMessage("Create a New News Article"); + } + + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + composite.setLayout(layout); + + // title field + SWTUtil.createLabel(composite, "Article's Title:", SWT.NULL); + _title = SWTUtil.createText(composite, "", SWT.SINGLE | SWT.BORDER); + { + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + _title.setLayoutData(gridData); + } + + // add a separator + SWTUtil.createHorizontalGridSeparator(composite); + + // created on field + SWTUtil.createLabel(composite, "Created on:", SWT.NULL); + _creationDate = + SWTUtil.createText(composite, "", SWT.SINGLE | SWT.BORDER); + { + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + _creationDate.setLayoutData(gridData); + } + + // remove on field + SWTUtil.createLabel(composite, "Remove on:", SWT.NULL); + _removeDate = + SWTUtil.createText(composite, "", SWT.SINGLE | SWT.BORDER); + { + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + _removeDate.setLayoutData(gridData); + } + + setControl(composite); + setDefaults(); + addListeners(); + } + + private Text _title; + private Text _removeDate; + private Text _creationDate; + private Date _creationDateAsDate; + private Date _removalDateAsDate; + + boolean _canFlipToNextPage = false; + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.IWizardPage#canFlipToNextPage() + */ + public boolean canFlipToNextPage() { + boolean validateDates = false; + boolean result = true; + + if (StringUtils.isEmpty(getArticleTitle())) { + result = false; + + } else if ((getArticleTitle().length() > 32)) { + result = false; + } + + if (StringUtils.isEmpty(getCreationDate())) { + result = false; + } else if ( + !Dates.isInFormat(getCreationDate(), Dates.DATE_MMddyyyy)) { + result = false; + } else { + validateDates = true; + } + + if (StringUtils.isEmpty(getRemoveDate())) { + result = false; + } else if ( + !Dates.isInFormat(getRemoveDate(), Dates.DATE_MMddyyyy)) { + result = false; + } else { + validateDates = validateDates && true; + } + + if (validateDates) { + DateFormat format = Dates.createDateFormat(Dates.DATE_MMddyyyy); + try { + _creationDateAsDate = format.parse(getCreationDate()); + _removalDateAsDate = format.parse(getRemoveDate()); + + if (_creationDateAsDate.after(_removalDateAsDate)) { + result = false; + } + } catch (ParseException e) { + result = false; + } + } + + return result; + } + + /** + * @return + */ + public String getCreationDate() { + return _creationDate.getText(); + } + + public Date getCreationDateAsDate() { + return _creationDateAsDate; + } + + /** + * @return + */ + public String getRemoveDate() { + return _removeDate.getText(); + } + + /** + * @return + */ + public Date getRemoveDateAsDate() { + return _removalDateAsDate; + } + + /** + * @return + */ + public String getArticleTitle() { + return _title.getText(); + } + + /* + * Untyped listener + * + * (non-Javadoc) + * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event) + */ + public void handleEvent(Event event) { + // Guideline 4.5 - from http://www.eclipse.org/articles/Article-UI-Guidelines + // Validate the wizard data in tab order. Display a prompt when + // information is absent, and an error when information is invalid. + setErrorMessage(null); + setMessage("Create a New News Article"); + + boolean validateDates = false; + + if (event.widget == _title) { + if (StringUtils.isEmpty(getArticleTitle())) { + setMessage( + "Enter the new Article's Title", + WizardPage.NONE); + } else if ( + (getArticleTitle().length() > 32) + && (event.type == SWT.KeyUp)) { + setMessage( + "Article Title cannot be longer than 32 characters", + WizardPage.ERROR); + } + } else if (event.widget == _creationDate) { + if (StringUtils.isEmpty(getCreationDate())) { + setMessage( + "Enter/Modify the Article's Creation Date", + WizardPage.NONE); + } else if ( + !Dates.isInFormat(getCreationDate(), Dates.DATE_MMddyyyy) + && (event.type == SWT.KeyUp)) { + setMessage( + "Creation Date must be in MM-dd-yyyy format", + WizardPage.ERROR); + } else { + validateDates = (event.type == SWT.KeyUp); + } + } else if (event.widget == _removeDate) { + if (StringUtils.isEmpty(getRemoveDate())) { + setMessage( + "Enter the Article's Removal Date", + WizardPage.NONE); + } else if ( + !Dates.isInFormat(getRemoveDate(), Dates.DATE_MMddyyyy) + && (event.type == SWT.KeyUp)) { + setMessage( + "Removal Date must be in MM-dd-yyyy format", + WizardPage.ERROR); + } else { + validateDates = (event.type == SWT.KeyUp); + } + } + + if (validateDates) { + DateFormat format = Dates.createDateFormat(Dates.DATE_MMddyyyy); + try { + Date creationDate = format.parse(getCreationDate()); + Date removalDate = format.parse(getRemoveDate()); + + if (creationDate.after(removalDate)) { + setMessage( + "Removal Date cannot be before Creation Date", + WizardPage.ERROR); + } + } catch (ParseException e) { + // add an assertion here this should never happen! + } + } + + // update the wizard buttons by invoking canFinish and canFlipToNextPage + getWizard().getContainer().updateButtons(); + } + + /** + * + */ + private void addListeners() { + _title.addListener(SWT.KeyUp, this); + _removeDate.addListener(SWT.KeyUp, this); + _creationDate.addListener(SWT.KeyUp, this); + _title.addListener(SWT.FocusIn, this); + _removeDate.addListener(SWT.FocusIn, this); + _creationDate.addListener(SWT.FocusIn, this); + } + + /** + * + */ + private void setDefaults() { + _creationDate.setText( + Dates.format(System.currentTimeMillis(), Dates.DATE_MMddyyyy)); + } + + } + + // + // NewsItemTextPage Wizard Page + // + private class NewsItemTextPage extends WizardPage implements Listener { + public NewsItemTextPage() { + super("NewsItemTextPage"); + setTitle("News Article"); + setDescription(""); //TODO where does this show up? + setMessage("Create a New News Article"); + } + + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(); + int columns = 3; + layout.numColumns = columns; + composite.setLayout(layout); + + // file field editor + _fileFieldEditor = + new FileFieldEditor("fileFieldEditor", "File Name:", composite); + _fileFieldEditor.setEmptyStringAllowed(false); + { + GridData gridData = new GridData(); + gridData.widthHint = 300; + _fileFieldEditor.getTextControl(composite).setLayoutData( + gridData); + } + + // get the text field out of the editor + _fileName = _fileFieldEditor.getTextControl(composite); + _fileName.setEditable(false); + + // add a separator + SWTUtil.createHorizontalGridSeparator(composite); + + // article body field + SWTUtil.createLabel(composite, "Article Body:", SWT.NULL); + + _text = + new StyledText( + composite, + SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.WRAP); + { + GridData gridData = new GridData(GridData.FILL_BOTH); + gridData.horizontalSpan = columns; + _text.setLayoutData(gridData); + } + + setControl(composite); + addListeners(); + } + + private FileFieldEditor _fileFieldEditor; + private StyledText _text; + private Text _fileName; + + public String getArticleBody() { + return StringUtils.trim(_text.getText()); + } + + private void addListeners() { + _text.addListener(SWT.Modify, this); + _text.addListener(SWT.FocusIn, this); + _fileName.addListener(SWT.Modify, this); + } + + /* (non-Javadoc) + * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event) + */ + public void handleEvent(Event event) { + if (event.widget == _text) { + switch (event.type) { + case SWT.Modify : + if (StringUtils.isEmpty(getArticleBody())) { + setMessage( + "Enter the new Article's Body", + WizardPage.NONE); + } + break; + case SWT.FocusIn : + setMessage( + "Enter the new Article's Body", + WizardPage.NONE); + break; + } + } else if (event.widget == _fileName) { + switch (event.type) { + case SWT.Modify : + System.out.println("File name text changed"); + try { + String fileContents = + FileUtils.fileRead(_fileName.getText()); + _text.setText(fileContents); + } catch (IOException e) { + setMessage( + "File " + _fileName.getText() + " not found", + WizardPage.ERROR); + } + break; + } + } + // update the wizard buttons by invoking canFinish and canFlipToNextPage + getWizard().getContainer().updateButtons(); + } + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/news/NewsModel.java b/src/gui/com/ejdoab/tcms/admin/news/NewsModel.java new file mode 100644 index 0000000..1025f56 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/NewsModel.java @@ -0,0 +1,164 @@ +package com.ejdoab.tcms.admin.news; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections.CollectionUtils; + +import com.ejdoab.tcms.services.dto.NewsItemDTO; +import com.ejdoab.tcms.util.Arrays; +import com.ejdoab.tcms.util.Dates; + +/** + * @author Brian Sam-Bodden + */ +public class NewsModel { + + private List _newsItems; + private Map _model = new HashMap(); + + private NewsModelListener _listener; + + /** + * + */ + public NewsModel(Object[] newsItems) { + super(); + _newsItems = new ArrayList(newsItems.length); + CollectionUtils.addAll(_newsItems, newsItems); + createModel(); + } + + public void add(NewsItemDTO newsItem) { + Date date = newsItem.getDate(); + String key = Dates.format(date, "MM-dd-yyyy"); + List items = null; + if (!_model.containsKey(key)) { + items = new ArrayList(); + _model.put(key, items); + } + + if (items == null) { + items = (List)_model.get(key); + } + + // add assertion here for items != null + items.add(newsItem); + fireModelChanged(); + } + + protected void fireModelChanged() { + if (_listener != null) { + _listener.modelChanged(); + } + } + + public void remove(NewsItemDTO newsItem) { + Date date = newsItem.getDate(); + String key = Dates.format(date, "MM-dd-yyyy"); + List items = (List)_model.get(key); + + if (items != null) { + items.remove(newsItem); + fireModelChanged(); + } + } + + /** + * + */ + private void createModel() { + if (_newsItems != null) { + // build a list of dates to be used as the key in the map + Iterator iter = _newsItems.iterator(); + + for (int i=0, n = _newsItems.size(); i < n; i++) { + NewsItemDTO dto = (NewsItemDTO)iter.next(); + Date date = dto.getDate(); + String key = Dates.format(date, "MM-dd-yyyy"); + List items = null; + if (!_model.containsKey(key)) { + items = new ArrayList(); + _model.put(key, items); + } + + if (items == null) { + items = (List)_model.get(key); + } + + // add assertion here for items != null + items.add(dto); + } + } + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) + */ + public Object[] getChildren(Object object) { + if (object instanceof String) { + if (_model.containsKey(object)) { + List children = (List)_model.get(object); + return children.toArray(); + } + } + + return Arrays.EMPTY_OBJECT_ARRAY; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) + */ + public Object getParent(Object object) { + if (object instanceof NewsItemDTO) { + NewsItemDTO dto = (NewsItemDTO)object; + return Dates.format(dto.getDate(), "MM-dd-yyyy"); + } + + return null; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) + */ + public boolean hasChildren(Object object) { + if (object instanceof String) { + if (_model.containsKey(object)) { + List children = (List)_model.get(object); + return !children.isEmpty(); + } + } + + return false; + } + + public Object[] getDates() { + return _model.keySet().toArray(); + } + + // + // Listener methods + // + + public void addChangeListener(NewsModelListener listener) { + _listener = listener; + } + + public void removeChangeListener(NewsModelListener listener) { + if (_listener.equals(listener)) { + _listener = null; + } + } + + /** + * + */ + public void setModified() { + fireModelChanged(); + } + +} diff --git a/src/gui/com/ejdoab/tcms/admin/news/NewsModelListener.java b/src/gui/com/ejdoab/tcms/admin/news/NewsModelListener.java new file mode 100644 index 0000000..bcf5521 --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/NewsModelListener.java @@ -0,0 +1,9 @@ +package com.ejdoab.tcms.admin.news; + + +/** + * @author Brian Sam-Bodden + */ +public interface NewsModelListener { + void modelChanged(); +} diff --git a/src/gui/com/ejdoab/tcms/admin/news/NewsPage.java b/src/gui/com/ejdoab/tcms/admin/news/NewsPage.java new file mode 100644 index 0000000..e9024de --- /dev/null +++ b/src/gui/com/ejdoab/tcms/admin/news/NewsPage.java @@ -0,0 +1,364 @@ +package com.ejdoab.tcms.admin.news; + +import org.eclipse.compare.CompareViewerPane; +import org.eclipse.compare.Splitter; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeItem; + +import com.ejdoab.swt.util.SWTUtil; +import com.ejdoab.tcms.admin.BaseTCMSView; +import com.ejdoab.tcms.admin.Resources; +import com.ejdoab.tcms.admin.remote.ConferenceServicesProxy; +import com.ejdoab.tcms.admin.remote.RemoteServerException; +import com.ejdoab.tcms.services.dto.NewsItemDTO; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; + +/** + * + * @author Brian Sam-Bodden + */ +public class NewsPage extends BaseTCMSView { + TreeViewer _treeViewer = null; + + Splitter _subForm; + Splitter _mainForm; + + CompareViewerPane _detailsForm; + Composite _detailsSubForm; + + CompareViewerPane _textForm; + Composite _textSubForm; + + CompareViewerPane _newsTreeForm; + Composite _newsTreeSubForm; + + StyledText _text; + + NewsItemDetailsWidget _details; + + private NewsItemDTO selected = null; + private boolean _textModified = false; + private NewsModel _model; + + /** + * @param arg0 + * @param arg1 + */ + public NewsPage(Composite parent, int style) { + super(parent, style); + setLayout(new FillLayout()); + + _mainForm = new Splitter(this, SWT.HORIZONTAL); + createTreeViewForm(_mainForm); + + _subForm = new Splitter(_mainForm, SWT.VERTICAL); + createTextEditorForm(_subForm); + createDetailsForm(_subForm); + } + + /** + * @param sashForm + * + */ + private void createTreeViewForm(SashForm sashForm) { + _newsTreeForm = new CompareViewerPane(sashForm, SWT.BORDER); + _newsTreeForm.setText("News"); + _newsTreeForm.setImage(Resources.getImageRegistry().get("icons_news")); + + SWTUtil.CLabelFocusListener gradientHandler = + new SWTUtil.CLabelFocusListener(_newsTreeForm); + SWTUtil.CLabelMouseAdapter cma = + new SWTUtil.CLabelMouseAdapter(_newsTreeForm); + + _newsTreeSubForm = new Composite(_newsTreeForm, SWT.NONE); + _newsTreeSubForm.setLayout(new FillLayout()); + + _treeViewer = new TreeViewer(_newsTreeSubForm); + + Tree tree = _treeViewer.getTree(); + + _treeViewer.setContentProvider(new NewsTreeContentProvider()); + _treeViewer.setLabelProvider(new NewsTreeLabelProvider()); + + _newsTreeForm.setContent(_newsTreeSubForm); + + tree.addFocusListener(gradientHandler); + + _treeViewer + .addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + IStructuredSelection selection = + (IStructuredSelection) event.getSelection(); + + Object o = selection.getFirstElement(); + + if (o instanceof NewsItemDTO) { + if (_details.isModified() || _textModified) { + // prompt to save modifications + checkToSave(selected); + } + selected = (NewsItemDTO) o; + _text.removeModifyListener(_textModifiedListener); + _text.setText(selected.getBody()); + _text.addModifyListener(_textModifiedListener); + _details.setModel(selected); + } + } + }); + + // + // listener examples + // + + // this is equivalent to the listener above but on the SWT widget instead of the JFace viewer + tree.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event arg0) { + System.out.println("SWT.Selection Event!"); + } + }); + + tree.addListener(SWT.MouseDoubleClick, new Listener() { + public void handleEvent(Event arg0) { + System.out.println("SWT.MouseDoubleClick Event!"); + } + }); + + tree.addListener(SWT.KeyDown, new Listener() { + public void handleEvent(Event arg0) { + System.out.println("SWT.KeyDown Event!"); + } + }); + + tree.addListener(SWT.Expand, new Listener() { + public void handleEvent(Event e) { + TreeItem item = (TreeItem) e.item; + item.setImage(Resources.getImageRegistry().get("icons_folder_open")); + System.out.println("SWT.Expand Event!"); + } + }); + + tree.addListener(SWT.Collapse, new Listener() { + public void handleEvent(Event e) { + TreeItem item = (TreeItem) e.item; + item.setImage(Resources.getImageRegistry().get("icons_folder_close")); + System.out.println("SWT.Collapse Event!"); + } + }); + + // create the context menu for the tree + tree.setMenu(createTreePopupMenu(tree)); + + } + + + + private class TextModifiedListener implements ModifyListener { + + public void modifyText(ModifyEvent event) { + _textModified = true; + selected.setBody(_text.getText()); + } + } + + private TextModifiedListener _textModifiedListener = + new TextModifiedListener(); + + /** + * @param sashForm + */ + private void createTextEditorForm(SashForm sashForm) { + _textForm = new CompareViewerPane(sashForm, SWT.BORDER); + _textForm.setText("News Article Text"); + _textForm.setImage(Resources.getImageRegistry().get("icons_news_item_edit")); + SWTUtil.CLabelFocusListener gradientHandler = + new SWTUtil.CLabelFocusListener(_textForm); + SWTUtil.CLabelMouseAdapter cma = + new SWTUtil.CLabelMouseAdapter(_textForm); + _textSubForm = new Composite(_textForm, SWT.NONE); + _textSubForm.setLayout(new FillLayout()); + + _text = + new StyledText( + _textSubForm, + SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.WRAP); + _text.addFocusListener(gradientHandler); + _textForm.setContent(_textSubForm); + } + + /** + * @param sashForm + */ + private void createDetailsForm(SashForm sashForm) { + _detailsForm = new CompareViewerPane(sashForm, SWT.BORDER); + _detailsForm.setText("Details"); + _detailsForm.setImage(Resources.getImageRegistry().get("icons_details")); + SWTUtil.CLabelFocusListener gradientHandler = + new SWTUtil.CLabelFocusListener(_detailsForm); + SWTUtil.CLabelMouseAdapter cma = + new SWTUtil.CLabelMouseAdapter(_detailsForm); + + _detailsSubForm = new Composite(_detailsForm, SWT.NONE); + _detailsSubForm.setLayout(new FillLayout()); + + _details = new NewsItemDetailsWidget(_detailsSubForm); + _details.addFocusListener(gradientHandler); + _detailsForm.setContent(_detailsSubForm); + } + + public static Object[] news = null; + + /** + * @param args + */ + private static ConferenceServicesProxy _service; + + private void checkToSave(NewsItemDTO selected) { + MessageDialog dialog = + new MessageDialog( + this.getShell(), + "News Item Modified", + null, + "News Item [" + + selected.getTitle() + + "] has been modified. Commit changes to the server?", + MessageDialog.QUESTION, + new String[] { + "&Commit", + "&Ignore Changes", + IDialogConstants.CANCEL_LABEL }, + 0); + + dialog.open(); + int rc = dialog.getReturnCode(); + switch (rc) { + case 0 : // save the changes + try { + System.out.println("Commit selected"); + if (_details.isModified()) { + _details.applyChanges(); + } + + if (_service.submitNewsItem(selected)) { + System.out.println("commit succeded"); + _details.setModified(false); + _textModified = false; + _model.setModified(); + } + + + } catch (DTOUpdateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (RemoteServerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + break; + case 1 : // don't save the changes + _details.setModified(false); + _textModified = false; + case 2 : // cancel + break; + } + } + + public void loadData(Object[] items) { + _model = new NewsModel(items); + _treeViewer.setInput(_model); + } + + /** + * @param proxy + */ + public void setService(ConferenceServicesProxy proxy) { + _service = proxy; + } + + /// + /// popup + /// + + public Menu createTreePopupMenu(final Tree tree) { + final Menu menu = new Menu(tree.getShell(), SWT.POP_UP); + + final MenuItem addNewsArticleMenuItem = new MenuItem(menu, SWT.PUSH); + addNewsArticleMenuItem.setText("Add News Item"); + addNewsArticleMenuItem.setImage(Resources.getImageRegistry().get("icons_plus")); + addNewsArticleMenuItem.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + TreeItem item = tree.getSelection()[0]; + if (item != null) { + NewsItemWizard wizard = new NewsItemWizard(_model, item.getText()); + wizard.setService(_service); + wizard.showWizard(); + } + } + }); + + final MenuItem deleteNewsArticleMenuItem = new MenuItem(menu, SWT.PUSH); + deleteNewsArticleMenuItem.setText("Delete Article"); + deleteNewsArticleMenuItem.setImage(Resources.getImageRegistry().get("icons_minus")); + deleteNewsArticleMenuItem.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + TreeItem item = tree.getSelection()[0]; + + IStructuredSelection selection = (IStructuredSelection) _treeViewer.getSelection(); + Object o = selection.getFirstElement(); + if (o instanceof NewsItemDTO) { + NewsItemDTO dto = (NewsItemDTO)o; + // confirmation dialog + + // remove from the server + if (_service != null) { + try { + if (_service.removeNewsItem(dto)) { + _model.remove(dto); + } + } catch (DTOUpdateException e) { + // do nothing + } catch (RemoteServerException e) { + // do nothing + } + } + } + } + }); + + menu.addListener(SWT.Show, new Listener() { + public void handleEvent(Event e) { + TreeItem [] treeItems = tree.getSelection (); + + if (treeItems == null) { + e.doit = false; + return; + } + + for (int i=0; iMiddlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Address" + * local-jndi-name="ejb.AddressLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Address o" + * + * @ejb.finder + * signature="java.util.Collection findByStreetAddress(java.lang.String streetAddress)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Address o WHERE o.streetAddress = ?1" + * description="STREETADDRESS is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByAptNumber(java.lang.String aptNumber)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Address o WHERE o.aptNumber = ?1" + * description="APTNUMBER is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByCity(java.lang.String city)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Address o WHERE o.city = ?1" + * description="CITY is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByState(java.lang.String state)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Address o WHERE o.state = ?1" + * description="STATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByZipCode(java.lang.String zipCode)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Address o WHERE o.zipCode = ?1" + * description="ZIPCODE is not indexed." + * + * @ejb.persistence table-name="ADDRESSES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class AddressBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the streetAddress + * @todo support OracleClob,OracleBlob on WLS + * + * @return the streetAddress + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="STREETADDRESS" + */ + public abstract java.lang.String getStreetAddress(); + + /** + * Sets the streetAddress + * + * @param java.lang.String the new streetAddress value + * @ejb.interface-method view-type="local" + */ + public abstract void setStreetAddress(java.lang.String streetAddress); + + /** + * Returns the aptNumber + * @todo support OracleClob,OracleBlob on WLS + * + * @return the aptNumber + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="APTNUMBER" + */ + public abstract java.lang.String getAptNumber(); + + /** + * Sets the aptNumber + * + * @param java.lang.String the new aptNumber value + * @ejb.interface-method view-type="local" + */ + public abstract void setAptNumber(java.lang.String aptNumber); + + /** + * Returns the city + * @todo support OracleClob,OracleBlob on WLS + * + * @return the city + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="CITY" + */ + public abstract java.lang.String getCity(); + + /** + * Sets the city + * + * @param java.lang.String the new city value + * @ejb.interface-method view-type="local" + */ + public abstract void setCity(java.lang.String city); + + /** + * Returns the state + * @todo support OracleClob,OracleBlob on WLS + * + * @return the state + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="STATE" + */ + public abstract java.lang.String getState(); + + /** + * Sets the state + * + * @param java.lang.String the new state value + * @ejb.interface-method view-type="local" + */ + public abstract void setState(java.lang.String state); + + /** + * Returns the zipCode + * @todo support OracleClob,OracleBlob on WLS + * + * @return the zipCode + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="ZIPCODE" + */ + public abstract java.lang.String getZipCode(); + + /** + * Sets the zipCode + * + * @param java.lang.String the new zipCode value + * @ejb.interface-method view-type="local" + */ + public abstract void setZipCode(java.lang.String zipCode); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.VenueLocal. + * middlegen.plugins.entitybean.Entity20Table@fbf51d + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * + * @ejb.relation + * name="ADDRESSES-cmp20-VENUES-cmp20" + * role-name="ADDRESSES-cmp20-has-VENUES-cmp20" + * target-ejb="Venue" + * target-role-name="VENUES-cmp20-has-ADDRESSES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_ADDRESSID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_ADDRESSID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getVenues(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.VenueLocal + * + * @param a collection of related com.ejdoab.tcms.entities.VenueLocal + * + * @ejb.interface-method view-type="local" + * + * @param venues the new CMR value + */ + public abstract void setVenues(java.util.Collection venues); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.UserLocal. + * middlegen.plugins.entitybean.Entity20Table@ca5bff + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * + * @ejb.relation + * name="ADDRESSES-cmp20-USERS-cmp20" + * role-name="ADDRESSES-cmp20-has-USERS-cmp20" + * target-ejb="User" + * target-role-name="USERS-cmp20-has-ADDRESSES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_ADDRESSID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_ADDRESSID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getUsers(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.UserLocal + * + * @param a collection of related com.ejdoab.tcms.entities.UserLocal + * + * @ejb.interface-method view-type="local" + * + * @param users the new CMR value + */ + public abstract void setUsers(java.util.Collection users); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ADDRESSES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param streetAddress the streetAddress value + * @param aptNumber the aptNumber value + * @param city the city value + * @param state the state value + * @param zipCode the zipCode value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String streetAddress, java.lang.String aptNumber, java.lang.String city, java.lang.String state, java.lang.String zipCode ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ADDRESSES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setStreetAddress(streetAddress); + setAptNumber(aptNumber); + setCity(city); + setState(state); + setZipCode(zipCode); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param streetAddress the streetAddress value + * @param aptNumber the aptNumber value + * @param city the city value + * @param state the state value + * @param zipCode the zipCode value + */ + public void ejbPostCreate( java.lang.String streetAddress, java.lang.String aptNumber, java.lang.String city, java.lang.String state, java.lang.String zipCode ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-addresses-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/AnswerBean.java b/src/java/com/ejdoab/tcms/entities/AnswerBean.java new file mode 100644 index 0000000..dccd89a --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/AnswerBean.java @@ -0,0 +1,176 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: ANSWERS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Answer" + * local-jndi-name="ejb.AnswerLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Answer o" + * + * @ejb.persistence table-name="ANSWERS" + * + * @weblogic.cache concurrency-strategy="ReadOnly" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class AnswerBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.QuestionnaireLocal. + * + * + * @ejb.relation + * name="QUESTIONNAIRES-cmp20-ANSWERS-cmp20" + * role-name="ANSWERS-cmp20-has-QUESTIONNAIRES-cmp20" + * target-ejb="Questionnaire" + * target-role-name="QUESTIONNAIRES-cmp20-has-ANSWERS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_QUESTIONNAIREID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_QUESTIONNAIREID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.QuestionnaireLocal getQuestionnaire(); + + /** + * Sets the related com.ejdoab.tcms.entities.QuestionnaireLocal + * + * @param com.ejdoab.tcms.entities.AnswerLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param questionnaire the new CMR value + */ + public abstract void setQuestionnaire(com.ejdoab.tcms.entities.QuestionnaireLocal questionnaire); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.UserLocal. + * + * + * @ejb.relation + * name="USERS-cmp20-ANSWERS-cmp20" + * role-name="ANSWERS-cmp20-has-USERS-cmp20" + * target-ejb="User" + * target-role-name="USERS-cmp20-has-ANSWERS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.UserLocal getUser(); + + /** + * Sets the related com.ejdoab.tcms.entities.UserLocal + * + * @param com.ejdoab.tcms.entities.AnswerLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param user the new CMR value + */ + public abstract void setUser(com.ejdoab.tcms.entities.UserLocal user); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param questionnaire mandatory CMR field + * @param user mandatory CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( com.ejdoab.tcms.entities.QuestionnaireLocal questionnaire, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ANSWERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param questionnaire mandatory CMR field + * @param user mandatory CMR field + */ + public void ejbPostCreate( com.ejdoab.tcms.entities.QuestionnaireLocal questionnaire, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Set CMR fields + setQuestionnaire(questionnaire); + setUser(user); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-answers-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/AttendeeBean.java b/src/java/com/ejdoab/tcms/entities/AttendeeBean.java new file mode 100644 index 0000000..db9f309 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/AttendeeBean.java @@ -0,0 +1,173 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: ATTENDEES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Attendee" + * local-jndi-name="ejb.AttendeeLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Attendee o" + * + * @ejb.persistence table-name="ATTENDEES" + * + * @weblogic.cache concurrency-strategy="ReadOnly" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class AttendeeBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * This is a bi-directional one-to-one relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.UserLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-ATTENDEES-cmp20" + * role-name="ATTENDEES-cmp20-has-USERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.UserLocal getUser(); + + /** + * Sets the related com.ejdoab.tcms.entities.UserLocal + * + * @param com.ejdoab.tcms.entities.AttendeeLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param user the new CMR value + */ + public abstract void setUser(com.ejdoab.tcms.entities.UserLocal user); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ATTENDEES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param user CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ATTENDEES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param user CMR field + */ + public void ejbPostCreate( com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Set CMR fields + setUser(user); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-attendees-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/BoothBean.java b/src/java/com/ejdoab/tcms/entities/BoothBean.java new file mode 100644 index 0000000..914d92b --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/BoothBean.java @@ -0,0 +1,231 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: BOOTHS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Booth" + * local-jndi-name="ejb.BoothLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Booth o" + * + * @ejb.finder + * signature="java.util.Collection findByNotes(java.lang.String notes)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Booth o WHERE o.notes = ?1" + * description="NOTES is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findBySize(java.lang.String size)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Booth o WHERE o.size = ?1" + * description="SIZE is not indexed." + * + * @ejb.persistence table-name="BOOTHS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class BoothBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the notes + * @todo support OracleClob,OracleBlob on WLS + * + * @return the notes + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NOTES" + */ + public abstract java.lang.String getNotes(); + + /** + * Sets the notes + * + * @param java.lang.String the new notes value + * @ejb.interface-method view-type="local" + */ + public abstract void setNotes(java.lang.String notes); + + /** + * Returns the size + * @todo support OracleClob,OracleBlob on WLS + * + * @return the size + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="SIZE" + */ + public abstract java.lang.String getSize(); + + /** + * Sets the size + * + * @param java.lang.String the new size value + * @ejb.interface-method view-type="local" + */ + public abstract void setSize(java.lang.String size); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.VenueLocal. + * + * + * @ejb.relation + * name="VENUES-cmp20-BOOTHS-cmp20" + * role-name="BOOTHS-cmp20-has-VENUES-cmp20" + * target-ejb="Venue" + * target-role-name="VENUES-cmp20-has-BOOTHS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_VENUEID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_VENUEID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.VenueLocal getVenue(); + + /** + * Sets the related com.ejdoab.tcms.entities.VenueLocal + * + * @param com.ejdoab.tcms.entities.BoothLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param venue the new CMR value + */ + public abstract void setVenue(com.ejdoab.tcms.entities.VenueLocal venue); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "BOOTHS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param notes the notes value + * @param size the size value + * @param venue CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String notes, java.lang.String size, com.ejdoab.tcms.entities.VenueLocal venue ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "BOOTHS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setNotes(notes); + setSize(size); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param notes the notes value + * @param size the size value + * @param venue CMR field + */ + public void ejbPostCreate( java.lang.String notes, java.lang.String size, com.ejdoab.tcms.entities.VenueLocal venue ) throws javax.ejb.CreateException { + // Set CMR fields + setVenue(venue); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-booths-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/ConferenceAbstractBean.java b/src/java/com/ejdoab/tcms/entities/ConferenceAbstractBean.java new file mode 100644 index 0000000..0a23b04 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/ConferenceAbstractBean.java @@ -0,0 +1,375 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: ABSTRACTS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="ConferenceAbstract" + * local-jndi-name="ejb.ConferenceAbstractLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM ConferenceAbstract o" + * + * @ejb.finder + * signature="java.util.Collection findByTitle(java.lang.String title)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstract o WHERE o.title = ?1" + * description="TITLE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByType(int type)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstract o WHERE o.type = ?1" + * description="TYPE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByTopic(int topic)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstract o WHERE o.topic = ?1" + * description="TOPIC is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByLevel(int level)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstract o WHERE o.level = ?1" + * description="LEVEL is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByBody(java.lang.String body)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstract o WHERE o.body = ?1" + * description="BODY is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByStatus(int status)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstract o WHERE o.status = ?1" + * description="STATUS is not indexed." + * + * @ejb.persistence table-name="ABSTRACTS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class ConferenceAbstractBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the title + * @todo support OracleClob,OracleBlob on WLS + * + * @return the title + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="TITLE" + */ + public abstract java.lang.String getTitle(); + + /** + * Sets the title + * + * @param java.lang.String the new title value + * @ejb.interface-method view-type="local" + */ + public abstract void setTitle(java.lang.String title); + + /** + * Returns the type + * @todo support OracleClob,OracleBlob on WLS + * + * @return the type + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="TYPE" + */ + public abstract int getType(); + + /** + * Sets the type + * + * @param int the new type value + * @ejb.interface-method view-type="local" + */ + public abstract void setType(int type); + + /** + * Returns the topic + * @todo support OracleClob,OracleBlob on WLS + * + * @return the topic + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="TOPIC" + */ + public abstract int getTopic(); + + /** + * Sets the topic + * + * @param int the new topic value + * @ejb.interface-method view-type="local" + */ + public abstract void setTopic(int topic); + + /** + * Returns the level + * @todo support OracleClob,OracleBlob on WLS + * + * @return the level + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="LEVEL" + */ + public abstract int getLevel(); + + /** + * Sets the level + * + * @param int the new level value + * @ejb.interface-method view-type="local" + */ + public abstract void setLevel(int level); + + /** + * Returns the body + * @todo support OracleClob,OracleBlob on WLS + * + * @return the body + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="BODY" + */ + public abstract java.lang.String getBody(); + + /** + * Sets the body + * + * @param java.lang.String the new body value + * @ejb.interface-method view-type="local" + */ + public abstract void setBody(java.lang.String body); + + /** + * Returns the status + * @todo support OracleClob,OracleBlob on WLS + * + * @return the status + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="STATUS" + */ + public abstract int getStatus(); + + /** + * Sets the status + * + * @param int the new status value + * @ejb.interface-method view-type="local" + */ + public abstract void setStatus(int status); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.PresenterLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="PRESENTERS-cmp20-ABSTRACTS-cmp20" + * role-name="ABSTRACTS-cmp20-has-PRESENTERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_PRESENTERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_PRESENTERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.PresenterLocal getPresenter(); + + /** + * Sets the related com.ejdoab.tcms.entities.PresenterLocal + * + * @param com.ejdoab.tcms.entities.ConferenceAbstractLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param presenter the new CMR value + */ + public abstract void setPresenter(com.ejdoab.tcms.entities.PresenterLocal presenter); + + /** + * This is a bi-directional one-to-one relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.PresentationLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="ABSTRACTS-cmp20-PRESENTATIONS-cmp20" + * role-name="ABSTRACTS-cmp20-has-PRESENTATIONS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract com.ejdoab.tcms.entities.PresentationLocal getPresentation(); + + /** + * Sets the related com.ejdoab.tcms.entities.PresentationLocal + * + * @param com.ejdoab.tcms.entities.ConferenceAbstractLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param presentation the new CMR value + */ + public abstract void setPresentation(com.ejdoab.tcms.entities.PresentationLocal presentation); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ABSTRACTS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param title the title value + * @param type the type value + * @param topic the topic value + * @param level the level value + * @param body the body value + * @param status the status value + * @param presenter CMR field + * @param presentation CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String title, int type, int topic, int level, java.lang.String body, int status, com.ejdoab.tcms.entities.PresenterLocal presenter, com.ejdoab.tcms.entities.PresentationLocal presentation ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ABSTRACTS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setTitle(title); + setType(type); + setTopic(topic); + setLevel(level); + setBody(body); + setStatus(status); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param title the title value + * @param type the type value + * @param topic the topic value + * @param level the level value + * @param body the body value + * @param status the status value + * @param presenter CMR field + * @param presentation CMR field + */ + public void ejbPostCreate( java.lang.String title, int type, int topic, int level, java.lang.String body, int status, com.ejdoab.tcms.entities.PresenterLocal presenter, com.ejdoab.tcms.entities.PresentationLocal presentation ) throws javax.ejb.CreateException { + // Set CMR fields + setPresenter(presenter); + setPresentation(presentation); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-abstracts-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/ConferenceAbstractStatusBean.java b/src/java/com/ejdoab/tcms/entities/ConferenceAbstractStatusBean.java new file mode 100644 index 0000000..3edfa1b --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/ConferenceAbstractStatusBean.java @@ -0,0 +1,121 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: ABSTRACTSTATUS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="ConferenceAbstractStatus" + * local-jndi-name="ejb.ConferenceAbstractStatusLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM ConferenceAbstractStatus o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceAbstractStatus o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.persistence table-name="ABSTRACTSTATUS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class ConferenceAbstractStatusBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ABSTRACTSTATUS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + */ + public void ejbPostCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-abstractstatus-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/ConferenceBean.java b/src/java/com/ejdoab/tcms/entities/ConferenceBean.java new file mode 100644 index 0000000..9a8538f --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/ConferenceBean.java @@ -0,0 +1,389 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: CONFERENCES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Conference" + * local-jndi-name="ejb.ConferenceLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Conference o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Conference o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Conference o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByStartDate(java.util.Date startDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Conference o WHERE o.startDate = ?1" + * description="STARTDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByEndDate(java.util.Date endDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Conference o WHERE o.endDate = ?1" + * description="ENDDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByAbstractSubmissionStartDate(java.util.Date abstractSubmissionStartDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Conference o WHERE o.abstractSubmissionStartDate = ?1" + * description="ABSTRACTSUBMISSIONSTARTDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByAbstractSubmissionEndDate(java.util.Date abstractSubmissionEndDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Conference o WHERE o.abstractSubmissionEndDate = ?1" + * description="ABSTRACTSUBMISSIONENDDATE is not indexed." + * + * @ejb.persistence table-name="CONFERENCES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class ConferenceBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * Returns the startDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the startDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="STARTDATE" + */ + public abstract java.util.Date getStartDate(); + + /** + * Sets the startDate + * + * @param java.util.Date the new startDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setStartDate(java.util.Date startDate); + + /** + * Returns the endDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the endDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="ENDDATE" + */ + public abstract java.util.Date getEndDate(); + + /** + * Sets the endDate + * + * @param java.util.Date the new endDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setEndDate(java.util.Date endDate); + + /** + * Returns the abstractSubmissionStartDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the abstractSubmissionStartDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="ABSTRACTSUBMISSIONSTARTDATE" + */ + public abstract java.util.Date getAbstractSubmissionStartDate(); + + /** + * Sets the abstractSubmissionStartDate + * + * @param java.util.Date the new abstractSubmissionStartDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setAbstractSubmissionStartDate(java.util.Date abstractSubmissionStartDate); + + /** + * Returns the abstractSubmissionEndDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the abstractSubmissionEndDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="ABSTRACTSUBMISSIONENDDATE" + */ + public abstract java.util.Date getAbstractSubmissionEndDate(); + + /** + * Sets the abstractSubmissionEndDate + * + * @param java.util.Date the new abstractSubmissionEndDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setAbstractSubmissionEndDate(java.util.Date abstractSubmissionEndDate); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.VenueLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="VENUES-cmp20-CONFERENCES-cmp20" + * role-name="CONFERENCES-cmp20-has-VENUES-cmp20" + * target-ejb="Venue" + * target-role-name="VENUES-cmp20-has-CONFERENCES-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_VENUEID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_VENUEID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.VenueLocal getVenue(); + + /** + * Sets the related com.ejdoab.tcms.entities.VenueLocal + * + * @param com.ejdoab.tcms.entities.ConferenceLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param venue the new CMR value + */ + public abstract void setVenue(com.ejdoab.tcms.entities.VenueLocal venue); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.TrackLocal. + * middlegen.plugins.entitybean.Entity20Table@bc36ff + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="CONFERENCES-cmp20-TRACKS-cmp20" + * role-name="CONFERENCES-cmp20-has-TRACKS-cmp20" + * target-ejb="Track" + * target-role-name="TRACKS-cmp20-has-CONFERENCES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_CONFERENCEID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_CONFERENCEID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getTracks(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.TrackLocal + * + * @param a collection of related com.ejdoab.tcms.entities.TrackLocal + * + * @ejb.interface-method view-type="local" + * + * @param tracks the new CMR value + */ + public abstract void setTracks(java.util.Collection tracks); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "CONFERENCES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param description the description value + * @param startDate the startDate value + * @param endDate the endDate value + * @param abstractSubmissionStartDate the abstractSubmissionStartDate value + * @param abstractSubmissionEndDate the abstractSubmissionEndDate value + * @param venue CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String description, java.util.Date startDate, java.util.Date endDate, java.util.Date abstractSubmissionStartDate, java.util.Date abstractSubmissionEndDate, com.ejdoab.tcms.entities.VenueLocal venue ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "CONFERENCES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setDescription(description); + setStartDate(startDate); + setEndDate(endDate); + setAbstractSubmissionStartDate(abstractSubmissionStartDate); + setAbstractSubmissionEndDate(abstractSubmissionEndDate); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param description the description value + * @param startDate the startDate value + * @param endDate the endDate value + * @param abstractSubmissionStartDate the abstractSubmissionStartDate value + * @param abstractSubmissionEndDate the abstractSubmissionEndDate value + * @param venue CMR field + */ + public void ejbPostCreate( java.lang.String name, java.lang.String description, java.util.Date startDate, java.util.Date endDate, java.util.Date abstractSubmissionStartDate, java.util.Date abstractSubmissionEndDate, com.ejdoab.tcms.entities.VenueLocal venue ) throws javax.ejb.CreateException { + // Set CMR fields + setVenue(venue); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-conferences-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/ConferenceNewsBean.java b/src/java/com/ejdoab/tcms/entities/ConferenceNewsBean.java new file mode 100644 index 0000000..ae9d608 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/ConferenceNewsBean.java @@ -0,0 +1,318 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: NEWS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="ConferenceNews" + * local-jndi-name="ejb.ConferenceNewsLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM ConferenceNews o" + * + * @ejb.finder + * signature="java.util.Collection findByDate(java.util.Date date)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceNews o WHERE o.date = ?1" + * description="DATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByRemoveDate(java.util.Date removeDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceNews o WHERE o.removeDate = ?1" + * description="REMOVEDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByCreationDate(java.util.Date creationDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceNews o WHERE o.creationDate = ?1" + * description="CREATIONDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByPublished(boolean published)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceNews o WHERE o.published = ?1" + * description="PUBLISHED is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByTitle(java.lang.String title)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceNews o WHERE o.title = ?1" + * description="TITLE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByBody(java.lang.String body)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ConferenceNews o WHERE o.body = ?1" + * description="BODY is not indexed." + * + * @ejb.persistence table-name="NEWS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class ConferenceNewsBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the date + * @todo support OracleClob,OracleBlob on WLS + * + * @return the date + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DATE" + */ + public abstract java.util.Date getDate(); + + /** + * Sets the date + * + * @param java.util.Date the new date value + * @ejb.interface-method view-type="local" + */ + public abstract void setDate(java.util.Date date); + + /** + * Returns the removeDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the removeDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="REMOVEDATE" + */ + public abstract java.util.Date getRemoveDate(); + + /** + * Sets the removeDate + * + * @param java.util.Date the new removeDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setRemoveDate(java.util.Date removeDate); + + /** + * Returns the creationDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the creationDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="CREATIONDATE" + */ + public abstract java.util.Date getCreationDate(); + + /** + * Sets the creationDate + * + * @param java.util.Date the new creationDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setCreationDate(java.util.Date creationDate); + + /** + * Returns the published + * @todo support OracleClob,OracleBlob on WLS + * + * @return the published + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PUBLISHED" + */ + public abstract boolean getPublished(); + + /** + * Sets the published + * + * @param boolean the new published value + * @ejb.interface-method view-type="local" + */ + public abstract void setPublished(boolean published); + + /** + * Returns the title + * @todo support OracleClob,OracleBlob on WLS + * + * @return the title + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="TITLE" + */ + public abstract java.lang.String getTitle(); + + /** + * Sets the title + * + * @param java.lang.String the new title value + * @ejb.interface-method view-type="local" + */ + public abstract void setTitle(java.lang.String title); + + /** + * Returns the body + * @todo support OracleClob,OracleBlob on WLS + * + * @return the body + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="BODY" + */ + public abstract java.lang.String getBody(); + + /** + * Sets the body + * + * @param java.lang.String the new body value + * @ejb.interface-method view-type="local" + */ + public abstract void setBody(java.lang.String body); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param date the date value + * @param removeDate the removeDate value + * @param creationDate the creationDate value + * @param published the published value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.util.Date date, java.util.Date removeDate, java.util.Date creationDate, boolean published ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "NEWS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setDate(date); + setRemoveDate(removeDate); + setCreationDate(creationDate); + setPublished(published); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param date the date value + * @param removeDate the removeDate value + * @param creationDate the creationDate value + * @param published the published value + */ + public void ejbPostCreate( java.util.Date date, java.util.Date removeDate, java.util.Date creationDate, boolean published ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param date the date value + * @param removeDate the removeDate value + * @param creationDate the creationDate value + * @param published the published value + * @param title the title value + * @param body the body value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.util.Date date, java.util.Date removeDate, java.util.Date creationDate, boolean published, java.lang.String title, java.lang.String body ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "NEWS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setDate(date); + setRemoveDate(removeDate); + setCreationDate(creationDate); + setPublished(published); + setTitle(title); + setBody(body); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param date the date value + * @param removeDate the removeDate value + * @param creationDate the creationDate value + * @param published the published value + * @param title the title value + * @param body the body value + */ + public void ejbPostCreate( java.util.Date date, java.util.Date removeDate, java.util.Date creationDate, boolean published, java.lang.String title, java.lang.String body ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-news-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/GroupPricingRuleBean.java b/src/java/com/ejdoab/tcms/entities/GroupPricingRuleBean.java new file mode 100644 index 0000000..c7bac21 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/GroupPricingRuleBean.java @@ -0,0 +1,219 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: GROUPPRICINGRULES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="GroupPricingRule" + * local-jndi-name="ejb.GroupPricingRuleLocalHome" + * view-type="local" + * primkey-field="ruleName" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM GroupPricingRule o" + * + * @ejb.finder + * signature="java.util.Collection findByMinimumAttendees(int minimumAttendees)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM GroupPricingRule o WHERE o.minimumAttendees = ?1" + * description="MINIMUMATTENDEES is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByMaximumAttendees(int maximumAttendees)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM GroupPricingRule o WHERE o.maximumAttendees = ?1" + * description="MAXIMUMATTENDEES is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDiscountPerAttendee(double discountPerAttendee)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM GroupPricingRule o WHERE o.discountPerAttendee = ?1" + * description="DISCOUNTPERATTENDEE is not indexed." + * + * @ejb.persistence table-name="GROUPPRICINGRULES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class GroupPricingRuleBean implements javax.ejb.EntityBean { + + /** + * Returns the ruleName + * @todo support OracleClob,OracleBlob on WLS + * + * @return the ruleName + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_RULENAME" + */ + public abstract java.lang.String getRuleName(); + + /** + * Sets the ruleName + * + * @param java.lang.String the new ruleName value + */ + public abstract void setRuleName(java.lang.String ruleName); + + /** + * Returns the minimumAttendees + * @todo support OracleClob,OracleBlob on WLS + * + * @return the minimumAttendees + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="MINIMUMATTENDEES" + */ + public abstract int getMinimumAttendees(); + + /** + * Sets the minimumAttendees + * + * @param int the new minimumAttendees value + * @ejb.interface-method view-type="local" + */ + public abstract void setMinimumAttendees(int minimumAttendees); + + /** + * Returns the maximumAttendees + * @todo support OracleClob,OracleBlob on WLS + * + * @return the maximumAttendees + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="MAXIMUMATTENDEES" + */ + public abstract int getMaximumAttendees(); + + /** + * Sets the maximumAttendees + * + * @param int the new maximumAttendees value + * @ejb.interface-method view-type="local" + */ + public abstract void setMaximumAttendees(int maximumAttendees); + + /** + * Returns the discountPerAttendee + * @todo support OracleClob,OracleBlob on WLS + * + * @return the discountPerAttendee + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DISCOUNTPERATTENDEE" + */ + public abstract double getDiscountPerAttendee(); + + /** + * Sets the discountPerAttendee + * + * @param double the new discountPerAttendee value + * @ejb.interface-method view-type="local" + */ + public abstract void setDiscountPerAttendee(double discountPerAttendee); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.String ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + setRuleName(com.ejdoab.tcms.entities.GroupPricingRuleUtil.generateGUID(this)); + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param minimumAttendees the minimumAttendees value + * @param maximumAttendees the maximumAttendees value + * @param discountPerAttendee the discountPerAttendee value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.String ejbCreate( int minimumAttendees, int maximumAttendees, double discountPerAttendee ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + setRuleName(com.ejdoab.tcms.entities.GroupPricingRuleUtil.generateGUID(this)); + + // Set CMP fields + setMinimumAttendees(minimumAttendees); + setMaximumAttendees(maximumAttendees); + setDiscountPerAttendee(discountPerAttendee); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param minimumAttendees the minimumAttendees value + * @param maximumAttendees the maximumAttendees value + * @param discountPerAttendee the discountPerAttendee value + */ + public void ejbPostCreate( int minimumAttendees, int maximumAttendees, double discountPerAttendee ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-grouppricingrules-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/PresentationBean.java b/src/java/com/ejdoab/tcms/entities/PresentationBean.java new file mode 100644 index 0000000..b73d248 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/PresentationBean.java @@ -0,0 +1,243 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: PRESENTATIONS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Presentation" + * local-jndi-name="ejb.PresentationLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Presentation o" + * + * @ejb.persistence table-name="PRESENTATIONS" + * + * @weblogic.cache concurrency-strategy="ReadOnly" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class PresentationBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.SessionLocal. + * middlegen.plugins.entitybean.Entity20Table@6f8b2b + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="PRESENTATIONS-cmp20-SESSIONS-cmp20" + * role-name="PRESENTATIONS-cmp20-has-SESSIONS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract java.util.Collection getSessions(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.SessionLocal + * + * @param a collection of related com.ejdoab.tcms.entities.SessionLocal + * + * @ejb.interface-method view-type="local" + * + * @param sessions the new CMR value + */ + public abstract void setSessions(java.util.Collection sessions); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.QuestionnaireLocal. + * middlegen.plugins.entitybean.Entity20Table@18b8914 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="PRESENTATIONS-cmp20-QUESTIONNAIRES-cmp20" + * role-name="PRESENTATIONS-cmp20-has-QUESTIONNAIRES-cmp20" + * target-ejb="Questionnaire" + * target-role-name="QUESTIONNAIRES-cmp20-has-PRESENTATIONS-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_PRESENTATIONID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_PRESENTATIONID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getQuestionnaires(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.QuestionnaireLocal + * + * @param a collection of related com.ejdoab.tcms.entities.QuestionnaireLocal + * + * @ejb.interface-method view-type="local" + * + * @param questionnaires the new CMR value + */ + public abstract void setQuestionnaires(java.util.Collection questionnaires); + + /** + * This is a bi-directional one-to-one relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.ConferenceAbstractLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="ABSTRACTS-cmp20-PRESENTATIONS-cmp20" + * role-name="PRESENTATIONS-cmp20-has-ABSTRACTS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_ABSTRACTID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_ABSTRACTID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.ConferenceAbstractLocal getConferenceAbstract(); + + /** + * Sets the related com.ejdoab.tcms.entities.ConferenceAbstractLocal + * + * @param com.ejdoab.tcms.entities.PresentationLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param conferenceAbstract the new CMR value + */ + public abstract void setConferenceAbstract(com.ejdoab.tcms.entities.ConferenceAbstractLocal conferenceAbstract); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param conferenceAbstract CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( com.ejdoab.tcms.entities.ConferenceAbstractLocal conferenceAbstract ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param conferenceAbstract CMR field + */ + public void ejbPostCreate( com.ejdoab.tcms.entities.ConferenceAbstractLocal conferenceAbstract ) throws javax.ejb.CreateException { + // Set CMR fields + setConferenceAbstract(conferenceAbstract); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-presentations-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/PresentationLevelBean.java b/src/java/com/ejdoab/tcms/entities/PresentationLevelBean.java new file mode 100644 index 0000000..0dd1b6e --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/PresentationLevelBean.java @@ -0,0 +1,193 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: PRESENTATIONLEVELS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="PresentationLevel" + * local-jndi-name="ejb.PresentationLevelLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM PresentationLevel o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM PresentationLevel o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM PresentationLevel o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.persistence table-name="PRESENTATIONLEVELS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class PresentationLevelBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONLEVELS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + */ + public void ejbPostCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param description the description value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String description ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONLEVELS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setDescription(description); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param description the description value + */ + public void ejbPostCreate( java.lang.String name, java.lang.String description ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-presentationlevels-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/PresentationTopicBean.java b/src/java/com/ejdoab/tcms/entities/PresentationTopicBean.java new file mode 100644 index 0000000..999dbe2 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/PresentationTopicBean.java @@ -0,0 +1,193 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: PRESENTATIONTOPICS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="PresentationTopic" + * local-jndi-name="ejb.PresentationTopicLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM PresentationTopic o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM PresentationTopic o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM PresentationTopic o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.persistence table-name="PRESENTATIONTOPICS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class PresentationTopicBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONTOPICS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + */ + public void ejbPostCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param description the description value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String description ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONTOPICS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setDescription(description); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param description the description value + */ + public void ejbPostCreate( java.lang.String name, java.lang.String description ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-presentationtopics-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/PresentationTypeBean.java b/src/java/com/ejdoab/tcms/entities/PresentationTypeBean.java new file mode 100644 index 0000000..7679855 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/PresentationTypeBean.java @@ -0,0 +1,193 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: PRESENTATIONTYPES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="PresentationType" + * local-jndi-name="ejb.PresentationTypeLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM PresentationType o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM PresentationType o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM PresentationType o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.persistence table-name="PRESENTATIONTYPES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class PresentationTypeBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONTYPES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + */ + public void ejbPostCreate( java.lang.String name ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param description the description value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String description ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTATIONTYPES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setDescription(description); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param description the description value + */ + public void ejbPostCreate( java.lang.String name, java.lang.String description ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-presentationtypes-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/PresenterBean.java b/src/java/com/ejdoab/tcms/entities/PresenterBean.java new file mode 100644 index 0000000..9dd6db2 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/PresenterBean.java @@ -0,0 +1,258 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: PRESENTERS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Presenter" + * local-jndi-name="ejb.PresenterLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Presenter o" + * + * @ejb.finder + * signature="java.util.Collection findByCompany(java.lang.String company)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Presenter o WHERE o.company = ?1" + * description="COMPANY is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByBio(java.lang.String bio)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Presenter o WHERE o.bio = ?1" + * description="BIO is not indexed." + * + * @ejb.persistence table-name="PRESENTERS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class PresenterBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the company + * @todo support OracleClob,OracleBlob on WLS + * + * @return the company + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="COMPANY" + */ + public abstract java.lang.String getCompany(); + + /** + * Sets the company + * + * @param java.lang.String the new company value + * @ejb.interface-method view-type="local" + */ + public abstract void setCompany(java.lang.String company); + + /** + * Returns the bio + * @todo support OracleClob,OracleBlob on WLS + * + * @return the bio + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="BIO" + */ + public abstract java.lang.String getBio(); + + /** + * Sets the bio + * + * @param java.lang.String the new bio value + * @ejb.interface-method view-type="local" + */ + public abstract void setBio(java.lang.String bio); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.ConferenceAbstractLocal. + * middlegen.plugins.entitybean.Entity20Table@1b82d69 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="PRESENTERS-cmp20-ABSTRACTS-cmp20" + * role-name="PRESENTERS-cmp20-has-ABSTRACTS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract java.util.Collection getConferenceAbstracts(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.ConferenceAbstractLocal + * + * @param a collection of related com.ejdoab.tcms.entities.ConferenceAbstractLocal + * + * @ejb.interface-method view-type="local" + * + * @param conferenceAbstracts the new CMR value + */ + public abstract void setConferenceAbstracts(java.util.Collection conferenceAbstracts); + + /** + * This is a bi-directional one-to-one relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.UserLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-PRESENTERS-cmp20" + * role-name="PRESENTERS-cmp20-has-USERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.UserLocal getUser(); + + /** + * Sets the related com.ejdoab.tcms.entities.UserLocal + * + * @param com.ejdoab.tcms.entities.PresenterLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param user the new CMR value + */ + public abstract void setUser(com.ejdoab.tcms.entities.UserLocal user); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param company the company value + * @param bio the bio value + * @param user CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String company, java.lang.String bio, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "PRESENTERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setCompany(company); + setBio(bio); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param company the company value + * @param bio the bio value + * @param user CMR field + */ + public void ejbPostCreate( java.lang.String company, java.lang.String bio, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Set CMR fields + setUser(user); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-presenters-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/QuestionBean.java b/src/java/com/ejdoab/tcms/entities/QuestionBean.java new file mode 100644 index 0000000..b516288 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/QuestionBean.java @@ -0,0 +1,263 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: QUESTIONS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Question" + * local-jndi-name="ejb.QuestionLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Question o" + * + * @ejb.finder + * signature="java.util.Collection findByQuestionText(java.lang.String questionText)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Question o WHERE o.questionText = ?1" + * description="QUESTIONTEXT is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByQuestionType(int questionType)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Question o WHERE o.questionType = ?1" + * description="QUESTIONTYPE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByQuestionChoices(java.lang.String questionChoices)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Question o WHERE o.questionChoices = ?1" + * description="QUESTIONCHOICES is not indexed." + * + * @ejb.persistence table-name="QUESTIONS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class QuestionBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the questionText + * @todo support OracleClob,OracleBlob on WLS + * + * @return the questionText + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="QUESTIONTEXT" + */ + public abstract java.lang.String getQuestionText(); + + /** + * Sets the questionText + * + * @param java.lang.String the new questionText value + * @ejb.interface-method view-type="local" + */ + public abstract void setQuestionText(java.lang.String questionText); + + /** + * Returns the questionType + * @todo support OracleClob,OracleBlob on WLS + * + * @return the questionType + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="QUESTIONTYPE" + */ + public abstract int getQuestionType(); + + /** + * Sets the questionType + * + * @param int the new questionType value + * @ejb.interface-method view-type="local" + */ + public abstract void setQuestionType(int questionType); + + /** + * Returns the questionChoices + * @todo support OracleClob,OracleBlob on WLS + * + * @return the questionChoices + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="QUESTIONCHOICES" + */ + public abstract java.lang.String getQuestionChoices(); + + /** + * Sets the questionChoices + * + * @param java.lang.String the new questionChoices value + * @ejb.interface-method view-type="local" + */ + public abstract void setQuestionChoices(java.lang.String questionChoices); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.QuestionnaireLocal. + * middlegen.plugins.entitybean.Entity20Table@18b8914 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="QUESTIONS-cmp20-QUESTIONNAIRES-cmp20" + * role-name="QUESTIONS-cmp20-has-QUESTIONNAIRES-cmp20" + * target-ejb="Questionnaire" + * target-role-name="QUESTIONNAIRES-cmp20-has-QUESTIONS-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_QUESTIONID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_QUESTIONID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getQuestionnaires(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.QuestionnaireLocal + * + * @param a collection of related com.ejdoab.tcms.entities.QuestionnaireLocal + * + * @ejb.interface-method view-type="local" + * + * @param questionnaires the new CMR value + */ + public abstract void setQuestionnaires(java.util.Collection questionnaires); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param questionType the questionType value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( int questionType ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "QUESTIONS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setQuestionType(questionType); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param questionType the questionType value + */ + public void ejbPostCreate( int questionType ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param questionText the questionText value + * @param questionType the questionType value + * @param questionChoices the questionChoices value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String questionText, int questionType, java.lang.String questionChoices ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "QUESTIONS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setQuestionText(questionText); + setQuestionType(questionType); + setQuestionChoices(questionChoices); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param questionText the questionText value + * @param questionType the questionType value + * @param questionChoices the questionChoices value + */ + public void ejbPostCreate( java.lang.String questionText, int questionType, java.lang.String questionChoices ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-questions-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/QuestionnaireBean.java b/src/java/com/ejdoab/tcms/entities/QuestionnaireBean.java new file mode 100644 index 0000000..e648eb9 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/QuestionnaireBean.java @@ -0,0 +1,217 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: QUESTIONNAIRES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Questionnaire" + * local-jndi-name="ejb.QuestionnaireLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Questionnaire o" + * + * @ejb.persistence table-name="QUESTIONNAIRES" + * + * @weblogic.cache concurrency-strategy="ReadOnly" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class QuestionnaireBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.QuestionLocal. + * + * + * @ejb.relation + * name="QUESTIONS-cmp20-QUESTIONNAIRES-cmp20" + * role-name="QUESTIONNAIRES-cmp20-has-QUESTIONS-cmp20" + * target-ejb="Question" + * target-role-name="QUESTIONS-cmp20-has-QUESTIONNAIRES-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_QUESTIONID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_QUESTIONID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.QuestionLocal getQuestion(); + + /** + * Sets the related com.ejdoab.tcms.entities.QuestionLocal + * + * @param com.ejdoab.tcms.entities.QuestionnaireLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param question the new CMR value + */ + public abstract void setQuestion(com.ejdoab.tcms.entities.QuestionLocal question); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.PresentationLocal. + * + * + * @ejb.relation + * name="PRESENTATIONS-cmp20-QUESTIONNAIRES-cmp20" + * role-name="QUESTIONNAIRES-cmp20-has-PRESENTATIONS-cmp20" + * target-ejb="Presentation" + * target-role-name="PRESENTATIONS-cmp20-has-QUESTIONNAIRES-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_PRESENTATIONID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_PRESENTATIONID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.PresentationLocal getPresentation(); + + /** + * Sets the related com.ejdoab.tcms.entities.PresentationLocal + * + * @param com.ejdoab.tcms.entities.QuestionnaireLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param presentation the new CMR value + */ + public abstract void setPresentation(com.ejdoab.tcms.entities.PresentationLocal presentation); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.AnswerLocal. + * middlegen.plugins.entitybean.Entity20Table@1fa490e + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="QUESTIONNAIRES-cmp20-ANSWERS-cmp20" + * role-name="QUESTIONNAIRES-cmp20-has-ANSWERS-cmp20" + * target-ejb="Answer" + * target-role-name="ANSWERS-cmp20-has-QUESTIONNAIRES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_QUESTIONNAIREID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_QUESTIONNAIREID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getAnswers(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.AnswerLocal + * + * @param a collection of related com.ejdoab.tcms.entities.AnswerLocal + * + * @ejb.interface-method view-type="local" + * + * @param answers the new CMR value + */ + public abstract void setAnswers(java.util.Collection answers); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param question mandatory CMR field + * @param presentation mandatory CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( com.ejdoab.tcms.entities.QuestionLocal question, com.ejdoab.tcms.entities.PresentationLocal presentation ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "QUESTIONNAIRES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param question mandatory CMR field + * @param presentation mandatory CMR field + */ + public void ejbPostCreate( com.ejdoab.tcms.entities.QuestionLocal question, com.ejdoab.tcms.entities.PresentationLocal presentation ) throws javax.ejb.CreateException { + // Set CMR fields + setQuestion(question); + setPresentation(presentation); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-questionnaires-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/RegistrationDatePricingRuleBean.java b/src/java/com/ejdoab/tcms/entities/RegistrationDatePricingRuleBean.java new file mode 100644 index 0000000..60767fc --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/RegistrationDatePricingRuleBean.java @@ -0,0 +1,179 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: REGISTRATIONDATEPRICINGRULES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="RegistrationDatePricingRule" + * local-jndi-name="ejb.RegistrationDatePricingRuleLocalHome" + * view-type="local" + * primkey-field="pricingModel" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM RegistrationDatePricingRule o" + * + * @ejb.finder + * signature="java.util.Collection findByStartDate(java.util.Date startDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM RegistrationDatePricingRule o WHERE o.startDate = ?1" + * description="STARTDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByEndDate(java.util.Date endDate)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM RegistrationDatePricingRule o WHERE o.endDate = ?1" + * description="ENDDATE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByPrice(double price)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM RegistrationDatePricingRule o WHERE o.price = ?1" + * description="PRICE is not indexed." + * + * @ejb.persistence table-name="REGISTRATIONDATEPRICINGRULES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class RegistrationDatePricingRuleBean implements javax.ejb.EntityBean { + + /** + * Returns the pricingModel + * @todo support OracleClob,OracleBlob on WLS + * + * @return the pricingModel + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_PRICINGMODEL" + */ + public abstract java.lang.String getPricingModel(); + + /** + * Sets the pricingModel + * + * @param java.lang.String the new pricingModel value + */ + public abstract void setPricingModel(java.lang.String pricingModel); + + /** + * Returns the startDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the startDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="STARTDATE" + */ + public abstract java.util.Date getStartDate(); + + /** + * Sets the startDate + * + * @param java.util.Date the new startDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setStartDate(java.util.Date startDate); + + /** + * Returns the endDate + * @todo support OracleClob,OracleBlob on WLS + * + * @return the endDate + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="ENDDATE" + */ + public abstract java.util.Date getEndDate(); + + /** + * Sets the endDate + * + * @param java.util.Date the new endDate value + * @ejb.interface-method view-type="local" + */ + public abstract void setEndDate(java.util.Date endDate); + + /** + * Returns the price + * @todo support OracleClob,OracleBlob on WLS + * + * @return the price + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PRICE" + */ + public abstract double getPrice(); + + /** + * Sets the price + * + * @param double the new price value + * @ejb.interface-method view-type="local" + */ + public abstract void setPrice(double price); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param startDate the startDate value + * @param endDate the endDate value + * @param price the price value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.String ejbCreate( java.util.Date startDate, java.util.Date endDate, double price ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + setPricingModel(com.ejdoab.tcms.entities.RegistrationDatePricingRuleUtil.generateGUID(this)); + + // Set CMP fields + setStartDate(startDate); + setEndDate(endDate); + setPrice(price); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param startDate the startDate value + * @param endDate the endDate value + * @param price the price value + */ + public void ejbPostCreate( java.util.Date startDate, java.util.Date endDate, double price ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-registrationdatepricingrules-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/ReminderBean.java b/src/java/com/ejdoab/tcms/entities/ReminderBean.java new file mode 100644 index 0000000..50db27e --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/ReminderBean.java @@ -0,0 +1,273 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: REMINDERS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Reminder" + * local-jndi-name="ejb.ReminderLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Reminder o" + * + * @ejb.finder + * signature="java.util.Collection findByMessage(java.lang.String message)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Reminder o WHERE o.message = ?1" + * description="MESSAGE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDateAndTime(java.util.Date dateAndTime)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Reminder o WHERE o.dateAndTime = ?1" + * description="DATEANDTIME is not indexed." + * + * @ejb.persistence table-name="REMINDERS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class ReminderBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the message + * @todo support OracleClob,OracleBlob on WLS + * + * @return the message + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="MESSAGE" + */ + public abstract java.lang.String getMessage(); + + /** + * Sets the message + * + * @param java.lang.String the new message value + * @ejb.interface-method view-type="local" + */ + public abstract void setMessage(java.lang.String message); + + /** + * Returns the dateAndTime + * @todo support OracleClob,OracleBlob on WLS + * + * @return the dateAndTime + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DATEANDTIME" + */ + public abstract java.util.Date getDateAndTime(); + + /** + * Sets the dateAndTime + * + * @param java.util.Date the new dateAndTime value + * @ejb.interface-method view-type="local" + */ + public abstract void setDateAndTime(java.util.Date dateAndTime); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.UserLocal. + * + * + * @ejb.relation + * name="USERS-cmp20-REMINDERS-cmp20" + * role-name="REMINDERS-cmp20-has-USERS-cmp20" + * target-ejb="User" + * target-role-name="USERS-cmp20-has-REMINDERS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.UserLocal getUser(); + + /** + * Sets the related com.ejdoab.tcms.entities.UserLocal + * + * @param com.ejdoab.tcms.entities.ReminderLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param user the new CMR value + */ + public abstract void setUser(com.ejdoab.tcms.entities.UserLocal user); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.ScheduleEntryLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="SCHEDULEENTRIES-cmp20-REMINDERS-cmp20" + * role-name="REMINDERS-cmp20-has-SCHEDULEENTRIES-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_SCHEDULEENTRYID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_SCHEDULEENTRYID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.ScheduleEntryLocal getScheduleEntry(); + + /** + * Sets the related com.ejdoab.tcms.entities.ScheduleEntryLocal + * + * @param com.ejdoab.tcms.entities.ReminderLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param scheduleEntry the new CMR value + */ + public abstract void setScheduleEntry(com.ejdoab.tcms.entities.ScheduleEntryLocal scheduleEntry); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param dateAndTime the dateAndTime value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.util.Date dateAndTime ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "REMINDERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setDateAndTime(dateAndTime); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param dateAndTime the dateAndTime value + */ + public void ejbPostCreate( java.util.Date dateAndTime ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param message the message value + * @param dateAndTime the dateAndTime value + * @param user CMR field + * @param scheduleEntry CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String message, java.util.Date dateAndTime, com.ejdoab.tcms.entities.UserLocal user, com.ejdoab.tcms.entities.ScheduleEntryLocal scheduleEntry ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "REMINDERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setMessage(message); + setDateAndTime(dateAndTime); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param message the message value + * @param dateAndTime the dateAndTime value + * @param user CMR field + * @param scheduleEntry CMR field + */ + public void ejbPostCreate( java.lang.String message, java.util.Date dateAndTime, com.ejdoab.tcms.entities.UserLocal user, com.ejdoab.tcms.entities.ScheduleEntryLocal scheduleEntry ) throws javax.ejb.CreateException { + // Set CMR fields + setUser(user); + setScheduleEntry(scheduleEntry); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-reminders-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/RoleBean.java b/src/java/com/ejdoab/tcms/entities/RoleBean.java new file mode 100644 index 0000000..2a9bd63 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/RoleBean.java @@ -0,0 +1,193 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: ROLES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Role" + * local-jndi-name="ejb.RoleLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Role o" + * + * @ejb.finder + * signature="java.util.Collection findByRolename(java.lang.String rolename)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Role o WHERE o.rolename = ?1" + * description="ROLENAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Role o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.persistence table-name="ROLES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class RoleBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the rolename + * @todo support OracleClob,OracleBlob on WLS + * + * @return the rolename + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="ROLENAME" + */ + public abstract java.lang.String getRolename(); + + /** + * Sets the rolename + * + * @param java.lang.String the new rolename value + * @ejb.interface-method view-type="local" + */ + public abstract void setRolename(java.lang.String rolename); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param rolename the rolename value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String rolename ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ROLES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setRolename(rolename); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param rolename the rolename value + */ + public void ejbPostCreate( java.lang.String rolename ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param rolename the rolename value + * @param description the description value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String rolename, java.lang.String description ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ROLES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setRolename(rolename); + setDescription(description); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param rolename the rolename value + * @param description the description value + */ + public void ejbPostCreate( java.lang.String rolename, java.lang.String description ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-roles-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/RoomBean.java b/src/java/com/ejdoab/tcms/entities/RoomBean.java new file mode 100644 index 0000000..5a4e73a --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/RoomBean.java @@ -0,0 +1,289 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: ROOMS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Room" + * local-jndi-name="ejb.RoomLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Room o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Room o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByNotes(java.lang.String notes)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Room o WHERE o.notes = ?1" + * description="NOTES is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByCapacity(int capacity)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Room o WHERE o.capacity = ?1" + * description="CAPACITY is not indexed." + * + * @ejb.persistence table-name="ROOMS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class RoomBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the notes + * @todo support OracleClob,OracleBlob on WLS + * + * @return the notes + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NOTES" + */ + public abstract java.lang.String getNotes(); + + /** + * Sets the notes + * + * @param java.lang.String the new notes value + * @ejb.interface-method view-type="local" + */ + public abstract void setNotes(java.lang.String notes); + + /** + * Returns the capacity + * @todo support OracleClob,OracleBlob on WLS + * + * @return the capacity + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="CAPACITY" + */ + public abstract int getCapacity(); + + /** + * Sets the capacity + * + * @param int the new capacity value + * @ejb.interface-method view-type="local" + */ + public abstract void setCapacity(int capacity); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.VenueLocal. + * + * + * @ejb.relation + * name="VENUES-cmp20-ROOMS-cmp20" + * role-name="ROOMS-cmp20-has-VENUES-cmp20" + * target-ejb="Venue" + * target-role-name="VENUES-cmp20-has-ROOMS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_VENUEID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_VENUEID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.VenueLocal getVenue(); + + /** + * Sets the related com.ejdoab.tcms.entities.VenueLocal + * + * @param com.ejdoab.tcms.entities.RoomLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param venue the new CMR value + */ + public abstract void setVenue(com.ejdoab.tcms.entities.VenueLocal venue); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.SessionLocal. + * middlegen.plugins.entitybean.Entity20Table@6f8b2b + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="ROOMS-cmp20-SESSIONS-cmp20" + * role-name="ROOMS-cmp20-has-SESSIONS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract java.util.Collection getSessions(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.SessionLocal + * + * @param a collection of related com.ejdoab.tcms.entities.SessionLocal + * + * @ejb.interface-method view-type="local" + * + * @param sessions the new CMR value + */ + public abstract void setSessions(java.util.Collection sessions); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ROOMS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param notes the notes value + * @param capacity the capacity value + * @param venue CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String notes, int capacity, com.ejdoab.tcms.entities.VenueLocal venue ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "ROOMS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setNotes(notes); + setCapacity(capacity); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param notes the notes value + * @param capacity the capacity value + * @param venue CMR field + */ + public void ejbPostCreate( java.lang.String name, java.lang.String notes, int capacity, com.ejdoab.tcms.entities.VenueLocal venue ) throws javax.ejb.CreateException { + // Set CMR fields + setVenue(venue); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-rooms-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/ScheduleEntryBean.java b/src/java/com/ejdoab/tcms/entities/ScheduleEntryBean.java new file mode 100644 index 0000000..7774d72 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/ScheduleEntryBean.java @@ -0,0 +1,300 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: SCHEDULEENTRIES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="ScheduleEntry" + * local-jndi-name="ejb.ScheduleEntryLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM ScheduleEntry o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ScheduleEntry o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM ScheduleEntry o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.persistence table-name="SCHEDULEENTRIES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class ScheduleEntryBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.SessionLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="SESSIONS-cmp20-SCHEDULEENTRIES-cmp20" + * role-name="SCHEDULEENTRIES-cmp20-has-SESSIONS-cmp20" + * target-ejb="Session" + * target-role-name="SESSIONS-cmp20-has-SCHEDULEENTRIES-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_SESSIONID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_SESSIONID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.SessionLocal getSession(); + + /** + * Sets the related com.ejdoab.tcms.entities.SessionLocal + * + * @param com.ejdoab.tcms.entities.ScheduleEntryLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param session the new CMR value + */ + public abstract void setSession(com.ejdoab.tcms.entities.SessionLocal session); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.UserLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-SCHEDULEENTRIES-cmp20" + * role-name="SCHEDULEENTRIES-cmp20-has-USERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.UserLocal getUser(); + + /** + * Sets the related com.ejdoab.tcms.entities.UserLocal + * + * @param com.ejdoab.tcms.entities.ScheduleEntryLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param user the new CMR value + */ + public abstract void setUser(com.ejdoab.tcms.entities.UserLocal user); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.ReminderLocal. + * middlegen.plugins.entitybean.Entity20Table@19b6225 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="SCHEDULEENTRIES-cmp20-REMINDERS-cmp20" + * role-name="SCHEDULEENTRIES-cmp20-has-REMINDERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract java.util.Collection getReminders(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.ReminderLocal + * + * @param a collection of related com.ejdoab.tcms.entities.ReminderLocal + * + * @ejb.interface-method view-type="local" + * + * @param reminders the new CMR value + */ + public abstract void setReminders(java.util.Collection reminders); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "SCHEDULEENTRIES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param description the description value + * @param session CMR field + * @param user CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String description, com.ejdoab.tcms.entities.SessionLocal session, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "SCHEDULEENTRIES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setDescription(description); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param description the description value + * @param session CMR field + * @param user CMR field + */ + public void ejbPostCreate( java.lang.String name, java.lang.String description, com.ejdoab.tcms.entities.SessionLocal session, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Set CMR fields + setSession(session); + setUser(user); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-scheduleentries-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/SeqBlockBean.java b/src/java/com/ejdoab/tcms/entities/SeqBlockBean.java new file mode 100644 index 0000000..4f075d9 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/SeqBlockBean.java @@ -0,0 +1,121 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: SEQ_BLOCK + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="SeqBlock" + * local-jndi-name="ejb.SeqBlockLocalHome" + * view-type="local" + * primkey-field="name" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM SeqBlock o" + * + * @ejb.finder + * signature="java.util.Collection findByIdx(int idx)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM SeqBlock o WHERE o.idx = ?1" + * description="IDX is not indexed." + * + * @ejb.persistence table-name="SEQ_BLOCK" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class SeqBlockBean implements javax.ejb.EntityBean { + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the idx + * @todo support OracleClob,OracleBlob on WLS + * + * @return the idx + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="IDX" + */ + public abstract int getIdx(); + + /** + * Sets the idx + * + * @param int the new idx value + * @ejb.interface-method view-type="local" + */ + public abstract void setIdx(int idx); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param idx the idx value + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.String ejbCreate( int idx ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + setName(com.ejdoab.tcms.entities.SeqBlockUtil.generateGUID(this)); + + // Set CMP fields + setIdx(idx); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param idx the idx value + */ + public void ejbPostCreate( int idx ) throws javax.ejb.CreateException { + // Set CMR fields + } + + + // No C:\tcms\src\middlegen\merge/cmp20-seq_block-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/SequenceBean.java b/src/java/com/ejdoab/tcms/entities/SequenceBean.java new file mode 100644 index 0000000..51a510b --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/SequenceBean.java @@ -0,0 +1,59 @@ +package com.ejdoab.tcms.entities; + +import javax.ejb.*; + +/** + * Sequence Block Entity Bean + * + * @author Middlegen + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Sequence" + * local-jndi-name="middlegen.sequencegenerator.ejb.SequenceLocalHome" + * view-type="local" + * primkey-field="name" + * + * @ejb.persistence table-name="SEQ_BLOCK" + */ +public abstract class SequenceBean implements EntityBean { + + /** + * @ejb.create-method + */ + public String ejbCreate(String name) throws javax.ejb.CreateException { + setName(name); + setIndex(0); + return null; + } + + /** + * Returns the index + * + * @return the index + * + * @ejb.persistence column-name="idx" + */ + public abstract int getIndex(); + public abstract void setIndex(int newIndex); + + /** + * Returns the name + * + * @return the name + * + * @ejb.pk-field + * @ejb.persistence column-name="name" + */ + public abstract String getName(); + public abstract void setName(java.lang.String newName); + + /** + * @ejb.interface-method view-type="local" + */ + public int getValueAfterIncrementingBy(int blockSize) { + setIndex(getIndex() + blockSize); + return getIndex(); + } +} diff --git a/src/java/com/ejdoab/tcms/entities/SequenceSessionBean.java b/src/java/com/ejdoab/tcms/entities/SequenceSessionBean.java new file mode 100644 index 0000000..4f9eb36 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/SequenceSessionBean.java @@ -0,0 +1,97 @@ +package com.ejdoab.tcms.entities; + +import com.ejdoab.tcms.entities.SequenceLocalHome; +import com.ejdoab.tcms.entities.SequenceLocal; +import com.ejdoab.tcms.entities.SequenceUtil; + +/** + * Sequence Block Session Bean + * + * @ejb.bean + * type="Stateless" + * name="SequenceSession" + * description="Sequence generator" + * local-jndi-name="com.ejdoab.tcms.entities.SequenceSessionLocalHome" + * view-type="local" + * + * @ejb.ejb-ref + * ejb-name="Sequence" + * ref-name="ejb/Sequence" + * view-type="local" + * + * @ejb:env-entry + * name="blockSize" + * type="java.lang.Integer" + * value="5" + * + * @ejb:env-entry + * name="retryCount" + * type="java.lang.Integer" + * value="2" + */ +public abstract class SequenceSessionBean implements javax.ejb.SessionBean { + + private class Entry { + SequenceLocal sequence; + int last; + } + + private java.util.Hashtable _entries = new java.util.Hashtable(); + private int _blockSize; + private int _retryCount; + private SequenceLocalHome _sequenceHome; + + /** + * @ejb.interface-method view-type="local" + */ + public int getNextSequenceNumber(String name) { + try { + Entry entry = (Entry) _entries.get(name); + + if (entry == null) { + // add an entry to the sequence table + entry = new Entry(); + try { + entry.sequence = _sequenceHome.findByPrimaryKey(name); + } catch (javax.ejb.FinderException e) { + //System.out.println("\n\n\n\n******** : " + e + "\n\n\n\n"); + // if we couldn't find it, then create it... + entry.sequence = _sequenceHome.create(name); + } + _entries.put(name, entry); + } + if (entry.last % _blockSize == 0) { + for (int retry = 0; true; retry++) { + try { + entry.last = entry.sequence.getValueAfterIncrementingBy(_blockSize); + break; + } catch (javax.ejb.TransactionRolledbackLocalException e) { + if (retry < _retryCount) { + // we hit a concurrency exception, so try again... + //System.out.println("RETRYING"); + continue; + } else { + // we tried too many times, so fail... + throw new javax.ejb.EJBException(e); + } + } + } + } + return entry.last++; + } catch (javax.ejb.CreateException e) { + throw new javax.ejb.EJBException(e); + } + } + + public void setSessionContext( javax.ejb.SessionContext sessionContext) { + try { + javax.naming.Context namingContext = new javax.naming.InitialContext(); + _blockSize = ((Integer) namingContext.lookup("java:comp/env/blockSize")).intValue(); + _retryCount = ((Integer) namingContext.lookup("java:comp/env/retryCount")).intValue(); + + _sequenceHome = SequenceUtil.getLocalHome(); + } catch(javax.naming.NamingException e) { + throw new javax.ejb.EJBException(e); + } + } +} diff --git a/src/java/com/ejdoab/tcms/entities/SessionBean.java b/src/java/com/ejdoab/tcms/entities/SessionBean.java new file mode 100644 index 0000000..e812fdb --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/SessionBean.java @@ -0,0 +1,308 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: SESSIONS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Session" + * local-jndi-name="ejb.SessionLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Session o" + * + * @ejb.finder + * signature="java.util.Collection findByDateTimeBegin(java.util.Date dateTimeBegin)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Session o WHERE o.dateTimeBegin = ?1" + * description="DATETIMEBEGIN is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDateTimeEnd(java.util.Date dateTimeEnd)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Session o WHERE o.dateTimeEnd = ?1" + * description="DATETIMEEND is not indexed." + * + * @ejb.persistence table-name="SESSIONS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class SessionBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the dateTimeBegin + * @todo support OracleClob,OracleBlob on WLS + * + * @return the dateTimeBegin + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DATETIMEBEGIN" + */ + public abstract java.util.Date getDateTimeBegin(); + + /** + * Sets the dateTimeBegin + * + * @param java.util.Date the new dateTimeBegin value + * @ejb.interface-method view-type="local" + */ + public abstract void setDateTimeBegin(java.util.Date dateTimeBegin); + + /** + * Returns the dateTimeEnd + * @todo support OracleClob,OracleBlob on WLS + * + * @return the dateTimeEnd + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DATETIMEEND" + */ + public abstract java.util.Date getDateTimeEnd(); + + /** + * Sets the dateTimeEnd + * + * @param java.util.Date the new dateTimeEnd value + * @ejb.interface-method view-type="local" + */ + public abstract void setDateTimeEnd(java.util.Date dateTimeEnd); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.PresentationLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="PRESENTATIONS-cmp20-SESSIONS-cmp20" + * role-name="SESSIONS-cmp20-has-PRESENTATIONS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_PRESENTATIONID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_PRESENTATIONID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.PresentationLocal getPresentation(); + + /** + * Sets the related com.ejdoab.tcms.entities.PresentationLocal + * + * @param com.ejdoab.tcms.entities.SessionLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param presentation the new CMR value + */ + public abstract void setPresentation(com.ejdoab.tcms.entities.PresentationLocal presentation); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.ScheduleEntryLocal. + * middlegen.plugins.entitybean.Entity20Table@1e88b35 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * + * @ejb.relation + * name="SESSIONS-cmp20-SCHEDULEENTRIES-cmp20" + * role-name="SESSIONS-cmp20-has-SCHEDULEENTRIES-cmp20" + * target-ejb="ScheduleEntry" + * target-role-name="SCHEDULEENTRIES-cmp20-has-SESSIONS-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_SESSIONID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_SESSIONID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getScheduleEntries(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.ScheduleEntryLocal + * + * @param a collection of related com.ejdoab.tcms.entities.ScheduleEntryLocal + * + * @ejb.interface-method view-type="local" + * + * @param scheduleEntries the new CMR value + */ + public abstract void setScheduleEntries(java.util.Collection scheduleEntries); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.RoomLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="ROOMS-cmp20-SESSIONS-cmp20" + * role-name="SESSIONS-cmp20-has-ROOMS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_ROOMID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_ROOMID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.RoomLocal getRoom(); + + /** + * Sets the related com.ejdoab.tcms.entities.RoomLocal + * + * @param com.ejdoab.tcms.entities.SessionLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param room the new CMR value + */ + public abstract void setRoom(com.ejdoab.tcms.entities.RoomLocal room); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "SESSIONS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param dateTimeBegin the dateTimeBegin value + * @param dateTimeEnd the dateTimeEnd value + * @param presentation CMR field + * @param room CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.util.Date dateTimeBegin, java.util.Date dateTimeEnd, com.ejdoab.tcms.entities.PresentationLocal presentation, com.ejdoab.tcms.entities.RoomLocal room ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "SESSIONS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setDateTimeBegin(dateTimeBegin); + setDateTimeEnd(dateTimeEnd); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param dateTimeBegin the dateTimeBegin value + * @param dateTimeEnd the dateTimeEnd value + * @param presentation CMR field + * @param room CMR field + */ + public void ejbPostCreate( java.util.Date dateTimeBegin, java.util.Date dateTimeEnd, com.ejdoab.tcms.entities.PresentationLocal presentation, com.ejdoab.tcms.entities.RoomLocal room ) throws javax.ejb.CreateException { + // Set CMR fields + setPresentation(presentation); + setRoom(room); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-sessions-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/TrackBean.java b/src/java/com/ejdoab/tcms/entities/TrackBean.java new file mode 100644 index 0000000..fc2861f --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/TrackBean.java @@ -0,0 +1,260 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: TRACKS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Track" + * local-jndi-name="ejb.TrackLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Track o" + * + * @ejb.finder + * signature="java.util.Collection findByTitle(java.lang.String title)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Track o WHERE o.title = ?1" + * description="TITLE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findBySubTitle(java.lang.String subTitle)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Track o WHERE o.subTitle = ?1" + * description="SUBTITLE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByDescription(java.lang.String description)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Track o WHERE o.description = ?1" + * description="DESCRIPTION is not indexed." + * + * @ejb.persistence table-name="TRACKS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class TrackBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the title + * @todo support OracleClob,OracleBlob on WLS + * + * @return the title + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="TITLE" + */ + public abstract java.lang.String getTitle(); + + /** + * Sets the title + * + * @param java.lang.String the new title value + * @ejb.interface-method view-type="local" + */ + public abstract void setTitle(java.lang.String title); + + /** + * Returns the subTitle + * @todo support OracleClob,OracleBlob on WLS + * + * @return the subTitle + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="SUBTITLE" + */ + public abstract java.lang.String getSubTitle(); + + /** + * Sets the subTitle + * + * @param java.lang.String the new subTitle value + * @ejb.interface-method view-type="local" + */ + public abstract void setSubTitle(java.lang.String subTitle); + + /** + * Returns the description + * @todo support OracleClob,OracleBlob on WLS + * + * @return the description + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="DESCRIPTION" + */ + public abstract java.lang.String getDescription(); + + /** + * Sets the description + * + * @param java.lang.String the new description value + * @ejb.interface-method view-type="local" + */ + public abstract void setDescription(java.lang.String description); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.ConferenceLocal. + * + * + * @ejb.relation + * name="CONFERENCES-cmp20-TRACKS-cmp20" + * role-name="TRACKS-cmp20-has-CONFERENCES-cmp20" + * target-ejb="Conference" + * target-role-name="CONFERENCES-cmp20-has-TRACKS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_CONFERENCEID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_CONFERENCEID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.ConferenceLocal getConference(); + + /** + * Sets the related com.ejdoab.tcms.entities.ConferenceLocal + * + * @param com.ejdoab.tcms.entities.TrackLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param conference the new CMR value + */ + public abstract void setConference(com.ejdoab.tcms.entities.ConferenceLocal conference); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "TRACKS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param title the title value + * @param subTitle the subTitle value + * @param description the description value + * @param conference CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String title, java.lang.String subTitle, java.lang.String description, com.ejdoab.tcms.entities.ConferenceLocal conference ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "TRACKS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setTitle(title); + setSubTitle(subTitle); + setDescription(description); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param title the title value + * @param subTitle the subTitle value + * @param description the description value + * @param conference CMR field + */ + public void ejbPostCreate( java.lang.String title, java.lang.String subTitle, java.lang.String description, com.ejdoab.tcms.entities.ConferenceLocal conference ) throws javax.ejb.CreateException { + // Set CMR fields + setConference(conference); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-tracks-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/UserBean.java b/src/java/com/ejdoab/tcms/entities/UserBean.java new file mode 100644 index 0000000..8c08c32 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/UserBean.java @@ -0,0 +1,577 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: USERS + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="User" + * local-jndi-name="ejb.UserLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM User o" + * + * @ejb.finder + * signature="java.util.Collection findByPassword(java.lang.String password)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.password = ?1" + * description="PASSWORD is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByFirstName(java.lang.String firstName)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.firstName = ?1" + * description="FIRSTNAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByLastName(java.lang.String lastName)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.lastName = ?1" + * description="LASTNAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByEmail(java.lang.String email)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.email = ?1" + * description="EMAIL is indexed." + * + * @ejb.finder + * signature="java.util.Collection findByHomePhone(java.lang.String homePhone)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.homePhone = ?1" + * description="HOMEPHONE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByWorkPhone(java.lang.String workPhone)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.workPhone = ?1" + * description="WORKPHONE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByFax(java.lang.String fax)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM User o WHERE o.fax = ?1" + * description="FAX is not indexed." + * + * @ejb.persistence table-name="USERS" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class UserBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the password + * @todo support OracleClob,OracleBlob on WLS + * + * @return the password + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PASSWORD" + */ + public abstract java.lang.String getPassword(); + + /** + * Sets the password + * + * @param java.lang.String the new password value + * @ejb.interface-method view-type="local" + */ + public abstract void setPassword(java.lang.String password); + + /** + * Returns the firstName + * @todo support OracleClob,OracleBlob on WLS + * + * @return the firstName + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="FIRSTNAME" + */ + public abstract java.lang.String getFirstName(); + + /** + * Sets the firstName + * + * @param java.lang.String the new firstName value + * @ejb.interface-method view-type="local" + */ + public abstract void setFirstName(java.lang.String firstName); + + /** + * Returns the lastName + * @todo support OracleClob,OracleBlob on WLS + * + * @return the lastName + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="LASTNAME" + */ + public abstract java.lang.String getLastName(); + + /** + * Sets the lastName + * + * @param java.lang.String the new lastName value + * @ejb.interface-method view-type="local" + */ + public abstract void setLastName(java.lang.String lastName); + + /** + * Returns the email + * @todo support OracleClob,OracleBlob on WLS + * + * @return the email + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="EMAIL" + */ + public abstract java.lang.String getEmail(); + + /** + * Sets the email + * + * @param java.lang.String the new email value + * @ejb.interface-method view-type="local" + */ + public abstract void setEmail(java.lang.String email); + + /** + * Returns the homePhone + * @todo support OracleClob,OracleBlob on WLS + * + * @return the homePhone + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="HOMEPHONE" + */ + public abstract java.lang.String getHomePhone(); + + /** + * Sets the homePhone + * + * @param java.lang.String the new homePhone value + * @ejb.interface-method view-type="local" + */ + public abstract void setHomePhone(java.lang.String homePhone); + + /** + * Returns the workPhone + * @todo support OracleClob,OracleBlob on WLS + * + * @return the workPhone + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="WORKPHONE" + */ + public abstract java.lang.String getWorkPhone(); + + /** + * Sets the workPhone + * + * @param java.lang.String the new workPhone value + * @ejb.interface-method view-type="local" + */ + public abstract void setWorkPhone(java.lang.String workPhone); + + /** + * Returns the fax + * @todo support OracleClob,OracleBlob on WLS + * + * @return the fax + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="FAX" + */ + public abstract java.lang.String getFax(); + + /** + * Sets the fax + * + * @param java.lang.String the new fax value + * @ejb.interface-method view-type="local" + */ + public abstract void setFax(java.lang.String fax); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.AddressLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="ADDRESSES-cmp20-USERS-cmp20" + * role-name="USERS-cmp20-has-ADDRESSES-cmp20" + * target-ejb="Address" + * target-role-name="ADDRESSES-cmp20-has-USERS-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_ADDRESSID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_ADDRESSID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.AddressLocal getAddress(); + + /** + * Sets the related com.ejdoab.tcms.entities.AddressLocal + * + * @param com.ejdoab.tcms.entities.UserLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param address the new CMR value + */ + public abstract void setAddress(com.ejdoab.tcms.entities.AddressLocal address); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.AnswerLocal. + * middlegen.plugins.entitybean.Entity20Table@1fa490e + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-ANSWERS-cmp20" + * role-name="USERS-cmp20-has-ANSWERS-cmp20" + * target-ejb="Answer" + * target-role-name="ANSWERS-cmp20-has-USERS-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getAnswers(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.AnswerLocal + * + * @param a collection of related com.ejdoab.tcms.entities.AnswerLocal + * + * @ejb.interface-method view-type="local" + * + * @param answers the new CMR value + */ + public abstract void setAnswers(java.util.Collection answers); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.UserRoleLocal. + * middlegen.plugins.entitybean.Entity20Table@1d29a78 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-USERROLES-cmp20" + * role-name="USERS-cmp20-has-USERROLES-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract java.util.Collection getUserRoles(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.UserRoleLocal + * + * @param a collection of related com.ejdoab.tcms.entities.UserRoleLocal + * + * @ejb.interface-method view-type="local" + * + * @param userRoles the new CMR value + */ + public abstract void setUserRoles(java.util.Collection userRoles); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.ReminderLocal. + * middlegen.plugins.entitybean.Entity20Table@19b6225 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-REMINDERS-cmp20" + * role-name="USERS-cmp20-has-REMINDERS-cmp20" + * target-ejb="Reminder" + * target-role-name="REMINDERS-cmp20-has-USERS-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getReminders(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.ReminderLocal + * + * @param a collection of related com.ejdoab.tcms.entities.ReminderLocal + * + * @ejb.interface-method view-type="local" + * + * @param reminders the new CMR value + */ + public abstract void setReminders(java.util.Collection reminders); + + /** + * This is a bi-directional one-to-one relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.PresenterLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-PRESENTERS-cmp20" + * role-name="USERS-cmp20-has-PRESENTERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract com.ejdoab.tcms.entities.PresenterLocal getPresenter(); + + /** + * Sets the related com.ejdoab.tcms.entities.PresenterLocal + * + * @param com.ejdoab.tcms.entities.UserLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param presenter the new CMR value + */ + public abstract void setPresenter(com.ejdoab.tcms.entities.PresenterLocal presenter); + + /** + * This is a bi-directional one-to-one relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.AttendeeLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-ATTENDEES-cmp20" + * role-name="USERS-cmp20-has-ATTENDEES-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract com.ejdoab.tcms.entities.AttendeeLocal getAttendee(); + + /** + * Sets the related com.ejdoab.tcms.entities.AttendeeLocal + * + * @param com.ejdoab.tcms.entities.UserLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param attendee the new CMR value + */ + public abstract void setAttendee(com.ejdoab.tcms.entities.AttendeeLocal attendee); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.ScheduleEntryLocal. + * middlegen.plugins.entitybean.Entity20Table@1e88b35 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-SCHEDULEENTRIES-cmp20" + * role-name="USERS-cmp20-has-SCHEDULEENTRIES-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + */ + public abstract java.util.Collection getScheduleEntries(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.ScheduleEntryLocal + * + * @param a collection of related com.ejdoab.tcms.entities.ScheduleEntryLocal + * + * @ejb.interface-method view-type="local" + * + * @param scheduleEntries the new CMR value + */ + public abstract void setScheduleEntries(java.util.Collection scheduleEntries); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "USERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param password the password value + * @param firstName the firstName value + * @param lastName the lastName value + * @param email the email value + * @param homePhone the homePhone value + * @param workPhone the workPhone value + * @param fax the fax value + * @param address CMR field + * @param presenter CMR field + * @param attendee CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String email, java.lang.String homePhone, java.lang.String workPhone, java.lang.String fax, com.ejdoab.tcms.entities.AddressLocal address, com.ejdoab.tcms.entities.PresenterLocal presenter, com.ejdoab.tcms.entities.AttendeeLocal attendee ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "USERS.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setPassword(password); + setFirstName(firstName); + setLastName(lastName); + setEmail(email); + setHomePhone(homePhone); + setWorkPhone(workPhone); + setFax(fax); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param password the password value + * @param firstName the firstName value + * @param lastName the lastName value + * @param email the email value + * @param homePhone the homePhone value + * @param workPhone the workPhone value + * @param fax the fax value + * @param address CMR field + * @param presenter CMR field + * @param attendee CMR field + */ + public void ejbPostCreate( java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String email, java.lang.String homePhone, java.lang.String workPhone, java.lang.String fax, com.ejdoab.tcms.entities.AddressLocal address, com.ejdoab.tcms.entities.PresenterLocal presenter, com.ejdoab.tcms.entities.AttendeeLocal attendee ) throws javax.ejb.CreateException { + // Set CMR fields + setAddress(address); + setPresenter(presenter); + setAttendee(attendee); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-users-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/UserRoleBean.java b/src/java/com/ejdoab/tcms/entities/UserRoleBean.java new file mode 100644 index 0000000..9f9629d --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/UserRoleBean.java @@ -0,0 +1,200 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: USERROLES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="UserRole" + * local-jndi-name="ejb.UserRoleLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM UserRole o" + * + * @ejb.finder + * signature="java.util.Collection findByRole(int role)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM UserRole o WHERE o.role = ?1" + * description="FK_ROLE is not indexed." + * + * @ejb.persistence table-name="USERROLES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class UserRoleBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the role + * @todo support OracleClob,OracleBlob on WLS + * + * @return the role + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="FK_ROLE" + */ + public abstract int getRole(); + + /** + * Sets the role + * + * @param int the new role value + * @ejb.interface-method view-type="local" + */ + public abstract void setRole(int role); + + /** + * This is a bi-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.UserLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="USERS-cmp20-USERROLES-cmp20" + * role-name="USERROLES-cmp20-has-USERS-cmp20" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_USERID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_USERID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.UserLocal getUser(); + + /** + * Sets the related com.ejdoab.tcms.entities.UserLocal + * + * @param com.ejdoab.tcms.entities.UserRoleLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param user the new CMR value + */ + public abstract void setUser(com.ejdoab.tcms.entities.UserLocal user); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "USERROLES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param role the role value + * @param user CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( int role, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "USERROLES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setRole(role); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param role the role value + * @param user CMR field + */ + public void ejbPostCreate( int role, com.ejdoab.tcms.entities.UserLocal user ) throws javax.ejb.CreateException { + // Set CMR fields + setUser(user); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-userroles-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/entities/VenueBean.java b/src/java/com/ejdoab/tcms/entities/VenueBean.java new file mode 100644 index 0000000..3627078 --- /dev/null +++ b/src/java/com/ejdoab/tcms/entities/VenueBean.java @@ -0,0 +1,383 @@ +package com.ejdoab.tcms.entities; + +/** + * A TCMS domain entity for table: VENUES + * Generated by Middlegen CMP2.0 Plugin + * + * @author Middlegen + * + * + * @ejb.bean + * type="CMP" + * cmp-version="2.x" + * name="Venue" + * local-jndi-name="ejb.VenueLocalHome" + * view-type="local" + * primkey-field="id" + * + * @ejb.finder + * signature="java.util.Collection findAll()" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT OBJECT(o) FROM Venue o" + * + * @ejb.finder + * signature="java.util.Collection findByName(java.lang.String name)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Venue o WHERE o.name = ?1" + * description="NAME is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByPhone(java.lang.String phone)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Venue o WHERE o.phone = ?1" + * description="PHONE is not indexed." + * + * @ejb.finder + * signature="java.util.Collection findByFax(java.lang.String fax)" + * result-type-mapping="Local" + * method-intf="LocalHome" + * query="SELECT DISTINCT OBJECT(o) FROM Venue o WHERE o.fax = ?1" + * description="FAX is not indexed." + * + * @ejb.persistence table-name="VENUES" + * + * @weblogic.data-source-name $plugin.middlegen.middlegenTask.datasourceJNDIName + */ +public abstract class VenueBean implements javax.ejb.EntityBean { + + /** + * Returns the id + * @todo support OracleClob,OracleBlob on WLS + * + * @return the id + * + * @ejb.pk-field + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PK_ID" + */ + public abstract java.lang.Integer getId(); + + /** + * Sets the id + * + * @param java.lang.Integer the new id value + */ + public abstract void setId(java.lang.Integer id); + + /** + * Returns the name + * @todo support OracleClob,OracleBlob on WLS + * + * @return the name + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="NAME" + */ + public abstract java.lang.String getName(); + + /** + * Sets the name + * + * @param java.lang.String the new name value + * @ejb.interface-method view-type="local" + */ + public abstract void setName(java.lang.String name); + + /** + * Returns the phone + * @todo support OracleClob,OracleBlob on WLS + * + * @return the phone + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="PHONE" + */ + public abstract java.lang.String getPhone(); + + /** + * Sets the phone + * + * @param java.lang.String the new phone value + * @ejb.interface-method view-type="local" + */ + public abstract void setPhone(java.lang.String phone); + + /** + * Returns the fax + * @todo support OracleClob,OracleBlob on WLS + * + * @return the fax + * + * @ejb.interface-method view-type="local" + * @ejb.persistence column-name="FAX" + */ + public abstract java.lang.String getFax(); + + /** + * Sets the fax + * + * @param java.lang.String the new fax value + * @ejb.interface-method view-type="local" + */ + public abstract void setFax(java.lang.String fax); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return the related com.ejdoab.tcms.entities.AddressLocal. + * + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="ADDRESSES-cmp20-VENUES-cmp20" + * role-name="VENUES-cmp20-has-ADDRESSES-cmp20" + * target-ejb="Address" + * target-role-name="ADDRESSES-cmp20-has-VENUES-cmp20" + * target-multiple="yes" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.column-map + * foreign-key-column="FK_ADDRESSID" + * key-column="PK_ID" + * + * @jboss.relation + * fk-constraint="true" + * fk-column="FK_ADDRESSID" + * related-pk-field="id" + * + */ + public abstract com.ejdoab.tcms.entities.AddressLocal getAddress(); + + /** + * Sets the related com.ejdoab.tcms.entities.AddressLocal + * + * @param com.ejdoab.tcms.entities.VenueLocal the related $target.variableName + * + * @ejb.interface-method view-type="local" + * + * @param address the new CMR value + */ + public abstract void setAddress(com.ejdoab.tcms.entities.AddressLocal address); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.ConferenceLocal. + * middlegen.plugins.entitybean.Entity20Table@c95daa + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * + * @ejb.relation + * name="VENUES-cmp20-CONFERENCES-cmp20" + * role-name="VENUES-cmp20-has-CONFERENCES-cmp20" + * target-ejb="Conference" + * target-role-name="CONFERENCES-cmp20-has-VENUES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_VENUEID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_VENUEID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getConferences(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.ConferenceLocal + * + * @param a collection of related com.ejdoab.tcms.entities.ConferenceLocal + * + * @ejb.interface-method view-type="local" + * + * @param conferences the new CMR value + */ + public abstract void setConferences(java.util.Collection conferences); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.BoothLocal. + * middlegen.plugins.entitybean.Entity20Table@3c86e9 + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="VENUES-cmp20-BOOTHS-cmp20" + * role-name="VENUES-cmp20-has-BOOTHS-cmp20" + * target-ejb="Booth" + * target-role-name="BOOTHS-cmp20-has-VENUES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_VENUEID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_VENUEID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getBooths(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.BoothLocal + * + * @param a collection of related com.ejdoab.tcms.entities.BoothLocal + * + * @ejb.interface-method view-type="local" + * + * @param booths the new CMR value + */ + public abstract void setBooths(java.util.Collection booths); + + /** + * This is a uni-directional one-to-many relationship CMR method + * + * @return a java.util.Collection of related com.ejdoab.tcms.entities.RoomLocal. + * middlegen.plugins.entitybean.Entity20Table@1bd669d + * class middlegen.plugins.entitybean.Entity20Table + * middlegen.plugins.entitybean.Entity20Table + * @ejb.interface-method view-type="local" + * + * @ejb.relation + * name="VENUES-cmp20-ROOMS-cmp20" + * role-name="VENUES-cmp20-has-ROOMS-cmp20" + * target-ejb="Room" + * target-role-name="ROOMS-cmp20-has-VENUES-cmp20" + * target-multiple="no" + * + * @jboss.relation-mapping style="foreign-key" + * + * @weblogic.target-column-map + * foreign-key-column="FK_VENUEID" + * key-column="PK_ID" + * + * @jboss.target-relation + * fk-constraint="true" + * fk-column="FK_VENUEID" + * related-pk-field="id" + * + */ + public abstract java.util.Collection getRooms(); + + /** + * Sets a collection of related com.ejdoab.tcms.entities.RoomLocal + * + * @param a collection of related com.ejdoab.tcms.entities.RoomLocal + * + * @ejb.interface-method view-type="local" + * + * @param rooms the new CMR value + */ + public abstract void setRooms(java.util.Collection rooms); + + /** + * This create method takes only mandatory (non-nullable) parameters. + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "VENUES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + */ + public void ejbPostCreate( ) throws javax.ejb.CreateException { + // Set CMR fields + } + + /** + * This create method takes all parameters (both nullable and not nullable). + * + * When the client invokes a create method, the EJB container invokes the ejbCreate method. + * Typically, an ejbCreate method in an entity bean performs the following tasks: + *
    + *
  • Inserts the entity state into the database.
  • + *
  • Initializes the instance variables.
  • + *
  • Returns the primary key.
  • + *
+ * + * @param name the name value + * @param phone the phone value + * @param fax the fax value + * @param address CMR field + * @return the primary key of the new instance + * + * @ejb.create-method + */ + public java.lang.Integer ejbCreate( java.lang.String name, java.lang.String phone, java.lang.String fax, com.ejdoab.tcms.entities.AddressLocal address ) throws javax.ejb.CreateException { + // Use Middlegen's Sequence Block PK generator. Only works for numeric fields + try { + com.ejdoab.tcms.entities.SequenceSessionLocal sequenceGenerator = + com.ejdoab.tcms.entities.SequenceSessionUtil.getLocalHome().create(); + setId(new java.lang.Integer(sequenceGenerator.getNextSequenceNumber( "VENUES.PK_ID" ))); + } catch( javax.naming.NamingException e ) { + throw new javax.ejb.CreateException(e.getMessage()); + } + // Use XDoclet's GUID generator. Only works for String fields + // This requires in ejbdoclet. + + // Set CMP fields + setName(name); + setPhone(phone); + setFax(fax); + // EJB 2.0 spec says return null for CMP ejbCreate methods. + return null; + } + + /** + * The container invokes thos method immediately after it calls ejbCreate. + * + * @param name the name value + * @param phone the phone value + * @param fax the fax value + * @param address CMR field + */ + public void ejbPostCreate( java.lang.String name, java.lang.String phone, java.lang.String fax, com.ejdoab.tcms.entities.AddressLocal address ) throws javax.ejb.CreateException { + // Set CMR fields + setAddress(address); + } + + + // No C:\tcms\src\middlegen\merge/cmp20-venues-class-code.txt found. + +} diff --git a/src/java/com/ejdoab/tcms/services/CVS/Entries b/src/java/com/ejdoab/tcms/services/CVS/Entries new file mode 100644 index 0000000..e4e3318 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/CVS/Entries @@ -0,0 +1,9 @@ +/ConferenceServicesBean.java/1.27/Tue Dec 30 13:53:02 2003/-kb/ +/EmailProcessorBean.java/1.4/Sun Dec 21 21:26:42 2003/-kb/ +/EmailServicesBean.java/1.5/Sun Dec 21 21:26:42 2003/-kb/ +/IScheduleServices.java/1.2/Sun Dec 21 21:26:42 2003// +/ScheduleServicesBean.java/1.10/Sun Dec 21 21:26:42 2003/-kb/ +/UserServicesBean.java/1.11/Mon Jan 26 01:49:58 2004/-kb/ +D/dto//// +D/exceptions//// +D/locator//// diff --git a/src/java/com/ejdoab/tcms/services/CVS/Repository b/src/java/com/ejdoab/tcms/services/CVS/Repository new file mode 100644 index 0000000..e07772f --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/services diff --git a/src/java/com/ejdoab/tcms/services/CVS/Root b/src/java/com/ejdoab/tcms/services/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/services/ConferenceServicesBean.java b/src/java/com/ejdoab/tcms/services/ConferenceServicesBean.java new file mode 100644 index 0000000..0468a3f --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/ConferenceServicesBean.java @@ -0,0 +1,544 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.entities.ConferenceAbstractLocal; +import com.ejdoab.tcms.entities.ConferenceAbstractLocalHome; +import com.ejdoab.tcms.entities.ConferenceAbstractUtil; +import com.ejdoab.tcms.entities.ConferenceNewsLocalHome; +import com.ejdoab.tcms.entities.ConferenceNewsUtil; +import com.ejdoab.tcms.entities.PresentationLocal; +import com.ejdoab.tcms.entities.PresenterLocal; +import com.ejdoab.tcms.entities.SessionLocalHome; +import com.ejdoab.tcms.entities.SessionUtil; +import com.ejdoab.tcms.entities.UserLocalHome; +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTOFactory; +import com.ejdoab.tcms.services.dto.DTOAbstractFactory; +import com.ejdoab.tcms.services.dto.NewsItemDTO; +import com.ejdoab.tcms.services.dto.NewsItemDTOFactory; +import com.ejdoab.tcms.services.dto.SessionDTO; +import com.ejdoab.tcms.services.dto.SessionDTOFactory; +import com.ejdoab.tcms.services.dto.StringCache; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; +import com.ejdoab.tcms.services.dto.page.Page; +import com.ejdoab.tcms.services.dto.page.PageCache; +import com.ejdoab.tcms.services.dto.page.PageFactory; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.services.locator.ServiceLocator; +import com.ejdoab.tcms.services.locator.ServiceLocatorException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.FinderException; +import javax.ejb.SessionBean; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + * + * @ejb.bean + * name="ConferenceServices" + * type="Stateless" + * view-type="both" + * jndi-name="ejb.ConferenceServicesHome" + * local-jndi-name="ejb.ConferenceServicesLocalHome" + * @ejb.transaction + * type="Required" + * @ejb.util + * generate="physical" + * @axis.service + * name="Conference" + * scope="Request" + * include-all="true" + */ +public abstract class ConferenceServicesBean implements SessionBean { + private static Log log = LogFactory.getLog(ConferenceServicesBean.class); + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param start + * @param size + * @return + * @throws DTOCreateException + */ + public Page getSessions(int start, int size) throws DTOCreateException { + SessionLocalHome slh; + + String pageName = "ALL_SESSIONS_" + start + "_" + size; + PageCache cache = PageCache.getInstance(); + Page page = cache.getPage(pageName); + + if (page == null) { + Collection c = null; + + try { + slh = SessionUtil.getLocalHome(); + c = slh.findAll(); + } catch (NamingException ne) { + throw new EJBException("Error accessing Session Information", ne); + } catch (FinderException fe) { + throw new EJBException("Error accessing Session Information", fe); + } + + SessionDTOFactory dtoFactory = (SessionDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(SessionDTO.class); + + if (c != null) { + page = PageFactory.buildPage(c, start, size, dtoFactory); + cache.addPage(pageName, page, 10); + } + } + + return page; + } + + /** + * @ejb.interface-method + * + * @param email + * @param start + * @param size + * @return + * @throws NoSuchUserException + * @throws DTOCreateException + */ + public Page getSessionsByPresenter(String email, int start, int size) + throws NoSuchUserException, DTOCreateException { + UserLocalHome ulh = null; + UserServicesLocal us = null; + + String pageName = "SESSIONS_FOR_" + email + "_" + start + "_" + size; + PageCache cache = PageCache.getInstance(); + Page page = cache.getPage(pageName); + + if (page == null) { + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + UserServicesLocalHome usHome = (UserServicesLocalHome) sl.getLocalHome( + "ejb.UserServicesLocalHome"); + + us = usHome.create(); + } catch (ServiceLocatorException e) { + new EJBException("could not access user services", e); + } catch (CreateException e) { + new EJBException("could not access user services", e); + } + + Collection c = new ArrayList(); + + PresenterLocal presenter = us.findPresenterByEmail(email); + log.info("[getSessionsByPresenter] presenter was" + + ((presenter == null) ? "not" : "") + " found"); + + Collection abstracts = presenter.getConferenceAbstracts(); + log.info("[getSessionsByPresenter] found " + abstracts.size() + + " abstracts"); + + Iterator i = abstracts.iterator(); + + for (int index = 0, n = abstracts.size(); index < n; index++) { + PresentationLocal presentation = ((ConferenceAbstractLocal) i.next()).getPresentation(); + + if (presentation != null) { + Collection sessions = presentation.getSessions(); + c.addAll(sessions); + } + } + + SessionDTOFactory dtoFactory = (SessionDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(SessionDTO.class); + + if (c != null) { + page = PageFactory.buildPage(c, start, size, dtoFactory); + cache.addPage(pageName, page, 10); + } + } + + return page; + } + + /** + * @ejb.interface-method + */ + public boolean submitAbstract(ConferenceAbstractDTO dto) + throws DTOUpdateException { + log.info("[submitAbstract] abstract " + dto.getTitle() + " submitted"); + + boolean sucess = false; + ConferenceAbstractDTOFactory builder = (ConferenceAbstractDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ConferenceAbstractDTO.class); + + if (builder.setDTO(dto)) { + // invalidate the affected cache entries + PageCache cache = PageCache.getInstance(); + cache.invalidateAllStartsWith("ALL_ABSTRACT_"); + cache.invalidateAllStartsWith("ALL_SESSIONS_"); + + return true; + } else { + return false; + } + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param id + * @return + * @throws DTOCreateException + * + */ + public ConferenceAbstractDTO getAbstract(int id) throws DTOCreateException { + ConferenceAbstractLocalHome calh; + ConferenceAbstractDTO dto = null; + ConferenceAbstractLocal cal = null; + + try { + calh = ConferenceAbstractUtil.getLocalHome(); + } catch (NamingException ne) { + throw new EJBException("Error accessing Conference Abstract Information", + ne); + } + + try { + cal = calh.findByPrimaryKey(new Integer(id)); + } catch (FinderException fe) { + throw new DTOCreateException("Error accessing Conference Abstract Information", + fe); + } + + if (cal != null) { + ConferenceAbstractDTOFactory dtoFactory = (ConferenceAbstractDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ConferenceAbstractDTO.class); + dto = (ConferenceAbstractDTO) dtoFactory.getDTO(cal); + } + + return dto; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @return int + */ + public int getAbstractsCount() { + int result = -1; + + ConferenceAbstractLocalHome calh; + + try { + calh = ConferenceAbstractUtil.getLocalHome(); + + Collection c = calh.findAll(); + + // TODO replace with an ejbSelect method if + // jboss 4.x supports the COUNT function in EJB-QL + // as this is grossly inneficient + result = c.size(); + } catch (NamingException ne) { + throw new EJBException("Error accessing Conference Abstract Information", + ne); + } catch (FinderException fe) { + throw new EJBException("Error accessing Conference Abstract Information", + fe); + } + + return result; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param start + * @param size + * @return + * @throws DTOCreateException + */ + public Page getAbstracts(int start, int size) throws DTOCreateException { + ConferenceAbstractLocalHome calh; + String pageName = "ALL_ABSTRACT_" + start + "_" + size; + PageCache cache = PageCache.getInstance(); + Page page = cache.getPage(pageName); + + if (page == null) { + Collection c = null; + + try { + calh = ConferenceAbstractUtil.getLocalHome(); + c = calh.findAll(); + } catch (NamingException ne) { + throw new EJBException("Error accessing Conference Abstract Information", + ne); + } catch (FinderException fe) { + throw new EJBException("Error accessing Conference Abstract Information", + fe); + } + + ConferenceAbstractDTOFactory dtoFactory = (ConferenceAbstractDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ConferenceAbstractDTO.class); + + if (c != null) { + page = PageFactory.buildPage(c, start, size, dtoFactory); + cache.addPage(pageName, page, 10); + } + } + + return page; + } + + /** + * @ejb.interface-method + * + * @param email + * @param start + * @param size + * @return + * @throws NoSuchUserException + * @throws DTOCreateException + */ + public Page getAbstractsByPresenter(String email, int start, int size) + throws NoSuchUserException, DTOCreateException { + log.debug("[getAbstractsByPresenter] start"); + + UserLocalHome ulh = null; + UserServicesLocal us = null; + + String pageName = "ABSTRACTS_FOR_" + email + "_" + start + "_" + size; + PageCache cache = PageCache.getInstance(); + Page page = cache.getPage(pageName); + + if (page == null) { + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + UserServicesLocalHome usHome = (UserServicesLocalHome) sl.getLocalHome( + "ejb.UserServicesLocalHome"); + + us = usHome.create(); + } catch (ServiceLocatorException e) { + new EJBException("could not access user services", e); + } catch (CreateException e) { + new EJBException("could not access user services", e); + } + + PresenterLocal presenter = us.findPresenterByEmail(email); + log.info("[getAbstractsByPresenter] presenter was" + + ((presenter == null) ? "not" : "") + " found"); + + Collection c = presenter.getConferenceAbstracts(); + + ConferenceAbstractDTOFactory dtoFactory = (ConferenceAbstractDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ConferenceAbstractDTO.class); + + if (c != null) { + page = PageFactory.buildPage(c, start, size, dtoFactory); + cache.addPage(pageName, page, 10); + } + } + + return page; + } + + /** + * @ejb.interface-method + * + * @return + */ + public String[] getValidTypes() { + return StringCache.getTypes(); + } + + /** + * @ejb.interface-method + * + * @return + */ + public String[] getValidTopics() { + return StringCache.getTopics(); + } + + /** + * @ejb.interface-method + * + * @return + */ + public String[] getValidLevels() { + return StringCache.getLevels(); + } + + /** + * @ejb.interface-method + * + * @return + */ + public String[] getValidAbstractStatus() { + return StringCache.getAbstractStatus(); + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param start + * @param size + * @return + * @throws DTOCreateException + */ + public Page getNews(int start, int size) throws DTOCreateException { + ConferenceNewsLocalHome cnlh; + + String pageName = "ALL_NEWS_" + start + "_" + size; + PageCache cache = PageCache.getInstance(); + Page page = cache.getPage(pageName); + + if (page == null) { + Collection c = null; + + try { + cnlh = ConferenceNewsUtil.getLocalHome(); + c = cnlh.findAll(); + } catch (NamingException ne) { + throw new EJBException("Error accessing Session Information", ne); + } catch (FinderException fe) { + throw new EJBException("Error accessing Session Information", fe); + } + + NewsItemDTOFactory dtoFactory = (NewsItemDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(NewsItemDTO.class); + + if (c != null) { + page = PageFactory.buildPage(c, start, size, dtoFactory); + cache.addPage(pageName, page, 10); + } + } + + return page; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @return int + */ + public int getNewsCount() { + int result = -1; + + ConferenceNewsLocalHome cnlh; + + try { + cnlh = ConferenceNewsUtil.getLocalHome(); + + Collection c = cnlh.findAll(); + + // TODO replace with an ejbSelect method if + // jboss 4.x supports the COUNT function in EJB-QL + // as this is grossly inneficient + result = c.size(); + } catch (NamingException ne) { + throw new EJBException("Error accessing News", ne); + } catch (FinderException fe) { + throw new EJBException("Error accessing News", fe); + } + + return result; + } + + /** + * @ejb.interface-method + */ + public boolean submitNewsItem(NewsItemDTO dto) throws DTOUpdateException { + log.info("[submitNewsItem] news item " + dto.getTitle() + " submitted"); + + boolean sucess = false; + + NewsItemDTOFactory dtoFactory = (NewsItemDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(NewsItemDTO.class); + + if (dtoFactory.setDTO(dto)) { + // invalidate the affected cache entries + PageCache cache = PageCache.getInstance(); + cache.invalidateAllStartsWith("ALL_NEWS_"); + + return true; + } else { + return false; + } + } + + /** + * @ejb.interface-method + */ + public boolean removeNewsItem(NewsItemDTO dto) throws DTOUpdateException { + log.info("[removeNewsItem] news item " + dto.getTitle() + + " submitted for removal"); + + boolean sucess = false; + + NewsItemDTOFactory dtoFactory = (NewsItemDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(NewsItemDTO.class); + + if (dtoFactory.removeDTO(dto)) { + // invalidate the affected cache entries + PageCache cache = PageCache.getInstance(); + cache.invalidateAllStartsWith("ALL_NEWS_"); + + return true; + } else { + return false; + } + } + + //========================================== + // EJB callbacks + //========================================== + + /** + * @ejb.create-method + */ + public void ejbCreate() throws CreateException { + } + + /** + * @throws CreateException DOCUMENT ME! + */ + public void ejbPostCreate() throws CreateException { + } +} diff --git a/src/java/com/ejdoab/tcms/services/EmailProcessorBean.java b/src/java/com/ejdoab/tcms/services/EmailProcessorBean.java new file mode 100644 index 0000000..859585b --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/EmailProcessorBean.java @@ -0,0 +1,69 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import javax.ejb.MessageDrivenBean; +import javax.ejb.MessageDrivenContext; + +import javax.jms.Message; +import javax.jms.MessageListener; + + +/** + * @author Brian Sam-Bodden + * + * @ejb.bean + * name="EmailProcessor" + * acknowledge-mode="Auto-acknowledge" + * destination-type="javax.jms.Queue" + * subscription-durability="Durable" + * transaction-type="Container" + * @ejb.transaction + * type="NotSupported" + * @ejb.resource-ref + * res-ref-name="${jndi.mail.session}" + * res-type="javax.mail.Session" + * res-auth="Container" + * + * @jboss.destination-jndi-name + * name="${jboss.queue.mail}" + * @jboss.resource-ref + * res-ref-name="${jndi.mail.session}" + * jndi-name="${jboss.mail.session}" + */ +public class EmailProcessorBean implements MessageDrivenBean, MessageListener { + /* (non-Javadoc) + * @see javax.jms.MessageListener#onMessage(javax.jms.Message) + */ + public void onMessage(Message arg0) { + // TODO Auto-generated method stub + } + + //============================================= + // EJB callbacks + //============================================= + public void ejbCreate() { + } + + /* (non-Javadoc) + * @see javax.ejb.MessageDrivenBean#setMessageDrivenContext(javax.ejb.MessageDrivenContext) + */ + public void setMessageDrivenContext(MessageDrivenContext mdc) { + } + + /* (non-Javadoc) + * @see javax.ejb.MessageDrivenBean#ejbRemove() + */ + public void ejbRemove() { + } +} diff --git a/src/java/com/ejdoab/tcms/services/EmailServicesBean.java b/src/java/com/ejdoab/tcms/services/EmailServicesBean.java new file mode 100644 index 0000000..0bd5f4e --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/EmailServicesBean.java @@ -0,0 +1,94 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import org.apache.log4j.Logger; + +import javax.ejb.CreateException; +import javax.ejb.SessionBean; + + +/** + * @author Brian Sam-Bodden + * + * @ejb.bean + * name="EmailServices" + * type="Stateless" + * view-type="local" + * local-jndi-name="ejb.EmailServicesLocalHome" + * @ejb.transaction + * type="Required" + * @ejb.util + * generate="physical" + */ +public abstract class EmailServicesBean implements SessionBean { + private Logger log; + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * @param recipentEmail + * @param subject + * @param body + * @return + */ + public boolean sendEmail(String recipentEmail, String subject, String body) { + return false; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param subject + * @param body + * @return + */ + public boolean sendToAllAttendees(String subject, String body) { + return false; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param subject + * @param body + * @return + */ + public boolean sendToAllPresenters(String subject, String body) { + return false; + } + + //========================================== + // EJB callbacks + //========================================== + + /** + * @ejb.create-method + */ + public void ejbCreate() throws CreateException { + log = Logger.getLogger(EmailServicesBean.class); + } + + /** + * DOCUMENT ME! + * + * @throws CreateException DOCUMENT ME! + */ + public void ejbPostCreate() throws CreateException { + } +} diff --git a/src/java/com/ejdoab/tcms/services/IScheduleServices.java b/src/java/com/ejdoab/tcms/services/IScheduleServices.java new file mode 100644 index 0000000..29b7b6d --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/IScheduleServices.java @@ -0,0 +1,31 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.services.dto.ScheduleDTO; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; + + +/** + * TODO document me! + * @author bms29 + */ +public interface IScheduleServices { + ScheduleDTO getUserSchedule(String email) throws NoSuchUserException; + + boolean setUserSchedule(ScheduleDTO dto); + + boolean mailSchedule(String userEmail, String recepientEmail); + + boolean mailSchedule(String userEmail); +} diff --git a/src/java/com/ejdoab/tcms/services/ScheduleServicesBean.java b/src/java/com/ejdoab/tcms/services/ScheduleServicesBean.java new file mode 100644 index 0000000..ae5e573 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/ScheduleServicesBean.java @@ -0,0 +1,153 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.entities.UserLocalHome; +import com.ejdoab.tcms.services.dto.DTOAbstractFactory; +import com.ejdoab.tcms.services.dto.ScheduleDTO; +import com.ejdoab.tcms.services.dto.ScheduleDTOFactory; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.services.locator.ServiceLocator; +import com.ejdoab.tcms.services.locator.ServiceLocatorException; + +import org.apache.log4j.Logger; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.SessionBean; + + +/** + * @author Brian Sam-Bodden + * + * @ejb.bean + * name="ScheduleServices" + * type="Stateless" + * view-type="both" + * jndi-name="ejb.ScheduleServicesHome" + * local-jndi-name="ejb.ScheduleServicesLocalHome" + * @ejb.transaction + * type="Required" + * @ejb.util + * generate="physical" + */ +public abstract class ScheduleServicesBean implements SessionBean { + private Logger log; + + /** + * @ejb.interface-method + * + * @param email + * @return + * @throws NoSuchUserException + */ + public ScheduleDTO getUserSchedule(String email) throws NoSuchUserException { + Object schedule = null; + UserLocalHome ulh = null; + UserServicesLocal us = null; + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + UserServicesLocalHome usHome = (UserServicesLocalHome) sl.getLocalHome( + "ejb.UserServicesLocalHome"); + + us = usHome.create(); + } catch (ServiceLocatorException e) { + new EJBException("could not access user services", e); + } catch (CreateException e) { + new EJBException("could not access user services", e); + } + + UserLocal user = us.findUserByEmail(email); + + ScheduleDTOFactory dtoBuilder = (ScheduleDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ScheduleDTO.class); + + ScheduleDTO dto = null; + + try { + dto = (ScheduleDTO) dtoBuilder.getDTO(user); + } catch (DTOCreateException dce) { + throw new EJBException("Error retrieving schedule for user " + + email, dce); + } + + return dto; + } + + /** + * @ejb.interface-method + * + * @param dto + * @return + */ + public boolean setUserSchedule(ScheduleDTO dto) { + ScheduleDTOFactory dtoBuilder = (ScheduleDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ScheduleDTO.class); + + try { + return dtoBuilder.setDTO(dto); + } catch (DTOUpdateException due) { + throw new EJBException("Error saving schedule information", due); + } + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param userEmail + * @param recepientEmail + * @return + */ + public boolean mailSchedule(String userEmail, String recepientEmail) { + return false; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param userEmail + * @return + */ + public boolean mailSchedule(String userEmail) { + return mailSchedule(userEmail, userEmail); + } + + //========================================== + // EJB callbacks + //========================================== + + /** + * @ejb.create-method + */ + public void ejbCreate() throws CreateException { + log = Logger.getLogger(ScheduleServicesBean.class); + } + + /** + * DOCUMENT ME! + * + * @throws CreateException DOCUMENT ME! + */ + public void ejbPostCreate() throws CreateException { + } +} diff --git a/src/java/com/ejdoab/tcms/services/UserServicesBean.java b/src/java/com/ejdoab/tcms/services/UserServicesBean.java new file mode 100644 index 0000000..11e91a7 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/UserServicesBean.java @@ -0,0 +1,395 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.entities.AttendeeLocal; +import com.ejdoab.tcms.entities.AttendeeLocalHome; +import com.ejdoab.tcms.entities.AttendeeUtil; +import com.ejdoab.tcms.entities.PresenterLocal; +import com.ejdoab.tcms.entities.PresenterLocalHome; +import com.ejdoab.tcms.entities.PresenterUtil; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.entities.UserLocalHome; +import com.ejdoab.tcms.entities.UserRoleLocalHome; +import com.ejdoab.tcms.entities.UserRoleUtil; +import com.ejdoab.tcms.entities.UserUtil; +import com.ejdoab.tcms.services.dto.DTOAbstractFactory; +import com.ejdoab.tcms.services.dto.UserProfileDTO; +import com.ejdoab.tcms.services.dto.UserProfileDTOFactory; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; +import com.ejdoab.tcms.services.exceptions.DuplicateEmailException; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.services.locator.ServiceLocator; +import com.ejdoab.tcms.services.locator.ServiceLocatorException; + +import org.apache.log4j.Logger; + +import java.util.*; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.FinderException; +import javax.ejb.SessionBean; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + * + * @ejb.bean + * name="UserServices" + * type="Stateless" + * view-type="both" + * jndi-name="ejb.UserServicesHome" + * local-jndi-name="ejb.UserServicesLocalHome" + * @ejb.transaction + * type="Required" + * @ejb.util + * generate="physical" + */ +public abstract class UserServicesBean implements SessionBean { + private Logger log; + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param email + * @param password + * @return + * @throws NoSuchUserException + */ + public boolean authenticate(String email, String password) + throws NoSuchUserException { + UserLocal user = findUserByEmail(email); + + return (password == null) ? (user.getPassword() == null) + : password.equals(user.getPassword()); + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param email + * @throws NoSuchUserException + */ + public void requestPassword(String email) throws NoSuchUserException { + UserLocal user = findUserByEmail(email); + + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + EmailServicesLocalHome esHome = (EmailServicesLocalHome) sl.getLocalHome( + "ejb.EmailServicesLocalHome"); + + EmailServicesLocal es = esHome.create(); + es.sendEmail(email, "Your password", + "you password is " + user.getPassword()); + } catch (ServiceLocatorException e) { + new EJBException("could not access user services", e); + } catch (CreateException e) { + new EJBException("could not access user services", e); + } + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param up + * @return + * @throws DuplicateEmailException + * @throws CreateException + * @throws NamingException + */ + public boolean registerUser(UserProfileDTO up) + throws DuplicateEmailException, CreateException, NamingException { + boolean success = true; + + // see if this email is already in use + String email = up.getEmail(); + log.info("[register] email parameter is =" + email); + + if (email != null) { + UserLocal user = createNewUser(email); + up.setId(user.getId()); + log.info("[register] after createNewUser"); + + // new user is an attendee + log.info("[register] user type is " + up.getUserType()); + + if (up.getUserType().equals(UserProfileDTO.UserType.ATTENDEE)) { + AttendeeLocalHome home = AttendeeUtil.getLocalHome(); + AttendeeLocal attendee = home.create(user); + log.info("[register] after creating new attendee"); + + if (attendee != null) { + log.info("[register] attendee is not null"); + + UserRoleLocalHome urh = UserRoleUtil.getLocalHome(); + urh.create(0, user); + log.info("[register] user role created"); + } else { + success = false; + } + + // new user is a presenter + } else if (up.getUserType().equals(UserProfileDTO.UserType.PRESENTER)) { + PresenterLocalHome home = PresenterUtil.getLocalHome(); + PresenterLocal presenter = home.create(); + presenter.setUser(user); + + if (presenter != null) { + UserRoleLocalHome urh = UserRoleUtil.getLocalHome(); + urh.create(1, user); + } else { + success = false; + } + } + + if (success) { + try { + UserProfileDTOFactory builder = (UserProfileDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(UserProfileDTO.class); + builder.setDTO(up); + log.info("[register] after update profile"); + } catch (DTOUpdateException due) { + throw new EJBException("this should never happen", due); + } + } + } else { + throw new EJBException("this should never happen"); + } + + return success; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param email + * @return + * @throws NoSuchUserException + */ + public UserProfileDTO getUserProfile(String email) + throws NoSuchUserException { + UserProfileDTO up = null; + + try { + UserLocalHome home = UserUtil.getLocalHome(); + log.info("[getUserProfile] looking for a user with email =" + + email); + + UserLocal user = findUserByEmail(email); + + // find which role this user plays in the system + // there are two ways to accomplish this, one is to + // get all the user roles all loop through them, since + // for this implementation we are making the assumption that + // a user plays one role only we can use the getPresenter + // and the getAttendee and go with whichever is not null + if (user != null) { + log.info("[getUserProfile] found the user!"); + + Object source = user.getAttendee(); + + if (source == null) { + source = user.getPresenter(); + } + + if (source != null) { + UserProfileDTOFactory builder = (UserProfileDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(UserProfileDTO.class); + + try { + up = (UserProfileDTO) builder.getDTO(source); + } catch (DTOCreateException dce) { + dce.printStackTrace(); + } + } else { + new EJBException("no role found"); + } + } else { + throw new NoSuchUserException( + "[getUserProfile] No user with email= " + email); + } + } catch (NamingException ne) { + new EJBException("Error accessing user information", ne); + } + + return up; + } + + /** + * @ejb.interface-method + * @ejb.transaction + * type="NotSupported" + * + * @param userProfile + * @return + * @throws NoSuchUserException + */ + public boolean setUserProfile(UserProfileDTO userProfile) + throws NoSuchUserException { + boolean result; + UserProfileDTOFactory builder = (UserProfileDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(UserProfileDTO.class); + + try { + result = builder.setDTO(userProfile); + } catch (DTOUpdateException due) { + // get the root exception and throw it + throw new NoSuchUserException(""); + } + + return result; + } + + /** + * @ejb.interface-method + * view-type="local" + * @ejb.transaction + * type="NotSupported" + * + * @param email + * @return + * @throws NoSuchUserException + */ + public UserLocal findUserByEmail(String email) throws NoSuchUserException { + try { + UserLocalHome home = UserUtil.getLocalHome(); + Collection c = home.findByEmail(email); + + if (!c.isEmpty()) { + UserLocal user = (UserLocal) c.iterator().next(); + + return user; + } else { + throw new NoSuchUserException( + "[findUserByEmail] No user with email= " + email); + } + } catch (NamingException ne) { + throw new EJBException("[findUserByEmail] Error retrieving user information", + ne); + } catch (FinderException fe) { + throw new NoSuchUserException( + "[findUserByEmail] No user with email= " + email); + } + } + + /** + * @ejb.interface-method + * view-type="local" + * @ejb.transaction + * type="NotSupported" + * + * @param email + * @return + * @throws NoSuchUserException + */ + public PresenterLocal findPresenterByEmail(String email) + throws NoSuchUserException { + PresenterLocal presenter = null; + UserLocal user = findUserByEmail(email); + + if (user != null) { + presenter = user.getPresenter(); + } + + if (presenter != null) { + return presenter; + } else { + throw new NoSuchUserException( + "[findPresenterByEmail] No presenter with email = " + email); + } + } + + /** + * @ejb.interface-method + * view-type="local" + * @ejb.transaction + * type="NotSupported" + * + * @param email + * @return + * @throws NoSuchUserException + */ + public AttendeeLocal findAttendeeByEmail(String email) + throws NoSuchUserException { + AttendeeLocal attendee = null; + UserLocal user = findUserByEmail(email); + + if (user != null) { + attendee = user.getAttendee(); + } + + if (attendee != null) { + return attendee; + } else { + throw new NoSuchUserException( + "[findAttendeeByEmail] No attendee with email = " + email); + } + } + + // -- private methods -- + private UserLocal createNewUser(String email) + throws DuplicateEmailException, CreateException, NamingException { + UserLocal user = null; + + try { + user = findUserByEmail(email); + } catch (NoSuchUserException e) { + // do nothing + } + + if (user == null) { + UserLocalHome home = UserUtil.getLocalHome(); + user = home.create(); + user.setEmail(email); + } else { + throw new DuplicateEmailException("User with email =" + email + + " already exists"); + } + + return user; + } + + //========================================== + // EJB callbacks + //========================================== + + /** + * @ejb.create-method + */ + public void ejbCreate() throws CreateException { + log = Logger.getLogger(UserServicesBean.class); + } + + /** + * DOCUMENT ME! + * + * @throws CreateException DOCUMENT ME! + */ + public void ejbPostCreate() throws CreateException { + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/CVS/Entries b/src/java/com/ejdoab/tcms/services/dto/CVS/Entries new file mode 100644 index 0000000..6fe1178 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/CVS/Entries @@ -0,0 +1,22 @@ +/ConferenceAbstractDTO.java/1.10/Sun Dec 21 21:26:41 2003/-kb/ +/ConferenceAbstractDTOFactory.java/1.8/Sun Dec 21 21:26:41 2003/-kb/ +/DTO.java/1.5/Sun Dec 21 21:26:41 2003/-kb/ +/DTOAbstractFactory.java/1.5/Sun Dec 21 21:26:41 2003/-kb/ +/DTOFactory.java/1.5/Sun Dec 21 21:26:41 2003/-kb/ +/DTOValidationResults.java/1.5/Sun Dec 21 21:26:41 2003/-kb/ +/MapDTO.java/1.4/Sun Dec 21 21:26:41 2003/-kb/ +/NewsItemDTO.java/1.2/Sun Dec 21 21:26:41 2003// +/NewsItemDTOFactory.java/1.3/Sun Dec 21 21:26:41 2003// +/ScheduleDTO.java/1.8/Sun Dec 21 21:26:42 2003/-kb/ +/ScheduleDTOFactory.java/1.7/Sun Dec 21 21:26:42 2003/-kb/ +/ScheduleEntryDTO.java/1.4/Sun Dec 21 21:26:42 2003/-kb/ +/ScheduleEntryDTOFactory.java/1.5/Sun Dec 21 21:26:42 2003/-kb/ +/ScheduleReminderDTO.java/1.4/Sun Dec 21 21:26:42 2003/-kb/ +/ScheduleReminderDTOFactory.java/1.6/Sun Dec 21 21:26:42 2003/-kb/ +/SessionDTO.java/1.10/Tue Dec 23 21:15:54 2003/-kb/ +/SessionDTOFactory.java/1.6/Tue Dec 23 21:14:42 2003/-kb/ +/StringCache.java/1.8/Sun Dec 21 21:26:42 2003/-kb/ +/UserProfileDTO.java/1.8/Sun Dec 21 21:26:42 2003/-kb/ +/UserProfileDTOFactory.java/1.6/Sun Dec 21 21:26:42 2003/-kb/ +D/exceptions//// +D/page//// diff --git a/src/java/com/ejdoab/tcms/services/dto/CVS/Repository b/src/java/com/ejdoab/tcms/services/dto/CVS/Repository new file mode 100644 index 0000000..cca9615 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/services/dto diff --git a/src/java/com/ejdoab/tcms/services/dto/CVS/Root b/src/java/com/ejdoab/tcms/services/dto/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/services/dto/ConferenceAbstractDTO.java b/src/java/com/ejdoab/tcms/services/dto/ConferenceAbstractDTO.java new file mode 100644 index 0000000..3f49543 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ConferenceAbstractDTO.java @@ -0,0 +1,299 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + + +/** + * @author Brian Sam-Bodden + */ +public class ConferenceAbstractDTO implements DTO { + private int abstractId = -1; + private String title = ""; + private String type = ""; + private String topic = ""; + private String level = ""; + private String body = ""; + private String status = ""; + private boolean hasPresentations = false; + private String presenter = ""; + private String presenterEmail = ""; + + ConferenceAbstractDTO(String title, String type, String topic, + String level, String body, String status, boolean hasPresentations, + String presenter, String presenterEmail) { + //this.abstractId = abstractId; + this.title = title; + this.type = type; + this.topic = topic; + this.level = level; + this.body = body; + this.status = status; + this.hasPresentations = hasPresentations; + this.presenter = presenter; + this.presenterEmail = presenterEmail; + } + + /** + * Creates a new ConferenceAbstractDTO object. + * + * @param title DOCUMENT ME! + * @param type DOCUMENT ME! + * @param topic DOCUMENT ME! + * @param level DOCUMENT ME! + * @param body DOCUMENT ME! + * @param presenterEmail DOCUMENT ME! + */ + public ConferenceAbstractDTO(String title, String type, String topic, + String level, String body, String presenterEmail) { + //this.abstractId = abstractId; + this.title = title; + this.type = type; + this.topic = topic; + this.level = level; + this.body = body; + this.presenterEmail = presenterEmail; + hasPresentations = false; + status = ""; + } + + /** + * Returns the body. + * @return java.lang.String + */ + public String getBody() { + return body; + } + + /** + * Returns the presenter. + * @return String + */ + public String getPresenter() { + return presenter; + } + + /** + * Returns the status. + * @return int + */ + public String getStatus() { + return status; + } + + /** + * Returns the title. + * @return java.lang.String + */ + public String getTitle() { + return title; + } + + /** + * Sets the body. + * @param body The body to set + */ + public void setBody(String body) { + this.body = body; + } + + /** + * Sets the title. + * @param title The title to set + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Returns whether there is a presentation associated with + * this Abstract + * @return true if there is a presentation associated + * false otherwise + */ + public boolean hasPresentations() { + return hasPresentations; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("abstractId=").append(abstractId).append('\n').append("title=") + .append(title).append('\n').append("type=").append(type).append('\n') + .append("topic=").append(topic).append('\n').append("level=") + .append(level).append('\n').append("body=").append(body).append('\n') + .append("presenter=").append(presenter).append('\n'); + + return sb.toString(); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public DTOValidationResults validate() { + return new DTOValidationResults(); + } + + /** + * Returns the abstractId. + * @return int + */ + public int getAbstractId() { + return abstractId; + } + + /** + * Returns the level. + * @return String + */ + public String getLevel() { + return level; + } + + /** + * Returns the topic. + * @return String + */ + public String getTopic() { + return topic; + } + + /** + * Returns the type. + * @return String + */ + public String getType() { + return type; + } + + /** + * Sets the level. + * @param level The level to set + */ + public void setLevel(String level) { + this.level = level; + } + + /** + * Sets the presenterEmail. + * @param presenterEmail The presenterEmail to set + */ + public void setPresenterEmail(String presenterEmail) { + this.presenterEmail = presenterEmail; + } + + /** + * Returns the presenterEmail. + * @return String + */ + public String getPresenterEmail() { + return presenterEmail; + } + + /** + * Idempotent and package access only + * @param i + */ + void setAbstractId(int id) { + if (abstractId == -1) { + abstractId = id; + } + } + + /** + * DOCUMENT ME! + * + * @param obj DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean equals(Object obj) { + if (obj instanceof ConferenceAbstractDTO) { + ConferenceAbstractDTO dto = (ConferenceAbstractDTO) obj; + boolean equals = true; + + if (this.title == null) { + equals = equals && (dto.title == null); + } else { + equals = equals && this.title.equals(dto.title); + } + + if (this.type == null) { + equals = equals && (dto.type == null); + } else { + equals = equals && this.body.equalsIgnoreCase(dto.type); + } + + if (this.topic == null) { + equals = equals && (dto.topic == null); + } else { + equals = equals && this.body.equalsIgnoreCase(dto.topic); + } + + if (this.level == null) { + equals = equals && (dto.level == null); + } else { + equals = equals && this.body.equalsIgnoreCase(dto.level); + } + + if (this.body == null) { + equals = equals && (dto.body == null); + } else { + equals = equals && this.body.equals(dto.body); + } + + if (this.status == null) { + equals = equals && (dto.status == null); + } else { + equals = equals && this.body.equalsIgnoreCase(dto.status); + } + + if (this.presenterEmail == null) { + equals = equals && (dto.presenterEmail == null); + } else { + equals = equals && + this.body.equalsIgnoreCase(dto.presenterEmail); + } + + return equals; + } else { + return false; + } + } + + /** + * @param string + */ + public void setStatus(String string) { + status = string; + } + + /** + * @param string + */ + public void setTopic(String string) { + topic = string; + } + + /** + * @param string + */ + public void setType(String string) { + type = string; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ConferenceAbstractDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/ConferenceAbstractDTOFactory.java new file mode 100644 index 0000000..d8548d6 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ConferenceAbstractDTOFactory.java @@ -0,0 +1,279 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ConferenceAbstractLocal; +import com.ejdoab.tcms.entities.ConferenceAbstractLocalHome; +import com.ejdoab.tcms.entities.ConferenceAbstractUtil; +import com.ejdoab.tcms.entities.PresenterLocal; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.services.UserServicesLocal; +import com.ejdoab.tcms.services.UserServicesLocalHome; +import com.ejdoab.tcms.services.dto.exceptions.*; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.services.locator.ServiceLocator; +import com.ejdoab.tcms.services.locator.ServiceLocatorException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.CreateException; +import javax.ejb.FinderException; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + */ +public class ConferenceAbstractDTOFactory implements DTOFactory { + private static Log log = LogFactory.getLog(ConferenceAbstractDTOFactory.class); + + private ConferenceAbstractDTO buildConferenceAbstractDTO( + ConferenceAbstractLocal cAbstract) { + UserLocal user = cAbstract.getPresenter().getUser(); + + String title = cAbstract.getTitle(); + + int abstractId = cAbstract.getId().intValue(); + + String type = StringCache.getType(cAbstract.getType()); + String topic = StringCache.getTopic(cAbstract.getTopic()); + String level = StringCache.getLevel(cAbstract.getLevel()); + String status = StringCache.getAbstractStatus(cAbstract.getStatus()); + String body = cAbstract.getBody(); + String presenter = user.getFirstName() + " " + user.getLastName(); + String presenterEmail = user.getEmail(); + + boolean hasPresentations = cAbstract.getPresentation() != null; + + ConferenceAbstractDTO dto = new ConferenceAbstractDTO(title, type, + topic, level, body, status, hasPresentations, presenter, + presenterEmail); + dto.setAbstractId(abstractId); + + return dto; + } + + /** + * @see com.ejdoab.tcms.services.dto.DTOFactory#getDTO(Object) + */ + public DTO getDTO(Object obj) throws DTOCreateException { + if (obj instanceof ConferenceAbstractLocal) { + try { + ConferenceAbstractLocal cAbstract = (ConferenceAbstractLocal) obj; + + return buildConferenceAbstractDTO(cAbstract); + } catch (Exception e) { + throw new DTOCreateException(e); + } + } else { + throw new DTOCreateException( + "invalid source object for DTO construction"); + } + } + + /** + * DOCUMENT ME! + * + * @param dto DOCUMENT ME! + * + * @return DOCUMENT ME! + * + * @throws DTOUpdateException DOCUMENT ME! + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof ConferenceAbstractDTO) { + log.trace("setDTO"); + + ConferenceAbstractDTO cAbstract = (ConferenceAbstractDTO) dto; + + return updateAbstract(cAbstract); + } else { + throw new DTOUpdateException( + "Attempting to update with an invalid DTO class"); + } + } + + /** + * Method updateAbstract. + * @param cAbstract + * @return boolean + */ + private boolean updateAbstract(ConferenceAbstractDTO dto) + throws DTOUpdateException { + log.trace("updateAbstract"); + + boolean retValue = false; + boolean isNewSubmission = false; + Integer id = new Integer(dto.getAbstractId()); + PresenterLocal presenter = null; + + log.debug("[updateAbstract] Abstract id is" + id); + + ConferenceAbstractLocalHome calh = null; + + try { + calh = ConferenceAbstractUtil.getLocalHome(); + } catch (NamingException ne) { + throw new DTOUpdateException("Exception getting ConferenceAbstractLocalHome", + ne); + } + + // get the service locator and find the UserServices + UserServicesLocal us = null; + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + UserServicesLocalHome usHome = (UserServicesLocalHome) sl.getLocalHome( + "ejb.UserServicesLocalHome"); + + us = usHome.create(); + } catch (ServiceLocatorException sle) { + throw new DTOUpdateException("ServiceLocator problem", sle); + } catch (CreateException ce) { + throw new DTOUpdateException("Create problem with UserServices", ce); + } + + if (calh != null) { + ConferenceAbstractLocal cal = null; + + if (id.intValue() == -1) { + try { + // possible new abstract submission + try { + presenter = us.findPresenterByEmail(dto.getPresenterEmail()); + log.info( + "[updateAbstract] Presenter found for the abstract"); + + Collection c = presenter.getConferenceAbstracts(); + Iterator i = c.iterator(); + ConferenceAbstractLocal match = null; + + for (int index = 0, n = c.size(); index < n; index++) { + ConferenceAbstractLocal anAbstract = (ConferenceAbstractLocal) i.next(); + + if (match(dto, anAbstract)) { + match = anAbstract; + + break; + } + } + + if (match != null) { + throw new DTOUpdateException( + "An abstract matching the submitted abstract already exists"); + } + } catch (NoSuchUserException nsue) { + throw new DTOUpdateException( + "There is no Presenter with email =" + + dto.getPresenterEmail(), nsue); + } + + log.info("[updateAbstract] Submission is a new abstract"); + cal = calh.create(); + isNewSubmission = true; + } catch (CreateException ce) { + throw new DTOUpdateException("could not create a new abstract", + ce); + } + } else { + try { + // update of an existing abstract + log.info( + "[updateAbstract] Submission is an existing abstract"); + cal = calh.findByPrimaryKey(id); + } catch (FinderException fe) { + throw new DTOUpdateException( + "could not find an abstract with id =" + id, fe); + } + } + + if (cal != null) { + log.info("[updateAbstract] Abstract succesfully created!"); + + cal.setBody(dto.getBody()); + cal.setTitle(dto.getTitle()); + cal.setLevel(StringCache.getLevelIndex(dto.getLevel())); + log.info("level = " + dto.getLevel()); + cal.setTopic(StringCache.getTopicIndex(dto.getTopic())); + log.info("topic = " + dto.getTopic()); + cal.setType(StringCache.getTypeIndex(dto.getType())); + log.info("type = " + dto.getType()); + cal.setStatus(StringCache.getAbstractStatusIndex( + dto.getStatus())); + log.info("status = " + dto.getStatus()); + + if (isNewSubmission) { + if (presenter != null) { + cal.setPresenter(presenter); + retValue = true; + log.info( + "[updateAbstract] Presenter set for the abstract"); + } + } else { + retValue = true; + } + } + } + + return retValue; + } + + private boolean match(ConferenceAbstractDTO dto, ConferenceAbstractLocal cal) { + boolean match = true; + + String type = StringCache.getType(cal.getType()); + String topic = StringCache.getTopic(cal.getTopic()); + String level = StringCache.getLevel(cal.getLevel()); + String body = cal.getBody(); + String title = cal.getTitle(); + + // no duplicate titles accepted unless they are in different levels + if (dto.getTitle() == null) { + match = match && (title == null); + } else { + match = match && dto.getTitle().equalsIgnoreCase(title); + + if (dto.getLevel() == null) { + match = match && (level == null); + } else { + match = match && dto.getLevel().equalsIgnoreCase(level); + } + } + + if (!match) { + // no duplicate body text accepted + if (dto.getBody() == null) { + match = match && (body == null); + } else { + match = match && dto.getBody().equalsIgnoreCase(body); + } + } + + return match; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/DTO.java b/src/java/com/ejdoab/tcms/services/dto/DTO.java new file mode 100644 index 0000000..493c049 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/DTO.java @@ -0,0 +1,23 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import java.io.Serializable; + + +/** + * @author Brian Sam-Bodden + */ +public interface DTO extends Serializable { + DTOValidationResults validate(); +} diff --git a/src/java/com/ejdoab/tcms/services/dto/DTOAbstractFactory.java b/src/java/com/ejdoab/tcms/services/dto/DTOAbstractFactory.java new file mode 100644 index 0000000..c31e75e --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/DTOAbstractFactory.java @@ -0,0 +1,60 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import java.util.HashMap; +import java.util.Map; + + +/** + * @author Brian Sam-Bodden + */ +public class DTOAbstractFactory { + private static DTOAbstractFactory instance = new DTOAbstractFactory(); + + static { + instance.dtoBuilders.put(UserProfileDTO.class, + new UserProfileDTOFactory()); + instance.dtoBuilders.put(SessionDTO.class, new SessionDTOFactory()); + instance.dtoBuilders.put(ConferenceAbstractDTO.class, + new ConferenceAbstractDTOFactory()); + instance.dtoBuilders.put(ScheduleDTO.class, new ScheduleDTOFactory()); + instance.dtoBuilders.put(ScheduleEntryDTO.class, + new ScheduleEntryDTOFactory()); + instance.dtoBuilders.put(ScheduleReminderDTO.class, + new ScheduleReminderDTOFactory()); + instance.dtoBuilders.put(NewsItemDTO.class, new NewsItemDTOFactory()); + } + + private Map dtoBuilders = new HashMap(); + + /** + * DOCUMENT ME! + * + * @param clazz DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public DTOFactory getDTOBuilder(Class clazz) { + return (DTOFactory) dtoBuilders.get(clazz); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static DTOAbstractFactory getInstance() { + return instance; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/DTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/DTOFactory.java new file mode 100644 index 0000000..e87dd0e --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/DTOFactory.java @@ -0,0 +1,27 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.services.dto.exceptions.*; + + +/** + * @author Brian Sam-Bodden + */ +public interface DTOFactory { + DTO getDTO(Object obj) throws DTOCreateException; + + boolean setDTO(DTO dto) throws DTOUpdateException; + + boolean removeDTO(DTO dto) throws DTOUpdateException; +} diff --git a/src/java/com/ejdoab/tcms/services/dto/DTOValidationResults.java b/src/java/com/ejdoab/tcms/services/dto/DTOValidationResults.java new file mode 100644 index 0000000..ff49bea --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/DTOValidationResults.java @@ -0,0 +1,102 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + + +/** + * @author Brian Sam-Bodden + */ +public class DTOValidationResults { + /** DOCUMENT ME! */ + public final static DTOValidationResults EMPTY_RESULTS = new DTOValidationResults() { + public void addValidationError(String error) { + // no-op + } + + public void addValidationWarning(String warning) { + // no-op + } + }; + + protected List validationErrors = Collections.EMPTY_LIST; + protected List validationWarnings = Collections.EMPTY_LIST; + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean isValid() { + return validationErrors.isEmpty(); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Iterator getValidationErrors() { + return validationErrors.iterator(); + } + + /** + * DOCUMENT ME! + * + * @param error DOCUMENT ME! + */ + public void addValidationError(String error) { + if ((validationErrors == null) || + (validationErrors == Collections.EMPTY_LIST)) { + validationErrors = new ArrayList(); + } + + validationErrors.add(error); + } + + /** + * DOCUMENT ME! + * + * @param warning DOCUMENT ME! + */ + public void addValidationWarning(String warning) { + if ((validationWarnings == null) || + (validationWarnings == Collections.EMPTY_LIST)) { + validationWarnings = new ArrayList(); + } + + validationWarnings.add(warning); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getErrorCount() { + return validationErrors.size(); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getWarningCount() { + return validationWarnings.size(); + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/MapDTO.java b/src/java/com/ejdoab/tcms/services/dto/MapDTO.java new file mode 100644 index 0000000..6d48652 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/MapDTO.java @@ -0,0 +1,25 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + + +/** + * @author Brian Sam-Bodden + */ +public interface MapDTO extends DTO { + String[] getNames(); + + void add(String name, String value); + + String getValue(String name); +} diff --git a/src/java/com/ejdoab/tcms/services/dto/NewsItemDTO.java b/src/java/com/ejdoab/tcms/services/dto/NewsItemDTO.java new file mode 100644 index 0000000..0321b75 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/NewsItemDTO.java @@ -0,0 +1,154 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +/* + * Created on Aug 20, 2003 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package com.ejdoab.tcms.services.dto; + +import java.util.Date; + + +/** + * @author Brian Sam-Bodden + */ +public class NewsItemDTO implements DTO { + private int newsItemId = -1; + private Date date; + private Date removedate; + private Date creationdate; + private boolean published; + private String body; + private String title; + + /** + * Creates a new NewsItemDTO object. + * + * @param newsItemId DOCUMENT ME! + * @param date DOCUMENT ME! + * @param removedate DOCUMENT ME! + * @param creationdate DOCUMENT ME! + * @param published DOCUMENT ME! + * @param body DOCUMENT ME! + */ + public NewsItemDTO(int newsItemId, Date date, Date removedate, + Date creationdate, boolean published, String title, String body) { + this.newsItemId = newsItemId; + this.date = date; + this.removedate = removedate; + this.creationdate = creationdate; + this.published = published; + this.title = title; + this.body = body; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTO#validate() + */ + public DTOValidationResults validate() { + return new DTOValidationResults(); + } + + /** + * @return + */ + public String getBody() { + return body; + } + + /** + * @return + */ + public Date getCreationdate() { + return creationdate; + } + + /** + * @return + */ + public Date getDate() { + return date; + } + + /** + * @return + */ + public int getNewsItemId() { + return newsItemId; + } + + /** + * @return + */ + public boolean isPublished() { + return published; + } + + /** + * @return + */ + public Date getRemovedate() { + return removedate; + } + + /** + * @return + */ + public String getTitle() { + return title; + } + + /** + * @param string + */ + public void setBody(String string) { + body = string; + } + + /** + * @param date + */ + public void setCreationDate(Date date) { + creationdate = date; + } + + /** + * @param date + */ + public void setDate(Date date) { + this.date = date; + } + + /** + * @param b + */ + public void setPublished(boolean b) { + published = b; + } + + /** + * @param date + */ + public void setRemoveDate(Date date) { + removedate = date; + } + + /** + * @param string + */ + public void setTitle(String string) { + title = string; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/NewsItemDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/NewsItemDTOFactory.java new file mode 100644 index 0000000..451b75b --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/NewsItemDTOFactory.java @@ -0,0 +1,183 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ConferenceNewsLocal; +import com.ejdoab.tcms.entities.ConferenceNewsLocalHome; +import com.ejdoab.tcms.entities.ConferenceNewsUtil; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Date; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.FinderException; +import javax.ejb.RemoveException; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + */ +public class NewsItemDTOFactory implements DTOFactory { + private static Log log = LogFactory.getLog(NewsItemDTOFactory.class); + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#getDTO(java.lang.Object) + */ + public DTO getDTO(Object obj) throws DTOCreateException { + if (obj instanceof ConferenceNewsLocal) { + try { + ConferenceNewsLocal newsItem = (ConferenceNewsLocal) obj; + + return buildScheduleDTO(newsItem); + } catch (Exception e) { + e.printStackTrace(); + throw new DTOCreateException(e); + } + } else { + throw new DTOCreateException( + "invalid source object for DTO creation"); + } + } + + /** + * @param newsItem + * @return + */ + private DTO buildScheduleDTO(ConferenceNewsLocal newsItem) { + int newsItemId = newsItem.getId().intValue(); + Date date = newsItem.getDate(); + Date removedate = newsItem.getRemoveDate(); + Date creationdate = newsItem.getCreationDate(); + boolean published = newsItem.getPublished(); + String body = newsItem.getBody(); + String title = newsItem.getTitle(); + + NewsItemDTO dto = new NewsItemDTO(newsItemId, date, removedate, + creationdate, published, title, body); + + return dto; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#setDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof NewsItemDTO) { + NewsItemDTO newsItem = (NewsItemDTO) dto; + + return saveNewsItem(newsItem); + } else { + throw new DTOUpdateException( + "Attempting to update with an invalid DTO class"); + } + } + + /** + * @param newsItem + * @return + */ + private boolean saveNewsItem(NewsItemDTO dto) throws DTOUpdateException { + ConferenceNewsLocal news = null; + ConferenceNewsLocalHome cnlh = null; + + try { + cnlh = ConferenceNewsUtil.getLocalHome(); + } catch (NamingException ne) { + throw new DTOUpdateException("Exception getting ConferenceNewsLocalHome", + ne); + } + + Integer id = new Integer(dto.getNewsItemId()); + + Date date = dto.getDate(); + Date removeDate = dto.getRemovedate(); + Date creationDate = dto.getCreationdate(); + boolean published = dto.isPublished(); + String body = dto.getBody(); + String title = dto.getTitle(); + + if (id.intValue() == -1) { + try { + news = cnlh.create(date, removeDate, creationDate, published, + title, body); + } catch (CreateException ce) { + throw new DTOUpdateException("Could not create news item", ce); + } + } else { + try { + news = cnlh.findByPrimaryKey(id); + news.setDate(date); + news.setRemoveDate(removeDate); + news.setCreationDate(creationDate); + news.setTitle(title); + news.setBody(body); + news.setPublished(published); + } catch (FinderException fe) { + throw new DTOUpdateException("There is no news item with id=" + + id, fe); + } + } + + return news != null; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof NewsItemDTO) { + NewsItemDTO newsItem = (NewsItemDTO) dto; + removeNewsItem(newsItem); + + return true; + } else { + throw new DTOUpdateException( + "Attempting to delete with an invalid DTO class"); + } + } + + /** + * @param dto + * @throws DTOUpdateException + */ + public void removeNewsItem(NewsItemDTO dto) throws DTOUpdateException { + ConferenceNewsLocal news = null; + ConferenceNewsLocalHome cnlh = null; + + try { + cnlh = ConferenceNewsUtil.getLocalHome(); + } catch (NamingException ne) { + throw new DTOUpdateException("Exception getting ConferenceNewsLocalHome", + ne); + } + + Integer id = new Integer(dto.getNewsItemId()); + + if (id.intValue() != -1) { + try { + cnlh.remove(id); + } catch (EJBException ejbe) { + throw new DTOUpdateException("Exception removing dto", ejbe); + } catch (RemoveException re) { + throw new DTOUpdateException("Exception removing dto", re); + } + } + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ScheduleDTO.java b/src/java/com/ejdoab/tcms/services/dto/ScheduleDTO.java new file mode 100644 index 0000000..6fed0ef --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ScheduleDTO.java @@ -0,0 +1,188 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.services.dto.exceptions.ScheduleConflictException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Date; +import java.util.Iterator; +import java.util.SortedSet; +import java.util.TreeSet; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleDTO implements DTO { + private static Log log = LogFactory.getLog(ScheduleDTO.class); + private SortedSet entries = new TreeSet(); + private String userEmail; + + /** + * @param userEmail + */ + public ScheduleDTO(String userEmail) { + this.userEmail = userEmail; + } + + /** + * @param item + * @return + * @throws ScheduleConflictException + */ + public void addScheduleEntry(ScheduleEntryDTO item) + throws ScheduleConflictException { + log.debug("[addScheduleEntry] Item user email =" + item.getUserEmail() + + " userEmail =" + userEmail); + + if (!item.getUserEmail().equals(userEmail)) { + throw new ScheduleConflictException( + "trying to insert an item into a schedule for a different user"); + } + + boolean added = entries.add(item); + + if (!added) { + throw new ScheduleConflictException( + "could not add entry to the schedule, duplicate entry"); + } + } + + /** + * @return + */ + public Iterator getEntries() { + return entries.iterator(); + } + + /** + * @param rangeLow + * @param rangeHi + * @return + */ + public Iterator getScheduleEntries(Date rangeLow, Date rangeHi) { + return entries.subSet(rangeLow, rangeHi).iterator(); + } + + /** + * @param dateTime + * @return + */ + public ScheduleEntryDTO getScheduleEntry(Date dateTime) { + SortedSet ss = entries.subSet(dateTime, dateTime); + ScheduleEntryDTO dto = (ScheduleEntryDTO) ss.first(); + + return dto; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTO#validate() + */ + public DTOValidationResults validate() { + // guaranteed to be valid + return DTOValidationResults.EMPTY_RESULTS; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() { + Iterator i = entries.iterator(); + StringBuffer sb = new StringBuffer(); + sb.append("schedule for user ").append(userEmail).append('\n'); + + for (int index = 0; index < entries.size(); index++) { + sb.append(i.next()).append('\n').append(index) + .append(" ************").append('\n'); + } + + return sb.toString(); + } + + /** + * @return + */ + public String getUserEmail() { + return userEmail; + } + + /** + * @return + */ + public int getEntryCount() { + return entries.size(); + } + + /** + * @param seId + * @return + */ + public boolean hasEntry(int seId) { + boolean retVal = false; + Iterator i = entries.iterator(); + + for (int index = 0; index < entries.size(); index++) { + ScheduleEntryDTO si = (ScheduleEntryDTO) i.next(); + + if (si.getId() == seId) { + retVal = true; + + break; + } + } + + return retVal; + } + + /** + * @param seId + * @return + */ + public boolean removeScheduleEntry(int seId) { + ScheduleEntryDTO se = getScheduleEntry(seId); + + return removeScheduleEntry(se); + } + + /** + * @param se + * @return + */ + public boolean removeScheduleEntry(ScheduleEntryDTO se) { + return entries.remove(se); + } + + /** + * @param seId + * @return + */ + public ScheduleEntryDTO getScheduleEntry(int seId) { + ScheduleEntryDTO retVal = null; + Iterator i = entries.iterator(); + + for (int index = 0; index < entries.size(); index++) { + ScheduleEntryDTO si = (ScheduleEntryDTO) i.next(); + + if (si.getId() == seId) { + retVal = si; + + break; + } + } + + return retVal; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ScheduleDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/ScheduleDTOFactory.java new file mode 100644 index 0000000..f78fc7a --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ScheduleDTOFactory.java @@ -0,0 +1,189 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ScheduleEntryLocal; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.entities.UserLocalHome; +import com.ejdoab.tcms.services.UserServicesLocal; +import com.ejdoab.tcms.services.UserServicesLocalHome; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; +import com.ejdoab.tcms.services.dto.exceptions.ScheduleConflictException; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.services.locator.ServiceLocator; +import com.ejdoab.tcms.services.locator.ServiceLocatorException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.RemoveException; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleDTOFactory implements DTOFactory { + private static Log log = LogFactory.getLog(ScheduleDTOFactory.class); + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#getDTO(java.lang.Object) + */ + public DTO getDTO(Object obj) throws DTOCreateException { + if (obj instanceof UserLocal) { + try { + UserLocal user = (UserLocal) obj; + + return buildScheduleDTO(user); + } catch (Exception e) { + e.printStackTrace(); + throw new DTOCreateException(e); + } + } else { + throw new DTOCreateException( + "invalid source object for DTO creation"); + } + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#saveDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof ScheduleDTO) { + ScheduleDTO schedule = (ScheduleDTO) dto; + + return updateSchedule(schedule); + } else { + throw new DTOUpdateException( + "Attempting to update with an invalid DTO class"); + } + } + + /** + * @param user + * @return + */ + private ScheduleDTO buildScheduleDTO(UserLocal user) { + String email = user.getEmail(); + ScheduleDTO dto = new ScheduleDTO(email); + Collection scheduleItems = user.getScheduleEntries(); + + ScheduleEntryDTOFactory dtoBuilder = (ScheduleEntryDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ScheduleEntryDTO.class); + + Iterator i = scheduleItems.iterator(); + + for (int index = 0; index < scheduleItems.size(); index++) { + ScheduleEntryLocal sel = (ScheduleEntryLocal) i.next(); + + try { + ScheduleEntryDTO item = (ScheduleEntryDTO) dtoBuilder.getDTO(sel); + dto.addScheduleEntry(item); + } catch (DTOCreateException dce) { + throw new EJBException( + "Error retrieving schedule items for user " + email, dce); + } catch (ScheduleConflictException sce) { + throw new EJBException("Schedule information for user " + + email + "is corrupted", sce); + } + } + + return dto; + } + + /** + * @param schedule + * @return + */ + private boolean updateSchedule(ScheduleDTO dto) throws DTOUpdateException { + boolean retValue = true; + UserLocal user = null; + UserLocalHome ulh = null; + UserServicesLocal us = null; + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + UserServicesLocalHome usHome = (UserServicesLocalHome) sl.getLocalHome( + "ejb.UserServicesLocalHome"); + + us = usHome.create(); + } catch (ServiceLocatorException e) { + new EJBException("could not access user services", e); + } catch (CreateException e) { + new EJBException("could not access user services", e); + } + + // find the user + String email = dto.getUserEmail(); + + try { + user = us.findUserByEmail(email); + } catch (NoSuchUserException nsue) { + throw new DTOUpdateException("There is no user with email " + + email, nsue); + } + + ScheduleEntryDTOFactory dtoBuilder = (ScheduleEntryDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ScheduleEntryDTO.class); + + if (user != null) { + // we need to do a comparison of the items in the schedule and those + // in the database and remove any items that are in the database but + // not in the schedule + Collection c = user.getScheduleEntries(); + Iterator items = c.iterator(); + + for (int index = 0; index < c.size(); index++) { + ScheduleEntryLocal se = (ScheduleEntryLocal) items.next(); + int seId = se.getId().intValue(); + + if (!dto.hasEntry(seId)) { + try { + log.debug( + "[updateSchedule] Removing deleted entry with id =" + + seId + " from the database"); + se.remove(); + } catch (RemoveException re) { + throw new DTOUpdateException( + "Could not remove schedule item with id" + seId, re); + } + } + } + + // loop through the schedule items + Iterator dtos = dto.getEntries(); + + for (int index = 0; index < dto.getEntryCount(); index++) { + DTO item = (DTO) dtos.next(); + retValue = retValue && dtoBuilder.setDTO(item); + } + } + + return retValue; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ScheduleEntryDTO.java b/src/java/com/ejdoab/tcms/services/dto/ScheduleEntryDTO.java new file mode 100644 index 0000000..26eb71f --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ScheduleEntryDTO.java @@ -0,0 +1,330 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.util.Dates; +import com.ejdoab.tcms.util.Validation; + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleEntryDTO implements DTO, Comparable { + private int id = -1; // schedule Item id + private int userId = -1; + private int sessionId = -1; + private String name; + private String description; + private Date dtBegin = new Date(Long.MAX_VALUE); + private Date dtEnd = new Date(Long.MAX_VALUE); + private String userEmail; + private List reminders = new ArrayList(); + + /** + * @param id + * @param userId + * @param sessionId + * @param name + * @param description + * @param dtBegin + * @param dtEnd + * @param userEmail + * @param reminders + */ + ScheduleEntryDTO(int id, int userId, int sessionId, String name, + String description, Date dtBegin, Date dtEnd, String userEmail, + boolean reminders) { + this.id = id; + this.userId = userId; + this.sessionId = sessionId; + this.name = name; + this.description = description; + this.dtBegin = dtBegin; + this.dtEnd = dtEnd; + this.userEmail = userEmail; + } + + /** + * @param sessionId + * @param name + * @param description + * @param userEmail + */ + public ScheduleEntryDTO(int sessionId, String name, String description, + String userEmail) { + this.sessionId = sessionId; + this.name = name; + this.description = description; + this.userEmail = userEmail; + } + + /** + * @param sessionId + * @param name + * @param description + * @param userEmail + */ + public ScheduleEntryDTO(int sessionId, String userEmail, String description) { + this.sessionId = sessionId; + this.userEmail = userEmail; + this.description = description; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTO#validate() + */ + public DTOValidationResults validate() { + DTOValidationResults results = new DTOValidationResults(); + + if (dtEnd.before(dtBegin)) { + results.addValidationError( + "end date-time must be after beginning date-time"); + } + + if (dtEnd.equals(dtBegin)) { + results.addValidationError( + "end date-time and beginning date-time can not be equal"); + } + + if (Validation.validateEmail(userEmail)) { + results.addValidationError("email " + userEmail + + " is not a valid email"); + } + + if (sessionId == -1) { + results.addValidationError( + "a schedule item must be associated with a session"); + } + + return results; + } + + /** + * @return + */ + public int getId() { + return id; + } + + /** + * @return + */ + public String getName() { + return name; + } + + /** + * Returns 0 if the schedule items overlap in time (however slightly) + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + public int compareTo(Object obj) { + if (obj instanceof ScheduleEntryDTO) { + ScheduleEntryDTO compareTo = (ScheduleEntryDTO) obj; + + if (compareTo.getSessionId() == sessionId) { + return 0; + } else if (compareTo.dtBegin.after(this.dtEnd)) { + return -1; + } else if (compareTo.dtEnd.before(this.dtBegin)) { + return 1; + } else { + return 0; + } + } else if (obj instanceof Date) { + Date compareTo = (Date) obj; + + if (compareTo.after(this.dtEnd)) { + return -1; + } else if (compareTo.before(this.dtBegin)) { + return 1; + } else { + return 0; + } + } else { + throw new ClassCastException(); + } + } + + /** + * @return + */ + public Date getDtBegin() { + return dtBegin; + } + + /** + * @return + */ + public Date getDtEnd() { + return dtEnd; + } + + /** + * @return + */ + public int getSessionId() { + return sessionId; + } + + /** + * @return + */ + public String getUserEmail() { + return userEmail; + } + + /** + * @return + */ + public int getUserId() { + return userId; + } + + /** + * @param i + */ + public void setSessionId(int i) { + sessionId = i; + } + + /** + * @param string + */ + public void setUserEmail(String string) { + userEmail = string; + } + + /** + * @return + */ + public String getDescription() { + return description; + } + + /** + * @param string + */ + public void setDescription(String string) { + description = string; + } + + /** + * @param string + */ + public void setName(String string) { + name = string; + } + + /** + * @param low + * @param high + * @return + */ + public boolean isInRange(Date low, Date high) { + return !(dtEnd.before(low) || dtBegin.after(high)); + } + + /** + * @param reminder + * @return + */ + public boolean addReminder(ScheduleReminderDTO reminder) { + int entryId = reminder.getEntryId(); + + if (id != -1) { + if (entryId == -1) { + reminder.setEntryId(this.id); + } else if (entryId != id) { + return false; // should we throw and exception instead? + } + } else { + if (entryId != -1) { + return false; // should we throw and exception instead? + } + } + + return reminders.add(reminder); + } + + /** + * @return + */ + public Iterator getRemindersIterator() { + return reminders.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() { + return new StringBuffer().append("id = ").append(id).append('\n') + .append("name = ").append(name).append('\n') + .append("session id = ").append(sessionId) + .append('\n').append("description = ") + .append(description).append('\n') + .append("user = ").append(userEmail) + .append('\n').append("dtBegin = ") + .append(dtBegin).append('\n').append("dtEnd = ") + .append(dtEnd).append('\n') + .append("duration = ") + .append(Dates.calculateHoursAndMinutes( + dtBegin, dtEnd)).append('\n').append("reminders = \n") + .append(getRemindersAsString()).append('\n') + .toString(); + } + + /** + * @param reminderId + * @return + */ + public boolean hasReminder(int reminderId) { + boolean retVal = false; + Iterator i = reminders.iterator(); + + for (int index = 0; index < reminders.size(); index++) { + ScheduleReminderDTO reminder = (ScheduleReminderDTO) i.next(); + + if (reminder.getId() == reminderId) { + retVal = true; + + break; + } + } + + return retVal; + } + + /** + * @return + */ + public int getRemindersCount() { + return reminders.size(); + } + + private String getRemindersAsString() { + StringBuffer sb = new StringBuffer(); + Iterator i = reminders.iterator(); + + for (int index = 0; index < reminders.size(); index++) { + ScheduleReminderDTO reminder = (ScheduleReminderDTO) i.next(); + sb.append(reminder); + } + + return sb.toString(); + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ScheduleEntryDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/ScheduleEntryDTOFactory.java new file mode 100644 index 0000000..6be4fe2 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ScheduleEntryDTOFactory.java @@ -0,0 +1,312 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ReminderLocal; +import com.ejdoab.tcms.entities.ScheduleEntryLocal; +import com.ejdoab.tcms.entities.ScheduleEntryLocalHome; +import com.ejdoab.tcms.entities.ScheduleEntryUtil; +import com.ejdoab.tcms.entities.SessionLocal; +import com.ejdoab.tcms.entities.SessionLocalHome; +import com.ejdoab.tcms.entities.SessionUtil; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.entities.UserLocalHome; +import com.ejdoab.tcms.services.UserServicesLocal; +import com.ejdoab.tcms.services.UserServicesLocalHome; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.services.locator.ServiceLocator; +import com.ejdoab.tcms.services.locator.ServiceLocatorException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.FinderException; +import javax.ejb.RemoveException; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleEntryDTOFactory implements DTOFactory { + private static Log log = LogFactory.getLog(ScheduleEntryDTOFactory.class); + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#getDTO(java.lang.Object) + */ + public DTO getDTO(Object obj) throws DTOCreateException { + if (obj instanceof ScheduleEntryLocal) { + try { + ScheduleEntryLocal scheduleEntry = (ScheduleEntryLocal) obj; + + return buildScheduleItemDTO(scheduleEntry); + } catch (Exception e) { + throw new DTOCreateException(e); + } + } else { + throw new DTOCreateException( + "invalid source object for DTO creation"); + } + } + + /** + * @param scheduleEntry + * @return + */ + private ScheduleEntryDTO buildScheduleItemDTO( + ScheduleEntryLocal scheduleEntry) throws DTOCreateException { + int id = -1; // schedule Item id + int userId = -1; + int sessionId = -1; + String name; + String description; + Date dtBegin; + Date dtEnd; + String userEmail; + boolean reminders = false; + + id = scheduleEntry.getId().intValue(); + name = scheduleEntry.getName(); + description = scheduleEntry.getDescription(); + + reminders = !scheduleEntry.getReminders().isEmpty(); + + SessionLocal session = scheduleEntry.getSession(); + sessionId = session.getId().intValue(); + + dtBegin = session.getDateTimeBegin(); + dtEnd = session.getDateTimeEnd(); + + UserLocal user = scheduleEntry.getUser(); + userId = user.getId().intValue(); + userEmail = user.getEmail(); + + ScheduleEntryDTO dto = new ScheduleEntryDTO(id, userId, sessionId, + name, description, dtBegin, dtEnd, userEmail, reminders); + + // get the reminder dto builder + ScheduleReminderDTOFactory dtoBuilder = (ScheduleReminderDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ScheduleReminderDTO.class); + + // add the reminders + Collection c = scheduleEntry.getReminders(); + Iterator items = c.iterator(); + + for (int index = 0; index < c.size(); index++) { + ReminderLocal reminder = (ReminderLocal) items.next(); + ScheduleReminderDTO reminderDTO; + reminderDTO = (ScheduleReminderDTO) dtoBuilder.getDTO(reminder); + dto.addReminder(reminderDTO); + } + + return dto; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#saveDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof ScheduleEntryDTO) { + ScheduleEntryDTO scheduleEntry = (ScheduleEntryDTO) dto; + + return updateScheduleEntry(scheduleEntry); + } else { + throw new DTOUpdateException( + "Attempting to update with an invalid DTO class"); + } + } + + private boolean updateScheduleEntry(ScheduleEntryDTO dto) + throws DTOUpdateException { + boolean retValue = true; + log.debug("[updateScheduleEntry] Updating " + dto); + + ScheduleEntryLocal scheduleEntry = null; + ScheduleEntryLocalHome selh = null; + + try { + selh = ScheduleEntryUtil.getLocalHome(); + } catch (NamingException ne) { + throw new DTOUpdateException("Error schedule entry Information", ne); + } + + int dtoId = dto.getId(); + Integer id = new Integer(dtoId); + Integer sessionId = new Integer(dto.getSessionId()); + String email = dto.getUserEmail(); + + String name = dto.getName(); + String description = dto.getDescription(); + + UserLocal user = null; + SessionLocal session = null; + + if (dtoId == -1) { + log.debug("[updateScheduleEntry] NEW schedule item with id " + + dtoId); + + // -------------------- + // schedule item is new + // -------------------- + UserLocalHome ulh = null; + UserServicesLocal us = null; + ServiceLocator sl; + + try { + sl = ServiceLocator.getInstance(); + + UserServicesLocalHome usHome = (UserServicesLocalHome) sl.getLocalHome( + "ejb.UserServicesLocalHome"); + + us = usHome.create(); + } catch (ServiceLocatorException e) { + new EJBException("could not access user services", e); + } catch (CreateException e) { + new EJBException("could not access user services", e); + } + + // find the user + try { + user = us.findUserByEmail(email); + } catch (NoSuchUserException nsue) { + throw new DTOUpdateException("There is no user with email " + + email, nsue); + } + + if (user != null) { + // find the session + try { + SessionLocalHome slh = SessionUtil.getLocalHome(); + session = slh.findByPrimaryKey(sessionId); + } catch (NamingException ne) { + throw new DTOUpdateException("Error accessing Session Information", + ne); + } catch (FinderException fe) { + throw new DTOUpdateException("No session found with id =" + + sessionId, fe); + } + + if (session != null) { + if (name == null) { + name = session.getPresentation().getConferenceAbstract() + .getTitle(); + } + + try { + scheduleEntry = selh.create(name, description, session, + user); + } catch (CreateException ce) { + throw new DTOUpdateException("Error creating schedule entry", + ce); + } + } else { + retValue = false; + } + } else { + retValue = false; + } + } else { + // schedule item already exists + // only things you can update are the name and description + System.out.println( + "[ScheduleItemDTOBuilder] EXISTING schedule item with id " + + dtoId); + + try { + scheduleEntry = selh.findByPrimaryKey(id); + } catch (FinderException fe) { + throw new DTOUpdateException("Schedule Item with id =" + id + + " does not exist", fe); + } + + if (scheduleEntry != null) { + if (!name.equals(scheduleEntry.getName())) { + scheduleEntry.setName(name); + } + + if (!description.equals(scheduleEntry.getDescription())) { + scheduleEntry.setDescription(description); + } + } else { + retValue = false; + } + } + + if (retValue) { + // we need to do a comparison of the items in the schedule and those + // in the database and remove any items that are in the database but + // not in the schedule + System.out.println( + "[ScheduleItemDTOBuilder] retValue before reminder section is " + + retValue); + + Collection c = scheduleEntry.getReminders(); + Iterator items = c.iterator(); + + for (int index = 0; index < c.size(); index++) { + ReminderLocal reminder = (ReminderLocal) items.next(); + int reminderId = reminder.getId().intValue(); + + if (!dto.hasReminder(reminderId)) { + try { + reminder.remove(); + } catch (RemoveException re) { + throw new DTOUpdateException( + "Could not remove schedule reminder with id" + + reminderId, re); + } + } + } + + ScheduleReminderDTOFactory dtoBuilder = (ScheduleReminderDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(ScheduleReminderDTO.class); + + // loop through the reminder and save them + System.out.println( + "[ScheduleItemDTOBuilder] before saving reminders"); + + Iterator dtos = dto.getRemindersIterator(); + System.out.println("[ScheduleItemDTOBuilder] reminders count =" + + dto.getRemindersCount()); + + for (int index = 0; index < dto.getRemindersCount(); index++) { + ScheduleReminderDTO reminderDTO = (ScheduleReminderDTO) dtos.next(); + + if (reminderDTO.getEntryId() == -1) { + reminderDTO.setEntryId(scheduleEntry.getId().intValue()); + } + + retValue = retValue && dtoBuilder.setDTO(reminderDTO); + } + } + + return retValue; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ScheduleReminderDTO.java b/src/java/com/ejdoab/tcms/services/dto/ScheduleReminderDTO.java new file mode 100644 index 0000000..6fc2a70 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ScheduleReminderDTO.java @@ -0,0 +1,122 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.util.HoursAndMinutes; + +import java.util.Date; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleReminderDTO implements DTO { + private int id = -1; + private int entryId = -1; + private String message; + private Date when; + private HoursAndMinutes hmBefore; + + /** + * @param message + * @param when + */ + public ScheduleReminderDTO(String message, HoursAndMinutes hmBefore) { + this.message = message; + this.hmBefore = hmBefore; + } + + /** + * @param id + * @param entryId + * @param message + * @param when + */ + ScheduleReminderDTO(int id, int entryId, String message, Date when) { + this.id = id; + this.entryId = entryId; + this.message = message; + this.when = when; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTO#validate() + */ + public DTOValidationResults validate() { + // check that Date is before the Schedule Entry Id + return DTOValidationResults.EMPTY_RESULTS; + } + + /** + * @return + */ + public int getId() { + return id; + } + + /** + * @return + */ + public String getMessage() { + return message; + } + + /** + * @return + */ + public Date getWhen() { + return when; + } + + /** + * @return + */ + public int getEntryId() { + return entryId; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + String ts = ""; + + if (when != null) { + ts = when.toString(); + } else { + ts = hmBefore.toString() + " before"; + } + + return new StringBuffer().append("id = ").append(id).append('\n') + .append("for schedule entry = ").append(entryId) + .append('\n').append("when = ").append(ts) + .append('\n').append("reminder message = ") + .append(message).append('\n').toString(); + } + + /** + * @param i + */ + void setEntryId(int i) { + entryId = i; + } + + /** + * @return + */ + public HoursAndMinutes getHmBefore() { + return hmBefore; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/ScheduleReminderDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/ScheduleReminderDTOFactory.java new file mode 100644 index 0000000..33d59fd --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/ScheduleReminderDTOFactory.java @@ -0,0 +1,175 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ReminderLocal; +import com.ejdoab.tcms.entities.ReminderLocalHome; +import com.ejdoab.tcms.entities.ReminderUtil; +import com.ejdoab.tcms.entities.ScheduleEntryLocal; +import com.ejdoab.tcms.entities.ScheduleEntryLocalHome; +import com.ejdoab.tcms.entities.ScheduleEntryUtil; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; +import com.ejdoab.tcms.services.dto.exceptions.DTOUpdateException; +import com.ejdoab.tcms.util.Dates; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Date; + +import javax.ejb.CreateException; +import javax.ejb.FinderException; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleReminderDTOFactory implements DTOFactory { + private static Log log = LogFactory.getLog(ScheduleReminderDTOFactory.class); + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#getDTO(java.lang.Object) + */ + public DTO getDTO(Object obj) throws DTOCreateException { + if (obj instanceof ReminderLocal) { + try { + ReminderLocal reminder = (ReminderLocal) obj; + + return buildScheduleReminderDTO(reminder); + } catch (Exception e) { + throw new DTOCreateException(e); + } + } else { + throw new DTOCreateException( + "invalid source object for DTO creation"); + } + } + + /** + * @param reminder + * @return + */ + private ScheduleReminderDTO buildScheduleReminderDTO(ReminderLocal reminder) { + int id = reminder.getId().intValue(); + Date when = reminder.getDateAndTime(); + int entryId = reminder.getScheduleEntry().getId().intValue(); + String message = reminder.getMessage(); + + return new ScheduleReminderDTO(id, entryId, message, when); + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#saveDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof ScheduleReminderDTO) { + ScheduleReminderDTO reminder = (ScheduleReminderDTO) dto; + + return updateScheduleReminder(reminder); + } else { + throw new DTOUpdateException( + "Attempting to update with an invalid DTO class"); + } + } + + /** + * @param reminder + * @return + */ + private boolean updateScheduleReminder(ScheduleReminderDTO dto) + throws DTOUpdateException { + boolean retValue = true; + log.trace("[updateScheduleReminder]"); + + ReminderLocal reminder = null; + ScheduleEntryLocalHome selh = null; + ReminderLocalHome rlh = null; + + try { + rlh = ReminderUtil.getLocalHome(); + } catch (NamingException ne) { + throw new DTOUpdateException("Error retrieving schedule reminder Information", + ne); + } + + try { + selh = ScheduleEntryUtil.getLocalHome(); + } catch (NamingException ne) { + throw new DTOUpdateException("Error retrieving schedule Information", + ne); + } + + Integer id = new Integer(dto.getId()); + Integer scheduleEntryId = new Integer(dto.getEntryId()); + String message = dto.getMessage(); + Date when = dto.getWhen(); + + if (id.intValue() == -1) { + ScheduleEntryLocal entry = null; + + try { + entry = selh.findByPrimaryKey(scheduleEntryId); + } catch (FinderException fe) { + throw new DTOUpdateException( + "There is no schedule entry with id =" + scheduleEntryId, fe); + } + + UserLocal user = entry.getUser(); + + if (user == null) { + throw new DTOUpdateException( + "There is no user associated with schedule entry= " + + scheduleEntryId); + } + + try { + if (when == null) { + when = Dates.getBefore(entry.getSession().getDateTimeBegin(), + dto.getHmBefore()); + } + + reminder = rlh.create(message, when, user, entry); + } catch (CreateException ce) { + throw new DTOUpdateException("Could not create schedule reminder", + ce); + } + } else { + try { + reminder = rlh.findByPrimaryKey(id); + } catch (FinderException fe) { + throw new DTOUpdateException("There is no reminder with id=" + + id, fe); + } + } + + if (reminder != null) { + reminder.setDateAndTime(when); + reminder.setMessage(message); + } else { + retValue = false; + } + + return retValue; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/SessionDTO.java b/src/java/com/ejdoab/tcms/services/dto/SessionDTO.java new file mode 100644 index 0000000..b117fd5 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/SessionDTO.java @@ -0,0 +1,191 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import java.util.Date; + + +/** + * @author Brian Sam-Bodden + */ +public class SessionDTO implements DTO { + private int sessionId; + private Date dtBegin; + private Date dtEnd; + private String title; + private String type; + private String topic; + private String level; + private String body; + private String where; + private String presenter; + private String presenterId; + + /** + * Creates a new SessionDTO object. + * + * @param sessionId DOCUMENT ME! + * @param title DOCUMENT ME! + * @param dtBegin DOCUMENT ME! + * @param dtEnd DOCUMENT ME! + * @param type DOCUMENT ME! + * @param topic DOCUMENT ME! + * @param level DOCUMENT ME! + * @param body DOCUMENT ME! + * @param where DOCUMENT ME! + * @param presenter DOCUMENT ME! + */ + public SessionDTO(int sessionId, String title, Date dtBegin, Date dtEnd, + String type, String topic, String level, String body, String where, + String presenter, String presenterId) { + this.sessionId = sessionId; + this.dtBegin = dtBegin; + this.dtEnd = dtEnd; + this.title = title; + this.type = type; + this.topic = topic; + this.level = level; + this.body = body; + this.where = where; + this.presenter = presenter; + this.presenterId = presenterId; + } + + /** + * @return + */ + public String getLevel() { + return level; + } + + /** + * @return + */ + public int getSessionId() { + return sessionId; + } + + /** + * @return + */ + public java.lang.String getTitle() { + return title; + } + + /** + * @return + */ + public String getTopic() { + return topic; + } + + /** + * @return + */ + public String getType() { + return type; + } + + /** + * @return + */ + public java.lang.String getBody() { + return body; + } + + /** + * @return + */ + public java.util.Date getDateTimeBegin() { + return dtBegin; + } + + /** + * @return + */ + public java.util.Date getDateTimeEnd() { + return dtEnd; + } + + /** + * @return + */ + public Date getDtBegin() { + return dtBegin; + } + + /** + * @return + */ + public Date getDtEnd() { + return dtEnd; + } + + /** + * @return + */ + public String getPresenter() { + return presenter; + } + + /** + * @return + */ + public String getPresenterId() { + return presenterId; + } + + /** + * @return + */ + public String getWhere() { + return where; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getDurationInMinutes() { + return (int) (dtEnd.getTime() - dtBegin.getTime()) / 60000; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("sessionId=").append(sessionId).append('\n').append("dtBegin=") + .append(dtBegin).append('\n').append("dtEnd=").append(dtEnd) + .append('\n').append("title=").append(title).append('\n') + .append("type=").append(type).append('\n').append("topic=") + .append(topic).append('\n').append("level=").append(level).append('\n') + .append("body=").append(body).append('\n').append("where=") + .append(where).append('\n').append("presenter=").append(presenter) + .append('\n').append("presenter id=").append(presenterId).append('\n'); + + return sb.toString(); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public DTOValidationResults validate() { + return new DTOValidationResults(); + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/SessionDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/SessionDTOFactory.java new file mode 100644 index 0000000..0b913ff --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/SessionDTOFactory.java @@ -0,0 +1,93 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ConferenceAbstractLocal; +import com.ejdoab.tcms.entities.PresentationLocal; +import com.ejdoab.tcms.entities.RoomLocal; +import com.ejdoab.tcms.entities.SessionLocal; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.services.dto.exceptions.*; + +import java.util.Date; + + +/** + * @author Brian Sam-Bodden + */ +public class SessionDTOFactory implements DTOFactory { + private SessionDTO buildSessionDTO(SessionLocal session) { + PresentationLocal presentation = session.getPresentation(); + ConferenceAbstractLocal cAbstract = presentation.getConferenceAbstract(); + UserLocal user = cAbstract.getPresenter().getUser(); + RoomLocal room = session.getRoom(); + + int sessionId = session.getId().intValue(); + Date dtBegin = session.getDateTimeBegin(); + Date dtEnd = session.getDateTimeEnd(); + + String title = cAbstract.getTitle(); + + String type = StringCache.getType(cAbstract.getType()); + String topic = StringCache.getTopic(cAbstract.getTopic()); + String level = StringCache.getLevel(cAbstract.getLevel()); + String body = cAbstract.getBody(); + String where = room.getName(); + String presenter = user.getFirstName() + " " + user.getLastName(); + String presenterId = user.getEmail(); + + SessionDTO dto = new SessionDTO(sessionId, title, dtBegin, dtEnd, type, + topic, level, body, where, presenter, presenterId); + + return dto; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOBuilder#getDTO(java.lang.Object) + */ + public DTO getDTO(Object obj) throws DTOCreateException { + if (obj instanceof SessionLocal) { + try { + SessionLocal session = (SessionLocal) obj; + + return buildSessionDTO(session); + } catch (Exception e) { + throw new DTOCreateException(e); + } + } else { + throw new DTOCreateException( + "invalid source object for DTO creation"); + } + } + + /** + * DOCUMENT ME! + * + * @param dto DOCUMENT ME! + * + * @return DOCUMENT ME! + * + * @throws DTOUpdateException DOCUMENT ME! + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + return false; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/StringCache.java b/src/java/com/ejdoab/tcms/services/dto/StringCache.java new file mode 100644 index 0000000..aa32932 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/StringCache.java @@ -0,0 +1,262 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.ConferenceAbstractStatusLocal; +import com.ejdoab.tcms.entities.ConferenceAbstractStatusUtil; +import com.ejdoab.tcms.entities.PresentationLevelLocal; +import com.ejdoab.tcms.entities.PresentationLevelUtil; +import com.ejdoab.tcms.entities.PresentationTopicLocal; +import com.ejdoab.tcms.entities.PresentationTopicUtil; +import com.ejdoab.tcms.entities.PresentationTypeLocal; +import com.ejdoab.tcms.entities.PresentationTypeUtil; +import com.ejdoab.tcms.util.Arrays; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.FinderException; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + */ +public class StringCache { + private static Log log = LogFactory.getLog(StringCache.class); + private static String[] types; + private static String[] topics; + private static String[] levels; + private static String[] abstractStatus; + + static { + initialize(); + } + + /** + * DOCUMENT ME! + */ + public static void initialize() { + try { + Collection allTopics = PresentationTopicUtil.getLocalHome().findAll(); + Collection allTypes = PresentationTypeUtil.getLocalHome().findAll(); + Collection allLevels = PresentationLevelUtil.getLocalHome().findAll(); + Collection allStatus = ConferenceAbstractStatusUtil.getLocalHome() + .findAll(); + + int topicCount = allTopics.size(); + topics = new String[topicCount]; + + Iterator topicsIterator = allTopics.iterator(); + + for (int index = 0; index < topicCount; index++) { + PresentationTopicLocal topic = (PresentationTopicLocal) topicsIterator.next(); + + if (log.isDebugEnabled()) { + log.debug("[initialize] Adding topic " + topic.getId() + + "=" + topic.getName()); + } + + topics[topic.getId().intValue()] = topic.getName(); + } + + int typesCount = allTypes.size(); + types = new String[typesCount]; + + Iterator typesIterator = allTypes.iterator(); + + for (int index = 0; index < typesCount; index++) { + PresentationTypeLocal type = (PresentationTypeLocal) typesIterator.next(); + + if (log.isDebugEnabled()) { + log.debug("[initialized] Adding type " + type.getId() + + "=" + type.getName()); + } + + types[type.getId().intValue()] = type.getName(); + } + + int levelsCount = allLevels.size(); + levels = new String[levelsCount]; + + Iterator levelsIterator = allLevels.iterator(); + + for (int index = 0; index < levelsCount; index++) { + PresentationLevelLocal level = (PresentationLevelLocal) levelsIterator.next(); + + if (log.isDebugEnabled()) { + log.debug("[initialized] Adding level " + level.getId() + + "=" + level.getName()); + } + + levels[level.getId().intValue()] = level.getName(); + } + + int aStatusCount = allStatus.size(); + abstractStatus = new String[aStatusCount]; + + Iterator abstractsStatusIterator = allStatus.iterator(); + + for (int index = 0; index < aStatusCount; index++) { + ConferenceAbstractStatusLocal status = (ConferenceAbstractStatusLocal) abstractsStatusIterator.next(); + + if (log.isDebugEnabled()) { + log.debug("[initialized] Adding abstract status " + + status.getId() + "=" + status.getName()); + } + + abstractStatus[status.getId().intValue()] = status.getName(); + } + } catch (NamingException ne) { + ne.printStackTrace(); + } catch (FinderException fe) { + fe.printStackTrace(); + } + } + + /** + * DOCUMENT ME! + * + * @param index DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static String getType(int index) { + if ((index >= 0) && (index < types.length)) { + return types[index]; + } else { + return "n/a"; + } + } + + /** + * DOCUMENT ME! + * + * @param type DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static int getTypeIndex(String type) { + return Arrays.getElementIndexIgnoreCase(types, type); + } + + /** + * DOCUMENT ME! + * + * @param index DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static String getLevel(int index) { + if ((index >= 0) && (index < levels.length)) { + return levels[index]; + } else { + return "n/a"; + } + } + + /** + * DOCUMENT ME! + * + * @param level DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static int getLevelIndex(String level) { + return Arrays.getElementIndexIgnoreCase(levels, level); + } + + /** + * DOCUMENT ME! + * + * @param index DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static String getTopic(int index) { + if ((index >= 0) && (index < topics.length)) { + return topics[index]; + } else { + return "n/a"; + } + } + + /** + * DOCUMENT ME! + * + * @param topic DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static int getTopicIndex(String topic) { + return Arrays.getElementIndexIgnoreCase(topics, topic); + } + + /** + * DOCUMENT ME! + * + * @param index DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static String getAbstractStatus(int index) { + if ((index >= 0) && (index < abstractStatus.length)) { + return abstractStatus[index]; + } else { + return "n/a"; + } + } + + /** + * DOCUMENT ME! + * + * @param status DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static int getAbstractStatusIndex(String status) { + return Arrays.getElementIndexIgnoreCase(abstractStatus, status); + } + + /** + * @return + */ + public static String[] getAbstractStatus() { + return abstractStatus; + } + + /** + * @return + */ + public static String[] getLevels() { + return levels; + } + + /** + * @return + */ + public static String[] getTopics() { + return topics; + } + + /** + * @return + */ + public static String[] getTypes() { + return types; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/UserProfileDTO.java b/src/java/com/ejdoab/tcms/services/dto/UserProfileDTO.java new file mode 100644 index 0000000..3420213 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/UserProfileDTO.java @@ -0,0 +1,520 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import java.io.Serializable; + +import java.util.HashSet; +import java.util.Set; + + +/** + * @author Brian Sam-Bodden + */ +public class UserProfileDTO implements DTO { + private int id = -1; + private UserType userType = null; + private String firstName; + private String lastName; + private String email; + private String password; + private String fax; + private String homePhone; + private String workPhone; + private String addressAptNumber; + private String addressCity; + private String addressState; + private String addressStreet; + private String addressZipCode; + + // presenter only fields + private String bio; + private String company; + + /** + * DOCUMENT ME! + * + * @param id DOCUMENT ME! + * @param firstName DOCUMENT ME! + * @param lastName DOCUMENT ME! + * @param email DOCUMENT ME! + * @param password DOCUMENT ME! + * @param fax DOCUMENT ME! + * @param homePhone DOCUMENT ME! + * @param workPhone DOCUMENT ME! + * @param addressAptNumber DOCUMENT ME! + * @param addressCity DOCUMENT ME! + * @param addressState DOCUMENT ME! + * @param addressStreet DOCUMENT ME! + * @param addressZipCode DOCUMENT ME! + * @param bio DOCUMENT ME! + * @param company DOCUMENT ME! + */ + public void setPresenterData(int id, String firstName, String lastName, + String email, String password, String fax, String homePhone, + String workPhone, String addressAptNumber, String addressCity, + String addressState, String addressStreet, String addressZipCode, + String bio, String company) { + setId(id); + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.fax = fax; + this.homePhone = homePhone; + this.workPhone = workPhone; + this.addressAptNumber = addressAptNumber; + this.addressCity = addressCity; + this.addressState = addressState; + this.addressStreet = addressStreet; + this.addressZipCode = addressZipCode; + this.bio = bio; + this.company = company; + + try { + setUserType(UserType.PRESENTER); + } catch (NoSuchUserTypeException e) { + e.printStackTrace(); + } + } + + /** + * DOCUMENT ME! + * + * @param id DOCUMENT ME! + * @param firstName DOCUMENT ME! + * @param lastName DOCUMENT ME! + * @param email DOCUMENT ME! + * @param password DOCUMENT ME! + * @param fax DOCUMENT ME! + * @param homePhone DOCUMENT ME! + * @param workPhone DOCUMENT ME! + * @param addressAptNumber DOCUMENT ME! + * @param addressCity DOCUMENT ME! + * @param addressState DOCUMENT ME! + * @param addressStreet DOCUMENT ME! + * @param addressZipCode DOCUMENT ME! + */ + public void setAttendeeData(int id, String firstName, String lastName, + String email, String password, String fax, String homePhone, + String workPhone, String addressAptNumber, String addressCity, + String addressState, String addressStreet, String addressZipCode) { + setId(id); + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.fax = fax; + this.homePhone = homePhone; + this.workPhone = workPhone; + this.addressAptNumber = addressAptNumber; + this.addressCity = addressCity; + this.addressState = addressState; + this.addressStreet = addressStreet; + this.addressZipCode = addressZipCode; + + try { + setUserType(UserType.ATTENDEE); + } catch (NoSuchUserTypeException e) { + e.printStackTrace(); + } + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getId() { + return this.id; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Integer getIdAsInteger() { + return new Integer(id); + } + + /** + * DOCUMENT ME! + * + * @param id DOCUMENT ME! + */ + public void setId(Integer id) { + setId(id.intValue()); + } + + // Idempotent Method + public void setId(int id) { + if (this.id == -1) { + this.id = id; + } + } + + // idempotent method + public void setUserType(UserType userType) throws NoSuchUserTypeException { + if (!UserType.types.contains(userType)) { + throw new NoSuchUserTypeException(userType.desc); + } + + if (this.userType == null) { + this.userType = userType; + } + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public UserType getUserType() { + return userType; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + return new StringBuffer().append("userType = ").append(userType) + .append('\n').append("firstName = ") + .append(firstName).append('\n') + .append("lastName = ").append(lastName) + .append('\n').append("email = ").append(email) + .append('\n').append("password = ") + .append(password).append('\n').append("fax = ") + .append(fax).append('\n').append("homePhone = ") + .append(homePhone).append('\n') + .append("workPhone = ").append(workPhone) + .append('\n').append("addressAptNumber = ") + .append(addressAptNumber).append('\n') + .append("addressCity = ").append(addressCity) + .append('\n').append("addressState = ") + .append(addressState).append('\n') + .append("addressStreet = ") + .append(addressStreet).append('\n') + .append("addressZipCode = ") + .append(addressZipCode).append('\n').toString(); + } + + /** + * Returns the addressAptNumber. + * @return String + */ + public String getAddressAptNumber() { + return addressAptNumber; + } + + /** + * Returns the addressCity. + * @return String + */ + public String getAddressCity() { + return addressCity; + } + + /** + * Returns the addressState. + * @return String + */ + public String getAddressState() { + return addressState; + } + + /** + * Returns the addressStreet. + * @return String + */ + public String getAddressStreet() { + return addressStreet; + } + + /** + * Returns the addressZipCode. + * @return String + */ + public String getAddressZipCode() { + return addressZipCode; + } + + /** + * Returns the bio. + * @return String + */ + public String getBio() { + return bio; + } + + /** + * Returns the email. + * @return String + */ + public String getEmail() { + return email; + } + + /** + * Returns the fax. + * @return String + */ + public String getFax() { + return fax; + } + + /** + * Returns the firstName. + * @return String + */ + public String getFirstName() { + return firstName; + } + + /** + * Returns the homePhone. + * @return String + */ + public String getHomePhone() { + return homePhone; + } + + /** + * Returns the lastName. + * @return String + */ + public String getLastName() { + return lastName; + } + + /** + * Returns the password. + * @return String + */ + public String getPassword() { + return password; + } + + /** + * Sets the addressAptNumber. + * @param addressAptNumber The addressAptNumber to set + */ + public void setAddressAptNumber(String addressAptNumber) { + this.addressAptNumber = addressAptNumber; + } + + /** + * Sets the addressCity. + * @param addressCity The addressCity to set + */ + public void setAddressCity(String addressCity) { + this.addressCity = addressCity; + } + + /** + * Sets the addressState. + * @param addressState The addressState to set + */ + public void setAddressState(String addressState) { + this.addressState = addressState; + } + + /** + * Sets the addressStreet. + * @param addressStreet The addressStreet to set + */ + public void setAddressStreet(String addressStreet) { + this.addressStreet = addressStreet; + } + + /** + * Sets the addressZipCode. + * @param addressZipCode The addressZipCode to set + */ + public void setAddressZipCode(String addressZipCode) { + this.addressZipCode = addressZipCode; + } + + /** + * Sets the bio. + * @param bio The bio to set + */ + public void setBio(String bio) { + this.bio = bio; + } + + /** + * Sets the email. + * @param email The email to set + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Sets the fax. + * @param fax The fax to set + */ + public void setFax(String fax) { + this.fax = fax; + } + + /** + * Sets the firstName. + * @param firstName The firstName to set + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Sets the homePhone. + * @param homePhone The homePhone to set + */ + public void setHomePhone(String homePhone) { + this.homePhone = homePhone; + } + + /** + * Sets the lastName. + * @param lastName The lastName to set + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Sets the password. + * @param password The password to set + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public DTOValidationResults validate() { + DTOValidationResults results = new DTOValidationResults(); + + return results; + } + + /** + * Returns the company. + * @return String + */ + public String getCompany() { + return company; + } + + /** + * Returns the workPhone. + * @return String + */ + public String getWorkPhone() { + return workPhone; + } + + /** + * Sets the company. + * @param company The company to set + */ + public void setCompany(String company) { + this.company = company; + } + + /** + * Sets the workPhone. + * @param workPhone The workPhone to set + */ + public void setWorkPhone(String workPhone) { + this.workPhone = workPhone; + } + + /** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ + public static class UserType implements Serializable { + /** DOCUMENT ME! */ + public static Set types = new HashSet(); + + /** DOCUMENT ME! */ + public static UserType ATTENDEE = new UserType("Attendee"); + + /** DOCUMENT ME! */ + public static UserType PRESENTER = new UserType("Presenter"); + + static { + types.add(ATTENDEE); + types.add(PRESENTER); + } + + private String desc; + + /** + * Constructor UserType. + * @param string + */ + private UserType(String desc) { + this.desc = desc; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + return desc; + } + + /** + * DOCUMENT ME! + * + * @param o DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean equals(Object o) { + if (o instanceof UserType) { + return ((UserType) o).desc.equals(desc); + } else { + return false; + } + } + } + + /** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ + public static class NoSuchUserTypeException extends Exception { + /** + * Constructor NoSuchUserTypeException. + * @param string + */ + public NoSuchUserTypeException(String message) { + super(message); + } + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/UserProfileDTOFactory.java b/src/java/com/ejdoab/tcms/services/dto/UserProfileDTOFactory.java new file mode 100644 index 0000000..0adc3f4 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/UserProfileDTOFactory.java @@ -0,0 +1,329 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto; + +import com.ejdoab.tcms.entities.AddressLocal; +import com.ejdoab.tcms.entities.AddressLocalHome; +import com.ejdoab.tcms.entities.AddressUtil; +import com.ejdoab.tcms.entities.AttendeeLocal; +import com.ejdoab.tcms.entities.PresenterLocal; +import com.ejdoab.tcms.entities.UserLocal; +import com.ejdoab.tcms.entities.UserLocalHome; +import com.ejdoab.tcms.entities.UserUtil; +import com.ejdoab.tcms.services.dto.exceptions.*; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.ejb.CreateException; +import javax.ejb.FinderException; + +import javax.naming.NamingException; + + +/** + * @author Brian Sam-Bodden + */ +public class UserProfileDTOFactory implements DTOFactory { + private static Log log = LogFactory.getLog(UserProfileDTOFactory.class); + + /** + * Method updateProfile. + * @param userProfile + * @return boolean + */ + private boolean updateProfile(UserLocal user, UserProfileDTO up) + throws NoSuchUserException { + boolean retValue = true; + Integer id = up.getIdAsInteger(); + log.debug("[updateProfile] profile submitted with id =" + id); + + if (!id.equals(user.getId()) && (id.intValue() != -1)) { + // this is not the right exception to throw + throw new NoSuchUserException( + "trying to update a user with the wrong profile"); + } + + try { + AddressLocal address = user.getAddress(); + + // if the user didn't have an address set the set it + if (address == null) { + AddressLocalHome alh = AddressUtil.getLocalHome(); + + try { + address = alh.create(); + user.setAddress(address); + } catch (CreateException e) { + e.printStackTrace(); + } + } + + if (address != null) { + // do the address + address.setAptNumber(up.getAddressAptNumber()); + address.setCity(up.getAddressCity()); + address.setState(up.getAddressState()); + address.setStreetAddress(up.getAddressStreet()); + address.setZipCode(up.getAddressZipCode()); + } + + // do other user fields + user.setEmail(up.getEmail()); + user.setFax(up.getFax()); + user.setFirstName(up.getFirstName()); + user.setHomePhone(up.getHomePhone()); + user.setLastName(up.getLastName()); + user.setPassword(up.getPassword()); + user.setWorkPhone(up.getWorkPhone()); + + if (up.getUserType() == UserProfileDTO.UserType.PRESENTER) { + PresenterLocal presenter = user.getPresenter(); + + if (presenter != null) { + presenter.setBio(up.getBio()); + presenter.setCompany(up.getCompany()); + } + } + } catch (NamingException e) { + // can't find the home + retValue = false; + } + + return retValue; + } + + /** + * Method updateProfile. + * @param userProfile + * @return boolean + */ + private boolean updateProfile(UserProfileDTO up) throws NoSuchUserException { + boolean retValue = true; + UserLocal user = null; + Integer id = up.getIdAsInteger(); + + if (id.intValue() == -1) { + throw new NoSuchUserException( + "trying to update a user with the wrong profile"); + } + + log.debug("[updateProfile] profile submitted with id =" + id); + + try { + UserLocalHome ulh = UserUtil.getLocalHome(); + user = ulh.findByPrimaryKey(id); + } catch (NamingException e) { + // can't find the home + retValue = false; + } catch (FinderException e) { + // can't find the user + throw new NoSuchUserException(e, + "there is no user with id " + up.getId() + " in the system"); + } + + if (user != null) { + log.debug("[updateProfile] user is not null"); + + return updateProfile(user, up); + } else { + log.debug("[updateProfile] user is null"); + + return false; + } + } + + /** + * Method getUserProfile. + * @param attendee + * @return UserProfile + */ + private UserProfileDTO getUserProfile(AttendeeLocal attendee) + throws DTOCreateException { + int id = -1; + String firstName = ""; + String lastName = ""; + String email = ""; + String password = ""; + String fax = ""; + String homePhone = ""; + String workPhone = ""; + String addressAptNumber = ""; + String addressCity = ""; + String addressState = ""; + String addressStreet = ""; + String addressZipCode = ""; + + UserLocal user = attendee.getUser(); + + if (user != null) { + id = user.getId().intValue(); + firstName = user.getFirstName(); + lastName = user.getLastName(); + email = user.getEmail(); + password = user.getPassword(); + fax = user.getFax(); + homePhone = user.getHomePhone(); + workPhone = user.getWorkPhone(); + } else { + // should never happen + throw new DTOCreateException( + "Can not find a user associated with attendee [" + + attendee.getId() + "]"); + } + + AddressLocal address = user.getAddress(); + + // do the address + if (address != null) { + addressAptNumber = address.getAptNumber(); + addressCity = address.getCity(); + addressState = address.getState(); + addressStreet = address.getStreetAddress(); + addressZipCode = address.getZipCode(); + } + + UserProfileDTO dto = new UserProfileDTO(); + dto.setAttendeeData(id, firstName, lastName, email, password, fax, + homePhone, workPhone, addressAptNumber, addressCity, addressState, + addressStreet, addressZipCode); + + return dto; + } + + /** + * Method getUserProfile. + * @param presenter + * @return UserProfile + */ + private UserProfileDTO getUserProfile(PresenterLocal presenter) + throws DTOCreateException { + int id = -1; + String firstName = ""; + String lastName = ""; + String email = ""; + String password = ""; + String fax = ""; + String homePhone = ""; + String workPhone = ""; + String addressAptNumber = ""; + String addressCity = ""; + String addressState = ""; + String addressStreet = ""; + String addressZipCode = ""; + String bio = ""; + String company = ""; + + bio = presenter.getBio(); + company = presenter.getCompany(); + + UserLocal user = presenter.getUser(); + + if (user != null) { + id = user.getId().intValue(); + firstName = user.getFirstName(); + lastName = user.getLastName(); + email = user.getEmail(); + password = user.getPassword(); + fax = user.getFax(); + homePhone = user.getHomePhone(); + workPhone = user.getWorkPhone(); + } else { + // should never happen + throw new DTOCreateException( + "Can not find a user associated with attendee [" + + presenter.getId() + "]"); + } + + AddressLocal address = user.getAddress(); + + // do the address + if (address != null) { + addressAptNumber = address.getAptNumber(); + addressCity = address.getCity(); + addressState = address.getState(); + addressStreet = address.getStreetAddress(); + addressZipCode = address.getZipCode(); + } + + UserProfileDTO dto = new UserProfileDTO(); + dto.setPresenterData(id, firstName, lastName, email, password, fax, + homePhone, workPhone, addressAptNumber, addressCity, addressState, + addressStreet, addressZipCode, bio, company); + + return dto; + } + + /** + * DOCUMENT ME! + * + * @param dto DOCUMENT ME! + * + * @return DOCUMENT ME! + * + * @throws DTOUpdateException DOCUMENT ME! + */ + public boolean setDTO(DTO dto) throws DTOUpdateException { + if (dto instanceof UserProfileDTO) { + UserProfileDTO userProfile = (UserProfileDTO) dto; + + try { + return updateProfile(userProfile); + } catch (NoSuchUserException nsue) { + throw new DTOUpdateException("", nsue); + } + } else { + throw new DTOUpdateException( + "Attempting to update with an invalid DTO class"); + } + } + + /** + * DOCUMENT ME! + * + * @param obj DOCUMENT ME! + * + * @return DOCUMENT ME! + * + * @throws DTOCreateException DOCUMENT ME! + */ + public DTO getDTO(Object obj) throws DTOCreateException { + DTO dto = null; + + if (obj instanceof AttendeeLocal) { + log.debug("[getDTO] Parameter is an Attendee"); + + AttendeeLocal attendee = (AttendeeLocal) obj; + dto = getUserProfile(attendee); + } else if (obj instanceof PresenterLocal) { + log.debug("[getDTO] Parameter is a Presenter"); + + PresenterLocal presenter = (PresenterLocal) obj; + dto = getUserProfile(presenter); + } else { + throw new DTOCreateException( + "Attempting to create a DTO with an invalid source object"); + } + + return dto; + } + + /* (non-Javadoc) + * @see com.ejdoab.tcms.services.dto.DTOFactory#removeDTO(com.ejdoab.tcms.services.dto.DTO) + */ + public boolean removeDTO(DTO dto) throws DTOUpdateException { + // TODO Auto-generated method stub + return false; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Entries b/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Entries new file mode 100644 index 0000000..b055da6 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Entries @@ -0,0 +1,3 @@ +/DTOCreateException.java/1.5/Sun Dec 21 21:26:41 2003/-kb/ +/DTOUpdateException.java/1.3/Sun Dec 21 21:26:41 2003/-kb/ +/ScheduleConflictException.java/1.4/Sun Dec 21 21:26:41 2003/-kb/ diff --git a/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Repository b/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Repository new file mode 100644 index 0000000..6e81b0d --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/services/dto/exceptions diff --git a/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Root b/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/exceptions/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/services/dto/exceptions/DTOCreateException.java b/src/java/com/ejdoab/tcms/services/dto/exceptions/DTOCreateException.java new file mode 100644 index 0000000..118d685 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/exceptions/DTOCreateException.java @@ -0,0 +1,75 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.exceptions; + + +/** + * @author Brian Sam-Bodden + */ +public class DTOCreateException extends Exception { + private Exception wex; + + /** + * @param message the detail message. + * @param exception the wrapped exception. + */ + public DTOCreateException(String message, Exception exception) { + super(message); + wex = exception; + } + + /** + * @param exception the contained (wrapped) exception. + */ + public DTOCreateException(Exception exception) { + this(null, exception); + } + + /** + * @param message the detail message. + */ + public DTOCreateException(String message) { + this(message, null); + } + + /** + * @return the wrapped exception. + */ + public Exception getException() { + return wex; + } + + /** + * @return + */ + public Exception getRootCause() { + if (wex instanceof DTOCreateException) { + return ((DTOCreateException) wex).getRootCause(); + } + + return (wex == null) ? this : wex; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + if (wex instanceof DTOCreateException) { + return ((DTOCreateException) wex).toString(); + } + + return (wex == null) ? super.toString() : wex.toString(); + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/exceptions/DTOUpdateException.java b/src/java/com/ejdoab/tcms/services/dto/exceptions/DTOUpdateException.java new file mode 100644 index 0000000..d4d9598 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/exceptions/DTOUpdateException.java @@ -0,0 +1,77 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.exceptions; + +import java.lang.Exception; + + +/** + * @author Brian Sam-Bodden + */ +public class DTOUpdateException extends Exception { + private Exception wex; + + /** + * @param message the detail message. + * @param exception the wrapped exception. + */ + public DTOUpdateException(String message, Exception exception) { + super(message); + wex = exception; + } + + /** + * @param exception the contained (wrapped) exception. + */ + public DTOUpdateException(Exception exception) { + this(null, exception); + } + + /** + * @param message the detail message. + */ + public DTOUpdateException(String message) { + this(message, null); + } + + /** + * @return the wrapped exception. + */ + public Exception getException() { + return wex; + } + + /** + * @return + */ + public Exception getRootCause() { + if (wex instanceof DTOUpdateException) { + return ((DTOUpdateException) wex).getRootCause(); + } + + return (wex == null) ? this : wex; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + if (wex instanceof DTOUpdateException) { + return ((DTOUpdateException) wex).toString(); + } + + return (wex == null) ? super.toString() : wex.toString(); + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/exceptions/ScheduleConflictException.java b/src/java/com/ejdoab/tcms/services/dto/exceptions/ScheduleConflictException.java new file mode 100644 index 0000000..e734998 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/exceptions/ScheduleConflictException.java @@ -0,0 +1,75 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.exceptions; + + +/** + * @author Brian Sam-Bodden + */ +public class ScheduleConflictException extends Exception { + private Exception wex; + + /** + * @param message the detail message. + * @param exception the wrapped exception. + */ + public ScheduleConflictException(String message, Exception exception) { + super(message); + wex = exception; + } + + /** + * @param exception the contained (wrapped) exception. + */ + public ScheduleConflictException(Exception exception) { + this(null, exception); + } + + /** + * @param message the detail message. + */ + public ScheduleConflictException(String message) { + this(message, null); + } + + /** + * @return the wrapped exception. + */ + public Exception getException() { + return wex; + } + + /** + * @return + */ + public Exception getRootCause() { + if (wex instanceof ScheduleConflictException) { + return ((ScheduleConflictException) wex).getRootCause(); + } + + return (wex == null) ? this : wex; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + if (wex instanceof ScheduleConflictException) { + return ((ScheduleConflictException) wex).toString(); + } + + return (wex == null) ? super.toString() : wex.toString(); + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/page/CVS/Entries b/src/java/com/ejdoab/tcms/services/dto/page/CVS/Entries new file mode 100644 index 0000000..81e0baf --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/page/CVS/Entries @@ -0,0 +1,3 @@ +/Page.java/1.6/Sun Dec 21 21:26:41 2003/-kb/ +/PageCache.java/1.11/Sun Dec 21 21:26:42 2003/-kb/ +/PageFactory.java/1.6/Sun Dec 21 21:26:42 2003/-kb/ diff --git a/src/java/com/ejdoab/tcms/services/dto/page/CVS/Repository b/src/java/com/ejdoab/tcms/services/dto/page/CVS/Repository new file mode 100644 index 0000000..5920be4 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/page/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/services/dto/page diff --git a/src/java/com/ejdoab/tcms/services/dto/page/CVS/Root b/src/java/com/ejdoab/tcms/services/dto/page/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/page/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/services/dto/page/Page.java b/src/java/com/ejdoab/tcms/services/dto/page/Page.java new file mode 100644 index 0000000..c772793 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/page/Page.java @@ -0,0 +1,192 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.page; + +import java.io.Serializable; + +import java.util.*; + + +/** + * Collection subset used to page through large collections. + * @author Brian Sam-Bodden + */ +public class Page implements Iterator, Serializable { + /** DOCUMENT ME! */ + public static final Page EMPTY_PAGE = new Page(Collections.EMPTY_LIST, 0, 0); + private ArrayList contents; + private transient Iterator i; + private int index; + private int totalSize; + private int size; + private transient String toStringValue; + + /** + * Consturctor + * @param c source collection + * @param index index of the collection to start + * @param size number of elements to be placed in Page + */ + public Page(Collection c, int index, int size) { + Object[] oa = new Object[size]; + System.arraycopy(c.toArray(), index, oa, 0, size); + contents = new ArrayList(Arrays.asList(oa)); + this.index = index; + this.size = size; + totalSize = c.size(); + } + + /** + * Consturctor + * @param c source collection + * @param index index of the collection to start + * @param size number of elements to be placed in Page + * @param totalSize of collection + */ + public Page(Collection c, int index, int size, int totalSize) { + Object[] oa = new Object[size]; + System.arraycopy(c.toArray(), 0, oa, 0, size); + contents = new ArrayList(Arrays.asList(oa)); + this.index = index; + this.size = size; + this.totalSize = totalSize; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean hasNext() { + checkIterator(); + + boolean hasNext = i.hasNext(); + + if (!hasNext) { + i = contents.iterator(); + } + + return hasNext; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Object next() { + checkIterator(); + + return i.next(); + } + + /** + * DOCUMENT ME! + */ + public void remove() { + throw new UnsupportedOperationException( + "Operation is not supported on a read-only list"); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getIndex() { + return index; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean hasMoreDataAhead() { + return (index + size) < totalSize; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean hasMoreDataBefore() { + return index > 0; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getNextPageStartIndex() { + return index + size; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getPreviousPageStartIndex() { + return Math.max(index - size, 0); + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getSize() { + return size; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getTotalSize() { + return totalSize; + } + + /** + * DOCUMENT ME! + */ + private void checkIterator() { + if (i == null) { + i = contents.iterator(); + } + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + if (toStringValue == null) { + StringBuffer sb = new StringBuffer(); + checkIterator(); + + for (int index = 0, n = contents.size(); index < n; index++) { + sb.append(i.next().toString()).append('\n'); + } + + toStringValue = sb.toString(); + } + + return toStringValue; + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/page/PageCache.java b/src/java/com/ejdoab/tcms/services/dto/page/PageCache.java new file mode 100644 index 0000000..f3bce9c --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/page/PageCache.java @@ -0,0 +1,167 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.page; + +import com.ejdoab.tcms.util.Dates; + +import org.apache.commons.logging.*; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + + +/** + * Singleton collection of cached Pages for improving performance and response + * time. + * @author Brian Sam-Bodden + */ +public class PageCache { + private static long CLEANING_INTERVAL = 5 * Dates.MILLIS_PER_MINUTE; + private static PageCache instance = new PageCache(); + private static Log log = LogFactory.getLog(PageCache.class); + private Map cache = new HashMap(); + private Map ttls = new HashMap(); + private long lastCleaned = System.currentTimeMillis(); + + // private to support singlton interface. + private PageCache() { + } + + /** + * Returns singleton instance. + */ + public static PageCache getInstance() { + return instance; + } + + /** + * Adds page to cache. + * @param name Name used to retrieve page from cache. + * @param page Page to store + * @param ttlInMinutes Time to Live in minutes + */ + public void addPage(String name, Page page, int ttlInMinutes) { + cleanIfNeeded(); + + // check if the Collection is in the cache + long now = System.currentTimeMillis(); + long ttlInMillis = now + (ttlInMinutes * Dates.MILLIS_PER_MINUTE); + Date ttl = new Date(ttlInMillis); + ttls.put(name, ttl); + cache.put(name, page); + log.debug("Collection " + name + " added on " + new Date(now) + + " with ttl set to " + ttl); + } + + /** + * Returns cached page by name. + */ + public Page getPage(String name) { + cleanIfNeeded(); + + Page page = null; + Object o = cache.get(name); + + if (o != null) { + // check the ttl + Date ttl = (Date) ttls.get(name); + Date now = new Date(); + + // is it expired? + log.debug("now = " + now + " ttl = " + ttl); + + if (ttl.after(now)) { + log.debug("Collection " + name + " found"); + page = (Page) o; + } else { + // remove it if expired + log.debug("Collection " + name + " found but it has expired"); + ttls.remove(name); + cache.remove(name); + } + } else { + log.warn("Collection " + name + " not found"); + } + + return page; + } + + /** + * @param name + */ + public void invalidatePage(String name) { + cache.remove(name); + } + + /** + * DOCUMENT ME! + * + * @param prefix DOCUMENT ME! + */ + public void invalidateAllStartsWith(String prefix) { + boolean done = false; + Set keys = cache.keySet(); + Object[] keysAsArray = keys.toArray(); + + for (int i = 0; i < keysAsArray.length; i++) { + String key = (String) keysAsArray[i]; + + if (key.startsWith(prefix)) { + invalidatePage(key); + } + } + } + + private void cleanIfNeeded() { + long now = System.currentTimeMillis(); + log.debug("Cache was last cleaned on " + new Date(lastCleaned) + + " now is " + new Date(now) + "\nlastCleaned =" + lastCleaned + + " now =" + now); + + if (now > (lastCleaned + CLEANING_INTERVAL)) { + log.trace("Need to clean the cache!"); + cleanCache(); + } else { + log.trace("No need to clean cache!"); + } + } + + /** + * Cleans cache if necessary. + */ + public synchronized void cleanCache() { + log.trace("cleaning Page Cache"); + + lastCleaned = System.currentTimeMillis(); + + Set keySet = ttls.keySet(); + String[] keys = (String[]) keySet.toArray(new String[keySet.size()]); + Date now = new Date(); + + for (int i = 0; i < keys.length; i++) { + String key = keys[i]; + Date ttl = (Date) ttls.get(key); + + if (ttl != null) { + if (ttl.before(now)) { + log.debug("Removing " + key + " from cache on " + now + + " ttl was " + ttl); + ttls.remove(key); + cache.remove(key); + } + } + } + } +} diff --git a/src/java/com/ejdoab/tcms/services/dto/page/PageFactory.java b/src/java/com/ejdoab/tcms/services/dto/page/PageFactory.java new file mode 100644 index 0000000..70323c2 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/dto/page/PageFactory.java @@ -0,0 +1,90 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.page; + +import com.ejdoab.tcms.services.dto.DTOFactory; +import com.ejdoab.tcms.services.dto.exceptions.DTOCreateException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * Factory for building Pages. + * @author Brian Sam-Bodden + */ +public class PageFactory { + private static Map methodCache = new HashMap(); + + /** An empty class array */ + public static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; + + /** DOCUMENT ME! */ + public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; + private static Log log = LogFactory.getLog(PageFactory.class); + + /** + * DOCUMENT ME! + * + * @param collection DOCUMENT ME! + * @param start DOCUMENT ME! + * @param size DOCUMENT ME! + * @param dtoBuilder DOCUMENT ME! + * + * @return DOCUMENT ME! + * + * @throws DTOCreateException DOCUMENT ME! + */ + public static Page buildPage(Collection collection, int start, int size, + DTOFactory dtoBuilder) throws DTOCreateException { + Page retVal = Page.EMPTY_PAGE; + int totalSize = collection.size(); + log.debug("[buildPage] Collection size = " + totalSize); + + if ((size == 0) || (totalSize == 0)) { + return retVal; + } else { + int returnArraySize = Math.min(size, totalSize - start); + + if (returnArraySize > 0) { + log.debug("[buildPage] Return size is " + returnArraySize); + + List dataObjects = new ArrayList(returnArraySize); + Object[] oa = new Object[returnArraySize]; + + System.arraycopy(collection.toArray(), start, oa, 0, + returnArraySize); + + log.debug("[buildPage] oa.lenght = " + oa.length); + + for (int i = 0; i < oa.length; i++) { + Object data; + data = dtoBuilder.getDTO(oa[i]); + dataObjects.add(data); + } + + log.trace("[buildPage] Before building return page"); + retVal = new Page(dataObjects, start, returnArraySize, totalSize); + log.trace("[buildPage] Finished building page"); + } + + return retVal; + } + } +} diff --git a/src/java/com/ejdoab/tcms/services/exceptions/CVS/Entries b/src/java/com/ejdoab/tcms/services/exceptions/CVS/Entries new file mode 100644 index 0000000..f9587a6 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/exceptions/CVS/Entries @@ -0,0 +1,2 @@ +/DuplicateEmailException.java/1.4/Sun Dec 21 21:26:42 2003/-kb/ +/NoSuchUserException.java/1.4/Sun Dec 21 21:26:42 2003/-kb/ diff --git a/src/java/com/ejdoab/tcms/services/exceptions/CVS/Repository b/src/java/com/ejdoab/tcms/services/exceptions/CVS/Repository new file mode 100644 index 0000000..6cd1c83 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/exceptions/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/services/exceptions diff --git a/src/java/com/ejdoab/tcms/services/exceptions/CVS/Root b/src/java/com/ejdoab/tcms/services/exceptions/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/exceptions/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/services/exceptions/DuplicateEmailException.java b/src/java/com/ejdoab/tcms/services/exceptions/DuplicateEmailException.java new file mode 100644 index 0000000..a5089ab --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/exceptions/DuplicateEmailException.java @@ -0,0 +1,27 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.exceptions; + + +/** + * @author Brian Sam-Bodden + */ +public class DuplicateEmailException extends Exception { + /** + * Constructor DuplicateEmailException. + * @param string + */ + public DuplicateEmailException(String message) { + super(message); + } +} diff --git a/src/java/com/ejdoab/tcms/services/exceptions/NoSuchUserException.java b/src/java/com/ejdoab/tcms/services/exceptions/NoSuchUserException.java new file mode 100644 index 0000000..867473f --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/exceptions/NoSuchUserException.java @@ -0,0 +1,39 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.exceptions; + + +/** + * @author Brian Sam-Bodden + */ +public class NoSuchUserException extends Exception { + private Exception rootCause; + + /** + * Constructor NoSuchUserException. + * @param string + */ + public NoSuchUserException(String message) { + super(message); + } + + /** + * Constructor NoSuchUserException. + * @param e + * @param string + */ + public NoSuchUserException(Exception e, String message) { + this(message); + rootCause = e; + } +} diff --git a/src/java/com/ejdoab/tcms/services/locator/CVS/Entries b/src/java/com/ejdoab/tcms/services/locator/CVS/Entries new file mode 100644 index 0000000..f41409e --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/locator/CVS/Entries @@ -0,0 +1,2 @@ +/ServiceLocator.java/1.9/Sun Dec 21 21:26:42 2003/-kb/ +/ServiceLocatorException.java/1.6/Sun Dec 21 21:26:42 2003/-kb/ diff --git a/src/java/com/ejdoab/tcms/services/locator/CVS/Repository b/src/java/com/ejdoab/tcms/services/locator/CVS/Repository new file mode 100644 index 0000000..2909791 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/locator/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/services/locator diff --git a/src/java/com/ejdoab/tcms/services/locator/CVS/Root b/src/java/com/ejdoab/tcms/services/locator/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/locator/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/services/locator/ServiceLocator.java b/src/java/com/ejdoab/tcms/services/locator/ServiceLocator.java new file mode 100644 index 0000000..943ace8 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/locator/ServiceLocator.java @@ -0,0 +1,308 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.locator; + +import java.net.*; + +import java.util.*; + +import javax.ejb.*; + +import javax.jms.*; + +import javax.naming.*; + +import javax.rmi.PortableRemoteObject; + +import javax.sql.DataSource; + + +/** + * @author Brian Sam-Bodden + */ +public class ServiceLocator { + private static ServiceLocator instance; + private InitialContext ic; + private Map dataSourceCache = null; + private Map queueConnectionFactoryCache = null; + private Map queueCache = null; + private Map localHomeCache = null; + + /** + * Constructor for ServiceLocator. + */ + private ServiceLocator() throws ServiceLocatorException { + try { + ic = new InitialContext(); + dataSourceCache = new HashMap(); + queueConnectionFactoryCache = new HashMap(); + queueCache = new HashMap(); + localHomeCache = new HashMap(); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + } + + /** + * Constructor for ServiceLocator passing environment configuration + * information. + */ + public ServiceLocator(Hashtable env) throws ServiceLocatorException { + try { + ic = new InitialContext(env); + dataSourceCache = new HashMap(); + queueConnectionFactoryCache = new HashMap(); + queueCache = new HashMap(); + localHomeCache = new HashMap(); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + } + + /** + * The ServiceLocator is implemented as a Singleton. The getInstance() + * method will return the static reference to the ServiceLocator stored + * inside of the ServiceLocator Class. + * + * @return + * @throws ServiceLocatorException + */ + public static ServiceLocator getInstance() throws ServiceLocatorException { + if (instance == null) { + instance = new ServiceLocator(); + } + + return instance; + } + + /** + * will get the ejb Remote home factory. + * clients need to cast to the type of EJBHome they desire + * @param jndiHomeName + * @return the EJB Home corresponding to the homeName + * @throws ServiceLocatorException + */ + public EJBLocalHome getLocalHome(String jndiHomeName) + throws ServiceLocatorException { + EJBLocalHome home = null; + + try { + Object obj = localHomeCache.get(jndiHomeName); + + if (obj == null) { + obj = ic.lookup(jndiHomeName); + localHomeCache.put(jndiHomeName, obj); + } + + home = (EJBLocalHome) obj; + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return home; + } + + /** + * will get the ejb Remote home factory. + * clients need to cast to the type of EJBHome they desire + * + * @param jndiHomeName + * @param className + * @return the EJB Home corresponding to the homeName* + * @throws ServiceLocatorException + */ + public EJBHome getRemoteHome(String jndiHomeName, Class className) + throws ServiceLocatorException { + EJBHome home = null; + + try { + Object objref = ic.lookup(jndiHomeName); + Object obj = PortableRemoteObject.narrow(objref, className); + home = (EJBHome) obj; + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return home; + } + + /** + * @param qConnFactoryName + * @return the factory for the factory to get queue connections from + * @throws ServiceLocatorException + */ + public QueueConnectionFactory getQueueConnectionFactory( + String qConnFactoryName) throws ServiceLocatorException { + QueueConnectionFactory factory = null; + + try { + factory = (QueueConnectionFactory) ic.lookup(qConnFactoryName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return factory; + } + + /** + * @param queueName + * @return the Queue Destination to send messages to + * @throws ServiceLocatorException + */ + public Queue getQueue(String queueName) throws ServiceLocatorException { + Queue queue = null; + + try { + queue = (Queue) ic.lookup(queueName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return queue; + } + + /** + * This method helps in obtaining the topic factory + * + * @param topicConnFactoryName + * @return the factory for the factory to get topic connections from + * @throws ServiceLocatorException + */ + public TopicConnectionFactory getTopicConnectionFactory( + String topicConnFactoryName) throws ServiceLocatorException { + TopicConnectionFactory factory = null; + + try { + factory = (TopicConnectionFactory) ic.lookup(topicConnFactoryName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return factory; + } + + /** + * This method obtains the topc itself for a caller + * + * @param topicName + * @return the Topic Destination to send messages to + * @throws ServiceLocatorException* + */ + public Topic getTopic(String topicName) throws ServiceLocatorException { + Topic topic = null; + + try { + topic = (Topic) ic.lookup(topicName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return topic; + } + + /** + * This method obtains the datasource itself for a caller + * + * @param dataSourceName + * @return the DataSource corresponding to the name parameter + * @throws ServiceLocatorException + */ + public DataSource getDataSource(String dataSourceName) + throws ServiceLocatorException { + DataSource dataSource = null; + + try { + dataSource = (DataSource) ic.lookup(dataSourceName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return dataSource; + } + + /** + * @param envName + * @return the URL value corresponding to the env entry name. + * @throws ServiceLocatorException + */ + public URL getUrl(String envName) throws ServiceLocatorException { + URL url = null; + + try { + url = (URL) ic.lookup(envName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return url; + } + + /** + * @param envName + * @return the boolean value corresponding to the env entry such as SEND_CONFIRMATION_MAIL property. + * @throws ServiceLocatorException + */ + public boolean getBoolean(String envName) throws ServiceLocatorException { + Boolean bool = null; + + try { + bool = (Boolean) ic.lookup(envName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return bool.booleanValue(); + } + + /** + * @param envName + * @return the String value corresponding + * to the env entry name. + * @throws ServiceLocatorException + */ + public String getString(String envName) throws ServiceLocatorException { + String envEntry = null; + + try { + envEntry = (String) ic.lookup(envName); + } catch (NamingException ne) { + throw new ServiceLocatorException(ne); + } catch (Exception e) { + throw new ServiceLocatorException(e); + } + + return envEntry; + } +} diff --git a/src/java/com/ejdoab/tcms/services/locator/ServiceLocatorException.java b/src/java/com/ejdoab/tcms/services/locator/ServiceLocatorException.java new file mode 100644 index 0000000..db015e9 --- /dev/null +++ b/src/java/com/ejdoab/tcms/services/locator/ServiceLocatorException.java @@ -0,0 +1,77 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.locator; + +import java.lang.Exception; + + +/** + * @author Brian Sam-Bodden + */ +public class ServiceLocatorException extends Exception { + private Exception wex; + + /** + * @param message the detail message. + * @param exception the wrapped exception. + */ + public ServiceLocatorException(String message, Exception exception) { + super(message); + wex = exception; + } + + /** + * @param exception the contained (wrapped) exception. + */ + public ServiceLocatorException(Exception exception) { + this(null, exception); + } + + /** + * @param message the detail message. + */ + public ServiceLocatorException(String message) { + this(message, null); + } + + /** + * @return the wrapped exception. + */ + public Exception getException() { + return wex; + } + + /** + * @return + */ + public Exception getRootCause() { + if (wex instanceof ServiceLocatorException) { + return ((ServiceLocatorException) wex).getRootCause(); + } + + return (wex == null) ? this : wex; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + if (wex instanceof ServiceLocatorException) { + return ((ServiceLocatorException) wex).toString(); + } + + return (wex == null) ? super.toString() : wex.toString(); + } +} diff --git a/src/java/com/ejdoab/tcms/util/Arrays.java b/src/java/com/ejdoab/tcms/util/Arrays.java new file mode 100644 index 0000000..2410c30 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/Arrays.java @@ -0,0 +1,43 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + + +/** + * @author Brian Sam-Bodden + */ +public class Arrays { + /** DOCUMENT ME! */ + public static final Object[] EMPTY_OBJECT_ARRAY = new Object[] { }; + + private Arrays() { + } + + /** + * DOCUMENT ME! + * + * @param array DOCUMENT ME! + * @param element DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static int getElementIndexIgnoreCase(String[] array, String element) { + for (int i = 0; i < array.length; i++) { + if (array[i].equalsIgnoreCase(element)) { + return i; + } + } + + return -1; + } +} diff --git a/src/java/com/ejdoab/tcms/util/CVS/Entries b/src/java/com/ejdoab/tcms/util/CVS/Entries new file mode 100644 index 0000000..ebd24c7 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/CVS/Entries @@ -0,0 +1,6 @@ +/Arrays.java/1.8/Tue Dec 30 13:53:22 2003/-kb/ +/Dates.java/1.8/Sun Dec 21 21:26:42 2003/-kb/ +/HoursAndMinutes.java/1.6/Sun Dec 21 21:26:42 2003/-kb/ +/JNDIResources.java/1.4/Sun Dec 21 21:26:42 2003/-kb/ +/NameValue.java/1.2/Sun Dec 21 21:26:42 2003// +/Validation.java/1.1/Sun Dec 21 21:26:42 2003// diff --git a/src/java/com/ejdoab/tcms/util/CVS/Repository b/src/java/com/ejdoab/tcms/util/CVS/Repository new file mode 100644 index 0000000..c4e8c81 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/util diff --git a/src/java/com/ejdoab/tcms/util/CVS/Root b/src/java/com/ejdoab/tcms/util/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/util/Dates.java b/src/java/com/ejdoab/tcms/util/Dates.java new file mode 100644 index 0000000..3fa81d2 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/Dates.java @@ -0,0 +1,244 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +import java.util.Calendar; +import java.util.Date; + + +/** + * @author Brian Sam-Bodden + */ +public class Dates { + /** DOCUMENT ME! */ + public static final int MILLIS_PER_HOUR = 1000 * 60 * 60; + + /** DOCUMENT ME! */ + public static final int MILLIS_PER_MINUTE = 1000 * 60; + private static Log log = LogFactory.getLog(Dates.class); + + /** DOCUMENT ME! */ + public static final String DATE_MMddyyyy = "MM-dd-yyyy"; + + /** + * DOCUMENT ME! + * + * @param dtBegin DOCUMENT ME! + * @param dtEnd DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static HoursAndMinutes calculateHoursAndMinutes(Date dtBegin, + Date dtEnd) { + long hours = 0; + long minutes = 0; + log.debug("[calculateHoursAndMinutes] dtBegin: " + dtBegin + + " dtEnd: " + dtEnd); + + if ((dtBegin != null) && (dtEnd != null)) { + long diffInMillis = dtEnd.getTime() - dtBegin.getTime(); + hours = diffInMillis / MILLIS_PER_HOUR; + minutes = (diffInMillis % MILLIS_PER_HOUR) * MILLIS_PER_MINUTE; + } + + return new HoursAndMinutes(hours, minutes); + } + + /** + * DOCUMENT ME! + * + * @param baseDate DOCUMENT ME! + * @param offset DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static Date getBefore(Date baseDate, HoursAndMinutes offset) { + long dateInMillis = baseDate.getTime() - offset.toMillis(); + Date date = new Date(dateInMillis); + + return date; + } + + /** + * DOCUMENT ME! + * + * @param baseDate DOCUMENT ME! + * @param offset DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static Date getAfter(Date baseDate, HoursAndMinutes offset) { + long dateInMillis = baseDate.getTime() + offset.toMillis(); + Date date = new Date(dateInMillis); + + return date; + } + + /** + * Format a date/time into a specific pattern. + * @param date the date to format expressed in milliseconds. + * @param pattern the pattern to use to format the date. + * @return the formatted date. + */ + public static String format(long date, String pattern) { + return format(new Date(date), pattern); + } + + /** + * Format a date/time into a specific pattern. + * @param date the date to format expressed in milliseconds. + * @param pattern the pattern to use to format the date. + * @return the formatted date. + */ + public static String format(Date date, String pattern) { + DateFormat df = createDateFormat(pattern); + + return df.format(date); + } + + /** + * return a lenient date format + * @param pattern the pattern used for date/time formatting. + * @return the configured format for this pattern. + */ + public static DateFormat createDateFormat(String pattern) { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + + return sdf; + } + + /** + * Method getDate + * + * Calendar is the preferred way to manipulate day and times in JDK1.2.X + * and greater. This functions uses a Calendar object to generate a valid + * Date object. + * Sets the values for the fields year, month, and date. + * Previous values of other fields are retained. If this is not desired, + * call clear first. + * + * @see Calendar.set(int, int, int) + * @param day + * @param year the value used to set the YEAR time field. + * @param month the value used to set the MONTH time field. + * @return a Date object for the parameters given + */ + public static Date getDate(int month, int day, int year) { + --month; // Month value is 0-based. e.g., 0 for January. + + Calendar cal = Calendar.getInstance(); + cal.clear(); + cal.set(year, month, day); + + return cal.getTime(); + } + + /** + * Method getDate + * + * Calendar is the preferred way to manipulate day and times in JDK1.2.X + * and greater. This functions uses a Calendar object to generate a valid + * Date object. + * Sets the values for the fields year, month, and date. + * Previous values of other fields are retained. If this is not desired, + * call clear first. + * month - the month between 1-12. + * date - the day of the month between 1-31. + * hrs - the hours between 0-23. + * min - the minutes between 0-59. + * sec - the seconds between 0-59. + * + * @see Calendar.set(int, int, int) + * @param day + * @param year the value used to set the YEAR time field. + * @param month the value used to set the MONTH time field. + * @param hour + * @param minute + * @param second + * @return a Date object for the parameters given + */ + public static Date getDate(int month, int day, int year, int hour, + int minute, int second) { + --month; // Month value is 0-based. e.g., 0 for January. + + Calendar cal = Calendar.getInstance(); + cal.clear(); + cal.set(Calendar.YEAR, year); + cal.set(Calendar.MONTH, month); + cal.set(Calendar.DAY_OF_MONTH, day); + cal.set(Calendar.HOUR_OF_DAY, hour); + cal.set(Calendar.MINUTE, minute); + cal.set(Calendar.SECOND, second); + + return cal.getTime(); + } + + /** + * @param dateStr + * @param format + * @return + */ + public static Date getDate(String dateStr, String format) { + DateFormat df = createDateFormat(format); + Date date = null; + + try { + date = df.parse(dateStr); + } catch (ParseException e) { + // do nothing null implies failure + } + + return date; + } + + /** + * Method isInFormat + * @param date + * @param formatString + * @return + */ + public static boolean isInFormat(String date, String formatString) { + try { + DateFormat format = new SimpleDateFormat(formatString); + format.setLenient(false); + format.parse(date); + + return (date.length() == formatString.length()); + } catch (Exception ex) { + return false; + } + } + + /** + * @param dateStr1 + * @param dateStr2 + * @param pattern + * @return + * @throws ParseException + */ + public static boolean before(String dateStr1, String dateStr2, + String pattern) throws ParseException { + DateFormat format = Dates.createDateFormat(pattern); + Date date1 = format.parse(dateStr1); + Date date2 = format.parse(dateStr2); + + return date1.before(date2); + } +} diff --git a/src/java/com/ejdoab/tcms/util/HoursAndMinutes.java b/src/java/com/ejdoab/tcms/util/HoursAndMinutes.java new file mode 100644 index 0000000..3bcfd87 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/HoursAndMinutes.java @@ -0,0 +1,80 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + +import java.io.Serializable; + + +/** + * Simple Value Object that Encapsulates a time representation in Hours and + * Minutes + * + * @author Brian Sam-Bodden + */ +public class HoursAndMinutes implements Serializable { + private long hours; + private long minutes; + + /** + * Creates a new HoursAndMinutes object. + * + * @param hours A long representing the hours + * @param minutes A long representing the minutes + */ + public HoursAndMinutes(long hours, long minutes) { + this.hours = hours; + this.minutes = minutes; + } + + /** + * @return the hours value + */ + public long getHours() { + return hours; + } + + /** + * @return the minutes value + */ + public long getMinutes() { + return minutes; + } + + /** + * Returns in milliseconds the value of the hours and + * minutes represented by this object + * + * @return long the hours and minutes in milliseconds + */ + public long toMillis() { + return (hours * Dates.MILLIS_PER_HOUR) + + (minutes * Dates.MILLIS_PER_MINUTE); + } + + /** + * Returns a string representation of this object + * in the format h H : m M where h represents the + * hours and m represents the minutes + * + * @return a String representing the hours and minutes + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + + if (hours > 0) { + sb.append(hours).append(" H").append(" : "); + } + + return sb.append(minutes).append(" M").toString(); + } +} diff --git a/src/java/com/ejdoab/tcms/util/JNDIResources.java b/src/java/com/ejdoab/tcms/util/JNDIResources.java new file mode 100644 index 0000000..ed8d0f6 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/JNDIResources.java @@ -0,0 +1,31 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + + +/** + * @author Brian Sam-Bodden + */ +public class JNDIResources { + /** DOCUMENT ME! */ + public static final String QUEUE_CONNECTION_FACTORY = "java:comp/env/jms/tcms/QueueConnectionFactory"; + + /** DOCUMENT ME! */ + public static final String EMAIL_SERVICE_QUEUE = "java:comp/env/jms/queue/tcms/mail"; + + /** DOCUMENT ME! */ + public static final String EMAIL_SESSION = "java:comp/env/mail/tcms/MailSession"; + + /** DOCUMENT ME! */ + public static final String DATASOURCE = "java:comp/env/jdbc/tcms"; +} diff --git a/src/java/com/ejdoab/tcms/util/NameValue.java b/src/java/com/ejdoab/tcms/util/NameValue.java new file mode 100644 index 0000000..6990c1e --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/NameValue.java @@ -0,0 +1,70 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + + +/** + * @author Brian Sam-Bodden + */ +public class NameValue { + String _name; + String _value; + + /** + * Creates a new NameValue object. + * + * @param name DOCUMENT ME! + * @param value DOCUMENT ME! + */ + public NameValue(String name, String value) { + _name = name; + _value = value; + } + + /** + * @return + */ + public String getName() { + return _name; + } + + /** + * @return + */ + public String getValue() { + return _value; + } + + /** + * @param string + */ + public void setName(String string) { + _name = string; + } + + /** + * @param string + */ + public void setValue(String string) { + _value = string; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String toString() { + return _name + " = " + _value; + } +} diff --git a/src/java/com/ejdoab/tcms/util/Validation.java b/src/java/com/ejdoab/tcms/util/Validation.java new file mode 100644 index 0000000..a70c229 --- /dev/null +++ b/src/java/com/ejdoab/tcms/util/Validation.java @@ -0,0 +1,35 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + +import org.apache.commons.validator.EmailValidator; + + +/** + * @author Brian Sam-Bodden + * package org.apache.commons.validator.EmailValidator (see) + */ +public class Validation { + private static EmailValidator emailValidator = EmailValidator.getInstance(); + + /** + * DOCUMENT ME! + * + * @param email DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public static boolean validateEmail(String email) { + return emailValidator.isValid(email); + } +} diff --git a/src/java/com/ejdoab/tcms/web/ApplicationResources.properties b/src/java/com/ejdoab/tcms/web/ApplicationResources.properties new file mode 100644 index 0000000..412cb7d --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/ApplicationResources.properties @@ -0,0 +1,30 @@ +errors.footer= +errors.header=

Validation Error

You must correct the following error(s) before proceeding: +errors.ioException=I/O exception rendering error messages: {0} +error.database.missing=
  • User database is missing, cannot validate logon credentials
  • +errors.required={0} is required. +errors.minlength={0} can not be less than {1} characters. +errors.maxlength={0} can not be greater than {1} characters. +errors.invalid={0} is invalid. +errors.byte={0} must be an byte. +errors.short={0} must be an short. +errors.integer={0} must be an integer. +errors.long={0} must be an long. +errors.float={0} must be an float. +errors.double={0} must be an double. +errors.date={0} is not a date. +errors.range={0} is not in the range {1} through {2}. +errors.creditcard={0} is not a valid credit card number. +errors.email={0} is an invalid e-mail address. + +firstname.label=First Name +lastname.label=Last Name +email.label=Email +password.label=Password +street.label=Street +city.label=City +state.label=State +zip.label=Zip + +error.register.duplicate=Somebody has already registered with that email address. +error.unknown=An unknown error has occured. \ No newline at end of file diff --git a/src/java/com/ejdoab/tcms/web/CVS/Entries b/src/java/com/ejdoab/tcms/web/CVS/Entries new file mode 100644 index 0000000..59ee165 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/CVS/Entries @@ -0,0 +1,3 @@ +/ApplicationResources.properties/1.3/Sat Jan 3 16:10:30 2004// +D/actions//// +D/forms//// diff --git a/src/java/com/ejdoab/tcms/web/CVS/Repository b/src/java/com/ejdoab/tcms/web/CVS/Repository new file mode 100644 index 0000000..d6a69ce --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/web diff --git a/src/java/com/ejdoab/tcms/web/CVS/Root b/src/java/com/ejdoab/tcms/web/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/web/actions/CVS/Entries b/src/java/com/ejdoab/tcms/web/actions/CVS/Entries new file mode 100644 index 0000000..6398729 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/CVS/Entries @@ -0,0 +1,6 @@ +/ListSessionsAction.java/1.7/Fri Jan 2 18:21:18 2004// +/ListSpeakersAction.java/1.3/Tue Dec 23 21:34:10 2003// +/SessionByPresenterAction.java/1.1/Tue Dec 23 21:54:47 2003// +/SubmitAbstract.java/1.1/Sun Dec 21 21:26:42 2003// +/SubmitPresenterAction.java/1.2/Fri Jan 2 20:57:30 2004// +/SubmitRegistrationAction.java/1.1/Sat Jan 3 15:32:23 2004// diff --git a/src/java/com/ejdoab/tcms/web/actions/CVS/Repository b/src/java/com/ejdoab/tcms/web/actions/CVS/Repository new file mode 100644 index 0000000..5d2328c --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/web/actions diff --git a/src/java/com/ejdoab/tcms/web/actions/CVS/Root b/src/java/com/ejdoab/tcms/web/actions/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/web/actions/ListSessionsAction.java b/src/java/com/ejdoab/tcms/web/actions/ListSessionsAction.java new file mode 100644 index 0000000..5019eb9 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/ListSessionsAction.java @@ -0,0 +1,58 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.web.actions; + +import com.ejdoab.tcms.services.ConferenceServicesLocal; +import com.ejdoab.tcms.services.ConferenceServicesLocalHome; +import com.ejdoab.tcms.services.ConferenceServicesUtil; +import com.ejdoab.tcms.services.dto.page.Page; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * List conference sessions. + * @author cjudd + */ +public class ListSessionsAction extends Action { + /* (non-Javadoc) + * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + ConferenceServicesLocalHome csHome = ConferenceServicesUtil.getLocalHome(); + ConferenceServicesLocal cs = csHome.create(); + + //todo: Change to use variable count after page is fixed + Page page = cs.getSessions(0, 1000); + List sessions = new ArrayList(); + + while (page.hasNext()) { + sessions.add(page.next()); + } + + request.setAttribute("sessions", sessions); + + return (mapping.findForward("success")); + } +} diff --git a/src/java/com/ejdoab/tcms/web/actions/ListSpeakersAction.java b/src/java/com/ejdoab/tcms/web/actions/ListSpeakersAction.java new file mode 100644 index 0000000..37f9379 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/ListSpeakersAction.java @@ -0,0 +1,42 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.web.actions; + +import com.ejdoab.tcms.services.*; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * Class lists all conference speakers. + * @author cjudd + */ +public class ListSpeakersAction extends Action { + /* (non-Javadoc) + * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + ConferenceServicesLocalHome csHome = ConferenceServicesUtil.getLocalHome(); + ConferenceServicesLocal cs = csHome.create(); + + return (mapping.findForward("success")); + } +} diff --git a/src/java/com/ejdoab/tcms/web/actions/SessionByPresenterAction.java b/src/java/com/ejdoab/tcms/web/actions/SessionByPresenterAction.java new file mode 100644 index 0000000..0344bdb --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/SessionByPresenterAction.java @@ -0,0 +1,79 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +/* + * Created on Dec 23, 2003 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package com.ejdoab.tcms.web.actions; + +import com.ejdoab.tcms.entities.PresenterLocal; +import com.ejdoab.tcms.services.*; +import com.ejdoab.tcms.services.dto.*; +import com.ejdoab.tcms.services.dto.page.*; + +import org.apache.struts.action.*; + +import java.util.*; + +import javax.servlet.http.*; + + +/** + * List sessions by presenter + * @author cjudd + */ +public class SessionByPresenterAction extends Action { + /** + * List sessions by presenters + * + * @param mapping Action Mapping + * @param form Action Form + * @param request Http Request + * @param response Http Response + * + * @return forward + * + * @throws Exception Any possible exception + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + ConferenceServicesLocalHome csHome = ConferenceServicesUtil.getLocalHome(); + ConferenceServicesLocal cs = csHome.create(); + + UserServicesLocalHome usHome = UserServicesUtil.getLocalHome(); + UserServicesLocal us = usHome.create(); + + String email = request.getParameter("presenter"); + + PresenterLocal pl = us.findPresenterByEmail(email); + + UserProfileDTOFactory upf = new UserProfileDTOFactory(); + DTO presenterDTO = upf.getDTO(pl); + + request.setAttribute("presenter", presenterDTO); + + Page page = cs.getSessionsByPresenter(email, 0, 16); + List sessions = new ArrayList(); + + while (page.hasNext()) { + sessions.add(page.next()); + } + + request.setAttribute("sessions", sessions); + + return (mapping.findForward("success")); + } +} diff --git a/src/java/com/ejdoab/tcms/web/actions/SubmitAbstract.java b/src/java/com/ejdoab/tcms/web/actions/SubmitAbstract.java new file mode 100644 index 0000000..91eefa4 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/SubmitAbstract.java @@ -0,0 +1,37 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.web.actions; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * @author cjudd + */ +public class SubmitAbstract extends Action { + /* (non-Javadoc) + * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + // TODO Auto-generated method stub + return (mapping.findForward("success")); + } +} diff --git a/src/java/com/ejdoab/tcms/web/actions/SubmitPresenterAction.java b/src/java/com/ejdoab/tcms/web/actions/SubmitPresenterAction.java new file mode 100644 index 0000000..c429bd5 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/SubmitPresenterAction.java @@ -0,0 +1,79 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.web.actions; + +import com.ejdoab.tcms.services.*; +import com.ejdoab.tcms.services.dto.*; +import com.ejdoab.tcms.services.exceptions.*; + +import org.apache.struts.Globals; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * @author cjudd + */ +public class SubmitPresenterAction extends Action { + /* (non-Javadoc) + * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + ActionErrors errors = new ActionErrors(); + DynaActionForm df = (DynaActionForm) form; + + UserServicesHome uslh = UserServicesUtil.getHome(); + UserServices us = uslh.create(); + + UserProfileDTO presenter = new UserProfileDTO(); + + try { + presenter.setUserType(UserProfileDTO.UserType.PRESENTER); + presenter.setPassword((String) df.get("password")); + presenter.setFirstName((String) df.get("firstname")); + presenter.setLastName((String) df.get("lastname")); + presenter.setEmail((String) df.get("email")); + presenter.setHomePhone((String) df.get("homephone")); + presenter.setWorkPhone((String) df.get("workphone")); + presenter.setFax((String) df.get("fax")); + + presenter.setAddressStreet((String) df.get("street")); + presenter.setAddressCity((String) df.get("city")); + presenter.setAddressState((String) df.get("state")); + presenter.setAddressZipCode((String) df.get("zip")); + + us.registerUser(presenter); + } catch (DuplicateEmailException ex) { + errors.add(ActionErrors.GLOBAL_ERROR, + new ActionError("error.register.duplicate")); + } + + if (errors.isEmpty()) { + return (mapping.findForward("success")); + } else { + request.setAttribute(Globals.ERROR_KEY, errors); + + return (mapping.findForward("failure")); + } + } +} diff --git a/src/java/com/ejdoab/tcms/web/actions/SubmitRegistrationAction.java b/src/java/com/ejdoab/tcms/web/actions/SubmitRegistrationAction.java new file mode 100644 index 0000000..ec343a6 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/actions/SubmitRegistrationAction.java @@ -0,0 +1,79 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.web.actions; + +import com.ejdoab.tcms.services.*; +import com.ejdoab.tcms.services.dto.*; +import com.ejdoab.tcms.services.exceptions.*; +import com.ejdoab.tcms.web.forms.*; + +import org.apache.struts.Globals; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionError; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * @author cjudd + */ +public class SubmitRegistrationAction extends Action { + /* (non-Javadoc) + * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + ActionErrors errors = new ActionErrors(); + RegistrationForm rf = (RegistrationForm) form; + + UserServicesHome uslh = UserServicesUtil.getHome(); + UserServices us = uslh.create(); + + UserProfileDTO attendee = new UserProfileDTO(); + + try { + attendee.setUserType(UserProfileDTO.UserType.ATTENDEE); + attendee.setPassword(rf.getPassword()); + attendee.setFirstName(rf.getFirstname()); + attendee.setLastName(rf.getLastname()); + attendee.setEmail(rf.getEmail()); + attendee.setHomePhone(rf.getHomephone()); + attendee.setWorkPhone(rf.getWorkphone()); + attendee.setFax(rf.getFax()); + + attendee.setAddressStreet(rf.getStreet()); + attendee.setAddressCity(rf.getCity()); + attendee.setAddressState(rf.getState()); + attendee.setAddressZipCode(rf.getZip()); + + us.registerUser(attendee); + } catch (DuplicateEmailException ex) { + errors.add(ActionErrors.GLOBAL_ERROR, + new ActionError("error.register.duplicate")); + } + + if (errors.isEmpty()) { + return (mapping.findForward("success")); + } else { + request.setAttribute(Globals.ERROR_KEY, errors); + + return (mapping.findForward("failure")); + } + } +} diff --git a/src/java/com/ejdoab/tcms/web/forms/CVS/Entries b/src/java/com/ejdoab/tcms/web/forms/CVS/Entries new file mode 100644 index 0000000..75bcc08 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/forms/CVS/Entries @@ -0,0 +1 @@ +/RegistrationForm.java/1.2/Sun Jan 4 20:57:02 2004// diff --git a/src/java/com/ejdoab/tcms/web/forms/CVS/Repository b/src/java/com/ejdoab/tcms/web/forms/CVS/Repository new file mode 100644 index 0000000..b4e7e9b --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/forms/CVS/Repository @@ -0,0 +1 @@ +tcms/src/java/com/ejdoab/tcms/web/forms diff --git a/src/java/com/ejdoab/tcms/web/forms/CVS/Root b/src/java/com/ejdoab/tcms/web/forms/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/forms/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/java/com/ejdoab/tcms/web/forms/RegistrationForm.java b/src/java/com/ejdoab/tcms/web/forms/RegistrationForm.java new file mode 100644 index 0000000..ef02635 --- /dev/null +++ b/src/java/com/ejdoab/tcms/web/forms/RegistrationForm.java @@ -0,0 +1,233 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.web.forms; + +import org.apache.struts.validator.*; + + +/** + * Registration Form + * + * @author cjudd + */ +public class RegistrationForm extends ValidatorForm { + private String city; + private String email; + private String fax; + private String firstname; + private String homephone; + private String lastname; + private String password; + private String state; + private String street; + private String workphone; + private String zip; + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getCity() { + return city; + } + + /** + * DOCUMENT ME! + * + * @param city DOCUMENT ME! + */ + public void setCity(String city) { + this.city = city; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getEmail() { + return email; + } + + /** + * DOCUMENT ME! + * + * @param email DOCUMENT ME! + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getFax() { + return fax; + } + + /** + * DOCUMENT ME! + * + * @param fax DOCUMENT ME! + */ + public void setFax(String fax) { + this.fax = fax; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getFirstname() { + return firstname; + } + + /** + * DOCUMENT ME! + * + * @param firstname DOCUMENT ME! + */ + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getHomephone() { + return homephone; + } + + /** + * DOCUMENT ME! + * + * @param homephone DOCUMENT ME! + */ + public void setHomephone(String homephone) { + this.homephone = homephone; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getLastname() { + return lastname; + } + + /** + * DOCUMENT ME! + * + * @param lastname DOCUMENT ME! + */ + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getPassword() { + return password; + } + + /** + * DOCUMENT ME! + * + * @param password DOCUMENT ME! + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getState() { + return state; + } + + /** + * DOCUMENT ME! + * + * @param state DOCUMENT ME! + */ + public void setState(String state) { + this.state = state; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getStreet() { + return street; + } + + /** + * DOCUMENT ME! + * + * @param street DOCUMENT ME! + */ + public void setStreet(String street) { + this.street = street; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getWorkphone() { + return workphone; + } + + /** + * DOCUMENT ME! + * + * @param workphone DOCUMENT ME! + */ + public void setWorkphone(String workphone) { + this.workphone = workphone; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String getZip() { + return zip; + } + + /** + * DOCUMENT ME! + * + * @param zip DOCUMENT ME! + */ + public void setZip(String zip) { + this.zip = zip; + } +} diff --git a/src/java/com/ejdoab/tcms/ws/News.java b/src/java/com/ejdoab/tcms/ws/News.java new file mode 100644 index 0000000..1d272fe --- /dev/null +++ b/src/java/com/ejdoab/tcms/ws/News.java @@ -0,0 +1,67 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.ws; + +import com.ejdoab.tcms.services.*; +import com.ejdoab.tcms.services.dto.*; +import com.ejdoab.tcms.services.dto.page.*; + +import java.rmi.*; + +import java.util.*; + + +/** + * Web service for getting news. + * @author cjudd + */ +public class News { + /** + * Gets all current news items + * + * @return An array of news items + * + * @throws RemoteException Any possible exception. + */ + public NewsItemDTO[] getNews() throws RemoteException { + try { + Calendar currentCalendar = Calendar.getInstance(); + Calendar newsCalendar = Calendar.getInstance(); + List currentNews = new ArrayList(); + ConferenceServicesLocalHome cslh = ConferenceServicesUtil.getLocalHome(); + ConferenceServicesLocal csl = cslh.create(); + Page page = csl.getNews(0, csl.getNewsCount()); + + while (page.hasNext()) { + NewsItemDTO item = (NewsItemDTO) page.next(); + + newsCalendar.setTime(item.getRemovedate()); + + if (item.isPublished() && currentCalendar.before(newsCalendar)) { + currentNews.add(item); + } + } + + NewsItemDTO[] items = new NewsItemDTO[currentNews.size()]; + int i = 0; + + for (Iterator iter = currentNews.iterator(); iter.hasNext(); i++) { + items[i] = (NewsItemDTO) iter.next(); + } + + return items; + } catch (Exception ex) { + throw new RemoteException(ex.getMessage(), ex); + } + } +} diff --git a/src/java/read-me.txt b/src/java/read-me.txt new file mode 100644 index 0000000..117d28f --- /dev/null +++ b/src/java/read-me.txt @@ -0,0 +1,2 @@ +Directory: src/java +Contents: location of all source code (hand-coded and middlegen generated). \ No newline at end of file diff --git a/src/middlegen/CVS/Entries b/src/middlegen/CVS/Entries new file mode 100644 index 0000000..f8ce599 --- /dev/null +++ b/src/middlegen/CVS/Entries @@ -0,0 +1,3 @@ +D/merge//// +/read-me.txt/1.1/Mon Jun 2 17:34:03 2003// +/tcms-prefs.properties/1.5/Sat Jan 24 15:24:58 2004// diff --git a/src/middlegen/CVS/Repository b/src/middlegen/CVS/Repository new file mode 100644 index 0000000..627e753 --- /dev/null +++ b/src/middlegen/CVS/Repository @@ -0,0 +1 @@ +tcms/src/middlegen diff --git a/src/middlegen/CVS/Root b/src/middlegen/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/middlegen/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/middlegen/merge/CVS/Entries b/src/middlegen/merge/CVS/Entries new file mode 100644 index 0000000..c5847a6 --- /dev/null +++ b/src/middlegen/merge/CVS/Entries @@ -0,0 +1 @@ +/cmp20-ALL-class-comments.txt/1.1/Mon Jun 2 17:34:21 2003// diff --git a/src/middlegen/merge/CVS/Repository b/src/middlegen/merge/CVS/Repository new file mode 100644 index 0000000..2999f6c --- /dev/null +++ b/src/middlegen/merge/CVS/Repository @@ -0,0 +1 @@ +tcms/src/middlegen/merge diff --git a/src/middlegen/merge/CVS/Root b/src/middlegen/merge/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/middlegen/merge/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/middlegen/merge/cmp20-ALL-class-comments.txt b/src/middlegen/merge/cmp20-ALL-class-comments.txt new file mode 100644 index 0000000..d32f55a --- /dev/null +++ b/src/middlegen/merge/cmp20-ALL-class-comments.txt @@ -0,0 +1,3 @@ + * A TCMS domain entity for table: ${table.sqlName} + * Generated by Middlegen CMP2.0 Plugin + * diff --git a/src/middlegen/read-me.txt b/src/middlegen/read-me.txt new file mode 100644 index 0000000..6650ab9 --- /dev/null +++ b/src/middlegen/read-me.txt @@ -0,0 +1,2 @@ +Directory: src/middlegen-prefs +Contents: location of the middlegen modifications made via the middlegen gui. \ No newline at end of file diff --git a/src/middlegen/tcms-prefs.properties b/src/middlegen/tcms-prefs.properties new file mode 100644 index 0000000..8bcc9d1 --- /dev/null +++ b/src/middlegen/tcms-prefs.properties @@ -0,0 +1,981 @@ +# Middlegen Preferences +cmp20.tables.ABSTRACTS.base-class-name=ConferenceAbstract +cmp20.tables.ABSTRACTS.columns.BODY.java-name=body +cmp20.tables.ABSTRACTS.columns.BODY.java-type=java.lang.String +cmp20.tables.ABSTRACTS.columns.BODY.local-get=true +cmp20.tables.ABSTRACTS.columns.BODY.local-set=true +cmp20.tables.ABSTRACTS.columns.BODY.remote-get=false +cmp20.tables.ABSTRACTS.columns.BODY.remote-set=false +cmp20.tables.ABSTRACTS.columns.FK_PRESENTERID.java-name=fkPresenterid +cmp20.tables.ABSTRACTS.columns.FK_PRESENTERID.java-type=int +cmp20.tables.ABSTRACTS.columns.FK_PRESENTERID.local-get=false +cmp20.tables.ABSTRACTS.columns.FK_PRESENTERID.local-set=false +cmp20.tables.ABSTRACTS.columns.FK_PRESENTERID.remote-get=false +cmp20.tables.ABSTRACTS.columns.FK_PRESENTERID.remote-set=false +cmp20.tables.ABSTRACTS.columns.FK_STATUS.java-name=status +cmp20.tables.ABSTRACTS.columns.FK_STATUS.java-type=java.lang.String +cmp20.tables.ABSTRACTS.columns.FK_STATUS.local-get=false +cmp20.tables.ABSTRACTS.columns.FK_STATUS.local-set=false +cmp20.tables.ABSTRACTS.columns.FK_STATUS.remote-get=false +cmp20.tables.ABSTRACTS.columns.FK_STATUS.remote-set=false +cmp20.tables.ABSTRACTS.columns.LEVEL.java-name=level +cmp20.tables.ABSTRACTS.columns.LEVEL.java-type=int +cmp20.tables.ABSTRACTS.columns.LEVEL.local-get=true +cmp20.tables.ABSTRACTS.columns.LEVEL.local-set=true +cmp20.tables.ABSTRACTS.columns.LEVEL.remote-get=false +cmp20.tables.ABSTRACTS.columns.LEVEL.remote-set=false +cmp20.tables.ABSTRACTS.columns.PK_ID.java-name=id +cmp20.tables.ABSTRACTS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ABSTRACTS.columns.PK_ID.local-get=true +cmp20.tables.ABSTRACTS.columns.PK_ID.local-set=false +cmp20.tables.ABSTRACTS.columns.PK_ID.remote-get=false +cmp20.tables.ABSTRACTS.columns.PK_ID.remote-set=false +cmp20.tables.ABSTRACTS.columns.STATUS.java-name=status +cmp20.tables.ABSTRACTS.columns.STATUS.java-type=int +cmp20.tables.ABSTRACTS.columns.STATUS.local-get=true +cmp20.tables.ABSTRACTS.columns.STATUS.local-set=true +cmp20.tables.ABSTRACTS.columns.STATUS.remote-get=false +cmp20.tables.ABSTRACTS.columns.STATUS.remote-set=false +cmp20.tables.ABSTRACTS.columns.TITLE.java-name=title +cmp20.tables.ABSTRACTS.columns.TITLE.java-type=java.lang.String +cmp20.tables.ABSTRACTS.columns.TITLE.local-get=true +cmp20.tables.ABSTRACTS.columns.TITLE.local-set=true +cmp20.tables.ABSTRACTS.columns.TITLE.remote-get=false +cmp20.tables.ABSTRACTS.columns.TITLE.remote-set=false +cmp20.tables.ABSTRACTS.columns.TOPIC.java-name=topic +cmp20.tables.ABSTRACTS.columns.TOPIC.java-type=int +cmp20.tables.ABSTRACTS.columns.TOPIC.local-get=true +cmp20.tables.ABSTRACTS.columns.TOPIC.local-set=true +cmp20.tables.ABSTRACTS.columns.TOPIC.remote-get=false +cmp20.tables.ABSTRACTS.columns.TOPIC.remote-set=false +cmp20.tables.ABSTRACTS.columns.TYPE.java-name=type +cmp20.tables.ABSTRACTS.columns.TYPE.java-type=int +cmp20.tables.ABSTRACTS.columns.TYPE.local-get=true +cmp20.tables.ABSTRACTS.columns.TYPE.local-set=true +cmp20.tables.ABSTRACTS.columns.TYPE.remote-get=false +cmp20.tables.ABSTRACTS.columns.TYPE.remote-set=false +cmp20.tables.ABSTRACTS.generate-pk-class=false +cmp20.tables.ABSTRACTSTATUS.base-class-name=ConferenceAbstractStatus +cmp20.tables.ABSTRACTSTATUS.columns.NAME.java-name=name +cmp20.tables.ABSTRACTSTATUS.columns.NAME.java-type=java.lang.String +cmp20.tables.ABSTRACTSTATUS.columns.NAME.local-get=true +cmp20.tables.ABSTRACTSTATUS.columns.NAME.local-set=true +cmp20.tables.ABSTRACTSTATUS.columns.NAME.remote-get=false +cmp20.tables.ABSTRACTSTATUS.columns.NAME.remote-set=false +cmp20.tables.ABSTRACTSTATUS.columns.PK_ID.java-name=id +cmp20.tables.ABSTRACTSTATUS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ABSTRACTSTATUS.columns.PK_ID.local-get=true +cmp20.tables.ABSTRACTSTATUS.columns.PK_ID.local-set=false +cmp20.tables.ABSTRACTSTATUS.columns.PK_ID.remote-get=false +cmp20.tables.ABSTRACTSTATUS.columns.PK_ID.remote-set=false +cmp20.tables.ABSTRACTSTATUS.columns.PK_NAME.java-name=name +cmp20.tables.ABSTRACTSTATUS.columns.PK_NAME.java-type=java.lang.String +cmp20.tables.ABSTRACTSTATUS.columns.PK_NAME.local-get=true +cmp20.tables.ABSTRACTSTATUS.columns.PK_NAME.local-set=false +cmp20.tables.ABSTRACTSTATUS.columns.PK_NAME.remote-get=false +cmp20.tables.ABSTRACTSTATUS.columns.PK_NAME.remote-set=false +cmp20.tables.ABSTRACTSTATUS.generate-pk-class=false +cmp20.tables.ADDRESSES.base-class-name=Address +cmp20.tables.ADDRESSES.columns.APTNUMBER.java-name=aptNumber +cmp20.tables.ADDRESSES.columns.APTNUMBER.java-type=java.lang.String +cmp20.tables.ADDRESSES.columns.APTNUMBER.local-get=true +cmp20.tables.ADDRESSES.columns.APTNUMBER.local-set=true +cmp20.tables.ADDRESSES.columns.APTNUMBER.remote-get=false +cmp20.tables.ADDRESSES.columns.APTNUMBER.remote-set=false +cmp20.tables.ADDRESSES.columns.CITY.java-name=city +cmp20.tables.ADDRESSES.columns.CITY.java-type=java.lang.String +cmp20.tables.ADDRESSES.columns.CITY.local-get=true +cmp20.tables.ADDRESSES.columns.CITY.local-set=true +cmp20.tables.ADDRESSES.columns.CITY.remote-get=false +cmp20.tables.ADDRESSES.columns.CITY.remote-set=false +cmp20.tables.ADDRESSES.columns.PK_ID.java-name=id +cmp20.tables.ADDRESSES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ADDRESSES.columns.PK_ID.local-get=true +cmp20.tables.ADDRESSES.columns.PK_ID.local-set=false +cmp20.tables.ADDRESSES.columns.PK_ID.remote-get=false +cmp20.tables.ADDRESSES.columns.PK_ID.remote-set=false +cmp20.tables.ADDRESSES.columns.STATE.java-name=state +cmp20.tables.ADDRESSES.columns.STATE.java-type=java.lang.String +cmp20.tables.ADDRESSES.columns.STATE.local-get=true +cmp20.tables.ADDRESSES.columns.STATE.local-set=true +cmp20.tables.ADDRESSES.columns.STATE.remote-get=false +cmp20.tables.ADDRESSES.columns.STATE.remote-set=false +cmp20.tables.ADDRESSES.columns.STREETADDRESS.java-name=streetAddress +cmp20.tables.ADDRESSES.columns.STREETADDRESS.java-type=java.lang.String +cmp20.tables.ADDRESSES.columns.STREETADDRESS.local-get=true +cmp20.tables.ADDRESSES.columns.STREETADDRESS.local-set=true +cmp20.tables.ADDRESSES.columns.STREETADDRESS.remote-get=false +cmp20.tables.ADDRESSES.columns.STREETADDRESS.remote-set=false +cmp20.tables.ADDRESSES.columns.ZIPCODE.java-name=zipCode +cmp20.tables.ADDRESSES.columns.ZIPCODE.java-type=java.lang.String +cmp20.tables.ADDRESSES.columns.ZIPCODE.local-get=true +cmp20.tables.ADDRESSES.columns.ZIPCODE.local-set=true +cmp20.tables.ADDRESSES.columns.ZIPCODE.remote-get=false +cmp20.tables.ADDRESSES.columns.ZIPCODE.remote-set=false +cmp20.tables.ADDRESSES.generate-pk-class=false +cmp20.tables.ANSWERS.base-class-name=Answer +cmp20.tables.ANSWERS.columns.FK_QUESTIONNAIREID.java-name=questionnaireId +cmp20.tables.ANSWERS.columns.FK_QUESTIONNAIREID.java-type=int +cmp20.tables.ANSWERS.columns.FK_QUESTIONNAIREID.local-get=false +cmp20.tables.ANSWERS.columns.FK_QUESTIONNAIREID.local-set=false +cmp20.tables.ANSWERS.columns.FK_QUESTIONNAIREID.remote-get=false +cmp20.tables.ANSWERS.columns.FK_QUESTIONNAIREID.remote-set=false +cmp20.tables.ANSWERS.columns.FK_USERID.java-name=userId +cmp20.tables.ANSWERS.columns.FK_USERID.java-type=int +cmp20.tables.ANSWERS.columns.FK_USERID.local-get=false +cmp20.tables.ANSWERS.columns.FK_USERID.local-set=false +cmp20.tables.ANSWERS.columns.FK_USERID.remote-get=false +cmp20.tables.ANSWERS.columns.FK_USERID.remote-set=false +cmp20.tables.ANSWERS.columns.PK_ID.java-name=id +cmp20.tables.ANSWERS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ANSWERS.columns.PK_ID.local-get=true +cmp20.tables.ANSWERS.columns.PK_ID.local-set=false +cmp20.tables.ANSWERS.columns.PK_ID.remote-get=false +cmp20.tables.ANSWERS.columns.PK_ID.remote-set=false +cmp20.tables.ANSWERS.generate-pk-class=false +cmp20.tables.ATTENDEES.base-class-name=Attendee +cmp20.tables.ATTENDEES.columns.FK_USERID.java-name=userId +cmp20.tables.ATTENDEES.columns.FK_USERID.java-type=int +cmp20.tables.ATTENDEES.columns.FK_USERID.local-get=false +cmp20.tables.ATTENDEES.columns.FK_USERID.local-set=false +cmp20.tables.ATTENDEES.columns.FK_USERID.remote-get=false +cmp20.tables.ATTENDEES.columns.FK_USERID.remote-set=false +cmp20.tables.ATTENDEES.columns.PK_ID.java-name=id +cmp20.tables.ATTENDEES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ATTENDEES.columns.PK_ID.local-get=true +cmp20.tables.ATTENDEES.columns.PK_ID.local-set=false +cmp20.tables.ATTENDEES.columns.PK_ID.remote-get=false +cmp20.tables.ATTENDEES.columns.PK_ID.remote-set=false +cmp20.tables.ATTENDEES.generate-pk-class=false +cmp20.tables.BOOTHS.base-class-name=Booth +cmp20.tables.BOOTHS.columns.FK_VENUEID.java-name=venueId +cmp20.tables.BOOTHS.columns.FK_VENUEID.java-type=int +cmp20.tables.BOOTHS.columns.FK_VENUEID.local-get=false +cmp20.tables.BOOTHS.columns.FK_VENUEID.local-set=false +cmp20.tables.BOOTHS.columns.FK_VENUEID.remote-get=false +cmp20.tables.BOOTHS.columns.FK_VENUEID.remote-set=false +cmp20.tables.BOOTHS.columns.NOTES.java-name=notes +cmp20.tables.BOOTHS.columns.NOTES.java-type=java.lang.String +cmp20.tables.BOOTHS.columns.NOTES.local-get=true +cmp20.tables.BOOTHS.columns.NOTES.local-set=true +cmp20.tables.BOOTHS.columns.NOTES.remote-get=false +cmp20.tables.BOOTHS.columns.NOTES.remote-set=false +cmp20.tables.BOOTHS.columns.PK_ID.java-name=id +cmp20.tables.BOOTHS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.BOOTHS.columns.PK_ID.local-get=true +cmp20.tables.BOOTHS.columns.PK_ID.local-set=false +cmp20.tables.BOOTHS.columns.PK_ID.remote-get=false +cmp20.tables.BOOTHS.columns.PK_ID.remote-set=false +cmp20.tables.BOOTHS.columns.SIZE.java-name=size +cmp20.tables.BOOTHS.columns.SIZE.java-type=java.lang.String +cmp20.tables.BOOTHS.columns.SIZE.local-get=true +cmp20.tables.BOOTHS.columns.SIZE.local-set=true +cmp20.tables.BOOTHS.columns.SIZE.remote-get=false +cmp20.tables.BOOTHS.columns.SIZE.remote-set=false +cmp20.tables.BOOTHS.generate-pk-class=false +cmp20.tables.CONFERENCES.base-class-name=Conference +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONENDDATE.java-name=abstractSubmissionEndDate +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONENDDATE.java-type=java.util.Date +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONENDDATE.local-get=true +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONENDDATE.local-set=true +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONENDDATE.remote-get=false +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONENDDATE.remote-set=false +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONSTARTDATE.java-name=abstractSubmissionStartDate +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONSTARTDATE.java-type=java.util.Date +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONSTARTDATE.local-get=true +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONSTARTDATE.local-set=true +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONSTARTDATE.remote-get=false +cmp20.tables.CONFERENCES.columns.ABSTRACTSUBMISSIONSTARTDATE.remote-set=false +cmp20.tables.CONFERENCES.columns.DESCRIPTION.java-name=description +cmp20.tables.CONFERENCES.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.CONFERENCES.columns.DESCRIPTION.local-get=true +cmp20.tables.CONFERENCES.columns.DESCRIPTION.local-set=true +cmp20.tables.CONFERENCES.columns.DESCRIPTION.remote-get=false +cmp20.tables.CONFERENCES.columns.DESCRIPTION.remote-set=false +cmp20.tables.CONFERENCES.columns.ENDDATE.java-name=endDate +cmp20.tables.CONFERENCES.columns.ENDDATE.java-type=java.util.Date +cmp20.tables.CONFERENCES.columns.ENDDATE.local-get=true +cmp20.tables.CONFERENCES.columns.ENDDATE.local-set=true +cmp20.tables.CONFERENCES.columns.ENDDATE.remote-get=false +cmp20.tables.CONFERENCES.columns.ENDDATE.remote-set=false +cmp20.tables.CONFERENCES.columns.FK_VENUEID.java-name=venueId +cmp20.tables.CONFERENCES.columns.FK_VENUEID.java-type=int +cmp20.tables.CONFERENCES.columns.FK_VENUEID.local-get=false +cmp20.tables.CONFERENCES.columns.FK_VENUEID.local-set=false +cmp20.tables.CONFERENCES.columns.FK_VENUEID.remote-get=false +cmp20.tables.CONFERENCES.columns.FK_VENUEID.remote-set=false +cmp20.tables.CONFERENCES.columns.NAME.java-name=name +cmp20.tables.CONFERENCES.columns.NAME.java-type=java.lang.String +cmp20.tables.CONFERENCES.columns.NAME.local-get=true +cmp20.tables.CONFERENCES.columns.NAME.local-set=true +cmp20.tables.CONFERENCES.columns.NAME.remote-get=false +cmp20.tables.CONFERENCES.columns.NAME.remote-set=false +cmp20.tables.CONFERENCES.columns.PK_ID.java-name=id +cmp20.tables.CONFERENCES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.CONFERENCES.columns.PK_ID.local-get=true +cmp20.tables.CONFERENCES.columns.PK_ID.local-set=false +cmp20.tables.CONFERENCES.columns.PK_ID.remote-get=false +cmp20.tables.CONFERENCES.columns.PK_ID.remote-set=false +cmp20.tables.CONFERENCES.columns.STARTDATE.java-name=startDate +cmp20.tables.CONFERENCES.columns.STARTDATE.java-type=java.util.Date +cmp20.tables.CONFERENCES.columns.STARTDATE.local-get=true +cmp20.tables.CONFERENCES.columns.STARTDATE.local-set=true +cmp20.tables.CONFERENCES.columns.STARTDATE.remote-get=false +cmp20.tables.CONFERENCES.columns.STARTDATE.remote-set=false +cmp20.tables.CONFERENCES.generate-pk-class=false +cmp20.tables.GROUPPRICINGRULES.base-class-name=GroupPricingRule +cmp20.tables.GROUPPRICINGRULES.columns.DISCOUNTPERATTENDEE.java-name=discountPerAttendee +cmp20.tables.GROUPPRICINGRULES.columns.DISCOUNTPERATTENDEE.java-type=double +cmp20.tables.GROUPPRICINGRULES.columns.DISCOUNTPERATTENDEE.local-get=true +cmp20.tables.GROUPPRICINGRULES.columns.DISCOUNTPERATTENDEE.local-set=true +cmp20.tables.GROUPPRICINGRULES.columns.DISCOUNTPERATTENDEE.remote-get=false +cmp20.tables.GROUPPRICINGRULES.columns.DISCOUNTPERATTENDEE.remote-set=false +cmp20.tables.GROUPPRICINGRULES.columns.MAXIMUMATTENDEES.java-name=maximumAttendees +cmp20.tables.GROUPPRICINGRULES.columns.MAXIMUMATTENDEES.java-type=int +cmp20.tables.GROUPPRICINGRULES.columns.MAXIMUMATTENDEES.local-get=true +cmp20.tables.GROUPPRICINGRULES.columns.MAXIMUMATTENDEES.local-set=true +cmp20.tables.GROUPPRICINGRULES.columns.MAXIMUMATTENDEES.remote-get=false +cmp20.tables.GROUPPRICINGRULES.columns.MAXIMUMATTENDEES.remote-set=false +cmp20.tables.GROUPPRICINGRULES.columns.MINIMUMATTENDEES.java-name=minimumAttendees +cmp20.tables.GROUPPRICINGRULES.columns.MINIMUMATTENDEES.java-type=int +cmp20.tables.GROUPPRICINGRULES.columns.MINIMUMATTENDEES.local-get=true +cmp20.tables.GROUPPRICINGRULES.columns.MINIMUMATTENDEES.local-set=true +cmp20.tables.GROUPPRICINGRULES.columns.MINIMUMATTENDEES.remote-get=false +cmp20.tables.GROUPPRICINGRULES.columns.MINIMUMATTENDEES.remote-set=false +cmp20.tables.GROUPPRICINGRULES.columns.PK_RULENAME.java-name=ruleName +cmp20.tables.GROUPPRICINGRULES.columns.PK_RULENAME.java-type=java.lang.String +cmp20.tables.GROUPPRICINGRULES.columns.PK_RULENAME.local-get=true +cmp20.tables.GROUPPRICINGRULES.columns.PK_RULENAME.local-set=false +cmp20.tables.GROUPPRICINGRULES.columns.PK_RULENAME.remote-get=false +cmp20.tables.GROUPPRICINGRULES.columns.PK_RULENAME.remote-set=false +cmp20.tables.GROUPPRICINGRULES.generate-pk-class=false +cmp20.tables.NEWS.base-class-name=ConferenceNews +cmp20.tables.NEWS.columns.BODY.java-name=body +cmp20.tables.NEWS.columns.BODY.java-type=java.lang.String +cmp20.tables.NEWS.columns.BODY.local-get=true +cmp20.tables.NEWS.columns.BODY.local-set=true +cmp20.tables.NEWS.columns.BODY.remote-get=false +cmp20.tables.NEWS.columns.BODY.remote-set=false +cmp20.tables.NEWS.columns.CREATIONDATE.java-name=creationDate +cmp20.tables.NEWS.columns.CREATIONDATE.java-type=java.util.Date +cmp20.tables.NEWS.columns.CREATIONDATE.local-get=true +cmp20.tables.NEWS.columns.CREATIONDATE.local-set=true +cmp20.tables.NEWS.columns.CREATIONDATE.remote-get=false +cmp20.tables.NEWS.columns.CREATIONDATE.remote-set=false +cmp20.tables.NEWS.columns.DATE.java-name=date +cmp20.tables.NEWS.columns.DATE.java-type=java.util.Date +cmp20.tables.NEWS.columns.DATE.local-get=true +cmp20.tables.NEWS.columns.DATE.local-set=true +cmp20.tables.NEWS.columns.DATE.remote-get=false +cmp20.tables.NEWS.columns.DATE.remote-set=false +cmp20.tables.NEWS.columns.PK_ID.java-name=id +cmp20.tables.NEWS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.NEWS.columns.PK_ID.local-get=true +cmp20.tables.NEWS.columns.PK_ID.local-set=false +cmp20.tables.NEWS.columns.PK_ID.remote-get=false +cmp20.tables.NEWS.columns.PK_ID.remote-set=false +cmp20.tables.NEWS.columns.PUBLISHED.java-name=published +cmp20.tables.NEWS.columns.PUBLISHED.java-type=boolean +cmp20.tables.NEWS.columns.PUBLISHED.local-get=true +cmp20.tables.NEWS.columns.PUBLISHED.local-set=true +cmp20.tables.NEWS.columns.PUBLISHED.remote-get=false +cmp20.tables.NEWS.columns.PUBLISHED.remote-set=false +cmp20.tables.NEWS.columns.REMOVEDATE.java-name=removeDate +cmp20.tables.NEWS.columns.REMOVEDATE.java-type=java.util.Date +cmp20.tables.NEWS.columns.REMOVEDATE.local-get=true +cmp20.tables.NEWS.columns.REMOVEDATE.local-set=true +cmp20.tables.NEWS.columns.REMOVEDATE.remote-get=false +cmp20.tables.NEWS.columns.REMOVEDATE.remote-set=false +cmp20.tables.NEWS.columns.TITLE.java-name=title +cmp20.tables.NEWS.columns.TITLE.java-type=java.lang.String +cmp20.tables.NEWS.columns.TITLE.local-get=true +cmp20.tables.NEWS.columns.TITLE.local-set=true +cmp20.tables.NEWS.columns.TITLE.remote-get=false +cmp20.tables.NEWS.columns.TITLE.remote-set=false +cmp20.tables.NEWS.generate-pk-class=false +cmp20.tables.PRESENTATIONLEVELS.base-class-name=PresentationLevel +cmp20.tables.PRESENTATIONLEVELS.columns.DESCRIPTION.java-name=description +cmp20.tables.PRESENTATIONLEVELS.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.PRESENTATIONLEVELS.columns.DESCRIPTION.local-get=true +cmp20.tables.PRESENTATIONLEVELS.columns.DESCRIPTION.local-set=true +cmp20.tables.PRESENTATIONLEVELS.columns.DESCRIPTION.remote-get=false +cmp20.tables.PRESENTATIONLEVELS.columns.DESCRIPTION.remote-set=false +cmp20.tables.PRESENTATIONLEVELS.columns.NAME.java-name=name +cmp20.tables.PRESENTATIONLEVELS.columns.NAME.java-type=java.lang.String +cmp20.tables.PRESENTATIONLEVELS.columns.NAME.local-get=true +cmp20.tables.PRESENTATIONLEVELS.columns.NAME.local-set=true +cmp20.tables.PRESENTATIONLEVELS.columns.NAME.remote-get=false +cmp20.tables.PRESENTATIONLEVELS.columns.NAME.remote-set=false +cmp20.tables.PRESENTATIONLEVELS.columns.PK_ID.java-name=id +cmp20.tables.PRESENTATIONLEVELS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.PRESENTATIONLEVELS.columns.PK_ID.local-get=true +cmp20.tables.PRESENTATIONLEVELS.columns.PK_ID.local-set=false +cmp20.tables.PRESENTATIONLEVELS.columns.PK_ID.remote-get=false +cmp20.tables.PRESENTATIONLEVELS.columns.PK_ID.remote-set=false +cmp20.tables.PRESENTATIONLEVELS.columns.PK_NAME.java-name=name +cmp20.tables.PRESENTATIONLEVELS.columns.PK_NAME.java-type=java.lang.String +cmp20.tables.PRESENTATIONLEVELS.columns.PK_NAME.local-get=true +cmp20.tables.PRESENTATIONLEVELS.columns.PK_NAME.local-set=false +cmp20.tables.PRESENTATIONLEVELS.columns.PK_NAME.remote-get=false +cmp20.tables.PRESENTATIONLEVELS.columns.PK_NAME.remote-set=false +cmp20.tables.PRESENTATIONLEVELS.generate-pk-class=false +cmp20.tables.PRESENTATIONS.base-class-name=Presentation +cmp20.tables.PRESENTATIONS.columns.FK_ABSTRACTID.java-name=abstractId +cmp20.tables.PRESENTATIONS.columns.FK_ABSTRACTID.java-type=int +cmp20.tables.PRESENTATIONS.columns.FK_ABSTRACTID.local-get=false +cmp20.tables.PRESENTATIONS.columns.FK_ABSTRACTID.local-set=false +cmp20.tables.PRESENTATIONS.columns.FK_ABSTRACTID.remote-get=false +cmp20.tables.PRESENTATIONS.columns.FK_ABSTRACTID.remote-set=false +cmp20.tables.PRESENTATIONS.columns.FK_LEVEL.java-name=level +cmp20.tables.PRESENTATIONS.columns.FK_LEVEL.java-type=java.lang.String +cmp20.tables.PRESENTATIONS.columns.FK_LEVEL.local-get=false +cmp20.tables.PRESENTATIONS.columns.FK_LEVEL.local-set=false +cmp20.tables.PRESENTATIONS.columns.FK_LEVEL.remote-get=false +cmp20.tables.PRESENTATIONS.columns.FK_LEVEL.remote-set=false +cmp20.tables.PRESENTATIONS.columns.FK_PRESENTERID.java-name=presenterId +cmp20.tables.PRESENTATIONS.columns.FK_PRESENTERID.java-type=java.lang.Integer +cmp20.tables.PRESENTATIONS.columns.FK_PRESENTERID.local-get=false +cmp20.tables.PRESENTATIONS.columns.FK_PRESENTERID.local-set=false +cmp20.tables.PRESENTATIONS.columns.FK_PRESENTERID.remote-get=false +cmp20.tables.PRESENTATIONS.columns.FK_PRESENTERID.remote-set=false +cmp20.tables.PRESENTATIONS.columns.FK_TOPIC.java-name=topic +cmp20.tables.PRESENTATIONS.columns.FK_TOPIC.java-type=java.lang.String +cmp20.tables.PRESENTATIONS.columns.FK_TOPIC.local-get=false +cmp20.tables.PRESENTATIONS.columns.FK_TOPIC.local-set=false +cmp20.tables.PRESENTATIONS.columns.FK_TOPIC.remote-get=false +cmp20.tables.PRESENTATIONS.columns.FK_TOPIC.remote-set=false +cmp20.tables.PRESENTATIONS.columns.FK_TYPE.java-name=type +cmp20.tables.PRESENTATIONS.columns.FK_TYPE.java-type=java.lang.String +cmp20.tables.PRESENTATIONS.columns.FK_TYPE.local-get=false +cmp20.tables.PRESENTATIONS.columns.FK_TYPE.local-set=false +cmp20.tables.PRESENTATIONS.columns.FK_TYPE.remote-get=false +cmp20.tables.PRESENTATIONS.columns.FK_TYPE.remote-set=false +cmp20.tables.PRESENTATIONS.columns.PK_ID.java-name=id +cmp20.tables.PRESENTATIONS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.PRESENTATIONS.columns.PK_ID.local-get=true +cmp20.tables.PRESENTATIONS.columns.PK_ID.local-set=false +cmp20.tables.PRESENTATIONS.columns.PK_ID.remote-get=false +cmp20.tables.PRESENTATIONS.columns.PK_ID.remote-set=false +cmp20.tables.PRESENTATIONS.columns.TITLE.java-name=title +cmp20.tables.PRESENTATIONS.columns.TITLE.java-type=java.lang.String +cmp20.tables.PRESENTATIONS.columns.TITLE.local-get=true +cmp20.tables.PRESENTATIONS.columns.TITLE.local-set=true +cmp20.tables.PRESENTATIONS.columns.TITLE.remote-get=false +cmp20.tables.PRESENTATIONS.columns.TITLE.remote-set=false +cmp20.tables.PRESENTATIONS.generate-pk-class=false +cmp20.tables.PRESENTATIONTOPICS.base-class-name=PresentationTopic +cmp20.tables.PRESENTATIONTOPICS.columns.DESCRIPTION.java-name=description +cmp20.tables.PRESENTATIONTOPICS.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.PRESENTATIONTOPICS.columns.DESCRIPTION.local-get=true +cmp20.tables.PRESENTATIONTOPICS.columns.DESCRIPTION.local-set=true +cmp20.tables.PRESENTATIONTOPICS.columns.DESCRIPTION.remote-get=false +cmp20.tables.PRESENTATIONTOPICS.columns.DESCRIPTION.remote-set=false +cmp20.tables.PRESENTATIONTOPICS.columns.NAME.java-name=name +cmp20.tables.PRESENTATIONTOPICS.columns.NAME.java-type=java.lang.String +cmp20.tables.PRESENTATIONTOPICS.columns.NAME.local-get=true +cmp20.tables.PRESENTATIONTOPICS.columns.NAME.local-set=true +cmp20.tables.PRESENTATIONTOPICS.columns.NAME.remote-get=false +cmp20.tables.PRESENTATIONTOPICS.columns.NAME.remote-set=false +cmp20.tables.PRESENTATIONTOPICS.columns.PK_ID.java-name=id +cmp20.tables.PRESENTATIONTOPICS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.PRESENTATIONTOPICS.columns.PK_ID.local-get=true +cmp20.tables.PRESENTATIONTOPICS.columns.PK_ID.local-set=false +cmp20.tables.PRESENTATIONTOPICS.columns.PK_ID.remote-get=false +cmp20.tables.PRESENTATIONTOPICS.columns.PK_ID.remote-set=false +cmp20.tables.PRESENTATIONTOPICS.columns.PK_NAME.java-name=name +cmp20.tables.PRESENTATIONTOPICS.columns.PK_NAME.java-type=java.lang.String +cmp20.tables.PRESENTATIONTOPICS.columns.PK_NAME.local-get=true +cmp20.tables.PRESENTATIONTOPICS.columns.PK_NAME.local-set=false +cmp20.tables.PRESENTATIONTOPICS.columns.PK_NAME.remote-get=false +cmp20.tables.PRESENTATIONTOPICS.columns.PK_NAME.remote-set=false +cmp20.tables.PRESENTATIONTOPICS.generate-pk-class=false +cmp20.tables.PRESENTATIONTYPES.base-class-name=PresentationType +cmp20.tables.PRESENTATIONTYPES.columns.DESCRIPTION.java-name=description +cmp20.tables.PRESENTATIONTYPES.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.PRESENTATIONTYPES.columns.DESCRIPTION.local-get=true +cmp20.tables.PRESENTATIONTYPES.columns.DESCRIPTION.local-set=true +cmp20.tables.PRESENTATIONTYPES.columns.DESCRIPTION.remote-get=false +cmp20.tables.PRESENTATIONTYPES.columns.DESCRIPTION.remote-set=false +cmp20.tables.PRESENTATIONTYPES.columns.NAME.java-name=name +cmp20.tables.PRESENTATIONTYPES.columns.NAME.java-type=java.lang.String +cmp20.tables.PRESENTATIONTYPES.columns.NAME.local-get=true +cmp20.tables.PRESENTATIONTYPES.columns.NAME.local-set=true +cmp20.tables.PRESENTATIONTYPES.columns.NAME.remote-get=false +cmp20.tables.PRESENTATIONTYPES.columns.NAME.remote-set=false +cmp20.tables.PRESENTATIONTYPES.columns.PK_ID.java-name=id +cmp20.tables.PRESENTATIONTYPES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.PRESENTATIONTYPES.columns.PK_ID.local-get=true +cmp20.tables.PRESENTATIONTYPES.columns.PK_ID.local-set=false +cmp20.tables.PRESENTATIONTYPES.columns.PK_ID.remote-get=false +cmp20.tables.PRESENTATIONTYPES.columns.PK_ID.remote-set=false +cmp20.tables.PRESENTATIONTYPES.columns.PK_NAME.java-name=name +cmp20.tables.PRESENTATIONTYPES.columns.PK_NAME.java-type=java.lang.String +cmp20.tables.PRESENTATIONTYPES.columns.PK_NAME.local-get=true +cmp20.tables.PRESENTATIONTYPES.columns.PK_NAME.local-set=false +cmp20.tables.PRESENTATIONTYPES.columns.PK_NAME.remote-get=false +cmp20.tables.PRESENTATIONTYPES.columns.PK_NAME.remote-set=false +cmp20.tables.PRESENTATIONTYPES.generate-pk-class=false +cmp20.tables.PRESENTERS.base-class-name=Presenter +cmp20.tables.PRESENTERS.columns.BIO.java-name=bio +cmp20.tables.PRESENTERS.columns.BIO.java-type=java.lang.String +cmp20.tables.PRESENTERS.columns.BIO.local-get=true +cmp20.tables.PRESENTERS.columns.BIO.local-set=true +cmp20.tables.PRESENTERS.columns.BIO.remote-get=false +cmp20.tables.PRESENTERS.columns.BIO.remote-set=false +cmp20.tables.PRESENTERS.columns.COMPANY.java-name=company +cmp20.tables.PRESENTERS.columns.COMPANY.java-type=java.lang.String +cmp20.tables.PRESENTERS.columns.COMPANY.local-get=true +cmp20.tables.PRESENTERS.columns.COMPANY.local-set=true +cmp20.tables.PRESENTERS.columns.COMPANY.remote-get=false +cmp20.tables.PRESENTERS.columns.COMPANY.remote-set=false +cmp20.tables.PRESENTERS.columns.FK_USERID.java-name=userId +cmp20.tables.PRESENTERS.columns.FK_USERID.java-type=int +cmp20.tables.PRESENTERS.columns.FK_USERID.local-get=false +cmp20.tables.PRESENTERS.columns.FK_USERID.local-set=false +cmp20.tables.PRESENTERS.columns.FK_USERID.remote-get=false +cmp20.tables.PRESENTERS.columns.FK_USERID.remote-set=false +cmp20.tables.PRESENTERS.columns.PK_ID.java-name=id +cmp20.tables.PRESENTERS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.PRESENTERS.columns.PK_ID.local-get=true +cmp20.tables.PRESENTERS.columns.PK_ID.local-set=false +cmp20.tables.PRESENTERS.columns.PK_ID.remote-get=false +cmp20.tables.PRESENTERS.columns.PK_ID.remote-set=false +cmp20.tables.PRESENTERS.generate-pk-class=false +cmp20.tables.QUESTIONNAIRES.base-class-name=Questionnaire +cmp20.tables.QUESTIONNAIRES.columns.FK_PRESENTATIONID.java-name=presentationId +cmp20.tables.QUESTIONNAIRES.columns.FK_PRESENTATIONID.java-type=int +cmp20.tables.QUESTIONNAIRES.columns.FK_PRESENTATIONID.local-get=false +cmp20.tables.QUESTIONNAIRES.columns.FK_PRESENTATIONID.local-set=false +cmp20.tables.QUESTIONNAIRES.columns.FK_PRESENTATIONID.remote-get=false +cmp20.tables.QUESTIONNAIRES.columns.FK_PRESENTATIONID.remote-set=false +cmp20.tables.QUESTIONNAIRES.columns.FK_QUESTIONID.java-name=questionId +cmp20.tables.QUESTIONNAIRES.columns.FK_QUESTIONID.java-type=int +cmp20.tables.QUESTIONNAIRES.columns.FK_QUESTIONID.local-get=false +cmp20.tables.QUESTIONNAIRES.columns.FK_QUESTIONID.local-set=false +cmp20.tables.QUESTIONNAIRES.columns.FK_QUESTIONID.remote-get=false +cmp20.tables.QUESTIONNAIRES.columns.FK_QUESTIONID.remote-set=false +cmp20.tables.QUESTIONNAIRES.columns.PK_ID.java-name=id +cmp20.tables.QUESTIONNAIRES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.QUESTIONNAIRES.columns.PK_ID.local-get=true +cmp20.tables.QUESTIONNAIRES.columns.PK_ID.local-set=false +cmp20.tables.QUESTIONNAIRES.columns.PK_ID.remote-get=false +cmp20.tables.QUESTIONNAIRES.columns.PK_ID.remote-set=false +cmp20.tables.QUESTIONNAIRES.generate-pk-class=false +cmp20.tables.QUESTIONS.base-class-name=Question +cmp20.tables.QUESTIONS.columns.PK_ID.java-name=id +cmp20.tables.QUESTIONS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.QUESTIONS.columns.PK_ID.local-get=true +cmp20.tables.QUESTIONS.columns.PK_ID.local-set=false +cmp20.tables.QUESTIONS.columns.PK_ID.remote-get=false +cmp20.tables.QUESTIONS.columns.PK_ID.remote-set=false +cmp20.tables.QUESTIONS.columns.QUESTIONCHOICES.java-name=questionChoices +cmp20.tables.QUESTIONS.columns.QUESTIONCHOICES.java-type=java.lang.String +cmp20.tables.QUESTIONS.columns.QUESTIONCHOICES.local-get=true +cmp20.tables.QUESTIONS.columns.QUESTIONCHOICES.local-set=true +cmp20.tables.QUESTIONS.columns.QUESTIONCHOICES.remote-get=false +cmp20.tables.QUESTIONS.columns.QUESTIONCHOICES.remote-set=false +cmp20.tables.QUESTIONS.columns.QUESTIONTEXT.java-name=questionText +cmp20.tables.QUESTIONS.columns.QUESTIONTEXT.java-type=java.lang.String +cmp20.tables.QUESTIONS.columns.QUESTIONTEXT.local-get=true +cmp20.tables.QUESTIONS.columns.QUESTIONTEXT.local-set=true +cmp20.tables.QUESTIONS.columns.QUESTIONTEXT.remote-get=false +cmp20.tables.QUESTIONS.columns.QUESTIONTEXT.remote-set=false +cmp20.tables.QUESTIONS.columns.QUESTIONTYPE.java-name=questionType +cmp20.tables.QUESTIONS.columns.QUESTIONTYPE.java-type=int +cmp20.tables.QUESTIONS.columns.QUESTIONTYPE.local-get=true +cmp20.tables.QUESTIONS.columns.QUESTIONTYPE.local-set=true +cmp20.tables.QUESTIONS.columns.QUESTIONTYPE.remote-get=false +cmp20.tables.QUESTIONS.columns.QUESTIONTYPE.remote-set=false +cmp20.tables.QUESTIONS.generate-pk-class=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.base-class-name=RegistrationDatePricingRule +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.ENDDATE.java-name=endDate +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.ENDDATE.java-type=java.util.Date +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.ENDDATE.local-get=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.ENDDATE.local-set=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.ENDDATE.remote-get=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.ENDDATE.remote-set=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PK_PRICINGMODEL.java-name=pricingModel +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PK_PRICINGMODEL.java-type=java.lang.String +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PK_PRICINGMODEL.local-get=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PK_PRICINGMODEL.local-set=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PK_PRICINGMODEL.remote-get=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PK_PRICINGMODEL.remote-set=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PRICE.java-name=price +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PRICE.java-type=double +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PRICE.local-get=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PRICE.local-set=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PRICE.remote-get=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.PRICE.remote-set=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.STARTDATE.java-name=startDate +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.STARTDATE.java-type=java.util.Date +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.STARTDATE.local-get=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.STARTDATE.local-set=true +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.STARTDATE.remote-get=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.columns.STARTDATE.remote-set=false +cmp20.tables.REGISTRATIONDATEPRICINGRULES.generate-pk-class=false +cmp20.tables.REMINDERS.base-class-name=Reminder +cmp20.tables.REMINDERS.columns.DATEANDTIME.java-name=dateAndTime +cmp20.tables.REMINDERS.columns.DATEANDTIME.java-type=java.util.Date +cmp20.tables.REMINDERS.columns.DATEANDTIME.local-get=true +cmp20.tables.REMINDERS.columns.DATEANDTIME.local-set=true +cmp20.tables.REMINDERS.columns.DATEANDTIME.remote-get=false +cmp20.tables.REMINDERS.columns.DATEANDTIME.remote-set=false +cmp20.tables.REMINDERS.columns.FK_SCHEDULEENTRYID.java-name=scheduleEntryId +cmp20.tables.REMINDERS.columns.FK_SCHEDULEENTRYID.java-type=int +cmp20.tables.REMINDERS.columns.FK_SCHEDULEENTRYID.local-get=false +cmp20.tables.REMINDERS.columns.FK_SCHEDULEENTRYID.local-set=false +cmp20.tables.REMINDERS.columns.FK_SCHEDULEENTRYID.remote-get=false +cmp20.tables.REMINDERS.columns.FK_SCHEDULEENTRYID.remote-set=false +cmp20.tables.REMINDERS.columns.FK_USERID.java-name=userId +cmp20.tables.REMINDERS.columns.FK_USERID.java-type=int +cmp20.tables.REMINDERS.columns.FK_USERID.local-get=false +cmp20.tables.REMINDERS.columns.FK_USERID.local-set=false +cmp20.tables.REMINDERS.columns.FK_USERID.remote-get=false +cmp20.tables.REMINDERS.columns.FK_USERID.remote-set=false +cmp20.tables.REMINDERS.columns.MESSAGE.java-name=message +cmp20.tables.REMINDERS.columns.MESSAGE.java-type=java.lang.String +cmp20.tables.REMINDERS.columns.MESSAGE.local-get=true +cmp20.tables.REMINDERS.columns.MESSAGE.local-set=true +cmp20.tables.REMINDERS.columns.MESSAGE.remote-get=false +cmp20.tables.REMINDERS.columns.MESSAGE.remote-set=false +cmp20.tables.REMINDERS.columns.PK_ID.java-name=id +cmp20.tables.REMINDERS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.REMINDERS.columns.PK_ID.local-get=true +cmp20.tables.REMINDERS.columns.PK_ID.local-set=false +cmp20.tables.REMINDERS.columns.PK_ID.remote-get=false +cmp20.tables.REMINDERS.columns.PK_ID.remote-set=false +cmp20.tables.REMINDERS.generate-pk-class=false +cmp20.tables.ROLES.base-class-name=Role +cmp20.tables.ROLES.columns.DESCRIPTION.java-name=description +cmp20.tables.ROLES.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.ROLES.columns.DESCRIPTION.local-get=true +cmp20.tables.ROLES.columns.DESCRIPTION.local-set=true +cmp20.tables.ROLES.columns.DESCRIPTION.remote-get=false +cmp20.tables.ROLES.columns.DESCRIPTION.remote-set=false +cmp20.tables.ROLES.columns.PK_ID.java-name=id +cmp20.tables.ROLES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ROLES.columns.PK_ID.local-get=true +cmp20.tables.ROLES.columns.PK_ID.local-set=false +cmp20.tables.ROLES.columns.PK_ID.remote-get=false +cmp20.tables.ROLES.columns.PK_ID.remote-set=false +cmp20.tables.ROLES.columns.PK_ROLENAME.java-name=roleName +cmp20.tables.ROLES.columns.PK_ROLENAME.java-type=java.lang.String +cmp20.tables.ROLES.columns.PK_ROLENAME.local-get=true +cmp20.tables.ROLES.columns.PK_ROLENAME.local-set=false +cmp20.tables.ROLES.columns.PK_ROLENAME.remote-get=false +cmp20.tables.ROLES.columns.PK_ROLENAME.remote-set=false +cmp20.tables.ROLES.columns.ROLENAME.java-name=rolename +cmp20.tables.ROLES.columns.ROLENAME.java-type=java.lang.String +cmp20.tables.ROLES.columns.ROLENAME.local-get=true +cmp20.tables.ROLES.columns.ROLENAME.local-set=true +cmp20.tables.ROLES.columns.ROLENAME.remote-get=false +cmp20.tables.ROLES.columns.ROLENAME.remote-set=false +cmp20.tables.ROLES.generate-pk-class=false +cmp20.tables.ROOMS.base-class-name=Room +cmp20.tables.ROOMS.columns.CAPACITY.java-name=capacity +cmp20.tables.ROOMS.columns.CAPACITY.java-type=int +cmp20.tables.ROOMS.columns.CAPACITY.local-get=true +cmp20.tables.ROOMS.columns.CAPACITY.local-set=true +cmp20.tables.ROOMS.columns.CAPACITY.remote-get=false +cmp20.tables.ROOMS.columns.CAPACITY.remote-set=false +cmp20.tables.ROOMS.columns.FK_VENUEID.java-name=venueId +cmp20.tables.ROOMS.columns.FK_VENUEID.java-type=int +cmp20.tables.ROOMS.columns.FK_VENUEID.local-get=false +cmp20.tables.ROOMS.columns.FK_VENUEID.local-set=false +cmp20.tables.ROOMS.columns.FK_VENUEID.remote-get=false +cmp20.tables.ROOMS.columns.FK_VENUEID.remote-set=false +cmp20.tables.ROOMS.columns.NAME.java-name=name +cmp20.tables.ROOMS.columns.NAME.java-type=java.lang.String +cmp20.tables.ROOMS.columns.NAME.local-get=true +cmp20.tables.ROOMS.columns.NAME.local-set=true +cmp20.tables.ROOMS.columns.NAME.remote-get=false +cmp20.tables.ROOMS.columns.NAME.remote-set=false +cmp20.tables.ROOMS.columns.NOTES.java-name=notes +cmp20.tables.ROOMS.columns.NOTES.java-type=java.lang.String +cmp20.tables.ROOMS.columns.NOTES.local-get=true +cmp20.tables.ROOMS.columns.NOTES.local-set=true +cmp20.tables.ROOMS.columns.NOTES.remote-get=false +cmp20.tables.ROOMS.columns.NOTES.remote-set=false +cmp20.tables.ROOMS.columns.PK_ID.java-name=id +cmp20.tables.ROOMS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.ROOMS.columns.PK_ID.local-get=true +cmp20.tables.ROOMS.columns.PK_ID.local-set=false +cmp20.tables.ROOMS.columns.PK_ID.remote-get=false +cmp20.tables.ROOMS.columns.PK_ID.remote-set=false +cmp20.tables.ROOMS.generate-pk-class=false +cmp20.tables.SCHEDULEENTRIES.base-class-name=ScheduleEntry +cmp20.tables.SCHEDULEENTRIES.columns.DESCRIPTION.java-name=description +cmp20.tables.SCHEDULEENTRIES.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.SCHEDULEENTRIES.columns.DESCRIPTION.local-get=true +cmp20.tables.SCHEDULEENTRIES.columns.DESCRIPTION.local-set=true +cmp20.tables.SCHEDULEENTRIES.columns.DESCRIPTION.remote-get=false +cmp20.tables.SCHEDULEENTRIES.columns.DESCRIPTION.remote-set=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_SESSIONID.java-name=sessionId +cmp20.tables.SCHEDULEENTRIES.columns.FK_SESSIONID.java-type=int +cmp20.tables.SCHEDULEENTRIES.columns.FK_SESSIONID.local-get=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_SESSIONID.local-set=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_SESSIONID.remote-get=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_SESSIONID.remote-set=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_USERID.java-name=userId +cmp20.tables.SCHEDULEENTRIES.columns.FK_USERID.java-type=int +cmp20.tables.SCHEDULEENTRIES.columns.FK_USERID.local-get=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_USERID.local-set=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_USERID.remote-get=false +cmp20.tables.SCHEDULEENTRIES.columns.FK_USERID.remote-set=false +cmp20.tables.SCHEDULEENTRIES.columns.NAME.java-name=name +cmp20.tables.SCHEDULEENTRIES.columns.NAME.java-type=java.lang.String +cmp20.tables.SCHEDULEENTRIES.columns.NAME.local-get=true +cmp20.tables.SCHEDULEENTRIES.columns.NAME.local-set=true +cmp20.tables.SCHEDULEENTRIES.columns.NAME.remote-get=false +cmp20.tables.SCHEDULEENTRIES.columns.NAME.remote-set=false +cmp20.tables.SCHEDULEENTRIES.columns.PK_ID.java-name=id +cmp20.tables.SCHEDULEENTRIES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.SCHEDULEENTRIES.columns.PK_ID.local-get=true +cmp20.tables.SCHEDULEENTRIES.columns.PK_ID.local-set=false +cmp20.tables.SCHEDULEENTRIES.columns.PK_ID.remote-get=false +cmp20.tables.SCHEDULEENTRIES.columns.PK_ID.remote-set=false +cmp20.tables.SCHEDULEENTRIES.generate-pk-class=false +cmp20.tables.SESSIONS.base-class-name=Session +cmp20.tables.SESSIONS.columns.DATETIMEBEGIN.java-name=dateTimeBegin +cmp20.tables.SESSIONS.columns.DATETIMEBEGIN.java-type=java.util.Date +cmp20.tables.SESSIONS.columns.DATETIMEBEGIN.local-get=true +cmp20.tables.SESSIONS.columns.DATETIMEBEGIN.local-set=true +cmp20.tables.SESSIONS.columns.DATETIMEBEGIN.remote-get=false +cmp20.tables.SESSIONS.columns.DATETIMEBEGIN.remote-set=false +cmp20.tables.SESSIONS.columns.DATETIMEEND.java-name=dateTimeEnd +cmp20.tables.SESSIONS.columns.DATETIMEEND.java-type=java.util.Date +cmp20.tables.SESSIONS.columns.DATETIMEEND.local-get=true +cmp20.tables.SESSIONS.columns.DATETIMEEND.local-set=true +cmp20.tables.SESSIONS.columns.DATETIMEEND.remote-get=false +cmp20.tables.SESSIONS.columns.DATETIMEEND.remote-set=false +cmp20.tables.SESSIONS.columns.FK_PRESENTATIONID.java-name=presentationId +cmp20.tables.SESSIONS.columns.FK_PRESENTATIONID.java-type=int +cmp20.tables.SESSIONS.columns.FK_PRESENTATIONID.local-get=false +cmp20.tables.SESSIONS.columns.FK_PRESENTATIONID.local-set=false +cmp20.tables.SESSIONS.columns.FK_PRESENTATIONID.remote-get=false +cmp20.tables.SESSIONS.columns.FK_PRESENTATIONID.remote-set=false +cmp20.tables.SESSIONS.columns.FK_ROOMID.java-name=roomId +cmp20.tables.SESSIONS.columns.FK_ROOMID.java-type=int +cmp20.tables.SESSIONS.columns.FK_ROOMID.local-get=false +cmp20.tables.SESSIONS.columns.FK_ROOMID.local-set=false +cmp20.tables.SESSIONS.columns.FK_ROOMID.remote-get=false +cmp20.tables.SESSIONS.columns.FK_ROOMID.remote-set=false +cmp20.tables.SESSIONS.columns.PK_ID.java-name=id +cmp20.tables.SESSIONS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.SESSIONS.columns.PK_ID.local-get=true +cmp20.tables.SESSIONS.columns.PK_ID.local-set=false +cmp20.tables.SESSIONS.columns.PK_ID.remote-get=false +cmp20.tables.SESSIONS.columns.PK_ID.remote-set=false +cmp20.tables.SESSIONS.generate-pk-class=false +cmp20.tables.TRACKS.base-class-name=Track +cmp20.tables.TRACKS.columns.DESCRIPTION.java-name=description +cmp20.tables.TRACKS.columns.DESCRIPTION.java-type=java.lang.String +cmp20.tables.TRACKS.columns.DESCRIPTION.local-get=true +cmp20.tables.TRACKS.columns.DESCRIPTION.local-set=true +cmp20.tables.TRACKS.columns.DESCRIPTION.remote-get=false +cmp20.tables.TRACKS.columns.DESCRIPTION.remote-set=false +cmp20.tables.TRACKS.columns.FK_CONFERENCEID.java-name=conferenceId +cmp20.tables.TRACKS.columns.FK_CONFERENCEID.java-type=int +cmp20.tables.TRACKS.columns.FK_CONFERENCEID.local-get=false +cmp20.tables.TRACKS.columns.FK_CONFERENCEID.local-set=false +cmp20.tables.TRACKS.columns.FK_CONFERENCEID.remote-get=false +cmp20.tables.TRACKS.columns.FK_CONFERENCEID.remote-set=false +cmp20.tables.TRACKS.columns.PK_ID.java-name=id +cmp20.tables.TRACKS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.TRACKS.columns.PK_ID.local-get=true +cmp20.tables.TRACKS.columns.PK_ID.local-set=false +cmp20.tables.TRACKS.columns.PK_ID.remote-get=false +cmp20.tables.TRACKS.columns.PK_ID.remote-set=false +cmp20.tables.TRACKS.columns.SUBTITLE.java-name=subTitle +cmp20.tables.TRACKS.columns.SUBTITLE.java-type=java.lang.String +cmp20.tables.TRACKS.columns.SUBTITLE.local-get=true +cmp20.tables.TRACKS.columns.SUBTITLE.local-set=true +cmp20.tables.TRACKS.columns.SUBTITLE.remote-get=false +cmp20.tables.TRACKS.columns.SUBTITLE.remote-set=false +cmp20.tables.TRACKS.columns.TITLE.java-name=title +cmp20.tables.TRACKS.columns.TITLE.java-type=java.lang.String +cmp20.tables.TRACKS.columns.TITLE.local-get=true +cmp20.tables.TRACKS.columns.TITLE.local-set=true +cmp20.tables.TRACKS.columns.TITLE.remote-get=false +cmp20.tables.TRACKS.columns.TITLE.remote-set=false +cmp20.tables.TRACKS.generate-pk-class=false +cmp20.tables.USERROLES.base-class-name=UserRole +cmp20.tables.USERROLES.columns.FK_ROLE.java-name=role +cmp20.tables.USERROLES.columns.FK_ROLE.java-type=int +cmp20.tables.USERROLES.columns.FK_ROLE.local-get=true +cmp20.tables.USERROLES.columns.FK_ROLE.local-set=true +cmp20.tables.USERROLES.columns.FK_ROLE.remote-get=false +cmp20.tables.USERROLES.columns.FK_ROLE.remote-set=false +cmp20.tables.USERROLES.columns.FK_USERID.java-name=userId +cmp20.tables.USERROLES.columns.FK_USERID.java-type=int +cmp20.tables.USERROLES.columns.FK_USERID.local-get=true +cmp20.tables.USERROLES.columns.FK_USERID.local-set=true +cmp20.tables.USERROLES.columns.FK_USERID.remote-get=false +cmp20.tables.USERROLES.columns.FK_USERID.remote-set=false +cmp20.tables.USERROLES.columns.PK_ID.java-name=id +cmp20.tables.USERROLES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.USERROLES.columns.PK_ID.local-get=true +cmp20.tables.USERROLES.columns.PK_ID.local-set=false +cmp20.tables.USERROLES.columns.PK_ID.remote-get=false +cmp20.tables.USERROLES.columns.PK_ID.remote-set=false +cmp20.tables.USERROLES.generate-pk-class=false +cmp20.tables.USERS.base-class-name=User +cmp20.tables.USERS.columns.EMAIL.java-name=email +cmp20.tables.USERS.columns.EMAIL.java-type=java.lang.String +cmp20.tables.USERS.columns.EMAIL.local-get=true +cmp20.tables.USERS.columns.EMAIL.local-set=true +cmp20.tables.USERS.columns.EMAIL.remote-get=false +cmp20.tables.USERS.columns.EMAIL.remote-set=false +cmp20.tables.USERS.columns.FAX.java-name=fax +cmp20.tables.USERS.columns.FAX.java-type=java.lang.String +cmp20.tables.USERS.columns.FAX.local-get=true +cmp20.tables.USERS.columns.FAX.local-set=true +cmp20.tables.USERS.columns.FAX.remote-get=false +cmp20.tables.USERS.columns.FAX.remote-set=false +cmp20.tables.USERS.columns.FIRSTNAME.java-name=firstName +cmp20.tables.USERS.columns.FIRSTNAME.java-type=java.lang.String +cmp20.tables.USERS.columns.FIRSTNAME.local-get=true +cmp20.tables.USERS.columns.FIRSTNAME.local-set=true +cmp20.tables.USERS.columns.FIRSTNAME.remote-get=false +cmp20.tables.USERS.columns.FIRSTNAME.remote-set=false +cmp20.tables.USERS.columns.FK_ADDRESSID.java-name=addressId +cmp20.tables.USERS.columns.FK_ADDRESSID.java-type=int +cmp20.tables.USERS.columns.FK_ADDRESSID.local-get=false +cmp20.tables.USERS.columns.FK_ADDRESSID.local-set=false +cmp20.tables.USERS.columns.FK_ADDRESSID.remote-get=false +cmp20.tables.USERS.columns.FK_ADDRESSID.remote-set=false +cmp20.tables.USERS.columns.HOMEPHONE.java-name=homePhone +cmp20.tables.USERS.columns.HOMEPHONE.java-type=java.lang.String +cmp20.tables.USERS.columns.HOMEPHONE.local-get=true +cmp20.tables.USERS.columns.HOMEPHONE.local-set=true +cmp20.tables.USERS.columns.HOMEPHONE.remote-get=false +cmp20.tables.USERS.columns.HOMEPHONE.remote-set=false +cmp20.tables.USERS.columns.LASTNAME.java-name=lastName +cmp20.tables.USERS.columns.LASTNAME.java-type=java.lang.String +cmp20.tables.USERS.columns.LASTNAME.local-get=true +cmp20.tables.USERS.columns.LASTNAME.local-set=true +cmp20.tables.USERS.columns.LASTNAME.remote-get=false +cmp20.tables.USERS.columns.LASTNAME.remote-set=false +cmp20.tables.USERS.columns.PASSWORD.java-name=password +cmp20.tables.USERS.columns.PASSWORD.java-type=java.lang.String +cmp20.tables.USERS.columns.PASSWORD.local-get=true +cmp20.tables.USERS.columns.PASSWORD.local-set=true +cmp20.tables.USERS.columns.PASSWORD.remote-get=false +cmp20.tables.USERS.columns.PASSWORD.remote-set=false +cmp20.tables.USERS.columns.PK_ID.java-name=id +cmp20.tables.USERS.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.USERS.columns.PK_ID.local-get=true +cmp20.tables.USERS.columns.PK_ID.local-set=false +cmp20.tables.USERS.columns.PK_ID.remote-get=false +cmp20.tables.USERS.columns.PK_ID.remote-set=false +cmp20.tables.USERS.columns.WORKPHONE.java-name=workPhone +cmp20.tables.USERS.columns.WORKPHONE.java-type=java.lang.String +cmp20.tables.USERS.columns.WORKPHONE.local-get=true +cmp20.tables.USERS.columns.WORKPHONE.local-set=true +cmp20.tables.USERS.columns.WORKPHONE.remote-get=false +cmp20.tables.USERS.columns.WORKPHONE.remote-set=false +cmp20.tables.USERS.generate-pk-class=false +cmp20.tables.VENUES.base-class-name=Venue +cmp20.tables.VENUES.columns.FAX.java-name=fax +cmp20.tables.VENUES.columns.FAX.java-type=java.lang.String +cmp20.tables.VENUES.columns.FAX.local-get=true +cmp20.tables.VENUES.columns.FAX.local-set=true +cmp20.tables.VENUES.columns.FAX.remote-get=false +cmp20.tables.VENUES.columns.FAX.remote-set=false +cmp20.tables.VENUES.columns.FK_ADDRESSID.java-name=addressId +cmp20.tables.VENUES.columns.FK_ADDRESSID.java-type=int +cmp20.tables.VENUES.columns.FK_ADDRESSID.local-get=false +cmp20.tables.VENUES.columns.FK_ADDRESSID.local-set=false +cmp20.tables.VENUES.columns.FK_ADDRESSID.remote-get=false +cmp20.tables.VENUES.columns.FK_ADDRESSID.remote-set=false +cmp20.tables.VENUES.columns.NAME.java-name=name +cmp20.tables.VENUES.columns.NAME.java-type=java.lang.String +cmp20.tables.VENUES.columns.NAME.local-get=true +cmp20.tables.VENUES.columns.NAME.local-set=true +cmp20.tables.VENUES.columns.NAME.remote-get=false +cmp20.tables.VENUES.columns.NAME.remote-set=false +cmp20.tables.VENUES.columns.PHONE.java-name=phone +cmp20.tables.VENUES.columns.PHONE.java-type=java.lang.String +cmp20.tables.VENUES.columns.PHONE.local-get=true +cmp20.tables.VENUES.columns.PHONE.local-set=true +cmp20.tables.VENUES.columns.PHONE.remote-get=false +cmp20.tables.VENUES.columns.PHONE.remote-set=false +cmp20.tables.VENUES.columns.PK_ID.java-name=id +cmp20.tables.VENUES.columns.PK_ID.java-type=java.lang.Integer +cmp20.tables.VENUES.columns.PK_ID.local-get=true +cmp20.tables.VENUES.columns.PK_ID.local-set=false +cmp20.tables.VENUES.columns.PK_ID.remote-get=false +cmp20.tables.VENUES.columns.PK_ID.remote-set=false +cmp20.tables.VENUES.generate-pk-class=false +relations.ABSTRACTS-PRESENTATIONS.ABSTRACTS-has-PRESENTATIONS.enabled=true +relations.ABSTRACTS-PRESENTATIONS.ABSTRACTS-has-PRESENTATIONS.target-many=false +relations.ABSTRACTS-PRESENTATIONS.PRESENTATIONS-has-ABSTRACTS.enabled=true +relations.ABSTRACTS-PRESENTATIONS.PRESENTATIONS-has-ABSTRACTS.target-many=false +relations.ABSTRACTSTATUS-ABSTRACTS.ABSTRACTS-has-ABSTRACTSTATUS.enabled=true +relations.ABSTRACTSTATUS-ABSTRACTS.ABSTRACTS-has-ABSTRACTSTATUS.target-many=false +relations.ABSTRACTSTATUS-ABSTRACTS.ABSTRACTSTATUS-has-ABSTRACTS.enabled=true +relations.ABSTRACTSTATUS-ABSTRACTS.ABSTRACTSTATUS-has-ABSTRACTS.target-many=true +relations.ADDRESSES-USERS.ADDRESSES-has-USERS.enabled=false +relations.ADDRESSES-USERS.ADDRESSES-has-USERS.target-many=true +relations.ADDRESSES-USERS.USERS-has-ADDRESSES.enabled=true +relations.ADDRESSES-USERS.USERS-has-ADDRESSES.target-many=false +relations.ADDRESSES-VENUES.ADDRESSES-has-VENUES.enabled=false +relations.ADDRESSES-VENUES.ADDRESSES-has-VENUES.target-many=true +relations.ADDRESSES-VENUES.VENUES-has-ADDRESSES.enabled=true +relations.ADDRESSES-VENUES.VENUES-has-ADDRESSES.target-many=false +relations.CONFERENCES-TRACKS.CONFERENCES-has-TRACKS.enabled=true +relations.CONFERENCES-TRACKS.CONFERENCES-has-TRACKS.target-many=true +relations.CONFERENCES-TRACKS.TRACKS-has-CONFERENCES.enabled=false +relations.CONFERENCES-TRACKS.TRACKS-has-CONFERENCES.target-many=false +relations.PRESENTATIONLEVELS-PRESENTATIONS.PRESENTATIONLEVELS-has-PRESENTATIONS.enabled=true +relations.PRESENTATIONLEVELS-PRESENTATIONS.PRESENTATIONLEVELS-has-PRESENTATIONS.target-many=true +relations.PRESENTATIONLEVELS-PRESENTATIONS.PRESENTATIONS-has-PRESENTATIONLEVELS.enabled=true +relations.PRESENTATIONLEVELS-PRESENTATIONS.PRESENTATIONS-has-PRESENTATIONLEVELS.target-many=false +relations.PRESENTATIONS-QUESTIONNAIRES.PRESENTATIONS-has-QUESTIONNAIRES.enabled=true +relations.PRESENTATIONS-QUESTIONNAIRES.PRESENTATIONS-has-QUESTIONNAIRES.target-many=true +relations.PRESENTATIONS-QUESTIONNAIRES.QUESTIONNAIRES-has-PRESENTATIONS.enabled=false +relations.PRESENTATIONS-QUESTIONNAIRES.QUESTIONNAIRES-has-PRESENTATIONS.target-many=false +relations.PRESENTATIONS-SESSIONS.PRESENTATIONS-has-SESSIONS.enabled=true +relations.PRESENTATIONS-SESSIONS.PRESENTATIONS-has-SESSIONS.target-many=true +relations.PRESENTATIONS-SESSIONS.SESSIONS-has-PRESENTATIONS.enabled=true +relations.PRESENTATIONS-SESSIONS.SESSIONS-has-PRESENTATIONS.target-many=false +relations.PRESENTATIONTOPICS-PRESENTATIONS.PRESENTATIONS-has-PRESENTATIONTOPICS.enabled=true +relations.PRESENTATIONTOPICS-PRESENTATIONS.PRESENTATIONS-has-PRESENTATIONTOPICS.target-many=false +relations.PRESENTATIONTOPICS-PRESENTATIONS.PRESENTATIONTOPICS-has-PRESENTATIONS.enabled=true +relations.PRESENTATIONTOPICS-PRESENTATIONS.PRESENTATIONTOPICS-has-PRESENTATIONS.target-many=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_level.PRESENTATIONS-has-PRESENTATIONTYPESByFkLevel.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_level.PRESENTATIONS-has-PRESENTATIONTYPESByFkLevel.target-many=false +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_level.PRESENTATIONTYPES-has-PRESENTATIONSByFkLevel.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_level.PRESENTATIONTYPES-has-PRESENTATIONSByFkLevel.target-many=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_topic.PRESENTATIONS-has-PRESENTATIONTYPESByFkTopic.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_topic.PRESENTATIONS-has-PRESENTATIONTYPESByFkTopic.target-many=false +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_topic.PRESENTATIONTYPES-has-PRESENTATIONSByFkTopic.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_topic.PRESENTATIONTYPES-has-PRESENTATIONSByFkTopic.target-many=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_type.PRESENTATIONS-has-PRESENTATIONTYPESByFkType.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_type.PRESENTATIONS-has-PRESENTATIONTYPESByFkType.target-many=false +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_type.PRESENTATIONTYPES-has-PRESENTATIONSByFkType.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS-fk_type.PRESENTATIONTYPES-has-PRESENTATIONSByFkType.target-many=true +relations.PRESENTATIONTYPES-PRESENTATIONS.PRESENTATIONS-has-PRESENTATIONTYPES.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS.PRESENTATIONS-has-PRESENTATIONTYPES.target-many=false +relations.PRESENTATIONTYPES-PRESENTATIONS.PRESENTATIONTYPES-has-PRESENTATIONS.enabled=true +relations.PRESENTATIONTYPES-PRESENTATIONS.PRESENTATIONTYPES-has-PRESENTATIONS.target-many=true +relations.PRESENTERS-ABSTRACTS.ABSTRACTS-has-PRESENTERS.enabled=true +relations.PRESENTERS-ABSTRACTS.ABSTRACTS-has-PRESENTERS.target-many=false +relations.PRESENTERS-ABSTRACTS.PRESENTERS-has-ABSTRACTS.enabled=true +relations.PRESENTERS-ABSTRACTS.PRESENTERS-has-ABSTRACTS.target-many=true +relations.PRESENTERS-PRESENTATIONS.PRESENTATIONS-has-PRESENTERS.enabled=true +relations.PRESENTERS-PRESENTATIONS.PRESENTATIONS-has-PRESENTERS.target-many=false +relations.PRESENTERS-PRESENTATIONS.PRESENTERS-has-PRESENTATIONS.enabled=true +relations.PRESENTERS-PRESENTATIONS.PRESENTERS-has-PRESENTATIONS.target-many=true +relations.QUESTIONNAIRES-ANSWERS.ANSWERS-has-QUESTIONNAIRES.enabled=false +relations.QUESTIONNAIRES-ANSWERS.ANSWERS-has-QUESTIONNAIRES.target-many=false +relations.QUESTIONNAIRES-ANSWERS.QUESTIONNAIRES-has-ANSWERS.enabled=true +relations.QUESTIONNAIRES-ANSWERS.QUESTIONNAIRES-has-ANSWERS.target-many=true +relations.QUESTIONS-QUESTIONNAIRES.QUESTIONNAIRES-has-QUESTIONS.enabled=false +relations.QUESTIONS-QUESTIONNAIRES.QUESTIONNAIRES-has-QUESTIONS.target-many=false +relations.QUESTIONS-QUESTIONNAIRES.QUESTIONS-has-QUESTIONNAIRES.enabled=true +relations.QUESTIONS-QUESTIONNAIRES.QUESTIONS-has-QUESTIONNAIRES.target-many=true +relations.ROLES-USERROLES.ROLES-has-USERROLES.enabled=true +relations.ROLES-USERROLES.ROLES-has-USERROLES.target-many=true +relations.ROLES-USERROLES.USERROLES-has-ROLES.enabled=true +relations.ROLES-USERROLES.USERROLES-has-ROLES.target-many=false +relations.ROOMS-SESSIONS.ROOMS-has-SESSIONS.enabled=true +relations.ROOMS-SESSIONS.ROOMS-has-SESSIONS.target-many=true +relations.ROOMS-SESSIONS.SESSIONS-has-ROOMS.enabled=true +relations.ROOMS-SESSIONS.SESSIONS-has-ROOMS.target-many=false +relations.SCHEDULEENTRIES-REMINDERS.REMINDERS-has-SCHEDULEENTRIES.enabled=true +relations.SCHEDULEENTRIES-REMINDERS.REMINDERS-has-SCHEDULEENTRIES.target-many=false +relations.SCHEDULEENTRIES-REMINDERS.SCHEDULEENTRIES-has-REMINDERS.enabled=true +relations.SCHEDULEENTRIES-REMINDERS.SCHEDULEENTRIES-has-REMINDERS.target-many=true +relations.SESSIONS-SCHEDULEENTRIES.SCHEDULEENTRIES-has-SESSIONS.enabled=true +relations.SESSIONS-SCHEDULEENTRIES.SCHEDULEENTRIES-has-SESSIONS.target-many=false +relations.SESSIONS-SCHEDULEENTRIES.SESSIONS-has-SCHEDULEENTRIES.enabled=false +relations.SESSIONS-SCHEDULEENTRIES.SESSIONS-has-SCHEDULEENTRIES.target-many=true +relations.USERS-ANSWERS.ANSWERS-has-USERS.enabled=false +relations.USERS-ANSWERS.ANSWERS-has-USERS.target-many=false +relations.USERS-ANSWERS.USERS-has-ANSWERS.enabled=true +relations.USERS-ANSWERS.USERS-has-ANSWERS.target-many=true +relations.USERS-ATTENDEES.ATTENDEES-has-USERS.enabled=true +relations.USERS-ATTENDEES.ATTENDEES-has-USERS.target-many=false +relations.USERS-ATTENDEES.USERS-has-ATTENDEES.enabled=true +relations.USERS-ATTENDEES.USERS-has-ATTENDEES.target-many=false +relations.USERS-PRESENTERS.PRESENTERS-has-USERS.enabled=true +relations.USERS-PRESENTERS.PRESENTERS-has-USERS.target-many=false +relations.USERS-PRESENTERS.USERS-has-PRESENTERS.enabled=true +relations.USERS-PRESENTERS.USERS-has-PRESENTERS.target-many=false +relations.USERS-REMINDERS.REMINDERS-has-USERS.enabled=false +relations.USERS-REMINDERS.REMINDERS-has-USERS.target-many=false +relations.USERS-REMINDERS.USERS-has-REMINDERS.enabled=true +relations.USERS-REMINDERS.USERS-has-REMINDERS.target-many=true +relations.USERS-SCHEDULEENTRIES.SCHEDULEENTRIES-has-USERS.enabled=true +relations.USERS-SCHEDULEENTRIES.SCHEDULEENTRIES-has-USERS.target-many=false +relations.USERS-SCHEDULEENTRIES.USERS-has-SCHEDULEENTRIES.enabled=true +relations.USERS-SCHEDULEENTRIES.USERS-has-SCHEDULEENTRIES.target-many=true +relations.USERS-USERROLES.USERROLES-has-USERS.enabled=true +relations.USERS-USERROLES.USERROLES-has-USERS.target-many=false +relations.USERS-USERROLES.USERS-has-USERROLES.enabled=true +relations.USERS-USERROLES.USERS-has-USERROLES.target-many=true +relations.VENUES-BOOTHS.BOOTHS-has-VENUES.enabled=false +relations.VENUES-BOOTHS.BOOTHS-has-VENUES.target-many=false +relations.VENUES-BOOTHS.VENUES-has-BOOTHS.enabled=true +relations.VENUES-BOOTHS.VENUES-has-BOOTHS.target-many=true +relations.VENUES-CONFERENCES.CONFERENCES-has-VENUES.enabled=true +relations.VENUES-CONFERENCES.CONFERENCES-has-VENUES.target-many=false +relations.VENUES-CONFERENCES.VENUES-has-CONFERENCES.enabled=false +relations.VENUES-CONFERENCES.VENUES-has-CONFERENCES.target-many=true +relations.VENUES-ROOMS.ROOMS-has-VENUES.enabled=false +relations.VENUES-ROOMS.ROOMS-has-VENUES.target-many=false +relations.VENUES-ROOMS.VENUES-has-ROOMS.enabled=true +relations.VENUES-ROOMS.VENUES-has-ROOMS.target-many=true +tables.ABSTRACTS.x=229 +tables.ABSTRACTS.y=358 +tables.ABSTRACTSTATUS.x=262 +tables.ABSTRACTSTATUS.y=622 +tables.ADDRESSES.x=972 +tables.ADDRESSES.y=571 +tables.ANSWERS.x=480 +tables.ANSWERS.y=201 +tables.ATTENDEES.x=484 +tables.ATTENDEES.y=296 +tables.BOOTHS.x=1005 +tables.BOOTHS.y=47 +tables.CONFERENCES.x=477 +tables.CONFERENCES.y=24 +tables.GROUPPRICINGRULES.x=11 +tables.GROUPPRICINGRULES.y=476 +tables.NEWS.x=767 +tables.NEWS.y=555 +tables.PRESENTATIONLEVELS.x=9 +tables.PRESENTATIONLEVELS.y=391 +tables.PRESENTATIONS.x=228 +tables.PRESENTATIONS.y=255 +tables.PRESENTATIONTOPICS.x=9 +tables.PRESENTATIONTOPICS.y=310 +tables.PRESENTATIONTYPES.x=9 +tables.PRESENTATIONTYPES.y=228 +tables.PRESENTERS.x=483 +tables.PRESENTERS.y=363 +tables.QUESTIONNAIRES.x=226 +tables.QUESTIONNAIRES.y=109 +tables.QUESTIONS.x=9 +tables.QUESTIONS.y=126 +tables.REGISTRATIONDATEPRICINGRULES.x=8 +tables.REGISTRATIONDATEPRICINGRULES.y=583 +tables.REMINDERS.x=484 +tables.REMINDERS.y=584 +tables.ROLES.x=993 +tables.ROLES.y=488 +tables.ROOMS.x=1001 +tables.ROOMS.y=275 +tables.SCHEDULEENTRIES.x=483 +tables.SCHEDULEENTRIES.y=464 +tables.SESSIONS.x=731 +tables.SESSIONS.y=237 +tables.TRACKS.x=12 +tables.TRACKS.y=6 +tables.USERROLES.x=1002 +tables.USERROLES.y=407 +tables.USERS.x=764 +tables.USERS.y=371 +tables.VENUES.x=779 +tables.VENUES.y=66 diff --git a/src/midp/CVS/Entries b/src/midp/CVS/Entries new file mode 100644 index 0000000..6056e07 --- /dev/null +++ b/src/midp/CVS/Entries @@ -0,0 +1 @@ +/read-me.txt/1.1/Sat May 10 19:09:41 2003/-kb/ diff --git a/src/midp/CVS/Repository b/src/midp/CVS/Repository new file mode 100644 index 0000000..c167787 --- /dev/null +++ b/src/midp/CVS/Repository @@ -0,0 +1 @@ +tcms/src/midp diff --git a/src/midp/CVS/Root b/src/midp/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/midp/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/midp/com/ejboab/tcms/midp/NewsDisplayable.java b/src/midp/com/ejboab/tcms/midp/NewsDisplayable.java new file mode 100644 index 0000000..ac50bcd --- /dev/null +++ b/src/midp/com/ejboab/tcms/midp/NewsDisplayable.java @@ -0,0 +1,62 @@ +package com.ejboab.tcms.midp; + +import javax.microedition.lcdui.*; +import java.util.*; + +/** + * Displays a list of news items + */ +public class NewsDisplayable extends List implements CommandListener { + + public static Command getCommand = new Command("Get", Command.SCREEN, 1); + public static Command selectCommand = new Command("Select", Command.ITEM, 1); + public static Command exitCommand = new Command("Exit", Command.EXIT, 3); + + private Vector news = null; + + /** Constructor */ + public NewsDisplayable() { + super("Conference News", List.IMPLICIT); + try { + init(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + private void init() throws Exception { + setCommandListener(this); + addCommand(getCommand); + addCommand(selectCommand); + addCommand(exitCommand); + listNews(); + } + + /** Handle events*/ + public void commandAction(Command command, Displayable displayable) { + if (command == exitCommand) { + TCMSMidlet.quitApp(); + } else if (command == getCommand) { + news = SyncAgent.getAgent().getNews(); + listNews(); + } else if (command == selectCommand) { + if(news != null) { + Hashtable item = (Hashtable)news.elementAt(getSelectedIndex()); + NewsItemDisplayable nid = new NewsItemDisplayable(item, this); + TCMSMidlet.setCurrent(nid); + } + } + } + + private void listNews() { + Hashtable item = null; + if(news != null) { + for (Enumeration e = news.elements() ; e.hasMoreElements() ;) { + item = (Hashtable)e.nextElement(); + append((String)item.get("title"), null); + } + } + } + +} diff --git a/src/midp/com/ejboab/tcms/midp/NewsItemDisplayable.java b/src/midp/com/ejboab/tcms/midp/NewsItemDisplayable.java new file mode 100644 index 0000000..b45e0a5 --- /dev/null +++ b/src/midp/com/ejboab/tcms/midp/NewsItemDisplayable.java @@ -0,0 +1,51 @@ +package com.ejboab.tcms.midp; + +import java.util.*; +import javax.microedition.lcdui.*; + +/** Displays an individual News Item */ +public class NewsItemDisplayable extends Form implements CommandListener { + StringItem date; + StringItem body; + Displayable returnTo; + Hashtable item = null; + + /** + * Display a news item + * @param item News Item to display. + */ + public NewsItemDisplayable(Hashtable item, Displayable prev) { + super((String)item.get("title")); + + this.item = item; + returnTo = prev; + + try { + init(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + private void init() throws Exception { + + String sDate = ((String)item.get("date")).substring(0,10); + + date = new StringItem("Date:", sDate); + body = new StringItem("", (String)item.get("body")); + date.setLabel("Date"); + setCommandListener(this); + addCommand(new Command("Back", Command.BACK, 1)); + this.append(date); + this.append(body); + } + + /**Handle events*/ + public void commandAction(Command command, Displayable displayable) { + if(command.getCommandType() == Command.BACK) { + TCMSMidlet.setCurrent(returnTo); + } + } + +} diff --git a/src/midp/com/ejboab/tcms/midp/SyncAgent.java b/src/midp/com/ejboab/tcms/midp/SyncAgent.java new file mode 100644 index 0000000..65b8f03 --- /dev/null +++ b/src/midp/com/ejboab/tcms/midp/SyncAgent.java @@ -0,0 +1,117 @@ +package com.ejboab.tcms.midp; + +import java.util.*; + +import org.ksoap.SoapObject; +import org.ksoap.SoapFault; +import org.ksoap.transport.HttpTransport; +import org.kobjects.serialization.*; +import org.ksoap.ClassMap; +import org.ksoap.*; + +/** + * Wraps SOAP calls + */ +public class SyncAgent { + + private static SyncAgent agent = null; + + private static final String SERVER = "localhost:8080"; + + private SyncAgent() {} + + public static SyncAgent getAgent() { + if(agent == null) { + agent = new SyncAgent(); + } + return agent; + } + + /** + * Retrieves Current News Items + * @return Collection of news items as a Hashtable + */ + public Vector getNews() { + + HttpTransport ht = null; + String method = "getNews"; + Vector requests = null; + + try { + ht = createTransport(method); + + SoapObject request = createObject(method); + Vector result = (Vector)ht.call(request); + + requests = mapSoapToHash(result); + } catch (SoapFault sf) { + System.out.println(sf.faultcode + " - " + sf.faultstring); + } catch (Exception ex) { + System.out.println(ex.getMessage()); + } + + return requests; + } + + /** + * Converts Soap objects to Hashtables + * @param requests Collection of soap objects to convert + * @return Collection of objects as a Hashtable + */ + private Vector mapSoapToHash (Vector requests) { + + Vector v = new Vector(requests.size()); + Hashtable ht = null; + Object value = null; + PropertyInfo pi = new PropertyInfo(); + + for (Enumeration e = requests.elements(); e.hasMoreElements();) { + Object item = e.nextElement(); + if(item instanceof SoapObject) { + SoapObject so = (SoapObject)item; + ht = new Hashtable(); + + ht.put("class", so.getName()); + + for (int i = 0; i < so.getPropertyCount(); i++) { + so.getPropertyInfo(i, pi); + value = so.getProperty(i); + if(value instanceof SoapPrimitive) { + value = ((SoapPrimitive)value).toString(); + } + + ht.put(pi.name, value); + } + + v.addElement(ht); + } + } + return v; + + } + + /** Factory method for creating new HttpTransport intances with url to prefered server. + * @param action SOAP action placed in HTTP header (typically remote method name) + * @return new HttpTransport instance + * @throws Exception Unable to determine server from preferences + */ + private static HttpTransport createTransport(String action) throws Exception { + HttpTransport ht; + + ht = new HttpTransport("http://" + SERVER + "/tcms/services/News", action); + ht.debug = true; + return ht; + } + + /** Factory method for creating new SoapObjects with the appropriate user name + * and password. + * @return new SoapObject instance + * @param name name of soap object + * @throws Exception + */ + private static SoapObject createObject(String name) throws Exception { + SoapObject so = new SoapObject("", name); + return so; + } + +} \ No newline at end of file diff --git a/src/midp/com/ejboab/tcms/midp/TCMSMidlet.java b/src/midp/com/ejboab/tcms/midp/TCMSMidlet.java new file mode 100644 index 0000000..f425aba --- /dev/null +++ b/src/midp/com/ejboab/tcms/midp/TCMSMidlet.java @@ -0,0 +1,42 @@ +package com.ejboab.tcms.midp; + +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; + +public class TCMSMidlet extends MIDlet { + private static TCMSMidlet instance; + private NewsDisplayable displayable = new NewsDisplayable(); + + public TCMSMidlet() { + instance = this; + } + + /** Start method */ + public void startApp() { + setCurrent(displayable); + } + + /** Handle pausing */ + public void pauseApp() { + } + + /** Clean up */ + public void destroyApp(boolean unconditional) { + } + + /** Exit */ + public static void quitApp() { + instance.destroyApp(true); + instance.notifyDestroyed(); + instance = null; + } + + public static void setCurrent(Displayable next) { + Display.getDisplay(instance).setCurrent(next); + } + + public static void setCurrent(Alert alert, Displayable next) { + Display.getDisplay(instance).setCurrent(alert, next); + } + +} diff --git a/src/midp/org/kobjects/base64/Base64.java b/src/midp/org/kobjects/base64/Base64.java new file mode 100644 index 0000000..d22a9fd --- /dev/null +++ b/src/midp/org/kobjects/base64/Base64.java @@ -0,0 +1,161 @@ +/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. */ + + +package org.kobjects.base64; + +import java.io.*; + +public class Base64 { + + static final char[] charTab = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + .toCharArray(); + + public static String encode(byte[] data) { + return encode(data, 0, data.length, null).toString(); + } + + /** Encodes the part of the given byte array denoted by start and + len to the Base64 format. The encoded data is appended to the + given StringBuffer. If no StringBuffer is given, a new one is + created automatically. The StringBuffer is the return value of + this method. */ + + public static StringBuffer encode( + byte[] data, + int start, + int len, + StringBuffer buf) { + + if (buf == null) + buf = new StringBuffer(data.length * 3 / 2); + + int end = len - 3; + int i = start; + int n = 0; + + while (i <= end) { + int d = + ((((int) data[i]) & 0x0ff) << 16) + | ((((int) data[i + 1]) & 0x0ff) << 8) + | (((int) data[i + 2]) & 0x0ff); + + buf.append(charTab[(d >> 18) & 63]); + buf.append(charTab[(d >> 12) & 63]); + buf.append(charTab[(d >> 6) & 63]); + buf.append(charTab[d & 63]); + + i += 3; + + if (n++ >= 14) { + n = 0; + buf.append("\r\n"); + } + } + + if (i == start + len - 2) { + int d = + ((((int) data[i]) & 0x0ff) << 16) + | ((((int) data[i + 1]) & 255) << 8); + + buf.append(charTab[(d >> 18) & 63]); + buf.append(charTab[(d >> 12) & 63]); + buf.append(charTab[(d >> 6) & 63]); + buf.append("="); + } + else if (i == start + len - 1) { + int d = (((int) data[i]) & 0x0ff) << 16; + + buf.append(charTab[(d >> 18) & 63]); + buf.append(charTab[(d >> 12) & 63]); + buf.append("=="); + } + + return buf; + } + + static int decode(char c) { + if (c >= 'A' && c <= 'Z') + return ((int) c) - 65; + else if (c >= 'a' && c <= 'z') + return ((int) c) - 97 + 26; + else if (c >= '0' && c <= '9') + return ((int) c) - 48 + 26 + 26; + else + switch (c) { + case '+' : + return 62; + case '/' : + return 63; + case '=' : + return 0; + default : + throw new RuntimeException( + "unexpected code: " + c); + } + } + + /** Decodes the given Base64 encoded String to a new byte array. + The byte array holding the decoded data is returned. */ + + public static byte[] decode(String s) { + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try { + decode(s, bos); + } + catch (IOException e) { + throw new RuntimeException(); + } + return bos.toByteArray(); + } + + public static void decode(String s, OutputStream os) + throws IOException { + int i = 0; + + int len = s.length(); + + while (true) { + while (i < len && s.charAt(i) <= ' ') + i++; + + if (i == len) + break; + + int tri = + (decode(s.charAt(i)) << 18) + + (decode(s.charAt(i + 1)) << 12) + + (decode(s.charAt(i + 2)) << 6) + + (decode(s.charAt(i + 3))); + + os.write((tri >> 16) & 255); + if (s.charAt(i + 2) == '=') + break; + os.write((tri >> 8) & 255); + if (s.charAt(i + 3) == '=') + break; + os.write(tri & 255); + + i += 4; + } + } +} \ No newline at end of file diff --git a/src/midp/org/kobjects/isodate/IsoDate.java b/src/midp/org/kobjects/isodate/IsoDate.java new file mode 100644 index 0000000..12fb20f --- /dev/null +++ b/src/midp/org/kobjects/isodate/IsoDate.java @@ -0,0 +1,149 @@ +/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. */ + + +package org.kobjects.isodate; + +import java.util.*; + +public class IsoDate { + + public static final int DATE = 1; + public static final int TIME = 2; + public static final int DATE_TIME = 3; + + static void dd(StringBuffer buf, int i) { + buf.append((char) (((int) '0') + i / 10)); + buf.append((char) (((int) '0') + i % 10)); + } + + public static String dateToString(Date date, int type) { + + Calendar c = Calendar.getInstance(); + c.setTimeZone(TimeZone.getTimeZone("GMT")); + c.setTime(date); + + StringBuffer buf = new StringBuffer(); + + if ((type & DATE) != 0) { + int year = c.get(Calendar.YEAR); + dd(buf, year / 100); + dd(buf, year % 100); + buf.append('-'); + dd( + buf, + c.get(Calendar.MONTH) - Calendar.JANUARY + 1); + buf.append('-'); + dd(buf, c.get(Calendar.DAY_OF_MONTH)); + + if (type == DATE_TIME) + buf.append("T"); + } + + if ((type & TIME) != 0) { + dd(buf, c.get(Calendar.HOUR_OF_DAY)); + buf.append(':'); + dd(buf, c.get(Calendar.MINUTE)); + buf.append(':'); + dd(buf, c.get(Calendar.SECOND)); + buf.append('.'); + int ms = c.get(Calendar.MILLISECOND); + buf.append((char) (((int) '0') + (ms / 100))); + dd(buf, ms % 100); + buf.append('Z'); + } + + return buf.toString(); + } + + public static Date stringToDate(String text, int type) { + + Calendar c = Calendar.getInstance(); + + if ((type & DATE) != 0) { + c.set( + Calendar.YEAR, + Integer.parseInt(text.substring(0, 4))); + c.set( + Calendar.MONTH, + Integer.parseInt(text.substring(5, 7)) + - 1 + + Calendar.JANUARY); + c.set( + Calendar.DAY_OF_MONTH, + Integer.parseInt(text.substring(8, 10))); + + if (type != DATE_TIME || text.length () < 11) { + c.set(Calendar.HOUR_OF_DAY, 0); + c.set(Calendar.MINUTE, 0); + c.set(Calendar.SECOND, 0); + c.set(Calendar.MILLISECOND, 0); + return c.getTime(); + } + text = text.substring(11); + } + else + c.setTime(new Date(0)); + + + c.set( + Calendar.HOUR_OF_DAY, + Integer.parseInt(text.substring(0, 2))); + // -11 + c.set( + Calendar.MINUTE, + Integer.parseInt(text.substring(3, 5))); + c.set( + Calendar.SECOND, + Integer.parseInt(text.substring(6, 8))); + + int pos = 8; + if (pos < text.length() && text.charAt(pos) == '.') { + int ms = 0; + int f = 100; + while (true) { + char d = text.charAt(++pos); + if (d < '0' || d > '9') + break; + ms += (d - '0') * f; + f /= 10; + } + c.set(Calendar.MILLISECOND, ms); + } + else + c.set(Calendar.MILLISECOND, 0); + + if (pos < text.length()) { + + if (text.charAt(pos) == '+' + || text.charAt(pos) == '-') + c.setTimeZone( + TimeZone.getTimeZone( + "GMT" + text.substring(pos))); + + else if (text.charAt(pos) == 'Z') + c.setTimeZone(TimeZone.getTimeZone("GMT")); + else + throw new RuntimeException("illegal time format!"); + } + + return c.getTime(); + } +} \ No newline at end of file diff --git a/src/midp/org/kobjects/serialization/ElementType.java b/src/midp/org/kobjects/serialization/ElementType.java new file mode 100644 index 0000000..3aac01d --- /dev/null +++ b/src/midp/org/kobjects/serialization/ElementType.java @@ -0,0 +1,82 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli + * + * */ + + +package org.kobjects.serialization; + +/** This class encapsulates type information. */ + + +public class ElementType { + + public static final Class OBJECT_CLASS = new Object ().getClass (); + public static final Class STRING_CLASS = "".getClass (); + public static final Class INTEGER_CLASS = new Integer (0).getClass (); + public static final Class LONG_CLASS = new Long (0).getClass (); + public static final Class BOOLEAN_CLASS = new Boolean (true).getClass (); + public static final Class VECTOR_CLASS = new java.util.Vector ().getClass (); + + public static final ElementType OBJECT_TYPE = + new ElementType (OBJECT_CLASS, false, null); + + + /** Type of the property/elements. Should usually be + an instance of class, */ + + public Object type; + + /** if a property is multi-referenced, set this flag to true. */ + + public boolean multiRef; + + /** Element type for array properties, null if not array prop. */ + + public ElementType elementType; + + + public ElementType () { + } + + + public ElementType (Object type) { + this.type = type; + } + + public ElementType (Object type, boolean multiRef, + ElementType elementType) { + + this.type = type; + this.multiRef = multiRef; + this.elementType = elementType; + } + + + public void clear () { + type = null; + multiRef = false; + elementType = null; + } + + public void copy (ElementType t2) { + type = t2.type; + multiRef = t2.multiRef; + elementType = t2.elementType; + } +} diff --git a/src/midp/org/kobjects/serialization/KvmSerializable.java b/src/midp/org/kobjects/serialization/KvmSerializable.java new file mode 100644 index 0000000..6e1c3c6 --- /dev/null +++ b/src/midp/org/kobjects/serialization/KvmSerializable.java @@ -0,0 +1,64 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli + * + * */ + + +package org.kobjects.serialization; + + +/** provides get and set methods for properties. Can be used to + replace reflection (to some extend) for "serialization-aware" + classes. Currently used in kSOAP and the RMS based kobjects object + repository */ + + + +public interface KvmSerializable { + + + /** + * Returns the property at a specified index (for serialization) + * + * @param index the specified index + * @return the serialized property + */ + + Object getProperty (int index); + + /** returns the number of serializable properties */ + + int getPropertyCount (); + + + + /** + * sets the property with the given index to the given value. + * @param index the index to be set + * @param value the value of the property + */ + void setProperty (int index, Object value); + + + + /** Fills the given property info record */ + + void getPropertyInfo (int index, PropertyInfo info); + + +} diff --git a/src/midp/org/kobjects/serialization/PropertyInfo.java b/src/midp/org/kobjects/serialization/PropertyInfo.java new file mode 100644 index 0000000..955c5ac --- /dev/null +++ b/src/midp/org/kobjects/serialization/PropertyInfo.java @@ -0,0 +1,71 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli + * + * */ + + +package org.kobjects.serialization; + +/** This class is used to store information about each property + an implementation of KvmSerializable exposes. */ + + +public class PropertyInfo extends ElementType { + + + /** Name of the property */ + + public String name; + + /** the equivalent to transient, but named differently because + transient is a reserved keyword */ + + public boolean nonpermanent; + + /* + public String toString () { + return "property "+ name + ": " + type + (elementType == null ? "" : "["+elementType+"]"); + } + */ + + public PropertyInfo () { + } + + + public PropertyInfo (String name, Object type) { + super (type); + this.name = name; + } + + + public PropertyInfo (String name, Object type, boolean multiRef, + ElementType elementType) { + super (type, multiRef, elementType); + this.name = name; + } + + + public void clear () { + name = null; + nonpermanent = false; + super.clear (); + } + + + +} diff --git a/src/midp/org/ksoap/ClassMap.java b/src/midp/org/ksoap/ClassMap.java new file mode 100644 index 0000000..07c7988 --- /dev/null +++ b/src/midp/org/ksoap/ClassMap.java @@ -0,0 +1,260 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): F. Hunter + * + * */ + + +package org.ksoap; + +import org.kobjects.serialization.*; +import java.io.*; +import java.util.Vector; +import java.util.Hashtable; +import org.kxml.*; + +/** This class provides various soap properties relevant for + (de)serialization, including a method for defining mappings + between java classes and XML element names. */ + + +public class ClassMap { + + + + /** Determines if type attributes are included for all objects + written. If true, the type attribute is only written if the + actual type differs from the declared type. */ + + public boolean implicitTypes; + public int version; + public PrefixMap prefixMap; + public String xsi; + public String xsd; + public String env; + public String enc; + + protected int cnt; + + static final Marshal DEFAULT_MARSHAL = new DM (); + + /** Map from XML qualified names to Java classes */ + + protected Hashtable qNameToClass = new Hashtable (); + + + /** Map from Java class names to XML name and namespace pairs */ + + protected Hashtable classToQName = new Hashtable (); + + + + /** deprecated + + Create a new class map using the 2001 version of the + XML schema namespace. */ + + public ClassMap () { + this (Soap.VER11); + } + + + + + public ClassMap (int version) { + this.version = version; + prefixMap = Soap.prefixMap [version]; + + if (version == Soap.VER10) { + xsi = Soap.XSI1999; + xsd = Soap.XSD1999; + } + else { + xsi = Soap.XSI; + xsd = Soap.XSD; + } + + if (version < Soap.VER12) { + enc = Soap.ENC; + env = Soap.ENV; + } + else { + enc = Soap.ENC2001; + env = Soap.ENV2001; + } + + addMapping (enc, "Array", ElementType.VECTOR_CLASS); + DEFAULT_MARSHAL.register (this); + } + + + /** deprecated + + Creates a new Class map. If the legacy flag is set to true, + the 1999 version of the XML Schema namespace is used, otherwise + the 2001 version. */ + + + + public ClassMap (boolean legacy) { + this (legacy ? Soap.VER10 : Soap.VER11); + } + + + + /** Returns a new object read from the given parser. If no + mapping is found, null is returned. This method is used by + the SoapParser in order to convert the XML code to Java + objects. */ + + + public Object readInstance (SoapParser parser, + String namespace, String name, + ElementType expected) throws IOException{ + + /* if (xsdNamespace.equals (namespace)) { + if ("int".equals (name)) + return new Integer (Integer.parseInt (readText (parser))); + else if ("long".equals (name)) + return new Long (Long.parseLong (readText (parser))); + else if ("string".equals (name)) + return readText (parser); + else if ("boolean".equals (name)) + return new Boolean (Soap.stringToBoolean (readText (parser))); + }*/ + + Class clazz = null; + + Object obj = qNameToClass.get + (new SoapPrimitive (namespace, name, null)); + + if (obj == null) return null; + + if (obj instanceof Marshal) + return ((Marshal) obj).readInstance + (parser, namespace, name, expected); + + if (obj instanceof SoapObject) + obj = ((SoapObject) obj).newInstance (); + else + try { + obj = ((Class) obj).newInstance (); + } + catch (Exception e) { + throw new RuntimeException (e.toString ()); + } + + // ok, obj is now the instance, fill it.... + + if (obj instanceof KvmSerializable) + parser.readSerializable ((KvmSerializable) obj); + else if (obj instanceof Vector) + parser.readVector ((Vector) obj, expected.elementType); + else throw new RuntimeException ("no deserializer for "+ obj.getClass ()); + + return obj; + } + + + + + /** Returns a string array containing the namespace, name, id and + Marshal object for the given java object. This method is used + by the SoapWriter in order to map Java objects to the + corresponding SOAP section five XML code.*/ + + public Object [] getInfo (Object type, Object instance) { + + + if (type == null) { + if (instance instanceof SoapObject + || instance instanceof SoapPrimitive) + type = instance; + else + type = instance.getClass (); + } + + + if (type instanceof SoapObject) { + SoapObject so = (SoapObject) type; + return new Object [] + {so.getNamespace (), so.getName (), null, null}; + } + + if (type instanceof SoapPrimitive) { + SoapPrimitive sp = (SoapPrimitive) type; + return new Object [] + {sp.getNamespace (), sp.getName (), null, DEFAULT_MARSHAL}; + } + + if ((type instanceof Class) + && type != ElementType.OBJECT_CLASS) { + + Object [] tmp = (Object []) classToQName.get + (((Class) type).getName ()); + + if (tmp != null) return tmp; + } + + return new Object [] {xsd, "anyType", null, null}; + } + + + /** Defines a direct mapping from a namespace and name to a java + class (and vice versa), using the given marshal mechanism */ + + public void addMapping (String namespace, String name, + Class clazz, Marshal marshal) { + + qNameToClass.put (new SoapPrimitive (namespace, name, null), + marshal == null ? (Object) clazz : marshal); + + classToQName.put (clazz.getName (), + new Object [] {namespace, name, null, marshal}); + + if (prefixMap.getPrefix (namespace) == null) + prefixMap = new PrefixMap (prefixMap, "n"+(cnt++), namespace); + } + + + /** Defines a direct mapping from a namespace and name to a java + class (and vice versa) */ + + public void addMapping (String namespace, String name, Class clazz) { + + addMapping (namespace, name, clazz, null); + } + + + /** Adds a SoapObject to the class map. During parsing, + objects of the given type (namespace/name) will be + mapped to corresponding copies of the given SoapObject, + maintaining the structure of the template. */ + + public void addTemplate (SoapObject so) { + + qNameToClass.put + (new SoapPrimitive (so.namespace, so.name, null), so); + + if (prefixMap.getPrefix (so.namespace) == null) + prefixMap = new PrefixMap (prefixMap, "n"+(cnt++), so.namespace); + } + +} + + + diff --git a/src/midp/org/ksoap/DM.java b/src/midp/org/ksoap/DM.java new file mode 100644 index 0000000..bc46bf6 --- /dev/null +++ b/src/midp/org/ksoap/DM.java @@ -0,0 +1,49 @@ +package org.ksoap; + + +import java.io.*; +import org.kobjects.serialization.*; +import org.kxml.parser.*; + +/** This class is not public, so save a few bytes + by using a short class name (DM stands for DefaultMarshal)... */ + +class DM implements Marshal { + + + public Object readInstance (SoapParser parser, + String namespace, String name, + ElementType expected) throws IOException { + + parser.parser.read (); // read start tag; + String text = parser.parser.readText (); + parser.parser.read (); // read end tag + switch (name.charAt (0)) { + case 's': return text; + case 'i': return new Integer (Integer.parseInt (text)); + case 'l': return new Long (Long.parseLong (text)); + case 'b': return new Boolean (Soap.stringToBoolean (text)); + default: + throw new RuntimeException (); + } + } + + + + public void writeInstance (SoapWriter writer, + Object instance) throws IOException { + + writer.writer.write (instance.toString ()); + } + + public void register (ClassMap cm) { + cm.addMapping (cm.xsd, "int", ElementType.INTEGER_CLASS, this); + cm.addMapping (cm.xsd, "long", ElementType.LONG_CLASS, this); + cm.addMapping (cm.xsd, "string", ElementType.STRING_CLASS, this); + cm.addMapping (cm.xsd, "boolean", ElementType.BOOLEAN_CLASS, this); + } +} + + + + diff --git a/src/midp/org/ksoap/Marshal.java b/src/midp/org/ksoap/Marshal.java new file mode 100644 index 0000000..2c35392 --- /dev/null +++ b/src/midp/org/ksoap/Marshal.java @@ -0,0 +1,42 @@ +package org.ksoap; + +import java.io.*; +import org.kobjects.serialization.*; + +/** Abstract class for custom (de)serialization. */ + + +public interface Marshal { + + + /** This methods reads an instance from the given parser. For + implementation, please note that the start and and tag must be + consumed. This is not symmetric to writeInstance, but + otherwise it would not be possible to access the attributes of + the start tag here. The underlying XML parser is accessible + using parser.parser. */ + + public Object readInstance (SoapParser parser, + String namespace, String name, + ElementType expected) throws IOException; + + + /** Write the instance to the given SoapWriter. In contrast to + readInstance, it is not neccessary to care about the + sorrounding start and end tags. Additional attributes must be + writen before anything else is written. The underlying xml + writer is accessible using writer.writer. */ + + public void writeInstance (SoapWriter writer, + Object instance) throws IOException; + + + /** Register this Marshal with the given classMap */ + + public void register (ClassMap cm); +} + + + + + diff --git a/src/midp/org/ksoap/Soap.java b/src/midp/org/ksoap/Soap.java new file mode 100644 index 0000000..390b9f6 --- /dev/null +++ b/src/midp/org/ksoap/Soap.java @@ -0,0 +1,101 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli + * + * */ + + +package org.ksoap; + +import org.kxml.*; + +/** Contains some constant definitions only. */ + + +public class Soap { + + public static final int VER10 = 0; + public static final int VER11 = 1; + public static final int VER12 = 2; + + + + public static final String ENV2001 = + "http://www.w3.org/2001/12/soap-envelope"; + + + public static final String ENC2001 = + "http://www.w3.org/2001/12/soap-encoding"; + + /** Namespace constant: http://schemas.xmlsoap.org/soap/envelope/ */ + + public static final String ENV = + "http://schemas.xmlsoap.org/soap/envelope/"; + + /** Namespace constant: http://schemas.xmlsoap.org/soap/encoding/ */ + + public static final String ENC = + "http://schemas.xmlsoap.org/soap/encoding/"; + + /** Namespace constant: http://www.w3.org/2001/XMLSchema */ + + public static final String XSD = + "http://www.w3.org/2001/XMLSchema"; + + /** Namespace constant: http://www.w3.org/2001/XMLSchema */ + + public static final String XSI = + "http://www.w3.org/2001/XMLSchema-instance"; + + /** Namespace constant: http://www.w3.org/1999/XMLSchema */ + + public static final String XSD1999 = + "http://www.w3.org/1999/XMLSchema"; + + /** Namespace constant: http://www.w3.org/1999/XMLSchema */ + + public static final String XSI1999 = + "http://www.w3.org/1999/XMLSchema-instance"; + + // static final Class BYTE_ARRAY_CLASS = new byte [0].getClass (); + // static final Class OBJECT_CLASS = new Object ().getClass (); + + /** A default prefix map containing all relevant namespaces */ + + static PrefixMap basePrefixMap = + new PrefixMap (new PrefixMap + (PrefixMap.DEFAULT, "SOAP-ENV", ENV), "SOAP-ENC", ENC); + + public static final PrefixMap [] prefixMap = { + new PrefixMap (new PrefixMap + (basePrefixMap, "xsd", XSD1999), "xsi", XSI1999), + new PrefixMap (new PrefixMap + (basePrefixMap, "xsd", XSD), "xsi", XSI), + new PrefixMap (new PrefixMap (new PrefixMap (new PrefixMap + (basePrefixMap, "xsd", XSD), "xsi", XSI), "SOAP-ENV", ENV2001), "SOAP-ENC", ENC2001)}; + + + static boolean stringToBoolean (String s) { + + if (s == null) return false; + + s = s.trim ().toLowerCase (); + return (s.equals ("1") || s.equals ("true")); + } + +} + diff --git a/src/midp/org/ksoap/SoapEnvelope.java b/src/midp/org/ksoap/SoapEnvelope.java new file mode 100644 index 0000000..9ae8bc8 --- /dev/null +++ b/src/midp/org/ksoap/SoapEnvelope.java @@ -0,0 +1,216 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli + * + * */ + + +package org.ksoap; + +import java.io.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; +import org.kobjects.serialization.*; + + +/** The SOAP envelope. */ + + +public class SoapEnvelope { + + Object body; + ClassMap classMap; + String encodingStyle; + + /** deprecated */ + + public SoapEnvelope () { + this (new ClassMap ()); + } + + + public SoapEnvelope (ClassMap classMap) { + this.classMap = classMap; + } + + + /** Returns the body object of the envelope. */ + + + public Object getBody () { + return body; + } + + + /** Returns the first property of the body object */ + + public Object getResult () { + KvmSerializable ks = (KvmSerializable) body; + return ks.getPropertyCount () == 0 ? null : ks.getProperty (0); + } + + + /** Parses the SOAP envelope from the given parser */ + + + public void parse (AbstractXmlParser parser) throws IOException { + + parseHead (parser); + parseBody (parser); + parseTail (parser); + } + + + public void parseHead (AbstractXmlParser parser) throws IOException { + parser.skip (); + StartTag tag = (StartTag) parser.read (Xml.START_TAG, classMap.env, + "Envelope"); + Attribute attr = tag.getAttribute (classMap.env, "encodingStyle"); + if (attr != null) encodingStyle = attr.getValue (); + + parser.skip (); + + if (parser.peek (Xml.START_TAG, classMap.env, "Header")) { + // consume start header + + parser.read (); + parser.skip (); + + // look at all header entries + while (parser.peek().getType( ) != Xml.END_TAG) { + attr = parser.peek ().getAttribute + (classMap.env, "mustUnderstand"); + + if (attr != null && attr.getValue ().equals ("1")) + throw new RuntimeException ("mU not supported"); + + parser.ignoreTree( ); + parser.skip( ); + } + + parser.read (Xml.END_TAG, classMap.env, "Header"); + } + + parser.skip (); + tag = (StartTag) parser.read (Xml.START_TAG, classMap.env, "Body"); + attr = tag.getAttribute (classMap.env, "encodingStyle"); + if (attr != null) encodingStyle = attr.getValue (); + } + + + public void parseBody (AbstractXmlParser parser) throws IOException { + + parser.skip (); + // insert fault generation code here + + if (parser.peek (Xml.START_TAG, classMap.env, "Fault")) { + SoapFault fault = new SoapFault (); + fault.parse (parser); + body = fault; + } + else if (body != null && body instanceof XmlIO) + ((XmlIO) body).parse (parser); + else + body = new SoapParser + (parser, classMap).read (); + } + + + + public void parseTail (AbstractXmlParser parser) throws IOException { + + parser.skip (); + parser.read (Xml.END_TAG, classMap.env, "Body"); + + parser.skip (); + parser.read (Xml.END_TAG, classMap.env, "Envelope"); + } + + + /** Sets the encoding style. */ + + public void setEncodingStyle (String encodingStyle) { + this.encodingStyle = encodingStyle; + } + + + /** Writes the envelope and body to the given XML writer. */ + + public void write (AbstractXmlWriter writer) throws IOException { + writeHead (writer); + writeBody (writer); + writeTail (writer); + } + + + /** Writes the head including the encoding style attribute and the + body start tag */ + + + public void writeHead (AbstractXmlWriter writer) throws IOException { + + writer.startTag (classMap.prefixMap, classMap.env, "Envelope"); + // writer.attribute (Soap.ENV, "encodingStyle", encodingStyle); + writer.startTag (classMap.env, "Body"); + } + + + + /** Overwrite this method for customized writing of + the soap message body. */ + + + public void writeBody (AbstractXmlWriter writer) throws IOException { + + if (body instanceof XmlIO) { + if (encodingStyle != null) + writer.attribute + (classMap.env, "encodingStyle", encodingStyle); + + ((XmlIO) body).write (writer); + } + else { + writer.attribute + (classMap.env, "encodingStyle", + encodingStyle == null ? classMap.enc : encodingStyle); + + new SoapWriter (writer, classMap).write (body); + } + } + + + public void writeTail (AbstractXmlWriter writer) throws IOException { + writer.endTag (); + writer.endTag (); + } + + + + public void setBody (Object body) { + this.body = body; + } + + + public void setClassMap (ClassMap classMap) { + this.classMap = classMap; + } + +} + + diff --git a/src/midp/org/ksoap/SoapFault.java b/src/midp/org/ksoap/SoapFault.java new file mode 100644 index 0000000..5d9e15b --- /dev/null +++ b/src/midp/org/ksoap/SoapFault.java @@ -0,0 +1,89 @@ +package org.ksoap; + +import java.util.Vector; +import java.io.*; +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; + +public class SoapFault extends IOException implements XmlIO { + + public String faultcode; + public String faultstring; + public String faultactor; + public Vector detail; + + public void parse (AbstractXmlParser parser) throws IOException { + parser.read (Xml.START_TAG, Soap.ENV, "Fault"); + + while (true) { + parser.skip (); + ParseEvent ev = parser.peek (); + switch (ev.getType ()) { + + case Xml.START_TAG: + { + String name = ev.getName (); + + if (name.equals ("detail")) { + detail = new Vector (); + parser.readTree (detail); + } + else { + parser.read (); + String value = parser.readText (); + parser.read (); + + + if (name.equals ("faultcode")) + faultcode = value; + else if (name.equals ("faultstring")) + faultstring = value; + else if (name.equals ("faultactor")) + faultactor = value; + } + } + break; + + case Xml.END_TAG: + parser.read (); + return; + default: + parser.read (); // ignore text + } + } + } + + + public void write (AbstractXmlWriter xw) throws IOException { + xw.startTag (Soap.ENV, "Fault"); + xw.startTag ("faultcode"); + xw.write (""+ faultcode); + xw.endTag (); + xw.startTag ("faultstring"); + xw.write (""+ faultstring); + xw.endTag (); + + xw.startTag ("detail"); + + if (detail != null) + for (int i = 0; i < detail.size (); i++) { + xw.startTag ("item"); + xw.write (""+detail.elementAt (i)); + xw.endTag (); + } + + xw.endTag (); + xw.endTag (); + } + + + public String toString () { + return "SoapFault - faultcode: '"+faultcode + +"' faultstring: '"+faultstring + +"' faultactor: '"+faultactor + +"' detail: "+detail; + + } + +} diff --git a/src/midp/org/ksoap/SoapObject.java b/src/midp/org/ksoap/SoapObject.java new file mode 100644 index 0000000..f71c3eb --- /dev/null +++ b/src/midp/org/ksoap/SoapObject.java @@ -0,0 +1,218 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, Dave Dash, Andre Gerard, F. Hunter, + * Renaud Tognelli + * + * */ + + +package org.ksoap; + +import java.util.Vector; +import org.kobjects.serialization.*; + + +/** A simple dynamic object that can be used to build + soap calls without implementing KvmSerializable */ + +/** + * A simple dynamic object that can be used to build soap calls without + * implementing KvmSerializable + *

    Essentially, this is what goes inside the body of a soap envelope - + * it is the direct subelement of the body and all further subelements

    + *

    Instead of this this class, custom classes + * can be used if they implement the KvmSerializable interface.

    + */ + +public class SoapObject implements KvmSerializable { + + String namespace; + String name; + Vector info = new Vector (); + Vector data = new Vector (); + /** + * Creates a new SoapObject instance. + * + * @param namespace the namespace for the soap object + * @param name the name of the soap object + */ + + public SoapObject (String namespace, String name) { + this.namespace = namespace; + this.name = name; + } + + + public boolean equals (Object o) { + if (!(o instanceof SoapObject)) return false; + + SoapObject so = (SoapObject) o; + int cnt = data.size (); + + if (cnt != so.data.size ()) return false; + + try { + for (int i = 0; i < cnt; i++) + if (!data.elementAt (i).equals + (so.getProperty (((PropertyInfo) info.elementAt (i)).name))) + return false; + } + catch (Exception e) { + return false; + } + return true; + } + + + public String getName () { + return name; + } + + + public String getNamespace () { + return namespace; + } + + + /** + * Returns a specific property at a certain index. + * + * @param index the index of the desired property + * @return the desired property + */ + public Object getProperty (int index) { + return data.elementAt (index); + } + + + public Object getProperty (String name) { + + for (int i = 0; i < data.size (); i++) { + if (name.equals (((PropertyInfo) info.elementAt (i)).name)) + return data.elementAt (i); + } + + throw new RuntimeException ("illegal property: "+name); + } + + + /** + * Returns the number of properties + * + * @return the number of properties + */ + + public int getPropertyCount () { + return data.size (); + } + + /** + * Places PropertyInfo of desired property into a designated PropertyInfo + * object + * + * @param index index of desired property + * @param info designated retainer of desired property + */ + + public void getPropertyInfo (int index, PropertyInfo pi) { + PropertyInfo p = (PropertyInfo) info.elementAt (index); + pi.name = p.name; + pi.copy (p); + } + + + + /** + * Creates a new SoapObject based on this, allows usage of SoapObjects + * as templates. One application is to set the expected return type + * of a soap call if the server does not send explicit type information. + * + * @return a copy of this. + */ + + public SoapObject newInstance () { + SoapObject o = new SoapObject (namespace, name); + for (int i = 0; i < data.size (); i++) { + PropertyInfo p = (PropertyInfo) info.elementAt (i); + o.addProperty (p.name, p, data.elementAt (i)); + } + return o; + } + + + /** + * Sets a specified property to a certain value. + * + * @param index the index of the specified property + * @param value the new value of the property + */ + public void setProperty (int index, Object value) { + data.setElementAt (value, index); + } + + + /** + * Adds a property (parameter) to the object. This is essentially + * a sub element. + * + * @param name The name of the property + * @param value the value of the property + */ + public SoapObject addProperty (String name, Object value) { + + return addProperty + (new PropertyInfo + (name, value == null + ? ElementType.OBJECT_CLASS + : value.getClass ()), + value); + } + + + /** @deprecated + Adds a property (parameter) to the object. This is essentially + a sub element. + + @param name the name of the property + @param type the type or class of the element + @param value the value of the property + */ + + public SoapObject addProperty (String name, ElementType type, + Object value) { + + PropertyInfo p = new PropertyInfo (); + p.copy (type); + p.name = name; + return addProperty (p, value); + } + + + /** Adds a property (parameter) to the object. This is + essentially a sub element. + + @param name the name of the property + @param type the type or class of the element + @param value the value of the property */ + + public SoapObject addProperty (PropertyInfo pi, Object value) { + info.addElement (pi); + data.addElement (value); + return this; + } + +} diff --git a/src/midp/org/ksoap/SoapParser.java b/src/midp/org/ksoap/SoapParser.java new file mode 100644 index 0000000..c22b780 --- /dev/null +++ b/src/midp/org/ksoap/SoapParser.java @@ -0,0 +1,372 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli, Sean McDaniel + * + * */ + +package org.ksoap; + +import java.util.*; +import java.io.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; +import org.kobjects.serialization.*; + + +/** A SOAP parser. Limitations: +
      +
    • Partial arrays are not yet supported
    • +
    • Multi-Dimensional Arrays are not supported
    • +
    • The hrefs must be local
    • +
    + + */ + +public class SoapParser { + + ClassMap classMap; + Hashtable idMap = new Hashtable (); + public AbstractXmlParser parser; + + + class FwdRef { + FwdRef next; + Object obj; + int index; + } + + + public SoapParser (AbstractXmlParser parser, + ClassMap classMap) { + + this.parser = parser; + this.classMap = classMap; + } + + + + + /** Extracts namespace and name and calls readBody for actual reading */ + + public Object read () throws IOException { + + Object root = null; + + //System.out.println ("start parsing...."); + + + while (true) { + parser.skip (); + int type = parser.peek ().getType (); + + if (type == Xml.END_TAG || type == Xml.END_DOCUMENT) + break; + else if (type != Xml.START_TAG) + throw new IOException ("Unexpected event: "+parser.peek ()); + + StartTag start = (StartTag) parser.peek (); + + // String name = namespaceMap.getPackage (start.getNamespace ()) + // + "." + start.getName (); + + Object o = read + (null, -1, + start.getNamespace (), start.getName (), + ElementType.OBJECT_TYPE); + + Attribute attr = start.getAttribute (classMap.enc, "root"); + if ((attr != null && attr.getValue ().equals ("1")) + || root == null) + root = o; + } + + //System.out.println ("leaving root read"); + + return root; + } + + + + + /** Builds an object from the XML stream. This method + is public for usage in conjuction with Marshal subclasses. */ + + public Object read (Object owner, int index, + String namespace, String name, + ElementType expected) + + throws IOException { + + // System.out.println ("in read"); + + + StartTag start = (StartTag) parser.peek (); + + // determine wire element type + + String href = start.getValueDefault ("href", null); + Object obj; + + if (href != null) { + if (owner == null) + throw new RuntimeException ("href at root level?!?"); + + href = href.substring (1); + obj = idMap.get (href); + + if (obj == null || obj instanceof FwdRef) { + + FwdRef f = new FwdRef (); + f.next = (FwdRef) obj; + f.obj = owner; + f.index = index; + idMap.put (href, f); + obj = null; + } + + parser.read (); // start tag + parser.skip (); + parser.read (Xml.END_TAG, null, null); + } + else { + Attribute attr = start.getAttribute + (classMap.xsi, "nil"); + + if (attr == null) attr = start.getAttribute + (classMap.xsi, "null"); + + if (attr != null && Soap.stringToBoolean (attr.getValue ())) { + obj = null; + parser.read (); // start tag + parser.skip (); + parser.read (Xml.END_TAG, null, null); + } + else { + + attr = start.getAttribute + (classMap.xsi, "type"); + + if (attr != null) { + String type = attr.getValue (); + int cut = type.indexOf (':'); + + name = type.substring (cut + 1); + String prefix = cut == -1 ? "" : type.substring (0, cut); + namespace = start.getPrefixMap ().getNamespace (prefix); + } + else if (name == null && namespace == null) { + if (start.getAttribute (classMap.enc, "arrayType") != null) { + namespace = classMap.enc; + name = "Array"; + } + else { + Object [] names = classMap.getInfo + (expected.type, null); + + namespace = (String) names [0]; + name = (String) names [1]; + + // System.out.println ("getInfo for "+expected.type+": {"+namespace+"}"+name); + } + } + + obj = classMap.readInstance + (this, namespace, name, expected); + + if (obj == null) + obj = readUnknown (namespace, name); + } + + // finally, care about the id.... + String id = start.getValueDefault ("id", null); + + if (id != null) { + Object hlp = idMap.get (id); + if (hlp instanceof FwdRef) { + FwdRef f = (FwdRef) hlp; + do { + if (f.obj instanceof KvmSerializable) + ((KvmSerializable) f.obj) + .setProperty (f.index, obj); + else + ((Vector) f.obj) + .setElementAt (obj, f.index); + + f = f.next; + } + while (f != null); + } + else if (hlp != null) + throw new RuntimeException ("double ID"); + + idMap.put (id, obj); + } + } + + // System.out.println ("leaving read"); + + return obj; + } + + + + protected void readSerializable (KvmSerializable obj) + throws IOException { + + parser.read (); // read start tag + + int testIndex = -1; // inc at beg. of loop for perf. reasons + int sourceIndex = 0; + int cnt = obj.getPropertyCount (); + PropertyInfo info = new PropertyInfo (); + + while (true) { + parser.skip (); + if (parser.peek ().getType () == Xml.END_TAG) break; + + StartTag start = (StartTag) parser.peek (); + String name = start.getName (); + // System.out.println ("tagname:"+name); + + int countdown = cnt; + + while (true) { + if (countdown-- == 0) + throw new RuntimeException ("Unknwon Property: "+name); + + if (++testIndex >= cnt) testIndex = 0; + + obj.getPropertyInfo (testIndex, info); + if (info.name == null + ? testIndex == sourceIndex + : info.name.equals (name)) break; + + } + + obj.setProperty + (testIndex, read (obj, testIndex, null, null, info)); + + sourceIndex = 0; + } + + parser.read (Xml.END_TAG, null, null); + } + + + public Object readUnknown (String namespace, + String name) throws IOException { + + parser.read (); // start tag + parser.skip (); + + Object result; + + if (parser.peek ().getType () == Xml.TEXT) + result = new SoapPrimitive + (namespace, name, parser.readText ()); + else { + SoapObject so = new SoapObject (namespace, name); + + while (parser.peek ().getType () != Xml.END_TAG) { + so.addProperty (parser.peek ().getName (), + read (so, so.getPropertyCount (), + null, null, + ElementType.OBJECT_TYPE)); + parser.skip (); + } + result = so; + } + + parser.read (Xml.END_TAG, null, null); + + return result; + } + + private int getIndex (Attribute attr, int start, int dflt) { + if (attr == null) return dflt; + String value = attr.getValue (); + return value.length() - start < 3 + ? dflt + : Integer.parseInt (value.substring (start+1, value.length()-1)); + } + + + public void readVector (Vector v, + ElementType elementType) throws IOException { + + StartTag start = (StartTag) parser.read (); + + String namespace = null; + String name = null; + int size = v.size (); + boolean dynamic = true; + + Attribute attr = start.getAttribute (classMap.enc, "arrayType"); + if (attr != null) { + String type = attr.getValue (); + + int cut0 = type.indexOf (':'); + int cut1 = type.indexOf ("[", cut0); + name = type.substring (cut0 + 1, cut1); + String prefix = cut0 == -1 ? "" : type.substring (0, cut0); + namespace = start.getPrefixMap ().getNamespace (prefix); + + size = getIndex(attr, cut1, -1); + if (size != -1) { + v.setSize (size); + dynamic = false; + } + } + + if (elementType == null) + elementType = ElementType.OBJECT_TYPE; + + parser.skip (); + + int position = getIndex + (start.getAttribute (classMap.enc, "offset"), 0, 0); + + while (parser.peek ().getType () != Xml.END_TAG) { + // handle position + + position = getIndex (parser.peek ().getAttribute + (classMap.enc, "position"), 0, position); + + if (dynamic && position >= size) { + size = position + 1; + v.setSize (size); + } + + // implicit handling of position exceeding specified size + v.setElementAt + (read (v, position, namespace, name, elementType), + position); + + position++; + parser.skip (); + } + + parser.read (Xml.END_TAG, start.getNamespace (), start.getName ()); + } +} + + + + + diff --git a/src/midp/org/ksoap/SoapPrimitive.java b/src/midp/org/ksoap/SoapPrimitive.java new file mode 100644 index 0000000..6b856e0 --- /dev/null +++ b/src/midp/org/ksoap/SoapPrimitive.java @@ -0,0 +1,64 @@ +package org.ksoap; + + +/** A class that is used to encapsulate primitive types + (represented by a string in XML serialization). + + Basically, the SoapPrimitive class encapsulates "unknown" + primitive types (similar to SoapObject encapsulating unknown + complex types). For example, new SoapPrimitive (classMap.xsd, + "float", "12.3") allows you to send a float from a MIDP device to + a server although MIDP does not support floats. In the other + direction, kSOAP will deserialize any primitive type (=no + subelements) that are not recognized by the ClassMap to + SoapPrimitive, preserving the namespace, name and string value + (this is how the stockquote example works). */ + + + +public class SoapPrimitive { + + + String namespace; + String name; + String value; + + + + + public SoapPrimitive (String namespace, String name, String value) { + this.namespace = namespace; + this.name = name; + this.value = value; + } + + + public boolean equals (Object o) { + if (!(o instanceof SoapPrimitive)) return false; + + SoapPrimitive p = (SoapPrimitive) o; + + return name.equals (p.name) && namespace.equals (p.namespace) && + (value == null ? (p.value == null) : value.equals (p.value)); + } + + + public int hashCode () { + return name.hashCode () ^ namespace.hashCode (); + } + + public String toString () { + return value; + } + + + public String getNamespace () { + return namespace; + } + + + public String getName () { + return name; + } + +} diff --git a/src/midp/org/ksoap/SoapWriter.java b/src/midp/org/ksoap/SoapWriter.java new file mode 100644 index 0000000..4f0d359 --- /dev/null +++ b/src/midp/org/ksoap/SoapWriter.java @@ -0,0 +1,196 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Mark Sanguinetti, Sean McDaniel + * + * */ + +package org.ksoap; + +import java.io.*; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kobjects.serialization.*; + +/** A writer that is able to write objects wrt. the SOAP section five + encoding rules. */ + +public class SoapWriter { + + public AbstractXmlWriter writer; + ClassMap classMap; + Vector multiRef = new Vector (); + Vector types = new Vector (); + + /** The SoapWriter is initialized with an AbstractXmlWriter and a + class map. */ + + + public SoapWriter (AbstractXmlWriter writer, + ClassMap classMap) { + + this.writer = writer; + this.classMap = classMap; + } + + + + /** Serializes the given object */ + + public void write (Object obj) throws IOException { + + multiRef.addElement (obj); + types.addElement (ElementType.OBJECT_TYPE); + + for (int i = 0; i < multiRef.size (); i++) { + + obj = multiRef.elementAt (i); + + Object [] qName = classMap.getInfo (null, obj); + + writer.startTag (classMap.prefixMap, + (String) qName [0], (String) qName [1]); + writer.attribute + ("id", + qName [2] == null ? ("o"+i) : (String) qName [2]); + + if (i == 0) writer.attribute (classMap.enc, "root", "1"); + + if (qName [3] != null) + ((Marshal) qName [3]).writeInstance (this, obj); + else if (obj instanceof KvmSerializable) + writeObjectBody ((KvmSerializable) obj); + else if (obj instanceof Vector) + writeVectorBody + ((Vector) obj, + ((ElementType) types.elementAt (i)).elementType); + else + throw new RuntimeException ("Cannot serialize: "+ obj); + + writer.endTag (); + } + } + + + /** Writes the body of an KvmSerializable object. This + method is public for access from Marshal subclasses. */ + + + public void writeObjectBody (KvmSerializable obj) throws IOException { + + PropertyInfo info = new PropertyInfo (); + int cnt = obj.getPropertyCount (); + + for (int i = 0; i < cnt; i++) { + + obj.getPropertyInfo (i, info); + + // Object value = obj.getProperty (i); + + // if (value != null) { + writer.startTag (info.name); + writeProperty (obj.getProperty (i), info); + writer.endTag (); + //} + } + } + + + protected void writeProperty (Object obj, + ElementType type) throws IOException { + + if (obj == null) { + writer.attribute (classMap.xsi, classMap.version >= Soap.VER12 + ? "nil" : "null", "true"); + return; + } + + Object [] qName = classMap.getInfo (null, obj); + + if (type.multiRef || qName [2] != null) { + int i = multiRef.indexOf (obj); + if (i == -1) { + i = multiRef.size (); + multiRef.addElement (obj); + types.addElement (type); + } + + writer.attribute + ("href", qName [2] == null ? ("#o"+i) : "#" + qName [2]); + } + else { + + if (!classMap.implicitTypes || obj.getClass () != type.type) { + + String prefix = writer.getPrefixMap ().getPrefix + ((String) qName [0]); + + if (prefix == null) throw new RuntimeException + ("Prefix for namespace "+qName [0] + " undefined!"); + + writer.attribute + (classMap.xsi, "type", prefix + ":" + qName [1]); + } + + if (qName [3] != null) + ((Marshal) qName [3]).writeInstance (this, obj); + else if (obj instanceof KvmSerializable) + writeObjectBody ((KvmSerializable) obj); + else if (obj instanceof Vector) + writeVectorBody ((Vector) obj, type.elementType); + else + throw new RuntimeException ("Cannot serialize: "+ obj); + } + } + + + protected void writeVectorBody (Vector vector, + ElementType elementType) throws IOException { + + if (elementType == null) + elementType = ElementType.OBJECT_TYPE; + + int cnt = vector.size (); + + Object [] arrType = classMap.getInfo (elementType.type, null); + + + writer.attribute + (classMap.enc, "arrayType", + writer.getPrefixMap ().getPrefix ((String) arrType [0]) + + ":" + arrType [1] + "[" + cnt + "]"); + + + boolean skipped = false; + for (int i = 0; i < cnt; i++) { + if (vector.elementAt (i) == null) + skipped = true; + else { + writer.startTag ("item"); + if (skipped) { + writer.attribute (classMap.enc, "position", "["+i+"]"); + skipped = false; + } + + writeProperty (vector.elementAt (i), elementType); + writer.endTag (); + } + } + } +} + diff --git a/src/midp/org/ksoap/marshal/MarshalBase64.java b/src/midp/org/ksoap/marshal/MarshalBase64.java new file mode 100644 index 0000000..7fa93a8 --- /dev/null +++ b/src/midp/org/ksoap/marshal/MarshalBase64.java @@ -0,0 +1,45 @@ +package org.ksoap.marshal; + +import java.io.*; +import org.ksoap.*; +import org.kobjects.base64.*; +import org.kobjects.serialization.*; + +/** Base64 (de)serializer */ + + +public class MarshalBase64 implements Marshal { + + static byte [] BA_WORKAROUND = new byte [0]; + public static Class BYTE_ARRAY_CLASS = BA_WORKAROUND.getClass (); + + + public Object readInstance (SoapParser parser, + String namespace, String name, + ElementType expected) throws IOException { + + parser.parser.read (); // start tag + Object result = Base64.decode + (parser.parser.readText ()); + parser.parser.read (); // end tag + return result; + } + + + public void writeInstance (SoapWriter writer, + Object obj) throws IOException { + + writer.writer.write (Base64.encode ((byte[]) obj)); + } + + public void register (ClassMap cm) { + cm.addMapping + (cm.xsd, "base64Binary", + MarshalBase64.BYTE_ARRAY_CLASS, this); + + cm.addMapping + (Soap.ENC, "base64", + MarshalBase64.BYTE_ARRAY_CLASS, this); + + } +} diff --git a/src/midp/org/ksoap/marshal/MarshalDate.java b/src/midp/org/ksoap/marshal/MarshalDate.java new file mode 100644 index 0000000..29479bb --- /dev/null +++ b/src/midp/org/ksoap/marshal/MarshalDate.java @@ -0,0 +1,43 @@ +package org.ksoap.marshal; + +import java.util.Date; +import java.io.*; +import org.ksoap.*; +import org.kobjects.isodate.*; +import org.kobjects.serialization.*; + +/** Marshal class for Dates. */ + + +public class MarshalDate implements Marshal { + + public static Class DATE_CLASS = new Date ().getClass (); + + + public Object readInstance (SoapParser parser, + String namespace, String name, + ElementType expected) throws IOException { + + parser.parser.read (); // start tag + Object result = IsoDate.stringToDate + (parser.parser.readText (), IsoDate.DATE_TIME); + parser.parser.read (); // end tag + return result; + } + + + public void writeInstance (SoapWriter writer, + Object obj) throws IOException { + + writer.writer.write (IsoDate.dateToString + ((Date) obj, IsoDate.DATE_TIME)); + } + + + public void register (ClassMap cm) { + cm.addMapping + (cm.xsd, "dateTime", + MarshalDate.DATE_CLASS, this); + } + +} diff --git a/src/midp/org/ksoap/marshal/MarshalHashtable.java b/src/midp/org/ksoap/marshal/MarshalHashtable.java new file mode 100644 index 0000000..2773800 --- /dev/null +++ b/src/midp/org/ksoap/marshal/MarshalHashtable.java @@ -0,0 +1,174 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Sean McDaniel + * + * */ +package org.ksoap.marshal; + +import java.io.*; +import java.util.*; + +import org.kobjects.serialization.ElementType; +import org.ksoap.*; +import org.kxml.Xml; +import org.kxml.io.XmlWriter; +import org.kxml.parser.*; + +/** + * serializes instances of hashtable to and from xml. + * this implementation is based on the xml schema from + * apache-soap, namely the type 'map' in the namespace + * 'http://xml.apache.org/xml-soap'. other soap + * implementations including apache (obviously ) and + * glue are also interoperable with the schema. + */ +public class MarshalHashtable implements Marshal { + + /** use then during registration */ + public static final String NAMESPACE = "http://xml.apache.org/xml-soap"; + + /** use then during registration */ + public static final String NAME = "Map"; + + /** CLDC does not support .class, so this helper is needed. */ + public static final Class HASHTABLE_CLASS = new Hashtable ().getClass (); + + public Object readInstance ( SoapParser parser, + String namespace, + String name, + ElementType expected ) throws IOException { + + Hashtable instance = new Hashtable (); + AbstractXmlParser xmlParser = parser.parser; + + // advance + xmlParser.read (); + xmlParser.skip (); + while (xmlParser.peek ().getType () != Xml.END_TAG) { + SoapObject item = new ItemSoapObject (instance); + + // advance + xmlParser.read (); + xmlParser.skip (); + + Object key = + parser.read (item, 0, null, null, ElementType.OBJECT_TYPE); + parser.parser.skip (); + if (key != null) + item.setProperty (0, key); + + Object value = + parser.read (item, 1, null, null, ElementType.OBJECT_TYPE); + parser.parser.skip (); + if (value != null) + item.setProperty (1, value); + + // advance + xmlParser.read (); + xmlParser.skip (); + } + + // advance + parser.parser.read (); + return instance; + } + + public void writeInstance (SoapWriter writer, + Object instance) throws IOException { + + Hashtable h = (Hashtable) instance; + SoapObject item = new SoapObject (null, null); + item.addProperty ("key", ElementType.OBJECT_TYPE, null); + item.addProperty ("value", ElementType.OBJECT_TYPE, null); + for (Enumeration keys = h.keys (); keys.hasMoreElements ();) { + writer.writer.startTag ("item"); + Object key = keys.nextElement (); + item.setProperty (0, key); + item.setProperty (1, h.get( key )); + writer.writeObjectBody (item); + writer.writer.endTag (); + } + } + + ////////////////////////////////////////////// + class ItemSoapObject extends SoapObject { + Hashtable h; + int resolvedIndex = -1; + + ItemSoapObject (Hashtable h) { + super (null, null); + this.h = h; + addProperty ("key", ElementType.OBJECT_TYPE, null); + addProperty ("value", ElementType.OBJECT_TYPE, null); + } + + // 0 & 1 only valid + public void setProperty (int index, Object value) { + if (resolvedIndex == -1) { + super.setProperty (index, value); + resolvedIndex = index; + } + else { + // already have a key or value + Object resolved = + resolvedIndex == 0 + ? getProperty (0) + : getProperty (1); + + if (index == 0) + h.put (value, resolved); + else + h.put (resolved, value); + } + } + } + + public void register (ClassMap cm) { + + cm.addMapping (MarshalHashtable.NAMESPACE, + MarshalHashtable.NAME, + HASHTABLE_CLASS, this); + + /* + Hashtable h = new Hashtable (); + Integer multiref = new Integer (12); + h.put ("one", multiref); + h.put ("two", multiref); + SoapEnvelope envelope = new SoapEnvelope (); + envelope.setClassMap (classMap); + envelope.setBody (h); + + XmlWriter writer = + new XmlWriter ( + new OutputStreamWriter ( + new FileOutputStream (args[0]) + ) + ); + envelope.write (writer); + writer.flush (); + + envelope = new SoapEnvelope (); + envelope.setClassMap (classMap); + XmlParser parser = + new XmlParser (new FileReader (args[0])); + envelope.parse (parser); + Hashtable body = (Hashtable) envelope.getBody (); + System.out.println (body); + + */ + } +} diff --git a/src/midp/org/ksoap/transport/HttpTransport.java b/src/midp/org/ksoap/transport/HttpTransport.java new file mode 100644 index 0000000..4100bfc --- /dev/null +++ b/src/midp/org/ksoap/transport/HttpTransport.java @@ -0,0 +1,316 @@ +/* kSOAP + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kSOAP is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): John D. Beatty, Dave Dash, F. Hunter, Renaud Tognelli, + * Thomas Strang, Alexander Krebs, Sean McDaniel + * */ + + +package org.ksoap.transport; + +import java.io.*; +import javax.microedition.io.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; + +import org.ksoap.*; + +/** Methods to facilitate SOAP calls over HTTP using the + J2ME generic connection framework. +

    + Instances of HttpTransport can be in one of two states: connected + and not connected. When an invocation on call is made the + instance is in a connected state until call returns or throws + an IOException. in any case once control is returned to the + caller the instance is again in the not connected state. HttpTransport + is not thread safe and applications should ensure that only one + thread is inside the call method at any given time. It is + designed in such a way that applications can reuse a single instance + for all soap calls to one, or multiple, target endpoints.

    + + The underlying HttpConnection is opened with the timeout + flag set. In the MIDP API this flag is only a hint to the + underlying protocol handler to throw an InterrruptIOException, + however, there are no guarantees that it will be handled. So + rather than support a timeout mechanism internally the design + is such that applications can manage timeouts in an environment + dependent way.

    + + For example some environments may allow for a timeout parameter + that can be externally specified in perhaps a system property + (which? I don't know. it's in the api). Others like + the emulator (ok, who cares) and the Motorola i85s can use + a simple and effective timeout mechanism that closes the + connection and associated streams in an asynchronous fashion. + Calling the close( ) method inside of a separate thread can + provide for this timeout handling by releasing threads that + maybe stuck inside of call( ) performing network io.

    + + Here is some sample code to demonstrate how such a timeout + mechanism may look:
    +

    +    private HttpTransport soap;
    +      ...
    +    TimerTask task =
    +      new TimerTask( ) { public void run( ) { soap.close( ); } };
    +
    +    try {
    +      new Timer( ).schedule( task, TIMEOUT );
    +      soap.call( soapobject );  // invoke method
    +      task.cancel( );           // cancel the timeout
    +
    +    } catch ( InterruptedIOException e ) {
    +      // handle timeout here...
    +
    +    } catch ( IOException e ) {
    +      // some other io problem...
    +    }
    +    

    + The call( ) method will throw and InterruptedIOException if + the instance is no longer in the connected state before + control is returned to the caller. The call to soap.close( ) + inside the TimerTask transitions the HttpConnection into + a not connected state.

    + Note: The InterruptedIOException will be caught by a thread + waiting on network io, however, it may not be immediate. It is + assumed that the protocol handler will gracefully handle the + lifecycle of the outputstream and therefore it is not closed + inside the close method. IOW the waiting thread will be interrupted + after the outputstream has been flushed. If the waiting thread + is hung up waiting for input a call to close from a separate thread + the exception is observed right away and will return before the + thread calling close. At least this is what has been observation + on the i85s handset. On this device, if a call to + outputstream.close( ) is made while the outputstream is + being flushed it seems to cause a deadlock, ie outputstream will + never return. + */ + +public class HttpTransport { + + String url; + String soapAction = "\"\""; + + SoapEnvelope requestEnvelope = new SoapEnvelope (); + SoapEnvelope responseEnvelope = new SoapEnvelope (); + + HttpConnection connection; + OutputStream os; + InputStream is; + InputStreamReader reader; + + /** state info */ + private boolean connected = false; + + /** Set to true if debugging */ + public boolean debug; + + /** String dump of request for debugging. */ + public String requestDump; + + /** String dump of response for debugging */ + public String responseDump; + + + /** default constructor */ + public HttpTransport () { + } + + + /** + * Creates instance of HttpTransport with set url and SoapAction + * + * @param url the destination to POST SOAP data + * @param soapAction the desired SOAP action (for HTTP headers) + */ + + public HttpTransport (String url, String soapAction) { + this.url = url; + this.soapAction = soapAction; + } + + + /** + * Set the target url. + * + * @param url the target url. + */ + + public void setUrl (String url) { + this.url = url; + } + + + /** + * set the desired soapAction header field + * + * @param soapAction the desired soapAction + */ + + public void setSoapAction (String soapAction) { + this.soapAction = soapAction; + } + + + /** + * set the desired ClassMap for the SOAP Envelopes + * + * @param classMap the desired ClassMap + */ + + public void setClassMap (ClassMap classMap) { + requestEnvelope.setClassMap (classMap); + responseEnvelope.setClassMap (classMap); + } + + + /** Sends the requestEnvelope and fills the + responseEnvelope + @exception InterruptedIOException if transport was closed async. + @exception IOException if an error occurs + */ + + public void call () throws IOException { + + ByteArrayOutputStream bos = new ByteArrayOutputStream (); + XmlWriter xw = new XmlWriter (new OutputStreamWriter (bos)); + requestEnvelope.write (xw); + xw.flush (); + bos.write ('\r'); + bos.write ('\n'); + byte [] requestData = bos.toByteArray (); + bos = null; + xw = null; + + requestDump = debug ? new String (requestData) : null; + responseDump = null; + + try { + connected = true; + connection = + (HttpConnection) Connector.open (url, Connector.READ_WRITE, true); + + connection.setRequestProperty ("SOAPAction", soapAction); + connection.setRequestProperty ("Content-Type", "text/xml"); + connection.setRequestProperty + ("Content-Length", ""+requestData.length); + + connection.setRequestProperty ("User-Agent", "kSOAP/1.0"); + + connection.setRequestMethod (HttpConnection.POST); + + os = connection.openOutputStream (); + os.write (requestData, 0, requestData.length); +// os.flush (); // removed in order to avoid chunked encoding + os.close (); + + requestData = null; + + is = connection.openInputStream (); + + if (debug) { + bos = new ByteArrayOutputStream (); + byte [] buf = new byte [256]; + + while (true) { + int rd = is.read (buf, 0, 256); + if (rd == -1) break; + bos.write (buf, 0, rd); + } + + buf = bos.toByteArray (); + responseDump = new String (buf); + is.close (); + is = new ByteArrayInputStream (buf); + } + + + reader = new InputStreamReader (is); + XmlParser xp = new XmlParser (reader); + + responseEnvelope.parse (xp); + + } finally { + if (!connected) throw new InterruptedIOException (); + reset (); + } + } + + + /** + * Executes a SOAP Method and returns a response + * + * @param method the remote soap method to be executed + * @return the result of the soap method + * @exception IOException if an error occurs + */ + + public Object call (SoapObject method) throws IOException { + + requestEnvelope.setBody (method); + call (); + + if (responseEnvelope.getBody () instanceof SoapFault) + throw((SoapFault)responseEnvelope.getBody ()); + + return responseEnvelope.getResult (); + } + + + public void call (XmlIO request, XmlIO result) throws IOException { + requestEnvelope.setBody (request); + responseEnvelope.setBody (result); + + if (responseEnvelope.getBody () instanceof SoapFault) + throw((SoapFault)responseEnvelope.getBody ()); + } + + + /** + * Closes the connection and associated streams. This method + * does not need to be explictly called since the uderlying + * connections and streams are only opened and valid inside of + * the call method. Close can be called ansynchronously, + * from another thread to potentially release another thread + * that is hung up doing network io inside of call. Caution + * should be taken, however when using this as a psedu timeout + * mechanism. it is a valid and suggested approach for the + * motorola handsets. oh, and it works in the emulator... + */ + public void reset () { + connected = false; + if (reader != null) { + try { reader.close (); } + catch (Throwable e) { } + reader = null; + } + + if (is != null) { + try { is.close (); } + catch (Throwable e) { } + is = null; + } + + if (connection != null) { + try { connection.close (); } + catch (Throwable e) { } + connection = null; + } + } + +} diff --git a/src/midp/org/kxml/Attribute.java b/src/midp/org/kxml/Attribute.java new file mode 100644 index 0000000..1033cef --- /dev/null +++ b/src/midp/org/kxml/Attribute.java @@ -0,0 +1,64 @@ +package org.kxml; + + +/** Attribute class, used by both kDom and the pullparser. The + instances of this class are immutable. This restriction allows + manipulation aware element implementations without needing to care + about hidden changes in attributes. */ + + +public class Attribute { + + String namespace; + String name; + String value; + + + /** Creates a new Attribute instance with the given name and + value. The namespace is set to "". */ + + public Attribute (String name, String value) { + this.namespace = ""; + this.name = name; + this.value = value; + } + + + /** creates a new Attribute with the given namespace, name and + value */ + + public Attribute (String namespace, String name, String value) { + this.namespace = namespace == null ? "" : namespace; + this.name = name; + this.value = value; + } + + + /** returns the string value of the attribute */ + + public String getValue () { + return value; + } + + + /** returns the name of the attribute */ + + public String getName () { + return name; + } + + + /** returns the namespace of the attribute */ + + public String getNamespace () { + return namespace; + } + + + public String toString () { + return (!namespace.equals ("") + ? ("{"+namespace+"}"+name) + : name) + "=\""+value+"\""; + } +} + diff --git a/src/midp/org/kxml/PrefixMap.java b/src/midp/org/kxml/PrefixMap.java new file mode 100644 index 0000000..b870251 --- /dev/null +++ b/src/midp/org/kxml/PrefixMap.java @@ -0,0 +1,64 @@ +package org.kxml; + +import java.util.*; + +/** Like Attribute, this class is immutable for similar reasons */ + +public class PrefixMap { + + public static final PrefixMap DEFAULT = new PrefixMap (null, "", ""); + + String prefix; + String namespace; + PrefixMap previous; + + + public PrefixMap (PrefixMap previous, String prefix, String namespace) { + this.previous = previous; + this.prefix = prefix; + this.namespace = namespace; + } + + + public String getNamespace () { + return namespace; + } + + public String getPrefix () { + return prefix; + } + + public PrefixMap getPrevious () { + return previous; + } + + /** returns the namespace associated with the given prefix, + or null, if none is assigned */ + + public String getNamespace (String prefix) { + PrefixMap current = this; + do { + if (prefix.equals (current.prefix)) return current.namespace; + current = current.previous; + } + while (current != null); + return null; + } + + + public String getPrefix (String namespace) { + PrefixMap current = this; + + do { + //System.err.println ("found: "+current.namespace +"/"+ current.prefix + "/" +getNamespace (current.prefix)); + if (namespace.equals (current.namespace) + && namespace.equals (getNamespace (current.prefix))) + return current.prefix; + + current = current.previous; + } + while (current != null); + return null; + } +} + diff --git a/src/midp/org/kxml/Xml.java b/src/midp/org/kxml/Xml.java new file mode 100644 index 0000000..40f442e --- /dev/null +++ b/src/midp/org/kxml/Xml.java @@ -0,0 +1,194 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson + * + * */ + +package org.kxml; + +import java.io.*; +import java.util.*; + + +/** A class containing several static xml methods, mainly for escaping + special characters like angle brakets and quotes. This class + contains also some (partially shared) constants for the parser and + kDOM. */ + + +public class Xml { + + public static final String NO_NAMESPACE = ""; + + /** XmlReader return value before the first call to next or skip */ + + public static final int START_DOCUMENT = 0; + + /** Integer constant for comments */ + + public static final int COMMENT = 1; + + + /** Integer constant for doctype */ + + public static final int DOCTYPE = 2; + + + /** Integer constant for elements */ + + public static final int ELEMENT = 4; + + + /** Integer constant returned by ParseEvent.getType if the end of + the document has been reached */ + + public static final int END_DOCUMENT = 8; + + + /** Integer constant assigned to an EndTag parse event */ + + public static final int END_TAG = 16; + + + /** Integer constant assigned to a processing instruction */ + + public static final int PROCESSING_INSTRUCTION = 32; + + + /** Integer constant assigned to StartTag parse event */ + + public static final int START_TAG = 64; + + + /** Integer constant assigned to text nodes and events */ + + public static final int TEXT = 128; + + + /** Integer constant for whitespace nodes and events */ + + public static final int WHITESPACE = 256; + + + /** minimum escaping, quotes are not escaped */ + + public static final int ENCODE_MIN = 0; + + /** forces escaping of quotes */ + + public static final int ENCODE_QUOT = 1; + + /** forces escaping of all character coded greater than 127 */ + + public static int ENCODE_128 = 2; + + /** Constant identifying wap extension events */ + + public static final int WAP_EXTENSION = 1024; + + + /** convenience method for encode (String raw, ENCODE_MIN) */ + + public static String encode (String raw) { + return encode (raw, ENCODE_MIN); + } + + + /* encodes an attribute with the given name and value. A single + space is inserted before the name of the attribute + + public static String encodeAttr (String name, String value) { + return " "+name+"=\"" + encode (value, ENCODE_QUOT) + "\""; + } +*/ + + /** encodes a string escaping less than etc. */ + + public static String encode (String raw, int flags) { + + int len = raw.length (); + + StringBuffer cooked = new StringBuffer (raw.length ()); + + for (int i = 0; i < len; i++) { + char c = raw.charAt (i); + + switch (c) { + case '<': cooked.append ("<"); break; + case '>': cooked.append (">"); break; + case '&': cooked.append ("&"); break; + case '"': + { + if ((flags & ENCODE_QUOT) != 0) + cooked.append ("""); + else + cooked.append ('"'); + } + break; + default: + if (c >= 128 && ((flags & ENCODE_128) != 0)) + cooked.append ("&#"+((int) c)+";"); + else + cooked.append (c); + } + } + return cooked.toString (); + } + + + /* quotes a string by adding quote chars at the beginning + and the end and escaping all quotes and XML special + chars contained in the string + + public static String quote (String q) { + return "\"" + encode (q, ENCODE_QUOT) + "\""; + } + */ + + + /* like String.trim, but additionally all groups of one or more + whitespace characters in the string are replaced by a single + space (0x040) + + public static String trim (String s) { + + char [] buf = new char [s.length ()]; + boolean ignoring = false; + int targetPos = 0; + + for (int i = 0; i < s.length (); i++) { + char c = s.charAt (i); + + if (c <= ' ') + ignoring = true; + else { + if (ignoring) { + if (targetPos != 0) buf [targetPos++] = ' '; + ignoring = false; + } + buf [targetPos++] = c; + } + } + + return new String (buf, 0, targetPos); + } + + */ +} + + diff --git a/src/midp/org/kxml/XmlIO.java b/src/midp/org/kxml/XmlIO.java new file mode 100644 index 0000000..5fcd9e2 --- /dev/null +++ b/src/midp/org/kxml/XmlIO.java @@ -0,0 +1,11 @@ +package org.kxml; + +import java.io.IOException; +import org.kxml.io.AbstractXmlWriter; +import org.kxml.parser.AbstractXmlParser; + +public interface XmlIO { + + public void parse (AbstractXmlParser parser) throws IOException; + public void write (AbstractXmlWriter writer) throws IOException; +} diff --git a/src/midp/org/kxml/io/AbstractXmlWriter.java b/src/midp/org/kxml/io/AbstractXmlWriter.java new file mode 100644 index 0000000..6e997b1 --- /dev/null +++ b/src/midp/org/kxml/io/AbstractXmlWriter.java @@ -0,0 +1,153 @@ +package org.kxml.io; + +import java.io.*; +import java.util.*; + +import org.kxml.*; + + +/** An abstract XmlWriter including namespace handling. */ + + +public abstract class AbstractXmlWriter extends Writer { + + protected State current = + new State (null, + PrefixMap.DEFAULT, //null, null, + null); + + + + /** writes an attribute. Only allowed immediately after + startTag or attribute. */ + + public abstract void attribute (String name, + String value) throws IOException; + + + + /** writes an attribute with the given namespace. Only allowed + immediately after startTag or another attribute + call. */ + + public void attribute (String namespace, + String name, + String value) throws IOException { + + if (namespace == null || "".equals (namespace)) + attribute (name, value); + else { + String prefix = current.prefixMap.getPrefix (namespace); + if (prefix == null || prefix.equals ("")) { + int cnt = 0; + do { + prefix = "p"+(cnt++); + } + while (current.prefixMap.getNamespace (prefix) != null); + current.prefixMap = new PrefixMap + (current.prefixMap, prefix, namespace); + + attribute ("xmlns:"+prefix, namespace); + } + attribute (prefix + ":" + name, value); + } + } + + public PrefixMap getPrefixMap () { + return current.prefixMap; + } + + + /** writes a start tag with the given name, using the given prefix + map. This method cares about the namespace prefixes and calls + startTag (PrefixMap prefixMap, String tag) for concrete + writing. */ + + public void startTag (PrefixMap prefixMap, + String namespace, + String name) throws IOException { + + // check if namespace is default. + + if (prefixMap == null) prefixMap = current.prefixMap; + if (namespace == null) namespace = ""; + + String prefix = prefixMap.getPrefix (namespace); + + if (prefix == null) { + //System.out.println ("namespace "+namespace +" not found in "+prefixMap); + + prefixMap = new PrefixMap (prefixMap, "", namespace); + prefix = ""; + } + + String tag = prefix.length () == 0 + ? name + : prefix + ':' + name; + + PrefixMap oldMap = current.prefixMap; + + startTag (prefixMap, tag); + + // if namespace has changed, write out changes... + + if (prefixMap != oldMap) { + PrefixMap current = prefixMap; + do { + String p2 = current.getPrefix (); + String ns = current.getNamespace (); + if (prefixMap.getNamespace (p2).equals (ns) + && !ns.equals (oldMap.getNamespace (p2))) + attribute (p2.equals ("") ? "xmlns" : ("xmlns:"+p2), ns); + current = current.getPrevious (); + } + while (current != null && current != oldMap); + } + } + + + /** writes a start tag with the given namespace and name */ + + public void startTag (String namespace, + String name) throws IOException { + startTag (null, namespace, name); + } + + + /** convenience method for startTag (Xml.NO_NAMESPACE, name) */ + + public void startTag (String name) throws IOException { + startTag (null, Xml.NO_NAMESPACE, name); + } + + + /** abstract method that must be overwritten by + a method actually writing the resolved start tag + without namespace checking. This implementation + just puts the state on the stack.

    + + Attention: The actual implementation include the + following line in order to + put the current State on the stack!

    + + current = new State (current, prefixMap, tag); + */ + + + protected abstract void startTag (PrefixMap prefixMap, + String tag) throws IOException; + + + /** Abstract method for writing an end tag. Attention: + Concrete implementations must pop the previous stack from the + stack:

    + + current = current.prev; */ + + public abstract void endTag () throws IOException; + + /** writes Xml.DOCTYPE, Xml.PROCESSING_INSTRUCTION or Xml.COMMENT */ + + public abstract void writeLegacy (int type, + String text) throws IOException; +} diff --git a/src/midp/org/kxml/io/ParseException.java b/src/midp/org/kxml/io/ParseException.java new file mode 100644 index 0000000..e3963ca --- /dev/null +++ b/src/midp/org/kxml/io/ParseException.java @@ -0,0 +1,71 @@ +package org.kxml.io; + +import java.io.*; + +// FIXME: would adding a file name make sense ?? + +/** a possibly chained exception, indicatin a line and column number. */ + +public class ParseException extends IOException { + + protected int lineNumber = -1; + protected int columnNumber = -1; + protected Exception chained; + + + /** Builds a new ParseException with the given message text, + chained Exception, lineNumber, columNumber. Set message text + or chained exception to null and lineNumber and + columNumber to -1 if not applicable. */ + + + public ParseException (String msg, Exception chained, + int lineNumber, int columnNumber) { + + super ((msg == null ? "ParseException" : msg) + + " @"+lineNumber+":" +columnNumber); + + this.chained = chained; + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; + } + + + /* Removed since super is not available in MIDP :( + + prints the own + stack trace followed by the stack trace of the original + exception to the given PrintStream + + public void printStackTrace (PrintStream p) { + super.printStackTrace (p); + if (chained != null) + chained.printStackTrace (p); + } + + + /** prints the own stack trace followed by the stack trace of the + original exception to the given PrintWriter + + public void printStackTrace (PrintWriter p) { + super.printStackTrace (p); + if (chained != null) + chained.printStackTrace (p); + } */ + + /** prints the own stack trace followed by the stack trace of the + original exception. */ + + public void printStackTrace () { + super.printStackTrace (); + if (chained != null) + chained.printStackTrace (); + } + + + public int getLineNumber () { + return lineNumber; + } + +} + diff --git a/src/midp/org/kxml/io/State.java b/src/midp/org/kxml/io/State.java new file mode 100644 index 0000000..0119119 --- /dev/null +++ b/src/midp/org/kxml/io/State.java @@ -0,0 +1,22 @@ +package org.kxml.io; + +import org.kxml.*; + +public class State { + public State prev; + public PrefixMap prefixMap; + public String namespace; + public String name; + public String tag; // for auto-endtag writing + + public State (State prev, PrefixMap prefixMap, + //String namespace, String name, + String tag) { + + this.prev = prev; + this.prefixMap = prefixMap; + // this.namespace = namespace; + // this.name = name; + this.tag = tag; + } +} diff --git a/src/midp/org/kxml/io/XmlWriter.java b/src/midp/org/kxml/io/XmlWriter.java new file mode 100644 index 0000000..63163f8 --- /dev/null +++ b/src/midp/org/kxml/io/XmlWriter.java @@ -0,0 +1,240 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson, Hans-Harald Schulz + * + * */ + + +package org.kxml.io; + +import java.io.*; +import java.util.*; + +import org.kxml.*; + + +/** a concrete XML Writer */ + +public class XmlWriter extends AbstractXmlWriter { + + protected Writer writer; + boolean pending = false; + int indentLevel = 0; + int noIndent = Integer.MAX_VALUE; + + + static char [] indent + = {'\r', '\n', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; + + + /** creates a new xmlWritet based on the given writer */ + + public XmlWriter (Writer writer) { + this.writer = writer; + } + + + protected void checkPending () throws IOException { + if (pending) { + writer.write ('>'); + pending = false; + } + } + + + /** closes the XmlWriter by closing the underlying writer */ + + public void close () throws IOException { + flush (); + writer.close (); + } + + + /** flushes the XmlWriter. Attention: If a closing + angle braket is pending, it will be appended before + flushing the underlying writer. Thus, after flush + attributes cannot be added any longer */ + + public void flush () throws IOException { + checkPending (); + writer.flush (); + } + + + /** writes a single character using the xml escaping rules */ + + public void write (char c) throws IOException { + checkPending (); + if (noIndent > indentLevel) noIndent = indentLevel; + + switch (c) { + case '<': writer.write ("<"); break; + case '>': writer.write (">"); break; + case '&': writer.write ("&"); break; + default: writer.write (c); + } + } + + + + + /** writes an character array using the XML escaping rules */ + + public void write (char [] buf, int start, int len) throws IOException { + checkPending (); + if (noIndent > indentLevel) noIndent = indentLevel; + + int end = start + len; + + do { + int i = start; + + while (i < end && "<>&".indexOf (buf [i]) == -1) i++; + + writer.write (buf, start, i - start); + + if (i == end) break; + + write (buf [i]); + + start = i+1; + } + while (start < end); + } + + + public void writeIndent () throws IOException { + + int l = indentLevel + 2; + + if (l < 2) l = 2; + else if (l > indent.length) l = indent.length; + + checkPending (); + // writer.write (""); + writer.write (indent, 0, l); + } + + + /** writes a degenerated tag with the given name and attributes */ + + public void attribute (String name, + String value) throws IOException { + + if (!pending) throw new RuntimeException + ("can write attr only immediately after a startTag"); + + writer.write (' '); + writer.write (name); + writer.write ("=\""); + writer.write (Xml.encode (value, Xml.ENCODE_QUOT)); + writer.write ('"'); + + if (name.equals ("xml:space") && value.equals ("preserve")) + noIndent = indentLevel; + } + + + + + /** writes a start tag with the given name */ + + protected void startTag (PrefixMap prefixMap, + String tag) throws IOException { + + current = new State (current, prefixMap, tag); + + checkPending (); + + if (indentLevel < noIndent) + writeIndent (); + + indentLevel++; + + writer.write ('<'); + writer.write (tag); + + pending = true; + } + + + /** writes an end tag. */ + + + + public void endTag () throws IOException { + indentLevel--; + + if (pending) { + writer.write (" />"); + pending = false; + } + else { + if (indentLevel + 1 < noIndent) + writeIndent (); + + writer.write (""); + } + + if (indentLevel + 1 == noIndent) + noIndent = Integer.MAX_VALUE; + + current = current.prev; + if (current == null) + throw new RuntimeException ("too many closing tags!"); + } + + + /** ATTENTION: Application needs to take care about not writing + illegal character sequences (like comment end in comments) */ + + public void writeLegacy (int type, String content) throws IOException { + checkPending (); + switch (type) { + case Xml.COMMENT: + writer.write (""); + + break; + case Xml.DOCTYPE: + writer.write (""); + break; + + case Xml.PROCESSING_INSTRUCTION: + writer.write (""); + break; + } + } + + + /** writes a string without escaping. Use with care! Not + available in wbxml writer */ + + public void writeRaw (String s) throws IOException { + checkPending (); + writer.write (s); + } +} diff --git a/src/midp/org/kxml/kdom/Document.java b/src/midp/org/kxml/kdom/Document.java new file mode 100644 index 0000000..99cc0d4 --- /dev/null +++ b/src/midp/org/kxml/kdom/Document.java @@ -0,0 +1,75 @@ +package org.kxml.kdom; + +import java.util.*; +import java.io.*; + + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; + + +/** The document consists of some legacy events and a single root + element. This class basically adds some consistency checks to + Node. */ + +public class Document extends Node { + + protected int rootIndex = -1; + + /** returns "#document" */ + + public String getName () { + return "#document"; + } + + + /** Adds a child at the given index position. Throws + an exception when a second root element is added */ + + public void addChild (int index, int type, Object child) { + if (type == Xml.ELEMENT) { + if (rootIndex != -1) + throw new RuntimeException + ("Only one document root element allowed"); + + rootIndex = index; + } + else if (rootIndex >= index) rootIndex++; + + super.addChild (index, type, child); + } + + + /** reads the document and checks if the last event + is END_DOCUMENT. If not, an exception is thrown. + The end event is consumed. For parsing partial + XML structures, consider using Node.parse (). */ + + + public void parse (AbstractXmlParser parser) throws IOException { + super.parse (parser); + if (parser.read ().getType () != Xml.END_DOCUMENT) + throw new RuntimeException ("Document end expected!"); + + } + + + + public void removeChild (int index) { + if (index == rootIndex) rootIndex = -1; + else if (index < rootIndex) rootIndex--; + + super.removeChild (index); + } + + + /** returns the root element of this document. */ + + public Element getRootElement () { + if (rootIndex == -1) + throw new RuntimeException ("Document has no root element!"); + + return (Element) getChild (rootIndex); + } +} diff --git a/src/midp/org/kxml/kdom/Element.java b/src/midp/org/kxml/kdom/Element.java new file mode 100644 index 0000000..969a87a --- /dev/null +++ b/src/midp/org/kxml/kdom/Element.java @@ -0,0 +1,338 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson + * + * */ + +package org.kxml.kdom; + +import java.io.*; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; + + +/** In order to create an element, please use the createElement method + instead of invoking the constructor directly. The right place to + add user defined initialization code is the init method. */ + +public class Element extends Node { + + protected String namespace; + protected String name; + protected Vector attributes; + protected Node parent; + protected PrefixMap prefixMap; + + + public Element () { + } + + + /** @deprecated + The init method is invoked by createElement setParent . */ + + public Element init (Node parent, String namespace, + String name, Vector attributes) { + this.parent = parent; + return this; + } + + + /** removes all children and attributes */ + + public void clear () { + setAttributes (new Vector ()); + + for (int i = getChildCount ()-1; i >= 0; i--) + removeChild (i); + } + + + /** Forwards creation request to parent if any, otherwise + calls super.createElement. Please note: For no + namespace, please use Xml.NO_NAMESPACE, null is not a legal + value. Currently, null is converted to Xml.NO_NAMESPACE, but + future versions may throw an exception. */ + + + public Element createElement (String namespace, String name) { + + return (this.parent == null) + ? super.createElement (namespace, name) + : this.parent.createElement (namespace, name); + } + + + + /** Returns the attribute at the given index. */ + + public Attribute getAttribute (int index) { + return (Attribute) attributes.elementAt (index); + } + + + /** convenience method for getAttribute (Xml.NO_NAMESPACE, name) */ + + public Attribute getAttribute (String name) { + return getAttribute (Xml.NO_NAMESPACE, name); + } + + + /** returns the attribute with the given namespace and name. + Please use null as placeholder for any namespace or + Xml.NO_NAMESPACE for no namespace. + */ + + public Attribute getAttribute (String namespace, String name) { + + int len = getAttributeCount (); + + for (int i = 0; i < len; i++) { + Attribute attr = getAttribute (i); + if (name.equals (attr.getName ()) + && (namespace == null || namespace.equals (attr.getNamespace ()))) + + return attr; + } + return null; + } + + + /** Returns the number of attributes of this element. */ + + public int getAttributeCount () { + return attributes == null ? 0 : attributes.size (); + } + + + /** Returns a Vector containing all Attributes. The Vector is not + copied. Modification is not allowed. */ + + public Vector getAttributes () { + return attributes; + } + + + /** Returns the document this element is a member of. The document + is determined by ascending to the parent of the root element. + If the element is not contained in a document, null is + returned. */ + + public Document getDocument () { + + if (parent instanceof Document) + return (Document) parent; + + if (parent instanceof Element) + return ((Element) parent).getDocument (); + + return null; + } + + + /** returns the (local) name of the element */ + + + public String getName () { + return name; + } + + + /** returns the namespace of the element */ + + public String getNamespace () { + return namespace; + } + + + /** Returns the parent node of this element */ + + public Node getParent () { + return parent; + } + + + /** Returns the parent element if available, null otherwise */ + + public Element getParentElement () { + return (parent instanceof Element) ? ((Element) parent) : null; + } + + + + /** Returns the namespace prefix map of this Element. */ + + public PrefixMap getPrefixMap () { + return prefixMap; + } + + + + /** Returns the value of the given attribute. If the attribute + does not exist, an exception is thrown. If a null value shall + be returned for not existing attributes, please use + getValueDefault (name, null) instead. */ + + public String getValue (String name) { + Attribute attr = getAttribute (Xml.NO_NAMESPACE, name); + return attr == null ? null : attr.getValue (); + } + + + /** Returns the value of the given attribute, or the given default + value if the desired attribute does not exist. */ + + public String getValueDefault (String name, String dflt) { + Attribute attr = getAttribute (Xml.NO_NAMESPACE, name); + return attr == null ? dflt : attr.getValue (); + } + + + /** Builds the child elements from the given Parser. By overwriting parse, + an element can take complete control over parsing its subtree. */ + + public void parse (AbstractXmlParser parser) throws IOException { + + StartTag startTag = (StartTag) parser.read (); + + name = startTag.getName (); + namespace = startTag.getNamespace (); + attributes = startTag.getAttributes (); + setPrefixMap (startTag.getPrefixMap ()); + + super.parse (parser); + + if (startTag != null + && !startTag.getDegenerated () + && getChildCount () == 0) + + addChild (Xml.WHITESPACE, ""); + + parser.read (Xml.END_TAG, startTag.getNamespace (), startTag.getName ()); + } + + + /** Removes the attribute at the given index */ + + public void removeAttribute (int index) { + attributes.removeElementAt (index); + } + + + + + /** Replaces all attributes by the given Vector. Caution: The + Vector is not copied. */ + + public void setAttributes (Vector attributes) { + this.attributes = attributes; + } + + + /** sets the given attribute */ + + public void setAttribute (Attribute attribute) { + if (attributes == null) + attributes = new Vector (); + else + for (int i = attributes.size () -1; i >= 0; i--) { + Attribute attr = (Attribute) attributes.elementAt (i); + if (attr.getName ().equals (attribute.getName ()) + && attr.getNamespace ().equals (attribute.getNamespace ())) { + attributes.setElementAt (attribute, i); + return; + } + } + + attributes.addElement (attribute); + } + + /** sets the value of the given attribute to the given string. + Convenience method for setAttribute (new Attribute (name, value)); + */ + + public void setValue (String name, String value) { + setAttribute (new Attribute (name, value)); + } + + + /** sets the name of the element */ + + public void setName (String name) { + this.name = name; + } + + + /** sets the namespace of the element. Please note: For no + namespace, please use Xml.NO_NAMESPACE, null is not a legal + value. Currently, null is converted to Xml.NO_NAMESPACE, but + future versions may throw an exception. */ + + public void setNamespace (String namespace) { + this.namespace = namespace == null ? Xml.NO_NAMESPACE : namespace; + } + + + /** Sets the Parent of this element. Automatically called from the + add method. The right place for replacements of the + deprectated init method. Please use with care, you can simply + create inconsitencies in the document tree structure using + this method! */ + + protected void setParent (Node parent){ + this.parent = parent; + if (init (parent, namespace, name, attributes) != this) + throw new RuntimeException ("init must return this"); + } + + + + /** Sets the namespace prefix map of this Node. */ + + public void setPrefixMap (PrefixMap prefixMap) { + this.prefixMap = prefixMap; + } + + + + /** Writes this element and all children to the given XmlWriter. */ + + + public void write (AbstractXmlWriter writer) throws IOException { + + writer.startTag (getPrefixMap (), getNamespace (), getName ()); + + int len = getAttributeCount (); + + for (int i = 0; i < len; i++) { + Attribute attr = getAttribute (i); + writer.attribute (attr.getNamespace (), + attr.getName (), attr.getValue ()); + } + + writeChildren (writer); + + writer.endTag (); + } +} + + + diff --git a/src/midp/org/kxml/kdom/Node.java b/src/midp/org/kxml/kdom/Node.java new file mode 100644 index 0000000..baa8c0e --- /dev/null +++ b/src/midp/org/kxml/kdom/Node.java @@ -0,0 +1,341 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson, Hans-Harald Schulz + * + * */ + +package org.kxml.kdom; + +import java.util.*; +import java.io.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; + + +/** A common base class for Document and Element, also used for + storing XML fragments. */ + +public class Node implements XmlIO{ + + protected Vector children; + protected StringBuffer types; + + /** inserts the given child object of the given type at the + given index. */ + + public void addChild (int index, int type, Object child) { + + if (child == null) + throw new NullPointerException (); + + if (children == null) { + children = new Vector (); + types = new StringBuffer (); + } + + if (type == Xml.ELEMENT) { + if (!(child instanceof Element)) + throw new RuntimeException ("Element obj expected)"); + + ((Element) child).setParent (this); + } + else if (!(child instanceof String)) + throw new RuntimeException ("String expected"); + + children.insertElementAt (child, index); + types.insert (index, (char) type); + } + + + /** convenience method for addChild (getChildCount (), child) */ + + public void addChild (int type, Object child) { + addChild (getChildCount (), type, child); + } + + + /** Builds a default element with the given properties. Elements + should always be created using this method instead of the + constructor in order to enable construction of specialized + subclasses by deriving custom Document classes. Please note: + For no namespace, please use Xml.NO_NAMESPACE, null is not a + legal value. Currently, null is converted to Xml.NO_NAMESPACE, + but future versions may throw an exception. */ + + + public Element createElement (String namespace, String name) { + + Element e = new Element (); + e.namespace = namespace == null ? Xml.NO_NAMESPACE : namespace; + e.name = name; + return e; + } + + + /** Returns the child object at the given index. For child + elements, an Element object is returned. For all other child + types, a String is returned. */ + + + public Object getChild (int index) { + return children.elementAt (index); + } + + + /** Returns the number of child objects */ + + public int getChildCount () { + return children == null ? 0 : children.size (); + } + + + /** returns the element at the given index. If the node at the + given index is a text node, null is returned */ + + public Element getElement (int index) { + Object child = getChild (index); + return (child instanceof Element) ? (Element) child : null; + } + + + /** Convenience method for getElement (getNamespace (), name). */ + + public Element getElement (String name) { + return getElement (getNamespace (), name); + } + + + /** Returns the element with the given namespace and name. If the + element is not found, or more than one matching elements are + found, an exception is thrown. */ + + public Element getElement (String namespace, String name) { + + int i = indexOf (namespace, name, 0); + int j = indexOf (namespace, name, i+1); + + if (i == -1 || j != -1) throw new RuntimeException + ("Element {"+namespace+"}" + name + + (i == -1 ? " not found in " : " more than once in ") + getName ()); + + return getElement (i); + } + + + /** returns "#document-fragment". For elements, the element name is returned */ + + public String getName () { + return "#document-fragment"; + } + + + /** Returns the namespace of the current element. For Node + and Document, Xml.NO_NAMESPACE is returned. */ + + public String getNamespace () { + return Xml.NO_NAMESPACE; + } + + + /** returns the text content if the element has text-only + content. Throws an exception for mixed content */ + + public String getText () { + + StringBuffer buf = new StringBuffer (); + int len = getChildCount (); + + for (int i = 0; i < len; i++) { + if ((getType (i) & (Xml.TEXT | Xml.WHITESPACE)) != 0) + buf.append (getText (i)); + else if (getType (i) == Xml.ELEMENT) + throw new RuntimeException ("not text-only content!"); + } + + return buf.toString (); + } + + + + /** Returns the text node with the given index or null if the node + with the given index is not a text node. */ + + public String getText (int index) { + return (getType (index) & (Xml.TEXT|Xml.WHITESPACE)) != 0 + ? (String) getChild (index) + : null; + } + + + /** Returns the type of the child at the given index. Possible + types are ELEMENT, TEXT, COMMENT, and PROCESSING_INSTRUCTION */ + + public int getType (int index) { + return types.charAt (index); + } + + + + /** Convenience method for indexOf (getNamespace (), name, + startIndex). */ + + public int indexOf (String name, int startIndex) { + return indexOf (getNamespace (), name, startIndex); + } + + + /** Performs search for an element with the given namespace and + name, starting at the given start index. A null namespace + matches any namespace, please use Xml.NO_NAMESPACE for no + namespace). returns -1 if no matching element was found. */ + + public int indexOf (String namespace, String name, int startIndex) { + + int len = getChildCount (); + + for (int i = startIndex; i < len; i++) { + + Element child = getElement (i); + + if (child != null + && name.equals (child.getName ()) + && (namespace == null || namespace.equals (child.getNamespace ()))) + return i; + } + return -1; + } + + + /** Recursively builds the child elements from the given parser + until an end tag or end document is found. + The end tag is not consumed. */ + + public void parse (AbstractXmlParser parser) throws IOException { + + boolean leave = false; + + do { + ParseEvent event = parser.peek (); + + switch (event.getType ()) { + + case Xml.START_TAG: + { + Element child = createElement + (event.getNamespace (), event.getName ()); + child.setAttributes (event.getAttributes ()); + addChild (Xml.ELEMENT, child); + + // order is important here since + // setparent may perform some init code! + + child.parse (parser); + break; + } + + case Xml.END_DOCUMENT: + case Xml.END_TAG: + leave = true; + break; + + default: + addChild (event.getType (), event.getText ()); + parser.read (); + } + } + while (!leave); + } + + + /** Removes the child object at the given index */ + + public void removeChild (int idx) { + children.removeElementAt (idx); + + /*** Modification by HHS - start ***/ + // types.deleteCharAt (index); + /***/ + int n = types.length()-1; + + for(int i = idx; i < n; i++) + types.setCharAt(i, types.charAt(i + 1)); + + types.setLength(n); + + /*** Modification by HHS - end ***/ + } + + + /** returns a valid XML representation of this Element including + attributes and children. */ + + public String toString () { + try { + ByteArrayOutputStream bos = new ByteArrayOutputStream (); + XmlWriter xw = new XmlWriter (new OutputStreamWriter (bos)); + write (xw); + xw.close (); + return new String (bos.toByteArray ()); + } + catch (IOException e) { + throw new RuntimeException (e.toString ()); + } + } + + + /** Writes this node to the given XmlWriter. For node and document, + this method is identical to writeChildren, except that the + stream is flushed automatically. */ + + public void write (AbstractXmlWriter writer) throws IOException { + writeChildren (writer); + writer.flush (); + } + + + /** Writes the children of this node to the given XmlWriter. */ + + public void writeChildren (AbstractXmlWriter writer) throws IOException { + if (children == null) return; + + int len = children.size (); + + for (int i = 0; i < len; i++) { + int type = getType (i); + Object child = children.elementAt (i); + switch (type) { + case Xml.ELEMENT: + ((Element) child).write (writer); + break; + + case Xml.TEXT: + case Xml.WHITESPACE: + writer.write ((String) child); + break; + + default: + writer.writeLegacy (type, (String) child); + } + } + } +} + + + diff --git a/src/midp/org/kxml/kdom/TreeParser.java b/src/midp/org/kxml/kdom/TreeParser.java new file mode 100644 index 0000000..ee79505 --- /dev/null +++ b/src/midp/org/kxml/kdom/TreeParser.java @@ -0,0 +1,109 @@ +package org.kxml.kdom; + + +import java.util.*; +import org.kxml.*; +import org.kxml.parser.*; + + +/** a pull parser that re-parses a kdom tree. */ + +public class TreeParser extends AbstractXmlParser { + + class Position { + + Node node; + StartTag start; + int index = -1; + Position previous; + + Position (Node node) { + this.node = node; + index = 0; + } + + + Position (Element element, Position prev) { + this.node = element; + + previous = prev; + start = new StartTag (prev == null ? null : prev.start, + element.getNamespace (), + element.getName (), + element.getAttributes (), + element.getChildCount () == 0, + false); + + start.setPrefixMap (element.getPrefixMap ()); + } + } + + + Position current; + ParseEvent next; + + public TreeParser (Node node) { + current = new Position (node); + } + + + public TreeParser (Element element, boolean skipRoot) { + + current = new Position (element, null); + if (skipRoot) { + current.index = 0; + current.start = null; + } + } + + + public ParseEvent read () { + if (next == null) peek (); + ParseEvent result = next; + next = null; + return result; + } + + + + public ParseEvent peek () { + + if (next == null) { + + int i = current.index++; + Node node = current.node; + + if (i < 0) + next = current.start; + else if (i >= node.getChildCount ()) { + + if (current.start == null || i > node.getChildCount ()) + next = new ParseEvent (Xml.END_DOCUMENT, null); + else { + next = new Tag (Xml.END_TAG, current.start, + current.start.getNamespace (), + current.start.getName ()); + + if (current.previous != null) + current = current.previous; + } + } + else { + int type = node.getType (i); + + if (type == Xml.ELEMENT) { + current = new Position (node.getElement (i), current); + next = peek (); // sets next.... + } + else + next = new ParseEvent (type, (String) node.getChild (i)); + } + } + + return next; + } +} + + + + diff --git a/src/midp/org/kxml/parser/AbstractXmlParser.java b/src/midp/org/kxml/parser/AbstractXmlParser.java new file mode 100644 index 0000000..806bf8d --- /dev/null +++ b/src/midp/org/kxml/parser/AbstractXmlParser.java @@ -0,0 +1,193 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson, Daniel Feygin, Scott Daub + * + * */ + +package org.kxml.parser; + +import java.io.IOException; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.*; + +/** An abstract base class for the XML and WBXML parsers. Of course, + you can implement your own subclass with additional features, + e.g. a validating parser. */ + + +public abstract class AbstractXmlParser { + + + protected boolean processNamespaces = true; + + + /** Ignores a tree */ + + public void ignoreTree () throws IOException { + readTree (null); + } + + /** Reads a complete element tree to the given event + Vector. The next event must be a start tag. */ + + + public void readTree (Vector buf) throws IOException { + + + StartTag start = (StartTag) read (); + //if (buf != null) buf.addElement (start); [caused duplication, fixed by SD] + + while (true) { + ParseEvent event = peek (); + if (buf != null) buf.addElement (event); + + switch (event.getType ()) { + + case Xml.START_TAG: + readTree (buf); + break; + + case Xml.END_TAG: + case Xml.END_DOCUMENT: + read (); + return; + + default: + read (); + } + } + } + + + /** Returns the current line number; -1 if unknown. Convenience + method for peek ().getLineNumber (). */ + + public int getLineNumber () throws IOException { + return peek ().getLineNumber (); + } + + + /** reads the next event available from the parser. If the end of + the parsed stream has been reached, null is returned. */ + + public abstract ParseEvent read () throws IOException; + + + + + /** Reads an event of the given type. If the type is START_TAG or + END_TAG, namespace and name are tested, otherwise + ignored. Throws a ParseException if the actual event does not + match the given parameters. */ + + public ParseEvent read (int type, String namespace, + String name) throws IOException { + + if (peek (type, namespace, name)) + return read (); + else throw new ParseException + ("unexpected: "+peek (), null, + peek().getLineNumber (), -1); + } + + + public boolean peek (int type, String namespace, + String name) throws IOException { + + ParseEvent pe = peek (); + + return pe.getType () == type + && (namespace == null || namespace.equals (pe.getNamespace ())) + && (name == null || name.equals (pe.getName ())); + } + + + /** Convenience Method for skip (Xml.COMMENT | Xml.DOCTYPE + | Xml.PROCESSING_INSTRUCTION | Xml.WHITESPACE) */ + + public void skip () throws IOException { + while (true) { + int type = peek ().type; + if (type != Xml.COMMENT + && type != Xml.DOCTYPE + && type != Xml.PROCESSING_INSTRUCTION + && type != Xml.WHITESPACE) break; + read (); + } + } + + + /** reads the next event available from the parser + without consuming it */ + + public abstract ParseEvent peek () throws IOException; + + + + /** tells the parser if it shall resolve namespace prefixes to + namespaces. Default is true */ + + public void setProcessNamespaces (boolean processNamespaces) { + this.processNamespaces = processNamespaces; + } + + + + + /** Convenience method for reading the content of text-only + elements. The method reads text until an end tag is + reached. Processing instructions and comments are + skipped. The end tag is NOT consumed. The concatenated text + String is returned. If the method reaches a start tag, an + Exception is thrown. */ + + + public String readText () throws IOException { + + StringBuffer buf = new StringBuffer (); + + while (true) { + + ParseEvent event = peek (); + + switch (event.getType ()) { + + case Xml.START_TAG: + case Xml.END_DOCUMENT: + case Xml.DOCTYPE: + throw new RuntimeException + ("Illegal event: "+event); + + case Xml.WHITESPACE: + case Xml.TEXT: + read (); + buf.append (event.getText ()); + break; + + case Xml.END_TAG: + return buf.toString (); + + default: + read (); + } + } + } +} + diff --git a/src/midp/org/kxml/parser/ParseEvent.java b/src/midp/org/kxml/parser/ParseEvent.java new file mode 100644 index 0000000..f0b2bfc --- /dev/null +++ b/src/midp/org/kxml/parser/ParseEvent.java @@ -0,0 +1,187 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson + * + * */ + +package org.kxml.parser; + +import java.util.*; +import java.io.IOException; + +import org.kxml.*; + + +/** Abstract superclass for all pull parser events. In order to avoid + some typecasts, this class already provides most of the content + access methods filled in the specialized subclasses. */ + + +public class ParseEvent { + + static final String WRONG_TYPE = + "Method not supported for the given event type!"; + + + int lineNumber = -1; + int type; + String text; + + public ParseEvent (int type, String text) { + this.type = type; + this.text = text; + } + + + /** returns the line number of the event */ + + public int getLineNumber () { + return lineNumber; + } + + /** returns the event type integer constant assigned to this + event. Possible event types are Xml.START_TAG, Xml.END_TAG, + Xml.TEXT, Xml.PROCESSING_INSTRUCTION, Xml.COMMENT, + Xml.DOCTYPE, and Xml.END_DOCUMENT */ + + public int getType () { + return type; + } + + + /** sets the line number of the event. Used by the parser only. */ + + public void setLineNumber (int lineNumber) { + this.lineNumber = lineNumber; + } + + + /** In the event type is START_TAG, this method returns the attribute + at the given index position. For all other event + types, or if the index is out of range, an exception is thrown. */ + + + public Attribute getAttribute (int index) { + return (Attribute) getAttributes().elementAt (index); + } + + /** returns the local attribute with the given name. convenience + method for getAttribute (Xml.NO_NAMESPACE, name); */ + + public Attribute getAttribute (String name) { + return getAttribute (Xml.NO_NAMESPACE, name); + } + + + /** returns the local attribute with the given qualified name. + Please use null as placeholder for any namespace or + Xml.NO_NAMESPACE for no namespace. */ + + public Attribute getAttribute (String namespace, String name) { + + Vector attributes = getAttributes (); + int len = getAttributeCount (); + + for (int i = 0; i < len; i++) { + Attribute attr = (Attribute) attributes.elementAt (i); + + if (attr.getName ().equals (name) + && (namespace == null || namespace.equals (attr.getNamespace ()))) + + return attr; + } + + return null; + } + + + /** If the event type is START_TAG, the number of attributes is + returned. For all other event types, an exception is thrown. */ + + public int getAttributeCount () { + Vector a = getAttributes (); + return a == null ? 0 : a.size (); + } + + + /** If the event type is START_TAG, the attribute Vector (null if + no attributes) is returned. For all other event types, an + exception is thrown. */ + + public Vector getAttributes () { + throw new RuntimeException (WRONG_TYPE); + } + + /** returns the (local) name of the element started if + instance of StartTag, null otherwise. */ + + public String getName () { + return null; + } + + + /** returns namespace if instance of StartTag, null + otherwise. */ + + public String getNamespace () { + return null; + } + + + /** Returns the value of the attribute with the given name. + Throws an exception if not instanceof StartTag or if not + existing. In order to get a null value for not existing + attributes, please call getValueDefault (attrName, null) + instead. */ + + public String getValue (String attrName) { + Attribute attr = getAttribute (attrName); + if (attr == null) throw new RuntimeException + ("Attribute "+ attrName + " in " + this + " expected!"); + return attr.getValue (); + } + + + /** Returns the given attribute value, or the given default value + if the attribute is not existing. */ + + public String getValueDefault (String attrName, String deflt) { + Attribute attr = getAttribute (attrName); + return attr == null ? deflt : attr.getValue (); + } + + + /** If the event type is TEXT, PROCESSING_INSTRUCTION, + or DOCTYPE, the corresponding string is returned. For + all othe event types, null is returned. */ + + public String getText () { + return text; + } + + + + public String toString () { + return "ParseEvent type="+type+ " text='"+text+"'"; + } + + + + +} + diff --git a/src/midp/org/kxml/parser/StartTag.java b/src/midp/org/kxml/parser/StartTag.java new file mode 100644 index 0000000..ee4a100 --- /dev/null +++ b/src/midp/org/kxml/parser/StartTag.java @@ -0,0 +1,158 @@ +package org.kxml.parser; + +import java.io.IOException; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.*; + + +/** A class for events indicating the start of a new element */ + + +public class StartTag extends Tag { + + Vector attributes; + boolean degenerated; + PrefixMap prefixMap; + + + /** creates a new StartTag. The attributes are not copied and may + be reused in e.g. the DOM. So DO NOT CHANGE the attribute + vector after handing over, the effects are undefined */ + + public StartTag (StartTag parent, String namespace, + String name, Vector attributes, + boolean degenerated, boolean processNamespaces) { + + super (Xml.START_TAG, parent, namespace, name); + + this.attributes = (attributes == null || attributes.size () == 0) + ? null + : attributes; + + this.degenerated = degenerated; + + prefixMap = parent == null ? PrefixMap.DEFAULT : parent.prefixMap; + + if (!processNamespaces) return; + + boolean any = false; + + for (int i = getAttributeCount () - 1; i >= 0; i--) { + Attribute attr = (Attribute) attributes.elementAt (i); + String attrName = attr.getName (); + int cut = attrName.indexOf (':'); + String prefix; + + if (cut != -1) { + prefix = attrName.substring (0, cut); + attrName = attrName.substring (cut+1); + } + else if (attrName.equals ("xmlns")) { + prefix = attrName; + attrName = ""; + } + else continue; + + if (!prefix.equals ("xmlns")) { + if (!prefix.equals ("xml")) any = true; + } + else { + prefixMap = new PrefixMap (prefixMap, attrName, attr.getValue ()); + + //System.out.println (prefixMap); + attributes.removeElementAt (i); + } + } + + int len = getAttributeCount (); + + if (any) { + for (int i = 0; i < len; i++) { + Attribute attr = (Attribute) attributes.elementAt (i); + String attrName = attr.getName (); + int cut = attrName.indexOf (':'); + + if (cut == 0) + throw new RuntimeException + ("illegal attribute name: "+attrName+ " at "+this); + + else if (cut != -1) { + String attrPrefix = attrName.substring (0, cut); + if (!attrPrefix.equals ("xml")) { + attrName = attrName.substring (cut+1); + + String attrNs = prefixMap.getNamespace (attrPrefix); + + if (attrNs == null) + throw new RuntimeException + ("Undefined Prefix: "+attrPrefix + " in " + this); + + attributes.setElementAt + (new Attribute (attrNs, + attrName, attr.getValue ()), i); + } + } + } + } + + int cut = name.indexOf (':'); + + String prefix; + if (cut == -1) prefix = ""; + else if (cut == 0) + throw new RuntimeException + ("illegal tag name: "+ name +" at "+this); + else { + prefix = name.substring (0, cut); + this.name = name.substring (cut+1); + } + + this.namespace = prefixMap.getNamespace (prefix); + + if (this.namespace == null) { + if (prefix.length () != 0) + throw new RuntimeException + ("undefined prefix: "+prefix+" in "+prefixMap +" at "+this); + this.namespace = Xml.NO_NAMESPACE; + } + } + + + /** returns the attribute vector. May return null for no attributes. */ + + public Vector getAttributes () { + return attributes; + } + + + + public boolean getDegenerated () { + return degenerated; + } + + + public PrefixMap getPrefixMap () { + return prefixMap; + } + + + + + /** Simplified (!) toString method for debugging + purposes only. In order to actually write valid XML, + please use a XmlWriter. */ + + + public String toString () { + return "StartTag <"+name+"> line: "+lineNumber+" attr: "+attributes; + } + + + public void setPrefixMap (PrefixMap map) { + this.prefixMap = map; + } + +} + diff --git a/src/midp/org/kxml/parser/Tag.java b/src/midp/org/kxml/parser/Tag.java new file mode 100644 index 0000000..409cca1 --- /dev/null +++ b/src/midp/org/kxml/parser/Tag.java @@ -0,0 +1,57 @@ +package org.kxml.parser; + + +import org.kxml.*; + +/** A class for events indicating the + * end of an element + */ + + +public class Tag extends ParseEvent { + + StartTag parent; + String namespace; + String name; + + public Tag (int type, StartTag parent, String namespace, String name) { + super (type, null); + this.parent = parent; + this.namespace = namespace == null ? Xml.NO_NAMESPACE : namespace; + this.name = name; + } + + + + /** returns the (local) name of the element */ + + public String getName () { + return name; + } + + /** returns the namespace */ + + public String getNamespace () { + return namespace; + } + + /** Returns the (corresponding) start tag or the start tag of the parent element, depending on the event type. */ + + public StartTag getParent () { + return parent; + } + + + + public String toString () { + return "EndTag "; + } +} + + + + + + + + diff --git a/src/midp/org/kxml/parser/XmlParser.java b/src/midp/org/kxml/parser/XmlParser.java new file mode 100644 index 0000000..b267aa8 --- /dev/null +++ b/src/midp/org/kxml/parser/XmlParser.java @@ -0,0 +1,591 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Wilhelm Fitzpatrick, + * Eric Foster-Johnson, Michael Angel, Jan Andrle + * + * */ + +package org.kxml.parser; + +import java.io.*; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.ParseException; + + +/** A simple, pull based "Common XML" parser. Attention: This class has + been renamed from DefaultParser for consitency with the org.kxml.io + package. */ + +public class XmlParser extends AbstractXmlParser { + + static final String UNEXPECTED_EOF = "Unexpected EOF"; + + char [] buf; + boolean eof; + int bufPos; + int bufCount; + Reader reader; + boolean relaxed; + int line = 1; + int column = 1; + + Vector qNames = new Vector (); + + boolean immediateClose = false; + StartTag current; + + /** The next event. May be null at startup. */ + + protected ParseEvent next; + + + int peekChar () throws IOException { + if (eof) return -1; + + if (bufPos >= bufCount) { + + if (buf.length == 1) { + int c = reader.read (); + if (c == -1) { + eof = true; + return -1; + } + + bufCount = 1; + buf [0] = (char) c; + } + else { + bufCount = reader.read (buf, 0, buf.length); + + if (bufCount == -1) { + eof = true; + return -1; + } + } + + bufPos = 0; + } + + return buf[bufPos]; + } + + + + int readChar () throws IOException { + int p = peekChar (); + bufPos++; + column++; + if (p == 10) { + line++; + column = 1; + } + return p; + } + + + void skipWhitespace () throws IOException { + while (!eof && peekChar () <= ' ') + readChar (); + } + + + + public String readName () throws IOException { + + int c = readChar (); + if (c < 128 && c != '_' && c != ':' + && (c < 'a' || c > 'z') + && (c < 'A' || c > 'Z')) + throw new DefaultParserException ("name expected!", null); + + + StringBuffer buf = new StringBuffer (); + buf.append ((char) c); + + while (!eof) { + c = peekChar (); + + if (c < 128 && c != '_' && c != '-' && c != ':' && c != '.' + && (c < '0' || c > '9') + && (c < 'a' || c > 'z') + && (c < 'A' || c > 'Z')) + + break; + + buf.append ((char) readChar ()); + } + + return buf.toString (); + } + + + /** Reads chars to the given buffer until the given stopChar + is reached. The stopChar itself is not consumed. */ + + public StringBuffer readTo (char stopChar, + StringBuffer buf) throws IOException { + + while (!eof && peekChar () != stopChar) + buf.append ((char) readChar ()); + + return buf; + } + + + + + /** creates a new Parser based on the give reader */ + + class DefaultParserException extends ParseException { + DefaultParserException (String msg, Exception chained) { + super (msg, chained, XmlParser.this.line, XmlParser.this.column); + } + } + + + public XmlParser (Reader reader) throws IOException { + this (reader, + Runtime.getRuntime ().freeMemory () >= 1048576 ? 8192 : 1); + } + + + public XmlParser (Reader reader, int bufSize) throws IOException { + + this.reader = reader; //new LookAheadReader (reader); + buf = new char [bufSize]; + } + + + + public String resolveCharacterEntity (String name) throws IOException { + + throw new DefaultParserException ("Undefined: &"+name+";", null); + } + + + /* precondition: <!- consumed */ + + ParseEvent parseComment () throws IOException { + + StringBuffer buf = new StringBuffer (); + + if (readChar () != '-') + throw new DefaultParserException ("'-' expected", null); + + int cnt; + int lst; + + while (true) { + readTo ('-', buf); + + if (readChar () == -1) + throw new DefaultParserException (UNEXPECTED_EOF, null); + + cnt = 0; + + do { + lst = readChar (); + cnt++; // adds one more, but first is not cnted + } + while (lst == '-'); + + if (lst == '>' && cnt >= 2) break; + + while (cnt-- > 0) + buf.append ('-'); + + buf.append ((char) lst); + } + + while (cnt-- > 2) + buf.append ('-'); + + return new ParseEvent (Xml.COMMENT, buf.toString ()); + } + + + /* precondition: <! consumed */ + + + ParseEvent parseDoctype () throws IOException { + + StringBuffer buf = new StringBuffer (); + int nesting = 1; + + while (true) { + int i = readChar (); + switch (i) { + case -1: + throw new DefaultParserException (UNEXPECTED_EOF, null); + case '<': + nesting++; + break; + case '>': + if ((--nesting) == 0) + return new ParseEvent (Xml.DOCTYPE, buf.toString ()); + break; + } + buf.append ((char) i); + } + } + + + ParseEvent parseCData () throws IOException { + + StringBuffer buf = readTo ('[', new StringBuffer ()); + + if (!buf.toString ().equals ("CDATA")) + throw new DefaultParserException ("Invalid CDATA start!", null); + + buf.setLength (0); + + readChar (); // skip '[' + + int c0 = readChar (); + int c1 = readChar (); + + while (true) { + int c2 = readChar (); + + if (c2 == -1) + throw new DefaultParserException (UNEXPECTED_EOF, null); + + if (c0 == ']' && c1 == ']' && c2 == '>') + break; + + buf.append ((char) c0); + c0 = c1; + c1 = c2; + } + + return new ParseEvent (Xml.TEXT, buf.toString ()); + } + + + + /* precondition: </ consumed */ + + ParseEvent parseEndTag () throws IOException { + + skipWhitespace (); + String name = readName (); + skipWhitespace (); + + if (readChar () != '>') + throw new DefaultParserException ("'>' expected", null); + + int last = qNames.size (); + while (true) { + if (last == 0) { + if (relaxed) return new ParseEvent (Xml.END_DOCUMENT, null); + throw new DefaultParserException + ("tagstack empty parsing ", null); + } + String qName = (String) qNames.elementAt (--last); + qNames.removeElementAt (last); + + if (qName.equals (name)) break; + if (!relaxed) throw new DefaultParserException + ("StartTag <"+qName + +"> does not match end tag ", null); + if (qName.toLowerCase ().equals (name.toLowerCase ())) break; + current = current.parent; + } + + Tag result = new Tag + (Xml.END_TAG, current, current.namespace, current.name); + + current = current.parent; + + return result; + } + + + /** precondition: ') { + buf.append ('?'); + + int r = readChar (); + if (r == -1) throw new DefaultParserException + (UNEXPECTED_EOF, null); + + buf.append ((char) r); + readTo ('?', buf); + readChar (); + } + + readChar (); // consume > + + return new ParseEvent + (Xml.PROCESSING_INSTRUCTION, buf.toString ()); + } + + + StartTag parseStartTag () throws IOException { + //current = new StartTag (current, reader, relaxed); + + //prefixMap = parent == null ? new PrefixMap () : parent.prefixMap; + + String qname = readName (); + + //System.out.println ("name: ("+name+")"); + + Vector attributes = null; + immediateClose = false; + + while (true) { + skipWhitespace (); + + int c = peekChar (); + + if (c == '/') { + immediateClose = true; + readChar (); + skipWhitespace (); + if (readChar () != '>') + throw new DefaultParserException + ("illegal element termination", null); + break; + } + + if (c == '>') { + readChar (); + break; + } + + if (c == -1) + throw new DefaultParserException (UNEXPECTED_EOF, null); + + String attrName = readName (); + + if (attrName.length() == 0) + throw new DefaultParserException + ("illegal char / attr", null); + + skipWhitespace (); + + if (readChar () != '=') + throw new DefaultParserException + ("Attribute name "+attrName + +"must be followed by '='!", null); + + skipWhitespace (); + int delimiter = readChar (); + + if (delimiter != '\'' && delimiter != '"') { + if (!relaxed) + throw new DefaultParserException + ("<" + qname + ">: invalid delimiter: " + + (char) delimiter, null); + + + delimiter = ' '; + } + + StringBuffer buf = new StringBuffer (); + readText (buf, (char) delimiter); + if (attributes == null) attributes = new Vector (); + attributes.addElement + (new Attribute (null, attrName, buf.toString ())); + + if (delimiter != ' ') + readChar (); // skip endquote + } + + try { + current = new StartTag + (current, Xml.NO_NAMESPACE, qname, attributes, + immediateClose, processNamespaces); + } + catch (Exception e) { + throw new DefaultParserException (e.toString (), e); + } + + //System.out.println ("tag: ("+next+")"); + + if (!immediateClose) + qNames.addElement (qname); + + return current; + } + + + + + int readText (StringBuffer buf, char delimiter) throws IOException { + + int type = Xml.WHITESPACE; + int nextChar; + + + while (true) { + nextChar = peekChar (); + + if (nextChar == -1 + || nextChar == delimiter + || (delimiter == ' ' + && (nextChar == '>' || nextChar < ' '))) break; + + readChar (); + + if (nextChar == '&') { + String code = readTo (';', new StringBuffer ()).toString (); + readChar (); + + if (code.charAt (0) == '#') { + nextChar = (code.charAt (1) == 'x' + ? Integer.parseInt (code.substring (2), 16) + : Integer.parseInt (code.substring (1))); + + if (nextChar > ' ') + type = Xml.TEXT; + + buf.append ((char) nextChar); + } + else { + if (code.equals ("lt")) buf.append ('<'); + else if (code.equals ("gt")) buf.append ('>'); + else if (code.equals ("apos")) buf.append ('\''); + else if (code.equals ("quot")) buf.append ('"'); + else if (code.equals ("amp")) buf.append ('&'); + else buf.append (resolveCharacterEntity (code)); + + type = Xml.TEXT; + } + } + else { + if (nextChar > ' ') + type = Xml.TEXT; + buf.append ((char) nextChar); + } + } + + return type; + } + + + /** precondition: < consumed */ + + ParseEvent parseSpecial () throws IOException { + + switch (peekChar ()) { + case -1: throw new DefaultParserException + (UNEXPECTED_EOF, null); + + case '!': + readChar (); + switch (peekChar ()) { + case '-': + readChar (); + return parseComment (); + + case '[': + readChar (); + return parseCData (); + + default: + return parseDoctype (); + } + + case '?': + readChar (); + return parsePI (); + + case '/': + readChar (); + return parseEndTag (); + + default: + return parseStartTag (); + } + } + + + public ParseEvent read () throws IOException{ + if (next == null) + peek (); + + ParseEvent result = next; + next = null; + return result; + } + + + public ParseEvent peek () throws IOException { + + if (next == null) { + + if (immediateClose) { + next = new Tag + (Xml.END_TAG, current, current.namespace, current.name); + current = current.getParent (); + immediateClose = false; + } + else { + switch (peekChar ()) { + + case '<': + readChar (); + next = parseSpecial (); + break; + + case -1: + if (current != null && !relaxed) + throw new DefaultParserException + ("End tag missing for: "+current, null); + next = new ParseEvent (Xml.END_DOCUMENT, null); + break; + + default: + { + StringBuffer buf = new StringBuffer (); + int type = readText (buf, '<'); + next = new ParseEvent (type, buf.toString ()); + } + } + } + } + return next; + } + + + + /** default is false. Setting relaxed true + allows CHTML parsing */ + + public void setRelaxed (boolean relaxed) { + this.relaxed = relaxed; + } + + public int getLineNumber () { + return line; + } + + public int getColumnNumber () { + return column; + } + +} + diff --git a/src/midp/org/kxml/wap/WapExtensionEvent.java b/src/midp/org/kxml/wap/WapExtensionEvent.java new file mode 100644 index 0000000..aeb3d78 --- /dev/null +++ b/src/midp/org/kxml/wap/WapExtensionEvent.java @@ -0,0 +1,43 @@ +package org.kxml.wap; + +import org.kxml.*; +import org.kxml.parser.*; + + +public class WapExtensionEvent extends ParseEvent { + + int id; + Object content; + + public WapExtensionEvent (int id, Object content) { + super (id, null); + this.content = content; + } + + + + /** returns Xml.WAP_EXTENSION */ + + public int getType () { + return Xml.WAP_EXTENSION; + } + + /** returns the id of the WAP extendsion, one of Wbxml.EXT_0, + Wbxml.EXT_1, Wbxml.EXT_2, Wbxml.EXT_T_0, Wbxml.EXT_T_1, + Wbxml.EXT_T_2, Wbxml.EXT_I_0, Wbxml.EXT_I_1, Wbxml.EXT_I_2, or + Wbxml.OPAQUE. */ + + public int getId () { + return id; + } + + + /** returns the content of the wap extension. The class + depends on the type of the extension. null for EXT_0..EXT_2, + String for EXT_I_0..EXT_I_2, Integer for EXT_T_0..EXT_T_2, + byte [] for OPAQUE. */ + + public Object getContent () { + return content; + } +} diff --git a/src/midp/org/kxml/wap/Wbxml.java b/src/midp/org/kxml/wap/Wbxml.java new file mode 100644 index 0000000..3b38421 --- /dev/null +++ b/src/midp/org/kxml/wap/Wbxml.java @@ -0,0 +1,29 @@ +package org.kxml.wap; + + +/** contains the WBXML constants */ + + +public class Wbxml { + + static public final int SWITCH_PAGE = 0; + static public final int END = 1; + static public final int ENTITY = 2; + static public final int STR_I = 3; + static public final int LITERAL = 4; + static public final int EXT_I_0 = 0x40; + static public final int EXT_I_1 = 0x41; + static public final int EXT_I_2 = 0x42; + static public final int PI = 0x43; + static public final int LITERAL_C = 0x44; + static public final int EXT_T_0 = 0x80; + static public final int EXT_T_1 = 0x81; + static public final int EXT_T_2 = 0x82; + static public final int STR_T = 0x83; + static public final int LITERAL_A = 0x084; + static public final int EXT_0 = 0x0c0; + static public final int EXT_1 = 0x0c1; + static public final int EXT_2 = 0x0c2; + static public final int OPAQUE = 0x0c3; + static public final int LITERAL_AC = 0x0c4; +} diff --git a/src/midp/org/kxml/wap/WbxmlParser.java b/src/midp/org/kxml/wap/WbxmlParser.java new file mode 100644 index 0000000..29e6807 --- /dev/null +++ b/src/midp/org/kxml/wap/WbxmlParser.java @@ -0,0 +1,389 @@ +// (c) 2001 Stefan Haustein +// Contributors: Bjorn Aadland + +package org.kxml.wap; + +import java.io.*; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.*; +import org.kxml.parser.*; + + +/** Still Todo: +

      +
    • implement Processing Instructions
    • +
    • implement support for more than one codepages
    • +
    + */ + + + + +public class WbxmlParser extends AbstractXmlParser { + + InputStream in; + + String [] attrStartTable; + String [] attrValueTable; + String [] tagTable; + String stringTable; + + int version; + int publicIdentifierId; + int charSet; + + StartTag current; + ParseEvent next; + boolean whitespace; + + public WbxmlParser (InputStream in) throws IOException { + + this.in = in; + + version = readByte (); + publicIdentifierId = readInt (); + + if (publicIdentifierId == 0) readInt (); + + charSet = readInt (); // skip charset + + int strTabSize = readInt (); + + StringBuffer buf = new StringBuffer (strTabSize); + + for (int i = 0; i < strTabSize; i++) + buf.append ((char) readByte ()); + + stringTable = buf.toString (); + } + + + + public ParseEvent peek () throws IOException { + + String s; + + if (next != null) return next; + + if (current != null && current.getDegenerated ()) { + next = new Tag + (Xml.END_TAG, current, + current.getNamespace (), + current.getName ()); + + current = current.getParent (); + return next; + } + + ParseEvent result = null; + + do { + int id = in.read (); + + switch (id) { + case -1: + if (current != null) + throw new RuntimeException ("unclosed elements: "+current); + + next = new ParseEvent (Xml.END_DOCUMENT, null); + break; + + case Wbxml.SWITCH_PAGE: + if (readByte () != 0) + throw new IOException ("Curr. only CP0 supported"); + break; + + case Wbxml.END: + next = new Tag (Xml.END_TAG, current, + current.getNamespace (), + current.getName ()); + + current = current.getParent (); + break; + + case Wbxml.ENTITY: + next = new ParseEvent (Xml.TEXT, "" + (char) readInt ()); + break; + + case Wbxml.STR_I: { + s = readStrI (); + next = new ParseEvent (whitespace ? Xml.WHITESPACE : Xml.TEXT, s); + break; + } + + case Wbxml.EXT_I_0: + case Wbxml.EXT_I_1: + case Wbxml.EXT_I_2: + case Wbxml.EXT_T_0: + case Wbxml.EXT_T_1: + case Wbxml.EXT_T_2: + case Wbxml.EXT_0: + case Wbxml.EXT_1: + case Wbxml.EXT_2: + case Wbxml.OPAQUE: + next = parseWapExtension (id); + break; + + case Wbxml.PI: + throw new RuntimeException ("PI curr. not supp."); + // readPI; + // break; + + case Wbxml.STR_T: { + int pos = readInt (); + int end = stringTable.indexOf ('\0', pos); + next = new ParseEvent + (Xml.TEXT, stringTable.substring (pos, end)); + break; + } + + default: + next = parseElement (id); + } + } + while (next == null); + + return next; + } + + + public ParseEvent read () throws IOException { + if (next == null) peek (); + ParseEvent result = next; + next = null; + return result; + } + + + + /** For handling wap extensions in attributes, overwrite this + method, call super and return a corresponding TextEvent. */ + + public ParseEvent parseWapExtension (int id) throws IOException { + + switch (id) { + case Wbxml.EXT_I_0: + case Wbxml.EXT_I_1: + case Wbxml.EXT_I_2: + return new WapExtensionEvent (id, readStrI ()); + + case Wbxml.EXT_T_0: + case Wbxml.EXT_T_1: + case Wbxml.EXT_T_2: + return new WapExtensionEvent (id, new Integer (readInt ())); + + case Wbxml.EXT_0: + case Wbxml.EXT_1: + case Wbxml.EXT_2: + return new WapExtensionEvent (id, null); + + case Wbxml.OPAQUE: { + int len = readInt (); + byte [] buf = new byte[len]; + + for (int i = 0; i < len; i++) // enhance with blockread! + buf [i] = (byte) readByte (); + + return new WapExtensionEvent (id, buf); + } // case OPAQUE + } // SWITCH + + throw new IOException ("illegal id!"); + } + + + public Vector readAttr () throws IOException { + + Vector result = new Vector (); + + int id = readByte (); + + while (id != 1) { + + String name = resolveId (attrStartTable, id); + StringBuffer value; + + int cut = name.indexOf ('='); + + if (cut == -1) + value = new StringBuffer (); + else { + value = new StringBuffer (name.substring (cut+1)); + name = name.substring (0, cut); + } + + id = readByte (); + while (id > 128 || id == Wbxml.ENTITY + || id == Wbxml.STR_I || id == Wbxml.STR_T + || (id >= Wbxml.EXT_I_0 && id <= Wbxml.EXT_I_2) + || (id >= Wbxml.EXT_T_0 && id <= Wbxml.EXT_T_2)) { + + switch (id) { + case Wbxml.ENTITY: + value.append ((char) readInt ()); + break; + + case Wbxml.STR_I: + value.append (readStrI ()); + break; + + case Wbxml.EXT_I_0: case Wbxml.EXT_I_1: case Wbxml.EXT_I_2: + case Wbxml.EXT_T_0: case Wbxml.EXT_T_1: case Wbxml.EXT_T_2: + case Wbxml.EXT_0: case Wbxml.EXT_1: case Wbxml.EXT_2: + case Wbxml.OPAQUE: + + ParseEvent e = parseWapExtension (id); + if (!(e.getType () != Xml.TEXT + && e.getType () != Xml.WHITESPACE)) + throw new RuntimeException ("parse WapExtension must return Text Event in order to work inside Attributes!"); + + value.append (e.getText ()); + + //value.append (handleExtension (id)); // skip EXT in ATTR + //break; + + case Wbxml.STR_T: + value.append (readStrT ()); + break; + + default: + value.append (resolveId (attrValueTable, id)); + } + + id = readByte (); + } + + result.addElement (new Attribute (null, name, value.toString ())); + } + + return result; + } + + + String resolveId (String [] tab, int id) throws IOException { + int idx = (id & 0x07f) - 5; + if (idx == -1) return readStrT (); + if (idx < 0 || tab == null + || idx >= tab.length || tab [idx] == null) + throw new IOException ("id "+id+" undef."); + + return tab [idx]; + } + + + + StartTag parseElement (int id) throws IOException { + + String tag = resolveId (tagTable, id & 0x03f); + + // ok, now let's care about attrs etc + + try { + current = new StartTag + (current, // previous + null, // namespace + tag, // name + (((id & 128) != 0) // attributes + ? readAttr () + : null), + (id & 64) == 0, // degenerated + processNamespaces); // processing + } + catch (Exception e) { + throw new ParseException (null, e, -1, -1); + } + + return current; + } + + + int readByte () throws IOException { + int i = in.read (); + if (i == -1) throw new IOException ("Unexpected EOF"); + return i; + } + + + int readInt () throws IOException { + int result = 0; + int i; + + do { + i = readByte (); + result = (result << 7) | (i & 0x7f); + } + while ((i & 0x80) != 0); + + return result; + } + + + String readStrI () throws IOException { + StringBuffer buf = new StringBuffer (); + boolean wsp = true; + while (true) { + int i = in.read (); + if (i == -1) throw new IOException ("Unexpected EOF"); + if (i == 0) break; + if (i > 32) wsp = false; + buf.append ((char) i); + } + this.whitespace = wsp; + return buf.toString (); + } + + + String readStrT () throws IOException { + int pos = readInt (); + int end = stringTable.indexOf ('\0', pos); + + return stringTable.substring (pos, end); + } + + + + /** Sets the tag table for a given page. + * The first string in the array defines tag 5, the second tag 6 etc. + * Currently, only page 0 is supported + */ + + public void setTagTable (int page, String [] tagTable) { + this.tagTable = tagTable; + if (page != 0) throw new RuntimeException ("code pages curr. not supp."); + } + + + /** Sets the attribute start Table for a given page. + * The first string in the array defines attribute + * 5, the second attribute 6 etc. + * Currently, only page 0 is supported. Please use the + * character '=' (without quote!) as delimiter + * between the attribute name and the (start of the) value + */ + + public void setAttrStartTable (int page, String [] attrStartTable) { + this.attrStartTable = attrStartTable; + if (page != 0) throw new RuntimeException ("code pages curr. not supp."); + } + + /** Sets the attribute value Table for a given page. + * The first string in the array defines attribute value 0x85, + * the second attribute value 0x86 etc. + * Currently, only page 0 is supported. + */ + + public void setAttrValueTable (int page, String [] attrStartTable) { + this.attrValueTable = attrStartTable; + if (page != 0) throw new RuntimeException ("code pages curr. not supp."); + } + + +} + + + + + + diff --git a/src/midp/org/kxml/wap/WbxmlWriter.java b/src/midp/org/kxml/wap/WbxmlWriter.java new file mode 100644 index 0000000..ca2396e --- /dev/null +++ b/src/midp/org/kxml/wap/WbxmlWriter.java @@ -0,0 +1,282 @@ +/* kXML + * + * The contents of this file are subject to the Enhydra Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * on the Enhydra web site ( http://www.enhydra.org/ ). + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific terms governing rights and limitations + * under the License. + * + * The Initial Developer of kXML is Stefan Haustein. Copyright (C) + * 2000, 2001 Stefan Haustein, D-46045 Oberhausen (Rhld.), + * Germany. All Rights Reserved. + * + * Contributor(s): Paul Palaszewski, Michael Wallbaum + * + * */ + + +package org.kxml.wap; + +import java.io.*; +import java.util.*; + +import org.kxml.*; +import org.kxml.io.*; + +//import com.sun.xml.parser.Parser; + +/** a class for converting ("binary encoding") XML to WBXML. + * Todo: + *
      + *
    • Add support for processing instructions + *
    • Add support for tag and attribute tables + *
    • Add support for WBXML extensions + *
    + */ + + +public class WbxmlWriter extends AbstractXmlWriter { + + Hashtable stringTable = new Hashtable (); + + OutputStream out; + + ByteArrayOutputStream buf = new ByteArrayOutputStream (); + ByteArrayOutputStream stringTableBuf = new ByteArrayOutputStream (); + + String pending; + Vector attributes = new Vector (); + + Hashtable attrStartTable = new Hashtable (); + Hashtable attrValueTable = new Hashtable (); + Hashtable tagTable = new Hashtable (); + + public WbxmlWriter (OutputStream out) throws IOException { + + this.out = out; + + buf = new ByteArrayOutputStream (); + stringTableBuf = new ByteArrayOutputStream (); + + // ok, write header + + out.write (0x01); // version + out.write (0x01); // unknown or missing public identifier + out.write (0x04); // iso-8859-1 + } + + + /** ATTENTION: flush cannot work since Wbxml documents cannot + need buffering. Thus, this call does nothing. */ + + public void flush () { + } + + public void close () throws IOException { + writeInt (out, stringTableBuf.size ()); + + // write StringTable + + out.write (stringTableBuf.toByteArray ()); + + // write buf + + out.write (buf.toByteArray ()); + + // ready! + + out.flush (); + } + + + public void checkPending (boolean degenerated) throws IOException { + if (pending == null) return; + + int len = attributes.size (); + + Integer idx = (Integer) tagTable.get(pending); + + // if no entry in known table, then add as literal + if(idx == null) { + buf.write + (len == 0 + ? (degenerated ? Wbxml.LITERAL : Wbxml.LITERAL_C) + : (degenerated ? Wbxml.LITERAL_A : Wbxml.LITERAL_AC)); + + writeStrT (pending); + } else { + buf.write + (len == 0 + ? (degenerated ? idx.intValue() : idx.intValue() | 64 ) + : (degenerated ? idx.intValue() | 128 : idx.intValue() | 192 )); + + } + + for (int i = 0; i < len;) { + idx = (Integer) attrStartTable.get(attributes.elementAt(i)); + if(idx == null) { + buf.write (Wbxml.LITERAL); + writeStrT ((String) attributes.elementAt (i)); + } else { + buf.write (idx.intValue()); + } + idx = (Integer) attrValueTable.get(attributes.elementAt(++i)); + if(idx == null) { + buf.write (Wbxml.STR_I); + writeStrI (buf, (String) attributes.elementAt (i)); + } else { + buf.write (idx.intValue()); + } + ++i; + } + + + if (len > 0) + buf.write (Wbxml.END); + + + + pending = null; + attributes.removeAllElements (); + } + + + public void startTag (PrefixMap prefixMap, + String name) throws IOException { + + current = new State (current, prefixMap, name); + + checkPending (false); + pending = name; + } + + + public void attribute (String name, String value) { + attributes.addElement (name); + attributes.addElement (value); + } + + + public void write (char [] chars, + int start, int len) throws IOException { + + checkPending (false); + + buf.write (Wbxml.STR_I); + writeStrI (buf, new String (chars, start, len)); + } + + + public void endTag () throws IOException { + + current = current.prev; + + if (pending != null) + checkPending (true); + else + buf.write (Wbxml.END); + } + + + /** currently ignored! */ + + public void writeLegacy (int type, String data) { + } + + + + + // ------------- internal methods -------------------------- + + + static void writeInt (OutputStream out, int i) throws IOException { + byte [] buf = new byte [5]; + int idx = 0; + + do { + buf [idx++] = (byte) (i & 0x7f); + i = i >> 7; + } while (i != 0); + + while (idx > 1) { + out.write (buf [--idx] | 0x80); + } + out.write (buf [0]); + } + + + static void writeStrI (OutputStream out, String s) throws IOException { + for (int i=0; i < s.length (); i++) { + out.write ((byte) s.charAt (i)); + } + out.write (0); + } + + void writeStrT (String s) throws IOException { + + Integer idx = (Integer) stringTable.get (s); + + if (idx == null) { + idx = new Integer (stringTableBuf.size ()); + stringTable.put (s, idx); + writeStrI (stringTableBuf, s); + stringTableBuf.flush (); + } + + writeInt (buf, idx.intValue ()); + } + + /** Sets the tag table for a given page. + * The first string in the array defines tag 5, the second tag 6 etc. + * Currently, only page 0 is supported + */ + public void setTagTable (int page, String [] tagTable) { + // clear entries in tagTable! + for(int i=0;i < tagTable.length;i++) { + if(tagTable[i] != null) { + Integer idx = new Integer(i+5); + this.tagTable.put(tagTable[i],idx); + } + } + if (page != 0) throw new RuntimeException ("code pages curr. not supp."); + } + + + /** Sets the attribute start Table for a given page. + * The first string in the array defines attribute + * 5, the second attribute 6 etc. + * Currently, only page 0 is supported. Please use the + * character '=' (without quote!) as delimiter + * between the attribute name and the (start of the) value + */ + public void setAttrStartTable (int page, String [] attrStartTable) { + // clear entries in this.table! + for(int i=0;i < attrStartTable.length;i++) { + if(attrStartTable[i] != null) { + Integer idx = new Integer(i+5); + this.attrStartTable.put(attrStartTable[i],idx); + } + } + if (page != 0) throw new RuntimeException ("code pages curr. not supp."); + } + + /** Sets the attribute value Table for a given page. + * The first string in the array defines attribute value 0x85, + * the second attribute value 0x86 etc. + * Currently, only page 0 is supported. + */ + public void setAttrValueTable (int page, String [] attrValueTable) { + // clear entries in this.table! + for(int i=0;i < attrValueTable.length;i++) { + if(attrValueTable[i] != null) { + Integer idx = new Integer(i+0x085); + this.attrValueTable.put(attrValueTable[i],idx); + } + } + if (page != 0) throw new RuntimeException ("code pages curr. not supp."); + } +} diff --git a/src/midp/org/kxml/wap/Wml.java b/src/midp/org/kxml/wap/Wml.java new file mode 100644 index 0000000..b0ffc35 --- /dev/null +++ b/src/midp/org/kxml/wap/Wml.java @@ -0,0 +1,212 @@ +package org.kxml.wap; + + +/** This class contains the wml coding tables for elements + * and attributes needed by the WmlParser. + */ + + +public class Wml { + + public static final String [] tagTable = { + + null, // 05 + null, // 06 + null, // 07 + null, // 08 + null, // 09 + null, // 0A + null, // 0B + null, // 0C + null, // 0D + null, // 0E + null, // 0F + + null, // 10 + null, // 11 + null, // 12 + null, // 13 + null, // 14 + null, // 15 + null, // 16 + null, // 17 + null, // 18 + null, // 19 + null, // 1A + null, // 1B + "a", // 1C + "td", // 1D + "tr", // 1E + "table", // 1F + + "p", // 20 + "postfield", // 21 + "anchor", // 22 + "access", // 23 + "b", // 24 + "big", // 25 + "br", // 26 + "card", // 27 + "do", // 28 + "em", // 29 + "fieldset", // 2A + "go", // 2B + "head", // 2C + "i", // 2D + "img", // 2E + "input", // 2F + + "meta", // 30 + "noop", // 31 + "prev", // 32 + "onevent", // 33 + "optgroup", // 34 + "option", // 35 + "refresh", // 36 + "select", // 37 + "small", // 38 + "strong", // 39 + null, // 3A + "template", // 3B + "timer", // 3C + "u", // 3D + "setvar", // 3E + "wml", // 3F + }; + + + public static final String [] attrStartTable = { + "accept-charset", // 05 + "align=bottom", // 06 + "align=center", // 07 + "align=left", // 08 + "align=middle", // 09 + "align=right", // 0A + "align=top", // 0B + "alt", // 0C + "content", // 0D + null, // 0E + "domain", // 0F + + "emptyok=false", // 10 + "emptyok=true", // 11 + "format", // 12 + "height", // 13 + "hspace", // 14 + "ivalue", // 15 + "iname", // 16 + null, // 17 + "label", // 18 + "localsrc", // 19 + "maxlength", // 1A + "method=get", // 1B + "method=post", // 1C + "mode=nowrap", // 1D + "mode=wrap", // 1E + "multiple=false", // 1F + + "multiple=true", // 20 + "name", // 21 + "newcontext=false", // 22 + "newcontext=true", // 23 + "onpick", // 24 + "onenterbackward", // 25 + "onenterforward", // 26 + "ontimer", // 27 + "optimal=false", // 28 + "optimal=true", // 29 + "path", // 2A + null, // 2B + null, // 2C + null, // 2D + "scheme", // 2E + "sendreferer=false", // 2F + + "sendreferer=true", // 30 + "size", // 31 + "src", // 32 + "ordered=true", // 33 + "ordered=false", // 34 + "tabindex", // 35 + "title", // 36 + "type", // 37 + "type=accept", // 38 + "type=delete", // 39 + "type=help", // 3A + "type=password", // 3B + "type=onpick", // 3C + "type=onenterbackward", // 3D + "type=onenterforward", // 3E + "type=ontimer", // 3F + + null, // 40 + null, // 41 + null, // 42 + null, // 43 + null, // 44 + "type=options", // 45 + "type=prev", // 46 + "type=reset", // 47 + "type=text", // 48 + "type=vnd.", // 49 + "href", // 4A + "href=http://", // 4B + "href=https://", // 4C + "value", // 4D + "vspace", // 4E + "width", // 4F + + "xml:lang", // 50 + null, // 51 + "align", // 52 + "columns", // 53 + "class", // 54 + "id", // 55 + "forua=false", // 56 + "forua=true", // 57 + "src=http://", // 58 + "src=https://", // 59 + "http-equiv", // 5A + "http-equiv=Content-Type", // 5B + "content=application/vnd.wap.wmlc;charset=", // 5C + "http-equiv=Expires", // 5D + null, // 5E + null, // 5F + }; + + + public static final String [] attrValueTable = { + ".com/", // 85 + ".edu/", // 86 + ".net/", // 87 + ".org/", // 88 + "accept", // 89 + "bottom", // 8A + "clear", // 8B + "delete", // 8C + "help", // 8D + "http://", // 8E + "http://www.", // 8F + + "https://", // 90 + "https://www.", // 91 + null, // 92 + "middle", // 93 + "nowrap", // 94 + "onpick", // 95 + "onenterbackward", // 96 + "onenterforward", // 97 + "ontimer", // 98 + "options", // 99 + "password", // 9A + "reset", // 9B + null, // 9C + "text", // 9D + "top", // 9E + "unknown", // 9F + + "wrap", // A0 + "www.", // A1 + }; +} + diff --git a/src/midp/org/kxml/wap/WmlParser.java b/src/midp/org/kxml/wap/WmlParser.java new file mode 100644 index 0000000..2402e57 --- /dev/null +++ b/src/midp/org/kxml/wap/WmlParser.java @@ -0,0 +1,50 @@ +package org.kxml.wap; + +import java.io.*; + +/** A parser for WML built on top of the WbxmlParser by + setting the corresponding TagTable, AttrStartTable and + AttrValueTable defined in the class Wml */ + + +public class WmlParser extends WbxmlParser { + + public WmlParser (InputStream in) throws IOException { + + super (in); + + setTagTable (0, Wml.tagTable); + setAttrStartTable (0, Wml.attrStartTable); + setAttrValueTable (0, Wml.attrValueTable); + } + + /* + public ParseEvent parseWapExtension (int id) { + + public void ext_i (int id, String par) throws SAXException { + String dec = "$("+par+")"; + + dh.characters (dec.toCharArray (), 0, dec.length ()); + } + + public void ext_t (int id, int par) throws SAXException { + + StringBuffer buf = new StringBuffer (); + + while (stringTable [par] != 0) + buf.append (stringTable [par++]); + + ext_i (id, buf.toString ()); + } + + public void opaque (byte [] bytes) throws SAXException { + throw new SAXException ("OPAQUE invalid in WML"); + } + + public void ext (int id) throws SAXException { + throw new SAXException ("EXT_"+id+" reserved in WML"); + } + + */ +} + diff --git a/src/midp/org/kxml/wap/WmlWriter.java b/src/midp/org/kxml/wap/WmlWriter.java new file mode 100644 index 0000000..3a31676 --- /dev/null +++ b/src/midp/org/kxml/wap/WmlWriter.java @@ -0,0 +1,52 @@ +// provided by Michael Wallbaum + +package org.kxml.wap; + +import java.io.*; + +/** A parser for WML built on top of the WbxmlParser by + setting the corresponding TagTable, AttrStartTable and + AttrValueTable defined in the class Wml */ + + +public class WmlWriter extends WbxmlWriter { + + public WmlWriter (OutputStream out) throws IOException { + + super (out); + + setTagTable (0, Wml.tagTable); + setAttrStartTable (0, Wml.attrStartTable); + setAttrValueTable (0, Wml.attrValueTable); + } + + /* + public ParseEvent parseWapExtension (int id) { + + public void ext_i (int id, String par) throws SAXException { + String dec = "$("+par+")"; + + dh.characters (dec.toCharArray (), 0, dec.length ()); + } + + public void ext_t (int id, int par) throws SAXException { + + StringBuffer buf = new StringBuffer (); + + while (stringTable [par] != 0) + buf.append (stringTable [par++]); + + ext_i (id, buf.toString ()); + } + + public void opaque (byte [] bytes) throws SAXException { + throw new SAXException ("OPAQUE invalid in WML"); + } + + public void ext (int id) throws SAXException { + throw new SAXException ("EXT_"+id+" reserved in WML"); + } + + */ +} + diff --git a/src/midp/read-me.txt b/src/midp/read-me.txt new file mode 100644 index 0000000..945b867 --- /dev/null +++ b/src/midp/read-me.txt @@ -0,0 +1,2 @@ +Directory: src/midp +Contents: --todo-- \ No newline at end of file diff --git a/src/test/CVS/Entries b/src/test/CVS/Entries new file mode 100644 index 0000000..143450b --- /dev/null +++ b/src/test/CVS/Entries @@ -0,0 +1,7 @@ +D/WEB-INF//// +/cactus.properties/1.1/Sun Jun 8 00:36:25 2003/-ko/ +D/com//// +D/data//// +/jndi.properties/1.1/Thu Jun 5 18:47:56 2003// +/log_client.properties/1.1/Sun Jun 8 00:36:25 2003/-ko/ +/log_server.properties/1.1/Sun Jun 8 00:36:25 2003/-ko/ diff --git a/src/test/CVS/Repository b/src/test/CVS/Repository new file mode 100644 index 0000000..b7792b5 --- /dev/null +++ b/src/test/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test diff --git a/src/test/CVS/Root b/src/test/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/WEB-INF/CVS/Entries b/src/test/WEB-INF/CVS/Entries new file mode 100644 index 0000000..88cf230 --- /dev/null +++ b/src/test/WEB-INF/CVS/Entries @@ -0,0 +1 @@ +/web.xml/1.2/Sun Jun 8 19:44:44 2003/-ko/ diff --git a/src/test/WEB-INF/CVS/Repository b/src/test/WEB-INF/CVS/Repository new file mode 100644 index 0000000..1362034 --- /dev/null +++ b/src/test/WEB-INF/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/WEB-INF diff --git a/src/test/WEB-INF/CVS/Root b/src/test/WEB-INF/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/WEB-INF/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/WEB-INF/web.xml b/src/test/WEB-INF/web.xml new file mode 100644 index 0000000..6bf4c56 --- /dev/null +++ b/src/test/WEB-INF/web.xml @@ -0,0 +1,19 @@ + + + + + + TCMS Unit Testing + + + ServletRedirector + org.apache.cactus.server.ServletTestRedirector + + + + ServletRedirector + /ServletRedirector + + + diff --git a/src/test/cactus.properties b/src/test/cactus.properties new file mode 100644 index 0000000..e2e3408 --- /dev/null +++ b/src/test/cactus.properties @@ -0,0 +1,3 @@ +cactus.contextURL=http://localhost:8080/tcms_test +cactus.servletRedirectorName=ServletRedirector +cactus.enableLogging=true \ No newline at end of file diff --git a/src/test/com/CVS/Entries b/src/test/com/CVS/Entries new file mode 100644 index 0000000..53b9cc0 --- /dev/null +++ b/src/test/com/CVS/Entries @@ -0,0 +1 @@ +D/ejdoab//// diff --git a/src/test/com/CVS/Repository b/src/test/com/CVS/Repository new file mode 100644 index 0000000..8749aed --- /dev/null +++ b/src/test/com/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com diff --git a/src/test/com/CVS/Root b/src/test/com/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/CVS/Entries b/src/test/com/ejdoab/CVS/Entries new file mode 100644 index 0000000..f2a55a2 --- /dev/null +++ b/src/test/com/ejdoab/CVS/Entries @@ -0,0 +1 @@ +D/tcms//// diff --git a/src/test/com/ejdoab/CVS/Repository b/src/test/com/ejdoab/CVS/Repository new file mode 100644 index 0000000..9e955a2 --- /dev/null +++ b/src/test/com/ejdoab/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab diff --git a/src/test/com/ejdoab/CVS/Root b/src/test/com/ejdoab/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/CVS/Entries b/src/test/com/ejdoab/tcms/CVS/Entries new file mode 100644 index 0000000..2b03c79 --- /dev/null +++ b/src/test/com/ejdoab/tcms/CVS/Entries @@ -0,0 +1,3 @@ +D/entities//// +D/services//// +D/util//// diff --git a/src/test/com/ejdoab/tcms/CVS/Repository b/src/test/com/ejdoab/tcms/CVS/Repository new file mode 100644 index 0000000..4fdb3f8 --- /dev/null +++ b/src/test/com/ejdoab/tcms/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab/tcms diff --git a/src/test/com/ejdoab/tcms/CVS/Root b/src/test/com/ejdoab/tcms/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/tcms/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/entities/AddressBeanTest.java b/src/test/com/ejdoab/tcms/entities/AddressBeanTest.java new file mode 100644 index 0000000..a7b4d34 --- /dev/null +++ b/src/test/com/ejdoab/tcms/entities/AddressBeanTest.java @@ -0,0 +1,135 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.entities; + +import org.apache.cactus.ServletTestCase; + +import java.sql.ResultSet; +import java.sql.Statement; + +import java.util.Collection; + +import javax.naming.Context; +import javax.naming.InitialContext; + +import javax.rmi.PortableRemoteObject; + + +/** + * Unit test for AddressBean + * @author cjudd + */ +public class AddressBeanTest extends ServletTestCase { + private static final String ADDR1 = "ADDR1"; + private static final String APT1 = "APPT1"; + private static final String CITY1 = "CITY1"; + private static final String STATE1 = "STATE1"; + private static final String ZIP1 = "ZIP1"; + private static final String ADDR2 = "ADDR2"; + private static final String APT2 = "APPT2"; + private static final String CITY2 = "CITY2"; + private static final String STATE2 = "STATE2"; + private static final String ZIP2 = "ZIP2"; + private static final String ADDR3 = "ADDR3"; + private static final String APT3 = "APPT3"; + private static final String CITY3 = "CITY3"; + private static final String STATE3 = "STATE3"; + private static final String ZIP3 = "ZIP3"; + private static final String ADDR4 = "ADDR4"; + private static final String APT4 = "APPT4"; + private static final String CITY4 = "CITY4"; + private static final String STATE4 = "STATE4"; + private static final String ZIP4 = "ZIP4"; + private Context ctx; + private AddressLocalHome home; + + /** + * Constructor for AddressBeanTest. + * @param arg0 + */ + public AddressBeanTest(String arg0) { + super(arg0); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void setUp() throws Exception { + ctx = new InitialContext(); + + // look up the home interface + Object obj = ctx.lookup("ejb.AddressLocalHome"); + assertNotNull("ejb.AddressLocalHome lookup", obj); + + // cast and narrow + home = (AddressLocalHome) PortableRemoteObject.narrow(obj, + AddressLocalHome.class); + assertNotNull("ejb.AddressBeanHome interface", home); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testCreateAddress() throws Exception { + Statement stmt = null; + ResultSet rs = null; + Collection c = null; + + c = home.findAll(); + assertEquals("Addresses count before Create", 5, c.size()); + + AddressLocal bean = home.create(ADDR1, APT1, CITY1, STATE1, ZIP1); + assertNotNull("AddressBean interface", bean); + + c = home.findAll(); + assertEquals("Addresses count after Create", 6, c.size()); + + c = home.findByStreetAddress(ADDR1); + assertEquals("Address count after address find", 1, c.size()); + + bean = (AddressLocal) c.toArray()[0]; + assertNotNull(bean); + + assertEquals("Street Address", ADDR1, bean.getStreetAddress()); + assertEquals("Apt", APT1, bean.getAptNumber()); + assertEquals("City", CITY1, bean.getCity()); + assertEquals("State", STATE1, bean.getState()); + assertEquals("Zip", ZIP1, bean.getZipCode()); + + //home.remove(bean); + bean.setStreetAddress(ADDR2); + bean.setAptNumber(APT2); + bean.setCity(CITY2); + bean.setState(STATE2); + bean.setZipCode(ZIP2); + + c = home.findByStreetAddress(ADDR1); + assertEquals("Search for ADDR1 changing address values", 0, c.size()); + + c = home.findByStreetAddress(ADDR2); + assertEquals("Search for ADDR2 changing address values", 1, c.size()); + + bean = (AddressLocal) c.toArray()[0]; + assertNotNull(bean); + + assertEquals("Street Address", ADDR2, bean.getStreetAddress()); + assertEquals("Apt", APT2, bean.getAptNumber()); + assertEquals("City", CITY2, bean.getCity()); + assertEquals("State", STATE2, bean.getState()); + assertEquals("Zip", ZIP2, bean.getZipCode()); + } +} diff --git a/src/test/com/ejdoab/tcms/entities/CVS/Entries b/src/test/com/ejdoab/tcms/entities/CVS/Entries new file mode 100644 index 0000000..ae3c6dc --- /dev/null +++ b/src/test/com/ejdoab/tcms/entities/CVS/Entries @@ -0,0 +1 @@ +/AddressBeanTest.java/1.5/Sun Jan 4 20:45:45 2004/-ko/ diff --git a/src/test/com/ejdoab/tcms/entities/CVS/Repository b/src/test/com/ejdoab/tcms/entities/CVS/Repository new file mode 100644 index 0000000..e3120f9 --- /dev/null +++ b/src/test/com/ejdoab/tcms/entities/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab/tcms/entities diff --git a/src/test/com/ejdoab/tcms/entities/CVS/Root b/src/test/com/ejdoab/tcms/entities/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/tcms/entities/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/services/CVS/Entries b/src/test/com/ejdoab/tcms/services/CVS/Entries new file mode 100644 index 0000000..b6cc394 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/CVS/Entries @@ -0,0 +1,4 @@ +/ConferenceServicesBeanTest.java/1.14/Sun Jan 4 01:51:42 2004// +/ScheduleServicesTest.java/1.7/Sun Jan 4 21:25:38 2004/-kb/ +/UserServiceBeanTest.java/1.3/Sun Jan 4 01:52:04 2004// +D/dto//// diff --git a/src/test/com/ejdoab/tcms/services/CVS/Repository b/src/test/com/ejdoab/tcms/services/CVS/Repository new file mode 100644 index 0000000..8af0805 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab/tcms/services diff --git a/src/test/com/ejdoab/tcms/services/CVS/Root b/src/test/com/ejdoab/tcms/services/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/services/ConferenceServicesBeanTest.java b/src/test/com/ejdoab/tcms/services/ConferenceServicesBeanTest.java new file mode 100644 index 0000000..4f81c68 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/ConferenceServicesBeanTest.java @@ -0,0 +1,242 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.services.dto.ConferenceAbstractDTO; +import com.ejdoab.tcms.services.dto.SessionDTO; +import com.ejdoab.tcms.services.dto.page.Page; +import com.ejdoab.tcms.util.DatabaseConnectionFactory; + +import junit.framework.TestCase; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.dbunit.Assertion; + +import org.dbunit.database.IDatabaseConnection; + +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.ITable; + +import org.dbunit.operation.DatabaseOperation; + +import java.rmi.RemoteException; + +import javax.naming.Context; + + +/** + * ConferenceServicesBean unit tests. + * @see ConferenceServicesBean + * @author cjudd + */ +public class ConferenceServicesBeanTest extends TestCase { + private static String PRESENTERS_EMAIL = "bsb@isllc.com"; + private static Log log = LogFactory.getLog(ConferenceServicesBeanTest.class); + private Context ctx = null; + private ConferenceServices cs = null; + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void setUp() throws Exception { + ConferenceServicesHome csHome = ConferenceServicesUtil.getHome(); + assertNotNull("ejb.ConferenceServiceHome interface", csHome); + + cs = csHome.create(); + assertNotNull("ConferenceServices remote interface", cs); + + IDatabaseConnection conn = DatabaseConnectionFactory.createConnection(); + + try { + DatabaseOperation.CLEAN_INSERT.execute(conn, + DatabaseConnectionFactory.createBaseDataSet()); + } finally { + conn.close(); + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testGetSessions() throws Exception { + Page page; + SessionDTO session; + + page = cs.getSessions(0, 5); + assertEquals("Sessions 0,5 (Valid range)", 5, page.getSize()); + + for (int i = 0; page.hasNext(); i++) { + session = (SessionDTO) page.next(); + assertEquals("Session id equals expected value in valid range", i, + session.getSessionId()); + } + + page = cs.getSessions(0, 16); + assertEquals("Sessions 1 through 16 (Entire range)", 16, page.getSize()); + + try { + page = cs.getSessions(-1, 5); + fail("Invalid range (-1,5)"); + } catch (RemoteException rex) { + } + + //todo: this should throw an exception because it is out of bounds + // try { + // page = cs.getSessions(-5,-1); + // fail("Invalid range (-5,-1)"); + // } catch (RemoteException rex) {} + //todo: Should return the 13,14,15,16 elements + // page = cs.getSessions(13,4); + // assertEquals("Sessions 13,4 (After valid range)", 4, page.getSize()); + page = cs.getSessions(20, 25); + assertEquals("Sessions 20 through 25 (After valid range)", 0, + page.getSize()); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testGetSessionByPresenter() throws Exception { + Page page; + SessionDTO session; + + page = cs.getSessionsByPresenter("cjudd@js.com", 0, 3); + assertEquals("Number of sessions for cjudd@js.com", 3, page.getSize()); + assertEquals("Number of total sessions for cjudd@js.com", 8, + page.getTotalSize()); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testGetAbstracts() throws Exception { + Page page; + ConferenceAbstractDTO ca; + + page = cs.getAbstracts(0, 5); + assertNotNull("Page", page); + assertEquals("Page size", 5, page.getSize()); + + //todo: I thought this should return 11 since there are 11 in the abstracts table + // assertEquals("Page total size", 11, page.getSize()); + while (page.hasNext()) { + ca = (ConferenceAbstractDTO) page.next(); + assertNotNull("Title", ca.getTitle()); + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testGetAbstractsByPresenter() throws Exception { + Page page; + ConferenceAbstractDTO ca; + + page = cs.getAbstractsByPresenter("cjudd@js.com", 0, 5); + assertNotNull("Page", page); + assertEquals("Page size", 5, page.getSize()); + assertEquals("Page total size", 5, page.getSize()); + + while (page.hasNext()) { + ca = (ConferenceAbstractDTO) page.next(); + assertNotNull("Title", ca.getTitle()); + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testSubmitAbstract() throws Exception { + Page page; + ConferenceAbstractDTO ca; + + page = cs.getAbstracts(0, 5); + + int totalAbstracts = page.getTotalSize(); + + Page presenterPage = cs.getAbstractsByPresenter(PRESENTERS_EMAIL, 0, 2); + assertEquals("Starting count of presenter's abstracts", 6, + presenterPage.getTotalSize()); + + int totalPresenterAbstracts = presenterPage.getTotalSize(); + + String aBody = "A panel of experts discuss the future of the Java platform"; + + ConferenceAbstractDTO dto = new ConferenceAbstractDTO("The future of Java", + "PANEL", "Management", "Intermediate", aBody, PRESENTERS_EMAIL); + + boolean submitted = cs.submitAbstract(dto); + assertTrue("Submitted abstract", submitted); + + //todo: Does not return the new abstract. I think because of the cache. + // page = cs.getAbstracts(0, 5); + // assertEquals("Cached total size", totalAbstracts + 1, page.getTotalSize()); + // try a uncached result + page = cs.getAbstracts(0, 6); + assertEquals("Uncached total size", totalAbstracts + 1, + page.getTotalSize()); + + presenterPage = cs.getAbstractsByPresenter(PRESENTERS_EMAIL, 0, 3); + assertEquals("After adding abstract count of presenter's abstracts", + totalPresenterAbstracts + 1, presenterPage.getTotalSize()); + + // compair contents of database ignoring PK_ID since it is generated + IDatabaseConnection conn = DatabaseConnectionFactory.createConnection(); + ITable actualTable = conn.createQueryTable("ABSTRACTS", + "select TITLE,TYPE,TOPIC,LEVEL,BODY,STATUS,FK_PRESENTERID from ABSTRACTS"); + + IDataSet expectedDataSet = DatabaseConnectionFactory.createDataSet( + "AfterAbstractSubmit.xml"); + ITable expectedTable = expectedDataSet.getTable("ABSTRACTS"); + + Assertion.assertEquals(expectedTable, actualTable); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testGetAbstract() throws Exception { + Page page; + ConferenceAbstractDTO ca; + + ca = cs.getAbstract(5); + assertNotNull("Abstract", ca); + assertEquals("Abract ID", 5, ca.getAbstractId()); + assertEquals("Title", "Performance Tuning J2EE", ca.getTitle()); + assertEquals("Level", "Beginner", ca.getLevel()); + assertEquals("Email", "cjudd@js.com", ca.getPresenterEmail()); + assertEquals("Status", "ACCEPTED", ca.getStatus()); + assertEquals("Presenter", "Christopher Judd", ca.getPresenter()); + assertEquals("Topic", "Development", ca.getTopic()); + assertEquals("Type", "REGULAR", ca.getType()); + assertEquals("Body", + "A scalable and extensible framework in which JavaTM technology performance tuning can be automated for enterprise applications.", + ca.getBody()); + } +} diff --git a/src/test/com/ejdoab/tcms/services/ScheduleServicesTest.java b/src/test/com/ejdoab/tcms/services/ScheduleServicesTest.java new file mode 100644 index 0000000..a57149d --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/ScheduleServicesTest.java @@ -0,0 +1,128 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.services.dto.ScheduleDTO; +import com.ejdoab.tcms.services.dto.ScheduleEntryDTO; +import com.ejdoab.tcms.services.dto.ScheduleReminderDTO; + +//import com.ejdoab.tcms.services.dto.exceptions.ScheduleConflictException; +import com.ejdoab.tcms.services.exceptions.NoSuchUserException; +import com.ejdoab.tcms.util.HoursAndMinutes; + +import junit.framework.*; + +import java.rmi.RemoteException; + +import java.util.Hashtable; + +import javax.ejb.CreateException; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import javax.rmi.PortableRemoteObject; + + +/** + * @author Brian Sam-Bodden + * + */ +public class ScheduleServicesTest extends TestCase { + private static final String ICF = "org.jnp.interfaces.NamingContextFactory"; + private static final String SERVER_URI = "localhost:1099"; + private static final String PKG_PREFIXES = "org.jboss.naming:org.jnp.interfaces"; + + /** + * DOCUMENT ME! + */ + public void testXXX() { + // dummy test to repress JUnit failure + } + + /** + * DOCUMENT ME! + * + * @param args DOCUMENT ME! + */ + public static void main(String[] args) { + Context ctx; + ScheduleServicesHome home; + ScheduleServices service; + + // initial context JBossNS configuration + Hashtable env = new Hashtable(); + env.put(Context.INITIAL_CONTEXT_FACTORY, ICF); + env.put(Context.PROVIDER_URL, SERVER_URI); + env.put(Context.URL_PKG_PREFIXES, PKG_PREFIXES); + + try { + // ---------- + // JNDI Stuff + // ---------- + ctx = new InitialContext(env); + + // look up the home interface + System.out.println( + "[jndi lookup] Looking Up Schedule Services Remote Home Interface"); + + Object obj = ctx.lookup("ejb.ScheduleServicesHome"); + + // cast and narrow + home = (ScheduleServicesHome) PortableRemoteObject.narrow(obj, + ScheduleServicesHome.class); + service = home.create(); + + // ---------- + // Tests begin + // ---------- + System.out.println("[test for getSchedule] "); + + ScheduleDTO schedule = null; + + try { + schedule = service.getUserSchedule("bsb@isllc.com"); + System.out.println("[schedule] \n" + schedule); + } catch (NoSuchUserException nsue) { + System.out.println("[getSchedule] " + nsue.getMessage()); + } + + boolean writeTest = false; + + if ((schedule != null) && (writeTest)) { + ScheduleEntryDTO entry = schedule.getScheduleEntry(20); + + //ScheduleItemDTO entry = new ScheduleItemDTO(5, "bsb@isllc.com", "applies to current project"); + ScheduleReminderDTO reminder = new ScheduleReminderDTO("my second reminder", + new HoursAndMinutes(5, 45)); + entry.addReminder(reminder); + + // try { + //schedule.addScheduleEntry(entry); + System.out.println("[schedule local] \n" + schedule); + service.setUserSchedule(schedule); + + // } catch (ScheduleConflictException sce) { + // System.out.println("[addScheduleEntry] scheduling conflict exception: " + sce.getMessage()); + // } + } + } catch (CreateException ce) { + System.out.println("[ejb] create exception: " + ce.getMessage()); + } catch (RemoteException re) { + System.out.println("[rmi] remote exception: " + re.getMessage()); + } catch (NamingException ne) { + System.out.println("[naming] naming exception: " + ne.getMessage()); + } + } +} diff --git a/src/test/com/ejdoab/tcms/services/UserServiceBeanTest.java b/src/test/com/ejdoab/tcms/services/UserServiceBeanTest.java new file mode 100644 index 0000000..09586ec --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/UserServiceBeanTest.java @@ -0,0 +1,188 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services; + +import com.ejdoab.tcms.services.dto.*; +import com.ejdoab.tcms.services.exceptions.*; +import com.ejdoab.tcms.util.*; + +import junit.framework.*; + +import org.dbunit.*; + +import org.dbunit.database.*; + +import org.dbunit.dataset.*; + +import org.dbunit.operation.*; + + +/** + * @author cjudd + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class UserServiceBeanTest extends TestCase { + private static String USER_EMAIL = "bsb@isllc.com"; + private UserServices us; + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void setUp() throws Exception { + UserServicesHome uslh = UserServicesUtil.getHome(); + us = uslh.create(); + + // set up datebase + IDatabaseConnection conn = DatabaseConnectionFactory.createConnection(); + + try { + DatabaseOperation.CLEAN_INSERT.execute(conn, + DatabaseConnectionFactory.createBaseDataSet()); + } finally { + conn.close(); + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testAuthenticate() throws Exception { + boolean authenticated = us.authenticate(USER_EMAIL, "pswd"); + assertTrue("Authenticated valid user", authenticated); + + authenticated = us.authenticate(USER_EMAIL, "invalid"); + assertFalse("Authenticated invalid password", authenticated); + + try { + us.authenticate("invalid", "invalid"); + fail("Invalid user"); + } catch (NoSuchUserException nsue) { + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testRegisterUser() throws Exception { + UserProfileDTO attendee = new UserProfileDTO(); + + attendee.setUserType(UserProfileDTO.UserType.ATTENDEE); + attendee.setPassword("abc"); + attendee.setFirstName("Larry"); + attendee.setLastName("Ellison"); + attendee.setEmail("larry@oracle.com"); + attendee.setHomePhone("555.555.6661"); + attendee.setWorkPhone("555.555.6662"); + attendee.setFax("555.555.6663"); + + boolean registered = us.registerUser(attendee); + assertTrue("Registered new attendee", registered); + + UserProfileDTO newAttendee = us.getUserProfile("larry@oracle.com"); + assertNotNull("New attendee", newAttendee); + assertEquals("New attendee email", "larry@oracle.com", + newAttendee.getEmail()); + assertEquals("New attendee first name", "Larry", + newAttendee.getFirstName()); + + // compair contents of database ignoring PK_ID since it is generated + IDatabaseConnection conn = DatabaseConnectionFactory.createConnection(); + ITable actualTable = conn.createQueryTable("USERS", + "select PASSWORD,FIRSTNAME,LASTNAME,EMAIL,HOMEPHONE,WORKPHONE,FAX from USERS"); + + IDataSet expectedDataSet = DatabaseConnectionFactory.createDataSet( + "AfterUserSubmit.xml"); + ITable expectedTable = expectedDataSet.getTable("USERS"); + + Assertion.assertEquals(expectedTable, actualTable); + + try { + us.registerUser(attendee); + fail("Reregister email address"); + } catch (DuplicateEmailException dee) { + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testRegisterPresenter() throws Exception { + UserProfileDTO presenter = new UserProfileDTO(); + + presenter.setUserType(UserProfileDTO.UserType.PRESENTER); + presenter.setPassword("edf"); + presenter.setFirstName("Bill"); + presenter.setLastName("Gates"); + presenter.setEmail("billy@ms.com"); + presenter.setHomePhone("555.523.6661"); + presenter.setWorkPhone("555.523.6662"); + presenter.setFax("555.523.6663"); + + boolean registered = us.registerUser(presenter); + assertTrue("Registered new presenter", registered); + + UserProfileDTO newPresenter = us.getUserProfile("billy@ms.com"); + assertNotNull("New presenter", newPresenter); + assertEquals("New presenter email", "billy@ms.com", + newPresenter.getEmail()); + assertEquals("New presenter first name", "Bill", + newPresenter.getFirstName()); + + // compair contents of database ignoring PK_ID since it is generated + IDatabaseConnection conn = DatabaseConnectionFactory.createConnection(); + ITable actualTable = conn.createQueryTable("USERS", + "select PASSWORD,FIRSTNAME,LASTNAME,EMAIL,HOMEPHONE,WORKPHONE,FAX from USERS"); + + IDataSet expectedDataSet = DatabaseConnectionFactory.createDataSet( + "AfterPresenterSubmit.xml"); + ITable expectedTable = expectedDataSet.getTable("USERS"); + + Assertion.assertEquals(expectedTable, actualTable); + + try { + us.registerUser(presenter); + fail("Reregister email address"); + } catch (DuplicateEmailException dee) { + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testSetUserProfile() throws Exception { + UserProfileDTO user = us.getUserProfile("bsb@isllc.com"); + + assertNotNull("Got user", user); + + user.setFirstName("first"); + user.setFax("fax"); + + us.setUserProfile(user); + + user = us.getUserProfile("bsb@isllc.com"); + assertEquals("Check first", "first", user.getFirstName()); + assertEquals("Check fax", "fax", user.getFax()); + } +} diff --git a/src/test/com/ejdoab/tcms/services/dto/CVS/Entries b/src/test/com/ejdoab/tcms/services/dto/CVS/Entries new file mode 100644 index 0000000..a4f7a39 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/CVS/Entries @@ -0,0 +1 @@ +D/page//// diff --git a/src/test/com/ejdoab/tcms/services/dto/CVS/Repository b/src/test/com/ejdoab/tcms/services/dto/CVS/Repository new file mode 100644 index 0000000..1a333f8 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab/tcms/services/dto diff --git a/src/test/com/ejdoab/tcms/services/dto/CVS/Root b/src/test/com/ejdoab/tcms/services/dto/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/services/dto/page/CVS/Entries b/src/test/com/ejdoab/tcms/services/dto/page/CVS/Entries new file mode 100644 index 0000000..97a450a --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/page/CVS/Entries @@ -0,0 +1,3 @@ +/PageCacheTest.java/1.5/Sun Jan 4 01:54:23 2004// +/PageFactoryTest.java/1.8/Sun Jan 4 20:55:49 2004// +/PageTest.java/1.5/Sun Jan 4 02:16:53 2004// diff --git a/src/test/com/ejdoab/tcms/services/dto/page/CVS/Repository b/src/test/com/ejdoab/tcms/services/dto/page/CVS/Repository new file mode 100644 index 0000000..61f7e51 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/page/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab/tcms/services/dto/page diff --git a/src/test/com/ejdoab/tcms/services/dto/page/CVS/Root b/src/test/com/ejdoab/tcms/services/dto/page/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/page/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/services/dto/page/PageCacheTest.java b/src/test/com/ejdoab/tcms/services/dto/page/PageCacheTest.java new file mode 100644 index 0000000..9e19147 --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/page/PageCacheTest.java @@ -0,0 +1,85 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.page; + +import junit.framework.TestCase; + +import java.util.*; + + +/** + * PageCache unit tests. + * @see PageCache + * @author cjudd + */ +public class PageCacheTest extends TestCase { + private static final String NAME1 = "Name 1"; + private static final String NAME2 = "Name 2"; + private static final String NAME3 = "Name 3"; + private PageCache pc = PageCache.getInstance(); + private Page page1; + private Page page2; + private Page page3; + private Collection list; + + /** + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + list = new ArrayList(); + list.add("One"); + list.add("Two"); + list.add("Three"); + page1 = new Page(list, 0, 3); + page2 = new Page(list, 0, 2); + page3 = new Page(list, 0, 1); + } + + /** + * @see TestCase#tearDown() + */ + protected void tearDown() throws Exception { + pc.cleanCache(); + } + + /** + * DOCUMENT ME! + */ + public void testAddPage() { + pc.addPage(NAME1, page1, 1); + assertEquals("NAME 1", page1, pc.getPage(NAME1)); + pc.addPage(NAME2, page2, 1); + assertEquals("NAME 2", page2, pc.getPage(NAME2)); + pc.addPage(NAME3, page3, 1); + assertEquals("NAME 3", page3, pc.getPage(NAME3)); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testCleanCache() throws Exception { + pc.addPage(NAME1, page1, 1); + assertEquals("NAME 1", page1, pc.getPage(NAME1)); + pc.addPage(NAME2, page2, 5); + pc.addPage(NAME3, page3, 1); + assertEquals("NAME 3", page3, pc.getPage(NAME3)); + + Thread.sleep(70000); // just over a 1 minute delay + + assertNull("NAME 1", pc.getPage(NAME1)); + assertNotNull("NAME 2", pc.getPage(NAME2)); + assertNull("NAME 3", pc.getPage(NAME3)); + } +} diff --git a/src/test/com/ejdoab/tcms/services/dto/page/PageFactoryTest.java b/src/test/com/ejdoab/tcms/services/dto/page/PageFactoryTest.java new file mode 100644 index 0000000..8562fcd --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/page/PageFactoryTest.java @@ -0,0 +1,83 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.page; + +import com.ejdoab.tcms.entities.*; +import com.ejdoab.tcms.services.dto.*; + +import org.apache.cactus.*; + +import java.util.*; + + +/** + * PageFactory unit tests. + * @see PageFactory + * @author cjudd + */ +public class PageFactoryTest extends ServletTestCase { + private SessionDTOFactory dtoFactory = null; + + /** + * Creates a new PageFactoryTest object. + * + * @param arg0 DOCUMENT ME! + */ + public PageFactoryTest(String arg0) { + super(arg0); + } + + /** + * DOCUMENT ME! + */ + public void setUp() { + dtoFactory = (SessionDTOFactory) DTOAbstractFactory.getInstance() + .getDTOBuilder(SessionDTO.class); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testBuildPage() throws Exception { + SessionLocalHome slh; + + slh = SessionUtil.getLocalHome(); + + Collection c = slh.findAll(); + + Page page = PageFactory.buildPage(c, 0, 5, dtoFactory); + assertNotNull("Page object", page); + assertEquals("Page size", 5, page.getSize()); + assertEquals("Page total size", 16, page.getTotalSize()); + + for (; page.hasNext();) { + Object obj = page.next(); + assertTrue("Instance of Session", obj instanceof SessionDTO); + } + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + public void testEmptyCollection() throws Exception { + Page page; + page = PageFactory.buildPage(new ArrayList(), 0, 5, dtoFactory); + assertEquals("Page size", 0, page.getSize()); + assertEquals("Page total size", 0, page.getTotalSize()); + assertEquals("Page.EMPTY_PAGE", Page.EMPTY_PAGE, page); + } +} diff --git a/src/test/com/ejdoab/tcms/services/dto/page/PageTest.java b/src/test/com/ejdoab/tcms/services/dto/page/PageTest.java new file mode 100644 index 0000000..ac9858c --- /dev/null +++ b/src/test/com/ejdoab/tcms/services/dto/page/PageTest.java @@ -0,0 +1,141 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.services.dto.page; + +import com.ejdoab.tcms.services.dto.page.Page; + +import junit.framework.TestCase; + +import java.util.*; + + +/** + * Page Unit Test + * @see Page + * @author cjudd + */ +public class PageTest extends TestCase { + private static final int SIZE = 10; + private Collection list = new ArrayList(); + + /** + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + for (int i = 1; i <= SIZE; i++) { + list.add(new Integer(i)); + } + } + + /** + * @see TestCase#tearDown() + */ + protected void tearDown() throws Exception { + list.clear(); + } + + /** + * Test getSize, getTotalSize and getIndex + */ + public void testGetSize() { + Page page; + + page = new Page(list, 0, 10); + assertEquals("Get Size of entire collection.", SIZE, page.getSize()); + assertEquals("Get Total Size of entire collection.", SIZE, + page.getTotalSize()); + assertEquals("Get Index on entire collection", 0, page.getIndex()); + + page = new Page(list, 2, 4); + assertEquals("Get Size of index 2 and size 4.", 4, page.getSize()); + assertEquals("Get Total Size of index 2 and size 4.", SIZE, + page.getTotalSize()); + assertEquals("Get Index of index 2 and size 4", 2, page.getIndex()); + } + + /** + * Test Page boundries. + */ + public void testBoundries() { + Page page; + + try { + page = new Page(list, -5, 2); + fail("Invalid index -5,2"); + } catch (ArrayIndexOutOfBoundsException abex) { + // expected + } + + try { + page = new Page(list, -1, 2); + fail("Invalid index -1,2"); + } catch (ArrayIndexOutOfBoundsException abex) { + // expected + } + + page = new Page(list, 9, 1); + assertEquals("Valid range 9,1", 1, page.getSize()); + + //todo: fix Array out of bounds error + // page = new Page(list, 9, 2); + // assertEquals("Valid range 9,1", 1, page.getSize()); + } + + /** + * Test for hasNext and next. + */ + public void testNext() { + Page page; + + page = new Page(list, 0, 10); + + for (int i = 1; page.hasNext(); i++) { + Integer item = (Integer) page.next(); + assertEquals("Page element 0,10", i, item.intValue()); + } + + page = new Page(list, 2, 4); + + for (int i = 3; page.hasNext(); i++) { + Integer item = (Integer) page.next(); + assertEquals("Page element 2,4", i, item.intValue()); + } + } + + /** + * Test for getNextPageStartIndex, getPreviousPageStartIndex, + * hasMoreDataAhead and hasMoreDataBefore + */ + public void testHasMoreData() { + Page page; + + page = new Page(list, 0, 4); + assertEquals("Next page start:1", 4, page.getNextPageStartIndex()); + assertEquals("Prev page start:1", 0, page.getPreviousPageStartIndex()); + assertEquals("Has more ahead: 1", true, page.hasMoreDataAhead()); + assertEquals("Has more before:1", false, page.hasMoreDataBefore()); + + page = new Page(list, page.getNextPageStartIndex(), 4); + assertEquals("Next Page Start:2", 8, page.getNextPageStartIndex()); + assertEquals("Prev Page Start:2", 0, page.getPreviousPageStartIndex()); + assertEquals("Has more ahead: 2", true, page.hasMoreDataAhead()); + assertEquals("Has more before:2", true, page.hasMoreDataBefore()); + + //todo: fix Array out of bounds exception + // page = new Page(list, page.getNextPageStartIndex(), 4); + // assertEquals("Next Page Start:3", 12, page.getNextPageStartIndex()); + // assertEquals("Prev Page Start:3", 8, page.getPreviousPageStartIndex()); + // assertEquals("Has more ahead: 3", true, page.hasMoreDataAhead()); + // assertEquals("Has more before:3", true, page.hasMoreDataBefore()); + } +} diff --git a/src/test/com/ejdoab/tcms/util/CVS/Entries b/src/test/com/ejdoab/tcms/util/CVS/Entries new file mode 100644 index 0000000..ca80271 --- /dev/null +++ b/src/test/com/ejdoab/tcms/util/CVS/Entries @@ -0,0 +1 @@ +/DatabaseConnectionFactory.java/1.4/Mon Dec 29 20:33:41 2003/-ko/ diff --git a/src/test/com/ejdoab/tcms/util/CVS/Repository b/src/test/com/ejdoab/tcms/util/CVS/Repository new file mode 100644 index 0000000..055ab98 --- /dev/null +++ b/src/test/com/ejdoab/tcms/util/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/com/ejdoab/tcms/util diff --git a/src/test/com/ejdoab/tcms/util/CVS/Root b/src/test/com/ejdoab/tcms/util/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/com/ejdoab/tcms/util/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/com/ejdoab/tcms/util/DatabaseConnectionFactory.java b/src/test/com/ejdoab/tcms/util/DatabaseConnectionFactory.java new file mode 100644 index 0000000..01b32cc --- /dev/null +++ b/src/test/com/ejdoab/tcms/util/DatabaseConnectionFactory.java @@ -0,0 +1,73 @@ +/* ========================================================================= * + * * + * Enterprise Java Development on a Budget * + * Technology Conference Management System * + * www.ejdoab.com * + * Licensed under The Apache Software License, Version 1.1 * + * * + * Copyright (c) 2003 Brian Sam-Bodden, Christopher M. Judd * + * All rights reserved. * + * * + * ========================================================================= */ + +package com.ejdoab.tcms.util; + +import org.dbunit.database.DatabaseConnection; +import org.dbunit.database.IDatabaseConnection; + +import org.dbunit.dataset.*; +import org.dbunit.dataset.xml.*; + +import java.io.*; + +import java.sql.*; + +import java.util.*; + + +/** + * Utility Factory for create DbUnit Database Connections + * @author cjudd + */ +public class DatabaseConnectionFactory { + /** + * Creates a DbUnit database connection. + * @return test database connection + */ + public static IDatabaseConnection createConnection() + throws Exception { + Properties prop = new Properties(); + InputStream is = DatabaseConnectionFactory.class.getResourceAsStream( + "/db.properties"); + prop.load(is); + + Class driverClass = Class.forName(prop.getProperty("db.driver")); + Connection conn = DriverManager.getConnection(prop.getProperty("db.url"), + prop.getProperty("db.user"), prop.getProperty("db.password")); + + return new DatabaseConnection(conn); + } + + /** + * Creates a DbUnit dataset based on a xml file. + * @param xmlFile path to an xml file containing the dataset + * @return requested dataset + */ + public static IDataSet createDataSet(String xmlFile) + throws Exception { + InputStream is = DatabaseConnectionFactory.class.getClass() + .getResourceAsStream("/data/" + + xmlFile); + Reader r = new InputStreamReader(is); + + return new XmlDataSet(r); + } + + /** + * Create a DbUnit dataset representing the base dataset for all database tests. + * @return base database set + */ + public static IDataSet createBaseDataSet() throws Exception { + return createDataSet("BaseDataSet.xml"); + } +} diff --git a/src/test/data/AfterAbstractSubmit.xml b/src/test/data/AfterAbstractSubmit.xml new file mode 100644 index 0000000..e2d602c --- /dev/null +++ b/src/test/data/AfterAbstractSubmit.xml @@ -0,0 +1,120 @@ + + + + TITLE + TYPE + TOPIC + LEVEL + BODY + STATUS + FK_PRESENTERID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/src/test/data/AfterPresenterSubmit.xml b/src/test/data/AfterPresenterSubmit.xml new file mode 100644 index 0000000..8242e8c --- /dev/null +++ b/src/test/data/AfterPresenterSubmit.xml @@ -0,0 +1,57 @@ + + + + PASSWORD + FIRSTNAME + LASTNAME + EMAIL + HOMEPHONE + WORKPHONE + FAX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/src/test/data/AfterUserSubmit.xml b/src/test/data/AfterUserSubmit.xml new file mode 100644 index 0000000..d9bcf38 --- /dev/null +++ b/src/test/data/AfterUserSubmit.xml @@ -0,0 +1,57 @@ + + + + PASSWORD + FIRSTNAME + LASTNAME + EMAIL + HOMEPHONE + WORKPHONE + FAX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/src/test/data/BaseDataSet.xml b/src/test/data/BaseDataSet.xml new file mode 100644 index 0000000..a9f252a --- /dev/null +++ b/src/test/data/BaseDataSet.xml @@ -0,0 +1,849 @@ + + + + PK_ID + QUESTIONTEXT + QUESTIONTYPE + QUESTIONCHOICES +
    + + NAME + IDX + + + + + + + + +
    + + PK_PRICINGMODEL + STARTDATE + ENDDATE + PRICE + + + + + + + + + + + + + + + + + + +
    + + PK_ID + ROLENAME + DESCRIPTION + + + + + + + + + + +
    + + PK_RULENAME + MINIMUMATTENDEES + MAXIMUMATTENDEES + DISCOUNTPERATTENDEE + + + + + + + + + + + + + + + + + + +
    + + PK_ID + NAME + DESCRIPTION + + + + + + + + + + + + + + + +
    + + PK_ID + FK_QUESTIONID + FK_PRESENTATIONID +
    + + PK_ID + STREETADDRESS + APTNUMBER + CITY + STATE + ZIPCODE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + NAME + DESCRIPTION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_ADDRESSID + NAME + PHONE + FAX + + + + + + + +
    + + PK_ID + NAME + + + + + + + + + + + + +
    + + PK_ID + PASSWORD + FIRSTNAME + LASTNAME + EMAIL + HOMEPHONE + WORKPHONE + FAX + FK_ADDRESSID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_VENUEID + NAME + NOTES + CAPACITY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + NAME + DESCRIPTION + FK_SESSIONID + FK_USERID +
    + + PK_ID + FK_USERID + FK_QUESTIONNAIREID +
    + + PK_ID + NAME + DESCRIPTION + STARTDATE + ENDDATE + ABSTRACTSUBMISSIONSTARTDATE + ABSTRACTSUBMISSIONENDDATE + FK_VENUEID + + + + + + + + + + +
    + + PK_ID + FK_SCHEDULEENTRYID + FK_USERID + MESSAGE + DATEANDTIME +
    + + PK_ID + NAME + DESCRIPTION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_USERID + FK_ROLE + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_VENUEID + NOTES + SIZE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_CONFERENCEID + TITLE + SUBTITLE + DESCRIPTION + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_USERID + + + + + + + + +
    + + PK_ID + FK_USERID + COMPANY + BIO + + + + + + + + + + + + +
    + + PK_ID + TITLE + TYPE + TOPIC + LEVEL + BODY + STATUS + FK_PRESENTERID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_ABSTRACTID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + PK_ID + FK_PRESENTATIONID + FK_ROOMID + DATETIMEBEGIN + DATETIMEEND + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/src/test/data/CVS/Entries b/src/test/data/CVS/Entries new file mode 100644 index 0000000..ea560c0 --- /dev/null +++ b/src/test/data/CVS/Entries @@ -0,0 +1,4 @@ +/AfterAbstractSubmit.xml/1.1/Wed Jun 11 16:02:46 2003/-ko/ +/AfterPresenterSubmit.xml/1.1/Thu Jul 24 01:43:11 2003// +/AfterUserSubmit.xml/1.1/Thu Jul 24 01:43:11 2003// +/BaseDataSet.xml/1.2/Wed Jun 11 15:59:27 2003/-ko/ diff --git a/src/test/data/CVS/Repository b/src/test/data/CVS/Repository new file mode 100644 index 0000000..5b8d6d8 --- /dev/null +++ b/src/test/data/CVS/Repository @@ -0,0 +1 @@ +tcms/src/test/data diff --git a/src/test/data/CVS/Root b/src/test/data/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/test/data/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/test/jndi.properties b/src/test/jndi.properties new file mode 100644 index 0000000..5e7cd0f --- /dev/null +++ b/src/test/jndi.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory +java.naming.provider.url=localhost:1099 +java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces \ No newline at end of file diff --git a/src/test/log_client.properties b/src/test/log_client.properties new file mode 100644 index 0000000..2cc24b2 --- /dev/null +++ b/src/test/log_client.properties @@ -0,0 +1,17 @@ +# Properties for configuring Log4j +# This is the configuring for logging on the JUnit side (i.e. the client side) + +log4j.appender.cactus = org.apache.log4j.FileAppender +log4j.appender.cactus.File = cactus_client.log +log4j.appender.cactus.Append = false +log4j.appender.cactus.layout = org.apache.log4j.PatternLayout +log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n + +# Any application log which uses Log4J will be logged to the Cactus log file +log4j.rootCategory=DEBUG, cactus + +# By default we don't log at the DEBUG level for Cactus log, in order not to generate too +# many logs. However, should a problem arise and logs need to be sent to the Cactus dev team, +# then we will ask you to change this to DEBUG. +log4j.category.org.apache.cactus = WARN, cactus +log4j.additivity.org.apache.cactus=false \ No newline at end of file diff --git a/src/test/log_server.properties b/src/test/log_server.properties new file mode 100644 index 0000000..2cc24b2 --- /dev/null +++ b/src/test/log_server.properties @@ -0,0 +1,17 @@ +# Properties for configuring Log4j +# This is the configuring for logging on the JUnit side (i.e. the client side) + +log4j.appender.cactus = org.apache.log4j.FileAppender +log4j.appender.cactus.File = cactus_client.log +log4j.appender.cactus.Append = false +log4j.appender.cactus.layout = org.apache.log4j.PatternLayout +log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n + +# Any application log which uses Log4J will be logged to the Cactus log file +log4j.rootCategory=DEBUG, cactus + +# By default we don't log at the DEBUG level for Cactus log, in order not to generate too +# many logs. However, should a problem arise and logs need to be sent to the Cactus dev team, +# then we will ask you to change this to DEBUG. +log4j.category.org.apache.cactus = WARN, cactus +log4j.additivity.org.apache.cactus=false \ No newline at end of file diff --git a/src/web/CVS/Entries b/src/web/CVS/Entries new file mode 100644 index 0000000..389e804 --- /dev/null +++ b/src/web/CVS/Entries @@ -0,0 +1,5 @@ +D/WEB-INF//// +D/images//// +/index.html/1.1/Mon Jul 14 00:17:54 2003// +/read-me.txt/1.1/Sat May 10 19:11:22 2003/-kb/ +D/style//// diff --git a/src/web/CVS/Repository b/src/web/CVS/Repository new file mode 100644 index 0000000..beb171f --- /dev/null +++ b/src/web/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web diff --git a/src/web/CVS/Root b/src/web/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/WEB-INF/CVS/Entries b/src/web/WEB-INF/CVS/Entries new file mode 100644 index 0000000..4e38397 --- /dev/null +++ b/src/web/WEB-INF/CVS/Entries @@ -0,0 +1,11 @@ +/c.tld/1.1/Sun Jul 13 23:51:25 2003/-kb/ +/fmt.tld/1.1/Tue Jul 15 00:48:17 2003/-kb/ +D/jsp//// +/struts-bean.tld/1.1/Thu Aug 28 00:22:58 2003/-kb/ +/struts-config.xml/1.4/Sat Jan 3 15:48:17 2004// +/struts-html.tld/1.1/Thu Aug 28 00:22:58 2003/-kb/ +/struts-logic.tld/1.1/Thu Aug 28 00:22:58 2003/-kb/ +/struts-tiles.tld/1.1/Sun Jul 13 23:51:25 2003/-kb/ +/tiles-defs.xml/1.4/Sat Jan 3 15:51:41 2004// +/validation.xml/1.3/Sat Jan 3 16:11:07 2004// +/validator-rules.xml/1.1/Thu Aug 28 00:22:58 2003// diff --git a/src/web/WEB-INF/CVS/Repository b/src/web/WEB-INF/CVS/Repository new file mode 100644 index 0000000..f041e07 --- /dev/null +++ b/src/web/WEB-INF/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web/WEB-INF diff --git a/src/web/WEB-INF/CVS/Root b/src/web/WEB-INF/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/WEB-INF/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/WEB-INF/c.tld b/src/web/WEB-INF/c.tld new file mode 100644 index 0000000..ce80e8d --- /dev/null +++ b/src/web/WEB-INF/c.tld @@ -0,0 +1,416 @@ + + + + 1.0 + 1.2 + c + http://java.sun.com/jstl/core + JSTL core + JSTL 1.0 core library + + + + org.apache.taglibs.standard.tlv.JstlCoreTLV + + + expressionAttributes + + out:value + out:default + out:escapeXml + if:test + import:url + import:context + import:charEncoding + forEach:items + forEach:begin + forEach:end + forEach:step + forTokens:items + forTokens:begin + forTokens:end + forTokens:step + param:encode + param:name + param:value + redirect:context + redirect:url + set:property + set:target + set:value + url:context + url:value + when:test + + + Whitespace-separated list of colon-separated token pairs + describing tag:attribute combinations that accept expressions. + The validator uses this information to determine which + attributes need their syntax validated. + + + + + + catch + org.apache.taglibs.standard.tag.common.core.CatchTag + JSP + + Catches any Throwable that occurs in its body and optionally + exposes it. + + + var + false + false + + + + + choose + org.apache.taglibs.standard.tag.common.core.ChooseTag + JSP + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + + + + out + org.apache.taglibs.standard.tag.el.core.OutTag + JSP + + Like <%= ... >, but for expressions. + + + value + true + false + + + default + false + false + + + escapeXml + false + false + + + + + if + org.apache.taglibs.standard.tag.el.core.IfTag + JSP + + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + + + test + true + false + + + var + false + false + + + scope + false + false + + + + + import + org.apache.taglibs.standard.tag.el.core.ImportTag + org.apache.taglibs.standard.tei.ImportTEI + JSP + + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + + + url + true + false + + + var + false + false + + + scope + false + false + + + varReader + false + false + + + context + false + false + + + charEncoding + false + false + + + + + forEach + org.apache.taglibs.standard.tag.el.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + + items + false + false + + + begin + false + false + + + end + false + false + + + step + false + false + + + var + false + false + + + varStatus + false + false + + + + + forTokens + org.apache.taglibs.standard.tag.el.core.ForTokensTag + JSP + + Iterates over tokens, separated by the supplied delimeters + + + items + true + false + + + delims + true + false + + + begin + false + false + + + end + false + false + + + step + false + false + + + var + false + false + + + varStatus + false + false + + + + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + + + + param + org.apache.taglibs.standard.tag.el.core.ParamTag + JSP + + Adds a parameter to a containing 'import' tag's URL. + + + name + true + false + + + value + false + false + + + + + redirect + org.apache.taglibs.standard.tag.el.core.RedirectTag + JSP + + Redirects to a new URL. + + + var + false + false + + + scope + false + false + + + url + true + false + + + context + false + false + + + + + remove + org.apache.taglibs.standard.tag.common.core.RemoveTag + empty + + Removes a scoped variable (from a particular scope, if specified). + + + var + true + false + + + scope + false + false + + + + + set + org.apache.taglibs.standard.tag.el.core.SetTag + JSP + + Sets the result of an expression evaluation in a 'scope' + + + var + false + false + + + value + false + false + + + target + false + false + + + property + false + false + + + scope + false + false + + + + + url + org.apache.taglibs.standard.tag.el.core.UrlTag + JSP + + Prints or exposes a URL with optional query parameters + (via the c:param tag). + + + var + false + false + + + scope + false + false + + + value + true + false + + + context + false + false + + + + + when + org.apache.taglibs.standard.tag.el.core.WhenTag + JSP + + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + + + test + true + false + + + + diff --git a/src/web/WEB-INF/fmt.tld b/src/web/WEB-INF/fmt.tld new file mode 100644 index 0000000..20523ee --- /dev/null +++ b/src/web/WEB-INF/fmt.tld @@ -0,0 +1,442 @@ + + + + 1.0 + 1.2 + fmt + http://java.sun.com/jstl/fmt + JSTL fmt + JSTL 1.0 i18n-capable formatting library + + + + org.apache.taglibs.standard.tlv.JstlFmtTLV + + + expressionAttributes + + requestEncoding:value + setLocale:value + setLocale:variant + timeZone:value + setTimeZone:value + bundle:basename + bundle:prefix + setBundle:basename + message:key + message:bundle + param:value + formatNumber:value + formatNumber:pattern + formatNumber:currencyCode + formatNumber:currencySymbol + formatNumber:groupingUsed + formatNumber:maxIntegerDigits + formatNumber:minIntegerDigits + formatNumber:maxFractionDigits + formatNumber:minFractionDigits + parseNumber:value + parseNumber:pattern + parseNumber:parseLocale + parseNumber:integerOnly + formatDate:value + formatDate:pattern + formatDate:timeZone + parseDate:value + parseDate:pattern + parseDate:timeZone + parseDate:parseLocale + + + Whitespace-separated list of colon-separated token pairs + describing tag:attribute combinations that accept expressions. + The validator uses this information to determine which + attributes need their syntax validated. + + + + + + requestEncoding + org.apache.taglibs.standard.tag.el.fmt.RequestEncodingTag + empty + + Sets the request character encoding + + + value + false + false + + + + + setLocale + org.apache.taglibs.standard.tag.el.fmt.SetLocaleTag + empty + + Stores the given locale in the locale configuration variable + + + value + true + false + + + variant + false + false + + + scope + false + false + + + + + timeZone + org.apache.taglibs.standard.tag.el.fmt.TimeZoneTag + JSP + + Specifies the time zone for any time formatting or parsing actions + nested in its body + + + value + true + false + + + + + setTimeZone + org.apache.taglibs.standard.tag.el.fmt.SetTimeZoneTag + empty + + Stores the given time zone in the time zone configuration variable + + + value + true + false + + + var + false + false + + + scope + false + false + + + + + bundle + org.apache.taglibs.standard.tag.el.fmt.BundleTag + JSP + + Loads a resource bundle to be used by its tag body + + + basename + true + false + + + prefix + false + false + + + + + setBundle + org.apache.taglibs.standard.tag.el.fmt.SetBundleTag + empty + + Loads a resource bundle and stores it in the named scoped variable or + the bundle configuration variable + + + basename + true + false + + + var + false + false + + + scope + false + false + + + + + message + org.apache.taglibs.standard.tag.el.fmt.MessageTag + JSP + + Maps key to localized message and performs parametric replacement + + + key + false + false + + + bundle + false + false + + + var + false + false + + + scope + false + false + + + + + param + org.apache.taglibs.standard.tag.el.fmt.ParamTag + JSP + + Supplies an argument for parametric replacement to a containing + <message> tag + + + value + false + false + + + + + formatNumber + org.apache.taglibs.standard.tag.el.fmt.FormatNumberTag + JSP + + Formats a numeric value as a number, currency, or percentage + + + value + false + false + + + type + false + false + + + pattern + false + false + + + currencyCode + false + false + + + currencySymbol + false + false + + + groupingUsed + false + false + + + maxIntegerDigits + false + false + + + minIntegerDigits + false + false + + + maxFractionDigits + false + false + + + minFractionDigits + false + false + + + var + false + false + + + scope + false + false + + + + + parseNumber + org.apache.taglibs.standard.tag.el.fmt.ParseNumberTag + JSP + + Parses the string representation of a number, currency, or percentage + + + value + false + false + + + type + false + false + + + pattern + false + false + + + parseLocale + false + false + + + integerOnly + false + false + + + var + false + false + + + scope + false + false + + + + + formatDate + org.apache.taglibs.standard.tag.el.fmt.FormatDateTag + empty + + Formats a date and/or time using the supplied styles and pattern + + + value + true + false + + + type + false + false + + + dateStyle + false + false + + + timeStyle + false + false + + + pattern + false + false + + + timeZone + false + false + + + var + false + false + + + scope + false + false + + + + + parseDate + org.apache.taglibs.standard.tag.el.fmt.ParseDateTag + JSP + + Parses the string representation of a date and/or time + + + value + false + false + + + type + false + false + + + dateStyle + false + false + + + timeStyle + false + false + + + pattern + false + false + + + timeZone + false + false + + + parseLocale + false + false + + + var + false + false + + + scope + false + false + + + + diff --git a/src/web/WEB-INF/jsp/CVS/Entries b/src/web/WEB-INF/jsp/CVS/Entries new file mode 100644 index 0000000..f1f85d0 --- /dev/null +++ b/src/web/WEB-INF/jsp/CVS/Entries @@ -0,0 +1,10 @@ +/call.jsp/1.1/Sat Jan 3 15:46:27 2004/-kb/ +/index.jsp/1.3/Fri Jan 2 12:14:12 2004// +D/layout//// +/registration.jsp/1.2/Sat Jan 3 16:46:32 2004/-kb/ +/registrationThanks.jsp/1.1/Sat Jan 3 15:53:37 2004/-kb/ +/sessions.jsp/1.4/Tue Dec 23 21:16:43 2003/-kb/ +/sessionsByPresenters.jsp/1.1/Tue Dec 23 21:59:01 2003/-kb/ +/speakerThanks.jsp/1.2/Sat Jan 3 15:53:28 2004/-kb/ +/speakers.jsp/1.1/Mon Jul 14 00:19:02 2003/-kb/ +D/tiles//// diff --git a/src/web/WEB-INF/jsp/CVS/Repository b/src/web/WEB-INF/jsp/CVS/Repository new file mode 100644 index 0000000..0ea5752 --- /dev/null +++ b/src/web/WEB-INF/jsp/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web/WEB-INF/jsp diff --git a/src/web/WEB-INF/jsp/CVS/Root b/src/web/WEB-INF/jsp/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/WEB-INF/jsp/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/WEB-INF/jsp/call.jsp b/src/web/WEB-INF/jsp/call.jsp new file mode 100644 index 0000000..afa2cd9 --- /dev/null +++ b/src/web/WEB-INF/jsp/call.jsp @@ -0,0 +1,111 @@ +<%@ taglib uri="struts-tiles" prefix="tiles" %> +<%@ taglib uri="struts-html" prefix="html" %> +<%@ taglib uri="struts-bean" prefix="bean" %> +<%@ taglib uri="struts-logic" prefix="logic" %> + +

    Submit Abstract

    +

    Enterprise Java Conference is looking for the best Java practitioners to present + current and valueable topics to experience Java developers. If you think you + have such a topic submit it now and we will let you know if your topic has been + selected. +

    + + + +
      + +
    • +
      +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + First Name: + + +
    + Last Name: + + +
    + Email: + + +
    + Password: + + +
    + Home Phone: + + +
    + Work Phone: + + +
    + Fax: + + +
    + Street: + + +
    + City: + + + State: + Zip: +
    + Submit + + Reset +
    + +
    \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/index.jsp b/src/web/WEB-INF/jsp/index.jsp new file mode 100644 index 0000000..73172dc --- /dev/null +++ b/src/web/WEB-INF/jsp/index.jsp @@ -0,0 +1,5 @@ +

    +Prepare to be amazed by the greatest Java technology in the world. +Presenters from all Java disiplines will provide the necessary +insites though presentations and keynotes. +

    \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/layout/CVS/Entries b/src/web/WEB-INF/jsp/layout/CVS/Entries new file mode 100644 index 0000000..49a105f --- /dev/null +++ b/src/web/WEB-INF/jsp/layout/CVS/Entries @@ -0,0 +1 @@ +/masterLayout.jsp/1.2/Thu Aug 28 00:26:10 2003/-kb/ diff --git a/src/web/WEB-INF/jsp/layout/CVS/Repository b/src/web/WEB-INF/jsp/layout/CVS/Repository new file mode 100644 index 0000000..042d5e5 --- /dev/null +++ b/src/web/WEB-INF/jsp/layout/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web/WEB-INF/jsp/layout diff --git a/src/web/WEB-INF/jsp/layout/CVS/Root b/src/web/WEB-INF/jsp/layout/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/WEB-INF/jsp/layout/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/WEB-INF/jsp/layout/masterLayout.jsp b/src/web/WEB-INF/jsp/layout/masterLayout.jsp new file mode 100644 index 0000000..aa67c2c --- /dev/null +++ b/src/web/WEB-INF/jsp/layout/masterLayout.jsp @@ -0,0 +1,39 @@ +<%@ taglib uri="struts-tiles" prefix="tiles" %> + + + + <tiles:getAsString name="title"/> + + + + + + + + + +
    + +
    + + + + +
    + + + +
    + + + + +
    + +
    + + \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/registration.jsp b/src/web/WEB-INF/jsp/registration.jsp new file mode 100644 index 0000000..d6dd8b8 --- /dev/null +++ b/src/web/WEB-INF/jsp/registration.jsp @@ -0,0 +1,107 @@ +<%@ taglib uri="struts-html" prefix="html" %> +<%@ taglib uri="struts-bean" prefix="bean" %> +<%@ taglib uri="struts-logic" prefix="logic" %> + +

    Registration

    +

    Join us at the Enterprise Java Conference. +

    + + + +
      + +
    • +
      +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + First Name: + + +
    + Last Name: + + +
    + Email: + + +
    + Password: + + +
    + Home Phone: + + +
    + Work Phone: + + +
    + Fax: + + +
    + Street: + + +
    + City: + + + State: + Zip: +
    + Submit + + Reset +
    + +
    \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/registrationThanks.jsp b/src/web/WEB-INF/jsp/registrationThanks.jsp new file mode 100644 index 0000000..f865310 --- /dev/null +++ b/src/web/WEB-INF/jsp/registrationThanks.jsp @@ -0,0 +1,5 @@ +

    Thank You

    + +

    +Thank you for registring for the Enterprise Java Conference. We look forward to seeing you at the event. +

    diff --git a/src/web/WEB-INF/jsp/registrationThanks.jsp~ b/src/web/WEB-INF/jsp/registrationThanks.jsp~ new file mode 100644 index 0000000..684aefa --- /dev/null +++ b/src/web/WEB-INF/jsp/registrationThanks.jsp~ @@ -0,0 +1,5 @@ +

    Thanks You

    + +

    +Thank you for submitting an abstract. We will let you know if the abstract has been accepted. +

    \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/sessions.jsp b/src/web/WEB-INF/jsp/sessions.jsp new file mode 100644 index 0000000..3675483 --- /dev/null +++ b/src/web/WEB-INF/jsp/sessions.jsp @@ -0,0 +1,15 @@ +<%@ taglib uri="jstl-core" prefix="c" %> +<%@ taglib uri="jstl-format" prefix="fmt" %> + +

    Sessions

    + + +
    + Presenter: ">
    + Day:
    + Time: + -
    + Location:
    + Track:
    +

    + diff --git a/src/web/WEB-INF/jsp/sessionsByPresenters.jsp b/src/web/WEB-INF/jsp/sessionsByPresenters.jsp new file mode 100644 index 0000000..cadd2d0 --- /dev/null +++ b/src/web/WEB-INF/jsp/sessionsByPresenters.jsp @@ -0,0 +1,14 @@ +<%@ taglib uri="jstl-core" prefix="c" %> +<%@ taglib uri="jstl-format" prefix="fmt" %> + +

    Sessions

    + + +
    + Day:
    + Time: + -
    + Location:
    + Track:
    +

    + diff --git a/src/web/WEB-INF/jsp/speakerThanks.jsp b/src/web/WEB-INF/jsp/speakerThanks.jsp new file mode 100644 index 0000000..46df713 --- /dev/null +++ b/src/web/WEB-INF/jsp/speakerThanks.jsp @@ -0,0 +1,5 @@ +

    Thank You

    + +

    +Thank you for submitting an abstract. We will let you know if the abstract has been accepted. +

    \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/speakers.jsp b/src/web/WEB-INF/jsp/speakers.jsp new file mode 100644 index 0000000..c84d13f --- /dev/null +++ b/src/web/WEB-INF/jsp/speakers.jsp @@ -0,0 +1 @@ +

    Speakers

    diff --git a/src/web/WEB-INF/jsp/tiles/CVS/Entries b/src/web/WEB-INF/jsp/tiles/CVS/Entries new file mode 100644 index 0000000..c6ae43e --- /dev/null +++ b/src/web/WEB-INF/jsp/tiles/CVS/Entries @@ -0,0 +1,3 @@ +/footer.jsp/1.1/Sun Jul 13 23:52:06 2003/-kb/ +/header.jsp/1.1/Sun Jul 13 23:52:06 2003/-kb/ +/menu.jsp/1.3/Sat Jan 3 15:58:19 2004/-kb/ diff --git a/src/web/WEB-INF/jsp/tiles/CVS/Repository b/src/web/WEB-INF/jsp/tiles/CVS/Repository new file mode 100644 index 0000000..9a11390 --- /dev/null +++ b/src/web/WEB-INF/jsp/tiles/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web/WEB-INF/jsp/tiles diff --git a/src/web/WEB-INF/jsp/tiles/CVS/Root b/src/web/WEB-INF/jsp/tiles/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/WEB-INF/jsp/tiles/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/WEB-INF/jsp/tiles/footer.jsp b/src/web/WEB-INF/jsp/tiles/footer.jsp new file mode 100644 index 0000000..3f104cb --- /dev/null +++ b/src/web/WEB-INF/jsp/tiles/footer.jsp @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/tiles/header.jsp b/src/web/WEB-INF/jsp/tiles/header.jsp new file mode 100644 index 0000000..ab24bd5 --- /dev/null +++ b/src/web/WEB-INF/jsp/tiles/header.jsp @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/web/WEB-INF/jsp/tiles/menu.jsp b/src/web/WEB-INF/jsp/tiles/menu.jsp new file mode 100644 index 0000000..c4e16b3 --- /dev/null +++ b/src/web/WEB-INF/jsp/tiles/menu.jsp @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/src/web/WEB-INF/server-config.wsdd b/src/web/WEB-INF/server-config.wsdd new file mode 100644 index 0000000..58e4944 --- /dev/null +++ b/src/web/WEB-INF/server-config.wsdd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://xml.apache.org/axis/wsdd/ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/web/WEB-INF/struts-bean.tld b/src/web/WEB-INF/struts-bean.tld new file mode 100644 index 0000000..7dfc6bd --- /dev/null +++ b/src/web/WEB-INF/struts-bean.tld @@ -0,0 +1,382 @@ + + + + + + + + + + +1.0 +1.1 +bean +http://jakarta.apache.org/struts/tags-bean + +cookie +org.apache.struts.taglib.bean.CookieTag +org.apache.struts.taglib.bean.CookieTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +define +org.apache.struts.taglib.bean.DefineTag +org.apache.struts.taglib.bean.DefineTei +JSP + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +header +org.apache.struts.taglib.bean.HeaderTag +org.apache.struts.taglib.bean.HeaderTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +include +org.apache.struts.taglib.bean.IncludeTag +org.apache.struts.taglib.bean.IncludeTei +empty + +anchor +false +true + + +forward +false +true + + +href +false +true + + +id +true +false + + +name +false +true + + +page +false +true + + +transaction +false +true + + + +message +org.apache.struts.taglib.bean.MessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +page +org.apache.struts.taglib.bean.PageTag +org.apache.struts.taglib.bean.PageTei +empty + +id +true +false + + +property +true +true + + + +parameter +org.apache.struts.taglib.bean.ParameterTag +org.apache.struts.taglib.bean.ParameterTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +resource +org.apache.struts.taglib.bean.ResourceTag +org.apache.struts.taglib.bean.ResourceTei +empty + +id +true +false + + +input +false +true + + +name +true +true + + + +size +org.apache.struts.taglib.bean.SizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + + +struts +org.apache.struts.taglib.bean.StrutsTag +org.apache.struts.taglib.bean.StrutsTei +empty + +id +true +false + + +formBean +false +true + + +forward +false +true + + +mapping +false +true + + + +write +org.apache.struts.taglib.bean.WriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +true +true + + +property +false +true + + +scope +false +true + + + + + + diff --git a/src/web/WEB-INF/struts-config.xml b/src/web/WEB-INF/struts-config.xml new file mode 100644 index 0000000..f6e2a26 --- /dev/null +++ b/src/web/WEB-INF/struts-config.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/web/WEB-INF/struts-html.tld b/src/web/WEB-INF/struts-html.tld new file mode 100644 index 0000000..9087060 --- /dev/null +++ b/src/web/WEB-INF/struts-html.tld @@ -0,0 +1,2972 @@ + + + + + + + + + + +1.0 +1.1 +html +http://jakarta.apache.org/struts/tags-html + +base +org.apache.struts.taglib.html.BaseTag +empty + +target +false +true + + +server +false +true + + + +button +org.apache.struts.taglib.html.ButtonTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +cancel +org.apache.struts.taglib.html.CancelTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +checkbox +org.apache.struts.taglib.html.CheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.html.ErrorsTag +empty + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + + +file +org.apache.struts.taglib.html.FileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.html.FormTag +JSP + +action +true +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +name +false +true + + +onreset +false +true + + +onsubmit +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + +type +false +true + + + +frame +org.apache.struts.taglib.html.FrameTag + +action +false +true + + +anchor +false +true + + +forward +false +true + + +frameborder +false +true + + +frameName +false +true + + +href +false +true + + +longdesc +false +true + + +marginheight +false +true + + +marginwidth +false +true + + +name +false +true + + +noresize +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +scrolling +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +hidden +org.apache.struts.taglib.html.HiddenTag +empty + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + +write +false +true + + + +html +org.apache.struts.taglib.html.HtmlTag +JSP + +locale +false +true + + +xhtml +false +true + + + +image +org.apache.struts.taglib.html.ImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.html.ImgTag +empty + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +javascript +org.apache.struts.taglib.html.JavascriptValidatorTag +empty + +cdata +false +true + + +dynamicJavascript +false +false + + +formName +false +true + + +method +false +true + + +page +false +true + + +src +false +true + + +staticJavascript +false +false + + +htmlComment +false +true + + + +link +org.apache.struts.taglib.html.LinkTag + +accesskey +false +true + + +action +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +messages +org.apache.struts.taglib.html.MessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +false + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.html.MultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +option +org.apache.struts.taglib.html.OptionTag + +bundle +false +true + + +disabled +false +true + + +key +false +true + + +locale +false +true + + +style +false +true + + +styleId +false +true + + +styleClass +false +true + + +value +true +true + + + +options +org.apache.struts.taglib.html.OptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.html.OptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.html.PasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.html.RadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +reset +org.apache.struts.taglib.html.ResetTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +rewrite +org.apache.struts.taglib.html.RewriteTag +empty + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + + +select +org.apache.struts.taglib.html.SelectTag +JSP + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.html.SubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.html.TextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.html.TextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +cols +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +xhtml +org.apache.struts.taglib.html.XhtmlTag +empty + + + diff --git a/src/web/WEB-INF/struts-logic.tld b/src/web/WEB-INF/struts-logic.tld new file mode 100644 index 0000000..1975973 --- /dev/null +++ b/src/web/WEB-INF/struts-logic.tld @@ -0,0 +1,642 @@ + + + + + + + + + +1.0 +1.1 +logic +http://jakarta.apache.org/struts/tags-logic + +empty +org.apache.struts.taglib.logic.EmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.logic.EqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +forward +org.apache.struts.taglib.logic.ForwardTag +empty + +name +true +true + + + +greaterEqual +org.apache.struts.taglib.logic.GreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.logic.GreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.logic.IterateTag +org.apache.struts.taglib.logic.IterateTei +JSP + +collection +false +true + + +id +true +false + + +indexId +false +false + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.logic.LessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.logic.LessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.logic.MatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.logic.MessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.logic.MessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.logic.NotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.logic.NotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.logic.NotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.logic.NotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.logic.PresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +redirect +org.apache.struts.taglib.logic.RedirectTag + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + + + + + diff --git a/src/web/WEB-INF/struts-tiles.tld b/src/web/WEB-INF/struts-tiles.tld new file mode 100644 index 0000000..e70d3ce --- /dev/null +++ b/src/web/WEB-INF/struts-tiles.tld @@ -0,0 +1,344 @@ + + + + + + + + + + +1.0 +1.1 +tiles +http://jakarta.apache.org/struts/tags-tiles + +insert +org.apache.struts.taglib.tiles.InsertTag +JSP + +template +false +true + + +component +false +true + + +page +false +true + + +definition +false +true + + +attribute +false +false + + +name +false +true + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +flush +false +false + + +ignore +false +true + + +role +false +true + + +controllerUrl +false +true + + +controllerClass +false +true + + + +definition +org.apache.struts.taglib.tiles.DefinitionTag +JSP + +id +true +false + + +scope +false +false + + +template +false +true + + +page +false +true + + +role +false +true + + +extends +false +true + + + +put +org.apache.struts.taglib.tiles.PutTag +JSP + +name +false +false + + +value +false +true + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +putList +org.apache.struts.taglib.tiles.PutListTag +JSP + +name +true +false + + + +add +org.apache.struts.taglib.tiles.AddTag +JSP + +value +false +false + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +get +org.apache.struts.taglib.tiles.GetTag +empty + +name +true +true + + +ignore +false +true + + +flush +false +false + + +role +false +true + + + +getAsString +org.apache.struts.taglib.tiles.GetAttributeTag +empty + +name +true +true + + +ignore +false +true + + +role +false +true + + + +useAttribute +org.apache.struts.taglib.tiles.UseAttributeTag +org.apache.struts.taglib.tiles.UseAttributeTei +empty + +id +false +false + + +classname +false +false + + +scope +false +false + + +name +true +true + + +ignore +false +true + + + +importAttribute +org.apache.struts.taglib.tiles.ImportAttributeTag +empty + +name +false +true + + +scope +false +false + + +ignore +false +true + + + +initComponentDefinitions +org.apache.struts.taglib.tiles.InitDefinitionsTag +empty + +file +true +false + + +classname +false +false + + + + + + diff --git a/src/web/WEB-INF/tiles-defs.xml b/src/web/WEB-INF/tiles-defs.xml new file mode 100644 index 0000000..f110012 --- /dev/null +++ b/src/web/WEB-INF/tiles-defs.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/web/WEB-INF/validation.xml b/src/web/WEB-INF/validation.xml new file mode 100644 index 0000000..9d2a828 --- /dev/null +++ b/src/web/WEB-INF/validation.xml @@ -0,0 +1,80 @@ + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + \ No newline at end of file diff --git a/src/web/WEB-INF/validator-rules.xml b/src/web/WEB-INF/validator-rules.xml new file mode 100644 index 0000000..de8e3fa --- /dev/null +++ b/src/web/WEB-INF/validator-rules.xml @@ -0,0 +1,1044 @@ + + + + + + + + + + = 0) { + value = field.options[si].value; + } + } else { + value = field.value; + } + + if (trim(value).length == 0) { + + if (i == 0) { + focusField = field; + } + fields[i++] = oRequired[x][1]; + isValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return isValid; + } + + // Trim whitespace from left and right sides of s. + function trim(s) { + return s.replace( /^\s*/, "" ).replace( /\s*$/, "" ); + } + + ]]> + + + + + + + + + + 0) && (field.value.length < iMin)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oMinLength[x][1]; + isValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return isValid; + }]]> + + + + + + + + iMax) { + if (i == 0) { + focusField = field; + } + fields[i++] = oMaxLength[x][1]; + isValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return isValid; + }]]> + + + + + + + + 0)) { + + if (!matchPattern(field.value, oMasked[x][2]("mask"))) { + if (i == 0) { + focusField = field; + } + fields[i++] = oMasked[x][1]; + isValid = false; + } + } + } + + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return isValid; + } + + function matchPattern(value, mask) { + return mask.exec(value); + }]]> + + + + + + + + = 0) { + value = field.options[si].value; + } + } else { + value = field.value; + } + + if (value.length > 0) { + if (!isAllDigits(value)) { + bValid = false; + if (i == 0) { + focusField = field; + } + fields[i++] = oByte[x][1]; + + } else { + + var iValue = parseInt(value); + if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oByte[x][1]; + bValid = false; + } + } + } + + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + }]]> + + + + + + + + = 0) { + value = field.options[si].value; + } + } else { + value = field.value; + } + + if (value.length > 0) { + if (!isAllDigits(value)) { + bValid = false; + if (i == 0) { + focusField = field; + } + fields[i++] = oShort[x][1]; + + } else { + + var iValue = parseInt(value); + if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oShort[x][1]; + bValid = false; + } + } + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + }]]> + + + + + + + + = 0) { + value = field.options[si].value; + } + } else { + value = field.value; + } + + if (value.length > 0) { + + if (!isAllDigits(value)) { + bValid = false; + if (i == 0) { + focusField = field; + } + fields[i++] = oInteger[x][1]; + + } else { + var iValue = parseInt(value); + if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oInteger[x][1]; + bValid = false; + } + } + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + } + + function isAllDigits(argvalue) { + argvalue = argvalue.toString(); + var validChars = "0123456789"; + var startFrom = 0; + if (argvalue.substring(0, 2) == "0x") { + validChars = "0123456789abcdefABCDEF"; + startFrom = 2; + } else if (argvalue.charAt(0) == "0") { + validChars = "01234567"; + startFrom = 1; + } else if (argvalue.charAt(0) == "-") { + startFrom = 1; + } + + for (var n = startFrom; n < argvalue.length; n++) { + if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false; + } + return true; + }]]> + + + + + + + + + + + = 0) { + value = field.options[si].value; + } + } else { + value = field.value; + } + + if (value.length > 0) { + // remove '.' before checking digits + var tempArray = value.split('.'); + var joinedString= tempArray.join(''); + + if (!isAllDigits(joinedString)) { + bValid = false; + if (i == 0) { + focusField = field; + } + fields[i++] = oFloat[x][1]; + + } else { + var iValue = parseFloat(value); + if (isNaN(iValue)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oFloat[x][1]; + bValid = false; + } + } + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + }]]> + + + + + + + + + + + 0) && + (datePattern.length > 0)) { + var MONTH = "MM"; + var DAY = "dd"; + var YEAR = "yyyy"; + var orderMonth = datePattern.indexOf(MONTH); + var orderDay = datePattern.indexOf(DAY); + var orderYear = datePattern.indexOf(YEAR); + if ((orderDay < orderYear && orderDay > orderMonth)) { + var iDelim1 = orderMonth + MONTH.length; + var iDelim2 = orderDay + DAY.length; + var delim1 = datePattern.substring(iDelim1, iDelim1 + 1); + var delim2 = datePattern.substring(iDelim2, iDelim2 + 1); + if (iDelim1 == orderDay && iDelim2 == orderYear) { + dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$"); + } else if (iDelim1 == orderDay) { + dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$"); + } else if (iDelim2 == orderYear) { + dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$"); + } else { + dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$"); + } + var matched = dateRegexp.exec(value); + if(matched != null) { + if (!isValidDate(matched[2], matched[1], matched[3])) { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } else { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } else if ((orderMonth < orderYear && orderMonth > orderDay)) { + var iDelim1 = orderDay + DAY.length; + var iDelim2 = orderMonth + MONTH.length; + var delim1 = datePattern.substring(iDelim1, iDelim1 + 1); + var delim2 = datePattern.substring(iDelim2, iDelim2 + 1); + if (iDelim1 == orderMonth && iDelim2 == orderYear) { + dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$"); + } else if (iDelim1 == orderMonth) { + dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$"); + } else if (iDelim2 == orderYear) { + dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$"); + } else { + dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$"); + } + var matched = dateRegexp.exec(value); + if(matched != null) { + if (!isValidDate(matched[1], matched[2], matched[3])) { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } else { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } else if ((orderMonth > orderYear && orderMonth < orderDay)) { + var iDelim1 = orderYear + YEAR.length; + var iDelim2 = orderMonth + MONTH.length; + var delim1 = datePattern.substring(iDelim1, iDelim1 + 1); + var delim2 = datePattern.substring(iDelim2, iDelim2 + 1); + if (iDelim1 == orderMonth && iDelim2 == orderDay) { + dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$"); + } else if (iDelim1 == orderMonth) { + dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$"); + } else if (iDelim2 == orderDay) { + dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$"); + } else { + dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{2})$"); + } + var matched = dateRegexp.exec(value); + if(matched != null) { + if (!isValidDate(matched[3], matched[2], matched[1])) { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } else { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } else { + if (i == 0) { + focusField = form[oDate[x][0]]; + } + fields[i++] = oDate[x][1]; + bValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + } + + function isValidDate(day, month, year) { + if (month < 1 || month > 12) { + return false; + } + if (day < 1 || day > 31) { + return false; + } + if ((month == 4 || month == 6 || month == 9 || month == 11) && + (day == 31)) { + return false; + } + if (month == 2) { + var leap = (year % 4 == 0 && + (year % 100 != 0 || year % 400 == 0)); + if (day>29 || (day == 29 && !leap)) { + return false; + } + } + return true; + }]]> + + + + + + + + + + + + + + + 0)) { + + var iMin = parseInt(oRange[x][2]("min")); + var iMax = parseInt(oRange[x][2]("max")); + var iValue = parseInt(field.value); + if (!(iValue >= iMin && iValue <= iMax)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oRange[x][1]; + isValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return isValid; + }]]> + + + + + + + 0)) { + + var fMin = parseFloat(oRange[x][2]("min")); + var fMax = parseFloat(oRange[x][2]("max")); + var fValue = parseFloat(field.value); + if (!(fValue >= fMin && fValue <= fMax)) { + if (i == 0) { + focusField = field; + } + fields[i++] = oRange[x][1]; + isValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return isValid; + }]]> + + + + + + + 0)) { + if (!luhnCheck(form[oCreditCard[x][0]].value)) { + if (i == 0) { + focusField = form[oCreditCard[x][0]]; + } + fields[i++] = oCreditCard[x][1]; + bValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + } + + /** + * Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl + */ + function luhnCheck(cardNumber) { + if (isLuhnNum(cardNumber)) { + var no_digit = cardNumber.length; + var oddoeven = no_digit & 1; + var sum = 0; + for (var count = 0; count < no_digit; count++) { + var digit = parseInt(cardNumber.charAt(count)); + if (!((count & 1) ^ oddoeven)) { + digit *= 2; + if (digit > 9) digit -= 9; + }; + sum += digit; + }; + if (sum == 0) return false; + if (sum % 10 == 0) return true; + }; + return false; + } + + function isLuhnNum(argvalue) { + argvalue = argvalue.toString(); + if (argvalue.length == 0) { + return false; + } + for (var n = 0; n < argvalue.length; n++) { + if ((argvalue.substring(n, n+1) < "0") || + (argvalue.substring(n,n+1) > "9")) { + return false; + } + } + return true; + }]]> + + + + + + + + 0)) { + if (!checkEmail(form[oEmail[x][0]].value)) { + if (i == 0) { + focusField = form[oEmail[x][0]]; + } + fields[i++] = oEmail[x][1]; + bValid = false; + } + } + } + if (fields.length > 0) { + focusField.focus(); + alert(fields.join('\n')); + } + return bValid; + } + + /** + * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com), + * http://javascript.internet.com + */ + function checkEmail(emailStr) { + if (emailStr.length == 0) { + return true; + } + var emailPat=/^(.+)@(.+)$/; + var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"; + var validChars="\[^\\s" + specialChars + "\]"; + var quotedUser="(\"[^\"]*\")"; + var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/; + var atom=validChars + '+'; + var word="(" + atom + "|" + quotedUser + ")"; + var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); + var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$"); + var matchArray=emailStr.match(emailPat); + if (matchArray == null) { + return false; + } + var user=matchArray[1]; + var domain=matchArray[2]; + if (user.match(userPat) == null) { + return false; + } + var IPArray = domain.match(ipDomainPat); + if (IPArray != null) { + for (var i = 1; i <= 4; i++) { + if (IPArray[i] > 255) { + return false; + } + } + return true; + } + var domainArray=domain.match(domainPat); + if (domainArray == null) { + return false; + } + var atomPat=new RegExp(atom,"g"); + var domArr=domain.match(atomPat); + var len=domArr.length; + if ((domArr[domArr.length-1].length < 2) || + (domArr[domArr.length-1].length > 3)) { + return false; + } + if (len < 2) { + return false; + } + return true; + }]]> + + + + + + + diff --git a/src/web/happyaxis.jsp b/src/web/happyaxis.jsp new file mode 100644 index 0000000..e743460 --- /dev/null +++ b/src/web/happyaxis.jsp @@ -0,0 +1,526 @@ + +<%@ page import="java.io.InputStream, + java.io.IOException, + javax.xml.parsers.SAXParser, + javax.xml.parsers.SAXParserFactory" + session="false" %> + <% + /* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Ant", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR + * ITS 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. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ +%> + +Axis Happiness Page + + +<%! + + /* + * Happiness tests for axis. These look at the classpath and warn if things + * are missing. Normally addng this much code in a JSP page is mad + * but here we want to validate JSP compilation too, and have a drop-in + * page for easy re-use + * @author Steve 'configuration problems' Loughran + * @author dims + * @author Brian Ewins + */ + + + /** + * Get a string providing install information. + * TODO: make this platform aware and give specific hints + */ + public String getInstallHints(HttpServletRequest request) { + + String hint= + "Note: On Tomcat 4.x and Java1.4, you may need to put libraries that contain " + +"java.* or javax.* packages into CATALINA_HOME/common/lib" + +"
    jaxrpc.jar and saaj.jar are two such libraries."; + return hint; + } + + /** + * test for a class existing + * @param classname + * @return class iff present + */ + Class classExists(String classname) { + try { + return Class.forName(classname); + } catch (ClassNotFoundException e) { + return null; + } + } + + /** + * test for resource on the classpath + * @param resource + * @return true iff present + */ + boolean resourceExists(String resource) { + boolean found; + InputStream instream=this.getClass().getResourceAsStream(resource); + found=instream!=null; + if(instream!=null) { + try { + instream.close(); + } catch (IOException e) { + } + } + return found; + } + + /** + * probe for a class, print an error message is missing + * @param out stream to print stuff + * @param category text like "warning" or "error" + * @param classname class to look for + * @param jarFile where this class comes from + * @param errorText extra error text + * @param homePage where to d/l the library + * @return the number of missing classes + * @throws IOException + */ + int probeClass(JspWriter out, + String category, + String classname, + String jarFile, + String description, + String errorText, + String homePage) throws IOException { + try { + Class clazz = classExists(classname); + if(clazz == null) { + String url=""; + if(homePage!=null) { + url="
    See "+homePage+""; + } + out.write("

    "+category+": could not find class "+classname + +" from file "+jarFile + +"
    "+errorText + +url + +"

    "); + return 1; + } else { + String location = getLocation(out, clazz); + if(location == null) { + out.write("Found "+ description + " (" + classname + ")
    "); + } + else { + out.write("Found "+ description + " (" + classname + ") at " + location + "
    "); + } + return 0; + } + } catch(NoClassDefFoundError ncdfe) { + String url=""; + if(homePage!=null) { + url="
    See "+homePage+""; + } + out.write("

    "+category+": could not find a dependency" + +" of class "+classname + +" from file "+jarFile + +"
    "+errorText + +url + +"
    The root cause was: "+ncdfe.getMessage() + +"
    This can happen e.g. if "+classname+" is in" + +" the 'common' classpath, but a dependency like " + +" activation.jar is only in the webapp classpath." + +"

    "); + return 1; + } + } + + /** + * get the location of a class + * @param out + * @param clazz + * @return the jar file or path where a class was found + */ + + String getLocation(JspWriter out, + Class clazz) { + try { + java.net.URL url = clazz.getProtectionDomain().getCodeSource().getLocation(); + String location = url.toString(); + if(location.startsWith("jar")) { + url = ((java.net.JarURLConnection)url.openConnection()).getJarFileURL(); + location = url.toString(); + } + + if(location.startsWith("file")) { + java.io.File file = new java.io.File(url.getFile()); + return file.getAbsolutePath(); + } else { + return url.toString(); + } + } catch (Throwable t){ + } + return "an unknown location"; + } + + /** + * a class we need if a class is missing + * @param out stream to print stuff + * @param classname class to look for + * @param jarFile where this class comes from + * @param errorText extra error text + * @param homePage where to d/l the library + * @throws IOException when needed + * @return the number of missing libraries (0 or 1) + */ + int needClass(JspWriter out, + String classname, + String jarFile, + String description, + String errorText, + String homePage) throws IOException { + return probeClass(out, + "Error", + classname, + jarFile, + description, + errorText, + homePage); + } + + /** + * print warning message if a class is missing + * @param out stream to print stuff + * @param classname class to look for + * @param jarFile where this class comes from + * @param errorText extra error text + * @param homePage where to d/l the library + * @throws IOException when needed + * @return the number of missing libraries (0 or 1) + */ + int wantClass(JspWriter out, + String classname, + String jarFile, + String description, + String errorText, + String homePage) throws IOException { + return probeClass(out, + "Warning", + classname, + jarFile, + description, + errorText, + homePage); + } + + /** + * probe for a resource existing, + * @param out + * @param resource + * @param errorText + * @throws Exception + */ + int wantResource(JspWriter out, + String resource, + String errorText) throws Exception { + if(!resourceExists(resource)) { + out.write("

    Warning: could not find resource "+resource + +"
    " + +errorText); + return 0; + } else { + out.write("found "+resource+"
    "); + return 1; + } + } + + + /** + * get servlet version string + * + */ + + public String getServletVersion() { + ServletContext context=getServletConfig().getServletContext(); + int major = context.getMajorVersion(); + int minor = context.getMinorVersion(); + return Integer.toString(major) + '.' + Integer.toString(minor); + } + + + + /** + * what parser are we using. + * @return the classname of the parser + */ + private String getParserName() { + SAXParser saxParser = getSAXParser(); + if (saxParser == null) { + return "Could not create an XML Parser"; + } + + // check to what is in the classname + String saxParserName = saxParser.getClass().getName(); + return saxParserName; + } + + /** + * Create a JAXP SAXParser + * @return parser or null for trouble + */ + private SAXParser getSAXParser() { + SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); + if (saxParserFactory == null) { + return null; + } + SAXParser saxParser = null; + try { + saxParser = saxParserFactory.newSAXParser(); + } catch (Exception e) { + } + return saxParser; + } + + /** + * get the location of the parser + * @return path or null for trouble in tracking it down + */ + + private String getParserLocation(JspWriter out) { + SAXParser saxParser = getSAXParser(); + if (saxParser == null) { + return null; + } + String location = getLocation(out,saxParser.getClass()); + return location; + } + %> +Axis Happiness Page + +

    Axis Happiness Page

    +

    Examining webapp configuration

    + +

    +

    Needed Components

    +<% + int needed=0,wanted=0; + + /** + * the essentials, without these Axis is not going to work + */ + needed=needClass(out, "javax.xml.soap.SOAPMessage", + "saaj.jar", + "SAAJ API", + "Axis will not work", + "http://xml.apache.org/axis/"); + + needed+=needClass(out, "javax.xml.rpc.Service", + "jaxrpc.jar", + "JAX-RPC API", + "Axis will not work", + "http://xml.apache.org/axis/"); + + needed+=needClass(out, "org.apache.axis.transport.http.AxisServlet", + "axis.jar", + "Apache-Axis", + "Axis will not work", + "http://xml.apache.org/axis/"); + + needed+=needClass(out, "org.apache.commons.discovery.Resource", + "commons-discovery.jar", + "Jakarta-Commons Discovery", + "Axis will not work", + "http://jakarta.apache.org/commons/discovery.html"); + + needed+=needClass(out, "org.apache.commons.logging.Log", + "commons-logging.jar", + "Jakarta-Commons Logging", + "Axis will not work", + "http://jakarta.apache.org/commons/logging.html"); + + needed+=needClass(out, "org.apache.log4j.Layout", + "log4j-1.2.8.jar", + "Log4j", + "Axis may not work", + "http://jakarta.apache.org/log4j"); + + //should we search for a javax.wsdl file here, to hint that it needs + //to go into an approved directory? because we dont seem to need to do that. + needed+=needClass(out, "com.ibm.wsdl.factory.WSDLFactoryImpl", + "wsdl4j.jar", + "IBM's WSDL4Java", + "Axis will not work", + null); + + needed+=needClass(out, "javax.xml.parsers.SAXParserFactory", + "xerces.jar", + "JAXP implementation", + "Axis will not work", + "http://xml.apache.org/xerces-j/"); + + needed+=needClass(out,"javax.activation.DataHandler", + "activation.jar", + "Activation API", + "Axis will not work", + "http://java.sun.com/products/javabeans/glasgow/jaf.html"); +%> +

    Optional Components

    +<% + /* + * now the stuff we can live without + */ + wanted+=wantClass(out,"javax.mail.internet.MimeMessage", + "mail.jar", + "Mail API", + "Attachments will not work", + "http://java.sun.com/products/javamail/"); + + wanted+=wantClass(out,"org.apache.xml.security.Init", + "xmlsec.jar", + "XML Security API", + "XML Security is not supported", + "http://xml.apache.org/security/"); + + wanted += wantClass(out, "javax.net.ssl.SSLSocketFactory", + "jsse.jar or java1.4+ runtime", + "Java Secure Socket Extension", + "https is not supported", + "http://java.sun.com/products/jsse/"); + /* + * resources on the classpath path + */ + /* broken; this is a file, not a resource + wantResource(out,"/server-config.wsdd", + "There is no server configuration file;" + +"run AdminClient to create one"); + */ + /* add more libraries here */ + + out.write("

    "); + //is everythng we need here + if(needed==0) { + //yes, be happy + out.write("The core axis libraries are present. "); + } else { + //no, be very unhappy + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + out.write("" + +needed + +" core axis librar" + +(needed==1?"y is":"ies are") + +" missing"); + } + //now look at wanted stuff + if(wanted>0) { + out.write("" + +wanted + +" optional axis librar" + +(wanted==1?"y is":"ies are") + +" missing"); + } else { + out.write("The optional components are present."); + } + out.write("

    "); + //hint if anything is missing + if(needed>0 || wanted>0 ) { + out.write(getInstallHints(request)); + } + + %> +

    + Note: Even if everything this page probes for is present, there is no guarantee your + web service will work, because there are many configuration options that we do + not check for. These tests are necessary but not sufficient +


    + +

    Examining Application Server

    + <% + String servletVersion=getServletVersion(); + String xmlParser=getParserName(); + String xmlParserLocation = getParserLocation(out); + + %> + + + + +
    Servlet version<%= servletVersion %>
    XML Parser<%= xmlParser %>
    XML ParserLocation<%= xmlParserLocation %>
    +<% if(xmlParser.indexOf("crimson")>=0) { %> +

    + We recommend Xerces 2 + over Crimson as the XML parser for Axis +

    +<% } %> + +

    Examining System Properties

    +<% + /** + * Dump the system properties + */ + java.util.Enumeration e=null; + try { + e= System.getProperties().propertyNames(); + } catch (SecurityException se) { + } + if(e!=null) { + out.write("
    ");
    +        for (;e.hasMoreElements();) {
    +            String key = (String) e.nextElement();
    +            out.write(key + "=" + System.getProperty(key)+"\n");
    +        }
    +        out.write("

    "); + } else { + out.write("System properties are not accessible

    "); + } +%> +


    + Platform: <%= getServletConfig().getServletContext().getServerInfo() %> + + + + diff --git a/src/web/images/.cvsignore b/src/web/images/.cvsignore new file mode 100644 index 0000000..085e8ba --- /dev/null +++ b/src/web/images/.cvsignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/src/web/images/CVS/Entries b/src/web/images/CVS/Entries new file mode 100644 index 0000000..729c51e --- /dev/null +++ b/src/web/images/CVS/Entries @@ -0,0 +1,2 @@ +/.cvsignore/1.1/Thu Jan 29 14:22:44 2004// +/header.jpg/1.1/Mon Jul 7 16:20:59 2003/-kb/ diff --git a/src/web/images/CVS/Repository b/src/web/images/CVS/Repository new file mode 100644 index 0000000..1a11a84 --- /dev/null +++ b/src/web/images/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web/images diff --git a/src/web/images/CVS/Root b/src/web/images/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/images/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/images/header.jpg b/src/web/images/header.jpg new file mode 100644 index 0000000..c3795a2 Binary files /dev/null and b/src/web/images/header.jpg differ diff --git a/src/web/index.html b/src/web/index.html new file mode 100644 index 0000000..0c0a9ba --- /dev/null +++ b/src/web/index.html @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/web/read-me.txt b/src/web/read-me.txt new file mode 100644 index 0000000..01be4d9 --- /dev/null +++ b/src/web/read-me.txt @@ -0,0 +1,2 @@ +Directory: src/web +Contents: --todo-- \ No newline at end of file diff --git a/src/web/style/CVS/Entries b/src/web/style/CVS/Entries new file mode 100644 index 0000000..ddbf5b4 --- /dev/null +++ b/src/web/style/CVS/Entries @@ -0,0 +1 @@ +/default.css/1.1/Mon Jul 7 16:21:14 2003// diff --git a/src/web/style/CVS/Repository b/src/web/style/CVS/Repository new file mode 100644 index 0000000..160c204 --- /dev/null +++ b/src/web/style/CVS/Repository @@ -0,0 +1 @@ +tcms/src/web/style diff --git a/src/web/style/CVS/Root b/src/web/style/CVS/Root new file mode 100644 index 0000000..4f0fed3 --- /dev/null +++ b/src/web/style/CVS/Root @@ -0,0 +1 @@ +:pserver:cjudd@integrallis.dyndns.org:/usr/local/cvsrepository diff --git a/src/web/style/default.css b/src/web/style/default.css new file mode 100644 index 0000000..8e7dad0 --- /dev/null +++ b/src/web/style/default.css @@ -0,0 +1,56 @@ +body { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + background : white; + color: #336699; + scrollbar-3dlight-color : #999999; + scrollbar-arrow-color : #999999; + scrollbar-base-color : #666666; + scrollbar-darkshadow-color : Black; + scrollbar-face-color : #666666; + scrollbar-highlight-color : #999999; + scrollbar-shadow-color : #999999; + scrollbar-track-color : #8B8B8B; +} + +td, th { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #333333; +} + +a { + color: #3366CC; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +.menu { + color: silver; + background-color : #696969; + text-decoration : none; + padding: 5px; + vertical-align: top; +} + +.menuItem { + color: silver; + font-weight : bolder; + text-decoration : none; +} + +.copyright { + font-family : Arial, Helvetica, sans-serif; + font-size : 9px; + text-align: center; + font-weight: normal; + color: #000000; +} + +.content { + text-align: left; + vertical-align: top; +} diff --git a/src/ws-client/com/ejdoab/tcms/NewsClient.java b/src/ws-client/com/ejdoab/tcms/NewsClient.java new file mode 100644 index 0000000..6686e2d --- /dev/null +++ b/src/ws-client/com/ejdoab/tcms/NewsClient.java @@ -0,0 +1,26 @@ +package com.ejdoab.tcms; + +import localhost.tcms.services.News.*; + +import com.ejdoab.tcms.services.*; + +/** + * Simple News Web Services Client + * @author cjudd + */ +public class NewsClient { + + public static void main(String[] args) throws Exception { + NewsServiceLocator locator = new NewsServiceLocator(); + News news = locator.getNews(); + NewsItemDTO[] items = news.getNews(); + + System.out.println("Conference News"); + + for(int i = 0; i < items.length; i++) { + System.out.println("*** " + items[i].getTitle() + " ***"); + System.out.println(items[i].getBody()); + } + } + +} diff --git a/src/ws-client/com/ejdoab/tcms/services/NewsItemDTO.java b/src/ws-client/com/ejdoab/tcms/services/NewsItemDTO.java new file mode 100644 index 0000000..392e090 --- /dev/null +++ b/src/ws-client/com/ejdoab/tcms/services/NewsItemDTO.java @@ -0,0 +1,253 @@ +/** + * NewsItemDTO.java + * + * This file was auto-generated from WSDL + * by the Apache Axis WSDL2Java emitter. + */ + +package com.ejdoab.tcms.services; + +public class NewsItemDTO implements java.io.Serializable { + private java.lang.String body; + private java.util.Calendar creationDate; + private java.util.Calendar creationdate; + private java.util.Calendar date; + private int newsItemId; + private boolean published; + private java.util.Calendar removeDate; + private java.util.Calendar removedate; + private java.lang.String title; + + public NewsItemDTO() { + } + + public java.lang.String getBody() { + return body; + } + + public void setBody(java.lang.String body) { + this.body = body; + } + + public java.util.Calendar getCreationDate() { + return creationDate; + } + + public void setCreationDate(java.util.Calendar creationDate) { + this.creationDate = creationDate; + } + + public java.util.Calendar getCreationdate() { + return creationdate; + } + + public void setCreationdate(java.util.Calendar creationdate) { + this.creationdate = creationdate; + } + + public java.util.Calendar getDate() { + return date; + } + + public void setDate(java.util.Calendar date) { + this.date = date; + } + + public int getNewsItemId() { + return newsItemId; + } + + public void setNewsItemId(int newsItemId) { + this.newsItemId = newsItemId; + } + + public boolean isPublished() { + return published; + } + + public void setPublished(boolean published) { + this.published = published; + } + + public java.util.Calendar getRemoveDate() { + return removeDate; + } + + public void setRemoveDate(java.util.Calendar removeDate) { + this.removeDate = removeDate; + } + + public java.util.Calendar getRemovedate() { + return removedate; + } + + public void setRemovedate(java.util.Calendar removedate) { + this.removedate = removedate; + } + + public java.lang.String getTitle() { + return title; + } + + public void setTitle(java.lang.String title) { + this.title = title; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof NewsItemDTO)) return false; + NewsItemDTO other = (NewsItemDTO) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.body==null && other.getBody()==null) || + (this.body!=null && + this.body.equals(other.getBody()))) && + ((this.creationDate==null && other.getCreationDate()==null) || + (this.creationDate!=null && + this.creationDate.equals(other.getCreationDate()))) && + ((this.creationdate==null && other.getCreationdate()==null) || + (this.creationdate!=null && + this.creationdate.equals(other.getCreationdate()))) && + ((this.date==null && other.getDate()==null) || + (this.date!=null && + this.date.equals(other.getDate()))) && + this.newsItemId == other.getNewsItemId() && + this.published == other.isPublished() && + ((this.removeDate==null && other.getRemoveDate()==null) || + (this.removeDate!=null && + this.removeDate.equals(other.getRemoveDate()))) && + ((this.removedate==null && other.getRemovedate()==null) || + (this.removedate!=null && + this.removedate.equals(other.getRemovedate()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getBody() != null) { + _hashCode += getBody().hashCode(); + } + if (getCreationDate() != null) { + _hashCode += getCreationDate().hashCode(); + } + if (getCreationdate() != null) { + _hashCode += getCreationdate().hashCode(); + } + if (getDate() != null) { + _hashCode += getDate().hashCode(); + } + _hashCode += getNewsItemId(); + _hashCode += new Boolean(isPublished()).hashCode(); + if (getRemoveDate() != null) { + _hashCode += getRemoveDate().hashCode(); + } + if (getRemovedate() != null) { + _hashCode += getRemovedate().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(NewsItemDTO.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("services.tcms.ejdoab.com", "NewsItemDTO")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("body"); + elemField.setXmlName(new javax.xml.namespace.QName("", "body")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("creationDate"); + elemField.setXmlName(new javax.xml.namespace.QName("", "creationDate")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("creationdate"); + elemField.setXmlName(new javax.xml.namespace.QName("", "creationdate")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("date"); + elemField.setXmlName(new javax.xml.namespace.QName("", "date")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("newsItemId"); + elemField.setXmlName(new javax.xml.namespace.QName("", "newsItemId")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("published"); + elemField.setXmlName(new javax.xml.namespace.QName("", "published")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeDate"); + elemField.setXmlName(new javax.xml.namespace.QName("", "removeDate")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removedate"); + elemField.setXmlName(new javax.xml.namespace.QName("", "removedate")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/src/ws-client/localhost/tcms/services/News/News.java b/src/ws-client/localhost/tcms/services/News/News.java new file mode 100644 index 0000000..ca2e2fa --- /dev/null +++ b/src/ws-client/localhost/tcms/services/News/News.java @@ -0,0 +1,12 @@ +/** + * News.java + * + * This file was auto-generated from WSDL + * by the Apache Axis WSDL2Java emitter. + */ + +package localhost.tcms.services.News; + +public interface News extends java.rmi.Remote { + public com.ejdoab.tcms.services.NewsItemDTO[] getNews() throws java.rmi.RemoteException; +} diff --git a/src/ws-client/localhost/tcms/services/News/NewsService.java b/src/ws-client/localhost/tcms/services/News/NewsService.java new file mode 100644 index 0000000..eae7838 --- /dev/null +++ b/src/ws-client/localhost/tcms/services/News/NewsService.java @@ -0,0 +1,16 @@ +/** + * NewsService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis WSDL2Java emitter. + */ + +package localhost.tcms.services.News; + +public interface NewsService extends javax.xml.rpc.Service { + public java.lang.String getNewsAddress(); + + public localhost.tcms.services.News.News getNews() throws javax.xml.rpc.ServiceException; + + public localhost.tcms.services.News.News getNews(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/src/ws-client/localhost/tcms/services/News/NewsServiceLocator.java b/src/ws-client/localhost/tcms/services/News/NewsServiceLocator.java new file mode 100644 index 0000000..c275e55 --- /dev/null +++ b/src/ws-client/localhost/tcms/services/News/NewsServiceLocator.java @@ -0,0 +1,105 @@ +/** + * NewsServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis WSDL2Java emitter. + */ + +package localhost.tcms.services.News; + +public class NewsServiceLocator extends org.apache.axis.client.Service implements localhost.tcms.services.News.NewsService { + + // Use to get a proxy class for News + private final java.lang.String News_address = "http://localhost:8080/tcms/services/News"; + + public java.lang.String getNewsAddress() { + return News_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String NewsWSDDServiceName = "News"; + + public java.lang.String getNewsWSDDServiceName() { + return NewsWSDDServiceName; + } + + public void setNewsWSDDServiceName(java.lang.String name) { + NewsWSDDServiceName = name; + } + + public localhost.tcms.services.News.News getNews() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(News_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getNews(endpoint); + } + + public localhost.tcms.services.News.News getNews(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + localhost.tcms.services.News.NewsSoapBindingStub _stub = new localhost.tcms.services.News.NewsSoapBindingStub(portAddress, this); + _stub.setPortName(getNewsWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (localhost.tcms.services.News.News.class.isAssignableFrom(serviceEndpointInterface)) { + localhost.tcms.services.News.NewsSoapBindingStub _stub = new localhost.tcms.services.News.NewsSoapBindingStub(new java.net.URL(News_address), this); + _stub.setPortName(getNewsWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + String inputPortName = portName.getLocalPart(); + if ("News".equals(inputPortName)) { + return getNews(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://localhost:8080/tcms/services/News", "NewsService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("News")); + } + return ports.iterator(); + } + +} diff --git a/src/ws-client/localhost/tcms/services/News/NewsSoapBindingStub.java b/src/ws-client/localhost/tcms/services/News/NewsSoapBindingStub.java new file mode 100644 index 0000000..6a79e1b --- /dev/null +++ b/src/ws-client/localhost/tcms/services/News/NewsSoapBindingStub.java @@ -0,0 +1,157 @@ +/** + * NewsSoapBindingStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis WSDL2Java emitter. + */ + +package localhost.tcms.services.News; + +public class NewsSoapBindingStub extends org.apache.axis.client.Stub implements localhost.tcms.services.News.News { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[1]; + org.apache.axis.description.OperationDesc oper; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getNews"); + oper.setReturnType(new javax.xml.namespace.QName("http://localhost:8080/tcms/services/News", "ArrayOf_tns1_NewsItemDTO")); + oper.setReturnClass(com.ejdoab.tcms.services.NewsItemDTO[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "getNewsReturn")); + oper.setStyle(org.apache.axis.enum.Style.RPC); + oper.setUse(org.apache.axis.enum.Use.ENCODED); + _operations[0] = oper; + + } + + public NewsSoapBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public NewsSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public NewsSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + java.lang.Class cls; + javax.xml.namespace.QName qName; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + qName = new javax.xml.namespace.QName("services.tcms.ejdoab.com", "NewsItemDTO"); + cachedSerQNames.add(qName); + cls = com.ejdoab.tcms.services.NewsItemDTO.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://localhost:8080/tcms/services/News", "ArrayOf_tns1_NewsItemDTO"); + cachedSerQNames.add(qName); + cls = com.ejdoab.tcms.services.NewsItemDTO[].class; + cachedSerClasses.add(cls); + cachedSerFactories.add(arraysf); + cachedDeserFactories.add(arraydf); + + } + + private org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = + (org.apache.axis.client.Call) super.service.createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + return _call; + } + catch (java.lang.Throwable t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", t); + } + } + + public com.ejdoab.tcms.services.NewsItemDTO[] getNews() throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://ws.tcms.ejdoab.com", "getNews")); + + setRequestHeaders(_call); + setAttachments(_call); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (com.ejdoab.tcms.services.NewsItemDTO[]) _resp; + } catch (java.lang.Exception _exception) { + return (com.ejdoab.tcms.services.NewsItemDTO[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.ejdoab.tcms.services.NewsItemDTO[].class); + } + } + } + +} diff --git a/undeploy.wsdd b/undeploy.wsdd new file mode 100644 index 0000000..1328eb1 --- /dev/null +++ b/undeploy.wsdd @@ -0,0 +1,3 @@ + + +