Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Web Technologies for Effective Dissemination of Information 13 November 2000 SIGAda 2000 Mr. Currie Colket SIGAda Vice Chair for Meetings.

Similar presentations


Presentation on theme: "Introduction to Web Technologies for Effective Dissemination of Information 13 November 2000 SIGAda 2000 Mr. Currie Colket SIGAda Vice Chair for Meetings."— Presentation transcript:

1 Introduction to Web Technologies for Effective Dissemination of Information 13 November 2000 SIGAda 2000 Mr. Currie Colket SIGAda Vice Chair for Meetings and Conferences Phone: (703) 883-7381; Email: colket@mitre.org | colket@acm.org Dr. John McCormick SIGAda Secretary Phone: (319) 273-2618; Email: mccormic@cs.uni.edu | SIGAda_Secretary@acm.org Mr. David A. Wheeler Institute for Defense Analyses Phone: (703) 845-6662; Email: dwheeler@ida.org | dwheeler@dwheeler.com Mr. Clyde Roby Institute for Defense Analyses Phone: (703) 845-6666; Email: roby@ida.org SIGAda Home Page  http://www.acm.org/sigada

2 13 November 2000SIGAda WWW 2 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Motivation This tutorial is designed for the SIGAda volunteer interested in using WWW technologies to promote Local activities and Working Group activities. At the end of this tutorial, you will be able to: Use simple web-authoring tools Develop your own Home Page Tailor it to effectively communicate to your audience Establish Home Page on ACM host Use simple web-posting tools Use simple web-verification tools Establish maillists for your activity

3 13 November 2000SIGAda WWW 3 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Overview Introduction to WWW and SIGAda Home Page as Notional Example (John McCormick ~ 20 minutes) Introduction to HTML and use of Netscape Composer (Currie Colket ~ 90 minutes) Effective Design Strategies Appropriate to Disseminating Information (Clyde Roby ~ 30 minutes) Tools to Manage Development of Web Pages (Clyde Roby ~ 40 minutes) Introduction to Ada CGI (David A. Wheeler ~ 90 minutes) Using ACM WWW and Maillist Facilities (John McCormick ~ 60 minutes) Introduction to XML (Currie Colket ~ 30 minutes) Start: 8:30 Break: 10:00 Lunch: 12:00 Back: 1:30 Break: 3:00 End: 5:00

4 13 November 2000SIGAda WWW 4 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Introduction to SIGAda Home Page as Notional Example John McCormick SIGAda Secretary

5 13 November 2000SIGAda WWW 5 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 1

6 13 November 2000SIGAda WWW 6 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 2

7 13 November 2000SIGAda WWW 7 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 3

8 13 November 2000SIGAda WWW 8 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 4

9 13 November 2000SIGAda WWW 9 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 5

10 13 November 2000SIGAda WWW 10 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 6

11 13 November 2000SIGAda WWW 11 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Home Page - 7

12 13 November 2000SIGAda WWW 12 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Introduction to HTML and use of Netscape Composer Currie Colket MITRE SIGAda Vice Chair for Meetings and Conferences

13 13 November 2000SIGAda WWW 13 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Introduction to HTML HTML Basics Fonts; Colors; Bold; Italics Creating Lists Creating Links to URLs Creating Anchors/Targets Creating Relative Links Creating Mailto Links Incorporating Images Putting Code On-line Forms Using the HTML Netscape Composer (a WYSIWYG) Creating Tables

14 13 November 2000SIGAda WWW 14 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Motivation for Knowing HTML Many WYSIWYG Tools- Why Learn HTML? Output of tools is not always portable Some use advanced features of HTML Some use non-standard extensions of HTML Some tools generate XML instead of HTML Browsers typically omit information not understood Many browsers can’t handle XML Tools can not always support desired goals Occasionally cleanup of HTML code is required Porting from one tool to another Eliminate garbage automatically generated Strengthens understanding of WWW capabilities Understanding HTML is good foundation for XML

15 13 November 2000SIGAda WWW 15 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda What is HTML Lingua franca for publishing hypertext on the World Wide Web Non-proprietary format based upon SGML Created and processed by a wide range of tools from simple plain text editors to sophisticated WYSIWYG authoring tools Uses tags such as and to structure text for Presentation Browsers attempt to produce page even when there are errors Produced by W3C as recommendation; voted on by Consortium members http://www.w3.org/MarkUp/ Status: Version 4.01 is current recommendation, replacing Version 3.2 Support for Style Sheets - Control color, font, and layout Internationalization Features - text right to left (Hebrew & Arabic) Accessibility Features - Braille and speech synthesizers Tables and Forms - many new features Scripting and Multimedia - many new features 3 Flavors of HTML: Transitional - take some advantage of 4.0, but primarily support 3.2 Strict - use style sheets, i.e., free of tags associated with layout Frameset - used to partition browser into one or more frames

16 13 November 2000SIGAda WWW 16 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda HTML Basics HTML: HyperText Markup Language is Semantic Markup physical: indent 1.0”, Use 24-Point Roman Font, Print “Hello” semantic: Hello uses markup tags Physical is WYSIWYG; HTML will differ on each system Designed to be extensible, in fact, still evolving Uses HyperText Transport Protocol (HTTP) Tag names are case insensitive HTML Program Structure: Some Tags have attributes Text is continuous regardless of spaces/CR Most Tags in pairs; solo: Paragraph Break Line Break Horizontal Rule <BODY BACKGROUND=“my_file.jpg” T EXT="#000000" LINK="#0000ff" VLINK="#ff0000" BGCOLOR="#ffffef" >

17 13 November 2000SIGAda WWW 17 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Fonts; Colors; Bold; Italics Highlighting HTML Characters can be highlighted using Boldfaced, Big and Bigger text, Italicized text, Strike-through Text, Small and Smaller text, with Subscripts and Superscripts, with Typewriter font and even underlining for emphasis. There is also a concept of Logical Highlighting using Strongly Emphasized Text, Computer Code Text, Keyboard Character Text, Literal Character Text, Defining Instance Text, Emphasized Text, Variable Text, Strike-out Text. SIGAda WWW Tutorial Sunday, 7:30 - 11:30 PM

18 13 November 2000SIGAda WWW 18 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Lists List Example The 3 most important things in real estate are: [Ordered Lists] Location, Location, and Location (It should be noted that all lists will wrap around with the correct indentation desired for the screen. The most important things in talking about software are: [UnOrdered Lists] Using Bullets Correctly Using Plenty of Bullets, and Using Subordinate Bullets When Necessary With Letters Again with Letters With Small Roman Numerals With Large Roman Numerals With Numbers Even With Numbers Out of Sequence

19 13 November 2000SIGAda WWW 19 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Links to URLs - 1 Link Example The following URLs contain useful information on using html: W3C HTML Home Page - http://www.w3.org/MarkUp/ W3C User Interface Domain - http://www.w3.org/MarkUp/Activity.html HTML Quick Reference - http://www.cc.ukans.edu/~acs/docs/other/HTML_quick.shtml The Bare Bones Guide to HTML - http://werbach.com/barebones/ Creating HTML Documents - http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/d2-htmlinfo.html HTML Primers and Tutorials - http://www.eclipse.net/derek/ ISO Latin 1 Character Entities and HTML Escape Sequence Table - http://www.bbsinc.com/symbol.html Compact Index of HTML Tags - http://www.willcam.com/cmat/html/crossref.html HTML, URL, and HTTP Technical Information and Specifications - http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/d2-tech.html <A HREF=” http://dir.yahoo.com/Computers_and_Internet/Information_and_Documentation/Data_Formats/HTML/"> Yahoo HTML Search Node - http://dir.yahoo.com/Computers_and_Internet/Information_and_Documentation/Data_Formats/HTML/

20 13 November 2000SIGAda WWW 20 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Links to URLs - 2

21 13 November 2000SIGAda WWW 21 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Anchors/Targets Anchors/Targets Example Anchors/Targets Example Navigation: Email Addresses | News | Weather Email Addresses Pelot Email Addresses Colket Email Addresses <IMG SRC="gif/updated.gif" WIDTH=46 HEIGHT=11> Colcord Email Addresses News News stuff Weather Weather Stuff

22 13 November 2000SIGAda WWW 22 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Relative Links Useful for Program Development File on local system has same relative name as file on remote system Switch from one system to other with simple click Relative Link Example Navigation: To www.colket.org | To C Drive Technology Resources: Acronyms | Ada | Conferences | HTML | Internet | Java | OO | Reuse | Email Addresses

23 13 November 2000SIGAda WWW 23 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Mailto Links Mailto Example Mailto Example Please email comments on this course to <A HREF="mailto: "Currie Colket" <colket@acm.org>, "Brad Balfour" <bbalfour@acm.org>, "Clyde Roby" <roby@ida.org>, "John McCormick" <mccormick@nova.cs.uni.edu>" TITLE="Comments on Course"> Currie, Brad, Clyde, and John Currie Colket (colket@acm.org) "Currie Colket" <colket@acm.org> is equivalent to “Currie Colket”

24 13 November 2000SIGAda WWW 24 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Incorporating Images Image Example ASIS is an interface between an Ada environment as defined by ISO/IEC 8652:1995 (the Ada Reference Manual) and any tool requiring information from this environment, as shown below: <IMG SRC="gif/updated.gif" WIDTH=46 HEIGHT=11> <IMG SRC="gif/asis.gif" ALT="ASIS as interface to Ada compilation environment" WIDTH=488 HEIGHT=306> ASIS as interface to Ada compilation environment Above image made in PowerPoint by: Creating image; cutting it from page Using Page Setup, selecting landscape, 3”x5” Pasting image onto page; aligning it to center Saving as gif (or jpeg) Obtaining size using Photo Editor Resize function Size is important; allows for building page sans images ALT for browsers without graphics or browsers turned off Bad Form Better Form Good Form

25 13 November 2000SIGAda WWW 25 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Putting Code On-line Code Example EXAMPLE: Loop iteration scheme List : constant Asis.Element_List := -- 3.7 <ASIS function returning a list>; An_Element : Asis.Element; -- 3.6 begin for I in List'Range loop An_Element := List (I); Process (An_Element); end loop; Use for large blocks of code For Preformatted text Characters in fixed width Preserves space characters, CR Allows for character emphasis Anchors and text highlighting tags only

26 13 November 2000SIGAda WWW 26 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Forms - 1 Form Example Last Name: First Name: Address Line 1: Address Line 2: City: State: DC MD VA Zip: Area Code: Phone: E-mail: Volunteer Interests: [ Program] [ Publicity] [ Local Arrangements] (Multiple items can be selected.) Ada Awareness Initiative: Yes No Maybe (Only one item can be selected.) Enter any special comments you might have here. Action Text Input Checkboxes Radios Text Areas Submit/Reset Text Options

27 13 November 2000SIGAda WWW 27 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Forms - 2

28 13 November 2000SIGAda WWW 28 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Forms - 3 Email = Subject: Form posted from Mozilla Lastname=Colket&Firstname=Currie &Address1=9906+Dale+Ridge+Court &Address2=&City=Vienna&State=VA&Zip=22181-5348 &Area_Code=703&Phone=883-7381 &Email=colket%40acm.org &Interests=Program&Ada_awareness=Yes &Special_Notes=This+is+a+demonstration+of+posting+forms. +Notice+how+the+text+automatically+wraps +around+as+the+information+is+typed.%0D%0A++&sub=Send+Form Use Ada95 bindings to CGI to automatically process form. Automatically confirm submission of form Automatically update database Perform other analysis of submitted information David Wheeler will address Ada95 Bindings to CGI Netscape returns as attachment Type: application/x-www-form-urlencoded Others return in different formats.

29 13 November 2000SIGAda WWW 29 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Using the HTML TITLE (Only required Element) Used as name for Bookmarks (those >60 are blank) Used to label display window or text screen Used by browsers as quick index mechanism Example: ACM SIGAda Home Page META (Optional - But highly recommended) Used for Meta information not explicitly defined elsewhere, Examples: BASE (Optional & NOT Recommended) Used for recording the base URL of the document Prevents relative links from developmental environments Recorded as URL in Bookmarks instead of actual URL Example:

30 13 November 2000SIGAda WWW 30 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Netscape Composer

31 13 November 2000SIGAda WWW 31 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Creating Tables

32 13 November 2000SIGAda WWW 32 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Effective Design Strategies Appropriate to Disseminating Information Clyde Roby IDA Note: Originally developed by Brad Balfour of Objective Interface

33 13 November 2000SIGAda WWW 33 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda This Section: Concept and Goals Main Goal: –To help understand the many ways that the WWW can be used to communicate information Secondary Goal: –To help new “designers” to effectively choose appropriate techniques from among the many that the web provides Technique: Descriptive rather than Prescriptive Present a series of questions to be asked in order to decide what structure and techniques to use to build the web pages (web site) Also will present a list of “rules” (both the commonly agreed upon and the controversial)

34 13 November 2000SIGAda WWW 34 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Building A Collection of Web Pages — Things to Think About The Audience Ways the Audience Gets Info and Gets Notified of Changes Frequency of Browsing by Audience Why Does the Audience Need Your Site What Makes the Site Attractive Kinds of Sites Types of Information Provided Organizing the Information Types of Content Design Tips/“Rules”

35 13 November 2000SIGAda WWW 35 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda The Audience Who are they? What do they need? What do they want? How experienced are they? What do they already know? What do they want to find out? How similar are they to the webmaster? How different are they from the webmaster? Are they using modern browsers on fast machines? Are their graphics enabled?

36 13 November 2000SIGAda WWW 36 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Ways the Audience Gets Info and Gets Notified of Changes Push versus Pull Site Info Push versus Pull Change Notification –Interrupt versus Polling –Most web sites are pull only and have no push content »Not even for notification of changes/updates/new info Browsing oriented site info organization Search oriented site info organization “Channels” E-mail notification plus Web-Site Print “Ads” notification of web-site (or TV)

37 13 November 2000SIGAda WWW 37 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Frequency of Browsing by Audience Multiple Times a Day Daily Weekly Monthly When Notified Only when first found –Or found via a search engine –Or found via a link to the site from the outside When ready to purchase Reference Only (based on external need for info)

38 13 November 2000SIGAda WWW 38 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Why Does the Audience Need Your Site Uniqueness? Timeliness? Loyalty? Membership? Who is your Competition? –Within SIGAda –Within Ada Community –Within ACM –Within the community of programming languages –With the software development community

39 13 November 2000SIGAda WWW 39 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda What Makes the Site Attractive Content? Look and Feel? Responsiveness? Satisfying the Audience’s need? How much is too much? How much is too little? Issues: –Connection Speed (everyone focuses on this) –Form versus Content (is it “versus”?) –Uniqueness versus Sameness –Freshness of content and form

40 13 November 2000SIGAda WWW 40 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Kinds of Sites Informational –e.g., medicine, academia, most.org News –e.g., CNN, MSNBC, ESPN Product/Service Oriented (Sales secondary via ads) –e.g., Kelly Blue Book Sales/Selling Oriented –e.g., “catalog” ordering, Ford, most product companies Organizational - Member Oriented –e.g., info to members only or predominately Organizational - Outreach Oriented –e.g., get new members to join based on info

41 13 November 2000SIGAda WWW 41 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Types of Information Provided (SIGAda specific) Technical info Copies of printed publications Software (source code and/or executables) Papers Data on experiences/results Membership info Organizational infrastructure (e.g., meeting minutes, org. structure, motions, charter, etc) Historical info (e.g., past e-mail list traffic archive, conference results) Contact info Links to other sites

42 13 November 2000SIGAda WWW 42 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Organizing the Information Types: –Linear –Hierarchy –Graph (DAG) –Random Depth of Links Breadth of Links What is the relationship between the contents What do people need to find? –What do they know when they want to find it? Search oriented users versus Browsing users

43 13 November 2000SIGAda WWW 43 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Types of Content Text Graphics Multimedia –Video –Sound Stored Documents –Ftp –Served Interactively –(format: PDF, PS, text) Software –Source –Executable –Browsed on-line (hyperlinked) –Downloaded Steak versus Sizzle Content versus Presentation Competition General overall Level of “Professionalism” Native to the browser versus needs plug-in Use of JavaScript Use of Java Use of cgi

44 13 November 2000SIGAda WWW 44 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Design Tips/“Rules” Commonly Agreed Upon No blinking text KISS Don’t overwhelm with graphics Navigate with text instead of/in addition to any image maps (unless the navigation is truly graphical like a map) Make the organization obvious (and help show users where they are at all times) Keep links & site up to date Controversial (like Multiple Inheritance) Frames All sites must be fast to download –What’s the connection speed of your users (home versus work)

45 13 November 2000SIGAda WWW 45 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Tools to Manage Development of Web Pages Clyde Roby IDA roby@ida.org

46 13 November 2000SIGAda WWW 46 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Goal and Concepts Goal: Development, Management, and Update of a Web Site (many web pages) Development and Organization Management Updating the Web Site Fixing the Web Site Tools to do the Job An Example: The ASIS Web Site

47 13 November 2000SIGAda WWW 47 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Web Development Local Development of Web Pages Development of Informational Materials Moving Your Web Pages to the Web Site

48 13 November 2000SIGAda WWW 48 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Web Management Who Comes to the Web Site? What do they Visit on the Web Site? How Often do they Visit/Return? How do they Retrieve/Use the Information? Why do they Visit the Web Site?

49 13 November 2000SIGAda WWW 49 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Updating the Web Site Local Update of Web Pages Updating of Informational Materials Updating Pages on the Web Site

50 13 November 2000SIGAda WWW 50 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Fixing the Web Site Broken Links Wrong Information Outdated Information ISP Problems Notification to the Webmaster

51 13 November 2000SIGAda WWW 51 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda WWW Tools Tools to Develop the Web Site Tools to Manage the Web Site Tools to Update the Web Site Tools to Find and Fix the Problems

52 13 November 2000SIGAda WWW 52 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda The ASIS Web Site ASIS Specification ASIS Tutorial Pages Information Updates –Technical Information –Vendor Product Information ASIS Bibliography Notification to SIGAda-ASIS members Membership Updates

53 13 November 2000SIGAda WWW 53 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda What This Means Test your web site locally Follow a few simple rules –Information on Home Page –Links Among Pages on Web Site –ALT for ALL Graphics Images –Use height and width in graphics –Information and Documents served via links “Save As” –Relatively Short Pages (50K Bytes Max) –For links greater than 50K Bytes, indicate size

54 13 November 2000SIGAda WWW 54 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Easy Web Site Development Home Page Information –Table of Contents –Points of Contact –Becoming Involved RELATIVE links –Facilitates development of Web pages –Avoid links with.. Or../.. (viewed as a security violation) Directory Structure “behind the scenes” Internal links to main/home page and to sponsoring organization Proof pages likely to be printed (e.g., maps, program) –Verify colors are easily readable when printed on black & white –Verify likely page break does not interfere with content use

55 13 November 2000SIGAda WWW 55 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Page Creation Web Sites www.microsoft.com/sitebuilder members.aol.com/royalef/gifanim.htm ds.dial.pipex.com/fw/animgifs.htm www.barebones.com www.demon.co.uk/Tangent/butwor.html www.webtechs.com/html-val-svc/ htc.rit.edu/klephacks/markup.html web.cs.bgsu.edu/morph/morphapplet.html

56 13 November 2000SIGAda WWW 56 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda HTML Editors for Macs www.yahoo.com/Computers/World_Wide_Web/HT ML_Editors/Macintosh www.uwtc.washington.edu/Computing/WWW/Mac /Directory.html www.awa.com/nct/software/webtools.html www.vermeer.com/soft.htm

57 13 November 2000SIGAda WWW 57 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Mac HTML Editors www.navisoft.com/register/client/MP_Trial_1.01.sit.hqx www.navisoft.com/NS/InsertRow/navipress pre ftp://bradley.bradley.edu/pub/guru/ps2html/ps2html-v2.html dragon.acadiau.ca/~giles/HTML_Editor_Documentation.html sec-look.uiowa.edu/about/projects/arachnid-page.html ftp://ftp.cray.com/src/WWWstuff/RTF/Users_Guide.html www.ceneca.com/Ordering.html

58 13 November 2000SIGAda WWW 58 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda General Info for Web Developers the-tech.mit.edu:80/KPT/Toms/index.html linestone.kosone.com/people/nelsonl/nl.htm www.info.net/~rdralph/icons/symbols/ abs.apple.com/apple-internet/authoring/ the-tech.mit.edu/cgi-bin/KPT_bgs.pl www.netscape.com/assist/net_sites/bg/backgrounds.html www.issi.com/people/russ/backgrounds.html www.primenet.com/~piglett/textures.html www.designsys.com/champ/background.html www.sci.kun.nl/thalia/guide/color/faq.html www.vmedia.com/archives/clipart/index.html www.cuteftp.com

59 13 November 2000SIGAda WWW 59 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Using ACM WWW and Mailing List Facilities John McCormick University of Northern Iowa

60 13 November 2000SIGAda WWW 60 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda The SIGAda Home Page Is a gateway to a lot of good information for the Ada community It is difficult for one volunteer with a full time job to keep all of this information up to date –Bad links sprout like mushrooms –Lots of old news

61 13 November 2000SIGAda WWW 61 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Solution - More Volunteers We already have –Volunteers from some local SIGAda Chapters –Volunteers from some SIGAda working groups

62 13 November 2000SIGAda WWW 62 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Local SIGAda Chapters with Web Presence Baltimore Jersey Shore Twin Cities Washington, DC

63 13 November 2000SIGAda WWW 63 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Working Groups with “Recent” Web Presence Ada as an HDL WG (forming) Ada Bindings ASIS Commercial Ada Users Education –Jobs page (Searching for student worker) Safety and Security

64 13 November 2000SIGAda WWW 64 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda More Help Needed in Tools, bindings, and components Ada news Ada advocacy Additional locals Additional working groups

65 13 November 2000SIGAda WWW 65 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda This Tutorial Stated agenda –Provide volunteers (including myself) with the basic information necessary to effectively disseminate information using the world wide web. My personal agenda –Recruit volunteers

66 13 November 2000SIGAda WWW 66 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda ACM WWW ACM hosts SIG websites –RS/6000 UNIX server –turing.acm.org –Moving to perl.acm.org running Red Hat Linux 6.1 Home directory for SIGAda is /acminfo/1/sigs/sigada or /usr2/info/sigs/sigada

67 13 November 2000SIGAda WWW 67 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Procedures for Setting up a Local or Working Group Home Page Option 1 Set up on your own machine and send me the URL –Currently used by all locals except DC –Not used by any Working Group Option 2Set up on ACM’s Turing –Currently used by all active working groups

68 13 November 2000SIGAda WWW 68 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Setting up Pages on Turing Requires an account on Turing I will set up a subdirectory in which to put the home page We use UNIX groups and permissions to control access to SIGAda subdirectories

69 13 November 2000SIGAda WWW 69 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Getting a Turing Account Send me the following information –Name –Company / Institution –Address –Telephone and FAX numbers –e-mail address –ACM membership number –Preferred login name (8 character limit)

70 13 November 2000SIGAda WWW 70 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Who Can Update a Page? Whoever is in the group that owns the file I welcome suggestions for policy and means of enforcement.

71 13 November 2000SIGAda WWW 71 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Guidance for Organizing Files Each working group and local chapter on Turing is rooted in their own subdirectory All groups currently use a flat organization There are currently 19 subdirectories in the SIGAda root directory

72 13 November 2000SIGAda WWW 72 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Suggestions for Pages Link to SIGAda home page Link to ACM home page Page owner name with e-mail link (blank if maintained by SIGAda Secretary) Date last modified Should we design templates?

73 13 November 2000SIGAda WWW 73 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Use of Private Directories with Passwords ACM now provides this ability via their member account names www.acm.org/infodir/services/access_control.html Access control lists set up by ACM support –Based on subscription services or –list individual account names maintained by SIG Information Director

74 13 November 2000SIGAda WWW 74 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda CGI SIGAda used CGI scripts for SIGAda 2000 Conference Registration turing.acm.org did not have an Ada compiler available; perl.acm.org does have an Ada compiler SIGAda is working with ACM to have the Ada95 cgi interfaces available on perl.acm.org ACM policy is that each SIG is on its own

75 13 November 2000SIGAda WWW 75 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda ACM Mailing Lists ACM uses Listserv software Complete documentation at –http://www.acm.org/infodir/services/listserv/doc.html (links to) –http://www.lsoft.com/manuals/1.8d/index.html: » LISTSERV List Owner's Quick Start » LISTSERV List Owner's Manual » LISTSERV General User's Guide All lists @acm.org –http://www.lsoft.com/SCRIPTS/WL.EXE?XH=ACM.ORG

76 13 November 2000SIGAda WWW 76 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Mailing Lists - 1 SIGADA-ABWG SIGADA-ANNOUNCE SIGADA-ASIS SIGADA-ASIS-OFFICERS SIGADA-ASIS-TECH SIGADA-AWARDS SIGADA-DC SIGADA-DC-EC SIGADA-EC SIGADA-EDITORS SIGADA-EEC SIGADA-LIAISONS SIGADA-LOCALS SIGADA-MEETINGS SIGADA-MEMBERS SIGADA-OOWG SIGADA-PAST-EC SIGADA-TALK SIGADA-WG SIGADA2000-COMMITTEE SIGADA2001-COMMITTEE SIGADA99-COMMITTEE Ada Bindings Working Group (63 subscribers) Announcement List (846 subscribers) Ada Semantic Interface Spec. Working Group (21 subscribers) ASIS Officers Mailing List (11 subscribers) ASIS Technical Discussion Group (93 subscribers) Awards Announcement List (2 subscribers) DC SIGAda Chapter Mailing List (229 subscribers) DC SIGAda Chapter Officers Mailing List (16 subscribers) SIGAda Executive Committee Mailing List (8 subscribers) Ada Letters Editors (2 subscribers) SIGAda Extended Executive Committee (no subscriber) Liaisons to Ada Organizations Around the World (16 subscribers) SIGAda Local Chapter Chairs (17 subscribers) Meetings Committee (1 subscriber) Discussion List (2 subscribers) Object Oriented Working Group (36 subscribers) Previous Executive Committee Mailing List (7 subscribers) Ongoing Discussion (56 subscribers) Working Group Chairs (22 subscribers) SIGAda 1999 COMMITTEE email distribution list (20 subscribers) SIGAda 2000 COMMITTEE email distribution list (28 subscribers) SIGAda 2001 COMMITTEE email distribution list (25 subscribers)

77 13 November 2000SIGAda WWW 77 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda SIGAda Mailing Lists - 2 ADA-COMMENT Public Comments on the International Ada Standard (1 subscriber) ADASAGE AdaSage tool discussion (448 subscribers) ARG Ada Rapporteur Group of WG9; managing the Ada issues (33 subscribers) TEAM-ADA Team Ada: Ada Advocacy Issues (83 & 95) (331 subscribers) WG9 ISO/IEC JTC1/SC22/WG9 (Ada) - Ada standardization topics (62 subscribers)

78 13 November 2000SIGAda WWW 78 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Requesting a List Send me the necessary information (detailed on following slides) I’ll arrange for ACM Support to set up the list

79 13 November 2000SIGAda WWW 79 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Name and Description List Name –Prefix with SIGAda –Maximum of 24 characters Descriptive Title –Prefix with ACM SIGAda –Maximum of 70 characters

80 13 November 2000SIGAda WWW 80 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Subscription Options By owner Requests to subscribe are forwarded to the list owner for approval Open Requests to subscribe are accepted; anyone can join Closed Requests to subscribe are rejected. List owner adds subscribers

81 13 November 2000SIGAda WWW 81 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Senders (who can post) PublicAnyone can post Editors/ModeratorsMessages posted from non-editors are forwarded to moderators for approval OwnersOnly list owners can post PrivateOnly list subscribers can post (this option can be problematic)

82 13 November 2000SIGAda WWW 82 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Review (who can see who subscribes) PrivateSubscribers can review OwnerOnly the list owner can review PublicAnyone can review

83 13 November 2000SIGAda WWW 83 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda List Archive No Monthly Weekly Yearly

84 13 November 2000SIGAda WWW 84 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Sample List Announcement Welcome To The Washington DC SIGAda Chapter Announcements List. This list is intended to keep you informed of important ACM SIGAda information in the Washington DC area including upcoming local DC and Baltimore SIGAda chapter meetings, local software engineering conferences, and other professional activities. You may leave this list at any time by sending mailto:LISTSERV@ACM.ORG with the following one line body: SIGNOFF SIGAda_DC If you need to change your email address, please signoff from your old system, as above, and resubcribe to the maillist from your new system by sending mailto:LISTSERV@ACM.ORG with the following one line body: SUBSCRIBE SIGAda_DC If you no longer have access to your old email address, please send mailto:SIGAda_DC_Request@acm.org requesting that your old address be removed and your new address be added. If you have any questions about this list, please mailto: SIGAda_DC_Request@acm.org. Additional information on the SIGAda_DC maillist is available on the DC SIGAda Home Page at: http://www.acm.org/sigs/sigada/locals/dc/ You are encouraged to notify your colleagues about this opportunity for professional software information. You do not need to be a member of ACM to subscribe. Please save this message for future reference.

85 13 November 2000SIGAda WWW 85 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Useful Listserv Commands - 1 To add a person (to SIGAda_DC@acm.org): Add SIGAda_DC Colket@ACM.ORG Currie Colket pw=123456 Quiet Add SIGAda_DC Colket@ACM.ORG Currie Colket pw=123456 To delete a person Delete SIGAda_DC Colket@ACM.ORG pw=1234546 Quiet Delete SIGAda_DC Colket@ACM.ORG pw=123456 To see the current list Review SIGAda_DC pw=123456 Send messages to: LISTSERV@acm.org Warning: if outgoing messages wrap at 72 characters, a CR is added and message is not recognized by listserv

86 13 November 2000SIGAda WWW 86 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Useful Listserv Commands - 2 To add many people at a time Warning: if outgoing messages wrap at 72 characters, a CR is added and listserv may process things very wrong ADD SIGAda_DC DD=InitialList IMPORT PW=123456 //InitialList DD * brosgol@ACM.ORG Ben Brosgol ClydeRoby@ACM.ORG Clyde Roby hal.hart@ACM.ORG Hal Hart bscrawford@AOL.COM Bard Crawford mangold@ATM-COMPUTER.DE Karlotto Mangold colket@COLKET.ORG Currie Colket mccormic@CS.UNI.EDU John McCormick sroliver@CSC.CALPOLY.EDU Ron Oliver roby@IDA.ORG Clyde Roby colket@MITRE.ORG Currie Colket /* No commas, etc. Use quotes

87 13 November 2000SIGAda WWW 87 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Useful Listserv Commands - 3 To update list header PUT SIGAda_DC LIST PW=123456 * ACM DC SIGAda email distribution list * Owner= colket@MITRE.ORG (Currie Colket) * Owner= colket@COLKET.ORG (Currie Colket) * Owner= Quiet: * Owner= mccormic@nova.cs.uni.edu (John McCormick) * Notebook=Yes,/home/listserv/home/notebooks/sigada_DC,Monthly,Private * Errors-To= Owner * Subscription= by owner * Ack= Yes * Confidential= No * Files= No * Notify= No * Mail-Via= Distribute * Validate= No * Reply-to= Sender,Respect * Review= Private * Send= Public * Stats= Normal,Private * X-Tags= Yes * Default-Options= NoFiles,NoRepro * Warning: if outgoing messages wrap at 72 characters, a CR is added and message is not recognized by listserv Added

88 13 November 2000SIGAda WWW 88 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Introduction to AdaCGI David A. Wheeler IDA

89 13 November 2000SIGAda WWW 89 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Outline Intro: myself, AdaCGI, CGI, Alternatives Using Ada for Web Apps (+ and -) High-Level: License, Basics Using AdaCGI: Minimal Example, Debugging and Installing Special: Get/Post, Cookies, Security, Recent Additions, Limitations AdaCGI spec & Long Example (“Search”)

90 13 November 2000SIGAda WWW 90 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda What is AdaCGI? Ada Library implementing the “Common Gateway Interface” (CGI) –CGI is the most common interface for web-enabled programs (“web apps”) –CGI is language & platform neutral Permits development of cross-platform web- enabled Ada programs http://www.dwheeler.com/adacgi

91 13 November 2000SIGAda WWW 91 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda CGI: General Concept (1 of 2) Web Browser (Client) Web Server Web Program/ Application HTTP CGI 1 (2) 3 4 (5) 6

92 13 November 2000SIGAda WWW 92 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda CGI: General Concept (2 of 2) When CGI is used, the following occurs: 1. Web browser sends request to web server 2. Web server determines that it must start web application; determines which one & starts it 3. Web application starts, loads data sent by web server (primarily as keys and their values; keys can duplicate) 4. Web application responds (via stdout), with a header (saying what it’s replying) followed by data 5. Web application exits (quits) once done 6. Web server passes this data on to user’s browser

93 13 November 2000SIGAda WWW 93 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda CGI Alternatives FastCGI –Keeps web app alive (instead of restarting per request) –(+) Better performance (eliminates startup) –(-) More work developing app (must reset all state) –(-) Less robust (app must survive many requests) Server-specific (proprietary) APIs –(+) Even better performance (eliminates startup & IPC) –(-) Lock-in to a particular web server –(-) Even less robust (error may take down server)

94 13 November 2000SIGAda WWW 94 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Alternatives Doug Smith’s WebAda CGI –Derived from an old version of AdaCGI –(+) generic iterators, can remove keys, re-parser –(-) no cookies, complex use, buggy decoders, little doc, unmaintained –We’ve agreed that I’ll remerge his into mine (in time) –www.adasmith.com/webada/source Binding to C (ugh) Un-CGI –Converts CGI data to environment vars “WWW_name” –No cookies, multivalue keys ambiguous, slow, ugh

95 13 November 2000SIGAda WWW 95 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Why use Ada for Web Apps? Excellent Run-Time Performance –better than interpreters (Perl), can be > typical JVM –CGI low performance, so relevant iff compute-bound Excellent compile-time checking Highly readable (especially vs. Perl) Increased security over C/C++ (bounds checking) Prefer Ada Have existing Ada applications

96 13 November 2000SIGAda WWW 96 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Weaknesses of Ada for Web Apps Wordiness (not best for short scripts) Less convenient string handling Regular expressions not built-in –Can use GNAT’s library, but fewer capabilities and can’t optimize like Perl Fewer web-app-specific and related support libraries Often, must separately install Ada library

97 13 November 2000SIGAda WWW 97 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI License AdaCGI is free, free software, open source Open Source License: LGPL + 2 clauses: –“GNAT clause”: don’t need to distribute separate object files –Web users must be able to get and redistribute your version of the AdaCGI library Can use to develop proprietary programs, but the AdaCGI library must stay open

98 13 November 2000SIGAda WWW 98 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Basics “with CGI”: initialization autoloads data Two ways to access CGI data: –an associative array (given key & optional key count, returns value) –indexed sequence (given index, =>key or value) Call Put_CGI_Header to start returning data –by default, to return HTML Then send results (HTML?) to standard out Use String or Unbounded_String directly

99 13 November 2000SIGAda WWW 99 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Minimal” Web App Example with CGI, Text_IO; use CGI, Text_IO; procedure Minimal is begin Put_CGI_Header; -- We will reply with a generated HTML document. -- Output …. : Put_HTML_Head("Minimal Form Demonstration”); if CGI.Input_Received then -- Check if input was received. Put_Variables; -- Input received; show all variable values. else -- No input received; reply with a simple HTML form. Put_Line(" What's your Name? "); end if; Put_HTML_Tail; -- End HTML doc, sending end Minimal;

100 13 November 2000SIGAda WWW 100 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Debugging/Testing a Web Program For debugging & test scripts, can start directly: –setenv REQUEST_METHOD GET –setenv QUERY_STRING key1=value1&key2=... –compile, link, run (“./minimal”) Output should look like: Content-type: text/html Minimal Form Demonstration What's your Name?

101 13 November 2000SIGAda WWW 101 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Installing a Web Program To really use it, set up with web server, e.g.: –su –cp minimal /home/httpd/cgi-bin Run –http://localhost/cgi-bin/minimal –http://localhost/cgi-bin/minimal? name=David%20Wheeler& email=dwheeler@dwheeler.com Odd problems? Try Put_Variables

102 13 November 2000SIGAda WWW 102 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Get vs. Post CGI supports two sub-protocols –Get: data can be included in URLs –Post: data can be voluminous AdaCGI supports both, merging them –Can use either subprotocol at any time –API hides difference; access data the same way –If you need to know, AdaCGI will say which, but using this difference is not recommended

103 13 November 2000SIGAda WWW 103 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Cookies Cookies are small pieces of data –Sent by the server –Stored by the client and sent back when the client re- communicates with the server Often used in e-commerce (the cookie is an ID indicating the transaction we’re in) Potential privacy risk: Permits servers to track users (loss of anonymity)

104 13 November 2000SIGAda WWW 104 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Security Issues CGI data comes from untrusted users –identify legal values, and prohibit anything not meeting the legal criteria (min, max, patterns, etc.) –don’t assume that these values are trustworthy (“price”) –in particular, never trust a filename or directory name –you may need to escape all metacharacters –NIL character See the many documents available on CGI programming security

105 13 November 2000SIGAda WWW 105 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Additions in Version 1.5 AdaCGI Version 1.5 added the following: –Cookie_Count –HTML_Encode: & becomes & –URL_Encode/Decode: % becomes %25 –Generic Iterators –Key_Value_Exists: Has Key been given Value? WebAda Inspired

106 13 November 2000SIGAda WWW 106 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Important Limitations No separate IndexedKey ADT/OO type for parameters & cookies –parse, modify, remove, save, reload Doesn’t support file uploads –Rarely used in practice Only supports GET/POST commands –Others useful for web maintenance (WebDAV)

107 13 November 2000SIGAda WWW 107 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Less Important Limitations Auto-initializes data on startup Doesn’t support FastCGI –Usually implemented separately anyway Doesn’t auto-gen form with initial values –Can be done with a higher-level package String/Unbounded_String awkward Some subprogram names too similar Could be broken into multiple packages (?!)

108 13 November 2000SIGAda WWW 108 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Get-by-key function Value(Key : in String; Index : in Positive := 1; Required : in Boolean := False) return Unbounded_String; function Key_Exists(Key : in String; Index : in Positive := 1) return Boolean; function Key_Count(Key : in String) return Natural;

109 13 November 2000SIGAda WWW 109 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Get-by-Position function Argument_Count return Natural; function Key(Position : in Positive) return String; function Value(Position : in Positive) return String;

110 13 November 2000SIGAda WWW 110 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Starting Output procedure Put_CGI_Header(Header : in String := "Content- type: text/html"); –Puts CGI Header to Current_Output, followed by two carriage returns. –This header determines the program's reply type. –Default is to return a generated HTML document. –Warning: Make calls to Set_Cookie before calling this procedure!

111 13 November 2000SIGAda WWW 111 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Generating HTML Basics procedure Put_HTML_Head(Title : in String; Mail_To : in String := ""); –Puts an HTML header with title “Title”: _Title_ procedure Put_HTML_Heading(Title : in String; Level : in Positive); –Put an HTML heading, e.g. Title. procedure Put_HTML_Tail; –Put HTML tail, I.e.:

112 13 November 2000SIGAda WWW 112 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Watch Out, Excessively Similar Names! Put_CGI_Header –Content-type: text/html Put_HTML_Head – … Put_HTML_Heading – …

113 13 November 2000SIGAda WWW 113 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Generating HTML Miscellania procedure Put_Error_Message(Message : in String); –This Puts an HTML_Head, an HTML_Heading, the message, and an HTML_Tail. –Call "Put_CGI_Header" before calling this. procedure Put_Variables; –Put to Current_Output all of the CGI variables as an HTML-formatted String.

114 13 November 2000SIGAda WWW 114 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Miscellaneous function Input_Received return Boolean function My_URL return String; function Get_Environment(Variable : in String) return String; Line_Count, Line_Count_of_Value, Line, Value_of_Line: handle multi-line values

115 13 November 2000SIGAda WWW 115 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda AdaCGI Spec: Cookies (new feature of AdaCGI 1.4) Set_Cookie(Key : String;Value : String; Expires : String := ""; Path: String := …; Domain: String := …; Secure: Boolean := False ); –Sets a cookie value; call this BEFORE calling Put_CGI_Header. function Cookie_Value(Key : in String; Index : in Positive := 1; Required : in Boolean := False) return Unbounded_String; function Cookie_Value(Position : in Positive) return String;

116 13 November 2000SIGAda WWW 116 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Top with CGI, …; use CGI, …; procedure Search is... begin Put_CGI_Header; if Key_Exists("query") and Key_Exists("file") then Process_Query; else Generate_Blank_Form; end if; Put_HTML_Tail; end Search;

117 13 November 2000SIGAda WWW 117 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Generate_Blank_Form (1 of 4) Put_HTML_Head("Text Search Form"); Put_HTML_Heading("Text Search Form", 1); Put_Line(" You may search for a text phrase from any of the given files. "); Put_Line("What do you want to search for: "); declare Query_String : constant String := CGI.Value ("query"); File_Value : constant String := CGI.Value ("file"); begin Put_Line("<INPUT NAME=""query"" SIZE=40"); if Query_String /= "" then - - if query set, use as default Put(" VALUE="); Put(String'(Value("query"))); end if; Put_Line("> ");

118 13 November 2000SIGAda WWW 118 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Generate_Blank_Form (2 of 4) - - if file set, then save it in form & display its value. - - otherwise, let the user select the file to search. if Key_Exists("file") and File_Value /= "" then Put("<INPUT TYPE=""hidden"" NAME=""file"" VALUE="""); Put(String'(Value("file") & """>")); Put(" You will be searching file "); Put(String'(Value("file"))); Put_Line(" "); else Put_Line("Where do you want to search? "); Put_Select_List; end if; end; -- declare block

119 13 November 2000SIGAda WWW 119 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Generate_Blank_Form (3 of 4) - - if “casesensitive” set, save in form invisibly, else ask user if Key_Exists("casesensitive") then Put_Line(String'(" ")); else Put_Line("Do you want this search to be case-sensitive?"); Put_Line(” Yes. "); Put_Line(" No. "); Put_Line(" "); end if;

120 13 November 2000SIGAda WWW 120 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Generate_Blank_Form (4 of 4) - - Generate submit and reset buttons for form Put_Line(" ");

121 13 November 2000SIGAda WWW 121 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Process_Query (1 of 2) procedure Process_Query is User_File_To_Search : constant String := CGI.Value("file"); File_To_Search : constant String := - - Don’t trust user to set this! Real_File_Name(U(User_File_To_Search)); Pattern : constant String := Value("query"); Case_Sensitive : Boolean := False; Case_Sensitivity : constant String := Value ("casesensitive"); begin Put_HTML_Head("Query Result"); Put_HTML_Heading("Query Result", 1); Put_Line(String'(" The search for " & Value("query") & " ")); Put_Line(String'(" in file " & Value("file") & " "));

122 13 November 2000SIGAda WWW 122 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda “Search” Example: Process_Query (2 of 2) if Case_Sensitivity = "yes" then Case_Sensitive := True; Put_Line(" in a case-sensitive manner"); end if; Put_Line("produced the following result: "); Put_Line(" "); Flush; Put_Matches(File_To_Search, Pattern, Case_Sensitive); Put_Line(" "); end Process_Query;

123 13 November 2000SIGAda WWW 123 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda In Conclusion... You can make web apps in Ada! –Get it at http://www.dwheeler.com/adacgi –EMailing: adacgi-list-request@adapower.com message body “subscribe” –Linux packaging: http://www.gnuada.org Use the current version of AdaCGI –Currently version 1.5 Patches welcome Go forth & have fun!

124 13 November 2000SIGAda WWW 124 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Introduction to XML Currie Colket MITRE

125 13 November 2000SIGAda WWW 125 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Motivation for XML HTML Dumbs Down Book Author DateISBN Publisher Title... Title: Programming in Ada95 (Second Edition) Author: John Barnes Date: July, 1998 ISBN: 0-201-34293-6 Publisher: Addison-Wesley... Useful for Presentation only Limited Content accessibility

126 13 November 2000SIGAda WWW 126 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda What is XML Produced by W3C as recommendation; voted on by Consortium members http://www.w3.org/XML/ XML is a method for putting structured data in a text file XML looks a bit like HTML but isn't HTML tags delimit data; in HTML tags communicate presentation XML is text, but isn't meant to be read strict rules; a forgotten tag makes the entire file useless XML is a family of specifications XML 1.0 - specifies tags and attributes, and Document Type Definition (DTD) guidelines Xlink - describes a standard way to add links to an XML file Xpointers and Xfragments point to portions of an XML file CSS - Cascading Style Sheets provide mechanism to present content documents XSL - Extensible Style Language is the advanced language for expressing style sheets XSLT - Transformations (XSLT) is the semantics for transforming one XML document into another DOM - Document Object Model allows programs and scripts to dynamically access and update the content, structure and style of documents XML Namespaces - specifies how you can associate a URL with every single tag and attribute in an XML document RDF - Resource Description Framework (RDF) is a foundation for processing metadata; it provides interoperability between applications that exchange data on the Web. Xschema - Specifications help developers define their own schemas and many more

127 13 November 2000SIGAda WWW 127 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda XML Interfaces HTML Browser User 1 “Produce content once and output in many different formats.” DTD XML Application Processing XML Validation XML Parser e.g., msxml Other XML Apps DOM HTML Browser User 2 XSL 1 XSL 2 Output for Printer XSL 3 Database Query Application From library of common DTDs

128 13 November 2000SIGAda WWW 128 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda XML Schema Example Book* Author+ DateISBN Publisher Book_Catalogue Title Month?Year Note: “*” means “zero or many” “?” means “is optional ” “+” means “one or more” Attributes for each book: Category - autobiography/non-fiction/fiction In_Stock - yes/no (no default) Reviewer - null default

129 13 November 2000SIGAda WWW 129 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda XML DTD Example <!ATTLIST Book Category (autobiography | non-fiction | fiction) #REQUIRED In_Stock (yes | no) “no” Reviewer CDATA “” > Book_Catalogue.dtd

130 13 November 2000SIGAda WWW 130 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda XML Code Example <Book Category = “non-fiction” In_Stock = “yes” Reviewer = “Pat Rogers”> Programming in Ada95 (Second Edition) John Barnes 1998 0-201-34293-6 Addison-Wesley <Book Category = “non-fiction” In_Stock = “no” Reviewer = “Ted Baker”> Ada 95: Problem Solving and Program Design, 3rd Edition Michael Feldman Elliot Koffman July 1999 0-201-36123-X Addison-Wesley Book_Catalogue.xml Need to suck in the DTD file

131 13 November 2000SIGAda WWW 131 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda What is XHTML l Produced by W3C as recommendation; voted on by Consortium members http://www.w3.org/TR/xhtml1/ l Reformulation of HTML 4.0 in XML 1.0 l XHTML is intended to be used in conjunction with tags from other X3 tag sets, so that in principle, you can combine XHTML tags with: l XML tags l Scalable Vector Graphics (SVG) tags l Synchronized Multimedia Integration Language (SMIL) tags l Mathematical Markup Language (MathML) tags l etc. l XML syntax is used for XHTML, for example: l Make tags case-sensitive l Include end tags e.g. and l Add a / to empty tags, e.g. and l Quote all attribute values, e.g. l Use lower-case for tags and attributes l Old browsers can render XHTML 1.0 if simple guidelines are followed. l New specification for FORMS based on Data, Logic, and Presentation l New specification for Modules to subset and extend XHTML

132 13 November 2000SIGAda WWW 132 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda XML Observations/Opinions l Technology in early adopter phase - Too early for true lessons learned l Phenomenal Excitement: XML is the latest “web thing” l Low Barriers to Entry - Incremental development, low investment requirements l Significant Industry Offerings in products and tools - Reaching critical mass Already internet output for Word in Microsoft Office instead of HTML l Cross Disciplines- Unifying framework for exchanging data l Requires Tools - Specialized tools needed to develop and use XML; not supported by many browsers l HTML Still Viable - XML will not replace HTML for basic presentation of information for many years, if ever

133 13 November 2000SIGAda WWW 133 © Currie Colket, Brad Balfour, John McCormick, Clyde Roby, & David Wheeler for ACM SIGAda Summary Introduction to WWW and SIGAda Home Page as Notional Example Introduction to HTML and use of Netscape Composer Effective Design Strategies Appropriate to Disseminating Information Tools to Manage Development of Web Pages Introduction to Ada CGI Using ACM WWW and Maillist Facilities Introduction to XML You should now be able to: Use simple web-authoring tools Develop your own Home Page Tailor it to effectively communicate to your audience Establish Home Page on ACM host Use simple web-posting tools Use simple web-verification tools Establish maillists for your activity We are looking for volunteers to “own” portions of the ACM SIGAda Home Page Please contact us if you are interested!


Download ppt "Introduction to Web Technologies for Effective Dissemination of Information 13 November 2000 SIGAda 2000 Mr. Currie Colket SIGAda Vice Chair for Meetings."

Similar presentations


Ads by Google