5/25/2009

Elevator Pitch 2

Elevator Pitch 2



I intend to build up an ebusiness for online fast food order and delivery service so far, after I have studied the ITC594 module, I have a further understanding on ebusiness development.

Firstly, I would define my ebusiness working on client server architecture in an internet environment.

Secondly, I would consider what kinds of software development methodology should be used in developing a web application with short development period, for fulfilling this requirements, I would like to choose RAD, because I don’t want to have other competitors releasing that kind of application are faster than me.

Thirdly, I need follow the RAD framework to build up my ebusiness with its required techniques and tools.

Fourthly, I would follow the XML scheme and W3C standard in order to make my web application more structural and standard, and also define more keywords in the html headers and tags that are easy for customer searching by search engine.

Fifthly, I would consider the internet security, so that I should implement a hardware firewall and use internet security protocol in order for having a high internet security protection.

Sixthly, I would like to choose Pay pal to be my online payment method, because Pay pal is very famous, that can give a high confidence to the customers.

And finally, after my web application has passed the test plan and has migrated from development to production environment, I would like to join my web application to some famous search engine for example, Yahoo, Google and AltaVista for increasing the website rating.

5/24/2009

Workshop 8

Evaluation and Report

1. List what you consider to be the three strengths of Ruby on Rails workshop series

I consider the 3 strengths to be:

a. We can learn ROR via workshop 1 -6 step by step, that is easy for us to understand ROR.
b. We can learn MVC from workshop 1-2 step by step, that is clearly for us to understand how to apply MVC in ROR.
c. We can learn how to use scraffolding, rake, session, post/get, cookie, etc from workshop 1-6 gradurately in order to build up a rapid application.

2. List what you consider to be the three weaknesses of Ruby on Rails workshop series:

I consider the 3 weaknessess to be:

a. Some provided tutorial link is dead link.
b. The recommented book from CSU library is always session full, we need to wait for other students logout and then we can access...
c. In workshop 5, the provided source code has a bug, we need to debug first before doing the workshop.

3. List what aspects of Ruby on Rails workshop series that you found to be most
difficult.

The most difficult aspects were:

a. Initially it is difficult to understand the MVC architecture in ROR, for example, what is the relationship between model, views and controllers in ROR?
b. Need to study how to create the table attributes by using db schema.

4. List what improvements could be made to the Ruby on Rails workshop series:

a. Verify the provides study link and source code whether is workable before anounces.
b. Teach the student how to do the transaction as well, because transaction is the core of e-business.
c. Use IDE for ROR project development.

5. Reflect on your experiences with the other Web framework used in this subject: Was it effective? How can it be improved? Should other Web frameworks be used as well or instead of Ruby on Rails?

I have a experiance on using java servlet, mysql and apache to do the booking system, it is not effective if comparing with ROR because java code is more complex than ROR. I suggest to use Netbean IDE for ROR project development, because it can help to verify the code syntex that avoid syntax error. I think other web frameworks such VB.NET that should be better than ROR.


6. Did the Developer or IT manager Team that you joined after workshop 4 have a preference towards using other tools to facilitate collaboration? Comment on the differences between these use of the sub-forum or Interact wiki tools from your experiences in this subject.

When I work as a developer, I would like to use MySQL Query Browswer to perform data query use NetBeans IDE to edit my program code and use Rubywaver to create my web application interface.

This is my first time post my findings in Interact wiki tools, I think sub-forum mainly is used for group discussion and interact wiki tools mainly is used for finding the defination. There is totally different.

7. Further comments to add?

a. Too Many exercises.

b. Talk more about transactions.








5/17/2009

Workshop 7-part 2

To Do - part 2

A. Topic reading from Safari Books OnlineHartl, M & Prochazka, A, (2008). RailsSpace: Building a Social Networking Website with Ruby on Rails, Pearson EducationThis workshop continues to use your reading of the ‘RailsSpace’ online book and use of other online sites.

I have partially read Safari Books OnlineHartl, M & Prochazka, A, (2008) at CSU library.

B. Focus QuestionAs either a developer or as an IT manager, what are the options available when deploying and maintaining the Ruby on Rails application online?

According to the given discussion note, I discuss with Joseph Cheung. The options available when deploying and maintaining the Ruby on Rails application online are...

1. Windows Platform VS Linux

We select Linux as our platform because Linux is freeware with higher stability than MS-Window

2. Skillset on ROR and Platform

There is no issue on skill set of ROR and Linux Platform because both of us have sound skills on ROR and Linux

3. Hosting Issue

We will place the server in our office as a production environment

4. Scalability

We will use the mongrel clusters for fault tolerance and Lunix RAID 5 external diskarry so volume expansion become easy.

5. Tools

We will use ROR freeware tools on the web.

From the given intruction,which way you choose to go will most likely depend upon:

  • The user interface and your own skills;
  • How quickly you are guided through deployment by admin tools that simplify management of the system;
  • System back-up, data security, virtualization and portability features
  • Future-proofness: (grid computing or a cloud computing service);
  • How much time and money is saved by an efficient deployment and maintenance schedule.

This guideline is very important and useful, but it sometimes is session full, that i need to wait for someone's logout.

Workshop 7-part 1

To Do:

Developers conclude their work with the OTBS and look at the options for deployment of the site. Examine the various platforms/software tools used for deployment such as UNIX environment suggested in the Discussion Notes, Mongrel or Mongrel cluster, Nginx, Subversion or Capistrano (during development stage), JRuby in the Java environment.

Which way?

The choice is up to you as this workshop present just one option and you may like to use another, such as deploying the OTBS in a .NET or J2EE environment

Can you get the OTBS Running in production mode as a minimal production server?

Share your success by posting progress comments and links etc to the Developers sub-forum site that has been set up for the Red team.


In my OTBS project, I install instantRails2.0 in my windows XP's PC and I feel instantRails2.0 is a good software for the student/developer to study ROR.

InstantRails2.0 has included mongrel web server, mysql server and ROR. Also, It is already preconfigures every setting for them.

In ROR development, i would like to use "rake" to generate the data table and use scaffolding to generate the view page. It is very good for Rapid application development.

Furthermore, i feel ROR is very convenient for SQL operation, because we do not need to create the SQL server connection string for query, insert, delete and update the DB.

Personally, I would like to implement my OTBS project from windows to linux platform because the performance of linux is better than windows. That's true. Also, I would like to use Mongrel cluster as well as using Mongrel, because Mongrel cluster simplifies the deployment of webapps and it conveniently configures and controls several mongrel servers, or groups of mongrel servers.

When need to get my OTBS running in production mode as a minimal production server, please following the below procedure:

1.) Backup the development database of OTBS by backup application which supports database backup for example NETVAULT.

2.) Use MYSQL query browser to gather the development table dictionary defination and save it in a text file.

3.) Using the development table dictionary defination file to create an identical table or db in production environment.

4.) Use Netvault with "copy data table" option to restore the development db to production db.

5.) Start the mongrel server in production mode by issuing the command -

mongrel_rails start -e production

5/15/2009

Workshop 6 -part 3

C. Set up a session in OTBS.
C1. Add session-check function in OTBS with following code. (See figure 1 to 4.)
If Session[:uid] is true, the system will display the corresponding page info;
If Session[:uid] is false, the system will request user to login.


Figure 1. Passenger's index.rhtml page

Figure 2. Passenger's new.rhtml page.

Figure 3. Passenger's show.rhtml page

Figure 4. Passenger's edit.rhtml page.

C2. Check the session of OTBS.

i.) If you directly access the passenger's index/new/edit page, it will requests user to login. (see video 1.)

Workshop 6 -part 2

To D0 - part2.
B. Create login page
B1. Create a controller named checkauth for handling some events, for example, logout, session timeout, logged-in redirection(see figure 1.)


Figure 1.
B2. Edit the checkauth controller with the following code (see figure 2.)
i.) pass_login method is used when the user login information has been verified.
ii.) logout method is used when the user logs out the system.
iii.) check_auth is used when the session is invaild.


Figure 2.


B3. Create a method name login in the user controller with following code. (see figure 3.)
The login method mainly is doing:
i.) Collect value of the variable named "login" and "password".
ii.)Check the user name and password whether is vaild, if it is correct, redirect to passengers' index page, if it is incorrect, prompt out an error message.


Figure 3.

B4. Create a user view named register.rhtml with following code. (see figure 4.)

Figure 4.


B5. Restart the TaxiApp project and navigate to login page. (see figure 5.)


Figure 5.

B6. Test login page

i.) Input a wrong login info. (see figure 6.)

Figure 6.


ii.) Input a correct login information. (see figure 7.)

Figure 7.

iii.) Click the link named "Register here". (see figure 8.)


Figure 8.

5/13/2009

Workshop 6-part 1

To do -Part 1

Developers may continue to build upon work with the OTBS using the topic reading to help with user registration and advanced login features from Hartl et al (2008).
  • generate a controller and an action by adding a method(s) to a controller.
  • create a view template for each action and to link to actions from views.
  • use AJAX to improve the user experience.

A. OTBS Registration.
A1. Create a model named user. (See figure 1).

Figure 1.

A2. Edit the file named 002_create_users file for auto generating table by rake migrate (see figure 2.)

Figure 2.

A3. Generate the user table (See figure 3.)

Figure 3.


A4. Create controller name user. (See figure 4.)

Figure 4.

A5. Edit the user controller (See figure 5), use AJAX methods- flash[:info] to show the registration result.
Figure 5.

A6. Add validation in user model (See figure 6.)

Figure 6.

A7. Create a view page named register.rhtml with following code. (See figure 7.)

Use AJAX method - "form_tag(:action => 'register') do" and "submit_tag" for performing the form subumition.

Figure 7.

A8. Restart the taxiapp project and use brower to navigate at http://localhost:3000/user/register (See figure 8.)

Figure 8.

A9. Test the registration page.

a.) Input a null value.


b.) Complete the registration form and click Register button.

c.) Input the created account in the login field..it returns error because that user has already created..

A10. Use MYSQL query browser to check the user named wilson whether is created.

Yes, the account named wilson and his information has already stored in the database.

A11. Add the link which is used to go back to the login page.

5/11/2009

Workshop 5-part 3

To Do - Part3


1. Create a new application called cabs in the same projects directory to demonstrate the use of an active view.

> rails cabs
> cd cabs


2. Create a controller called Vehicle in cabs\app\controllers
cabs> ruby script/generate controller Vehicle

3. Add an action to vehicle_controller.rb as the method called cabtype


4. Add a view template - cabs\app\views\vehicle\cabtype.rhtml
We will edit this view in later steps but you may like to add your own test HTML code to the view at this stage.


5. Save the view and restart the Web server and navigate to http://localhost:3000/vehicle/cabtype


6. Create a file in the public directory - \cabs\public called input.html



7. Edit the vehicle_controller.rb here is a start. The data in each form element in the Rails application can be accessed via its name and a hash called params



8. Edit the view template cabtype.rhtml


9. Start the Web server and go to the opening page of this application at http://localhost:3000/input.html



10. Submit the forms data. What do you find?
a.) Fill in all information and click submit button, like the below figure:


b.) Form data will send to "/vehical/cabtype" by post method and the result is listed as below:


c.) Fill in information but unclick the Yes box and click submit button, and the result is listed as below:

11. Report your progress or findings in your Developers Blog.


Firstly, there are several errors are prompted when we follow the procedure in workshop5. I need spend 3 hours to debug the source code, in details, please refer to my figure.

Secondly, learning from Tutorialspoint(2009), the directory under ruby's project named public which like the public directory for a web server, this directory has web files that don't change, such a s JavaScript files (public/javascripts), graphics (public/images), stylesheets (public/stylesheets), and HTML files (public). This should be set as the DOCUMENT_ROOT of my web server.

Thirdly, form data of input.html are stored in the methods named cabtype of vehicle controller , and cabtype.rhtml uses pass-by-reference to gather those data from cabtype methods.

References:
Tutorialspoint(2009). "Ruby on Rails 2.1.x - Directory Structure". Received 12th May, 2009 from URL - http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-directory-structure.htm

Workshop 5-part 2

To Do - Part2


1. Create a new application called scenery in the same projects directory to demonstrate the use of an active view.

> rails scenery
> cd scenery




2. Create a controller called Demo in scenery\app\controllers
scenery> ruby script/generate controller Demo



3. Add an action to demo_controller.rb as the method called rubycobe


4. Add a view template - scenery\app\views\demo\rubycode.rhtml
We will edit this view in later steps but you may like to add your own test HTML code to the view at this stage.



5. Save and restart the Web server and navigate to http://localhost:3000/demo/rubycode


6. Use the Time.now example to pass data from an action to a view.



7. Modify and save the rubycode action with a value for the time instance variable in the DemoController class in app\controllers\demo_controller.rb




8. Then modify and save the corresponding view template in \app\views\demo\rubycode.rhtml by adding a call by reference to the action’s instance variable:




9. Restart the Web server and navigate the browser to http://localhost:3000/demo/rubycode

Data has been passed from the action to the view as it is done with SQL requests. The instance variables of a Ruby class are available to view templates by referencing the action’s instance variables by name in the view .rhtml template.








Workshop 5-part 1

To Do - PART A

1. Create the Rails application framework in the projects folder: C:\InstantRails\...\projects\>rails animals

2. Running the application on localhost:3000 using the WeBrick ruby server (or Mongrel as alternative) and access via Web browser at http://localhost:3000/

3. Create the controller to make the application do an action. This is under the controller-action/model-view structure.

Stop the WEBrick server each time you edit Ruby classes and then re-start or refresh the views you are testing. Use the Ruby command below:

>ruby script/generate controller Mammal


4. Test the controller by starting the WEBrick server and navaigatibng the browser to http://localhost:3000/mammal Note how the controller name is appended to the end of the URL and that no action resulted because there are no controller methods.

5. Create an action by editing and saving the mammal_controller.rb class in projects\animals\app\controllers using your text editor to add the method below:


6. Start the WEBrick server and browse at http://localhost:3000/mammals/breathe where you will get a “missing template” message since it is missing a view for the breathe method.

Rails is trying to connect the breathe method action of the mammal controller to a view, by using the action’s name – breathe. This view template is created as breathe.rhtml and stored in the \projects\animals\views\mammal directory.




7. Create and save a view in that directory by using a text editor to create a view called breathe.rhtml


8. Try Ruby code and HTML in the action view by using the <%....%>wrapper around the inserted Ruby code. Here are some snippets to try from workshop 4: