OScript API/Built-in Package Index

Class: License

Important Note: The License built-ins are supposed to be used internally only, that is, by the License Subsystem in the Kernel module which provides hooks for modules requiring licenses. They are not meant to be used by 3rd party developers.

The License package provides services for retrieving and managing licenses for Content Server and modules that require separate licenses. The major functionalities offered in the License Package are the following:

Class Attributes

License Error: Invalid application fingerprint.

License Error: Bad license format.

License Error: Invalid application version.

License Error: Cannot read license file.

License Error: Expired License.

License Error: Error generating fingerprint.

License Error: Failed to get license information.

License Error: Invalid license.

Nonproduction License Type: 1

License Error: No license found.

License Error: Error getting number of active users.

License Error: An old format license that is no longer supported, or a corrupt file.

License Error: Error getting license from OTDS.

License Error: Error getting number of active users.

Production License Type: 2.

Temporary License Type: 0.

License Error: System is busy and cannot read license. Please try again.

License Error: Maximum number of users exceeded.

License Error: Unknown error.

Valid license.

License Error: Error validating license.

Class Methods

ApplyCoreLicense( String license, Boolean isFilePath )

Loads and validates a license file and sets it as the Content Server core license

ApplyModuleLicense( String licenseFile, String applicationKey, String version, Integer numActiveUsers )

Loads and validates a module license file and sets it as a module license.

Generates a fingerprint string for the installed system.

GenerateReportHash( String licenseContent )

Returns a hash generated from the license data.

Gets information from the Content Server core license.

Returns a list of licensed applications.

GetLicenseFeatureName( String licenseContent )

Returns the feature name for the license.

GetLicenseInfo( String license, String version, Integer numActiveUsers )

Gets the information from a license content string or a license file path.

GetLicenseLogString( Assoc moduleInfo )

Returns a string containing the license info for each license.

GetModuleLicenseInfo( String applicationKey, String version, Integer numActiveUsers )

Gets information from a Content Server module license

Returns the number of active users in the system.

Validates the Content Server core license

ValidateModuleLicense( String applicationKey, String version, Integer numActiveUsers )

Validates a Content Server module license.

Class Attributes

License Error: Invalid application fingerprint.

License Error: Bad license format.

Integer BAD_VERSION

License Error: Invalid application version.

License Error: Cannot read license file.

Integer EXPIRED

License Error: Expired License.

License Error: Error generating fingerprint.

Integer INFO_ERROR

License Error: Failed to get license information.

Integer INVALID

License Error: Invalid license.

Nonproduction License Type: 1

Integer NOT_FOUND

License Error: No license found.

Integer NUMUSER_ERROR

License Error: Error getting number of active users.

Integer OLD_INVALID

License Error: An old format license that is no longer supported, or a corrupt file.

Integer OTDS_ERROR

License Error: Error getting license from OTDS.

License Error: Error getting number of active users.

Integer SAVE_ERROR

Production License Type: 2.

Temporary License Type: 0.

License Error: System is busy and cannot read license. Please try again.

License Error: Maximum number of users exceeded.

Integer UNKNOWN_ERROR

License Error: Unknown error.

Integer VALID

Valid license.

License Error: Error validating license.

Class Methods

ApplyCoreLicense

Integer ApplyCoreLicense( String license,
                          Boolean isFilePath )

Loads and validates a license file and sets it as the Content Server core license.

Parameters

license

the license content or the full path and name of the license file.

isFilePath

TRUE - file path, FALSE - license content.

Returns:

Zero if successful; Error otherwise.

ApplyModuleLicense

Integer ApplyModuleLicense( String licenseFile,
                            String applicationKey,
                            String version,
                            Integer numActiveUsers )

Loads and validates a module license file and sets it as a module license.

Parameters

licenseFile

Full path and name of the license file.

applicationKey

string identifier for the module.

version

module version.

numActiveUsers

the number of active users for the module.

Returns:

Zero if successful; Error otherwise.

GenerateFingerprint

String GenerateFingerprint()

Generates a fingerprint string for the installed system.

Returns:

A string containing the generated fingerprint if successful; Error otherwise.

GenerateReportHash

String GenerateReportHash( String licenseContent )

Returns a hash generated from the license data.

Parameters

licenseContent
                Contents of a license file.

Returns:

a string containing the report hash if successful; Error otherwise.

GetCoreLicenseInfo

Assoc GetCoreLicenseInfo()

Gets information from the Content Server core license.

Returns:

Error if error occurred; otherwise an assoc with the following structure:

Name

Type

ActiveFingerprint

String

ActiveVersion

String

CustomerName

String

EndUserCode

String

ExpirationDate

Date

LicensedFingerprint

String

LicensedVersion

String

LicensedType

String

NumActiveUsers

Integer

NumLicensedUsers

Integer

ProductName

String

SalesKitInfo

String

Status

Integer

SUID

String

TypeName

String

GetLicensedApplications

List GetLicensedApplications()

Returns a list of licensed applications.

Returns:

A list of licensed applications.

Example

    Calling the function on a CS with its WebReports licensed will return a list:
    {'Content_Server','CSAOTPERSPECTIVEMGR','WebReports'}

GetLicenseFeatureName

String GetLicenseFeatureName( String licenseContent )

Returns the feature name for the license.

Parameters

licenseContent

Contents of a license file.

Returns:

A string containing the feature name if no errors; Error otherwise.

Example

Calling the function with a WebReport license content will return 'WebReports'.

GetLicenseInfo

Assoc GetLicenseInfo( String license,
                      String version,
                      Integer numActiveUsers )

Gets the information from a license content string or a license file path.

Parameters

license

Contents of a license file.

version

The version of the running system.

numActiveUsers

optional - The number of active users of the running system.

Returns:

Error if error occurred; otherwise an assoc with the following structure:

Name

Type

ActiveFingerprint

String

ActiveVersion

String

CustomerName

String

EndUserCode

String

ExpirationDate

Date

LicensedFingerprint

String

LicensedVersion

String

LicensedType

String

NumActiveUsers

Integer

NumLicensedUsers

Integer

ProductName

String

SalesKitInfo

String

Status

Integer

SUID

String

TypeName

String

Example

        A sample valid result is given below:

         A<1,?,
            'ActiveFingerprint'='47723CB3',
            'ActiveVersion'='16.0.0',
            'CustomerName'='OpenText Internal Use Only ',
            'EndUserCode'='EU0025397',
            'ExpirationDate'=D/1900/1/0:0:0:0,
            'LicensedFingerprint'='',
            'LicensedVersion'='16.0.0',
            'LicenseType'=1,
            'NumActiveUsers'=7,
            'NumLicensedUsers'=100000,
            'ProductName'='OpenText Content Server',
            'SalesKitInfo'='',
            'Status'=0,
            'SUID'='48382-38294',
            'TypeName'='Non-production'>

GetLicenseLogString

String GetLicenseLogString( Assoc moduleInfo )

Returns a string containing the license info for each license.

Parameters

moduleInfo

An Assoc containing applications.

Returns:

A string containing the license info for each license.

GetModuleLicenseInfo

Assoc GetModuleLicenseInfo( String applicationKey,
                            String version,
                            Integer numActiveUsers )

Gets information from a Content Server module license

Parameters

applicationKey

string identifier for a module

version

The version of the module

numActiveUsers

optional - The number of active users of the module

Returns:

Error if error occurred; otherwise an assoc with the following structure:

Name

Type

ActiveFingerprint

String

ActiveVersion

String

CustomerName

String

EndUserCode

String

ExpirationDate

Date

LicensedFingerprint

String

LicensedVersion

String

LicensedType

String

NumActiveUsers

Integer

NumLicensedUsers

Integer

ProductName

String

SalesKitInfo

String

Status

Integer

SUID

String

TypeName

String

GetNumActiveUsers

Integer GetNumActiveUsers()

Returns the number of active users in the system.

Returns:

An integer representing the number of active users or Error if error occurred.

ValidateCoreLicense

Integer ValidateCoreLicense()

Validates the Content Server core license.

Returns:

Zero if success; Error otherwise.

ValidateModuleLicense

Integer ValidateModuleLicense( String applicationKey,
                               String version,
                               Integer numActiveUsers )

Validates a Content Server module license.

Parameters

applicationKey

A string identifier for the module.

version

module version.

numActiveUsers

number of active users for the module.

Returns:

Zero if success; Error otherwise.

 Copyright © 2022 OpenText Corporation. All rights reserved.