You
can modify the general dialog XML file to respond to dialog boxes
that are generated by the system or to respond to dialog boxes that
are common to multiple applications.
Adding a filetype entry in the XML configuration fileThis procedure explains how to
update the Generate PDF service configuration file to associate
file types with native applications. To update this configuration file,
you must use Administration Console to export the configuration
data to a file. The default file name for the configuration data
is native2pdfconfig.xml.
Update the Generate PDF service configuration fileSelect Home > Services > Adobe LiveCycle PDF Generator 11 > Configuration Files,
and then select Export Configuration.
Modify the filetype-settings element in
the native2pdfconfig.xml file, as needed.
Select Home > Services > Adobe LiveCycle PDF Generator 11 > Configuration Files,
and then select Import Configuration. The configuration data
is imported into the Generate PDF service, replacing previous settings.
Remarque : The name of the application is specified as the
value of the GenericApp element’s name attribute.
This value must exactly match the corresponding name specified in
the script that you develop for that application. Likewise, the GenericApp element’s displayName attribute
should exactly match the corresponding script’s expectedWindow window
caption. Such equivalency is evaluated after resolving any regular
expressions that appear in the displayName or caption attributes.
In this example, the default configuration
data supplied with the Generate PDF service was modified to specify
that Notepad (not Microsoft Word) should be used to process files
with the file name extension .txt. Before this modification, Microsoft
Word was specified as the native application that should process
such files.
Modifications for directing text files to Notepad (native2pdfconfig.xml)<filetype-settings>
<!-- Some native app file types were omitted for brevity. -->
<!-- The following GenericApp element specifies Notepad as the native application that should be used to process files that have a txt file name extension. -->
<GenericApp
extensions="txt"
name="Notepad" displayName=".*Notepad"/>
<GenericApp
extensions="wpd"
name="WordPerfect" displayName="Corel WordPerfect"/>
<GenericApp extensions="pmd,pm6,p65,pm"
name="PageMaker" displayName="Adobe PageMaker"/>
<GenericApp extensions="fm"
name="FrameMaker" displayName="Adobe FrameMaker"/>
<GenericApp extensions="psd"
name="Photoshop" displayName="Adobe Photoshop"/>
</settings>
</filetype-settings>
Creating an environment variable to locate the native applicationCreate an environment variable that specifies
the location of the native application executable. The variable
must use the format [applicationname]_PATH, where applicationname must
exactly match the application name used in the XML configuration
file and in the script, and where the path contains the path to the
executable in double quotation marks. An example of such an environment variable
is Photoshop_PATH.
After creating the new environment variable, you must restart
the server on which the Generate PDF service is deployed.
Create a system variable in the Windows XP environmentSelect Control Panel > System.
In the System Properties dialog box, click the Advanced tab
and then click Environment Variables.
Under System Variables in the Environment Variables dialog
box, click New.
In the New System Variable dialog box, in the Variable name box,
type a name that uses the format [applicationname]_PATH.
In the Variable value box, type the full path and
file name of the application's executable file and then click OK.
For example, type: c:\windows\Notepad.exe
In the Environment Variables dialog box, click OK.
Create a system variable from the command lineIn a command
line window, type the variable definition, using this format:
[applicationname]_PATH=[Full path name]
For
example, type: NotePad_PATH=C:\WINDOWS\NOTEPAD.EXE
Start a fresh command line prompt for the system variable
to take effect.
XML filesLiveCycle includes sample XML files that
cause the Generate PDF service to use Notepad to process any files
with the file name extension .txt. This code is included in this
section. In addition, you must make the other modifications described
in this section.
Additional dialog XML fileThis
example contains the additional dialog boxes for the Notepad application. These
dialog boxes can be in addition to the ones specified by the Generate
PDF service.
Notepad dialog boxes(appmon.notepad.addition.en_US.xml)<dialogs app="Notepad" locale="en_US" version="7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dialogs.xsd">
<window caption="Caption Title">
<windowList>
<window className="Button" caption="OK" action="press"/>
</windowList>
</window>
</dialogs>
Script XML fileThis
example specifies how the Generate PDF service should interact with Notepad
to print files by using the Adobe PDF printer.
Notepad script XML file (appmon.notepad.script.en_US.xml)<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
*
* ADOBE CONFIDENTIAL
* ___________________
* Copyright 2004 - 2005 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
*-->
<!-- This file automates printing of text files via notepad to Adobe PDF printer. In order to see the complete hierarchy we recommend using the Microsoft Spy++ which details the properties of windows necessary to write scripts. In this sample there are total of eight steps-->
<application name="Notepad" version="9.0" locale="en_US" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="scripts.xsd">
<!-- In this step we wait for the application window to appear -->
<step>
<expectedWindow>
<window caption=".*Notepad"/>
</expectedWindow>
</step>
<!-- In this step, we acquire the application window and send File->Open menu bar, menu item commands and the expectation is the windows Open dialog-->
<step>
<acquiredWindow>
<window caption=".*Notepad">
<virtualInput>
<menuBar>
<selection>
<name>File</name>
</selection>
<selection>
<name>Open...</name>
</selection>
</menuBar>
</virtualInput>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Open"/>
</expectedWindow>
</step>
<!-- In this step, we acquire the Open window and then select the 'Edit' widget and input the source path followed by clicking on the 'Open' button . The expectation of this 'action' is that the Open dialog will disappear -->
<step>
<acquiredWindow>
<window caption="Open">
<windowList>
<window className="ComboBoxEx32">
<windowList>
<window className="ComboBox">
<windowList>
<window className="Edit" action="inputSourcePath"/>
</windowList>
</window>
</windowList>
</window>
</windowList>
<windowList>
<window className="Button" caption="Open" action="press"/>
</windowList>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Open" action="disappear"/>
</expectedWindow>
<pause value="30"/>
</step>
<!-- In this step, we acquire the application window and send File->Print menu bar, menu item commands and the expectation is the windows Print dialog-->
<step>
<acquiredWindow>
<window caption=".*Notepad">
<virtualInput>
<menuBar>
<selection>
<name>File</name>
</selection>
<selection>
<name>Print...</name>
</selection>
</menuBar>
</virtualInput>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Print">
</window>
</expectedWindow>
</step>
<!-- In this step, we acquire the Print dialog and click on the 'Preferences' button and the expected window in this case is the dialog with the caption '"Printing Preferences' -->
<step>
<acquiredWindow>
<window caption="Print">
<windowList>
<window caption="General">
<windowList>
<window className="Button" caption="Preferences" action="press"/>
</windowList>
</window>
</windowList>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Printing Preferences"/>
</expectedWindow>
</step>
<!-- In this step, we acquire the dialog "Printing Preferences' and select the combo box which is the 10th child of window with caption '"Adobe PDF Settings' and select the first index. (Note: All indeces start with 0.) Besides this we uncheck the box which has the caption '"View Adobe PDF results' and we click on the button OK. The expectation is that 'Printing Preferences' dialog disappears. -->
<step>
<acquiredWindow>
<window caption="Printing Preferences">
<windowList>
<window caption="Adobe PDF Settings">
<windowList>
<window className="Button" caption="View Adobe PDF results" action="uncheck"/>
</windowList>
<windowList>
<window className="Button" caption="Ask to Replace existing PDF file" action="uncheck"/>
</windowList>
</window>
</windowList>
<windowList>
<window className="Button" caption="OK" action="press"/>
</windowList>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Printing Preferences" action="disappear"/>
</expectedWindow>
</step>
<!-- In this step, we acquire the 'Print' dialog and click on the Print button. The expectation is that the dialog with caption 'Print' disappears. In this case we use the regular expression '^Print$' for specifying the caption given there could be multiple dialogs with caption that includes the word Print. -->
<step>
<acquiredWindow>
<window caption="Print">
<windowList>
<window caption="General"/>
<window className="Button" caption="^Print$" action="press"/>
</windowList>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Print" action="disappear"/>
</expectedWindow>
</step>
<step>
<expectedWindow>
<window caption="Save PDF File As"/>
</expectedWindow>
</step>
<!-- Finally in this step, we acquire the dialog with caption "Save PDF File As" and in the Edit widget type the destination path for the output PDF file and click on the Save button. The expectation is that the dialog disappears-->
<step>
<acquiredWindow>
<window caption="Save PDF File As">
<windowList>
<window className="Edit" action="inputDestinationPath"/>
</windowList>
<windowList>
<window className="Button" caption="Save" action="press"/>
</windowList>
</window>
</acquiredWindow>
<expectedWindow>
<window caption="Save PDF File As" action="disappear"/>
</expectedWindow>
</step>
<!-- We can always set a retry count or a maximum time for a step. In case we surpass these limitations, PDF Generator generates this abort message and terminates processing. -->
<abortMessage msg="15078"/>
</application>
|
|
|