![]() | Products |
| Home » Technical Support » Elevate Web Builder Technical Support » Product Manuals » Elevate Web Builder 3 Manual » Using the Web Server » Web Server Applications |

unit extnamespacemain;
interface
{ You need to include the ewbextmodule unit in the uses clause }
uses SysUtils, ewbextmodule;
type
{ Here we define the various types used in the namespace that we are
exposing to the Elevate Web Builder interpreter, including the namespace
class itself }
TMyNamespaceType = (ntNone,ntInternal,ntLibrary);
{ You can only register one namespace per module, and the namespace
class must descend from the TEWBExternalModuleNamespace class.
In addition, any properties that you wish to be visible to the
Elevate Web Builder interpreter must be included in the published
scope. Any public methods will automatically be visible in the
Elevate Web Builder interprepter because the ancestor
TEWBExternalModuleNamespace class is marked with the
$METHODINFO ON compiler directive }
TMyExternalModuleNamespace = class(TEWBExternalModuleNamespace)
private
FID: Integer;
FValue: String;
FNamespaceType: TMyNamespaceType;
public
procedure TestProcedure(ID: Integer;
const Value: String;
NamespaceType: TMyNamespaceType);
function TestFunction(ID: Integer): TMyNamespaceType;
published
property ID: Integer read FID write FID;
property Value: String read FValue write FValue;
property NamespaceType: TMyNamespaceType read FNamespaceType
write FNamespaceType;
end;
implementation
{ This variable will hold the global instance of the namespace class instance }
var
MyExternalModuleNamespace: TMyExternalModuleNamespace;
procedure TMyExternalModuleNamespace.TestProcedure(ID: Integer;
const Value: String;
NamespaceType: TMyNamespaceType);
begin
FID:=ID;
FValue:=Value;
FNamespaceType:=NamespaceType;
end;
function TMyExternalModuleNamespace.TestFunction(ID: Integer): TMyNamespaceType;
begin
if (ID=FID) then
Result:=FNamespaceType
else
Result:=ntNone;
end;
{ Here we create the namespace class instance and assign it a type alias
for the TMyNamespaceType enumerated type so that the Elevate Web Builder
interpreter can refer to the type using a more normalized name }
initialization
MyExternalModuleNamespace:=TMyExternalModuleNamespace.Create;
RegisterExternalModule(MyExternalModuleNamespace);
RegisterExternalTypeAlias('TMyNamespaceType','TNamespaceType');
finalization
UnregisterExternalModule;
FreeAndNil(MyExternalModuleNamespace);
end.unit extnamespace;
interface
type
{ Enumerated Types }
external TNamespaceType = (ntNone, ntInternal, ntLibrary) module extnamespace;
{ Routines }
external procedure TestProcedure(ID: Integer; const Value: String; NamespaceType: TNamespaceType) module extnamespace;
external function TestFunction(ID: Integer): TNamespaceType module extnamespace;
{ Variables }
var
external ID: Integer module extnamespace;
external Value: String module extnamespace;
external NamespaceType: TNamespaceType module extnamespace;
implementation
end.| Method | Description |
| SendContentHeader | Sends a response for a HEAD request. |
| SendCustomContentHeader | Sends a custom content response for a HEAD request. |
| SendContent | Sends a UTF-8-encoded text response with a Content-Type header of "text/html; charset=utf-8" along with an optional status code and message. |
| SendCustomContent | Sends a UTF-8-encoded text response with a custom content type, encoding, and disposition. |
| SendRedirect | Sends a redirect response to a new URL along with an optional UTF-8-encoded text response with a Content-Type header of "text/html; charset=utf-8". By default, the redirect HTTP status code is 302, but you can specify a different status code. |
| SendError | Sends a status code and message along with an optional UTF-8-encoded text response with a Content-Type header of "text/plain; charset=utf-8". |
| SendContentStream | Sends a UTF-8-encoded text stream response with a Content-Type header of "text/html; charset=utf-8" along with an optional status code and message. |
| SendCustomContentStream | Sends a binary stream response with a custom content type, encoding, and disposition. |
| SendContentFile | Sends a file response with a custom content type, encoding, and disposition. |
This web page was last updated on Tuesday, September 16, 2025 at 04:56 PM | Privacy Policy © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

