


WEB
Version 0.95

A Component to do Webbing...






















(C) 1995 By E. Cipolloni 
Preliminary Version - NOT to be released
Basically, the WEB component has the capability to retrieve WEB page from whatever WEB server by using very simple properties and method, without taking care of the underlying TCP/IP connection.

The current version support only a true connection under TCP/IP, next version will also support downloading from a file.

Also, before starting the Delphi environment, make sure that your TCP/IP software and stack is up and running (or better, that your networking protocols are running). WEB support the Microsft WINSOCK DLL, since I'm using standard Winsock calls this should work under other stacks, but I'm not sure. Please report about this.

I've no time to produce a better documentation than a mere list of Properties and Method, final release will have a more decent one.

Properties:

BasePath
BytesSent
BytesLeft
Completed
DocClass
DocDateTime
DocLen
DocType
*DocumentName
FileStreamName
HttpVersion
HttpResponse
*Method
MimeVersion
Page
Pipe
*Proxy
*ProxyPort
ServerDateTime
Size
Stream
*URL
*UseProxy
UseFileStream
*UseStream
Warning
*WebHost
*WebPort
*WebService
* These properties are modifiable using the Object Inspector

Methods:

Abort
PageClear
RecvBuf
RecvText
Retrieve
SendBuf
SendText

Event handlers:


OnConnect
OnDisconnect
OnInfo
OnRead
OnWrite

Properties Description


Property Name: BasePath
Description: Retrieve or sets the Base Path for the current document
Parameters: On Read/Write: the string containing the base path
Read: string variable
Write: string variable

Property Name: BytesSent
Description: Retrieve the num of  bytes sent by the Web control Web
Parameters: None
Read: longint variable
Write: Not available

Property Name: BytesLeft
Description: Retrieve the num of bytes that are left  to read from the current doc
Parameters: None
Read: longint variable
Write: Not available

Property Name: Completed
Description: Retrieve the percentage of document reading completed
Parameters: None
Read: integer variable
Write: Not available

Property Name: DocClass
Description: Retrieve the class of the current document (first part of MIME field) 
Parameters: None
Read: string variable
Write: Not available

Property Name: DocDateTime
Description: Retrieve the date/time creation of the current document (from Header)
Parameters: None
Read: string variable
Write: Not available

Property Name: DocLen
Description: Retrieve the length (in bytes) fo the current document
Parameters: None
Read: longint variable
Write: Not available



Property Name: DocType
Description: Retrieve the type of the current document (second part of MIME field)
Parameters: None
Read: string variable
Write: Not available

Property Name: DocumentName
Description: Retrieve or Sets the name of the current document or the one to retrieve
Parameters: On Read: NONE; On Write: string variable
Read: string variable
Write: string variable

Property Name: FileStreamName
Description: Retrieve or Sets the name of the file where to document must be saved to
Parameters: On Read: NONE; On Write: string variable
Read: string variable
Write: string variable

Property Name: HttpVersion
Description: Retrieve the version of HTTP specification followed by the document
Parameters: None
Read: real variable
Write: Not available

Property Name: HttpResponse
Description: Retrieve the response of the HTTP daemon returned in the Header
Parameters: None
Read: string variable
Write: Not available

Property Name: Method
Description: Retrieve or Sets the Method you want to apply to the URL
Parameters: On Read: None; On Write: string: ('HEAD', 'GET', 'POST');
Read: string variable
Write: string variable

Property Name: MimeVersion
Description: Retrieve the version of MIME specification followed by the document
Parameters: None
Read: real variable
Write: Not available







Property Name: Page
Description: contains the current document broken into a TStringList
Parameters: None
Read: TStringList variable
Write: Not available
Note: you can read from the string list while the document is retrieving

Property Name: Pipe
Description: Retrieve or Send text from/to the Web Service
Parameters: On Read: string variable; On Write: string variable;
Read: string variable
Write: string variable

Property Name: Proxy
Description: Retrieve or Sets the Proxy Address or Name
Parameters: On Read: name/address of  Proxy; On Write: name/address of Proxy
Read: string variable
Write: string variable
Note: the control can discern automatically from ADDRESS and NAME

Property Name: ProxyPort
Description: Retrieve or Sets the port to be used when connecting to Proxy gateway
Parameters: On Read: the port number; On Write: the port number
Read: integer variable
Write: integer variable

Property Name: ServerDateTime
Description: retrieve the Date and Time from the HTTP server (taken from Header)
Parameters: None
Read: string variable
Write: Not available

Property Name: Size
Description: Retrieve the document size
Parameters: None
Read: lognint variable
Write: Not available

Property Name: Stream
Description: Contains the current document in a TMemoryStream variable
Parameters: None
Read: TMemoryStream variable
Write: Not available

Property Name: URL
Description: Retrieve or Sets the URL for the current document
Parameters: On Read: a string with the URL; On Write: same as On Read;
Read: string variable
Write: string variable
Property Name: UseProxy
Description: Retrieve or Sets the use of a Proxy gateway
Parameters: On Read: a boolean value; On Write: a boolean value
Read: boolean value;
Write: boolean value

Property Name: UseFileStream
Description: Decide where the document is stored (MemoryStream or FileStream)
Parameters: On Read: a boolean value; On Write: a boolean value  
Read: boolean value
Write: boolean value

Property Name: UseStream
Description: Decide where the document is stored (Stream or String list)
Parameters: On Read: a boolean value; On Write: a boolean value  
Read: boolean value
Write: boolean value

Property Name: Warning
Description: Retrieve returned warning from the HTTPD server
Parameters: None
Read: string variable
Write: Not available

Property Name: WebHost
Description: Retrieve or Sets the name of the Host Web 
Parameters: On Read: Name/Address of Host; On Write: Name/Address of Host
Read: string variable
Write: string variable

Property Name: Webport
Description: Retrieve or Sets the port of the Host Web 
Parameters: On Read: port of Host; On Write: port of Host
Read: integer variable
Write: integer variable

Property Name: WebService
Description: Retrieve or Sets the name of the service you request from the Web Server 
Parameters: On Read/Write: service name ('HTTP', 'GOPHER', 'FTP')
Read: string variable
Write: string variable


Methods Description:


Method Name: Abort
Description: Stops immediately reading from the Host and shuts down 
Parameters: None
Read: Not available
Write: Not Available

Method Name: Page Clear
Description: Clear all the strings contained in the Page property
Parameters: None
Read: Not available
Write: Not available

Method Name: RecvBuf(var buf; count : integer) : integer;
Description: Receive from Host (generally in response of a OnRead event)
Parameters: buf: a char buffer; count: how many characters you to read
Read: return num of chars actually read
Write: Not available

Method Name: RecvText : string;
Description: Receive from Host (generally in response of a OnRead event)
Parameters: None
Read: return the string actually read
Write: Not available

Method Name: Retrieve
Description: Open connection to Host and apply the method you request
Parameters: None
Read: Not available
Write: Not available

Method Name: SendBuf(var buf; count integer) : integer;
Description: Send the characters contained in a buffer
Parameters: bar: the buffer to send; the num of char to send
Read: returns the num of chars actually sent
Write: Not available

Method Name: SendText(s : string)
Description: Sends the text contained in the string S
Parameters: S: the string to send
Read: None
Write: string variable

Event Handlers Description:

Event Name: OnConnect
Description: This event is called whenever the control has logged to the Host.
                     May be useful to give feedback to the user

Event Namae: OnDisconnect
Description: This event is executed when the Host shuts down the communcation
                     channel. This usually means that the transmission of the document\
                     is finished.

Event Name: OnInfo
Description: This event is executed whenever the Web control has info about the
                     document to be retrieved. Some Host send this before sending the
                     actual document, other not (you should use a HEAD method first).
                     The Web control is designed to actually control both situations.

Event Name: OnRead
Description: This event is executed whenever the Web control begin effectively to
                     read effective document data (Header is excluded from document). This
                     event is usel to give feedback to user, to read data from the control

Event name: OnWrite
Description: This event is executed whenever the control is about to write data out





Sorry for this really brief explanation, but I've not really much time to write documentaion. Attached to this you will find an example Program which, I hope, will give you better chances to understands the working with the Web Component.




Please report bugs and suggestion to:

Emanuele Cipolloni

Leviathan@dlep1.itg.ti.com




Thank you, and enjoy webbing !!!!!!!!!
