INTRODUCTION TO DEVELOPMENT OF DYNAMIC WEB APPLICATIONS

INTRODUCTION TO DEVELOPMENT OF DYNAMIC

WEB APPLICATIONS Svein Nordbotten

Svein Nordbotten & Associates Bergen 2007

1

Table of Contents

Preface ...................................................................................................................................................... 7 Session 1: Introduction ............................................................................................................................. 8

Web-pages and web sites ..................................................................................................................... 8 Dynamic web sites ................................................................................................................................ 9 CGI and PERL ....................................................................................................................................... 10 Applications Program Interfaces......................................................................................................... 10 ColdFusion Markup Language............................................................................................................. 11 Evaluating a web site .......................................................................................................................... 11 Visit counter example ......................................................................................................................... 12 Exercises.............................................................................................................................................. 13 Session 2: ColdFusion MX ....................................................................................................................... 15 ColdFusion Markup Language............................................................................................................. 15 Data types ........................................................................................................................................... 15 Variables.............................................................................................................................................. 16 Expressions.......................................................................................................................................... 16 Flow control statements ..................................................................................................................... 18 Other components .............................................................................................................................. 19 Guessing game example ..................................................................................................................... 20 Exercises.............................................................................................................................................. 23 Session 3: Web market research ............................................................................................................ 24 Introduction ........................................................................................................................................ 24 Market research.................................................................................................................................. 24 Applications outline ............................................................................................................................ 24 Implementation .................................................................................................................................. 25

2

Exercises.............................................................................................................................................. 31 Session 4: Web database for opinion polls ............................................................................................. 33

Files and databases ............................................................................................................................. 33 Databases............................................................................................................................................ 33 CFMX SQL ............................................................................................................................................ 34 Basic SQL elements ............................................................................................................................. 34 Opinion polling.................................................................................................................................... 35 INSERT statements.............................................................................................................................. 37 SELECT statements.............................................................................................................................. 40 UPDATE statements ............................................................................................................................ 41 Statistical report.................................................................................................................................. 45 DELETE statements ............................................................................................................................. 47 Exercises.............................................................................................................................................. 49 Session 5: Web perception application .................................................................................................. 50 Introduction ........................................................................................................................................ 50 Outline of the design........................................................................................................................... 51 Design of the database ....................................................................................................................... 52 Design of the dynamic web process ................................................................................................... 53 Opening page ...................................................................................................................................... 53 Demographic form .............................................................................................................................. 54 Displaying the first chart ..................................................................................................................... 58 Perception report form ....................................................................................................................... 61 Next chart............................................................................................................................................ 64 Thanks to the participants .................................................................................................................. 67 Exercises.............................................................................................................................................. 68 Session 6: Web search engine................................................................................................................. 69 A search engine................................................................................................................................... 69 Selection menu ................................................................................................................................... 70 File collection ...................................................................................................................................... 71 Indexing the files ................................................................................................................................. 73 Searching the collection...................................................................................................................... 75 Deleting a registered collection .......................................................................................................... 77

3

Final remarks....................................................................................................................................... 79 Exercises.............................................................................................................................................. 79 Session 7: e-learning ............................................................................................................................... 80 Web courses........................................................................................................................................ 80 Course architecture............................................................................................................................. 80 Authorization and authentication....................................................................................................... 81 Registration and authorization ........................................................................................................... 82 Authentication .................................................................................................................................... 86 List of content ..................................................................................................................................... 87 Lectures............................................................................................................................................... 88 Session 8: Web shop ............................................................................................................................... 91 e-business ........................................................................................................................................... 91 Business promotion ............................................................................................................................ 91 Buying products .................................................................................................................................. 94 Purchasing products.......................................................................................................................... 101 Exercises............................................................................................................................................ 103 Session 9: Web agents .......................................................................................................................... 104 Web agents ....................................................................................................................................... 104 Agent 1 .............................................................................................................................................. 104 Advanced agent ................................................................................................................................ 107 Remarks on scheduling ..................................................................................................................... 113 Other Internet Agents ....................................................................................................................... 114 Exercises............................................................................................................................................ 114 Session 10: Data exchange - syndication .............................................................................................. 116 XML ................................................................................................................................................... 116 Web Distributed Data Exchange ....................................................................................................... 116 Data exchange between art galleries................................................................................................ 117 Implementation of the exchange...................................................................................................... 118 DTD for WDDX................................................................................................................................... 123 Exercises............................................................................................................................................ 123 Session 11: Regular expressions and CFScript ...................................................................................... 125 Regular expressions and string processing ....................................................................................... 125

4

Re-visiting the search engine ............................................................................................................ 125 Implementation ................................................................................................................................ 130 CFScript language.............................................................................................................................. 131 Comparing CFML and CFScript.......................................................................................................... 131 Conclusion......................................................................................................................................... 133 Exercises............................................................................................................................................ 133 Session 12: Re-using code..................................................................................................................... 134 Re-using code........................................................................................................................................ 134 ColdFusion approaches ..................................................................................................................... 134 Custom Tags ...................................................................................................................................... 134 User-Defined Functions .................................................................................................................... 137 UDF libraries...................................................................................................................................... 138 CFX Tags ............................................................................................................................................ 139 Exercises................................................................................................................................................ 139 Session 13: Distributed processing ....................................................................................................... 140 Distributed processing .......................................................................................................................... 140 Client-side processing ....................................................................................................................... 140 JavaScript .......................................................................................................................................... 140 Flash and ActionScript....................................................................................................................... 142 Exercises................................................................................................................................................ 149 Session 14: Components....................................................................................................................... 150 CFMX Component technology .............................................................................................................. 150 Authorization example...................................................................................................................... 150 Component for generating unique random numbers ...................................................................... 150 Introspection..................................................................................................................................... 153 Exercises................................................................................................................................................ 154 Session 15: Web services ...................................................................................................................... 155 Web services ......................................................................................................................................... 155 Universal Description, Discovery, and Integration ............................................................................ 156 Web Service Description Language ................................................................................................... 156 Simple Object Access Protocol .......................................................................................................... 156 Web services creation and consumption in CFMX ............................................................................ 156

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download