AMT Help Files

ILionLabel

This section details the functions and properties of the AMT-COBOL Repository Module Label interface.

Properties

Name   Type   Access   Description  
CreatedTimeDateDateTimeRead onlyReturns the created date/time of the label.
ModifiedTimeDateDateTimeRead onlyReturns the last modified date/time of the label.
Name String Read only Returns the name of the Label.

Functions

Function name Return type Parameters 
Description
Name  Type 
AddSubLabel ILionLabel Object LabelName String Adds new label as sub-label to the current label.
AssignRevision Void  LionObject ILionObject Assigns the specified revision to this label.
When the label already has another revision it will be overwritten by the new one.
Revision  ILionRevision 
   
GetParentLabel ILionLabel Object     Returns the parent label of the current label, or null if the current label has no parent label. 
GetRevision  ILionRevision Object LionObject  ILionObject  Returns an ILionRevision object with revision information of the specified object e.g. "1.2" or "1.2.1.3".
GetSubLabels List of
ILionLabel Objects 
    Returns the sub-labels the current label.
RemoveLabel  Void      Removes the current label (and associated objects) from the repository.
RemoveRevision Void  LionObject  ILionObject  Removed the specified object from this label.

Example

C#


ILionLabel label2 = app.GetLabel("labelb");
Log("Single label: " + label2.Name);

ILionObject report = app.GetLionObject("KOREP", LionObjectType.ReportUser);

ILionRevision initialRev = label.GetRevision(report);
if
(initialRev != null) {
    Log("Current revision: " + report.Name + " " + initialRev.Revision);
} else {
    Log("Report not assigned to label");
}

ILionRevision rev15 = report.GetRevision("1.5");

label.AssignRevision(report, rev15);
label.RemoveRevision(report); // 1.3

ILionLabel label3 = app.AddLabel("DummyLabel");

label3.RemoveLabel();


PowerShell


$O_Label2 = $O_App.GetLabel("labelb")

if ($O_Label2) {
    Write-Host("Single label: " + $O_Label2.Name)
    }

$O_Report = $O_App.GetLionObject("KOREP", 208)

$O_InitialRev = $O_Label.GetRevision($O_Report)

if ($O_InitialRev) {
    Write-Host("Current revision: " + $O_Report.Name + " " + $O_InitialRev)
    } Else {
    Write-Host("Report not assigned to label")
    }

$O_Rev15 = $O_Report.GetRevision("1.5")

$O_Label.AssignRevision($O_Report, $O_Rev15)
$O_Label.RemoveRevision($O_Report)

$O_Label3 = $O_App.AddLabel("DummyLabel")

$O_Label3.RemoveLabel()