AddLanerToFactors(Laner: );
AddLanerToFactors(Laner: Prognoz.Platform.Interop.Laner.);
Laner. Workbook of the time series database.
The AddLanerToFactors method sets the selection for the elements from the specified workbook.
To deselect all elements, use the IMobilePublishRubricator.ClearFactors method.
Executing the example requires that the repository contains a mobile application with the MA_PUB identifier. Add links to the Metabase, Mobile, Express, and Laner system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Mobile: IMobileApplication;
Publicator: IMobileApplicationPublicator;
MaPubObs: IMobileApplicationPublishObjects;
i, j: Integer;
MaPubObj, LanPubObj: IMobileApplicationPublishObject;
PubObj: IMobilePublishObject;
RubPubObj: IMobilePublishRubricator;
Eax: IEaxAnalyzer;
Laner: ILaner;
res: MobilePublishObjectResult;
Begin
mb := MetabaseClass.Active;
// 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);
// Select among objects of time series database
If MaPubObj.Type = MobilePublishObjectType.Rubricator Then
PubObj := MaPubObj.PublishObject;
RubPubObj := PubObj As IMobilePublishRubricator;
// Clear the current selection
RubPubObj.ClearFactors;
For j := 0 To MaPubObs.Count - 1 Do
LanPubObj := MaPubObs.Item(j);
// Choose workbooks among the objects
If LanPubObj.Type = MobilePublishObjectType.Laner Then
// Set the selection for workbook series
Eax := LanPubObj.PublishObject.Object As IEaxAnalyzer;
Laner := Eax.Laner As ILaner;
RubPubObj.AddLanerToFactors(Laner);
End If;
End For;
// Specify the path for publishing
PubObj.ExportPath := "C:\" + PubObj.Object.Id + ".zip";
// Publish working time series database
res := PubObj.Publish;
// Display result in the console window
If (res As integer) = 0 Then
Debug.WriteLine("Publishing was successful").
Debug.WriteLine(" Publishing path: " + PubObj.ExportPath);
Else
Debug.WriteLine("Error occurred on publishing").
End If;
End If;
End For;
End Sub UserProc;
Example execution result: all time series databases in the mobile application have the selection according to the workbooks from this mobile application.
Executing the example requires that the repository contains a mobile application with the MA_PUB identifier.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Mobile;
…
[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Mobile: IMobileApplication;
Publicator: IMobileApplicationPublicator;
MaPubObs: IMobileApplicationPublishObjects;
i, j: Integer;
MaPubObj, LanPubObj: IMobileApplicationPublishObject;
PubObj: IMobilePublishObject;
RubPubObj: IMobilePublishRubricator;
Eax: IEaxAnalyzer;
Laner: LanerFactory;
res: 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];
// Select among objects of the time series database
If MaPubObj.Type = MobilePublishObjectType.mpotRubricator Then
PubObj := MaPubObj.PublishObject;
RubPubObj := PubObj As IMobilePublishRubricator;
// Clear the current selection
RubPubObj.ClearFactors();
For j := 0 To MaPubObs.Count - 1 Do
LanPubObj := MaPubObs.Item[j];
// Select workbooks among the objects
If LanPubObj.Type = MobilePublishObjectType.mpotLaner Then
// Set the selection for workbook series
Eax := LanPubObj.PublishObject.Object As IEaxAnalyzer;
Laner := Eax.Laner As LanerFactory;
RubPubObj.AddLanerToFactors(Laner);
End If;
End For;
// Specify path for publishing
PubObj.ExportPath := "C:\" + PubObj.Object.Id + ".zip";
// Publish working time series database
res := PubObj.Publish(Null);
// Display result in the console window
If (res As integer) = 0 Then
System.Diagnostics.Debug.WriteLine("Publishing was successful").
System.Diagnostics.Debug.WriteLine(" Publishing path: " + PubObj.ExportPath).
Else
System.Diagnostics.Debug.WriteLine("Error occurred on publishing").
End If;
End If;
End For;
End Sub;
Example execution result: all time series databases in the mobile application have the selection according to the workbooks from this mobile application.
See also: