Micro Focus Content Manager SDK 10.1
TRIM.SDK.TrimApplication Class Reference

The TrimApplication class provides methods for querying and adjusting the runtime environment of a SDK application. More...

Inheritance diagram for TRIM.SDK.TrimApplication:
TRIM.SDK.TrimApplicationBase

Public Member Functions

 TrimApplication ()
 

Static Public Member Functions

static void setAsService ()
 Notifies the SDK that this application is running as a Windows service. Can only be called once in your application. More...
 
static void SetAsWebService (string webServiceWorkPath)
 Notifies the SDK that this application is running as a Web Service. Can only be called once in your application. To run as a web service, you must specify a path for storing temporary per-user work files. If the path parameter is left blank or NULL, TRIM will consult the local machine registry to see if a web service path has been defined there. More...
 
static string GetHelpFileNameForLanguage (Language forLanguage)
 Gets the name of the TRIM help file for the nominated language More...
 
static string GetMessageImpl (Database db, int msgId, StringArray substPercentStrings)
 
static string ProcessMessage (string msg)
 Processes the specified string, replacing any special TRIM substitution string (e.g. B_record%, E_tt_Favorites%, etc) More...
 
static string ProcessMessage (Database db, string msg)
 Processes the specified string, replacing any special TRIM substitution string (e.g. B_record%, E_tt_Favorites%, etc). The supplied database parameter allows any local customized captions to be used instead of standard TRIM captions. More...
 
static bool IsLanguageSupported (short LanguageId)
 Indicates if the current installation of Content Manager has a localization available for the nominated language More...
 
static bool SetDefaultLanguage (short LanguageId)
 Sets the current thread default language to be used for subsequent calls to GetMessage and any other functions that are language specific. Note that this default will not be used if a connected Database object is provided. The function returns false if the specified language is not supported. The language is specified using the standard Windows Language Identifier. More...
 
static bool IsLanguageSupported (Language language)
 Indicates if the current installation of Content Manager has a localization available for the nominated language More...
 
static bool SetDefaultLanguage (Language language)
 Sets the current thread default language to be used for subsequent calls to GetMessage and any other functions that are language specific. Note that this default will not be used if a connected Database object is provided. The function returns false if the specified language is not supported. The language is specified using using the TRIM enumeration for currently supported TRIM languages. More...
 
static StringArray GetDatabaseIds (string servedByWorkgroup, int onPortNumber)
 Gets a list of database ids that are supported by a particular workgroup server. Note that the returned set of database ids are not authenticated, it is possible that the current user may not have access to some or all of them. More...
 
static StringArray GetTimeZones ()
 Gets the list of windows time zone display strings. More...
 
static string MIMETypeToFileType (string mimeTypeString)
 Converts a MIME type to a Windows File Type extension string, according to the list of known file types used by Content Manager. More...
 
static void InitializeIconCache (Database db, bool useAuthoringAppIconsIfAvailable)
 Set useAuthoringAppIconsIfAvailable to true, to enable loading of icons from locally installed authoring applications (such as Microsoft Office). More...
 
static void PreloadIconsAsPNG (IconSizes size)
 This will pre-load the icon cache with all icons converted to PNG format. It will synchronize to ensure that the latest versions of the icons are in the cache. You will need to call this for each size of PNG file that you wish to pre-load. Note that other sizes will be loaded on demand when using the GetIconAsPNG function. More...
 
static void PreloadIconsAsICO ()
 This will pre-load the icon cache with all icons converted to ICO format. It will synchronize to ensure that the latest versions of the icons are in the cache. More...
 
static string GetIconAsPNG (TrimIcon icon, IconSizes size)
 Converts a TrimIcon to PNG file of the specified size. It first looks in the standard icon cache folder to see if a PNG already exists, otherwise it will attempt to download it. To ensure that any external icons are available, you should first call the InitIconCache function. More...
 
static string GetIconAsICO (TrimIcon icon)
 Converts a TrimIcon to ICO file. It first looks in the standard icon cache folder to see if a ICO already exists, otherwise it will attempt to download it. To ensure that any external icons are available, you should first call the InitializeIconCache function. More...
 
static string GetIconCacheFolder ()
 Gets the folder that is used for storing external icons files and any icons that have been requested as PNG files. More...
 
- Static Public Member Functions inherited from TRIM.SDK.TrimApplicationBase
static void Initialize ()
 Initializes the SDK, by explicitly loading native binaries. Once Initialize() returns successfully, subsequent calls to Initialize() have no effect. If Initialize() is not called by the application, it will be called implicitly by the SDK, when the first native-backed SDK method is called. More...
 
static void DiagnoseDllLoading (string binariesDir="", string systemDir="C:\\Windows\\System32")
 Diagnoses DLL dependency issues when loading the SDK. Loads known dependencies one by one to determine if any are missing. Any loading errors are written to the console. More...
 
static void EnableSdkLeakTracking (bool enable)
 Enables or disables SDK leak tracking. If leak tracking is enabled, stack traces are collected upon the creation of each Database. If the leak tracker subsequently detects that one of these objects is being disposed by the garbage collector, rather than through explicit disposal, an error will be logged to the Windows Application event log. Such an error will only be logged once. More...
 
static int GetSdkLeakCount ()
 Gets the current number of SDK leaks. Requires SDK leak tracking to be enabled. More...
 
static List< string > GetSdkLeakStackTraces ()
 Gets the current list of SDK leaks. Requires SDK leak tracking to be enabled. More...
 
static int GetSdkObjectCount ()
 Gets the current number of SDK objects that have not yet been disposed. More...
 
static long ToErrorCode (MessageIds msgId)
 Converts the error message enumeration value to an ErrorCode that is used by the TRIMSDK TrimException class. More...
 
static string GetMessage (MessageIds msgId)
 Retrieves a message with the specified message id from the TRIM Messages database. More...
 
static string GetMessage (MessageIds msgId, string substPercent1)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string provided will replace all occurrences of %1% that are found inside the TRIM Message. More...
 
static string GetMessage (MessageIds msgId, string substPercent1, string substPercent2)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string substPercent1 will replace all occurrences of %1% that are found inside the TRIM Message. The substitution string substPercent2 will replace all occurrences of %2% that are found inside the TRIM Message. More...
 
static string GetMessage (MessageIds msgId, string[] substPercentStrings)
 Retrieves a message with the specified message id from the TRIM Messages database. The array of substitition strings will replace the values %1%, %2%, ... that are found inside the message. Note that although the array index is 0-based, the substitution strings are 1-based, so substPercentStrings[0] will be used to replace %1%. A maximum of 8 substitution strings are currently supported. More...
 
static string GetMessage (Database db, MessageIds msgId)
 Retrieves a message with the specified message id from the TRIM Messages database. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static string GetMessage (Database db, MessageIds msgId, string substPercent1)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string provided will replace all occurrences of %1% that are found inside the TRIM Message. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static string GetMessage (Database db, MessageIds msgId, string substPercent1, string substPercent2)
 Retrieves a message with the specified message id from the TRIM Messages database. The substitution string substPercent1 will replace all occurrences of %1% that are found inside the TRIM Message. The substitution string substPercent2 will replace all occurrences of %2% that are found inside the TRIM Message. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static string GetMessage (Database db, MessageIds msgId, string[] substPercentStrings)
 Retrieves a message with the specified message id from the TRIM Messages database. The array of substitition strings will replace the values %1%, %2%, ... that are found inside the message. Note that although the array index is 0-based, the substitution strings are 1-based, so substPercentStrings[0] will be used to replace %1%. A maximum of 8 substitution strings are currently supported. The supplied database (if not null) will be used to do any customer-specific captioning of certain TRIM strings, and will also return the message in the language designated for the currently logged-on user in that database. More...
 
static void WriteToSdkLog (string msg)
 Write a message to the Content Manager client log. Requires SDK logging to be enabled in the client log settings. More...
 

Protected Attributes

bool swigCMemOwn
 

Properties

static Environments RuntimeEnvironment [get, set]
 Gets or sets an Environments enum value indicating the type of runtime environment the SDK application is running in. Certain areas of TRIM functionality may be disabled depending on what is appropriate for the runtime environment specified. More...
 
static int SDKVersion [get]
 Gets an integer containing the version number of the TRIM.SDK.dll that is currently installed. More...
 
static string SoftwareVersion [get]
 Gets a string containing the Content Manager version number and build number that is currently installed. More...
 
static string WebServerWorkPath [get]
 Gets a string value representing the working folder currently being used by a WebService application. More...
 
static ServiceTypes ServiceType [get]
 Gets a ServiceTypes enum value indicating that the Application is running as a particular type of service. More...
 
static string BinaryPath [get]
 Returns the name of the Windows folder where the Content Manager software is installed More...
 
static string TemporaryPath [get]
 Returns a string containing the name of a Windows folder that is a good place to create temporary files More...
 
static string HelpFileName [get]
 Gets the name of the TRIM help file, based on the current language being used More...
 
static bool HasUserInterface [get, set]
 Returns a boolean value indicating if the running application has access to a user interface. More...
 
- Properties inherited from TRIM.SDK.TrimApplicationBase
static string TrimBinariesLoadPath [get, set]
 Set TrimBinariesLoadPath, to force the SDK to load native binaries from a particular path. This will override the searching logic that the SDK would otherwise apply. More...
 
static bool HasBeenInitialized [get]
 

Detailed Description

The TrimApplication class provides methods for querying and adjusting the runtime environment of a SDK application.

Constructor & Destructor Documentation

◆ TrimApplication()

TRIM.SDK.TrimApplication.TrimApplication ( )

Member Function Documentation

◆ GetDatabaseIds()

static StringArray TRIM.SDK.TrimApplication.GetDatabaseIds ( string  servedByWorkgroup,
int  onPortNumber 
)
static

Gets a list of database ids that are supported by a particular workgroup server. Note that the returned set of database ids are not authenticated, it is possible that the current user may not have access to some or all of them.

◆ GetHelpFileNameForLanguage()

static string TRIM.SDK.TrimApplication.GetHelpFileNameForLanguage ( Language  forLanguage)
static

Gets the name of the TRIM help file for the nominated language

◆ GetIconAsICO()

static string TRIM.SDK.TrimApplication.GetIconAsICO ( TrimIcon  icon)
static

Converts a TrimIcon to ICO file. It first looks in the standard icon cache folder to see if a ICO already exists, otherwise it will attempt to download it. To ensure that any external icons are available, you should first call the InitializeIconCache function.

◆ GetIconAsPNG()

static string TRIM.SDK.TrimApplication.GetIconAsPNG ( TrimIcon  icon,
IconSizes  size 
)
static

Converts a TrimIcon to PNG file of the specified size. It first looks in the standard icon cache folder to see if a PNG already exists, otherwise it will attempt to download it. To ensure that any external icons are available, you should first call the InitIconCache function.

◆ GetIconCacheFolder()

static string TRIM.SDK.TrimApplication.GetIconCacheFolder ( )
static

Gets the folder that is used for storing external icons files and any icons that have been requested as PNG files.

◆ GetMessageImpl()

static string TRIM.SDK.TrimApplication.GetMessageImpl ( Database  db,
int  msgId,
StringArray  substPercentStrings 
)
static

◆ GetTimeZones()

static StringArray TRIM.SDK.TrimApplication.GetTimeZones ( )
static

Gets the list of windows time zone display strings.

◆ InitializeIconCache()

static void TRIM.SDK.TrimApplication.InitializeIconCache ( Database  db,
bool  useAuthoringAppIconsIfAvailable 
)
static

Set useAuthoringAppIconsIfAvailable to true, to enable loading of icons from locally installed authoring applications (such as Microsoft Office).

◆ IsLanguageSupported() [1/2]

static bool TRIM.SDK.TrimApplication.IsLanguageSupported ( Language  language)
static

Indicates if the current installation of Content Manager has a localization available for the nominated language

◆ IsLanguageSupported() [2/2]

static bool TRIM.SDK.TrimApplication.IsLanguageSupported ( short  LanguageId)
static

Indicates if the current installation of Content Manager has a localization available for the nominated language

◆ MIMETypeToFileType()

static string TRIM.SDK.TrimApplication.MIMETypeToFileType ( string  mimeTypeString)
static

Converts a MIME type to a Windows File Type extension string, according to the list of known file types used by Content Manager.

◆ PreloadIconsAsICO()

static void TRIM.SDK.TrimApplication.PreloadIconsAsICO ( )
static

This will pre-load the icon cache with all icons converted to ICO format. It will synchronize to ensure that the latest versions of the icons are in the cache.

◆ PreloadIconsAsPNG()

static void TRIM.SDK.TrimApplication.PreloadIconsAsPNG ( IconSizes  size)
static

This will pre-load the icon cache with all icons converted to PNG format. It will synchronize to ensure that the latest versions of the icons are in the cache. You will need to call this for each size of PNG file that you wish to pre-load. Note that other sizes will be loaded on demand when using the GetIconAsPNG function.

◆ ProcessMessage() [1/2]

static string TRIM.SDK.TrimApplication.ProcessMessage ( Database  db,
string  msg 
)
static

Processes the specified string, replacing any special TRIM substitution string (e.g. B_record%, E_tt_Favorites%, etc). The supplied database parameter allows any local customized captions to be used instead of standard TRIM captions.

◆ ProcessMessage() [2/2]

static string TRIM.SDK.TrimApplication.ProcessMessage ( string  msg)
static

Processes the specified string, replacing any special TRIM substitution string (e.g. B_record%, E_tt_Favorites%, etc)

◆ setAsService()

static void TRIM.SDK.TrimApplication.setAsService ( )
static

Notifies the SDK that this application is running as a Windows service. Can only be called once in your application.

◆ SetAsWebService()

static void TRIM.SDK.TrimApplication.SetAsWebService ( string  webServiceWorkPath)
static

Notifies the SDK that this application is running as a Web Service. Can only be called once in your application. To run as a web service, you must specify a path for storing temporary per-user work files. If the path parameter is left blank or NULL, TRIM will consult the local machine registry to see if a web service path has been defined there.

◆ SetDefaultLanguage() [1/2]

static bool TRIM.SDK.TrimApplication.SetDefaultLanguage ( Language  language)
static

Sets the current thread default language to be used for subsequent calls to GetMessage and any other functions that are language specific. Note that this default will not be used if a connected Database object is provided. The function returns false if the specified language is not supported. The language is specified using using the TRIM enumeration for currently supported TRIM languages.

◆ SetDefaultLanguage() [2/2]

static bool TRIM.SDK.TrimApplication.SetDefaultLanguage ( short  LanguageId)
static

Sets the current thread default language to be used for subsequent calls to GetMessage and any other functions that are language specific. Note that this default will not be used if a connected Database object is provided. The function returns false if the specified language is not supported. The language is specified using the standard Windows Language Identifier.

Member Data Documentation

◆ swigCMemOwn

bool TRIM.SDK.TrimApplication.swigCMemOwn
protected

Property Documentation

◆ BinaryPath

string TRIM.SDK.TrimApplication.BinaryPath
staticget

Returns the name of the Windows folder where the Content Manager software is installed

◆ HasUserInterface

bool TRIM.SDK.TrimApplication.HasUserInterface
staticgetset

Returns a boolean value indicating if the running application has access to a user interface.

◆ HelpFileName

string TRIM.SDK.TrimApplication.HelpFileName
staticget

Gets the name of the TRIM help file, based on the current language being used

◆ RuntimeEnvironment

Environments TRIM.SDK.TrimApplication.RuntimeEnvironment
staticgetset

Gets or sets an Environments enum value indicating the type of runtime environment the SDK application is running in. Certain areas of TRIM functionality may be disabled depending on what is appropriate for the runtime environment specified.

◆ SDKVersion

int TRIM.SDK.TrimApplication.SDKVersion
staticget

Gets an integer containing the version number of the TRIM.SDK.dll that is currently installed.

◆ ServiceType

ServiceTypes TRIM.SDK.TrimApplication.ServiceType
staticget

Gets a ServiceTypes enum value indicating that the Application is running as a particular type of service.

◆ SoftwareVersion

string TRIM.SDK.TrimApplication.SoftwareVersion
staticget

Gets a string containing the Content Manager version number and build number that is currently installed.

◆ TemporaryPath

string TRIM.SDK.TrimApplication.TemporaryPath
staticget

Returns a string containing the name of a Windows folder that is a good place to create temporary files

◆ WebServerWorkPath

string TRIM.SDK.TrimApplication.WebServerWorkPath
staticget

Gets a string value representing the working folder currently being used by a WebService application.