Use XForms and ODF to implement interactive office documents

Source: Internet
Author: User
Tags ibm developerworks

Introduction

Common office documents provide us with rich input methods. In addition to text, you can use tables, graphs, charts, and other forms to better express information, however, it is often used only as a carrier of static information and has limited interaction capabilities.

In addition to some formatting terms, a loan contract also includes the lender's information, loan quota, loan bank information, and bank loan approval records. After entering information from multiple parties, A valid loan contract can be generated. Imagine such an office document, which can be used as a carrier of a loan contract, flows in the loan workflow, and its content is constantly supplemented and modified in the workflow. At the end of the workflow, a valid formal loan contract is generated. The custom input content in the loan contract can be extracted at will and provided to end users in different views for modification. At the same time, users' modifications will also affect the dynamic changes in their associated content in the contract document. For example, the loan quota and repayment period data are associated with the annual repayment amount chart in the contract document, when the loan quota and repayment period data change, the associated chart is automatically updated to reflect the change in the repayment amount more vividly.

This interactive Office document can be implemented using ODF and XForms. This article describes this interactive document through an example.

Back to Top

Introduction to XForms and ODF

XForms is W3C form standard. The most significant feature of XForms is that it separates the logic, representation, and data of a form, form an XML-based abstract form definition unrelated to platforms and devices. The logic layer includes the control and management of various fields in the form, including filling, multi-page, form order, and legality check. The presentation layer describes the form performance, that is, what form control component is used, and what events are responded; the data layer adds more data structures and maintains data consistency for the form by applying a richer schema or type to the actual data source. currently, Lotus forms supports the XForms standard. Its xfdl document based on XForms provides a wizard form input function and more complex formula support, the security check and full-text submission capabilities of Data signatures are also supported by attachments. Other documents are stored as attachments in xfdl documents.

ODF (Open Document Format) is a standard XML-based Office document format, including workbooks, charts, presentations, and word processing files. The biggest advantage of the ODF format is its openness and inheritance. documents based on the ODF format can still be used for any office software of the latest version after many years. Meanwhile, ODF uses XForms as its form standard, that is, the XForms model can be embedded into ODF documents. IBM Lotus Symphony provides comprehensive support for ODF document formats. It provides a wide range of document content display methods and supports the display and storage of XForms models.

Based on the above background, XForms provides the ideal logic for separation of data and representation, while ODF documents support XForms, which makes it possible to implement interactive office documents.

Back to Top

Architecture Diagram

The XForms document runs in the form editor. It contains the logic layer, data layer, and presentation layer of XForms, and ODF attachment, in addition, the XML data model of the document data layer corresponds to the XML data model of the XForms data layer in the ODF attachment. You can enter the form in the form editor wizard. After the input is complete, you can open the attachment. In this case, the ODF document will be opened in the ODF editor, and the form data you enter will be updated accordingly in the ODF document content. You can browse the document content in the ODF editor and modify the corresponding data. When you switch back to the form editor, you will find that the data is modified in the ODF document, synchronization is also performed in the form editor.

Figure 1. flowchart of interactive Office document Runtime

Among them, we use Lotus forms as the form Editor, Lotus Symphony as the ODF editor, and use Lotus Notes/Expeditor compound application technology to achieve seamless integration and data exchange between the two applications. It can be seen that the Lotus/Expeditor compound application has become a bridge between two applications for data exchange. Lotus forms and Lotus Symphony provide APIs for processing XForms data models respectively.

Figure 2. Interactive Office document Architecture

Back to Top

Examples of interactive office documents

The following example shows how this interactive Office document works at runtime. Assume that a customer is filling out a loan contract and enters basic information in the form view wizard. The user entered the name of the Loan Bank.

Figure 3. Form view wizard-bank information page

Then, on the next Wizard Page, the user enters the lender's information. The form view can validate each input item. For example, if the information entered by the user in the zip code is invalid, the view will remind the user of this error.

Figure 4. Form view wizard-applicant information page

After you complete the basic information in the form view, you can click "loan agreement" to view the corresponding contract content. The information entered by the user in the form view has been updated to the contract text.

Figure 5.contract document in ODF Editor

In addition, the loan amount information entered by the user in the form view can be displayed in charts in the ODF document content, which makes the loan information more intuitive. For example, the ratio of each purpose in the loan application to the loan.

Figure 6. dynamically changing charts

You can edit the contract content in the ODF Editor, such as modifying Loan Bank and lender information. You can also add, delete, or modify the formatting terms in the contract. After the modification, the user clicks "return to form" to return to form view.

Figure 7. Edit contract document

Return to the form view and you will find that the modified content in the ODF editor has been updated in the form view. In fact, all modifications to the contract have been synchronized to the form view.

Figure 8. Bank Information Update

Figure 9. Applicant Information Update

Through the above examples, we can see that the use of XForms model and ODF documentation makes office documents more user-friendly and interoperable. In addition, the form view of Lotus form also provides the digital signature function. After the contract is completed, the contract content cannot be modified, lotus Symphony can also be used to print the contract directly.

References

    • Get started with IBM Lotus Symphony technology.

    • Read developerworksArticle"How to create an XForms document in IBM Lotus Symphony"
    • Get started with The XForms tutorial in the XML area of IBM developerworks.
    • Get more technical articles about Lotus forms through the IBM developerworks China Lotus technology zone.
    • Visit the developerworks Lotus composite applications page.
    • Read the developerworks article "Lotus Expeditor 6.1-based Composite Application Development"
    • Read the developerworks article "Integrating Lotus Symphony in Lotus Notes composite applications"

About the author

Su Hefeng joined IBM in 2005 and is now engaged in Lotus Symphony R & D at the IBM China Software Development Center. He focuses on document interoperability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.