Presentation is loading. Please wait.

Presentation is loading. Please wait.

ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 1 Electronic Commerce: Information Publishing Technology.

Similar presentations


Presentation on theme: "ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 1 Electronic Commerce: Information Publishing Technology."— Presentation transcript:

1 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 1 Electronic Commerce: Information Publishing Technology

2 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 2 Web Information Publishing: Advantages Platform Transparency: Platform Transparency: –The browser software, used for accessing the web, offers the same interface irrespective of whether it is running on the Windows, X-Windows or Macintosh platform. –Even the data residing on variety of server platforms is available to users through the same look-and-feel interface. Distribution Transparency: Distribution Transparency: –The web is a distributed information system. The information stored at variety of geographically dispersed server platforms is available to the web users on a single interface window. –A page displayed on a browser screen may contain text coming from a IBM server in New York, an image from Windows NT servers located in Delhi, and a background audio clip from a Linux server in Lucknow.

3 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 3 Web Information Publishing: Advantages Information Type Transparency: Information Type Transparency: –The web offers seamless integration of the multiple types of information content. The text, graphics, sound, video and various other data formats can be integrated and displayed uniformly through the browser interface. –It can integrate variety of information content stored on distant servers through the hypertext mechanism. Interactive: Interactive: –The information browsing on the web is based on selecting and clicking on links. The clicking on links retrieves and offers additional information on screen. –In addition, it also supports forms with input windows, radio buttons, options lists, checkboxes for submitting the data. The web servers can collect the input information from users through the form mechanism and add it to a database, update the database, or provide a customized information depending upon the inputs.

4 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 4 Web Information Publishing: Advantages Dynamic : Dynamic : –Browsers retrieve information stored on sites and through web servers and display it on the screen. If the information is updated at the server site, the latest version is made available. –The web publishing does not incur any cost of reproducing the copies. Any one accessing it reads the latest version. Graphical and Navigational: Graphical and Navigational: –Web based systems are capable of integrating and displaying graphics, text and other multimedia formats in color on a same page. –The web has made it possible to browse the multimedia information on the same page. Also, the hyper linking mechanism has reduced the task of navigating through the information to point and click. A user can jump from pages stored on a server to another servers just by clicking on links.

5 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 5 Web Browsers A software client that interacts with HyperText Transfer Protocol (HTTP) Server to retrieve the requested HTML documents. A software client that interacts with HyperText Transfer Protocol (HTTP) Server to retrieve the requested HTML documents. It retrieves the HTML documents and renders them on the screen by invoking appropriate inbuilt tools and helper applications. It retrieves the HTML documents and renders them on the screen by invoking appropriate inbuilt tools and helper applications. It accepts the URL of requested resource and parses it to determine the HTTP server to contact and name of document to request. It accepts the URL of requested resource and parses it to determine the HTTP server to contact and name of document to request. National Super Computer Applications Center (NCSA) developed Mosaic was the first popular Web browser National Super Computer Applications Center (NCSA) developed Mosaic was the first popular Web browser Netscape (http://www.netscape.com) is another Web browser Netscape (http://www.netscape.com) is another Web browserhttp://www.netscape.com The Microsoft’s Internet Explorer (Web Browser) is avaialble at: The Microsoft’s Internet Explorer (Web Browser) is avaialble at:

6 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 6 Hyper Text Markup Language (HTML) A Subset of Standard Generalized Markup Language (ISO 8879) A Subset of Standard Generalized Markup Language (ISO 8879) HTML is a document formatting Language HTML is a document formatting Language Formatting instruction called Tags are enclosed in symbols. e.g., and Formatting instruction called Tags are enclosed in symbols. e.g., and For a particular markup “bold” denotes the beginning of tag and denotes matching end- of-tag. For a particular markup “bold” denotes the beginning of tag and denotes matching end- of-tag. An HTML document is plain-text document consisting of regular text and information and markup tags. An HTML document is plain-text document consisting of regular text and information and markup tags. A complete HTML document has two structured parts – Head and Body. A complete HTML document has two structured parts – Head and Body. The head portion contains information regarding the document such as title, author and other meta-tags. The head portion contains information regarding the document such as title, author and other meta-tags. The body portion is displayed in the main window of the browser. The body portion is displayed in the main window of the browser.

7 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 7 Hyper Text Markup Language (HTML) define a HTML document. define a HTML document. and define the header section and define the header section and define the body section. and define the body section. The body may contain several level of heading tags, they describe the size of character display relative to each other. These are denoted by,.. The body may contain several level of heading tags, they describe the size of character display relative to each other. These are denoted by,.. The being the highest level heading and the smallest level heading. The being the highest level heading and the smallest level heading. Each tag may have several attributes. For example, tag has attribute bgcolor which defines the background color of the windows main body on the browser. Each tag may have several attributes. For example, tag has attribute bgcolor which defines the background color of the windows main body on the browser. ; the browser will display the background red color for the main window of the browser for this document. ; the browser will display the background red color for the main window of the browser for this document.

8 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 8 Hyper Text Markup Language (HTML) A Simple HTML document can be created using any text editor such as notepad. A Simple HTML document can be created using any text editor such as notepad. Typically, the html documents have.html or.htm extensions Typically, the html documents have.html or.htm extensions Exercise: create following text in file exm1.htm open the file in a browser the output is shown in the next slide. Exercise: create following text in file exm1.htm open the file in a browser the output is shown in the next slide. My First Document My First Document Heading Level 1 Heading Level 1 Heading Level 2 Heading Level 2 Heading Level 3 Heading Level 3 Using Notepad or any text editor, you can type the Document as it is. Save the file as exm1.htm. Invoke the Browser and open the file exm1.htm to see the output on your screen.

9 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 9 Hyper Text Markup Language (HTML) TitleTag Title Tag

10 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 10 Hyper Text Markup Language (HTML) We present some commonly used HTML tags. Roughly, the tags in HTML can be classified as follows : We present some commonly used HTML tags. Roughly, the tags in HTML can be classified as follows : –Text Formatting Tags –Block Structuring Tags –List Tags –Image Tag –Anchor Tag ( for Hyper Linking) –Form Tags

11 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 11 HTML: Text Formatting Tags contd. Tags that allow a person to format certain items in a manner that will be constant to all who see the document. –The text appearing between the tags is emphasized. The browser uses the default (italics) or user set mechanism for emphasizing. –The tag is used for citations of books and articles. The browser typically uses italics for display. –The tag is used for enclosing the program code listing. Browser uses fixed width font for displaying. –The tag is used for placing a strong emphasis on the enclosed text. Browsers typically use bold formatting.

12 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 12 HTML: Text Formatting Tags contd. Tags that allow Physical formatting of the test in a document: –The text characters between the tags appear in the bold. –The text characters between the tags are italicized. –The text characters between the tags are underlined. –The text characters between the tags appear in teletype format.

13 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 13 HTML: Text Formatting Tags contd. Tags that allow Physical formatting of the test in a document: –The text characters between the tags appear struck out. –The text characters between the tags appear as subscript to the preceding character. The The –text characters between the tags appear as superscript to the preceding character.

14 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 14 HTML: Text Formatting Tags -Example Exercise: create following text in file exm2.htm open the file in a browser the output is shown in the next slide. Exercise: create following text in file exm2.htm open the file in a browser the output is shown in the next slide. My First Document My First Document Examples of Formatting Tags Examples of Formatting Tags Using Notepad or any text editor, you can type the document as it is. Save the file as exm2.htm type the document as it is. Save the file as exm2.htm
Invoke the Browser and open the file myhtml.htm exm2.htm to see the output on your screen. exm2.htm to see the output on your screen.

15 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 15 HTML: Text Formatting Tags -Example

16 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 16 HTML: Block Structuring Tags The document is made up of blocks. The blocks contain a specific kind of text and may have some common associated properties. Following tags define a block. –Marks a beginning of a new paragraph. It places the text following the tag –Indicates to a browser that the text with in the tag- pair is preformatted and should be displayed as it is. –The tag-pair marks the beginning and end of a quoted text. Usually browser uses a different margin to make it stand out from the surrounding text.

17 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 17 HTML: Block Structuring Tags -Example Exercise: create following text in file exm3.htm open the file in a browser the output is shown in the next slide Exercise: create following text in file exm3.htm open the file in a browser the output is shown in the next slide Preformatted Text Preformatted Text

The following text appears in user-formatted form: The following text appears in user-formatted form:

 This is an example of preformatted text. Large States in India. 1. UP 2. MP 3. Maharashtra North Eastern States: 1. Assam 2. Mizoram 3. Arunachal Pradesh 4. Manipur 5. Nagaland 6. Meghalaya 7. Tripura 
This is an Example of Blockquote tag: This is an Example of Blockquote tag:
Uttaranchal, Jharkhand and ChhattisGarh are the three most recent states of India.

18 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 18 HTML: Block Structuring Tags -Example

19 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 19 HTML: List Tags The List elements in a document are used for organizing annotated listings. and and –Marks the beginning and end of an ordered list. and and –Marks the beginning and end of unordered list. and and –Marks beginning and end of definitions list and and –Marks beginning and end of a Menu list –Marks the beginning of each list item with in the list tags. The markup tag does not require a matching end tag as the appearance of or or as the case may be implicitly marks the end of list item description.

20 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 20 HTML: List Tags -Example Exercise: create following text in file exm4.htm open the file in a browser the output is shown in the next slide. My Document: Ordered and Unordered Lists My Document: Ordered and Unordered Lists Fruits Fruits

    Apples Apples Oranges Oranges Bananas Bananas Pears Pears
Flowers Flowers
  • Lotus
  • Rose
  • Marigold
  • Jasmine
  • Sunflower
Computer Devices Computer Devices
CPU Central Processing Unit CPU Central Processing Unit ALU Arithmetic Logic Unit ALU Arithmetic Logic Unit

21 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 21 HTML: List Tags -Example

22 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 22 HTML: Image Tag The images in the HTML document can be included using the tag. GIF, PNG and JPEG formats have inbuilt support. The images in the HTML document can be included using the tag. GIF, PNG and JPEG formats have inbuilt support. The tag like many other html tags has several attributes associated with it. These attributes in case of the tag can be used defining alignment, width, height and the name of the image source file. The tag like many other html tags has several attributes associated with it. These attributes in case of the tag can be used defining alignment, width, height and the name of the image source file. Usage is a as follows: Usage is a as follows: Name Of File--^ pixels--^ pixels-^ border-^ text-^ Name Of File--^ pixels--^ pixels-^ border-^ text-^ wide deep size description wide deep size description

23 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 23 HTML: Image Tag -Example Exercise: create following text in file exm5.htm open the file in a browser the output is shown in the next slide. Example of Image in a Document Example of Image in a Document Here is an example of the including a image in the document. Here is an example of the including a image in the document. The images in gif89a formats The images in gif89a formats can be animated. can be animated.

24 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 24 HTML: Image Tag -Example

25 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 25 HTML: Anchor Tag The hyper linking of two documents in HTML is accomplished through the anchor tag. The hyper linking of two documents in HTML is accomplished through the anchor tag. The anchor tag pair.. creates a link from current document to the referenced document in the tag. The anchor tag pair.. creates a link from current document to the referenced document in the tag. The A tag has several attributes, two important attributes used for linking purposes are name and href. The A tag has several attributes, two important attributes used for linking purposes are name and href. The href attribute is used for specifying a name or an URL of the document that this link points to (referenced document). The href attribute is used for specifying a name or an URL of the document that this link points to (referenced document). The name attribute is used for defining the anchor point that can be referred by the href tag. The name attribute is used for defining the anchor point that can be referred by the href tag.

26 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 26 HTML: Anchor Tag -Example Exercise: create following text in file exm6.htm open the file in a browser the output is shown in the next slide. Example of Hyperlink in a Document The following example illustrates usage of anchor tag for creating link to other documents.

Description of the Anchor Tag Description of the Anchor Tag The user can click on the text between the beginning and end The user can click on the text between the beginning and end of anchor tag. On clicking, the moreonlink.html document is retrieved from the same site from where this document was retrieved and rendered by the browser. retrieved and rendered by the browser.

27 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 27 HTML: Anchor Tag -Example

28 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 28 Common Gateway Interface (CGI) The Common Gateway Interface (CGI) mechanism of the HTTP enables servers to execute the programs, obtain results and send the results to the requesting browser. The Common Gateway Interface (CGI) mechanism of the HTTP enables servers to execute the programs, obtain results and send the results to the requesting browser. The program executed by the HTTP servers can be compiled C, C++ programs or in scripting languages such as Unix Shell (sh) or Perl. The program executed by the HTTP servers can be compiled C, C++ programs or in scripting languages such as Unix Shell (sh) or Perl. These CGI programs also referred as gateway programs/scripts act as bridge between the HTTP server and other programs such as DBMS. These CGI programs also referred as gateway programs/scripts act as bridge between the HTTP server and other programs such as DBMS. The CGI is an interface that specifies how the browser input entered through the tags is passed to the gateway programs/scripts and the expected format of the output from these gateway programs that can be passed to the browser by the web server. The CGI is an interface that specifies how the browser input entered through the tags is passed to the gateway programs/scripts and the expected format of the output from these gateway programs that can be passed to the browser by the web server.

29 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 29 Common Gateway Interface Web Browser Web Server CGI ScriptDBMS

30 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 30 CGI: Identifying and Invoking programs The CGI programs are triggered by the browser requests and executed by servers. The CGI programs are triggered by the browser requests and executed by servers. The web server distinguishes between the document requests and the CGI scripts/program execution requests based on the directives in the configuration file. The web server distinguishes between the document requests and the CGI scripts/program execution requests based on the directives in the configuration file. The web server configuration directive can be set so that a particular extension (e.g.,.cgi or.exe) implies an executable program rather than the document. Or, the web server can be configured in such a way that it treats all the files in particular sub directories (e.g., cgi-bin/) as the executable CGI programs /scripts. The web server configuration directive can be set so that a particular extension (e.g.,.cgi or.exe) implies an executable program rather than the document. Or, the web server can be configured in such a way that it treats all the files in particular sub directories (e.g., cgi-bin/) as the executable CGI programs /scripts. A browser can trigger a CGI program in one of the two ways. In the first case, the browser requests a CGI program as a regular URL mechanism. The server on receiving the URL examines the path name and/or the file extension of the URL, and identifies whether it is an HTML or an executable script/program, based on the file extension or location, that requires to be executed. A browser can trigger a CGI program in one of the two ways. In the first case, the browser requests a CGI program as a regular URL mechanism. The server on receiving the URL examines the path name and/or the file extension of the URL, and identifies whether it is an HTML or an executable script/program, based on the file extension or location, that requires to be executed. In the second case, the CGI program/script (URL) name appears as the action attribute of the tag. The forms are used for accepting user input In the second case, the CGI program/script (URL) name appears as the action attribute of the tag. The forms are used for accepting user input

31 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 31 CGI: Output Specifications CGI Program/Script output CGI Program/Script output –The program on execution puts the output on to stdout. Parsed and Non-Parsed Header CGI Scripts Parsed and Non-Parsed Header CGI Scripts –The CGI program/script usually produce output that is parsed by the Server and sent back to the client with completed header information. In this approach the programs/scripts do not need to generate full HTTP header for every request. –In some cases, the programs may want to bypass the parsing of the output by server, and talk directly to the client. In this case, it is programs responsibility to generate the valid HTTP header information. To distinguish these scripts, CGI requires that the script name begins with nph-.

32 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 32 CGI: Output Specifications Parsed headers Parsed headers –In this case, the header information consists of text lines, terminated by a blank line (a line with only a linefeed or CR/LF). –Headers that are not server directives are sent directly back to the client. The commonly used directives are: Content-type: the MIME type of the document you are returning. Content-type: the MIME type of the document you are returning. Location: Used to specify to the server that a reference to a document is being returned instead of actual document. Usually, it is a URL, and the server issues a redirect to the client. Location: Used to specify to the server that a reference to a document is being returned instead of actual document. Usually, it is a URL, and the server issues a redirect to the client. Status: It gives the server an HTTP Status Information for sending to the client. The format is nnn xxxxx, where nnn is the 3-digit status code, and xxxxx is the reason string, such as "Forbidden". Status: It gives the server an HTTP Status Information for sending to the client. The format is nnn xxxxx, where nnn is the 3-digit status code, and xxxxx is the reason string, such as "Forbidden".

33 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 33 CGI: Invoking the Programs/Script The following HTML document references a hyperlink. This hyperlink points to a CGI program/script. The following HTML document references a hyperlink. This hyperlink points to a CGI program/script. The browser rendition of this document is shown in next slide. The browser rendition of this document is shown in next slide. Example of a CGI Script Example of a CGI Script The following example demonstrates the use CGI script. This script, on execution, lists all the users logged on the system. The following example demonstrates the use CGI script. This script, on execution, lists all the users logged on the system. List People Logged on to ICRC List People Logged on to ICRC

34 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 34 CGI: Invoking programs/Scripts

35 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 35 CGI: Identifying and Invoking programs If user clicks on hyper link. The web server running at icrc.iiml.ac.in receives the request for the document who.cgi If user clicks on hyper link. The web server running at icrc.iiml.ac.in receives the request for the document who.cgi The configuration of the server indicates the.cgi files are CGI program /scripts. Thus, the server invokes CGI interface to execute who.cgi and its output is parsed by the server and sent to the browser for displaying. The configuration of the server indicates the.cgi files are CGI program /scripts. Thus, the server invokes CGI interface to execute who.cgi and its output is parsed by the server and sent to the browser for displaying. For the following who.cgi, For the following who.cgi,#!/bin/sh echo Content-type: text/plain echo echo Output of the Who command on icrc /bin/who On execution this script passes following output to the server, the browser output is shown in next slide. On execution this script passes following output to the server, the browser output is shown in next slide. Content-type: text/plain rootpts/0Nov 01 13:08(agni.iiml.ac.in) bhaskerpts/1Nov 01 13:22 (icrc.iiml.ac.in)

36 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 36 CGI: Identifying and Invoking programs

37 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 37 Forms and CGI Programs/Scripts For accepting the Input data for processing by the server based CGI Programs / Scripts, the HTML supports the tag. The tag defines a form. The tag has following important properties associated with it. ACTION: The action attribute specifies the CGI program/script that will be used for processing the data entered through the form. The action field accepts URL of the CGI programs. ENCTYPE: The attribute specifies how the values entered in the form are encoded for transmission to the URL. Some valid formats are are encoded for transmission to the URL. Some valid formats are application/x-www-form-urlencode and multipart/form-data. METHOD: The attribute describes the method used for sending the data to the Web server. The two supported methods are get and post. The browser uses the GET or POST protocol packet for sending the data to the server.

38 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 38 Forms and CGI Programs/Scripts A simple example of HTML document with forms is as follows. Example of HTML form Example of HTML form The following tags create a form in the HTML document The following tags create a form in the HTML document

39 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 39 Forms and CGI Programs/Scripts In the browser, the creates a logical form with no displayable components. In the browser, the creates a logical form with no displayable components. The action attribute may contain a full URL or a relative path. The relative paths are relative to the base document, i.e., the document in which this relative path appears. The action attribute may contain a full URL or a relative path. The relative paths are relative to the base document, i.e., the document in which this relative path appears. The get method specifies that the data will be transmitted to the CGI program, through web server indicated in the action field, as per the “Get” protocol. The get method specifies that the data will be transmitted to the CGI program, through web server indicated in the action field, as per the “Get” protocol. The enctype attribute has not been specified in this case, thus the default application/x-form-urlencoded is assumed. The enctype attribute has not been specified in this case, thus the default application/x-form-urlencoded is assumed.

40 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 40 Forms and CGI Programs/Scripts For accepting input from the form screen, tags such as input, select and textarea have been defined. For accepting input from the form screen, tags such as input, select and textarea have been defined. Each of these input tags have properties called name and (default) value. The user entered data overrides the default value. The input is transmitted from the browser in name=value format. Each of these input tags have properties called name and (default) value. The user entered data overrides the default value. The input is transmitted from the browser in name=value format. Following HTML code segment shows the usage of the form and input tags. Following HTML code segment shows the usage of the form and input tags. Please enter your last name: Please enter your last name:

41 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 41 Forms: Input Tag Text: Text: The text type input is made up of one-line field where user can type the data. The text type input is made up of one-line field where user can type the data. Following example shows the usage of text type input field: Following example shows the usage of text type input field: The size specifies the size of window that appears on the browser screen. The size specifies the size of window that appears on the browser screen. Value specifies the default value that will appear on the screen. In this case none appears on the screen. If user replace it by text by “newval”. The browser will pass last_name=“newval” otherwise last_name=“none” will be send by the browser. Value specifies the default value that will appear on the screen. In this case none appears on the screen. If user replace it by text by “newval”. The browser will pass last_name=“newval” otherwise last_name=“none” will be send by the browser. Maxlength: specifies the maximum length of input that can be accepted. If the size is smaller than maxlength the typed text will scroll over to left side. Maxlength: specifies the maximum length of input that can be accepted. If the size is smaller than maxlength the typed text will scroll over to left side.

42 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 42 Forms: Input Tag Password: Password: The text type input is made up of one-line field where user can type the data. The text type input is made up of one-line field where user can type the data. Following example shows the usage of text type input field: Following example shows the usage of text type input field: The size specifies the size of window that appears on the browser screen. The size specifies the size of window that appears on the browser screen. For the type= Password, whatever user types on the screen will not appear in clear-text.. If user types “newpassl”. The browser will pass userpw=“newpassl” to the server. For the type= Password, whatever user types on the screen will not appear in clear-text.. If user types “newpassl”. The browser will pass userpw=“newpassl” to the server. Maxlength: specifies the maximum length of input that can be accepted. If the size is smaller than maxlength the typed text will scroll over to left side. Maxlength: specifies the maximum length of input that can be accepted. If the size is smaller than maxlength the typed text will scroll over to left side.

43 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 43 Forms: Input Tag Radio Buttons Radio Buttons –In multiple-choice situations, the radio buttons are used for accepting the input. –Like the Radio-Tape recorder buttons only one of them can be selected at a time. –Radio buttons require both the name and value attribute specified with the tag. –Bunch of radio button that form a group have a common name and different values. –Bunch of radio button that form a group have a common name and different values. –Within a group, each radio button should have a unique value as the name=value is sent to the web server on submission of a form.

44 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 44 Forms: Input Tag For example:

Hair Color: Hair Color: Brunette Brunette Blonde Blonde Golden Golden Eye Color: Eye Color: Blue Blue Green Green Black Black The above example has two groups of radio buttons, the first ones identified by name=”h_color” and the other one identified by the name=”e_color”. The above example has two groups of radio buttons, the first ones identified by name=”h_color” and the other one identified by the name=”e_color”. The browser will send the following input: The browser will send the following input: h_color=black&e_color=green h_color=black&e_color=green

45 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 45 Forms: Input Tag Check Boxes: Check Boxes: The check boxes permit users to enter more than one answer for a question. The check boxes permit users to enter more than one answer for a question. On a form they act like on/off switches. In case of the checkboxes, the name attribute must have a unique value. On a form they act like on/off switches. In case of the checkboxes, the name attribute must have a unique value. For example: For example: Hair Dyes: Hair Dyes: Loreal Loreal Revelon Revelon

The browser will send name=value pair to the web server for all the boxes that are checked by the user prior to submitting the form. If user checks both the boxes, following argument will be sent: The browser will send name=value pair to the web server for all the boxes that are checked by the user prior to submitting the form. If user checks both the boxes, following argument will be sent: loreal=yes&revelon=yes loreal=yes&revelon=yes

46 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 46 Forms: Input Tag Submit buttons: Submit buttons: The submit button is created by defining the attribute type=“submit” in tag. The submit button has the name and value attributes as well. The submit button is created by defining the attribute type=“submit” in tag. The submit button has the name and value attributes as well. The value attribute specifies the label that appears on the submit button on the browser screen. If the value attribute is not specified the “submit” appears as the label on the button. The value attribute specifies the label that appears on the submit button on the browser screen. If the value attribute is not specified the “submit” appears as the label on the button. Submit button sends the data entered through the form to the web server for processing by the program specified through the “action” attribute of the tag. Submit button sends the data entered through the form to the web server for processing by the program specified through the “action” attribute of the tag. In case the name attribute has been specified for the submit button, the name=value pair corresponding to the submit button is sent as a part of the input argument. In case the name attribute has been specified for the submit button, the name=value pair corresponding to the submit button is sent as a part of the input argument.

47 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 47 Forms: Input Tag Reset Button Reset Button The reset button is defined by using the type=”reset” in the tag. The reset button is defined by using the type=”reset” in the tag. The reset button is used for clearing up the form and setting the values back to the original (default). The reset button is used for clearing up the form and setting the values back to the original (default). It is specially useful in a large form where after entering several fields user realizes the mistake and wants to starts afresh. It is specially useful in a large form where after entering several fields user realizes the mistake and wants to starts afresh. The value attribute of the reset button, like the submit button, can be used for changing the label of the reset button on the form. The value attribute of the reset button, like the submit button, can be used for changing the label of the reset button on the form.

48 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 48 Forms: Input Tag Hidden input: Hidden input: The hidden fields can be created by using type=”hidden” in the tag. The hidden fields can be created by using type=”hidden” in the tag. These fields do not appear anywhere on the form-screen displayed by the browser. These fields do not appear anywhere on the form-screen displayed by the browser. The hidden fields have name and value attributes. The name=value pair is sent to the web server for the hidden fields as well. The hidden fields have name and value attributes. The name=value pair is sent to the web server for the hidden fields as well. These field are used for passing the information to the server that you do not want a user to see and change. These field are used for passing the information to the server that you do not want a user to see and change. These fields can be used for passing the context information. Also, in multi-part form situation correlation information between the first form with subsequent forms can be maintained by adding a hidden field in the subsequent forms that carry some identifying values from the first form. These fields can be used for passing the context information. Also, in multi-part form situation correlation information between the first form with subsequent forms can be maintained by adding a hidden field in the subsequent forms that carry some identifying values from the first form.

49 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 49 Forms: Textarea Tag The textarea tag is used for accepting multiple lines of text input. The following example shows the use of textarea tag. The textarea tag is used for accepting multiple lines of text input. The following example shows the use of textarea tag. Your Feedback please: Your Feedback please: The rows and columns specify the size of a textarea The rows and columns specify the size of a textarea Wrap attribute can have three values- off, physical and virtual. Wrap attribute can have three values- off, physical and virtual. WRAP=OFF means that the text in the box does not wrap, but it is sent exactly the way it was typed in WRAP=OFF means that the text in the box does not wrap, but it is sent exactly the way it was typed in WRAP=PHYSICAL means that the text in the box wraps, and it is sent that way too. WRAP=PHYSICAL means that the text in the box wraps, and it is sent that way too. WRAP=VIRTUAL means that the text in the box wraps, but it is sent as one long continuous string. WRAP=VIRTUAL means that the text in the box wraps, but it is sent as one long continuous string.

50 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 50 Forms: Select Tag Select tag is used as an alternative to the radio buttons. It creates a pull-down list or multiple line selection options, making it suitable for presenting a large list of options in a limited space on screen. The following example shows the use of select tag. Select tag is used as an alternative to the radio buttons. It creates a pull-down list or multiple line selection options, making it suitable for presenting a large list of options in a limited space on screen. The following example shows the use of select tag. Country:
India India Nepal Nepal Bangladesh Bangladesh Pakistan Pakistan

51 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 51 Forms: Example HTML Code Example of HTML form Example of HTML form The following tags create a form with Input type text, radio buttons The following tags create a form with Input type text, radio buttons and checkboxes and checkboxes Please Enter Your Name: Please Enter Your Name: Please Indicate the Age group you belong: Please Indicate the Age group you belong: Under18 Years Under18 Years Years Years Years Years Years Years Over 65 Years Over 65 Years Please tick your hobbies: Please tick your hobbies: Reading Reading Sports Sports Mountaineering Mountaineering Horse Riding Horse Riding Gardening Gardening Stamp Collection Stamp Collection Photography Photography

52 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 52 Browser Output of Example HTML Code

53 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 53 Forms and CGI: All about Data While defining the form in HTML document the method property can have one of the two values- GET and POST. While defining the form in HTML document the method property can have one of the two values- GET and POST. The GET method: The GET method: –If the document has METHOD="GET" in its FORM tag, the CGI program will receive the encoded form input in the environment variable QUERY_STRING. The POST method: The POST method: –If the document has METHOD="POST" in its FORM tag, the CGI program will receive the encoded form input on stdin. –The server does not receive EOF on the end of the data, The CONTENT_LENGTH environment variable is used to determine how many bytes to read from stdin.

54 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 54 Forms and CGI: All about Data The data received by the CGI program on server side is in the format determined by Enctype property of the form tag. If no enctype is specified, the default x- www-form-urlencoded is used. The data received by the CGI program on server side is in the format determined by Enctype property of the form tag. If no enctype is specified, the default x- www-form-urlencoded is used. In the default format, all name=value pairs are concatenated with & character as a separator. The spaces are replaced by + character. In the default format, all name=value pairs are concatenated with & character as a separator. The spaces are replaced by + character. For example, the following name=value pairs For example, the following name=value pairs username=bharat bhasker agegroup=midagereading=yesriding=yes will be encoded as will be encoded asusername=bharat+bhasker&agegroup=midage&reading=yes&riding=yes

55 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 55 Forms and CGI: All about Data Get method sends the whole argument string as a part of the URL specified in the action attribute. Get method sends the whole argument string as a part of the URL specified in the action attribute. The argument string is appended to the URL separated by ‘?’ character. The argument string is appended to the URL separated by ‘?’ character. For the example, if action../cgi/bin/test/test.cgi, then the Get part of the request packet will be as follows: For the example, if action../cgi/bin/test/test.cgi, then the Get part of the request packet will be as follows: GET../cgi/bin/test.cgi?username=bharat+bhasker&agegroup=midage&reading=yes&riding=yes

56 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 56 Forms and CGI: All about Data If the attribute specified value of post for the method attribute, the relevant of portion of the protocol request will be as follows: If the attribute specified value of post for the method attribute, the relevant of portion of the protocol request will be as follows: POST../cgi-bin/test-cgiHTTP/1.1 Content-type: application/x-www-form-urlencoded Content-length:27 username=bharat+bhasker&agegroup=midage&reading=yes&riding=yes

57 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 57 Forms and CGI: Environment Variables In addition to the Query-String and Content_length referred earlier, the server makes several other environment variables available to the CGI Program. Some of these are: In addition to the Query-String and Content_length referred earlier, the server makes several other environment variables available to the CGI Program. Some of these are: SERVER_SOFTWARE SERVER_SOFTWARE –The name and version of the web server software handling the request. For example, Apache/1.3 SERVER_NAME SERVER_NAME –The server's hostname, DNS alias, or IP address GATEWAY_INTERFACE GATEWAY_INTERFACE –The version of CGI specification to which this server complies. For example, CGI/1.1 SERVER_PROTOCOL SERVER_PROTOCOL –Name and version of the protocol this request came in with. For example, HTTP/1.1

58 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 58 Forms and CGI: Environment Variables Contd. SERVER_PORT SERVER_PORT –The server port number to which this request was sent. For example, 80 REQUEST_METHOD REQUEST_METHOD –The method with which the request was made. For HTTP, this is "GET", "HEAD", "POST". QUERY_STRING QUERY_STRING –The information following the ‘?’ character in the URL which referenced this script. This is the data entered in the form by user in encoded form. It is not be decoded by the server. This variable is always set when there is query information/form-data and the method used is GET. REMOTE_HOST REMOTE_HOST –The hostname of the client making the request. If case the information is not available to the web server, it sets the REMOTE_ADDR variable and leaves this unset. REMOTE_ADDR REMOTE_ADDR –The IP Address of the remote machine making the request.

59 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 59 Forms and CGI: Environment Variables Contd. CONTENT_TYPE CONTENT_TYPE –For queries which have attached information, such as HTTP POST, this is the content type of the data. It has the same value as the enctype attribute of the form tag. For example, application/x-www-form-urlencoded CONTENT_LENGTH CONTENT_LENGTH –The length of the content (encoded form-data) send by the client. HTTP_ACCEPT HTTP_ACCEPT –The MIME types that are accepted by the client. The information is derived from HTTP headers. Commas, as per the HTTP specifications,separate each item in this list. HTTP_USER_AGENT HTTP_USER_AGENT –Stamp of the browser that the client used for sending the request. For example, Mozilla/4.5 for Netscape version 4.5

60 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 60 Forms and CGI: Environment Variables If following is the content of test.cgi program, the output for the Previously mentioned input for get method is shown in the next slide. #!/bin/sh echo Content-type: text/plain echo echo CGI/1.0 test script report: echo SERVER_SOFTWARE = $SERVER_SOFTWARE echo SERVER_NAME = $SERVER_NAME echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE echo SERVER_PROTOCOL = $SERVER_PROTOCOL echo SERVER_PORT = $SERVER_PORT echo REQUEST_METHOD = $REQUEST_METHOD echo HTTP_ACCEPT = "$HTTP_ACCEPT" echo PATH_INFO = "$PATH_INFO" echo SCRIPT_NAME = "$SCRIPT_NAME" echo QUERY_STRING = "$QUERY_STRING" echo REMOTE_HOST = $REMOTE_HOST echo REMOTE_ADDR = $REMOTE_ADDR echo REMOTE_USER = $REMOTE_USER echo AUTH_TYPE = $AUTH_TYPE echo CONTENT_TYPE = $CONTENT_TYPE echo CONTENT_LENGTH = $CONTENT_LENGTH

61 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 61 Forms and CGI: Environment Variables

62 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 62 Alternatives to CGI The CGI) offers capability to build the web-based applications that could provide search and retrieval, transaction management and other application services by interfacing the back-end information storage manager to the HTTP servers. The CGI) offers capability to build the web-based applications that could provide search and retrieval, transaction management and other application services by interfacing the back-end information storage manager to the HTTP servers. The CGI mechanism launches the script/program for every user requests that in turn takes up valuable processor time. The CGI mechanism launches the script/program for every user requests that in turn takes up valuable processor time. With limited number of requests per minute, it was possible to live with the performance. But, with the increase popularity of many of the search engines, electronic commerce sites the performance became a major issue. With limited number of requests per minute, it was possible to live with the performance. But, with the increase popularity of many of the search engines, electronic commerce sites the performance became a major issue. As a result, the Web server developers began to develop possible alternatives to the CGI mechanisms to enhance the performance. As a result, the Web server developers began to develop possible alternatives to the CGI mechanisms to enhance the performance.

63 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 63 Alternatives to CGI The performance problems were alleviated by removing the need to launch a CGI application repetitively for requests. The performance problems were alleviated by removing the need to launch a CGI application repetitively for requests. Some of the approaches are as follows: Some of the approaches are as follows: –Server Side Includes –Active Server Pages –Apache Mod_perl Module

64 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 64 Alternatives to CGI: SSIs The Server Side Includes (SSI) mechanism extends the HTML pages by adding predefined directive in the HTML document itself. The Server Side Includes (SSI) mechanism extends the HTML pages by adding predefined directive in the HTML document itself. The web server is configured to distinguish between a plain HTML and SSI directive embedded web pages. Typically, the web servers are configured to identify files with “.shtml” extension as the SSI files. The configuration file of the web server contains directive The web server is configured to distinguish between a plain HTML and SSI directive embedded web pages. Typically, the web servers are configured to identify files with “.shtml” extension as the SSI files. The configuration file of the web server contains directive AddType text/x-server-parsed-html.shtml In such a web server, whenever a browser requests a file with the “.shtml” extension, the web server reads and interprets the directives embedded in the file. During the interpretation process, the web server substitutes directives by the results of the directives. In such a web server, whenever a browser requests a file with the “.shtml” extension, the web server reads and interprets the directives embedded in the file. During the interpretation process, the web server substitutes directives by the results of the directives. The directives themselves are embedded as the HTML comments in the document. The directives themselves are embedded as the HTML comments in the document.

65 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 65 Alternatives to CGI: SSIs Here is an example of SSI document Here is an example of SSI documentmydoc.shtml Server Side Includes IllustrationM Server Side Includes IllustrationM The following document displays Server Side Includes Directives: The following document displays Server Side Includes Directives: Document Name: Document Name: Date: Date: This file was last modified on: This file was last modified on: Also the size of mydoc.shtml Also the size of mydoc.shtml

66 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 66 Alternatives to CGI: SSIs A selected list of SSI directives is as follows: #config: #config: The directive is used for formatting the output of other directive. #echo #echo Displays the content of the environmental variables discussed in CGI section and the additional ones listed earlier. #exec #exec The directive inserts the result of an external program in the document.. #flastmod #flastmod It displays the last modification date of a file.

67 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 67 Alternatives to CGI: SSIs contd.. #fsize #fsize The directive displays the size of the specified in the file parameter, in bytes. The syntax of the directive is as follows: #include #include The directive is used for inserting contents of a text file directly into a document. The syntax of the include directive is as follows: In addition to these command directives the APACHE web server also supports extended version of the SSI (XSSI). The extended directives are available in the mod_include module In addition to these command directives the APACHE web server also supports extended version of the SSI (XSSI). The extended directives are available in the mod_include module

68 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 68 Alternatives to CGI: ASP Active Server Pages (ASP) are supported by Microsoft’s Internet Information Server (IIS). Active Server Pages (ASP) are supported by Microsoft’s Internet Information Server (IIS). It uses the HTML tag based architecture to support Scripts and ActiveX components. In the ASP framework HTML pages have embedded scripts in the page. It uses the HTML tag based architecture to support Scripts and ActiveX components. In the ASP framework HTML pages have embedded scripts in the page. The ASPs are interpreted on the server and the resulting output page is delivered for rendering to browsers. The ASPs are interpreted on the server and the resulting output page is delivered for rendering to browsers. Host of ActiveX controls can be downloaded and executed in the Microsoft browser. Host of ActiveX controls can be downloaded and executed in the Microsoft browser. Similarly, there are many ActiveX controls that offer functionality to the web server. The ASP documents interface to these ActiveX components on the server side. Similarly, there are many ActiveX controls that offer functionality to the web server. The ASP documents interface to these ActiveX components on the server side. For example, the ActiveX component Active Data Object (ADO) can be invoked to act as an intermediary between the Active Server Pages and relational databases. The ADO provides many objects that are used for connecting to databases and manipulating the data. For example, the ActiveX component Active Data Object (ADO) can be invoked to act as an intermediary between the Active Server Pages and relational databases. The ADO provides many objects that are used for connecting to databases and manipulating the data.

69 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 69 Alternatives to CGI: ASP IIS VBScript Jscript ActiveX Script Engines Database ActiveX Data Objects ( ADO ) Components Browser HTTP Request HTTP Response ASP Files

70 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 70 Alternatives to CGI: Mod_Perl Apache Web Server consists of several modules, each entrusted with specific functional responsibility. A request to server passes through several modules during the processing. The Web server is written to easily extend and add newer modules. Apache Web Server consists of several modules, each entrusted with specific functional responsibility. A request to server passes through several modules during the processing. The Web server is written to easily extend and add newer modules. Apache web server offers a special module ‘Mod_Perl’ that embeds the Perl Interpreter inside the server. Apache web server offers a special module ‘Mod_Perl’ that embeds the Perl Interpreter inside the server. When a user request is passed to the server, it checks the Apache registry to determine whether it is responsible for processing request. When a user request is passed to the server, it checks the Apache registry to determine whether it is responsible for processing request. Through the Apache::Registry Module, the web server can be configured to identify certain extension directories, for execution by the mod_perl module. Through the Apache::Registry Module, the web server can be configured to identify certain extension directories, for execution by the mod_perl module. The mod_perl module enables the perl script writers to run their scripts with in the Apache Web Server itself without invoking the external process and Perl interpreter as is the case with CGI/Perl. The mod_perl module enables the perl script writers to run their scripts with in the Apache Web Server itself without invoking the external process and Perl interpreter as is the case with CGI/Perl.

71 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 71 Dynamic HTML The standard HTML is a static language with a scant concern for the layout and style of the rendered document and does provide in- built features for dynamically updating the content, change the appearance, hide, or animate the content. The standard HTML is a static language with a scant concern for the layout and style of the rendered document and does provide in- built features for dynamically updating the content, change the appearance, hide, or animate the content. The dynamic HTML (DHTML) provides capability to change the HTML page even after the browser has rendered it. The dynamic HTML (DHTML) provides capability to change the HTML page even after the browser has rendered it. For example, an image rendered on screen may change to an alternate image on moving the mouse over it or the header of an important text may scrolls horizontally over the screen. For example, an image rendered on screen may change to an alternate image on moving the mouse over it or the header of an important text may scrolls horizontally over the screen. The DHTML by itself is not a tagging language or a technology like JavaScript or a plug-in, it’s a concept. The DHTML by itself is not a tagging language or a technology like JavaScript or a plug-in, it’s a concept. The concept of DHTML is achieved by marrying the HTML, Cascading Style Sheets, Scripting Language (JavaScript) and the Document Object Model together. The concept of DHTML is achieved by marrying the HTML, Cascading Style Sheets, Scripting Language (JavaScript) and the Document Object Model together. The scripting languages provide ability to add event driven programming on the browser. The language such as JavaScript can be embedded in the HTML code with tag-pair. The scripting languages provide ability to add event driven programming on the browser. The language such as JavaScript can be embedded in the HTML code with tag-pair.

72 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 72 Dynamic HTML DHTML is an extension of HTML tags, when used with JavaScript or ActiveX and style sheets, allows the designer control over the appearance and position of page elements (objects) DHTML is an extension of HTML tags, when used with JavaScript or ActiveX and style sheets, allows the designer control over the appearance and position of page elements (objects) DHTML also allows for interactive pages that can be dynamically modified without interacting with the server DHTML also allows for interactive pages that can be dynamically modified without interacting with the server Leading visual DHTML Tools include: Leading visual DHTML Tools include: –NetObject’s Fusion –Macromedia’s Dreamweaver

73 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 73 HTML Editors The available HTML authoring tools generally fall in three categories- –WYSIWYG editors NetObjects Fusion NetObjects Fusion –Code based editors that require basic understanding of HTML; HomeSite HotDog Professional HotDog Professional HTMLed Pro 32, HTMLed Pro 32, WebberActive and WebberActive and WebEdit Pro WebEdit Pro –Compound – WYSIWYG and Code based editors. Microsoft FrontPage, Microsoft FrontPage, Adobe PageMill, Adobe PageMill, HoTMetaL Pro, HoTMetaL Pro, Macromedia DreamWeaver and Macromedia DreamWeaver and QuickSite QuickSite

74 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 74 Multimedia Content: Images The tag can be used for including an image in HTML document The tag can be used for including an image in HTML document The graphics and images can be classified in following two formats The graphics and images can be classified in following two formats –Raster Format A raster format uses one or more bits to store a pixel information. If only one bit (color depth 1) is used for each pixel, it will be a black and white image. With 8 bits for each pixel the image can have 256 colors and with 24-bits it can have millions of colors A raster format uses one or more bits to store a pixel information. If only one bit (color depth 1) is used for each pixel, it will be a black and white image. With 8 bits for each pixel the image can have 256 colors and with 24-bits it can have millions of colors –Vector Format The vector format records images descriptively, in terms of geometric shapes. During rendering, these shapes are converted into bitmaps. Since the images in vector format are made up of multiple independent shapes, it is easier to modify a vector image. The component shapes of an image can be resized, rotated, moved or even deleted independently The vector format records images descriptively, in terms of geometric shapes. During rendering, these shapes are converted into bitmaps. Since the images in vector format are made up of multiple independent shapes, it is easier to modify a vector image. The component shapes of an image can be resized, rotated, moved or even deleted independently

75 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 75 Multimedia Content: True & Web Images True Image True Image –The quality images typically use 24-bits for colors (true colors). These images also called true images record colors to the finest levels. The true images are useful when constructing and editing the images as they lose very little or no information. These images due to 24-bit color information for each pixel are usually large in size. Thus, using them on web pages tends to slowdown the download speed of the page. –The Microsoft Windows uses BMP, Macintosh PICT and X-Window systems favor XWD for the true images. Web Image- Web Image- –The performance requires the smaller file sizes for images. The GIF and JPEG are two common formats that are used for images on web pages. Both of these formats have smaller sized files as they compromise on the image quality through compression. So, if the image needs to be re-edited at some later point, it is important to keep a copy of the image in True format.

76 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 76 Web Images: GIF The Graphic Interchange Format (GIF) reduces the size of a True color or bit mapped file by compressing it. It uses Lempel-Ziv compression algorithm. The algorithm treats rows of the same color pixels as single unit and saves on the space. The GIF uses an indexed color scheme that uses 8 bits of color depth to index a 24- bit color palette. Thus, a GIF file can have maximum of 256 colors in an image. The Graphic Interchange Format (GIF) reduces the size of a True color or bit mapped file by compressing it. It uses Lempel-Ziv compression algorithm. The algorithm treats rows of the same color pixels as single unit and saves on the space. The GIF uses an indexed color scheme that uses 8 bits of color depth to index a 24- bit color palette. Thus, a GIF file can have maximum of 256 colors in an image. The GIF files also support transparency of images. In a transparent image the page background shows through image. The GIF files also support transparency of images. In a transparent image the page background shows through image. The GIF 89a format supports transparency as it permits marking of single color as transparent. The GIF 89a format supports transparency as it permits marking of single color as transparent. The following examples mark the white color as transparent in a given image (say anu.gif) and produce a transparent image tr_anu.gif. The following examples mark the white color as transparent in a given image (say anu.gif) and produce a transparent image tr_anu.gif. giftrans –t #ffffff –o tr_anu.gif anu.gif

77 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 77 Web Images: JPEG The JPEG format supports full 24-bit color depth but compresses the file by recording the brightness of each pixel and averaging the hues. The JPEG format supports full 24-bit color depth but compresses the file by recording the brightness of each pixel and averaging the hues. Our eyes can distinguish a limited gradation of hues, so rather than recording the literal composition of an image it records the description. The browsing program decodes the description and translates it into a bitmap that looks closer to original image. Our eyes can distinguish a limited gradation of hues, so rather than recording the literal composition of an image it records the description. The browsing program decodes the description and translates it into a bitmap that looks closer to original image. The JPEG format can not have transparency information as traditional method of making the transparent images in GIF has been to pick a color and render all the pixels of that color transparent. The JPEG format can not have transparency information as traditional method of making the transparent images in GIF has been to pick a color and render all the pixels of that color transparent. The JPEG is a lossy format. The encoded information is translated to pixel map as a result they do not come out to be exactly the same. The JPEG is a lossy format. The encoded information is translated to pixel map as a result they do not come out to be exactly the same.

78 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 78 Multimedia Content: Audio, Video etc. Various media objects such as sound, video, PDF, postscripts in addition to images can also be added in the web pages. Various media objects such as sound, video, PDF, postscripts in addition to images can also be added in the web pages. The multimedia objects can be integrated as external or internal objects. The files that are not directly rendered by the browser in in-line mode are referred to as the external media. The multimedia objects can be integrated as external or internal objects. The files that are not directly rendered by the browser in in-line mode are referred to as the external media. The following example integrates a multimedia object mmfile.ext that will be downloaded and rendered when a user clicks on the text “Media Object: Click to play”. The following example integrates a multimedia object mmfile.ext that will be downloaded and rendered when a user clicks on the text “Media Object: Click to play”. Media Object: Click to play Media Object: Click to play To render these objects the browser usually runs a separate program that understands the files specified by “.ext” extension. To render these objects the browser usually runs a separate program that understands the files specified by “.ext” extension. The browser has to know about these helper applications and their association with type of files (defined by.ext). The browsers come loaded with support for many standard file types and helper applications. The browser has to know about these helper applications and their association with type of files (defined by.ext). The browsers come loaded with support for many standard file types and helper applications.

79 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 79 Multimedia Content: Audio, Video etc. For a new file type, the browser can be configured for invoking a helper application for a given file extension. The configuration requires the file extension, MIME type and location of the helper program/application to be invoked information. The following figure shows the configuration window for Netscape Navigator. For a new file type, the browser can be configured for invoking a helper application for a given file extension. The configuration requires the file extension, MIME type and location of the helper program/application to be invoked information. The following figure shows the configuration window for Netscape Navigator.

80 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 80 Multimedia Content: Audio, Video etc. The external multimedia objects, included through the anchor tags, are rendered/played only when the user clicks on the object. Some times, designer of the web pages are interested in providing the background music to the web pages. The external multimedia objects, included through the anchor tags, are rendered/played only when the user clicks on the object. Some times, designer of the web pages are interested in providing the background music to the web pages. Most of browsers for that purpose support additional tags such as and. These tags with appropriate set of attributes can play the sound as the page background. Following examples illustrate the use of these tags. Most of browsers for that purpose support additional tags such as and. These tags with appropriate set of attributes can play the sound as the page background. Following examples illustrate the use of these tags. In the tag AUTOSTART=true indicates to the browser that the file is to be played on loading and HIDDEN=true specifies that no icon will appear on screen for this tag. In the tag AUTOSTART=true indicates to the browser that the file is to be played on loading and HIDDEN=true specifies that no icon will appear on screen for this tag. Video objects can be integrated in the same way as the audio. The video objects include both the animation and real video files. There are several prevalent video file formats- QuickTime, MPEG etc. Video objects can be integrated in the same way as the audio. The video objects include both the animation and real video files. There are several prevalent video file formats- QuickTime, MPEG etc.

81 ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 81 Multimedia Content: VRML VRML is a Web-based language for describing 3D virtual worlds VRML is a Web-based language for describing 3D virtual worlds Tools support the complexity of VRML development and model editing Tools support the complexity of VRML development and model editing Leading VRML Editors: Leading VRML Editors: –Cosmo Software’s Cosmo Worlds –Platinum Technology’s VRCreator –Ligos Technology’s V-Realm Builder


Download ppt "ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 1 Electronic Commerce: Information Publishing Technology."

Similar presentations


Ads by Google