IMobilePublishObject.ExtErrorCode

Fore Syntax

ExtErrorCode: Integer;

Fore.NET Syntax

ExtErrorCode: integer;

Description

The ExtErrorCode property returns code of the message indicating error on converting a topobase.

Comments

The ExtErrorCode property returns converting error for the user.

Fore Example

Executing the example requires that the repository contains a mobile application with the MA_PUB identifier containing an express report with a map. Add links to the Metabase, Mobile system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Mobile: IMobileApplication;
    Publicator: IMobileApplicationPublicator;
    MaPubObs: IMobileApplicationPublishObjects;
    result, i: Integer;
    MaPubObj: IMobileApplicationPublishObject;
    PubObj: IMobilePublishObject;
    EaxPubObj: IMobilePublishAnalyzer;
Begin
    mb := MetabaseClass.Active;
    // Get published mobile application (MA)
    Mobile := mb.ItemById("MA_PUB").Bind As IMobileApplication;
    // Create a mobile application publisher 
    Publicator := Mobile.CreatePublicator;
    // Get mobile application objects
    MaPubObs := Publicator.Items;
    For i := 0 To MaPubObs.Count - 1 Do
        MaPubObj := MaPubObs.Item(i);
        If MaPubObj.IsValid Then
            PubObj := MaPubObj.PublishObject;
            //Search for express report
            If MaPubObj.Type = MobilePublishObjectType.Analyzer Then
                EaxPubObj := PubObj As IMobilePublishAnalyzer;
                If PubObj.Object.ClassId = MetabaseObjectClass.KE_CLASS_EXPRESSREPORT Then
                    //Publish object
                    result := PubObj.Publish(Null);
                    Debug.WriteLine("Express report: " + PubObj.Object.Name);
                    Debug.WriteLine("Publication result: " + result.ToString);
                    If result = MobilePublishObjectResult.AnalyzerMapTopobaseError Then
                        Debug.WriteLine("Converting error:" + PubObj.ExtErrorCode.ToString);
                        Else Debug.WriteLine("No error on converting");
                    End If;
                End If;
            End If;
        End If;
    End For;
End Sub UserProc;

Example execution result: the console window displays information about the error occurred on converting a topobase.

Fore.NET Example

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Mobile;

...

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Mobile: IMobileApplication;
    Publicator: IMobileApplicationPublicator;
    MaPubObs: IMobileApplicationPublishObjects;
    i: Integer;
    MaPubObj: IMobileApplicationPublishObject;
    PubObj: IMobilePublishObject;
    EaxPubObj: IMobilePublishAnalyzer;
    result: MobilePublishObjectResult;
Begin
    mb := Params.Metabase;
    // Get mobile application 
    Mobile := mb.ItemById["MA_PUB"].Bind() As  IMobileApplication;
    // Create a mobile application publisher 
    Publicator := Mobile.CreatePublicator();
    // Get mobile application objects
    MaPubObs := Publicator.Items;
    For  i := 0 To  MaPubObs.Count - 1 Do
        MaPubObj := MaPubObs.Item[i];
        If MaPubObj.IsValid Then
            PubObj := MaPubObj.PublishObject;
            //Search for express report
            If  MaPubObj.Type = MobilePublishObjectType.mpotAnalyzer Then
                EaxPubObj := PubObj As IMobilePublishAnalyzer;
                If PubObj.Object.ClassId As MetabaseObjectClass = MetabaseObjectClass.KE_CLASS_EXPRESSREPORT Then
                    //Publish object
                    result := PubObj.Publish(Null);
                    System.Diagnostics.Debug.WriteLine("Express report: " + PubObj.Object.Name);
                    System.Diagnostics.Debug.WriteLine("Publication result: " + result.ToString());
                    If result = MobilePublishObjectResult.mporAnalyzerMapTopobaseError Then
                        System.Diagnostics.Debug.WriteLine("Converting error:" + PubObj.ExtErrorCode.ToString());
                    Else System.Diagnostics.Debug.WriteLine("No error on converting");
                    End If;
                End If;
            End If;
        End If;
    End For;
End Sub;

Example execution result: the console window displays information about the error occurred on converting a topobase.

See also:

IMobilePublishObject