The Authentic Scripting feature provides more flexibility and interactivity to SPS designs. These designs can be created or edited in StyleVision Enterprise and Professional editions, and can be viewed in the Authentic View of the Enterprise and Professional editions of Altova products. A complete listing of support for this feature in Altova products is given in the table below. Note, however, that in the trusted version of Authentic Browser plug-in, internal scripting is turned off because of security concerns.
Authentic Scripts Creation
Authentic Scripts Enabled
StyleVision Basic *
Authentic Desktop Enterprise
Authentic Browser Ent Trusted **
Authentic Browser Ent Untrusted
* No AuthenticView
** Scripted designs displayed. No internal macro execution or event handling. External events fired.
Authentic Scripts behave in the same way in all Altova products, so no product-specific code or settings are required.
Authentic Script Warning Dialog
If a PXF file, or an XML file linked to an SPS, contains a script and the file is opened or switched to Authentic View (in Altova products other than StyleVision), then a warning dialog (screenshot below) pops up.
You can choose one of the following options:
•Click Yes. to add the folder containing the file to the Trusted Locations list for Authentic scripts. Subsequently, all files in the trusted folder will be opened In Authentic View without this warning dialog being displayed first. The Trusted Locations list can be accessed via the menu command Authentic | Trusted Locations, and modified.
•Click No to not add the folder containing the file to the Trusted Locations list. The file will be displayed in Authentic View with scripts disabled. The Authentic Script Warning dialog will appear each time this file is opened in Authentic View. To add the file's folder to the Trusted Locations list subsequently, open the Trusted locations dialog via the menu command Authentic | Trusted Locations, and add the folder or modify as required.
|Note:||When StyleVision is accessed via its COM interface (see Programmers' Reference to see how this can be done), the security check is not done and the Authentic Script Warning dialog is not displayed. The warning dialog described above appears in the Authentic View of Altova products other than StyleVision. You, as an SPS designer, should be aware of this.|
How Authentic Scripting works
The designer of the SPS design can use Authentic Scripting in two ways to make Authentic documents interactive:
•By assigning scripts for user-defined actions (macros) to design elements, toolbar buttons, and context menu items.
•By adding to the design event handlers that react to Authentic View events.
All the scripting that is required for making Authentic documents interactive is done within the StyleVision GUI (Enterprise and Professional editions). Forms, macros and event handlers are created within the Scripting Editor interface of StyleVision and these scripts are saved with the SPS. Then, in the Design View of StyleVision, the saved scripts are assigned to design elements, toolbar buttons, and context menus. When an XML document based on the SPS is opened in an Altova product that supports Authentic Scripting (see table above), the document will have the additional flexibility and interactivity that has been created for it.
In this section
In this section we explain how Authentic Scripting works. The section is organized into the following sub-sections:
•Scripting Editor, which describes the interface in which a scripting project containing the scripts for the SPS are saved
•Macros, which shows how macros can be associated with design elements, Authentic toolbar buttons, and Authentic context menus
•Event Handlers, which shows how event handler scripts are created and used
•Scripting Options, which documents the options
Example SPS files with Authentic Scripting are in the Authentic\Scripting folder of the Examples project in the Project window of StyleVision.