Web Resource (PRIM_CLRC)

The abstract class describing the resource delivered by a webroutine

Ancestors - Object (PRIM_OBJT)


A Web Resource is a component instance used to describe the output of a WebRoutine as a Response Object.


This example shows a typical file download routine.
Rather than the data being returned as a BLOB, it is returned in a Response Object so that the browser can deal with it as an object.
The BLOB is read from the file and attached to the Response Object as the ContentFile.
Webroutine Name(DownloadImage) Response(#Response)
   Web_Map For(*Input) Fields(#Empno)
   Fetch Fields(#GiveName #Surname) From_File(pslmst) With_Key(#empno)
   If_Status Is(*okay)
      Fetch Fields(#empimg) From_File(pslimg) With_Key(#empno)
   If_Status Is(*okay)
      #Response.ContentFile := #Empimg.Filename
      #Response.AttachmentFileName := #Surname + #GiveName + #Empno


AttachmentFileNameSave the file with a suggested name
CharsetSpecify a character set override
ComponentClassNameComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembersComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternNameComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
ComponentTagGeneric space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentTypeComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeNameComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
CompressionSet as true to use gzip encoding to compress the file
ContentFileFile name to be served
ContentStringString to be served
ContentTypeOverride the default file content type derived from the extension
HttpStatusHTTP status code
NameName identifies the component Inherited from Object (PRIM_OBJT)
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentThe component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)
RemoveFileRemove the file after it is sent to the user agent


CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from Web Resource (PRIM_CLRC)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Web Resource (PRIM_CLRC)


AddHeaderAdd a custom HTTP header
Name, Value

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2