IAuditFilterCondition.ObjectKey

Синтаксис

ObjectKey(Index: Integer): Integer;

ObjectKey[Index: integer]: integer;

Параметры

Index. Индекс позиции. Количество ключей определяется свойством. IAuditFilterCondition.ObjectKeyCount.

Описание

Свойство ObjectKey определяет ключ объекта, для которого будут отображаться записи протокола.

Пример

Для выполнения примера предполагается наличие в репозитории отчета с идентификатором «Report».

Добавьте ссылки на системные сборки: Metabase, ForeSystem (для примера на Fore.NET).

Sub UserProc;
Var
    Mb: IMetabase;
    Log: IAuditLog;
    Con: IAuditFilterCondition;
    Fil: IAuditFilter;
    objectKey: Integer;
    operations: IAuditOperations;
    Lic: Object;
    d: DateTime;
Begin
    Mb := MetabaseClass.Active;
    Lic := Mb.RequestLicense(UiLicenseFeatureType.Adm);
    Log := Mb.Security.OpenAuditLog;
    Fil := Log.Filter;
    
If Fil.Count <= 0 Then
        Con := Fil.Add;
    
Else
        Con := Fil.Item(
0);
    
End If;
    Con.IncludeFailedLogons := 
False;
    Con.IncludeSucceededLogons := 
False;
    objectKey := MB.ItemById(
"Report").Key;
    Con.ObjectKeyCount := 
1;
    Con.ObjectKey(
0) := objectKey;
    operations := Log.OpenOperationTree(-
1, -1);
    
While Not operations.Eof Do
        Debug.Write(operations.Name + 
"; ");
        d := DateTime.FromDouble(operations.Stamp);
        Debug.WriteLine(d.ToString + 
";");
        operations.Next;
    
End While;
    operations.Eof;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;
Imports 
Prognoz.Platform.Interop.ForeSystem;

Public
 Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    Log: IAuditLog;
    Con: IAuditFilterCondition;
    Fil: IAuditFilter;
    objectKey: Integer;
    operations: IAuditOperations;
    Lic: Object;
    d: System.DateTime;
Begin
    Mb := Params.Metabase;
    Lic := Mb.RequestLicense(UiLicenseFeatureType.lftAdm);
    Log := Mb.Security.OpenAuditLog();
    Fil := Log.Filter;
    
If Fil.Count <= 0 Then
        Con := Fil.Add();
    
Else
        Con := Fil.Item[
0];
    
End If;
    Con.IncludeFailedLogons := 
False;
    Con.IncludeSucceededLogons := 
False;
    objectKey := MB.ItemById[
"Report"].Key As integer;
    Con.ObjectKeyCount := 
1;
    Con.ObjectKey[
0] := objectKey;
    operations := Log.OpenOperationTree(-
1, -1);
    
While Not operations.Eof() Do
        System.Diagnostics.Debug.Write(operations.Name + 
"; ");
        d := DateTime.FromOADate(operations.Stamp);
        System.Diagnostics.Debug.WriteLine(d.ToString() + 
";");
        operations.Next();
    
End While;
    operations.Eof();
End Sub;

После выполнения примера в консоли будет отображен список операций, производимых над объектом. Для каждой операции будет выведено название, дата и время.

См. также:

IAuditFilterCondition