ITK Function Reference
(12.1) |
Data Structures | |
struct | mdc_sblock |
Macros | |
#define | ITK_BATCH_TEXT_MODE 0 |
#define | ITK_BATCH_TEXT_MODE 0 |
#define | MDC_MAXARGS 5 |
#define | PROTO(params) params |
#define | SUCCESS NULL |
#define | tags_equal(a, b) ((a)==(b)) |
Typedefs | |
typedef struct mdc_sblock * | mdc_status_t |
Functions | |
TC_API logical | ITK__ask_managed_mode (void) |
TC_API void | ITK__convert_tag_to_uid (tag_t aTag, char **uid) |
TC_API void | ITK__convert_uid_to_tag (const char *uid, tag_t *aTag) |
TCINIT_API void | ITK__initialise_tc (int argc, char **argv) |
TC_API void | ITK__set_managed_mode (logical value) |
TC_API char * | ITK_ask_action (void) |
TC_API char * | ITK_ask_action_argument (const char *key) |
TC_API int | ITK_ask_argument_named_value (const char *argument, char **flag, char **value) |
TC_API int | ITK_ask_bypass (logical *has_bypass) |
TC_API char * | ITK_ask_cli_argument (const char *argument_name) |
TC_API int | ITK_ask_default_date_format (char **date_string) |
TC_API int | ITK_ask_in_ic_context (logical *in_ic_context) |
TC_API int | ITK_ask_object (tag_t *objectId) |
TC_API int | ITK_ask_update_level (int *update_level) |
TCINIT_API int | ITK_auto_login (void) |
TC_API int | ITK_date_to_string (date_t a_date, char **a_string) |
TCINIT_API int | ITK_init_from_cpp (int argc, char **argv) |
TCINIT_API int | ITK_init_module (const char *user_id, const char *user_password, const char *user_group) |
TC_API int | ITK_initialize_text_services (int unused) |
TC_API int | ITK_is_obj_edited_in_ic_context (tag_t obj, logical *res) |
TCINIT_API void | ITK_log_cmdline_args (int argc, char **argv) |
TC_API int | ITK_reset_obj_edited_in_ic_context (tag_t obj) |
TC_API int | ITK_set_bypass (logical on_or_off) |
TC_API int | ITK_set_in_ic_context (logical on_or_off) |
TC_API int | ITK_set_obj_edited_in_ic_context (tag_t obj) |
TC_API int | ITK_string_to_date (const char *a_string, date_t *a_date) |
int | ITK_user_main (int argc, char **argv) |
TC_API int | TC_ask_memory_in_use (void) |
TC_API int | TC_ask_memory_statistics (int *count, char ***names, int **values) |
TC_API int | TC_dump_objects () |
TC_API int | TC_is_system_running_utf8 (logical *is_running_utf8) |
TC_API int | TC_print_memory_statistics (FILE *output_file) |
TC_API void | TC_report_serious_error (const char *file_name, int line_number, const char *error_message,...) |
TC_API void | TC_write_syslog (const char *control_string,...) |
Login / Logout | |
TC_API int | ITK_init_to_login (void) |
TC_API void | TC__initialise_tc (int argc, char **argv) |
TC_API int | TC_init_cmain (int argc, char **argv) |
TC_API int | TC_init_module (const char *users_id, const char *users_password, const char *users_group) |
TC_API int | TC_init_module_sponsored (const char *user_id, const char *user_password, const char *sponsored_user, const char *sponsored_user_group) |
TC_API int | TC_auto_login (void) |
TC_API int | ITK_exit_module (logical ignore_unsaved_stuff) |
Teamcenter Version | |
TC_API int | ITK_ask_full_version (char **release) |
TC_API int | ITK_is_release_at_least (const char *minimum_version, logical *verdict) |
TC_API int | ITK_is_release_at_least_advanced (const char *minimum_version, const logical in_absolute, logical *verdict) |
TC_API int | ITK_ask_version_string (char **version_string) |
TC_API int | ITK_ask_version (int *version_number) |
Journalling | |
TC_API int | ITK_set_journalling (int on_or_off) |
TC_API logical | ITK_ask_journalling (void) |
Error message constants | |
#define | ITK_ok 0 |
#define ITK_BATCH_TEXT_MODE 0 |
Default Text Mode for ITK Batch Program
Definition at line 44 of file tc_startup.h.
#define ITK_BATCH_TEXT_MODE 0 |
#define MDC_MAXARGS 5 |
Definition at line 31 of file tc_basic.h.
#define PROTO | ( | params | ) | params |
Definition at line 54 of file tc_basic.h.
#define SUCCESS NULL |
Definition at line 30 of file tc_basic.h.
#define tags_equal | ( | a, | |
b | |||
) | ((a)==(b)) |
This macro is obsolescent and is only included for backwards compatability. Please use the == operator directly for all new code.
Definition at line 49 of file tc_basic.h.
typedef struct mdc_sblock * mdc_status_t |
Status block which is returned by some subroutines
TC_API logical ITK__ask_managed_mode | ( | void | ) |
Asks the current state of the tcserver managed mode. Returns true if the tcserver is in 4 tier mode
TC_API void ITK__convert_tag_to_uid | ( | tag_t | aTag, |
char ** | uid | ||
) |
aTag | (I) |
uid | (OF) |
TC_API void ITK__convert_uid_to_tag | ( | const char * | uid, |
tag_t * | aTag | ||
) |
uid | (I) |
aTag | (O) |
TCINIT_API void ITK__initialise_tc | ( | int | argc, |
char ** | argv | ||
) |
TC_API void ITK__set_managed_mode | ( | logical | value | ) |
Sets the current state of the tcserver managed mode. TC_managed_mode is set to true if the tcserver is in 4 tier mode.
value | (I) Set to 1 to indicate server is in managed mode. |
TC_API char* ITK_ask_action | ( | void | ) |
Returns the action passed to the shell program by Application Encapsulation or Release Management (e.g., create, open, save as, etc.). The AE actions are defined in ae.h.
Restrictions:
This function only returns the action code, not any argument to the code. Use ITK_ask_action_argument to get the argument.
TC_API char* ITK_ask_action_argument | ( | const char * | key | ) |
This function returns the argument that was passed to an ITK program from Teamcenter when an external ITK program is invoked through Teamcenter.
There is a special parameter passed to the process that contains the tag of the object being acted on and the action.
In order to get the tag of the dataset, the function should be invoked as follows:
In order to convert the tag_string to an actual tag, use POM_string_to_tag.
In order to get the format of the dataset, the function can be invoked as follows:
key | (I) |
TC_API int ITK_ask_argument_named_value | ( | const char * | argument, |
char ** | flag, | ||
char ** | value | ||
) |
Extracts the switch string and the corresponding value string from the argument string passed into the function.
The format of the switch-value pair must conform to the following pattern: [^=]*=[^=]*.
The switch and the value can be any alpha-numeric string that does not contain the equal (=) character.
The equal (=) character is used to delimit the switch and the value.
argument | (I) |
flag | (OF) |
value | (OF) |
TC_API int ITK_ask_bypass | ( | logical * | has_bypass | ) |
Checks if bypass is switched on.
has_bypass | (O) Whether bypass is switched on |
TC_API char* ITK_ask_cli_argument | ( | const char * | argument_name | ) |
Returns the value associated with a command line argument.
Restrictions:
argument_name
cannot contain a space character as its last character, if the value expected is to follow immediately. argument_name
cannot exceed 255 characters. Usage:
command
-i=on
, use the call ITK_ask_cli_argument
( "-i="
) to retrieve the value on
. command
-i
on
, use the call ITK_ask_cli_argument
( "-i "
) to retrieve the value on
. "-i "
contains a space character. argument_name | (I) The name of the argument for which the value is to be returned. |
TC_API int ITK_ask_default_date_format | ( | char ** | date_string | ) |
Creates a text string from the current date, using the format defined by the key "DefaultDateFormat" in the localized text resource file "timelocal_locale.xml".
date_string | (OF) |
TC_API int ITK_ask_full_version | ( | char ** | release | ) |
Retrieves the full version of the release (e.g. "10.1.4").
release | (OF) A string representing the Teamcenter release |
TC_API int ITK_ask_in_ic_context | ( | logical * | in_ic_context | ) |
in_ic_context | (O) |
TC_API logical ITK_ask_journalling | ( | void | ) |
Asks the current state of the journalling flag as set via ITK_set_journalling. This allows users to develop code that can dynamically switch journalling on or off. Expected use would be in exits and methods.
Returns Journalling_enabled if true; Journalling_suppressed if false.
TC_API int ITK_ask_object | ( | tag_t * | objectId | ) |
Returns the tag of the object passed to your program as an argument.
For an Application Encapsulation shell, this is the tag of the selected Dataset.
For a follow-up action, this is the tag of the Job.
objectId | (O) |
TC_API int ITK_ask_update_level | ( | int * | update_level | ) |
Returns the version control information.
update_level | (O) Version number of the release |
TC_API int ITK_ask_version | ( | int * | version_number | ) |
Returns the version number of the current Teamcenter release.
version_number | (O) |
TC_API int ITK_ask_version_string | ( | char ** | version_string | ) |
Returns the version number of the current Teamcenter release as a string. The string is MEM_alloc()ed.
version_string | (OF) A string representing the version number |
TCINIT_API int ITK_auto_login | ( | void | ) |
Attempts an automatic login first by assuming sufficient data is available on the command line.
your_program -u=<user_id> -p=<password> -g=<group>
TC_API int ITK_date_to_string | ( | date_t | a_date, |
char ** | a_string | ||
) |
Converts a date_t structure into a text representation.
The date is formatted according to the DefaultDateFormat string defined in timelocal_locale.xml localized text resource file.
a_date | (I) Supplied date_t structure |
a_string | (OF) Text representation of specified date |
TC_API int ITK_exit_module | ( | logical | ignore_unsaved_stuff | ) |
Exits this module.
ignore_unsaved_stuff | (I) This flag is passed to POM_stop. If false, an error is returned if there are unsaved modified objects. |
TCINIT_API int ITK_init_from_cpp | ( | int | argc, |
char ** | argv | ||
) |
This function initializes the Teamcenter environment for all ITK programs.
Restrictions:
If an ITK program has its own main() routine, this ITK function must be called before any other ITK routines. Otherwise, the ITK program must linked with the ITK_main.o module which performs the same function as this routine.
argc | (I) Argument count from the main() routine |
argv | (I) argc Array of arguments from the main() routine |
TCINIT_API int ITK_init_module | ( | const char * | user_id, |
const char * | user_password, | ||
const char * | user_group | ||
) |
Attempts a login with the passed-in information.
user_id | (I) The ID of the user to log-in |
user_password | (I) The associated password |
user_group | (I) The group in which to log-in the user |
TC_API int ITK_init_to_login | ( | void | ) |
This function calls as much initialisation code as possible without actually logging in with a user name and password. Calling this before ITK_init_module may make ITK_init_module faster.
TC_API int ITK_initialize_text_services | ( | int | unused | ) |
Initializes the Teamcenter text services. This is necessary to get the correct error strings when you use EMH_get_error_string, or by certain other Teamcenter functions that make use of text services, like forms.
unused | (I) The value is not used anymore |
TC_API int ITK_is_release_at_least | ( | const char * | minimum_version, |
logical * | verdict | ||
) |
Determines if the current Teamcenter release is higher or equal to the specified release.
minimum_version
or the determined version release is not in the expected format (integers separated by the '.' character, e.g. "10.1.6.1"). minimum_version | (I) A string representing the minimum Teamcenter version, e.g. "10.1.4". The string is composed of at least one group and up to 4 groups separated by the '.' character: the major version (mandatory), the minor version, the service pack, the patch. If either the service pack or the patch information is missing (e.g. "10.1.4" or "10.1"), the assumed value is "0". If the string is null or empty, the verdict is "true" and no error is returned. |
verdict | (O) "true" if the current Platform release is minimum_version or higher. |
TC_API int ITK_is_release_at_least_advanced | ( | const char * | minimum_version, |
const logical | in_absolute, | ||
logical * | verdict | ||
) |
Determines if the current Teamcenter release is higher or equal to the specified release in the given release stream or in the absolute.
in_absolute
equal to true
is the same as invoking ITK_is_release_at_least.minimum_version
or the determined version release is not in the expected format (integers separated by the '.' character, e.g. "10.1.6.1"). minimum_version | (I) A string representing the minimum Teamcenter version, e.g. "10.1.4". The string is composed of at least one group and up to 4 groups separated by the '.' character: the major version (mandatory), the minor version, the service pack, the patch. If either the service pack or the patch information is missing (e.g. "10.1.4" or "10.1"), the assumed value is "0". If the string is null or empty, the verdict is "true" and no error is returned. |
in_absolute | (I) Determines if the check is made in the absolute (true ) or only against the the major release (i.e. the first portion minimum_version ; false ). |
verdict | (O) "true" if the current Platform release is minimum_version or higher. |
TCINIT_API void ITK_log_cmdline_args | ( | int | argc, |
char ** | argv | ||
) |
This function can be used to print command line arguments in syslog for ITK programs.
argc | (I) Argument count from the main() routine |
argv | (I) argc Array of arguments from the main() routine |
TC_API int ITK_reset_obj_edited_in_ic_context | ( | tag_t | obj | ) |
obj | (I) |
TC_API int ITK_set_bypass | ( | logical | on_or_off | ) |
Allows a system administrator to bypass Access Manager controls on objects.
Switching the bypass on typically allows the system administrator to modify, delete, or otherwise access objects at will.
When using the old AM, all access control is disabled by the bypass facility. However, the effect of bypass in the new AM is dependent on the Has Teamcenter::Bypass rule in the AM Rules Tree.
The user must be a Teamcenter system administrator.
on_or_off | (I) Whether to switch bypass on (true) or off (false) |
TC_API int ITK_set_in_ic_context | ( | logical | on_or_off | ) |
on_or_off | (I) |
TC_API int ITK_set_journalling | ( | int | on_or_off | ) |
Sets journalling for the ITK, WSOM, AOM, and FL functions of Teamcenter.
on_or_off | (I) Set to 0 to turn journalling off, or to non-zero to turn journalling on. |
TC_API int ITK_set_obj_edited_in_ic_context | ( | tag_t | obj | ) |
obj | (I) |
TC_API int ITK_string_to_date | ( | const char * | a_string, |
date_t * | a_date | ||
) |
Converts a text string into a date_t structure.
The string is assumed to be formatted according to the DefaultDateFormat value in time.uil.
a_string | (I) Specified date string |
a_date | (O) Date as a date_t structure |
int ITK_user_main | ( | int | argc, |
char ** | argv | ||
) |
Main functions for all ITK utility.
Create your own implementation of this utility to address your needs. The utility will need to be linked with itk_main.o, which is done if the linkitk.sh or linkitk.bat script from ADK (Application Development Kit) is called.
The Teamcenter infrastructure will call your utility ITK_user_main upon execution.
[in] | argc | The number of input arguments |
[in] | argv | The array of input arguments |
TC_API void TC__initialise_tc | ( | int | argc, |
char ** | argv | ||
) |
Initializes different key modules in the Teamcenter server.
It internally calls TC_init_cmain.
TC_API int TC_ask_memory_in_use | ( | void | ) |
Reports SM+OM in-use space. Ignores OM-UNDO
TC_API int TC_ask_memory_statistics | ( | int * | count, |
char *** | names, | ||
int ** | values | ||
) |
Implemented in memorymonitorwindow.cxx
Returns virtual memory use under various categories (some CPU types give more data than others) (These numbers may be of interest to ITK programmers, but probably not to system administrators)
count | (O) |
names | (OF) count |
values | (OF) count |
TC_API int TC_auto_login | ( | void | ) |
ITK_init_module attempts an automatic login first by assuming sufficient data is available on the command line.
This method is now in libtcinit, and calls register_init_functions() followed by a call to TC_init_module, which is the old ITK_init_module() in infomanager_itk.cxx
TC_API int TC_dump_objects | ( | ) |
TC_API int TC_init_cmain | ( | int | argc, |
char ** | argv | ||
) |
Routine to initialize the basic system service routines from SYSS module. It also initializes the Preferences module.
TC_API int TC_init_module | ( | const char * | users_id, |
const char * | users_password, | ||
const char * | users_group | ||
) |
The original method, ITK_init_module, initializes the Integration Tool Kit (ITK) for use. \
For convenience, also logs into the POM.
This m ethod is now in libtcinit, and calls register_init_functions() followed by a call toTC_init_module.
TC_init_module is the rest of the method that was not moved to tcinit.
users_id | (I) |
users_password | (I) |
users_group | (I) |
TC_API int TC_init_module_sponsored | ( | const char * | user_id, |
const char * | user_password, | ||
const char * | sponsored_user, | ||
const char * | sponsored_user_group | ||
) |
Initializes TC for sponsored login
user_id | (I) User id of the sponsoring user |
user_password | (I) Password of the sponsoring user |
sponsored_user | (I) User id of the sponsored user |
sponsored_user_group | (I) Sponsored user's group |
TC_API int TC_is_system_running_utf8 | ( | logical * | is_running_utf8 | ) |
Checks if the Teamcenter system is configured for UTF-8 encoding, and is running as such.
The system comprises the server and the database.
is_running_utf8 | (O) Determines if system is running in utf8. The value is true if the Teamcenter system is properly configured for UTF-8 encoding, and is running as such. false if the Teamcenter system is not configured for UTF-8 encoding. |
TC_API int TC_print_memory_statistics | ( | FILE * | output_file | ) |
Prints the current memory statistics into a specified file.
output_file | - File pointer to an already opened output file where the memory statistics will be written out |
output_file | (I) File pointer to an already opened output file where the memory statistics will be written out |
TC_API void TC_report_serious_error | ( | const char * | file_name, |
int | line_number, | ||
const char * | error_message, | ||
... | |||
) |
Raises an exception (ERROR_raise) using the error ITK_internal_error as well as a given message.
file_name
and line_number
parameters. file_name | (I) The file where the error has occurred. |
line_number | (I) The line where the error has occurred. |
error_message | (I) The potentially parameterized message to be associated with the exception. %s indicates a string parameter, %d a digit, etc. The parameters are to be provided as subsequent arguments of this API. |
TC_API void TC_write_syslog | ( | const char * | control_string, |
... | |||
) |
Loads the data from the given locations, converts them to character string equivalents and writes the results to the syslog file.
control_string | (I) Pointer to a null-terminated string specifying how to interpret the data. The format string consists of ordinary characters (except %), which are copied unchanged into the syslog file, and conversion specifications. Each conversion specification (% and characters following) has the format as specificed in std::printf. All arguments following the control_string specify the data to print. If any argument after default conversions is not the type expected by the corresponding conversion specifier, or if there are fewer arguments than required by control_string, the behavior is undefined. If there are more arguments than required by control_string, the extraneous arguments are evaluated and ignored. |