IMetabaseCustomClass.OperationsWeb

Syntax

OperationsWeb: IMetabaseCustomClassOperationsWeb;

Description

The OperationsWeb property returns the collection of custom class operations available in the web application.

Example

Executing the example requires that the repository contains four web forms with the F_WEB_CREATE, F_WEB_OPEN, F_WEB_EDIT, F_WEB_CUSTOM identifiers. There is also a unit with the M_WEB_OPERATIONS identifier, in which the WebOperationsClass class implemented for handling operations without visual dependencies. The class should implement methods for handling the PASTE and DELETE system operations.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    Mb: IMetabase;
    CustomClassExtender: IMetabaseCustomExtender;
    CustomClass: IMetabaseCustomClass;
    StdOperationsWeb: IMetabaseCustomClassStandardOperationsWeb;
    Operations: IMetabaseCustomClassOperationsWeb;
    Operation: IMetabaseCustomClassOperationWeb;
Begin
    Mb := MetabaseClass.Active;
    // Get custom class container
    CustomClassExtender := Mb.SpecialObject(MetabaseSpecialObject.CustomExtender).Edit As IMetabaseCustomExtender;
    // Add a custom class
    CustomClass := CustomClassExtender.Classes.Add;
    CustomClass.Id := "CUSTOMOBJECTWEB";
    CustomClass.Name := "Object for web application";
    CustomClass.ImplementationAssembly := MB.ItemById("M_WEB_OPERATIONS");
    CustomClass.ImplementationClass := "WebOperationsClass";
    // Set up system operations
    StdOperationsWeb := CustomClass.StandardOperationsWeb;
    StdOperationsWeb.FindById("CREATEOBJECT").Handler := Mb.ItemById("F_WEB_CREATE");
    StdOperationsWeb.FindById("OPEN").Handler := Mb.ItemById("F_WEB_OPEN");
    StdOperationsWeb.FindById("EDIT").Handler := Mb.ItemById("F_WEB_EDIT");
    // Create a custom operation
    Operations := CustomClass.OperationsWeb;
    Operation := Operations.Add(0);
    Operation.Name := "Operation";
    Operation.Handler := Mb.ItemById("F_WEB_CUSTOM");
    Debug.WriteLine("Identifier of created operation: " + Operation.Id);
    (CustomClassExtender As IMetabaseObject).Save;
End Sub UserProc;

After executing the operation a new object classis created in the custom class container that is used to work in the web application. Basic properties will be determined for the class, the specified web forms will be set to handle system operations. A custom operation will be created, for which a we form will also be set. A unit and class will be specified to handle operations without visual dependencies.

See also:

IMetabaseCustomClass