ODF Toolkit with .NET Support

3,438 views
3,288 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,438
On SlideShare
0
From Embeds
0
Number of Embeds
31
Actions
Shares
0
Downloads
30
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ODF Toolkit with .NET Support

  1. 1. ODF Toolkit ODF Support For .NET With AODL Lars Behrmann Sun Microsystems
  2. 2. About AODL <ul><li>.NET module of the ODF Toolkit Project </li></ul><ul><li>ODF implementation in pure C# </li></ul><ul><li>Designed straight forward </li></ul><ul><li>Hides the complexity of ODF </li></ul><ul><li>Supports text and spreadsheet documents </li></ul><ul><li>Minimum requirement: .NET 1.1 framework </li></ul><ul><li>Can be used with Mono. </li></ul>
  3. 3. ODF Support For .NET Applications <ul><li>Why ? </li></ul><ul><li>Business applications have to handle documents. </li></ul><ul><li>A lot of these are developed with .NET. </li></ul><ul><li>ODF is an accepted ISO standard. </li></ul><ul><li>ODF is a XML file format. </li></ul><ul><li>XML guarantees future accessibility. </li></ul>
  4. 4. Easy To Use <ul><li>Minimal coding effort. </li></ul><ul><li>Requires only a basic knowledge of general Document structures like: </li></ul><ul><ul><li>All documents consists of content and styles. </li></ul></ul><ul><ul><li>Contents can be tables, paragraphs, ... . </li></ul></ul><ul><ul><li>Contents could contain other contents. </li></ul></ul><ul><ul><li>Styles are used to format contents. </li></ul></ul><ul><li>With AODL these contents and styles got a real name. </li></ul>
  5. 5. Supported Document Types <ul><li>OpenDocument Text Documents </li></ul><ul><ul><li>Create, Open, Modify and Save </li></ul></ul><ul><li>OpenDocument Spreadsheet Documents </li></ul><ul><ul><li>Create, Open, Modify and Save </li></ul></ul><ul><li>All documents shares the contents and styles </li></ul><ul><ul><li>One implementation for Tables, Paragraphs, Images, ... . </li></ul></ul>
  6. 6. Import And Export Filter <ul><li>AODL offers two interfaces for import and export </li></ul><ul><ul><li>IImport </li></ul></ul><ul><ul><li>IExport </li></ul></ul><ul><ul><ul><li>Example implementation: The experimental PDF export. </li></ul></ul></ul>
  7. 7. AODL UML Class Diagram
  8. 8. Create New Documents //Create a new text document TextDocument document = new TextDocument () ; document.New () ; //Create a standard paragraph using the ParagraphBuilder Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document); //Add some simple text paragraph.TextContent.Add( new SimpleText ( document, &quot;OpenOffice.org Conference&quot; ) ) ; //Add the paragraph to the document document.Content.Add ( paragraph ) ; //Save document.SaveTo ( &quot;simple.odt&quot; ) ;
  9. 9. Modify Existing Documents //Create a new text document object TextDocument document = new TextDocument () ; //Load a text document document.Load (&quot; OOoCon2007.odt&quot; ) ; //Search for a text area control with the id = headline ODFTextArea headlineCtl = document.FindControlById (&quot; headline &quot;) as ODFTextArea; if ( headlineCtl != null) { //Set a new value for the found control headlineCtl.CurrentValue = &quot;OpenOffice.org Conference &quot; ; } //Save modified document document.SaveTo (&quot; OOoCon2007.odt&quot; ) ;
  10. 10. A Real World Scenario <ul><li>Assume you already have a shop software. </li></ul><ul><li>Now, this software should be able to create bills for your customer. </li></ul><ul><li>What will be the required steps ? </li></ul>
  11. 11. A Real World Scenario – Todo's <ul><li>Outside your application: </li></ul><ul><li>Create an OpenDocument text document as a template. </li></ul><ul><li>Use placeholder to mark insert positions. </li></ul><ul><li>Add the document as application resource. </li></ul>
  12. 12. A Real World Scenario – Todo's <ul><li>Inside your application: </li></ul><ul><li>Reference the AODL assembly. </li></ul><ul><li>Load your “template” file. </li></ul><ul><li>Find the corresponding placeholder. </li></ul><ul><li>Replace them with the data from your application. </li></ul><ul><li>Save the file. </li></ul>
  13. 13. A Real World Scenario - Result
  14. 14. Future Steps <ul><li>Future steps will be ... </li></ul><ul><li>Support for presentation and draw documents ... </li></ul><ul><li>Performance optimization ... </li></ul><ul><li>Usability optimization ... </li></ul><ul><li>Synchronization with other modules like odf4j, ... </li></ul><ul><li>etc. </li></ul>
  15. 15. Presentation End Now, Open Discussion ... Lars Behrmann Sun Microsystems

×