Ana səhifə

Class and Tool Reference


Yüklə 1.16 Mb.
səhifə1/10
tarix11.06.2016
ölçüsü1.16 Mb.
  1   2   3   4   5   6   7   8   9   10

Class wwServer & Class wwOLEServer

West Wind Web Connection

Class and Tool Reference




Rick Strahl, West Wind Technologies, 1997
Support: http://www.west-wind.com/wwThreads

Overview of the main classes




The image above describes the main framework classes that are implemented in Visual FoxPro code by Web Connection. The four important classes are:


  • wwServer
    This class and the wwOLEServer subclass are responsible for communicating with the Web server handling request routing and passing the input data and output HTTP results between the Web Connection DLL and the Visual FoxPro framework. Also handles logging and all aspects of the visual server window.

  • wwProcess
    This is the 'application' class that will be subclassed by you to handle all your application logic. Each Web request translates into a matching method in this class. While you can write all of your code inside of this class, you can also delegate logic from your entry method to other objects or user defined functions.

  • wwCGI/wwPostRequest
    You use the wwCGI object as your program input. The wwCGI Object abstracts all the incoming data from the Web server. This includes server variables, browser information, HTTP information, HTML form variables and Web Connection status info.

  • wwHTML
    You use the wwHTML object as your program output. The wwHTML class is used to return all output back to the Web server. Output is string based and this class abstracts the interface with a large collection of both high and low level methods for creating HTML and HTTP compliant output.

There are additional classes that are subclasses of these four basic classes as well:




  • wwOLEServer
    This subclass is specific to Automation servers. It essentially overrides wwServer's ProcessHit, Init, Error methods to allow to be able to respond to Automation commands sent by the Web Connection DLL.

  • wwHTMLString
    This subclass of the HTML class keeps output in a result string, rather than sending output to file immediately as the wwHTML class does. wwHTMLString optimizes string output by dumping large strings to disk – disk based output is much faster for multiple concats on strings than memory operations. The interface is identical to wwHTML.

  • wwNetscapeCGI
    This subclass of the CGI class is specific to Netscape servers and works around Netscape's non-standard implementation of the Windows CGI standard.

A number of support classes that are called by these classes and are available for use in your code. Some of the support classes available are:




  • wwAPI
    A class that contains a number of API functions that are used in Web Connection. Includes INI, Registry access, path related functions, Process priority function and more.

  • wwEval
    This class allows safe execution of EVALUATEs as well as providing the ability to run entire programs and routines without requiring the development version of Visual FoxPro. Courtesy of Randy Pearson's CodeBlck class.

  • wwIPStuff
    Provides a number of Internet related functions in a compact DLL with a Visual FoxPro class wrapper. Included are Async and blocking SMTP, FTP Get and Send, HTTP Get for getting Web pages into a string and DNS and reverse DNS lookup.

  • wwHTTPHeader
    This class allows building custom HTTP headers with ease. The class allows for adding individual header strings as well as providing one line access to advanced features such as redirection and Authentication.

  • wwShowCursor
    This powerful class can be used to display table based data in HTML table output with a single method call. It also includes single record display in both ASCII and HTML table output formats.

  • wwSession
    This class allows you to track users through a site by attaching dynamic variables stored in a table to a user. With this mechanism you can implement a state table that can remember settings or filters set on previous requests. Works in conjunction with HTTP Cookies.

  • wwDBFPopup
    This class allows building complex HTML popup boxes that are data driven.

  • wwHTMLForm
    This class allows on the fly display of most Visual FoxPro forms as HTML based forms under Internet Explorer 4.0 (Enterprise Edition only).

Table of Contents


Class and Tool Reference 1

Overview of the main classes 1



Table of Contents 3

Class wwServer & Class wwOLEServer 11

Parent Class: wwServerForm Source: wwServer.prg 11

How it works 11

How to use it 11

Server Setup 12

Implementing your own wwServer class 12

Pathing issues and dealing with multiple setups 14

Exposed Properties: 14

Exposed Methods: 15

wwServer::Init 15

wwServer::Init 15

wwServer::SetServerEnvironment (virtual) 15

wwServer::SetServerEnvironment (virtual) 15

wwServer::SetServerProperties 16

wwServer::SetServerProperties 16

wwServer::ReadSettingsFromIni 16

wwServer::ReadSettingsFromIni 16

wwServer::SetCGIClass 17

wwServer::SetCGIClass 17

wwServer::Show 17

wwServer::Show 17

wwServer :: SetCGIFilePath 18

wwServer :: SetCGIFilePath 18

wwServer :: SetForegroundTasking 18

wwServer :: SetForegroundTasking 18

wwServer :: SetTimerInterval 19

wwServer :: SetTimerInterval 19

wwServer :: SetLogToFile 19

wwServer :: SetLogToFile 19

wwServer :: GetLogToFile 20

wwServer :: GetLogToFile 20

wwServer :: LogEntry 20

wwServer :: LogEntry 20

wwServer :: SetStatusWindow 21

wwServer :: SetStatusWindow 21

wwServer :: SetCGITemplateFile 21

wwServer :: SetCGITemplateFile 21

wwServer :: CleanTempFiles 22

wwServer :: CleanTempFiles 22

wwServer::SendMail 22

wwServer::SendMail 22

wwServer :: CreateSessionEntry 23

wwServer :: CreateSessionEntry 23

wwServer :: KillSessionEntry 23

wwServer :: KillSessionEntry 23

wwServer :: GetSessionCount 24

wwServer :: GetSessionCount 24

wwServer :: GetAppBasePath() 24

wwServer :: GetAppBasePath() 24

Class wwProcess 25

Parent Class: Relation Source: wwProcess.prg 25

How it works 25

Exposed Properties: 27

Exposed Methods 28

wwProcess::Init 28

wwProcess::Init 28

wwProcess::Process (Virtual) 28

wwProcess::Process (Virtual) 28

wwProcess::InitSession 28

wwProcess::InitSession 28

wwProcess::GetAppIniVar 29

wwProcess::GetAppIniVar 29

wwProcess::DisplayFile 30

wwProcess::DisplayFile 30

wwProcess::Error 30

wwProcess::Error 30

wwProcess::StandardPage 30

wwProcess::StandardPage 30

wwProcess::ErrorMsg 31

wwProcess::ErrorMsg 31

Class wwCGI 32

Parent Class: Relation Source: wwCGI.PRG 32

How it works 32

How to use it 32

wwCGI::Init 33

wwCGI::Init 33

wwCGI::LoadCGIFileNames 33

wwCGI::LoadCGIFileNames 33

wwCGI::ServerVariables 33

wwCGI::ServerVariables 33

wwCGI::GetCGIVar 34

wwCGI::GetCGIVar 34

wwCGI::Form 34

wwCGI::Form 34

wwCGI::SetKey 35

wwCGI::SetKey 35

wwCGI::GetFormCheckBox 35

wwCGI::GetFormCheckBox 35

wwCGI::GetFormMultiple 36

wwCGI::GetFormMultiple 36

wwCGI::aFormVars 36

wwCGI::aFormVars 36

wwCGI::GetOutFile 37

wwCGI::GetOutFile 37

wwCGI::GetContentFile 37

wwCGI::GetContentFile 37

wwCGI::QueryString 37

wwCGI::QueryString 37

wwCGI::aCGIParms 38

wwCGI::aCGIParms 38

wwCGI::GetCommandLine 38

wwCGI::GetCommandLine 38

wwCGI::GetPreviousUrl 38

wwCGI::GetPreviousUrl 38

wwCGI::GetCurrentUrl 39

wwCGI::GetCurrentUrl 39

wwCGI::GetServerAdmin 39

wwCGI::GetServerAdmin 39

wwCGI::GetServerName 39

wwCGI::GetServerName 39

wwCGI::GetRemoteAddress 39

wwCGI::GetRemoteAddress 39

wwCGI::GetBrowser 39

wwCGI::GetBrowser 39

wwCGI::IsHTML30 40

wwCGI::IsHTML30 40

wwCGI::IsSecure 40

wwCGI::IsSecure 40

wwCGI::IsLinkSecure 40

wwCGI::IsLinkSecure 40

wwCGI::GetClientCertificate 40

wwCGI::GetClientCertificate 40

wwCGI::GetCookie 41

wwCGI::GetCookie 41

wwCGI::GetRequestMethod 41

wwCGI::GetRequestMethod 41

wwCGI::GetRequestProtocol 41

wwCGI::GetRequestProtocol 41

wwCGI::GetAuthenticatedUser 41

wwCGI::GetAuthenticatedUser 41

wwCGI::GetPhysicalPath 42

wwCGI::GetPhysicalPath 42

wwCGI::GetLogicalPath 42

wwCGI::GetLogicalPath 42

wwCGI::ForcePath 42

wwCGI::ForcePath 42



Class wwPostRequest 43

Parent Class: wwCGI Source: wwPostRequest.prg 43

wCGI::GetMultiPartFile 43

wCGI::GetMultiPartFile 43

wwCGI::GetMultiPartFormVar 44

wwCGI::GetMultiPartFormVar 44



Class wwHTML 45

Parent Class: Relation Source: wwHTML.prg 45

How it works 45

wwHTML Class: Exposed Methods 45

wwHTML::Init 45

wwHTML::Init 45

wwHTML::Destroy 45

wwHTML::Destroy 45

wwHTML::Write 46

wwHTML::Write 46

wwHTML::Send 46

wwHTML::Send 46

wwHTML::SendLn 46

wwHTML::SendLn 46

wwHTML::FastSend 47

wwHTML::FastSend 47

wwHTML::SendPar 47

wwHTML::SendPar 47

wwHTML::SendMemoLn 47

wwHTML::SendMemoLn 47

wwHTML::BreakMemo 48

wwHTML::BreakMemo 48

wwHTML::ShowCursor 48

wwHTML::ShowCursor 48

wwHTML::ExpandTemplate 49

wwHTML::ExpandTemplate 49

wwHTML::ExpandScript 50

wwHTML::ExpandScript 50

wwHTML::EnclosedText 51

wwHTML::EnclosedText 51

wwHTML::HeaderText 52

wwHTML::HeaderText 52

wwHTML::HRef 52

wwHTML::HRef 52

wwHTML::HTMLColor 52

wwHTML::HTMLColor 52

wwHTML::List 53

wwHTML::List 53

wwHTML::DBFPopup 53

wwHTML::DBFPopup 53

wwHTML::ContentTypeHeader 54

wwHTML::ContentTypeHeader 54

wwHTML::HTMLHeader 55

wwHTML::HTMLHeader 55

wwHTML::HTMLFooter 57

wwHTML::HTMLFooter 57

wwHTML::HTMLAuthenticate 57

wwHTML::HTMLAuthenticate 57

wwHTML::HTMLRedirect 58

wwHTML::HTMLRedirect 58

wwHTML::HTMLError 58

wwHTML::HTMLError 58

wwHTML::FormTextBox 59

wwHTML::FormTextBox 59

wwHTML::FormTextArea 59

wwHTML::FormTextArea 59

wwHTML::FormButton 59

wwHTML::FormButton 59

wwHTML::FormRadio 60

wwHTML::FormRadio 60

wwHTML::FormCheckbox 60

wwHTML::FormCheckbox 60

wwHTML::NoOutput 60

wwHTML::NoOutput 60

wwHTML::SetHTTPHeaderClass 61

wwHTML::SetHTTPHeaderClass 61

wwHTML::AutoRefresh 61

wwHTML::AutoRefresh 61

wwHTML::IEChart 62

wwHTML::IEChart 62



Class wwHTMLString 63

Parent Class: wwHTML 63

wwHTML::Init 63

wwHTML::Init 63

wwHTMLString::Send 63

wwHTMLString::Send 63

wwHTML::GetOutput 64

wwHTML::GetOutput 64

wwHTML::SetBufferSize 64

wwHTML::SetBufferSize 64



Class wwShowCursor 65

Parent Class: Relation Source: ShowCursor.prg 65

How it works 65

Paged ShowCursor Display 66

Exposed Properties 68

Exposed Methods 68

wwShowCursor::Init 68

wwShowCursor::Init 68

wwShowCursor::GetOutput 69

wwShowCursor::GetOutput 69

wwShowCursor::ShowCursor 69

wwShowCursor::ShowCursor 69

wwShowCursor::ShowRecord 69

wwShowCursor::ShowRecord 69

wwShowCursor::ShowASCIIRecord 70

wwShowCursor::ShowASCIIRecord 70

wwShowCursor::BuildFieldListHeader 70

wwShowCursor::BuildFieldListHeader 70

wwShowCursor::SetCursor 70

wwShowCursor::SetCursor 70



Class wwDBFPopup 72

Parent Class: Relation Source: DBFPopup 72

How it works 72

Exposed Properties 72

Exposed Methods 73

wwDBFPopup::Init 73

wwDBFPopup::Init 73

wwDBFPopup::GetOutput 73

wwDBFPopup::GetOutput 73

wwDBFPopup::BuildList 73

wwDBFPopup::BuildList 73

wwDBFPopup::Reset 74

wwDBFPopup::Reset 74

Class wwHTTPHeader 75

Parent Class: Relation Source: wwHTML.prg 75

How it works 75

wwHTTPHeader::GetOutput 76

wwHTTPHeader::GetOutput 76

wwHTTPHeader::CompleteHeader 76

wwHTTPHeader::CompleteHeader 76

wwHTTPHeader::ClearHeader 76

wwHTTPHeader::ClearHeader 76

wwHTTPHeader::DefaultHeader 77

wwHTTPHeader::DefaultHeader 77

wwHTTPHeader::SetProtocol 77

wwHTTPHeader::SetProtocol 77

wwHTTPHeader::SetContentType 77

wwHTTPHeader::SetContentType 77

wwHTTPHeader::AddCookie 78

wwHTTPHeader::AddCookie 78

wwHTTPHeader::AddForceReload 78

wwHTTPHeader::AddForceReload 78

wwHTTPHeader::More Methods 79

wwHTTPHeader::More Methods 79

Class wwHTMLForm 80

Parent Class: wwHTMLControl Source: wwForm.prg 80

How to use it: 80

Using the wwForm Wrapper 80

Using the Class 80

How it works: 81

Field and Value mapping 81

HTML and Script hooks 81

Form Submission and Assigning values back to the form 81

Rules of Operation 82

Overriding Object Types with your own Renderers 82

What doesn’t work 83

How to use it: 83

Grids 84


Exposed Properties:
85

Exposed Methods: 86

wwHTMLForm::Init 86

wwHTMLForm::Init 86

wwHTMLForm::GetOutput 87

wwHTMLForm::GetOutput 87

wwHTMLForm::ShowContainer 87

wwHTMLForm::ShowContainer 87

wwHTMLForm::SetValues 87

wwHTMLForm::SetValues 87

wwHTMLForm::OverrideInsertObjectHTML 88

wwHTMLForm::OverrideInsertObjectHTML 88

wwHTMLForm::OverrideSetValue 89

wwHTMLForm::OverrideSetValue 89



Class wwVFPScript 90

Parent Class: Relation Source: wwVFPScript.prg 90

Related Classes: Request, Response, Session, Server 90

How it works 90

A sample script page 92

Accessing Objects – ASP Objects and Web Connection Objects 93

The need to compile 93

Class wwSession 95

Parent Class: Relation Source: wwSession.prg 95

How it works 95

wwSession::Init 97

wwSession::Init 97

wwSession::Reindex 98

wwSession::Reindex 98

wwSession::NewSession 98

wwSession::NewSession 98

wwSession::IsValidSession 98

wwSession::IsValidSession 98

wwSession::SetSessionVar 99

wwSession::SetSessionVar 99

wwSession::GetSessionVar 99

wwSession::GetSessionVar 99

wwSession::GetUserId 99

wwSession::GetUserId 99

wwSession::GetField 100

wwSession::GetField 100

Class wwIPStuff 101

Parent Class: Custom Source: wwIPStuff.vcx 101

How it works 101

How to use it 102

Sending SMTP Mail 102

Sending and receiving files via FTP 102

Retrieving HTTP requests to strings (HTTP GET) 103

Sending and Retrieving HTTP requests to strings (HTTP POST) 103

Sending and Receiving files over HTTP: 103

Domain Name Lookup 104

Exposed Properties: 104

SMTP properties: 104

FTP Properties: 105

HTTP Properties: 105

Exposed Methods: 106

wwIPStuff::Init 106

wwIPStuff::Init 106

wwIPStuff::GetDomainFromIp 106

wwIPStuff::GetDomainFromIp 106

wwIPStuff::GetIPFromDomain 107

wwIPStuff::GetIPFromDomain 107

wwIPStuff::SendMail


wwIPStuff::SendMailAsync 107

wwIPStuff::SendMail


wwIPStuff::SendMailAsync 107

wwIPStuff::FTPGetFile 108

wwIPStuff::FTPGetFile 108

wwIPStuff::FTPSendFile 109

wwIPStuff::FTPSendFile 109

wwIPStuff::FTPDeleteFile 109

wwIPStuff::FTPDeleteFile 109

wwIPStuff::aFTPDir 110

wwIPStuff::aFTPDir 110

wwIPStuff::HTTPGet 110

wwIPStuff::HTTPGet 110

wwIPStuff::HTTPConnect 111

wwIPStuff::HTTPConnect 111

wwIPStuff::HTTPGetEx 111

wwIPStuff::HTTPGetEx 111

wwIPStuff::OnHTTPBufferUpdate 112

wwIPStuff::OnHTTPBufferUpdate 112

wwIPStuff::HTTPGetExAsync 113

wwIPStuff::HTTPGetExAsync 113

wwIPStuff::AddPostKey 114

wwIPStuff::AddPostKey 114

wwIPStuff::HTTPClose 114

wwIPStuff::HTTPClose 114

wwIPStuff::EncodeDBF 115

wwIPStuff::EncodeDBF 115

wwIPStuff::DecodeDBF 115

wwIPStuff::DecodeDBF 115

Low Level HTTP Methods 115

wwIPStuff::RasDial 116

wwIPStuff::RasDial 116

wwIPStuff::RasHangup 116

wwIPStuff::RasHangup 116

wwIPStuff::GetSystemErrorMsg 117

wwIPStuff::GetSystemErrorMsg 117



Class wwFTP 118

Parent Class: wwIPStuff Source: wwIPStuff.vcx 118



Class wwHTTPAsync 119

Parent Class: Timer Source: wwIPStuff.vcx 119

How it works 119

Properties and Methods 119



Class wwHTTPData & wwHTTPFile 121

Parent Class: aHTTPData Source: wwIPStuff.vcx 121

How it works 121

The Client Side 121

The Server Side 122

Security 122

Basic Authentication 123

Secure Sockets Layer (SSL) 123

Uploading Files via HTTP with wwHTTPFile 123

wwHTTPData::Execute 124

wwHTTPData::Execute 124

wwHTTPData::S_Execute 125

wwHTTPData::S_Execute 125

wwHTTPFile::SendFile 125

wwHTTPFile::SendFile 125

wwHTTPFile::S_SendFile 126

wwHTTPFile::S_SendFile 126

Class wwPDF – Adobe Acrobat File Creation 127

Source: wwPDF.prg 127

How to use it: 127

Adobe PDFWriter Configuration 128



Support Classes 130

Class wwAPI 130

Class wwEval 133

Procedure Library wwUtils 136

Function File2Var 136

Function Extract 136

Function MergeText 136

Function AparseString 137

Function Path 137

Function OpenExclusive 137

Functions URLEncode and URLDecode 138

IsComObject 138

RegisterOleServer 138

DCOMCnfgServer 139

Function GetAppStartPath 139

Function DomainName 139

Function GoURL 139

Function ShowHTML 140

Function StripHTML 140

Function HTMLColor 140

Function DateToC 140

Functions JustFname, JustStem, JustExt, JustPath, ForcePath and AddBs 141

Function IsDir 142

Function FileSize 142

Function ProgLevel 142

Function PropertyDump 142

Function InputForm 142

Function PEMStatus 143

Other Tools 144

West Wind Web Monitor 144

Web Server Configuration Component 144

Dependicies: 144

Text Wrapper 145

ScriptMap 145

LogCount 145

  1   2   3   4   5   6   7   8   9   10


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©kagiz.org 2016
rəhbərliyinə müraciət