MeadCo.ScriptX.Print.Licensing
A static class wrapping calls to the server API to install / manage a client license for ScriptX.Services for Windows PC.
The purpose of these libraries is to assist those with a body of client javascript code targetting use of the ScriptX Add-On for Internet Explorer. These libraries assist with continuing with a large part of the code intact when transitioning to using ScriptX.Services instead/as well.
This module is only required when working with ScriptX Services for Windows PC.
A license must be 'applied' to the current html document/window before calls to printing APIs that use the license can be made.
This module is NOT required when working with Cloud or On Premise services as the license installation and management occurs at the server.
Requires: meadco-core.js
Members
# static errorMessage
Get the text of the last error.
Properties:
Name | Type | Description |
---|---|---|
errorMessage |
string
|
# static errorMessage
Get the text of the last error.
Properties:
Name | Type | Description |
---|---|---|
errorMessage |
string
|
# static License
Get the details on the connected license. If it hasnt been applied yet, then query for the details (but dont apply it and connectLite() MUST have been called).
Warning this function is synchronous, GetLicenseAsync() should be used.
Properties:
Name | Type | Description |
---|---|---|
License |
license
|
# static result
Get the result code for the last attempt to apply a license.
Basically faked for the benefit of code compatibility with the add-on
Properties:
Name | Type | Description |
---|---|---|
result |
number
|
# static validLicense
Get whether a license has been applied successfully
Properties:
Name | Type | Description |
---|---|---|
validLicense |
boolean
|
# static version
Get the version of this module as a string major.minor.hotfix.build
Properties:
Name | Type | Description |
---|---|---|
version |
string
|
Methods
# static apply(licenseGuid, revision, path) → {license}
Apply (make usable) the MeadCo ScriptX Client license for use with this content. If the license is not already cached it will be downloaded and cached. It is strongly suggested you request that the silent option is enabled in the license (it is by default for ScriptX.Services for Windows PC licenses)
The license must list the url of the content to which it is being applied.
This call is synchronous and therefore not recommended. Use applyAsync()
Parameters:
Name | Type | Description |
---|---|---|
licenseGuid |
string
|
the license GUID as provided by MeadCo. |
revision |
number
|
the revision number of the licsnse as provided by MeadCo. |
path |
string
|
fully qualified path to the license file (.mlf file). Use the value 'warehouse' to download from the public MeadCo License warehouse |
details the license that was sucessfully applied, null if none available
license
# static applyAsync(licenseGuid, revision, path, resolve, reject)
Apply (make usable) the MeadCo ScriptX Client license for use with this content. If the license is not already cached it will be downloaded and cached. It is strongly suggested you request that the silent option is enabled in the license (it is by default for ScriptX.Services for Windows PC licenses)
The license must list the url of the content to which it is being applied.
Parameters:
Name | Type | Description |
---|---|---|
licenseGuid |
string
|
the license GUID as provided by MeadCo. |
revision |
number
|
the revision number of the licsnse as provided by MeadCo. |
path |
string
|
fully qualified path to the license file (.mlf file). Use the value 'warehouse' to download from the public MeadCo License warehouse |
resolve |
function
|
function to call on success |
reject |
function
|
function to call on failure with reason for failure |
# static connect(serverUrl, slicenseGuid)
Specify the server to use and the license Guid.
Parameters:
Name | Type | Description |
---|---|---|
serverUrl |
string
|
the 'root' url to the server (the api path will be added by the library) |
slicenseGuid |
string
|
the license GUID as provided by MeadCo. Optional unless will call GetLicenseAsync() without calling apply |
# static connectLite(serverUrl, slicenseGuid, revision, path)
Specify the server to use and the license Guid in order to get details on the license via the License property or function GetLicenseAsync()
Parameters:
Name | Type | Description |
---|---|---|
serverUrl |
string
|
the 'root' url to the server (the api path will be added by the library) |
slicenseGuid |
string
|
the license GUID as provided by MeadCo. Optional unless will call GetLicenseAsync() without calling apply |
revision |
number
|
the revision number of the licsnse as provided by MeadCo. |
path |
string
|
fully qualified path to the license file (.mlf file). Use the value 'warehouse' to download from the public MeadCo License warehouse |
# static GetLicenseAsync(resolve, reject)
Get the details on the connected license. If it hasnt been applied yet, then query for the details (but dont apply it and connectLite() MUST have been called).
Parameters:
Name | Type | Description |
---|---|---|
resolve |
function
|
function to call on success |
reject |
function
|
function to call on failure with reason for failure |
Type Definitions
# license
License details
Properties:
Name | Type | Description |
---|---|---|
guid |
string
|
The unique id of the license |
company |
string
|
The name of the license owner |
companyHomePage |
string
|
Url of company home page |
from |
Date
|
Date license is valid from |
to |
Date
|
Date license is vaid till |
options |
LicenseOptions
|
The options enabled by the license |
domains |
Array.string
|
the domains the license can be used from |
# LicenseOptions
The capabilities that can be licensed.
Properties:
Name | Type | Description |
---|---|---|
basicHtmlPrinting |
boolean
|
True if Add-on compatible basic html printing is available (always true) |
advancedPrinting |
boolean
|
True if Add-on compatible advanced html printing features are available |
enhancedFormatting |
boolean
|
True if Add-on compatible enhanced formatting is available |
printPdf |
boolean
|
True if printing PDF files is available |
printRaw |
boolean
|
True if Raw printing is available |