IMobileApplicationPublicator.Version

Fore Syntax

Version: Integer;

Fore.NET Syntax

Version: integer;

Description

The Version property returns version of publication format.

Comments

By default, publication format version is 1.

Fore Example

Executing the example requires that the repository contains a mobile application container with the MAC identifier.

Add links to the Metabase, Mobile system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Mobile: IMobileApplication;
    Publicator: IMobileApplicationPublicator;
    res: MobilePublishResult;
Begin
    mb := MetabaseClass.Active;
    // Get published mobile application (MA)
    Mobile := mb.ItemById("MAC").Bind As IMobileApplication;
    // Create a mobile application publisher 
    Publicator := Mobile.CreatePublicator;
    // Specify web server and virtual directory for publishing mobile application
    Publicator.WebApplication := "http://prognoz/PPMobile_App";
    // Publish mobile application
    Publicator.Execute(Null);
    // Handle results of mobile application publication
    If res = MobilePublishResult.Ok Then
        Debug.WriteLine("Publication is successful. Publication format version: " + Publicator.Version.ToString);
    Else
        Debug.WriteLine("Error occurred on publishing");
    End If;
End Sub UserProc;

After executing the example the MAC mobile application container is published. The console window shows a message about publication result.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Mobile;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Mobile: IMobileApplication;
    Publicator: IMobileApplicationPublicator;
    res: MobilePublishResult;
Begin
    mb := Params.Metabase;
    // Get published mobile application (MA)
    Mobile := mb.ItemById["MAC"].Bind() As IMobileApplication;
    // Create a mobile application publisher 
    Publicator := Mobile.CreatePublicator();
    // Specify web server and virtual directory for publishing mobile application
    Publicator.WebApplication := "http://prognoz/PPMobile_App";
    // Publish mobile application
    Publicator.Execute(Null);
    // Handle results of publishing mobile application
    If res = MobilePublishResult.mprOk Then
        System.Diagnostics.Debug.WriteLine("Publishing was successful. "
            + "Publication format version: " + Publicator.Version.ToString());
    Else
        System.Diagnostics.Debug.WriteLine("Error occurred on publishing");
    End If;
End Sub;

See also:

IMobileApplicationPublicator