WebApplication: String;
WebApplication: string;
The WebApplication property determines the path for publishing a mobile application.
The mobile application publishing path is determined by the IPublishMobileApplicationScheduledTask.Publicator property.
The path where a mobile application is published is generated as follows: http://<server name where mobile application is to be published>/<virtual directory name where mobile application is to be published>, for example: http://test/fpMobile_App_v9.2x64.
The virtual directory name where a mobile application is published by default: fpMobile_App_v9.2x64 - only for 64-bit version of Foresight Analytics Platform.
Executing this example requires that the repository contains the following objects: a scheduled tasks container with the TASK_CONT identifier and a mobile application with the MA_PUB identifier.
Add links to the Metabase, Mobile, Fore system assemblies.
Sub UserProc;
Var
mb: IMetabase;
tCont: IScheduledTasksContainer;
cInfo: IMetabaseObjectCreateInfo;
maTask: IPublishMobileApplicationScheduledTask;
MobApp: IMobileApplication;
Begin
mb := MetabaseClass.Active;
// Get scheduled tasks container
tCont := mb.ItemById("TASK_CONT").Edit As IScheduledTasksContainer;
// Create a task of mobile application publishing in the container
cInfo := mb.CreateCreateInfo;
cInfo.ClassId := MetabaseObjectClass.KE_CLASS_TASK_PUBLISHMOBILEAPP;
cInfo.Parent := tCont As IMetabaseObjectDescriptor;
maTask := mb.CreateObject(cInfo).Edit As IPublishMobileApplicationScheduledTask;
// Specify mobile application publishing path
maTask.WebApplication := "http://localhost/fpMobile_App_v9.2x64";
// Specify mobile application publisher
MobApp := mb.ItemById("MA_PUB").Bind As IMobileApplication;
maTask.Publicator := MobApp.CreatePublicator;
// Save publishing task and scheduled tasks container
(maTask As IMetabaseObject).Save;
(tCont As IMetabaseObject).Save;
End Sub UserProc;
Example execution result: the task of mobile application publishing is added to the scheduled tasks container.
Executing the example requires that the repository contains the following objects: a scheduled tasks container with the TASK_CONT identifier and a mobile application with the MA_PUB identifier.
Imports Prognoz.Platform.Interop.KeFore;
Imports Prognoz.Platform.Interop.Mobile;
…
[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
tCont: IScheduledTasksContainer;
cInfo: IMetabaseObjectCreateInfo;
maTask: IPublishMobileApplicationScheduledTask;
MobApp: IMobileApplication;
Begin
mb := Params.Metabase;
// Get scheduled tasks container
tCont := mb.ItemById["TASK_CONT"].Edit() As IScheduledTasksContainer;
// Create a task of mobile application publishing in the container
cInfo := mb.CreateCreateInfo();
cInfo.ClassId := MetabaseObjectClass.KE_CLASS_TASK_PUBLISHMOBILEAPP As Integer;
cInfo.Parent := tCont As IMetabaseObjectDescriptor;
maTask := mb.CreateObject(cInfo).Edit() As IPublishMobileApplicationScheduledTask;
// Specify mobile application publishing path
maTask.WebApplication := "http://localhost/fpMobile_App_v9.2x64";
// Specify mobile application publisher
MobApp := mb.ItemById["MA_PUB"].Bind() As IMobileApplication;
maTask.Publicator := MobApp.CreatePublicator();
// Save publishing task and scheduled tasks container
(maTask As IMetabaseObject).Save();
(tCont As IMetabaseObject).Save();
End Sub;
Example execution result: the task of mobile application publishing is added to the scheduled tasks container.
See also: