Professional Documents
Culture Documents
Marc Chan, SAP NetWeaver RIG APJ Boris Magocsi, SAP NetWeaver RIG Americas Peter McNulty, SAP NetWeaver PMO Daniel Yackel, SAP NetWeaver RIG Americas
Disclaimer
This presentation outlines our general product direction and should not be relied on in making a purchase decision. This presentation is not subject to your license agreement or any other agreement with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to develop or release any functionality mentioned in this presentation. This presentation and SAP's strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent.
Agenda
Adobe LiveCycle Designer enables a form developer to build intelligent forms using only the options provided in the Adobe LiveCycle Designer graphical interface. By scripting against the XML Form Object Model, the form developer may further manipulate all aspects of the form, extending the functionality of the form beyond what is available through the LiveCycle Designer interface. Scripting is supported in two languages: FormCalc, a calculation language created by Adobe, and JavaScript, a powerful and popular scripting language. Detail of the XML Form Object Model can be found from:
http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pdf
Use the Script Editor to write scripts for a form design The scripts written will be embeded in the XML Source. Use the PDF Preview tab to view and test a form design as a PDF form
Use the Hierarchy palette to select and manipulate objects, and to locate an object in the form hierarchy.
Make sure Dynamic XML Form is set to enable script execution on the form during runtime. In the Adobe LiveCycle Designer, go to Edit -> Form Properties -> Defaults. Configure the XDP Preview Format in the Preview section and PDF Render Format in the Server section.
The visibility of an UI element is controlled by setting the presence properties to visible or invisible. In the same way, you can control the visibility of a subform so you can toggle the presence of all the UI elements inside.
Example 1: Setting a field to be visible or invisible // If a field is visible, make it invisible and vice versa. if(Field1.presence == "visible){ Field1.presence = "invisible"; } else { Field1.presence = "visible"; } Example 2: Setting a subform to be visible when a checkbox is checked // If the checkbox is checked, set the subform to be visible and vice versa if (CheckBox1.rawValue == 0) { Subform1.presence = "invisible"; } else { Subform1.presence = "visible"; }
A table row is basically a subform. Inserting a row in the table actually means adding an instance of the subform on the table. Make use of the instanceManger of the subform to insert or remove instance of the table row.
In Web Dynpro environment, the number of table rows to be displayed is controlled by the number of instance of the Web Dynpro context node the table row binds to. For example, if you have 5 instances of the context node during runtime, the table on the PDF generated will have 5 table rows by default. To allow the PDF only display 1 table row by default but allow users to add more rows dynamically, the followings have to be done: Remove the subform instances created by Web Dynpro runtime during initialization. This can be done by a simple for-loop script in the initialize action of the Table subform. The number of instances of Web Dynpro context nodes should be treated as the max number of rows you can have in the table. You should configure this as the max number of row for the Table row. Clicking on the Add Row button will just insert an instance of the subform just like before.
Supposed you want to sum up the prices in a table for the total every time a user enters the amount. This can be easily done by using the FormCalc script on the exit event on the field where the user enters the amount.
Agenda
IWDPDFDocument API allows dynamic construction and manipulation of new or existing PDF document objects. You can:
Create documents using a template (layout) and data. Template + data = PDF. Add attachments to documents Change the document appearance (hide menu bars, magnification) Digitally sign the document using a private key Change the dynamic mode of the document Extract data in XML form from an existing document
Templates in XDP
XML Data Package (XDP) allows PDF content to be packaged within an XML container. XDP can contain template information to build the UI: drop downs, text fields, etc. <field name="DestinationCity" y="127mm" x="19.05mm" w="101.6mm" h="9mm"> <ui> <textEdit> <border> <edge stroke="lowered"/> </border> <margin/> </textEdit> </ui> ... <bind match="dataRef" ref="$record.TravelData[*].DestinationCity"/> </field>
XML Data
Use WDResourceFactory to create IWDResource objects from byte arrays, InputStreams, or context attributes. Example of loading a resource from deployment unit:
String resultPDFPath = WDURLGenerator.getResourcePath( wdComponentAPI.getDeployableObjectPart(), example.pdf"); FileInputStream in = new FileInputStream(resultPDFPath); IWDResource resource = WDResourceFactory. createResource(in, "result.pdf", WDWebResourceType.PDF, false);
Once you have the IWDPDFDocument of the pdf, you can apply the getData() method to retrieve the data from it. Below is a sample custom method for doing so.
private String getPDFData( IWDPDFDocument document ) { try { InputStream ins = document.getData(); StringWriter sw = new StringWriter(); while ( ins.available() > 0 ) { sw.write(ins.read()); } return sw.toString(); } catch ( IOException e ) { throw new WDRuntimeException("Can not read PDF data: " + e); } }
Building Your Business with SDN Subscriptions SDN Subscriptions offers developers and consultants like you, an annual license to the complete SAP NetWeaver platform software, related services, and educational content, to keep you at the top of your profession.
SDN Software Subscriptions: (currently available in U.S. and Germany)
A
one year low cost, development, test, and commercialization license to the complete SAP NetWeaver software platform Automatic notification for patches and updates Continuous learning presentations and demos to build expertise in each of the SAP NetWeaver platform components A personal SAP namespace
Starter Kit
To learn more or to get your own SDN Subscription, visit us at the Community Clubhouse or at www.sdn.sap.com/irj/sdn/subscriptions
SAP 2008 / SAP TechEd 08 / UP361 Page 22
Teams with certified architects and developers deliver projects on specification, on time, and on budget more often than other teams.
2008 IDC Certification Analysis
SAP Certified Application Professional status is proof of quality, and thats what matters most to customers.*
Conny Dahlgren, SAP Certified Professional
Take advantage of the enhanced, expanded and multi tier certifications from SAP today!
Further Information
Thank you!
Thank You !
SAP 2008 / SAP TechEd 08 / UP361 Page 26
Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrckliche schriftliche Genehmigung durch SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen knnen ohne vorherige Ankndigung gendert werden. Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte knnen Softwarekomponenten umfassen, die Eigentum anderer Softwarehersteller sind. SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, SAP Business ByDesign, ByDesign, PartnerEdge und andere in diesem Dokument erwhnte SAP-Produkte und Services sowie die dazugehrigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Lndern weltweit. Alle anderen in diesem Dokument erwhnten Namen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben im Text sind unverbindlich und dienen lediglich zu Informationszwecken. Produkte knnen lnderspezifische Unterschiede aufweisen. Die in dieser Publikation enthaltene Information ist Eigentum der SAP. Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, nur mit ausdrcklicher schriftlicher Genehmigung durch SAP AG gestattet. Bei dieser Publikation handelt es sich um eine vorlufige Version, die nicht Ihrem gltigen Lizenzvertrag oder anderen Vereinbarungen mit SAP unterliegt. Diese Publikation enthlt nur vorgesehene Strategien, Entwicklungen und Funktionen des SAP-Produkts. SAP entsteht aus dieser Publikation keine Verpflichtung zu einer bestimmten Geschfts- oder Produktstrategie und/oder bestimmten Entwicklungen. Diese Publikation kann von SAP jederzeit ohne vorherige Ankndigung gendert werden. SAP bernimmt keine Haftung fr Fehler oder Auslassungen in dieser Publikation. Des Weiteren bernimmt SAP keine Garantie fr die Exaktheit oder Vollstndigkeit der Informationen, Texte, Grafiken, Links und sonstigen in dieser Publikation enthaltenen Elementen. Diese Publikation wird ohne jegliche Gewhr, weder ausdrcklich noch stillschweigend, bereitgestellt. Dies gilt u. a., aber nicht ausschlielich, hinsichtlich der Gewhrleistung der Marktgngigkeit und der Eignung fr einen bestimmten Zweck sowie fr die Gewhrleistung der Nichtverletzung geltenden Rechts. SAP haftet nicht fr entstandene Schden. Dies gilt u. a. und uneingeschrnkt fr konkrete, besondere und mittelbare Schden oder Folgeschden, die aus der Nutzung dieser Materialien entstehen knnen. Diese Einschrnkung gilt nicht bei Vorsatz oder grober Fahrlssigkeit. Die gesetzliche Haftung bei Personenschden oder Produkthaftung bleibt unberhrt. Die Informationen, auf die Sie mglicherweise ber die in diesem Material enthaltenen Hotlinks zugreifen, unterliegen nicht dem Einfluss von SAP, und SAP untersttzt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewhrleistungen oder Zusagen ber Internetseiten Dritter ab. Alle Rechte vorbehalten.
SAP 2008 / SAP TechEd 08 / UP361 Page 27