Lexmark X925 Lexmark Document Distributor - Page 33

Understanding the objects used in solution development, Top-level objects, Prompts

Page 33 highlights

Developing workflow solutions 33 Understanding the objects used in solution development Most tasks in scripted solutions for the Lexmark Document Distributor are completed by creating and manipulating objects. The Solution Builder Toolkit includes three main types of objects specific to development of solutions for Lexmark Document Distributor: top-level objects, prompts, and services. Top-level objects Top-level objects provide global references to the entity that launched the script, including references to the printer, confirmation page, prompts and services, and task information. For example, the taskInfo object is used to access and set task information, such as the IP of the printer that originated the task or the status displayed with the job in LMC, and the caller object is used to execute a prompt on the printer. function main() { ... // Use taskInfo to get the address of the originating printer var printerIP = taskInfo.printer; // Use taskInfo to set the task status in LMC taskInfo.status = "Running"; ... // Use the caller object to execute the prompt caller.ask(mystringprompt); ... } Prompts Prompts are used primarily during the document capture stage to receive inputs, including both documents and answers to prompts, from the caller (the printer or software client). The following example uses a string prompt to illustrate the basic structure necessary to create, manipulate, and execute most prompts, although some prompts use a different structure. For more information and examples for specific prompts, see the Lexmark Document Distributor Script Reference Guide. Note that a separate function is used for the prompt object to enhance readability and reusability of code. function main() { ... var value = promptForString() ... } function promptForString() { // Create instance of the StringPrompt object var myprompt = new StringPrompt; // Set text to display when the prompt is executed myprompt.text = "Enter a string";

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82

Understanding the objects used in solution development
Most tasks in scripted solutions for the Lexmark Document Distributor are completed by creating and manipulating
objects. The Solution Builder Toolkit includes three main types of objects specific to development of solutions for
Lexmark Document Distributor: top-level objects, prompts, and services.
Top-level objects
Top-level objects provide global references to the entity that launched the script, including references to the printer,
confirmation page, prompts and services, and task information.
For example, the
taskInfo
object is used to access and set task information, such as the IP of the printer that
originated the task or the status displayed with the job in LMC, and the
caller
object is used to execute a prompt
on the printer.
function main()
{
// Use taskInfo to get the address of the originating printer
var printerIP = taskInfo.printer;
// Use taskInfo to set the task status in LMC
taskInfo.status = "Running";
// Use the caller object to execute the prompt
caller.ask(mystringprompt);
}
Prompts
Prompts are used primarily during the document capture stage to receive inputs, including both documents and answers
to prompts, from the caller (the printer or software client).
The following example uses a string prompt to illustrate the basic structure necessary to create, manipulate, and execute
most prompts, although some prompts use a different structure. For more information and examples for specific
prompts, see the
Lexmark Document Distributor Script Reference Guide
. Note that a separate function is used for the
prompt object to enhance readability and reusability of code.
function main()
{
var value = promptForString()
}
function promptForString()
{
// Create instance of the StringPrompt object
var myprompt = new StringPrompt;
// Set text to display when the prompt is executed
myprompt.text = "Enter a string";
Developing workflow solutions
33