vfpweb

Information about vfpweb

Published on September 18, 2007

Author: FunSchool

Source: authorstream.com

Content

Visual FoxProDatabase Publishing on the Internet :  Visual FoxPro Database Publishing on the Internet by Rick Strahl West Wind Technologies http://www.west-wind.com/ Internet Development:  Internet Development Businesses are expanding their operations onto the Internet Internet Development is exploding Active, Database Applications are in high demand Why build Web Applications?Issues that make the Web hot:  Why build Web Applications? Issues that make the Web hot Distribute widely Administer centrally Universal Client Interface Application Platform of the future Limitations of Web ApplicationsOr: Two steps forward, one step back...:  Limitations of Web Applications Or: Two steps forward, one step back... Configuration issues Interface limitations of HTML Indirect data accesss through server Mostly non-visual development Server based programming model Slide5:  Browser provides the Active interface Web Server provides data / application connectivity The Internet Server API (ISAPI) is the building block for server side extensions Slide6:  Web Browser Displays HTML Server side Client side Web server Static HTML Pages ‘TheWall’ Dynamic Data and Database How the Active Web Works Slide7:  Web Server HREF='/cgi-bin/cgi.exe?Parms' Common Gateway Interface Traditional Web Interface New system process for each instance of script. (relatively slow, resource intensive) Slide8:  Web Server HREF='/scripts/isapi.dll?parms' MyISAPI (1,2..n) (Multithreaded, In-Process DLL) Loads DLL once after which it stays resident, processing multiple requests simultaneously. OtherISAPI (Multithreaded, In-Process DLL) Internet Server API (ISAPI) Extending the Architecture within the Server Slide9:  ODBC MAPI Internet Server API (ISAPI) The extension interface for IIS Getting StartedWhat you need for building Web apps:  Getting Started What you need for building Web apps Fast Pentium box (133Mhz/32-64megs) WindowsNT (recommended) Web Server Connector Interface/Application Web browser Basic HTML skills Everything can run on 1 box! Connecting Visual FoxPro DataSome of the tools available for IIS:  Connecting Visual FoxPro Data Some of the tools available for IIS Active Server Pages (IIS 3.0) FoxISAPI connector (OLE) West Wind Web Connection (ISAPI/OLE) Active Server Pages (IIS 3.0)Server side scripting for IIS:  Active Server Pages (IIS 3.0) Server side scripting for IIS Object Based Architecture Tight integration with IIS Database Connectivity with Active Data Objects (ADO) Supports external object creation Several sophisticated objects are built-in Active Server ArchitectureComponents Galore:  ASP.DLL (ISAPI Extension) Active Server Architecture Components Galore Active Data Objects (ODBC) Response/Request Objects (Input and Output) Server Object (System Services) Scripting Engine (VBScript/JavaScript) Session/Application Objects (Keeping State) Active Data Objects:  Active Data Objects Lightweight ODBC Connector Implements OLE DB (ODBC 3.5) Based on Visual Basic’s Remote Data Object It’s fast especially when tied to a persistent connection object! Implemented as Automation Object. Slide15:  ASP Scripting Engine HTML containing VBScript code Web Server ADO Data Object (ODBC Data Access) OLE DLL Server (InProcess) OLE EXE Server (OutOf Process) TClass::Tmethod() Automation Server Access HREF='MyPage.ASP' Active Server Summary:  Active Server Summary Pros: Tight Integration with IIS No hassle configuration Very easy for simple active content Cons: Code Management Automation Server Scalability Scripting Language Limitations FoxISAPIConnecting VFP Automation servers:  FoxISAPI Connecting VFP Automation servers Direct link from Web pages ISAPI DLL creates persistent Automation object DLL does equivalent of: Passes form vars in parameter Passes server vars in INI file oServer=CREATEOBJECT('TOleServer.TOleClass') oServer.YourMethod('UserId=1','c:\temp\fox2.ini') Slide18:  Web Server FOXISAPI.DLL (HREF='foxisapi.dll/Server.Class.Method') multithreaded/running InProcess Visual FoxPro OLE Server (loaded once then stays in memory) Method1 Method2 Methodn passes HTML Form Data returns HTML Document How FoxISAPI works Slide19:  DEFINE CLASS TFoxISAPI AS Custom OLEPUBLIC FUNCTION Helloworld LPARAMETER lcFormVars, lcIniFile, lnReleaseFlag LOCAL lcOutput #DEFINE CR CHR(13)+CHR(10) *** HTTP header - REQUIRED on each request! *** System Defines lcOutput='HTTP/1.0 200 OK'+CR+; 'Content-type: text/html'+CR+CR lcOutput=lcOutput+; 'andlt;HTMLandgt;andlt;BODYandgt;'+CR+; 'andlt;H1andgt;Hello World from Visual FoxProandlt;/H1andgt;andlt;HRandgt;'+CR+; 'This page was generated by Visual FoxPro...andlt;HRandgt;'+CR+; 'andlt;/HTMLandgt;andlt;/BODYandgt;' RETURN lcOutput ENDDEFINE HREF='/scripts/foxisapi.dll/TDevCon.TFoxIsapi.Helloworld?' Hello World with FoxISAPI FoxISAPI Method Rules:  FoxISAPI Method Rules Must take 3 parameters lcFormVar - HTML Form vars or ‘parameters’ passed on the URL lcIniFile - filename containing server var lnReleaseFlag - Set to keep or release server reference. Must return HTTP compliant output HTML document including HTTP header Use custom HTTP headers for things like authentication, redirection, Cookies etc. Set up for FoxISAPI:  Set up for FoxISAPI OLE Server must be registered Copy FoxISAPI.dll into script dir Directory must have Web Server Execute rights set! Run DCOMCnfg on NT 4.0 Add IUSR_ account to default rights Set user to Interactive user on the specific server Need to re-run whenever server is rebuilt FoxISAPI OLE Instancing:  FoxISAPI OLE Instancing InProcess DLL Very fast Only 1 VFP server can be InProcess MultiUse (Out of Process EXE) Slightly slower Multiple different servers Single Use Use for multiple pooled servers Same server can be instanced more than once Starter FoxISAPI classProvided on the CD:  Starter FoxISAPI class Provided on the CD Send/SendLn() Send text to output StandardPage() Generates a full HTML page ContentTypeHeader() Adds HTTP header StartRequest() Called to set up a request. Decodes input vars and clears the output property. GetFormVar() Retrieves a form variable passed in with the first parameter. GetCGIVar() Retrieves a server/browser variable from the INI file. ReleaseServer() Standard method that releases the OLE server. Slide24:  * TFoxISAPI :: TestMethod FUNCTION TestMethod LPARAMETER lcFormVars, lcIniFile, lnReleaseFlag LOCAL lcOutput, lcUserId, lcName *** Decode the Form Vars and assign INI file to class property THIS.StartRequest(lcFormVars,lcIniFile) *** Must always add a content Type Header to output first THIS.HTMLContentTypeHeader() lcUserId=THIS.GetFormVar('UserId') lcName=THIS.GetFormVar('UserName') THIS.SendLn('andlt;HTMLandgt;andlt;BODYandgt;') THIS.SendLn('andlt;H1andgt;Hello World from Visual FoxProandlt;/H1andgt;andlt;HRandgt;') THIS.SendLn('The current time is: '+time()+'andlt;pandgt;') THIS.SendLn('andlt;bandgt;Encoded Form/URL variables:andlt;/bandgt; '+lcFormVars+'andlt;BRandgt;') THIS.SendLn('andlt;bandgt;Decoded UserId:andlt;/bandgt; '+ lcUserId+'andlt;pandgt;') THIS.SendLn([To retrieve the Browser use ]+; [THIS.GetCGIVar('HTTP_USER_AGENT','ALL_HTTP'): ]+; THIS.GetCGIVar('HTTP_USER_AGENT','ALL_HTTP') ) THIS.SendLn('andlt;HRandgt;andlt;/HTMLandgt;andlt;/BODYandgt;') RETURN THIS.cOutput HREF='/scripts/foxisapi.dll/TDevCon.TFoxIsapi.TestMethod?' Method example with FoxISAPI class Slide25:  FoxISAPI Summary Pros: Full support for Visual FoxPro Real Development Environment Excellent performance Cons: Difficult First Time Configuration No Web specific code support Doesn’t run on non-ISAPI servers or Windows ‘95 West Wind Web Connection:  West Wind Web Connection Extensive Visual FoxPro framework for Web development Support for multiple sessions Works with Automation and File based messaging interchangeably Scalable across multiple machines Real-time, live debugging Server Management Slide27:  Web Browser Web Server Visual FoxPro Data Server (already loaded) Database HTML Document HTML Link wc.dll (ISAPI) Server and Form Data returns HTML Doc FoxPro User Code Scripted HTML Web Connection Data Server Slide28:  wwServer Visual FoxPro form class handles request routing on incoming requests. invokes wwServer::Process() Routes request to your PRG file MyPRG creates new Process object and calls Process method CGIProcess Class Contains MyMethod() that creates HTML output. Class can contain multiple methods. Returns HTML object To process this URL: wc.dll?MyPRG~MyMethod How your code gets called Slide29:  wwServer Visual FoxPro form that’s an OLEPUBLIC Automation Object or uses a timer to poll for requests on disk. How your code gets called Creates Process Object returns HTML object DEFINE CLASS MyProcess... Procedure Process loCGI=THIS.oCGI lcParam=loCGI.GetParam(1) *** Any ‘global processing’ here *** Check for Cookies, User Ids etc. *** Route to appropriate method CASE PEMSTATUS(THIS,lcParam,5) =EVAL('THIS.'+lcParam+'()') RETURN PROCEDURE CUSTLIST andlt;Your processing goes hereandgt; andlt;Create HTML document fileandgt; RETURN Web Connection FrameworkSome of the features available:  Web Connection Framework Some of the features available Class framework for easy access to CGI/HTML functionality Solid error handling scheme Hit Logging, Mulitple Session Management and Maintainence Routines HTML scripting from files or memos Single method output of tables to HTML Built-in support for many advanced HTML/HTTP features Slide31:  Sample Processing Code Tools summary:  Tools summary Check out Active Server for sophisticated server scripting and connectivity to VFP via Auto servers For more control use Visual FoxPro as a Web data server FoxISAPI provides powerful OLE connectivity with an easy interface For a complete Fox based Web environment check out Web Connection Slide33: 

Related presentations


Other presentations created by FunSchool

Got Discipline PowerPoint
18. 06. 2007
0 views

Got Discipline PowerPoint

InterAccess
30. 04. 2008
0 views

InterAccess

lockin1
28. 04. 2008
0 views

lockin1

IIEF MCX
22. 04. 2008
0 views

IIEF MCX

MapAccNov01
18. 04. 2008
0 views

MapAccNov01

ICW Presentation
17. 04. 2008
0 views

ICW Presentation

Lecture 9 Macro model
16. 04. 2008
0 views

Lecture 9 Macro model

ATE12
14. 04. 2008
0 views

ATE12

TeAM NEF ESF Report
13. 04. 2008
0 views

TeAM NEF ESF Report

SAEA06Robinson
10. 04. 2008
0 views

SAEA06Robinson

Larose
09. 04. 2008
0 views

Larose

dairybreeds
19. 10. 2007
0 views

dairybreeds

hex
18. 09. 2007
0 views

hex

infocom2001sfb
18. 09. 2007
0 views

infocom2001sfb

2003 Student Info System IBM
18. 09. 2007
0 views

2003 Student Info System IBM

Fine Art and Literature
13. 10. 2007
0 views

Fine Art and Literature

cell3
15. 10. 2007
0 views

cell3

opel
19. 10. 2007
0 views

opel

horrocks
23. 10. 2007
0 views

horrocks

yang45
15. 10. 2007
0 views

yang45

GGFpart2
28. 11. 2007
0 views

GGFpart2

Sunken backbone game
10. 10. 2007
0 views

Sunken backbone game

BrandtPadua
16. 10. 2007
0 views

BrandtPadua

Lectures4 5 Ch2
07. 11. 2007
0 views

Lectures4 5 Ch2

vugia emerging
23. 10. 2007
0 views

vugia emerging

1a co clustering
19. 11. 2007
0 views

1a co clustering

mobopts 5
01. 12. 2007
0 views

mobopts 5

majoranastatus
10. 12. 2007
0 views

majoranastatus

Northern Renaissance Art
14. 12. 2007
0 views

Northern Renaissance Art

world Hunger
13. 08. 2007
0 views

world Hunger

unconscious Origins
13. 08. 2007
0 views

unconscious Origins

Vending Ala Carte
13. 08. 2007
0 views

Vending Ala Carte

weaning mice
13. 08. 2007
0 views

weaning mice

Xiushi Yang
13. 08. 2007
0 views

Xiushi Yang

LarsonWelcome
16. 10. 2007
0 views

LarsonWelcome

Ken stellar halo
15. 11. 2007
0 views

Ken stellar halo

African Union 2050
23. 12. 2007
0 views

African Union 2050

frfin
12. 10. 2007
0 views

frfin

Bhutan Hunger presentation RCC
04. 01. 2008
0 views

Bhutan Hunger presentation RCC

10 31 05 chaps 15 16
02. 11. 2007
0 views

10 31 05 chaps 15 16

HAtrash
15. 10. 2007
0 views

HAtrash

gti pmgti
24. 10. 2007
0 views

gti pmgti

Uniform Wear
18. 09. 2007
0 views

Uniform Wear

Lsn 6 Maya and Inca
20. 11. 2007
0 views

Lsn 6 Maya and Inca

monster
21. 11. 2007
0 views

monster

campusmap
28. 12. 2007
0 views

campusmap

wolson presentation
17. 10. 2007
0 views

wolson presentation

thurston
09. 10. 2007
0 views

thurston

compfpm flood plain functions
03. 01. 2008
0 views

compfpm flood plain functions

jeff kephart 11 03
18. 09. 2007
0 views

jeff kephart 11 03

LACEApresJZ1
26. 10. 2007
0 views

LACEApresJZ1

Wedding PP Presntation attach
27. 11. 2007
0 views

Wedding PP Presntation attach

RHCh1
20. 02. 2008
0 views

RHCh1

MATERIAL HANDLING PREVIEW
26. 02. 2008
0 views

MATERIAL HANDLING PREVIEW

unaids
13. 08. 2007
0 views

unaids

tgs04b
18. 09. 2007
0 views

tgs04b

about
28. 09. 2007
0 views

about

CPPStudyPhysicalProt ection
19. 11. 2007
0 views

CPPStudyPhysicalProt ection

nliwiSCS
12. 10. 2007
0 views

nliwiSCS

TurfBMP81704
14. 02. 2008
0 views

TurfBMP81704

CAlbala
22. 10. 2007
0 views

CAlbala

LT SLIDE show
11. 03. 2008
0 views

LT SLIDE show

marie curie jenam june 2005
13. 03. 2008
0 views

marie curie jenam june 2005

volcanoes group5
25. 03. 2008
0 views

volcanoes group5

gusev
15. 10. 2007
0 views

gusev

Parent Presentation predators
01. 01. 2008
0 views

Parent Presentation predators

Williams Tanzania
13. 08. 2007
0 views

Williams Tanzania

PrelimI
07. 10. 2007
0 views

PrelimI

personalities
12. 10. 2007
0 views

personalities

MeetingFreightDataCh allenges
28. 02. 2008
0 views

MeetingFreightDataCh allenges

04 19 SW
29. 10. 2007
0 views

04 19 SW

APP The American Experience WK3
17. 12. 2007
0 views

APP The American Experience WK3

062507
04. 03. 2008
0 views

062507

wedekind
08. 10. 2007
0 views

wedekind

IZMO CONCIERGE
30. 10. 2007
0 views

IZMO CONCIERGE

eh wellseptic
07. 11. 2007
0 views

eh wellseptic

20070114 sanog9 apnic update
27. 03. 2008
0 views

20070114 sanog9 apnic update

ATCNewswireCatalogue EN Q207
02. 10. 2007
0 views

ATCNewswireCatalogue EN Q207

db pres okutani whois
09. 10. 2007
0 views

db pres okutani whois

hotchips 2004 motes
18. 06. 2007
0 views

hotchips 2004 motes

gww sid july27
18. 06. 2007
0 views

gww sid july27

eolson AUV2004
18. 06. 2007
0 views

eolson AUV2004

EMS Stake holders
18. 06. 2007
0 views

EMS Stake holders

edinburgh condor tutorial
18. 06. 2007
0 views

edinburgh condor tutorial

dztalk 3
18. 06. 2007
0 views

dztalk 3

dw olap
18. 06. 2007
0 views

dw olap

Digital Photos Hitchcock
18. 06. 2007
0 views

Digital Photos Hitchcock

DGov transform wo notes web
18. 06. 2007
0 views

DGov transform wo notes web

defense
18. 06. 2007
0 views

defense

palais 04
18. 09. 2007
0 views

palais 04

chop06
29. 10. 2007
0 views

chop06

MISR images Aug2001
21. 10. 2007
0 views

MISR images Aug2001

PresentacionGobCorp2 003
22. 10. 2007
0 views

PresentacionGobCorp2 003

cmc2q06
18. 09. 2007
0 views

cmc2q06

AfricanAmericans A Z
03. 10. 2007
0 views

AfricanAmericans A Z

Proper KeyBoarding Technique
15. 06. 2007
0 views

Proper KeyBoarding Technique

Dinosaurs
15. 06. 2007
0 views

Dinosaurs

Memories
15. 06. 2007
0 views

Memories

Like - Having Different Hobbies
15. 06. 2007
0 views

Like - Having Different Hobbies

humanity
15. 06. 2007
0 views

humanity

Volcanoes are Hot Stuff
15. 06. 2007
0 views

Volcanoes are Hot Stuff

China2005NoAnimation
23. 10. 2007
0 views

China2005NoAnimation

BTL Statistics2005
18. 09. 2007
0 views

BTL Statistics2005

Dillon
18. 06. 2007
0 views

Dillon

infovis03 talk slides
18. 09. 2007
0 views

infovis03 talk slides

Block 6 Basler Ausschuss
16. 10. 2007
0 views

Block 6 Basler Ausschuss

scarlett 28oct05
18. 09. 2007
0 views

scarlett 28oct05

barrier
18. 09. 2007
0 views

barrier

SNIMA BTP
24. 10. 2007
0 views

SNIMA BTP

familyweek3
24. 02. 2008
0 views

familyweek3

rutkowska bheurope2006
18. 09. 2007
0 views

rutkowska bheurope2006

ATA2007 US MA MReyna
23. 10. 2007
0 views

ATA2007 US MA MReyna

P Jonson AIC
18. 10. 2007
0 views

P Jonson AIC

Denver 05b
18. 06. 2007
0 views

Denver 05b

6 WP4 TRT
20. 03. 2008
0 views

6 WP4 TRT

Enigma1
31. 12. 2007
0 views

Enigma1

P416 Lec5 S07
27. 09. 2007
0 views

P416 Lec5 S07

mulligan
18. 09. 2007
0 views

mulligan