Wednesday, August 29, 2007

Use Case

Background Introduction
Second hand textbook has potential market in every university. Although there are many big C2C online selling companies out there, like eBay, some students still prefer to buy locally, which saves the delivery expense and is easier to make a payment.

Description
A local bookstore can deploy a used book sell online website, which utilizes information communication technology and has the convenience provided by local trading. Buyer can check detail of each book on the website before he/she go to the store, and seller can leave a book in the bookstore with predefined price. Each transaction is through the bookstore. Buyer and seller do not have to make an appointment to meet any more.

Scope
This component is a part of an entire online selling system. It builds the entry and update function for bookstore staff, browsing function for buyer to find a correct book.
Online placing sell, order and updating function from buyer or seller are out of the boundary. Also, there is no search function for browser to search a particular book for sell.

Actors & Goals
Bookstore (Direct Actor): Keeps buyer and seller’s membership. Propagate itself, or generate some profit from transaction.
Buyer (Direct Actor): Easy to find a book and get the up-to-date information. Does transaction with less time constrain.
Seller: Get a platform with intense demand. No time constrain as no appointment.

Use Case
1. A seller hand a textbook to the bookstore located near university, and give a price to the book.
2. Bookstore staff takes picture and makes description of that book, classify it to a course. Then upload this sell onto the website. (MVC and write database)
3. Buyer browses the website, follow the course classification then check all those available books under one course, record a book he/she wants to buy. (MVC with database read)
4. Buyer goes to bookstore, ask for that particular book and pay. (Delete the record in database)
5. Seller is notified to collect money from bookstore.

Extend
 In book’s description, staff uses a multiple choice to mark a book’s current condition. (unbias)
 Bookstore staff can use barcode to identify a particular book.
 Seller can leave and update a description and price directly on the store website.
 Buyer can place an order directly online.

Potential Project Components to Integrate
(This part is not in my individual work, but can be handled by other team member)
 Bookstore can notify seller by email or SMS after book sold.
 A search engine should be built
 A auction function can be used.
 Integrate with library book DB, student account DB and study unit portal (sakai).

Actually the best actor of the bookstore is the library, which keeps a book database, customer (student) database. This also enhances the payment and trust. And the most important thing is that, unlike most second hand bookstores work on large margin or commission fee between buying and selling price, this service can be free to students.

Sunday, August 19, 2007

A Book related to our lab work - Spring in Action

CRAIG WALLS, RYAN BREIDENBACH, 2005, Spring in Action

It discusses what we are trying to do in lab in the following chapter. I find it useful when you get confused in doing the lab work.

Chapter 8 Building the web layer - Getting started with Spring MVC
This chapter covers
■ Mapping requests to Spring controllers
■ Transparently binding form parameters
■ Validating form submissions
■ Adding functionality with interceptors

Saturday, August 18, 2007

GCC

To setup the C environment in Ubuntu, so that you can compile C file
sudo apt-get install build-essential

Wednesday, August 15, 2007

Junit test failed in terminal

Use my Eclipse to run junit:
No problem:

Buildfile: /home/ji/projects/springapp/build.xml

build:
[javac] Compiling 1 source file to /home/ji/projects/springapp/war/WEB-INF/classes
clearData:
[echo] CLEAR DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully
loadData:
[echo] LOAD DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
[sql] Executing commands
[sql] 5 of 5 SQL statements executed successfully
junit:
[junit] Running tests.TestProductManager
[junit] Testsuite: tests.TestProductManager
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.035 sec
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.035 sec
[junit] Running tests.TestProductManagerDaoJdbc
[junit] Testsuite: tests.TestProductManagerDaoJdbc
[junit] 2007-08-15 00:55:31,921 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] -
[junit] 2007-08-15 00:55:31,922 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,387 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,403 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,403 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,406 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] -
[junit] 2007-08-15 00:55:32,407 INFO [db.ProductManagerDaoJdbc] -
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.771 sec
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.771 sec
[junit] ------------- Standard Output ---------------
[junit] 2007-08-15 00:55:31,921 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] -
[junit] 2007-08-15 00:55:31,922 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,387 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,403 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,403 INFO [db.ProductManagerDaoJdbc] -
[junit] 2007-08-15 00:55:32,406 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource] -
[junit] 2007-08-15 00:55:32,407 INFO [db.ProductManagerDaoJdbc] -
[junit] ------------- ---------------- ---------------
[junit] Running tests.TestSpringappController
[junit] Testsuite: tests.TestSpringappController
[junit] 2007-08-15 00:55:32,535 INFO [org.springframework.core.CollectionFactory] -
[junit] 2007-08-15 00:55:32,577 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] -
[junit] 2007-08-15 00:55:32,691 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] -
[junit] 2007-08-15 00:55:32,709 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] - <6 hashcode="6147782]">
[junit] 2007-08-15 00:55:32,719 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] -
[junit] 2007-08-15 00:55:32,722 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] -
[junit] 2007-08-15 00:55:32,725 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] -
[junit] 2007-08-15 00:55:32,802 INFO [web.SpringappController] -
[junit] 2007-08-15 00:55:32,803 INFO [web.SpringappController] -
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.376 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.376 sec
[junit] ------------- Standard Output ---------------
[junit] 2007-08-15 00:55:32,535 INFO [org.springframework.core.CollectionFactory] -
[junit] 2007-08-15 00:55:32,577 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] -
[junit] 2007-08-15 00:55:32,691 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] -
[junit] 2007-08-15 00:55:32,709 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] - <6 hashcode="6147782]">
[junit] 2007-08-15 00:55:32,719 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] -
[junit] 2007-08-15 00:55:32,722 INFO [org.springframework.context.support.FileSystemXmlApplicationContext] -
[junit] 2007-08-15 00:55:32,725 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] -
[junit] 2007-08-15 00:55:32,802 INFO [web.SpringappController] -
[junit] 2007-08-15 00:55:32,803 INFO [web.SpringappController] -
[junit] ------------- ---------------- ---------------
BUILD SUCCESSFUL
Total time: 3 seconds




When I use the terminal command:
ant junit
Error comes out:


Buildfile: build.xml

build:
[javac] Compiling 1 source file to /home/ji/projects/springapp/war/WEB-INF/classes

clearData:
[echo] CLEAR DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully

loadData:
[echo] LOAD DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:db/test
[sql] Executing commands
[sql] 5 of 5 SQL statements executed successfully

junit:

BUILD FAILED
/home/ji/projects/springapp/build.xml:175: java.lang.NoClassDefFoundError: org/apache/tools/ant/types/ResourceCollection



I think the reasons can be they use different junit.jar files, or my Ant did not configure well. Anyway, the springapp website runs without any problem. I install
Apache Ant version 1.6.5 compiled on July 5 2006

Saturday, August 11, 2007

Stop working

http://weg.ee.usyd.edu.au/courses/ebus5003/
This afternoon, I try the course website, but it doesn't work. I can't do the lab without this~~~~!!!!!

Another problem is that I have copied Spring file from lab computer. When I extract it in my desktop at home, it comes out an error. I really need the junit.jar from Spring to continue.

Maybe Saturday is not the right day to work.

Friday, August 03, 2007

Here is a brand new chapter

I install Ubuntu 7.04 on my desktop at home to do this lab. Since I used up all the quota in accessing internet, I downloaded all the software in lab and planned to install them into my Ubuntu just like what we usually do in MS Windows that straight forward. But I am wrong.

Many software in Ubuntu is self-managed by the system. It can automatically download online and install it on a click. But if you'd got a pack on hand to install, it seems not that straight forward.
First, in Ubuntu, you can't use RPM pack used normally in Fedora or some other popular Linux systems. In installation, you just uncompress the pack you downloaded online, and put it somewhere in the system. The hard thing is to specify the environment value. Here is what I added to
~/.bashrc

export JAVA_HOME=/usr/lib/j2sdk1.5-sun
export CLASSPATH=/usr/lib/j2sdk1.5-sun/lib
export PATH=$PATH:/usr/lib/j2sdk1.5-sun/bin
export CATALINA_HOME=/opt/tomcat

There are some reminders when using the lab computer

bash
source /eelabs/ebus5003/profile

In my account, I always have to type these in my terminal to start and work. No idea!!!!

fs listquota
check your disk space

proxy:
http://www.eelab.usyd.edu.au/proxy.pac
In Firefox


build.properties and build.xml should be under the same folder




In step10, make sure to specify where you want to put the log file. In my case, it is like this:

log4j.appender.logfile.File=/opt/tomcat/logs/springapp.log

If you make it wrong, you can't find the file, and nothing indicates it was going wrong!!!!!!!!


Until now, luckily, part1 is finished. I encounter Linux, Ant and Spring. I believe they are good tools once you can set them up.