GetPluginTarget(PluginName: String): IUiCommandTarget;
GetPluginTarget(PluginName: System.String): Prognoz.Platform.Interop.Ui.IUiCommandTarget;
PluginName. Name of plugin in use.
The GetPluginTarget method creates an object that executes command of a specified plugin.
The following plugins are available:
Adm. Administration commands.
Cubes. Multidimensional data source commands.
Db. Table commands.
DevEnv. Development environment object commands.
Dim. Dictionary commands.
Etl. ETL task commands.
Express. The Analytical Queries (OLAP) tool commands.
FactRubricator. The Time Series Analysis tool commands.
Fld. Repository object commands.
MetabaseUpdate. The Update Manager tool commands.
Mobile. Mobile application container commands.
Modeller. Express modeling commands.
Ms. The Modeling and Forecasting tool commands.
Rds. MDM dictionary commands.
Report. The Reports tool commands.
Std. Object navigator commands.
Wsp. The Workspace tool commands.
To execute the example, make sure that the security manager contains the USER user.
Add links to the Metabase, Ui, ForeSystem (for Fore.NET example) system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MbSec: IMetabaseSecurity;
User: ISecuritySubject;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := Mb.RequestLicense(UiLicenseFeatureType.Adm);
MbSec := MB.Security;
User := MbSec.ResolveName("USER");
Target := WinApplication.Instance.GetPluginTarget("Adm");
Context := Target.CreateExecutionContext;
Context.Data := User;
Target.Execute("ShowHoursPolicy", Context);
// Save changes
MbSec.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ui;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
MbSec: IMetabaseSecurity;
User: ISecuritySubject;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
WinApp: WinApplicationClassClass;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := Mb.RequestLicense(UiLicenseFeatureType.lftAdm);
MbSec := MB.Security;
User := MbSec.ResolveName("USER");
WinApp := New WinApplicationClassClass();
Target := WinApp.Instance[Null].GetPluginTarget("Adm");
Context := Target.CreateExecutionContext();
Context.Data := User;
Target.Execute("ShowHoursPolicy", Context, Null);
// Save changes
MbSec.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example a dialog box opens to control access by time for the USER user.
See also: