Thursday, April 15, 2010

Elevator Pitch 1

Hi everyone.Me, Abhishek Das and my partner Mr.Neeraj Tamrakar are currently studying at Charles Sturt Univesity and are the contributors for this blog.This blog has be created for the purpose of posting our assignments and other materials regarding the subject E-System Infrastructure Development (ITC594).

Here the main objective of the course is to give us valuable knowledge about
many new technologies that have developed over the years to produce the modern business to business and e-commerce applications.It also gives the knowledge about How web applications are being used for online business?

As far as talking about the assignment we have covered topics like E-commerce, distributed applications and the Internet, Client, servers and distributed paradigms, Database servers, Web application servers, XML -eXtensible Markup Language.All the exercises related to these topics were very interesting.Theses were very useful and they gave an in-depth knowledge about technical aspects of e-commerce.

We were very new to Ruby programming language.Development of Sinatra application, making use of the git and Heroku was really very exciting and add valuable knowledge.
Lastly we have tired to share all our findings and results in this blog.We are confident that these materials will be very helpful to anyone trying to learn or have interest in e-commerce and online business using web applications.

Thank you.


Thursday, April 8, 2010

Exercise : 8 XML Introduction

Create an XML document for an online catalogue of cars where each car has the child elements of make, model, year, colour, engine, number_of_doors, transmission_type and accessories. The engine has child elements called number_of_cylinders and fuel_system.

The XML document is built as below:

<?xml version="1.0" encoding='ISO-8859-1'?>

<catalogue >
<make></make >
<model ></model >
<year ></year >
<colour ></colour>
<engine >
<number_of_cylinders ></number_of_cylinders >
<fuel_system > </fuel_system >
</engine >
<number_of_doors ></number_of_doors >
<transmission_type > </transmission_type >
<accessories ></accessories >
</catalogue >

Wednesday, April 7, 2010

Exercise : 7 Application server platforms in e-commerce

1. Why is the perception getting stronger that integration will become a critical factor in coming days?

E-commerce systems are online systems which is used to transfer goods, services and transfer money in a secure environment. There are many such online systems like ebay, Amazon which gives us the service of buying and selling any products in a convinient way. Due to this facility it has become in universally and is in high demand.

Therefore in this scenario where there are heaps of such systems, integration becomes a vital factor for its success. The factors which could make integration of the systems a critical factors in coming generation can be:
a. Reduction of costs.
b. Integrity of transactions
c. Security of transactions
d. Accurate decision due to availability of information.
e. Management has greater control.

Reference :

Huuhtanen, J 2004. Critical Success Factors in Integration of E-Commerce and Financial Information Systems. Retrieved on April 10, 2010 from http://www.pafis.shh.fi/graduates/juhhuu01.pdf.

Ecommerce System : Tailored to Australia Business environment. Retrieved on April 10, 2010 from http://www.webdynamic.com.au/ecommerce-system.html.


2. What is the relationship of AJAX to JQuery (jquery.com) and the lightweight Web 2.0 javascript framework called MooTools (mootools.net) within the enterprise software architecture?

AJAX(Asynchronous JavaScript and XML) is a pure javascript application framework which works on client-side to create an interactive web application. AJAX has made possible exchanging of data with server without the neccessity of reloading the current pagem making the webpage dynamic and interactive.

"JQuery is collection of Javascript Library that simplifies traversing HTM document, event handling, animating and Ajax interaction for Rapid Web Development by making it easier and faster. (jQuery.com)''. It was developed to change the way javascript was written. jQuery library is usually a single JavaScript file, containing all its common DOM, event, effects, and Ajax functions. Therefore it makes calling ajax functions possible just by calling $.ajax and associated methods.

"MooTools a modular object-oriented JavaScript Web application framework designed to create powerful, flexible and cross browser code with its cohrents and well documented API (mootools.net)". This framework built in manipulation of CSS, DOM elements, native JavaScript objects, Ajax requests, DOM effects and more. MooTools makes use of Ajax easier by providing classes with methods such as onRequest, onSuccess, onComplete etc.

Hence both frameworks make use of Ajax a lot easier and simpler to use.

Reference :

Ajax. The colabarative Application Platform. Retreived on April 10, 2010 from http://ajax.org


jQuery. jQuery: The Write Less, Do More, JavaScript Library. Retreived on April 11, 2010

from http://jquery.com/


jQuery. Wikipedia. 2010.Wikimedia Foundation, Inc. Retreived on April 11, 2010 from

http://en.wikipedia.org/wiki/Jquery


MooTools. MooTools a compact javascript framework. Retrieved on April 11, 2010 from

http://mootools.org


MooTools. Wikipedia. 2010. Wikimedia Foundation, Inc. Retrieved on April 11, 2010 from

http://en.wikipedia.org/wiki/MooTools



3. What are the similarities between the object-oriented development using model-view-controller (MVC) in Ruby on Rails 2.0 and Action Script 2.0 (Flash animations)?

Ruby is an object oriented scripting language that combines syntax inspired by Perl, SmallTalk,Eiffel and Lisp. And Action Script 2.0 is a scripting based language used for developing web application and software in Adobe Flash Player platform.


The similarities between these language are both have open classes. i.e. it lets you add methods or property to an existing class. So you can add method or property to that class outside the class definition whenever you want which is also often called as monkey-patching. This functionality can be a major drawback if it is performed carelessly.


Reference :

ActionScript. Wikipedia. 2010.Wikimedia Foundation, Inc. Retreived on April 11, 2010 from http://en.wikipedia.org/wiki/ActionScript


AS2 OOP: Class Structure, 2009. Retrieved on April 11, 2010 from http://www.kirupa.com/developer/oop2/AS2OOPClassStructure7.htm

Ruby (programming language). Wikipedia. 2010. Wikimedia Foundation, Inc. Retrieved on April 11, 2010 from http://en.wikipedia.org/wiki/Ruby_(programming_language)


4. What does it mean to develop RESTful practices into our web applications?

Representational State Transfer (REST) is not a new technology or framework but it simply is a architectural style which specifies certain set of architecture constraints.The main idea of this style is to use a uniform interface for all services, which means that each Web site provides the same service. REST has been applied for describing desired Web Architecture, to identify existing problems and to compare alternative solutions. The Goals of RESTful practice includes:
a. Scalability of the component interaction.
b. Generality of interfaces.
c. Independent deployment of components.
d. Intermediary component to reduce latency, enforce securit and encapsulate legacy systems.

Reference :

Wilde, E. 2004. Representational State Transfer, Retrieved on April 11, 2010 from http://dret.net/lectures/web-spring09/rest

Representational State Transfer. Wikipedia. 2010.Wikimedia Foundation, Inc. Retreived on April 11, 2010
from http://en.wikipedia.org/wiki/Representational_State_Transfer

Nene, D. 2009. Representational State Transfer Explained. Retrieved on April 12, 2010 from http://www.slideshare.net/dnene/rest-representational-state-transfer-explained

Tuesday, April 6, 2010

Exercise: 6 Web form design and processing: A basis for e commerce interaction

1. Design the form
'Retrofit' the form data string above: name=Evan+Burke&card=Visa&number=8443261344895544&order=French+perfume
for buying some French perfume into the HTML form fields and submit button on the Web page form.

The design of the form is implemented as


which displays the results as

2. Write the script
Script archives exist for PERL, Python and JavaScript. Search the Web for a script that processes the HTML forms data. Read the code and list the steps involved in processing the form.


The steps involved in processing the HTML form from javascript are :
Steps
1. Create an HTML form with all the elements we need.
2. Put the elements with appropriate name, which will be used for form processing.
3. Add an "onClick" function to the button or "onSubmit" function to form element to call the javascript function that processes the form.
4. Create an javascript function that process the form and submits it to target page.



3.
Can you modify the script to process the form?

Yes, we can modify the script as per the user requirement. We can change the script to validate the form fields before submitting the form. This can be done to make the data more accurate and error free.


4.
Improve the user experience by add a Javascript feature.

The user experience is enhanced by adding form validation for numbers with help of javascript function. The code is show as below:



After validating, with help of the javascript again we can separate the parameters in the header of the page passed from the form and display in it orderly manner. The code of the target page is like:



and the result is displayed in the page in form of table as below:



Reference :

Anderson, J. 2002. Javascript isNumeric Function. Retrieved on April 12, 2010 from http://www.codetoad.com/javascript/isnumeric.asp

Monday, April 5, 2010

Exercise : 5 Database case study

For this exercise, we have chosen CASE B "PHP AND MYSQL". We have installed Xampp version 1.7.0 which contains distribution of Apache version 2.2.11, PHP v 5.2.8 and MySQL v5.1.30. Although the package contains phpMyAdmin v3.1.1, but for more comfort we are using SQLyog v5.22 as MySQL GUI.

1.

<HTML>
<HEAD>
<TITLE>
This is a test for server
</TITLE>
</HEAD>
<BODY>
<?php
echo "the remote address of the server is ", $_SERVER['REMOTE_ADDR'];
echo "<BR>";
echo "the name of the server is ", $_SERVER['SERVER_NAME'];
echo "<BR>";
echo "the location of the page is ", $_SERVER['PHP_SELF'];
?>
</BODY>
</HTML>


In this question, we have implemented $_SERVER['REMOTE_ADDR'], $_SERVER['SERVER_NAME'] and $_SERVER['PHP_SELF'] in localhost server and the results is shown in the screenshot below:


2.

<HTML>
<HEAD>
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<?php
$myvar = "Hello World!";
echo $myvar;
?>
</BODY>
</HTML>

This code simply stores "Hello World" string in "myvar" variable and prints the variable. The screenshot is shown below.


3.

<HTML>
<HEAD>
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<FORM METHOD="GET" ACTION="submit.php">
What's your name? <INPUT NAME="myname" SIZE=10>
(Then press ENTER)
</BODY>
</HTML>

This code creates a simple form which submit the text entered in the text to the submit.php page. The screenshot is given below.


4.

<HTML>
<HEAD>
<TITLE>
DISPLAY
</TITLE>
</HEAD>
<BODY>
<?php
echo "Hello, ", $_GET['myname'];
?>
</BODY>
</HTML>

This code saved under the file submit.php displays the text entered in the previous form which was passed through parameter in the header under the variable 'myname'. Here, we have to use $_GET['myname'] to extract the text posted from the form. Hence the screenshot is below


5.

To continue with inserting values in table, first we have create database which is assisted by the code "create database mydatabase" written in MySQL GUI. It is show in screenshot below:


Then after, we have to create table named "employees" with 4 fields. Screenshot below


Now,
a.

<HTML>
<HEAD>
<TITLE>
DISPLAY
</TITLE>
</HEAD>
<BODY>
<?php
$db = mysql_connect('localhost', 'root', '');
mysql_select_db('mydatabase',$db);
$result = mysql_query('SELECT * FROM employees',$db);
echo "First Name: ", mysql_result($result,0,'first'), "<BR>";
echo "Last Name: ", mysql_result($result,0,"last"), "<BR>";
echo "Address: ", mysql_result($result,0,"address"), "<BR>";
echo "Position: ", mysql_result($result,0,"position"), "<BR>";
?>
</BODY>
</HTML>

This code first connects mysql in localhost with "username=root" and "password=null" and then select the database named "mydatabase" which we created earlier and then displays the results of the first column in the table "employees". Here in this example i have inserted a sample data value which will be displayed as a result shown in the following screenshot.

b.

<HTML>
<HEAD>
<TITLE>
Add Record
</TITLE>
</HEAD>
<BODY>
<FORM METHOD="POST" ACTION="add_record.php">
First name:<INPUT TYPE="Text" NAME="first"><br>
Last name:<INPUT TYPE="Text" NAME="last"><br>
Address:<INPUT TYPE="Text" NAME="address"><br>
Position:<INPUT TYPE="Text" NAME="position"><br>
<INPUT TYPE="Submit" NAME="submit" VALUE="Enter information">
</BODY>
</HTML&gt;

This "add_record.html" page creates a form which submits values inserted in the textbox to the "add_record.php" page.

c.

<HTML>
<HEAD>
<TITLE>
Insert Record
</TITLE>
</HEAD>
<BODY>
<?php
$db = mysql_connect('localhost', 'root', '');
mysql_select_db('mydatabase',$db);
$result = mysql_query("INSERT INTO employees (first,last,address,position)
VALUES ('$_POST[first]','$_POST[last]','$_POST[address]','$_POST[position]')");
if ($result == 1) {
echo "Thank you! Your information has been entered."
} else {
echo "Sorry, theres a problem";
}
?>
</BODY>
</HTML>

This "add_record.php" page first connects to the database as described previously in step 5.a and then inserts the value into the table named "employees" with all the data posted from the form show in step 5.b. The message "Thank you ! Your information has been entered."
will be displayed if the data are successfully posted which is shown in the screenshot.


d.

<HTML>
<HEAD>
<TITLE>
Insert Record
</TITLE>
</HEAD>
<BODY>
<?php
$db = mysql_connect('localhost', 'root', '');
mysql_select_db('mydatabase',$db);
$result = mysql_query("SELECT * FROM employees",$db); echo "<table border=1>\n";
echo "<tr><td><b>Name</b></td><td><b>Position</b></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
echo "<tr><td>", $myrow[2], ", ", $myrow[1], "</td><td>",
$myrow[4], "</td></tr>";
}
echo "</table><BR>";
?>
</BODY>
</HTML>

This "show_results.php" page shows the total results present in the table by applying "while" condition until the end of the total column in the table. The code creates a table for displaying the results. Screenshot below: