Due Wedneday, Sept. 28, in class, on paper
1. XML. Read the tutorial linked from the class web page. Find the error in $cs636/campus.xml and describe it. Hint: try to display it in a browser. Fix the error and show a snippet of XML around your fix in your homework paper.
2. Command line development, environment variables, UNIX case. Do this before problem 5. This problem uses ant as a "black box."
a. Set up your UNIX/Linux account at cs.umb.edu as specified in DatabaseSetup, which also covers setting up environment variable definitions (both at cs.umb.edu and on your home machine) for ORACLE_USER, ORACLE_PW, ORACLE_SITE, MYSQL_USER, MYSQL_PW, and MYSQL_SITE, and also cs636 for /courses/cs636/public_html, the directory for our class home page.
b. Give the UNIX/Linux command to recursively copy $cs636/pizza1 to your own pizza1 under your cs636 directory, when you are cd'd to your cs636 directory. Use $cs636 in the command. Do the copy.
c. Download pizza1.zip to your home machine and unzip it there to a convenient directory. Show the whole directory structure of pizza1 after “ant clean” and then after "ant build" while cd'd to your copy of pizza1, both on cs.umb and at home. I'd use du for this on UNIX/Linux, tree on PC.
d. Cd to the pizza1/database directory (on either platform) and use “ant load-oradb” to load the Oracle tables, and “ant show-oradb” to display them. Note that you do not need to be logged into topcat to do this. You can do it anywhere connected to cs.umb.edu by the Internet, with a running tunnel if off-campus. Similarly load and show mysql, after looking at build.xml just to see the target names (grep target build.xml on UNIX, find “target” build.xml on Windows). Report success or any problems.
e. After loading the database, try "ant oraSysTest" to see it run the pizza1 system test using the ORACLE_ environment variables you set up. Also try "ant mysqlSysTest". Report success or any problems.
f. Start up HSQLDB by using "ant start-hsqldb" in the database directory. Load up its database and run its sys test. Bring it down again.
3. Review or learn about Java packages. There is a
Java tutorial on packages. Your directory listing of the pizza
project in problem 2 showed many subdirectories of src and bin. These
are all related to the Java packages in use.
a. Find and quote the package directive in PizzaOrderDAO.java that places its code in its package. What is its directory under src? Under bin?
b. For StudentService.java, what is the package for this code? What methods of PizzaOrderDao are called from here? Find and quote the import statement that allows this StudentService code to access PizzaOrderDAO methods without long names.
c. Try removing the import statement you found in b. and trying to compile the project (ant build). Report the resulting error.
d. What longer name could be used by StudentService to access the PizzaOrderDAO type without the import? Show the line of code that changes.
4. Start learning ant. Read the tutorial linked from the class
a. Find and read the details on the ant delete task at the site where the tutorial resides. What does the line <delete dir="build"/> do when executed on UNIX/Linux? "rmdir build"? "rm -r build"? and from what directory?
b. Modify the second example in the tutorial for "oata.HelloWorld" to be for the same java file (except for the package declaration) but now made to be in package "com.oata", following the usual convention that the package name is the site name in reverse order. (Only one tiny change is needed, showing the ease of refactoring this way with ant.) What do you need to do with the source file other than change the package name (i.e. what change in its filesystem location)?
c. Read about the sql task used in database/build.xml and compose a target that executes “select * from pizza_orders” where this select statement is in the target, not in a separate file.