Defunct - this repo moved to https://github.com/IanDarwin/TicketManorJava after Learning Tree deleted Course 936 from the course catalog. All enhancements, fixes, will be done on that repo instead of here.
This is a demo application of building enterprise applications using Java EE. There are a variety of APIs used, e.g., Java EE (JPA, EJB), Spring Framework, modern SPA Web (Angular, Ember.JS), and so on. Each major framework has its own subdirectory.
It will be used as a showcase in various courses offered by Learning Tree, the world leader in instructor-led tecnical training. Learning Tree offers courses in Java as well as many other enterprise applications.
Legal Note: We do not intend this to be a passing-off of TicketMaster.com, which is a trademark in most countries. It is just a demonstration of how certain parts of an enterprise app could be implemented. WE ARE NOT ACTUALLY SELLING ANY TICKETS.
This site is not affiliated in any way with TicketMaster™ nor any other commercial ticket selling organization.
This project now depends on Java SE 12+ and Java EE 8+.
The Java projects generally use Eclipse to write/compile/test code and Maven to build/package. The Android project uses Android Studio (based on IntelliJ IDea) to write code and Gradle to compile/test/package.
The top-level Maven pom runs each of the other projects (including android, through a Maven plug-in that knows how to run Gradle). For some reason the top-level build doesn’t always succeed, so you might want to build just the EE project, as below.
The server projects are configured to deploy with the EE Server WildFly 14+
You MUST change the file ${WILDFLYHOME}/standalone/configuration/standalone.xml AND standalone-full.xml to have a datasource named TicketManorDataSource. For initial testing I just added:
<datasource jndi-name="java:jboss/datasources/TicketManorDataSource" pool-name="TicketManorPool" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:mem:ticketmanor;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource>
We should someday change this to a real database like PostgreSQL before deployment.
cd ticketmanor-ee mvn wildfly:deploy # Assuming you have WildFly running
N.B. Never give the production app unfettered access to the database; limit it by doing something like the following, which creates a new account in the database accounting mechanism, separate from the database account that owns the database tables, and gives it only insert and update privileges. Commands are from PostgreSQL (where 'role' means 'user') but will be similar on other DB products.
postgres=# \c ticketmanor You are now connected to database "ticketmanorjava"... ticketmanor=# create role myAppAcct login password 'someEnchantedPasswordHere45678'; CREATE ROLE ticketmanor=# revoke all on database ticketmanorjava from myAppAcct; REVOKE ticketmanor=# grant select, insert, update on all tables in schema public to myAppAcct; GRANT ticketmanor=#
The "schema public" only applies to the current database, so it’s important to connect to the correct database before issuing this command!
You might need a few other perms if JPA/Hibernate is running in "create" or "update" mode, but these modes should not really be used in production!
Note that when you want to delete a role that has been granted permissions, you must first use drop owned by myappacct cascade;.
In the Java code, classnames with:
-
Bean means either a JSF managed JavaBean or a Spring-managed JavaBean;
-
Resource means a RESTful web service endpoint;
-
Ejb (or *EJB) of course represents an Enterprise JavaBean.
Use http://www.stateofflow.com/journal/66/creating-java-projects-programmatically to create Eclipse projects for different courses.
The following is IN ADDITION to getting the basic functionality working across all the designated APIs that we need to demonstrate in the courses. It’s more a placeholder for IDEAS than an actual list of steps to do.
-
"Sync Instance" feature to update the database from a master copy on the Internet.
Maybe use j2objc to make iOS versions of at least the Model classes.