Developing Customizable and Database-resident Help Scott DeLoach.

Slides:



Advertisements
Similar presentations
Microsoft Expression Web-Illustrated Unit K: Working with Behaviors.
Advertisements

Developing Context-sensitive Help for Web Applications Scott DeLoach.
Developing Database-resident Help for Customizable Web-based Applications Scott DeLoach.
Tutorial 5 Windows and Frames Section A - Working with Windows.
Creating a Login Process Creating a users table and a login form that denies access to unauthorized users.
Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Java Script Session1 INTRODUCTION.
Cookies The HTTP protocol is stateless, that is, it does not maintain information on states after the session ends. But sometimes it is useful to remember.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Session 13 Active Server Pages (ASP) Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
ASP.NET Security MacDonald Ch. 18 MIS 424 MIS 424 Professor Sandvig Professor Sandvig.
1 Active Server Pages Active Server Pages (ASPs) are Web pages ASP = server-side scripts + HTML The appearance of an Active Server Page depends on who.
DT211 Stage 2 Databases Lab 1. Get to know SQL Server SQL server has 2 parts: –A client, running on your machine, in the lab. You access the database.
Master Detail Page Set Enabling Users to See More Detailed Data.
Mark Dixon, SoCCE SOFT 131Page 1 19 – Web applications: Server-side code (ASP)
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
Nu Vendor Management System A web based tool to Manage Vendors.
JavaScript, Fourth Edition
THE BIG PICTURE. How does JavaScript interact with the browser?
State Management. What is State management Why State management ViewState QueryString Cookies.
© Michelle C. Heckman All Rights Reserved. v6.0 Dreamweaver “UltraDev” CS125UDF This course qualifies as a CAS Web Master Related Elective.
Mark Dixon 1 22 – Web applications: Writing data to Databases using ASP.Net.
Mark Dixon Page 1 23 – Web applications: Writing data to Databases using ASP.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
Eurotrace Hands-On The Eurotrace File System. 2 The Eurotrace file system Under MS ACCESS EUROTRACE generates several different files when you create.
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
Chapter 8 Cookies And Security JavaScript, Third Edition.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
1 Maryland ColdFusion User Group Session Management December 2001 Michael Schuler
ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University
Mark Dixon 1 03 – Passing Data between pages: Forms, Sessions, & Query Strings.
HTML Forms.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
Introduction to Client-Side Web Development Introduction to Client-Side programming using JavaScript JavaScript; application examples 10 th February 2005.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
COOKIES and SESSIONS. COOKIES A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each.
Introduction to JavaScript CS101 Introduction to Computing.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
CIS 451: Cookies Dr. Ralph D. Westfall February, 2009.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
Cookies (continue). Extracting Data From Cookies Data retrieved from a cookie is a simple text string. While there is no specific JavaScript function.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
(Some from Chapter 11.9 – “Web” 4 th edition and
1 PHP HTTP After this lecture, you should be able to know: How to create and process web forms with HTML and PHP. How to create and process web forms with.
Web Application Design. Data –What data is available? –How do we store it or how is it stored in the DB? Schema Data types Etc. –Where is the data?
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
Navigation: If the tutorial opens up in your web browser, simply click your mouse to advance to the next slide. Use the “Backspace”
Using databases ActiveX Data Objects (ADO) Connecting to a database Reading data from a database Inserting, updating and deleting records Using databases.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Chapter 4 Java Script – Part2. 2 Location object Properties Properties href – whole path will be displayed. ex: window.location.href ( see example 11)
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
Cookies Tutorial Cavisson Systems Inc..
By Janet Crawford and Dam Luong Submitted to the Faculty of
Presentation transcript:

Developing Customizable and Database-resident Help Scott DeLoach

We will discuss how to provide: personalized secure flexible annotated* Help using JavaScript and ASP * ASP only. Session Overview

Sample application

sample_login.htm

sample_home.htm

JavaScript examples

Does not require a database Does not require IIS (runs on the client) Better learning resources JavaScripts advantages over ASP 3

How to… Hide topics that do not apply to the users job Remember completed sections Remember user settings Personal Help Recognizing users 3

Hiding topics that do not apply to the users job Show admin tutorials if the user logs in as admin sample_tutorial.htm

Hiding topics that do not apply to the users job Code to write the cookie (in sample_login.htm) var today = new Date(); var expires = new Date(today.getTime() + (60 * )); function set() { var cookieID = document.form.name.value; Set_Cookie("security",cookieID,expires); } function Set_Cookie(name,value,expires) { document.cookie = name + "=" + value + "=" + "; path=/" + ((expires==null) ? "" : "; expires=" + expires.toGMTString()); } code for the Submit button: Number of days to store the cookie 4

Hiding topics that do not apply to the users job Code to read the cookie (in sample_tutorial.htm) var cookiecheck=unescape(document.cookie); if (cookiecheck.indexOf('admin') != -1) { document.write(' Admin tutorials How to customize the application '); } 1

Remembering completed sections Show check if the user has completed the section sample_tutorial.htm

Remembering completed sections Code to write to the cookie (in sample_tutoriallogin3.htm) var today = new Date(); var expires = new Date(today.getTime() + (60 * )); function Set_Cookie(name,value,expires) { document.cookie = name + "=" + value + "=" + "; path=/" + ((expires==null) ? "" : "; expires=" + expires.toGMTString()); } … Number of days to store the cookie 2

Remembering completed sections Code to read the cookie (in sample_tutorial.htm) var cookiecheck=unescape(document.cookie); if (cookiecheck.indexOf('checklogin') != -1) document.images['checklogin'].src = "check.gif"; code for the image: 2

Remembering user settings Remember and use selected size sample_tutorial.htm

Remembering user settings Code to open the tutorial (in sample_home.htm) var security=unescape(document.cookie); function opentutorial() { var w=600; var h=400; if (security.indexOf('big') != -1) w=800; h=600; window.open('sample_tutorial.htm','tutorialwin','toolba r=0,location=0,directories=0,status=1,menubar=0,scr ollbars=0,resizable=1,width=' + w + ',height=' + h); } 1

Remembering user settings Code to resize the tutorial (in sample_tutorial.htm) function checksize() { var security=unescape(document.cookie); if (security.indexOf('big') != -1) window.resizeTo(800,600); if (security.indexOf('big') == -1) window.resizeTo(600,400); } … 2

Remembering user settings Code to store the new size (in sample_tutorial.htm) function changesize(size) { var today = new Date(); var expires = new Date(today.getTime() + (60 * )); if (size == "big") { document.cookie = "tutorialsize=big" + "; path=/" + ((expires==null) ? "" : "; expires=" + expires.toGMTString()); window.resizeTo(800,600); } if (size == "normal") { document.cookie = "tutorialsize=normal" + "; path=/" + ((expires==null) ? "" : "; expires=" + expires.toGMTString()); window.resizeTo(600,400); }} Number of days to store the cookie 2

Secure Help Limiting access to topics logins Hide this link if the user is not logged in as admin sample_help.htm

Hiding Links Code to tag links (in sample_help.htm) Customizing the application 1

Hiding Links Code to hide links (in sample_help.htm) var security=unescape(document.cookie); if (security.indexOf('admin') == -1) { for (var i=0; i < document.links.length; i++) { if (document.links[i].id.indexOf("admin") != -1) document.links[i].innerText = ""; }} 2

Flexible Help Modifying topics on the fly sample_help.htm sample_home.htm Field names need to match between application and Help

Modifying topics on the fly Code to tag application elements (in sample_home.htm) Project Number

Modifying topics on the fly Code to read from application and modify Help (in sample_help.htm) var projectnumber = "The " + (opener.document.all.projectnumber.innerText).toLowerCase() + ".... "; // repeat above for each field on page var form = opener.document.forms[0]; for (i= 0; i < form.elements.length-1; i++) { var elemspan = (form.elements[i].name).substr(5); document.write(" " + opener.document.all[elemspan].innerText + " "); document.write(eval(elemspan)); } chops off name_ 2

ASP examples

More secure Database approach more powerful Can reduce browser requirements Does not require cookies for data storage ASPs advantages over JavaScript

How to… Hide topics that do not apply to the users job Remember completed sections Remember user settings Personal Help Recognizing users

Hiding topics that do not apply to the users job Show admin tutorials if the user logs in as admin sample_tutorial.asp

Hiding topics that do not apply to the users job Code to request the users login (in sample_login.asp) Code to store the users login (in sample_home.asp) 2

Hiding topics that do not apply to the users job Code to show/hide topics based on the login (in sample_tutorial.asp) If objRS("ID") = Session("security") Then … If objRS("Custom") <> "N" Then … Response.Write " How to customize the application End If 2

Remembering completed sections Show checks if the user has completed the section sample_tutorial.asp

Remembering completed sections users database (users.mdb) Key: Y (yes)user is authorized to view the section N (no)user is not authorized to view the section C (complete)user has completed the section

Remembering completed sections Code to open the database (in sample_tutoriallogin3.asp) Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\userfirstdemos\db\users.mdb") Dim objRS Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "Tutorial", objConn,, adLockOptimistic, adCmdTable 3

Remembering completed sections Code to write to and close the database (in sample_tutoriallogin3.asp) Do While Not objRS.EOF If objRS("ID") = Session("security") Then objRS("login") = "C" objRS.Update End If objRS.MoveNext Loop objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing

Remembering completed sections Code to mark completed sections (in sample_tutorial.asp) If objRS("login") <> "N" Then If objRS("login") = "C" Then Response.Write " " Else Response.Write " " End If 2

Remembering user settings Remember and use selected size sample_tutorial.asp

Remembering user settings Help database (fieldhelp.mdb) Note: HlpText is used to store defaults. HlpTextCustom is used to store modified Help topics.

Remembering user settings Code to set the window size (in sample_tutorial.asp) big... If Request.QueryString = "big" Then Do While Not objRS.EOF If objRS("ID") = Session("security") Then objRS("size") = "big" Response.Write " Call window.resizeTo(800, 600) " objRS.MoveNext Loop End If 3

Remembering user settings Code to change the window size (in sample_tutorial.asp) If Request.QueryString = "" Then Do While Not objRS.EOF If objRS("ID") = Session("security") Then If objRS("size") = "big" Then Response.Write " Call window.resizeTo(800, 600) " If objRS("size") = "normal" Then Response.Write " Call window.resizeTo(600, 400) " End If objRS.MoveNext Loop End If 2

Secure Help Limiting access to topics Hide this link if the user is not logged in as admin sample_help.htm

Hiding Links Code to hide links (in sample_help.asp) <% If Session("security") = "admin" Then Response.Write Customizing the application " End If %> 1

Flexible Help Modifying topics on the fly sample_help.asp sample_home.asp Field names need to match between application and Help

Modifying topics on the fly (in sample_help.htm) Do While Not objRS.EOF Response.Write " " & objRS("FieldLabel") & " " If objRS("HlpTextCustom") <> "" Then Response.Write objRS("HlpTextCustom") & " " Else If objRS("HlpText") <> "" Then Response.Write objRS("HlpText") & " " Else Response.Write "No Help has been written for this field. " End If objRS.MoveNext Loop 4

Annotated Help Allowing users to modify/add topics fieldhelp.asp Administrators see the edit button, which they can use to add or change the field Help topics. fieldhelp_edit.asp

Modifying/Adding Help topics Code to show field Help (in fieldhelp.asp) Do While Not objRS.EOF If Request.QueryString = objRS("FieldID") Then If objRS("HlpTextCustom") <> "" Then Response.Write " "& objRS("FieldLabel") & " " & objRS("HlpTextCustom") Else Response.Write " "& objRS("FieldLabel") & " " & objRS("HlpText") End If objRS.MoveNext Loop 3

Modifying/Adding Help topics Code to show Edit button (in fieldhelp.asp) If Session("security") = "admin" Then _ Response.Write " " 3

Modifying/Adding Help topics Code to display the Edit form (1 of 2) (in fieldhelpedit.asp) Do While Not objRS.EOF If Request.QueryString = objRS("FieldID") Then Response.Write " "& objRS("FieldLabel") & " " Response.Write " " If objRS("HlpTextCustom") <> "" Then Response.Write " " & objRS("HlpTextCustom") & " " Else Response.Write " " & objRS("HlpText") & " " End If 3

Modifying/Adding Help topics Code to display the Edit form (2 of 2) (in fieldhelpedit.asp) … Response.Write " " End If objRS.MoveNext Loop 1

Modifying/Adding Help topics Code to update the Help (in fieldhelpupdate.asp) Do While Not objRS.EOF If Request.QueryString = objRS("FieldID") Then If Request.Form("helptext") <> "" Then objRS("HlpTextCustom") = Request.Form("helptext") objRS.Update End If objRS.MoveNext Loop 1

Wrapping Up

JavaScript sample files (zipped and live) ASP sample files (zipped and live) www27.brinkster.com/userfirstdemos/index.html (Brinkster is a free ASP hosting site, so it goes down from time to time.) Both versions (zipped only) This presentation and notes about both versions Viewing and downloading the sample files

JavaScript Visual Quickstart Guide Tom Negrino and Dori Smith Designing with JavaScript Nick Heinle and Bill Peña JavaScript Bible and JavaScript Examples Danny Goodman Recommended JavaScript books

Teach Yourself Active Server Pages in 21 Days Scott Mitchell and James Atkinson VBScript in a Nutshell Matt Childs, Paul Lomax, & Ron Petrusha Recommended VBScript and ASP books

Feel free to me. Or, catch me later at the conference! Scott DeLoach Founding Partner, User First Services, Inc. Certified RoboHELP Instructor and Consultant CIW Master Designer Questions?