Class

TTemplate

Module

uTemplates

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Inherits from

TObject

Declaration


TTemplate = class(TObject)
private
  FDescriptionLoaded: boolean;  // Template Notes Loaded Flag
  FDescription: string;         // Template Notes
  FCreatingChildren: boolean;   // Flag used to prevent infinite recursion
  FExclude: boolean;            // Exclude from group boilerplate
  FActive: boolean;
  FDisplayOnly: boolean;        // Suppresses checkbox in dialog - no PN text
  FFirstLine: boolean;          // Display only the first line in a dialog box
  FOneItemOnly: boolean;        // Allow only one Child Item to be selected in dialog
  FHideDlgItems: boolean;       // Hide Child Items when not checked
  FHideItems: boolean;          // Hide items in Templates Drawer Tree
  FIndentItems: boolean;        // Indent Items in dialog only
  FLock: boolean;               // Locks Shared Templates
  FDialog: boolean;             // Determines if Group is a Dialog
  FBoilerPlateLoaded: boolean;  // Boilerplate Loaded Flag
  FBoilerplate: string;         // Boilerplate
  FID: string;                  // Template IEN
  FPrintName: string;           // Template Name
  FItems: TList;                // Holds pointers to children templates
  FNodes: TStringList;          // Holds tree nodes that reference the template
                                // string value is tmp index used for syncing
  FRealType: TTemplateType;     // Real Template Type (from the template file)
  FGap: integer;                // Number of blank lines to insert between items
  FChildren: TTemplateChildren; // flag indicating the active status of children
  FPersonalOwner: Int64;        // owner DUZ
  FExpanded: boolean;           // Indicates children have been read from server
  FTag: longint;                // Used internally for syncing
  FLastTagIndex: longint;       // Used internally for syncing
  FBkup: TTemplateBackup;       // Backup values to determine what needs to be saved
  FLastDlgCnt: longint;
  FLastUniqueID: longint;
  FDialogAborted: boolean;      // Flag indicating Cancel was pressed on the dialog
  fReminderDialog: string;      // Reminder Dialog IEN ^ Reminder Dialog Name
  FIsReminderDialog: boolean;   // Flag used internally for setting Type
  FIsCOMObject: boolean;        // Flag used internally for setting Type
  FLocked: boolean;             // Flag Indicating Template is locked
  FCOMObject: integer;          // COM Object IEN
  FCOMParam: string;            // Param to pass to COM Object
  FFileLink: string;            // Used to link templates to Titles and Reasons for Request
  FLinkName: string;
  FCloning: boolean;            // Flag used to prevent locking during the cloning process
  FPreviewMode:  boolean;       // Flag to prevent "Are you sure you want to cancel?" dialog when previewing
protected
  function TrueClone: TTemplate;
  function GetItems: TList;
  function GetTemplateType: TTemplateType;
  function GetBoilerplate: string;
  function GetChildren: TTemplateChildren;
  procedure SetTemplateType(const Value: TTemplateType);
  procedure SetBoilerplate(Value: string);
  function GetText: string;
  procedure SetPersonalOwner(Value: Int64);
  procedure SetActive(const Value: boolean);
  procedure SetDisplayOnly(const Value: boolean);
  procedure SetFirstLine(const Value: boolean);
  procedure SetOneItemOnly(const Value: boolean);
  procedure SetHideDlgItems(const Value: boolean);
  procedure SetHideItems(const Value: boolean);
  procedure SetIndentItems(const Value: boolean);
  procedure SetLock(const Value: boolean);
  procedure SetExclude(const Value: boolean);
  procedure SetDialog(const Value: boolean);
  procedure SetGap(const Value: integer);
  procedure SetPrintName(const Value: string);
  procedure SetRealType(const Value: TTemplateType);
  procedure ClearBackup(ClearItemIENs: boolean = TRUE);
  procedure SetDescription(const Value: string);
  function GetDescription: string;
  function GetDialogAborted: boolean;
  procedure SetReminderDialog(const Value: string);     // Reminder Dialog IEN
  procedure SetCOMObject(const Value: integer);
  procedure SetCOMParam(const Value: string);
  procedure AssignFileLink(const Value: string; Force: boolean);
  procedure SetFileLink(const Value: string);
  function ValidID: boolean;
public
  constructor Create(DataString: string);
  class function CreateFromXML(Element: IXMLDOMNode; Owner: string): TTemplate;
  destructor Destroy; override;
  function CanModify: boolean;
  procedure Unlock;
  procedure AddNode(Node: Pointer);
  procedure RemoveNode(Node: Pointer);
  procedure AddChild(Child: TTemplate);
  procedure RemoveChild(Child: TTemplate);
  function Clone(Owner: Int64): TTemplate;
  function ItemBoilerplate: string;
  function FullBoilerplate: string;
  function ItemIENs: string;
  procedure BackupItems;
  procedure SortChildren;
  function Changed: boolean;
  function DialogProperties(Parent: TTemplate = nil): string;
  function DlgID: string;
  function IsDialog: boolean;
  function CanExportXML(Data, Fields: TStringList; IndentLevel: integer = 0): boolean;
  function ReminderDialogIEN: string;
  function ReminderDialogName: string;
  function ReminderWipe: string; //AGP Change 24.8
  function IsLocked: boolean;
  procedure UpdateImportedFieldNames(List: TStrings);
  //function COMObjectText(const DefText: string = ''; DocInfo: string = ''): string;
  function COMObjectText(DefText: string; var DocInfo: string): string;
  function AutoLock: boolean;
  function LinkType: TTemplateLinkType;
  function LinkIEN: string;
  function LinkName: string;
  procedure ExecuteReminderDialog(OwningForm: TForm); 
  property Nodes: TStringList read FNodes;
  property ID: string read FID;
  property PrintName: string read FPrintName write SetPrintName;
  property RealType: TTemplateType read FRealType write SetRealType;
  property TemplateType: TTemplateType read GetTemplateType write SetTemplateType;
  property Active: boolean read FActive write SetActive;
  property DisplayOnly: boolean read FDisplayOnly write SetDisplayOnly;
  property FirstLine: boolean read FFirstLine write SetFirstLine;
  property OneItemOnly: boolean read FOneItemOnly write SetOneItemOnly;
  property HideDlgItems: boolean read FHideDlgItems write SetHideDlgItems;
  property HideItems: boolean read FHideItems write SetHideItems;
  property IndentItems: boolean read FIndentItems write SetIndentItems;
  property Lock: boolean read FLock write SetLock;
  property Exclude: boolean read FExclude write SetExclude;
  property Dialog: boolean read FDialog write SetDialog;
  property Boilerplate: string read GetBoilerplate write SetBoilerplate;
  property Children: TTemplateChildren read GetChildren;
  property Items: TList read GetItems;
  property Gap: integer read FGap write SetGap;
  property Description: string read GetDescription write SetDescription;
  property Text: string read GetText;
  property PersonalOwner: Int64 read FPersonalOwner write SetPersonalOwner;
  property Expanded: boolean read FExpanded write FExpanded;
  property Tag: longint read FTag write FTag;
  property LastTagIndex: longint read FLastTagIndex write FLastTagIndex;
  property DialogAborted: boolean read GetDialogAborted;
  property ReminderDialog: string read fReminderDialog write SetReminderDialog;
  property IsReminderDialog: boolean read FIsReminderDialog write FIsReminderDialog;
  property IsCOMObject: boolean read FIsCOMObject write FIsCOMObject;
  property Locked: boolean read FLocked;
  property COMObject: integer read FCOMObject write SetCOMObject;
  property COMParam: string read FCOMParam write SetCOMParam;
  property FileLink: string read FFileLink write SetFileLink;
  property TemplatePreviewMode: boolean read FPreviewMode write FPreviewMode;
end;

Class Hierarchy


TObject
 └TTemplate

Class Fields

Name Type Scope Comments
FActive Boolean Private -
FBkup Private Backup values to determine what needs to be saved
FBoilerplate UnicodeString Private Boilerplate
FBoilerPlateLoaded Boolean Private Boilerplate Loaded Flag
FChildren Private Flag indicating the active status of children
FCloning Boolean Private Flag used to prevent locking during the cloning process
FCOMObject Integer Private COM Object IEN
FCOMParam UnicodeString Private Param to pass to COM Object
FCreatingChildren Boolean Private Flag used to prevent infinite recursion
FDescription UnicodeString Private Template Notes
FDescriptionLoaded Boolean Private Template Notes Loaded Flag
FDialog Boolean Private Determines if Group is a Dialog
FDialogAborted Boolean Private Flag indicating Cancel was pressed on the dialog
FDisplayOnly Boolean Private Suppresses checkbox in dialog - no PN text
FExclude Boolean Private Exclude from group boilerplate
FExpanded Boolean Private Indicates children have been read from server
FFileLink UnicodeString Private Used to link templates to Titles and Reasons for Request
FFirstLine Boolean Private Display only the first line in a dialog box
FGap Integer Private Number of blank lines to insert between items
FHideDlgItems Boolean Private Hide Child Items when not checked
FHideItems Boolean Private Hide items in Templates Drawer Tree
FID UnicodeString Private Template IEN
FIndentItems Boolean Private Indent Items in dialog only
FIsCOMObject Boolean Private Flag used internally for setting Type
FIsReminderDialog Boolean Private Flag used internally for setting Type
FItems TList Private Holds pointers to children templates
FLastDlgCnt LongInt Private -
FLastTagIndex LongInt Private Used internally for syncing
FLastUniqueID LongInt Private -
FLinkName UnicodeString Private -
FLock Boolean Private Locks Shared Templates
FLocked Boolean Private Flag Indicating Template is locked
FNodes TStringList Private Holds tree nodes that reference the template
FOneItemOnly Boolean Private Allow only one Child Item to be selected in dialog
FPersonalOwner Int64 Private Owner DUZ
FPreviewMode Boolean Private Flag to prevent "Are you sure you want to cancel?" dialog when previewing
FPrintName UnicodeString Private Template Name
FRealType Private
String value is tmp index used for syncing

 Real Template Type (from the template file)
FReminderDialog UnicodeString Private Reminder Dialog IEN ^ Reminder Dialog Name
FTag LongInt Private Used internally for syncing

Properties

Name Type Scope Comments
Active Boolean Public -
Boilerplate UnicodeString Public -
Children Public -
COMObject Integer Public -
COMParam UnicodeString Public -
Description UnicodeString Public -
Dialog Boolean Public -
DialogAborted Boolean Public -
DisplayOnly Boolean Public -
Exclude Boolean Public -
Expanded Boolean Public -
FileLink UnicodeString Public -
FirstLine Boolean Public -
Gap Integer Public -
HideDlgItems Boolean Public -
HideItems Boolean Public -
ID UnicodeString Public -
IndentItems Boolean Public -
IsCOMObject Boolean Public -
IsReminderDialog Boolean Public -
Items TList Public -
LastTagIndex LongInt Public -
Lock Boolean Public -
Locked Boolean Public -
Nodes TStringList Public -
OneItemOnly Boolean Public -
PersonalOwner Int64 Public -
PrintName UnicodeString Public -
RealType Public -
ReminderDialog UnicodeString Public -
Tag LongInt Public -
TemplatePreviewMode Boolean Public -
TemplateType Public -
Text UnicodeString Public -

Constructors

Name Declaration Scope Comments
Create constructor Create(DataString: string); Public TTemplate

Destructors

Name Declaration Scope Comments
Destroy destructor Destroy; override; Public -

Methods

Name Declaration Scope Comments
AddChild procedure AddChild(Child: TTemplate); Public -
AddNode procedure AddNode(Node: Pointer); Public -
AssignFileLink procedure AssignFileLink(const Value: string; Force: boolean); Protected -
AutoLock function AutoLock: boolean; Public -
BackupItems procedure BackupItems; Public -
CanExportXML function CanExportXML(Data, Fields: TStringList; IndentLevel: integer = 0): boolean; Public -
CanModify function CanModify: boolean; Public -
Changed function Changed: boolean; Public -
ClearBackup procedure ClearBackup(ClearItemIENs: boolean = TRUE); Protected -
Clone function Clone(Owner: Int64): TTemplate; Public
Creates a new Template that looks like the old one, but with a new Owner  
 - an example of where this is needed:  when a shared template in a user's 
   personal folder is modified, we need to create a copy of the shared     
   template, make it a personal template, and make the changes to the copy
COMObjectText function COMObjectText(DefText: string; var DocInfo: string): string; Public
Function COMObjectText(const DefText: string = ''; DocInfo: string = ''): string;
function TTemplate.COMObjectText(const DefText: string = ''; DocInfo: string = ''): string;
CreateFromXML class function CreateFromXML(Element: IXMLDOMNode; Owner: string): TTemplate; Public -
DialogProperties function DialogProperties(Parent: TTemplate = nil): string; Public -
DlgID function DlgID: string; Public -
ExecuteReminderDialog procedure ExecuteReminderDialog(OwningForm: TForm); Public -
FullBoilerplate function FullBoilerplate: string; Public Returns the complete boilerplate, including a group's items
GetBoilerplate function GetBoilerplate: string; Protected -
GetChildren function GetChildren: TTemplateChildren; Protected -
GetDescription function GetDescription: string; Protected -
GetDialogAborted function GetDialogAborted: boolean; Protected -
GetItems function GetItems: TList; Protected -
GetTemplateType function GetTemplateType: TTemplateType; Protected -
GetText function GetText: string; Protected Gets the object-expanded boilerplated text
IsDialog function IsDialog: boolean; Public -
IsLocked function IsLocked: boolean; Public -
ItemBoilerplate function ItemBoilerplate: string; Public Returns the cumulative boilerplate of a groups items
ItemIENs function ItemIENs: string; Public -
LinkIEN function LinkIEN: string; Public -
LinkName function LinkName: string; Public -
LinkType function LinkType: TTemplateLinkType; Public -
ReminderDialogIEN function ReminderDialogIEN: string; Public -
ReminderDialogName function ReminderDialogName: string; Public -
ReminderWipe function ReminderWipe: string; Public AGP Change 24.8
RemoveChild procedure RemoveChild(Child: TTemplate); Public -
RemoveNode procedure RemoveNode(Node: Pointer); Public -
SetActive procedure SetActive(const Value: boolean); Protected -
SetBoilerplate procedure SetBoilerplate(Value: string); Protected Sets the items boilerplate - does not affect children boilerplates of a group
SetCOMObject procedure SetCOMObject(const Value: integer); Protected -
SetCOMParam procedure SetCOMParam(const Value: string); Protected -
SetDescription procedure SetDescription(const Value: string); Protected -
SetDialog procedure SetDialog(const Value: boolean); Protected -
SetDisplayOnly procedure SetDisplayOnly(const Value: boolean); Protected -
SetExclude procedure SetExclude(const Value: boolean); Protected -
SetFileLink procedure SetFileLink(const Value: string); Protected -
SetFirstLine procedure SetFirstLine(const Value: boolean); Protected -
SetGap procedure SetGap(const Value: integer); Protected -
SetHideDlgItems procedure SetHideDlgItems(const Value: boolean); Protected -
SetHideItems procedure SetHideItems(const Value: boolean); Protected -
SetIndentItems procedure SetIndentItems(const Value: boolean); Protected -
SetLock procedure SetLock(const Value: boolean); Protected -
SetOneItemOnly procedure SetOneItemOnly(const Value: boolean); Protected -
SetPersonalOwner procedure SetPersonalOwner(Value: Int64); Protected -
SetPrintName procedure SetPrintName(const Value: string); Protected -
SetRealType procedure SetRealType(const Value: TTemplateType); Protected -
SetReminderDialog procedure SetReminderDialog(const Value: string); Protected Reminder Dialog IEN
SetTemplateType procedure SetTemplateType(const Value: TTemplateType); Protected -
SortChildren procedure SortChildren; Public -
TrueClone function TrueClone: TTemplate; Protected Creates a duplicate Template - used for backups and comparrisons
Unlock procedure Unlock; Public -
UpdateImportedFieldNames procedure UpdateImportedFieldNames(List: TStrings); Public -
ValidID function ValidID: boolean; Protected -

Referenced By (227)

Module (line) Referrer Type
dShared (39) AddTemplateNode Read
dShared (51) TemplateOK Read
dShared (116) - Read
dShared (128) - Read
dShared (155) - Read
dShared (218) - Read
dShared (228) - Read
dShared (231) - Read
dShared (246) - Read
dShared (272) - Read
dShared (280) - Read
dShared (335) - Read
dShared (357) BuildNodes Read
dShared (380) - Read
dShared (402) - Read
dShared (430) - Read
dShared (656) - Read
dShared (765) - Read
fDrawers (169) AddTemplateNode Read
fDrawers (679) - Read
fDrawers (705) - Read
fDrawers (752) - Read
fDrawers (765) - Read
fDrawers (849) - Read
fDrawers (864) - Read
fDrawers (870) - Read
fDrawers (914) - Read
fDrawers (922) - Read
fDrawers (944) - Read
fDrawers (952) - Read
fDrawers (1078) - Read
fDrawers (1212) - Read
fDrawers (1429) - Read
fDrawers (1435) - Read
fDrawers (1454) - Read
fDrawers (1459) - Read
fDrawers (1462) - Read
fReminderDialog (85) ProcessTemplate Read
fReminderDialog (95) ViewRemDlgTemplateFromForm Read
fReminderDialog (175) ViewRemDlgFromForm Read
fReminderDialog (273) - Read
fReminderDialog (288) - Read
fReminderDialog (294) - Read
fReminderDialog (1784) - Read
fTemplateEditor (393) TfrmTemplateEditor Read
fTemplateEditor (400) ShowTemplateType Read
fTemplateEditor (409) Resync Read
fTemplateEditor (418) AutoDel Read
fTemplateEditor (423) UpdateApply Read
fTemplateEditor (565) - Unknown
fTemplateEditor (579) - Read
fTemplateEditor (599) - Read
fTemplateEditor (604) - Read
fTemplateEditor (623) - Read
fTemplateEditor (628) - Read
fTemplateEditor (641) - Read
fTemplateEditor (819) - Read
fTemplateEditor (825) - Read
fTemplateEditor (835) - Read
fTemplateEditor (837) - Read
fTemplateEditor (848) - Read
fTemplateEditor (855) - Read
fTemplateEditor (1009) - Read
fTemplateEditor (1015) - Read
fTemplateEditor (1136) - Read
fTemplateEditor (1260) - Read
fTemplateEditor (1269) - Read
fTemplateEditor (1289) - Read
fTemplateEditor (1298) - Read
fTemplateEditor (1330) - Read
fTemplateEditor (1339) - Read
fTemplateEditor (1360) - Read
fTemplateEditor (1368) - Read
fTemplateEditor (1468) - Read
fTemplateEditor (1555) - Read
fTemplateEditor (1563) - Read
fTemplateEditor (1565) - Read
fTemplateEditor (1584) - Read
fTemplateEditor (1594) - Read
fTemplateEditor (1611) - Read
fTemplateEditor (1621) - Read
fTemplateEditor (1625) - Read
fTemplateEditor (1655) - Read
fTemplateEditor (1663) - Read
fTemplateEditor (1665) - Read
fTemplateEditor (1685) - Read
fTemplateEditor (1695) - Read
fTemplateEditor (1712) - Read
fTemplateEditor (1722) - Read
fTemplateEditor (1726) - Read
fTemplateEditor (1757) - Read
fTemplateEditor (1766) - Read
fTemplateEditor (1768) - Read
fTemplateEditor (1792) - Read
fTemplateEditor (1819) - Read
fTemplateEditor (1857) - Read
fTemplateEditor (1887) - Read
fTemplateEditor (1912) - Read
fTemplateEditor (1926) - Read
fTemplateEditor (1933) - Read
fTemplateEditor (1942) - Read
fTemplateEditor (1946) - Read
fTemplateEditor (1954) - Read
fTemplateEditor (1959) - Read
fTemplateEditor (1968) - Read
fTemplateEditor (1984) - Read
fTemplateEditor (2002) - Read
fTemplateEditor (2008) - Read
fTemplateEditor (2047) - Read
fTemplateEditor (2081) - Read
fTemplateEditor (2094) - Read
fTemplateEditor (2131) - Read
fTemplateEditor (2136) - Read
fTemplateEditor (2137) - Read
fTemplateEditor (2177) - Read
fTemplateEditor (2185) - Read
fTemplateEditor (2196) - Read
fTemplateEditor (2228) - Read
fTemplateEditor (2234) - Read
fTemplateEditor (2242) - Read
fTemplateEditor (2249) - Unknown
fTemplateEditor (2333) - Read
fTemplateEditor (2334) - Read
fTemplateEditor (2392) - Read
fTemplateEditor (2756) - Read
fTemplateEditor (2934) - Read
fTemplateEditor (2960) - Read
fTemplateEditor (3102) - Read
fTemplateEditor (3103) - Read
fTemplateEditor (3194) - Read
fTemplateEditor (3195) - Read
fTemplateEditor (3206) - Read
fTemplateEditor (3220) - Read
fTemplateEditor (3234) - Read
fTemplateEditor (3256) - Unknown
fTemplateEditor (3257) - Unknown
fTemplateEditor (3265) - Read
fTemplateEditor (3274) - Read
fTemplateEditor (3408) - Read
fTemplateEditor (3416) - Read
fTemplateEditor (3488) - Read
fTemplateEditor (3496) - Read
fTemplateEditor (3520) - Read
fTemplateEditor (3542) - Read
fTemplateEditor (3659) - Read
fTemplateEditor (3732) - Read
fTemplateEditor (3785) - Read
fTemplateEditor (3812) - Read
fTemplateEditor (3855) - Read
fTemplateEditor (3864) - Read
fTemplateEditor (3943) - Read
fTemplateEditor (3948) - Read
fTemplateEditor (3957) - Read
fTemplateEditor (3961) - Read
fTemplateEditor (3970) - Read
fTemplateEditor (3978) - Read
fTemplateEditor (3979) - Read
fTemplateEditor (4097) - Read
fTemplateEditor (4103) - Read
fTemplateEditor (4117) - Read
fTemplateEditor (4123) - Read
fTemplateEditor (4140) - Read
fTemplateEditor (4146) - Read
fTemplateEditor (4149) - Read
fTemplateEditor (4151) - Read
fTemplateEditor (4199) - Read
fTemplateEditor (4206) - Read
uTemplates (115) TrueClone Read
uTemplates (149) CreateFromXML Read
uTemplates (155) AddChild Read
uTemplates (156) RemoveChild Read
uTemplates (157) Clone Read
uTemplates (164) DialogProperties Read
uTemplates (218) AddTemplate Read
uTemplates (218) AddTemplate Read
uTemplates (220) ExpandTemplate Read
uTemplates (224) GetLinkedTemplate Read
uTemplates (229) SaveTemplate Read
uTemplates (232) MarkDeleted Read
uTemplates (280) RootTemplate Read
uTemplates (281) MyTemplate Read
uTemplates (282) TitlesTemplate Read
uTemplates (283) ConsultsTemplate Read
uTemplates (284) ProceduresTemplate Read
uTemplates (494) - Read
uTemplates (494) - Read
uTemplates (498) - Read
uTemplates (508) - Read
uTemplates (525) - Read
uTemplates (559) - Read
uTemplates (601) - Read
uTemplates (640) - Read
uTemplates (646) CanEditType Read
uTemplates (671) - Read
uTemplates (685) - Read
uTemplates (687) - Read
uTemplates (732) - Read
uTemplates (750) - Read
uTemplates (934) - Read
uTemplates (946) - Read
uTemplates (952) - Read
uTemplates (958) - Read
uTemplates (971) - Read
uTemplates (1002) - Read
uTemplates (1006) - Read
uTemplates (1022) - Read
uTemplates (1482) - Read
uTemplates (1509) - Read
uTemplates (1623) - Read
uTemplates (1708) - Read
uTemplates (1715) - Read
uTemplates (1763) - Read
uTemplates (1817) - Read
uTemplates (1837) - Read
uTemplates (1842) - Read
uTemplates (1843) - Read
uTemplates (1952) - Read
uTemplates (1981) - Read
uTemplates (2008) - Read
uTemplates (2037) - Read
uTemplates (2055) - Read
uTemplates (2060) - Read
uTemplates (2060) - Read
uTemplates (2390) - Read
uTemplates (2475) - Read
uTemplates (2534) - Read
uTemplates (2683) - Read