OScript API/Built-in Package Index

Class: Language

This API will allow a developer to get/set language information for Content Server.

Class Attributes

The pMultilingual table attribute is not in the expected format.

The language is disabled.

The language name cannot be empty.

The local language name cannot be empty.

The value cannot be empty.

Unknown error constant .

The language is invalid.

The name/language assoc is invalid.

Success return constant.

Class Methods

DeleteLanguage( CAPILOGIN login, String languageCode )

Removes a language from the pool of available metadata languages.

DetermineCoreLanguageCode( CAPILOGIN login, Assoc values )

Determine the language code for the core value (based on current language configuration) from the data given.

DetermineCoreValue( CAPILOGIN login, Assoc values )

Determine the core value (based on current language configuration) from the data given.

DisableLanguage( CAPILOGIN login, String languageCode )

Mark the given metadata language as disabled.

EnableLanguage( CAPILOGIN login, String languageCode )

Mark the given metadata language as enabled.

GetDefaultLanguage( CAPILOGIN login )

Gets the default metadata language code.

GetEnabledLanguages( CAPICONNECT connection )

Gets the list of enabled metadata languages.

GetSystemLanguages( CAPICONNECT connection )

Gets the master list of languages defined in Content Server.

InsertLanguage( CAPILOGIN login, String languageCode, Boolean enabled )

Adds a language to the pool of available metadata languages.

IsLanguageEnabled( CAPICONNECT connection, String languageCode )

Checks if the given language code is currently enabled.

RenameLanguage( CAPICONNECT connect, String languageCode )

Update the display labels for the given metadata language code.

SetDefaultLanguage( CAPILOGIN login, String languageCode )

Sets the default metadata language code.

Class Attributes

The pMultilingual table attribute is not in the expected format.

Error DISABLED

The language is disabled.

Error EMPTY

The language name cannot be empty.

The local language name cannot be empty.

The value cannot be empty.

Error ERROR

Unknown error constant.

Error INVALID

The language is invalid.

The name/language assoc is invalid.

Integer OK

Success return constant.

Class Methods

DeleteLanguage

Integer DeleteLanguage( CAPILOGIN login,
                        String languageCode )

Removes a language from the pool of available metadata languages.

Parameters

login

The login to use to set the data.

languageCode

The language code to remove.

Returns:

Language.OK (Integer zero) if successful; Error otherwise.

DetermineCoreLanguageCode

String DetermineCoreLanguageCode( CAPILOGIN login,
                                  Assoc values )

Determine the language code for the core value from the data given, based on the current language configuration.

Parameters

login

The login to use to retrieve the data.

values

A set of values, keyed by their respective language codes.

Returns:

The core language code as a string if successful; Error otherwise.

DetermineCoreValue

String DetermineCoreValue( CAPILOGIN login,
                           Assoc values )

Determine the core value from the data given, based on the current language configuration.

Parameters

login

The login to use to retrieve the data.

values

A set of values, keyed by their respective language codes.

Returns:

The core value as a string if successful; Error otherwise.

DisableLanguage

Integer DisableLanguage( CAPILOGIN login,
                         String languageCode )

Mark the given metadata language as disabled.

Parameters

login

The login to use to set the data.

languageCode

The language code to disable.

Returns:

Language.OK (Integer zero) if successful; Error otherwise.

EnableLanguage

Integer EnableLanguage( CAPILOGIN login,
                        String languageCode )

Mark the given metadata language as enabled.

Parameters

login

The login to use to set the data.

languageCode

The language code to enable.

Returns:

Language.OK (Integer zero) if successful; Error otherwise.

GetDefaultLanguage

String GetDefaultLanguage( CAPILOGIN login )

Gets the default metadata language code.

Parameters

login

The login to use to fetch the data.

Returns:

A String representing the default language code; Error otherwise.

GetEnabledLanguages

RecArray GetEnabledLanguages( CAPICONNECT connection )

Gets the list of enabled metadata languages.

Parameters

connection

The connection to use for the query.

Returns:

A RecArray containing the languages if successful; Error otherwise.

    The format for the RecArray is as follows:
LanguageCode the language code in the format xx_YYY (for example: en, en_US)
LanguageName the name of the language that the admin user will see
LanguageNameLocal the localized name of the language that non-admin users will see

GetSystemLanguages

RecArray GetSystemLanguages( CAPICONNECT connection )

Gets the master list of languages defined in Content Server.

Parameters

connection

The connection to use for the query.

Returns:

A RecArray containing the languages if successful. If the function fails, an error code will be returned. The format of the RecArray is as follows:

LanguageCode the language code in the format xx_YYY (for example: en, en_US)
LanguageName the name of the language that the admin user will see
LanguageNameLocal the localized name of the language that non-admin users will see

InsertLanguage

Integer InsertLanguage( CAPILOGIN login,
                        String languageCode,
                        Boolean enabled )

Adds a language to the pool of available metadata languages.

Parameters

login

The login to use to set the data.

languageCode

The language code to add.

enabled

Optional: true if the language should be enabled (default is false).

Returns:

Language.OK (Integer zero) if successful; Error otherwise.

IsLanguageEnabled

Boolean IsLanguageEnabled( CAPICONNECT connection,
                           String languageCode )

Checks if the given metadata language is currently enabled.

Parameters

connection

The connection to use to retrieve the data.

languageCode

The language code to check.

Returns:

True if the given language is currently enabled; false if not.

RenameLanguage

Integer RenameLanguage( CAPICONNECT connect,
                        String languageCode )

Adds a language to the pool of available metadata languages.

Parameters

connect

The connection to use to set the data.

languageCode

The language code to add.

Returns:

language.ok (integer zero) if successful; Error otherwise.

SetDefaultLanguage

Integer SetDefaultLanguage( CAPILOGIN login,
                            String languageCode )

Sets the default metadata language code.

Parameters

login

The login to use to set the data.

languageCode

The language code to make default.

Returns:

Language.OK (Integer zero) if successful; Error otherwise.

 Copyright © 2022 OpenText Corporation. All rights reserved.