7
Review, Markup, and Approval
Online Collaboration Essentials
Acrobat JavaScript-based Collaboration Driver
Acrobat JavaScript can be used to describe the workflow for a given document review, and
can be used in review management. This is done by specifying a state model for the types
of annotations a reviewer may use and creating an annotation store on the server for
customized comment and review within browser-based workflows. The
Collab
object
provides you with control over the possible states
annot
objects may have, and may be
used in conjunction with the
SOAP
object to create an annotation store.
There are several methods available within the
Dollab
object that enable you to describe
the state model for the review: these include
addStateModel
,
getStateInModel
,
transitionToState
, and
removeStateModel
.
The
addStateModel
method is used to add a new state model to Acrobat describing the
possible states for an
annot
object using the model, and the
removeStateModel
method removes the model, though it does not affect previously created
annot
objects.
Their usage is shown in the code below:
// Add a state model
try{
var myStates = new Object;
myStates["initial"] = {cUIName: "Haven’t reviewed it"};
myStates["approved"] = {cUIName: "I approve"};
myStates["rejected"] = {cUIName: "Forget it"};
myStates["resubmit"] = {cUIName: "Make some changes"};
Collab.addStateModel({
cName: "ReviewStates",
cUIName: "My Review",
oStates: myStates,
cDefault: "initial"
});
// Now transition myAnnot to the "approved" state:
myAnnot.transitionToState("ReviewStates", "approved");
}
catch(e){console.println(e);}
// Now remove the state model
try {Collab.removeStateModel("ReviewStates");}
catch(e){console.println(e);}
126
Acrobat JavaScript Scripting Guide