Using Auto-Configure Scripts - Lexmark C792 Manual

Lexmark document distributor sdk guide
Hide thumbs Also See for C792:
Table of Contents

Advertisement

Developing workflow solutions
The script file library.js in the TestSNS example template is an example of a library script.
Adding a library script to a solution
A library script does not require a specific file name. To begin adding a library script, add a blank script in the scripts\
folder.
To define the script as a library script, a specific structure is used:
Begin the library section of the script with an empty library() function.
Use the format library.prototype.<functionName> = function(<arguments>) for function
headers.
Create a new library object. This must be done as the last line of the script.
The following example shows the basic structure of a library script:
function library()
{
}
...
library.prototype.myFunction = function(myArgument1,myArgument2)
{
...
}
...
new library();
Accessing the functions of a library script
To access the functions of a library script from another script, create an object reference to the library script using the
context.callTask() method. The functions in the library script are then available as members of the new object.
The first argument in the callTask() method is always taskInfo.solutionName. The second argument is the
script file name with no extension. For example, if the previous library script is named "mylibrary.js," the following line
creates an object reference to that library:
var myLib = context.callTask(taskInfo.solutionName, "mylibrary");
The included functions can then be accessed as follows:
myLib.myFunction(arg1,arg2)

Using auto-configure scripts

If you have detailed knowledge of the LDD system where a solution will be deployed, then you can write an
auto‑configure script that can:
Create a device group.
Add printers to a device group.
Deploy the solution to a device group.
Configure home screens.
Discover devices.
Perform a policy update.
Set the server online.
20

Advertisement

Table of Contents
loading

This manual is also suitable for:

C925X792X925Document distributor 4.6.02

Table of Contents