S/Web Objects

Home S/Web Description S/Web Overview S/Web Installation S/Web Features S/Web Functions S/Web Objects S/Web Settings S/Web Troubleshoot S/Web FAQ S/Web Appendices

Cache Client Document LH Repository Request Response Server Session

 

Links on this page:
 

Properties

Methods

Document

This object handles information relating to a repository based document.

Properties:

Property Get/Set Description
CACHEGet/SetDefines whether all documents are cached.
COMPRESSIONGet/SetDefines whether all documents are compressed.
XVERSIONGetContains the current S/Web version

Methods:

call www_Exec_Method( "DOCUMENT", method, param1, param2, param3, param4, param5 )

Method Description 
Opens the handle of the WWW_DOCUMENT file and places it in the wwwDocumentHandle@ S/Web common variable.

Note: This method should not be called by the end user!
Retrieves properties for the current document object
Reads a document stored in the repository. 
Purges the current document cache. 
Sets properties of the current client object. 

[top]

Create method

This method should not be called by the end user!

Argument Description 
param1  Not used.
param2  Not used.
param3  Not used.
param4  Not used. 
param5  Not used. 

[top]

GET method

This method retrieves properties for the DOCUMENT object.

ArgumentDescription 
param1  An @RM list of properties to retrieve
param2  An @RM list of retrieved property values.
param3  Not used. 
param4  Not used. 
param5  Not used. 

Example:

   declare function www_Exec_Method, www_Get_Status, www_Set_Status
   $insert www_Status_Equates    $insert logical
   Properties  =   "COMPRESSION"
   Properties  :=  @RM : "CACHE"
   if www_Exec_Method( "GET", Properties, RetVals, "", "", "", "", errorText ) then
      CompressionVal  =  Field( RetVals, @RM, 1 )
      CacheVal        =  Field( RetVals, @RM, 2 )
   end else
      abort = TRUE$
   end

[top]

READ method

This function reads the document from file. As a document may be > 64K the example below shows a loop to retrieve a large document. In real life if you know the document is < 64K you may just issue a single document READ.

ArgumentDescription 
param1  The document type (HTML, JS, CSS, etc)
param2  Document object name.
param3  Returned document. 
param4  Defined properties in repository for this document
param5  Current buffer number. 
param6Total number of buffers

Example:

   declare function www_Exec_Method, www_Get_Status, www_Set_Status
   $insert www_Status_Equates
   $insert logical

   ......
   loop
      www_Exec_Method( "DOCUMENT", "READ", classID, docID, docBuffer, docProperties, docBufferNo,
          docBufferCount )
      if www_Get_Status( errorText ) then
         abort  = TRUE$
      end else
         call www_Exec_Method( "RESPONSE", "SETCONTENT", docBuffer, "+" )
         docBufferNo += 1
         if ( docBufferNo > docBufferCount ) then
            eofDocument = TRUE$
         end
      end
    until ( eofDocument or abort )
    repeat
    if abort then
      goSub setStdError
    end else
      * // Now set the content type ...
      thisData = docProperties<WWW_REPOSITORY$HTTP_CONTENT_TYPE$>
      if len( thisData ) then
          call www_Set_Property( "RESPONSE", "CONTENTTYPE", thisData )
          if www_Get_Status( errorText ) then
             abort = TRUE$
             goSub   setStdError
          end
       end
     end

[top]

PURGE method

This function purges the client cache table

Argument Description 
param1  If Logical True then clear disk cache as well
param2  Not used. 
param3  Not used. 
param4  Not used. 
param5  Not used. 
param6Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
......
PurgeDisk  =  True$
www_Exec_Method( "DOCUMENT", "PURGE", PurgeDisk, "", "", "", "", ErrorText)

[top]

SET method

This function sets properties in the document object.

Argument Description 
param1  An @RM list of properties to retrieve
param2  An @RM list of retrieved property values.
param3  An @RM list of original property values.
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
*  Turn compression on, but stop caching documents.
Properties  =   "COMPRESSION"
Properties  :=  @RM : "CACHE"
Values      =   True$
Values      :=  False$   
if www_Exec_Method( "SET", Properties, RetVals, OrigRetVals, "", "", "", errorText ) then
   OrigCompressionVal  =  Field( OrigRetVals, @RM, 1 )
   OrigCacheVal        =  Field( OrigRetVals, @RM, 2 )
end else
   abort = TRUE$
end

[top]

Copyright © 2005 The Sprezzatura Group. All rights reserved.