ODF Toolkit with .NET Support

download ODF Toolkit with .NET Support

If you can't read please download the document

Transcript of ODF Toolkit with .NET Support


ODF Toolkit
ODF Support For .NET With AODL

Lars Behrmann
Sun Microsystems

About AODL

.NET module of the ODF Toolkit Project

ODF implementation in pure C#

Designed straight forward

Hides the complexity of ODF

Supports text and spreadsheet documents

Minimum requirement: .NET 1.1 framework

Can be used with Mono.

ODF Support For .NET Applications

Why ?

Business applications have to handle documents.

A lot of these are developed with .NET.

ODF is an accepted ISO standard.

ODF is a XML file format.

XML guarantees future accessibility.

Easy To Use

Minimal coding effort.

Requires only a basic knowledge of general Document structures like:

All documents consists of content and styles.

Contents can be tables, paragraphs, ... .

Contents could contain other contents.

Styles are used to format contents.

With AODL these contents and styles got a real name.

Supported Document Types

OpenDocument Text Documents

Create, Open, Modify and Save

OpenDocument Spreadsheet Documents

Create, Open, Modify and Save

All documents shares the contents and styles

One implementation for Tables, Paragraphs, Images, ... .

Import And Export Filter

AODL offers two interfaces for import and export

IImport

IExport

Example implementation: The experimental PDF export.

AODL UML Class Diagram

Create New Documents

//Create a new text documentTextDocument document = new TextDocument();document.New();//Create a standard paragraph using the ParagraphBuilderParagraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document);//Add some simple textparagraph.TextContent.Add(new SimpleText(document, "OpenOffice.org Conference"));//Add the paragraph to the documentdocument.Content.Add(paragraph);//Save document.SaveTo("simple.odt");

Modify Existing Documents

//Create a new text document objectTextDocument document = new TextDocument();//Load a text documentdocument.Load("OOoCon2007.odt");//Search for a text area control with the id = headlineODFTextArea headlineCtl = document.FindControlById("headline") as ODFTextArea;if (headlineCtl != null) {//Set a new value for the found controlheadlineCtl.CurrentValue = "OpenOffice.org Conference";}//Save modified documentdocument.SaveTo("OOoCon2007.odt");

A Real World Scenario

Assume you already have a shop software.

Now, this software should be able to create bills for your customer.

What will be the required steps ?

A Real World Scenario Todo's

Outside your application:

Create an OpenDocument text document as a template.

Use placeholder to mark insert positions.

Add the document as application resource.

A Real World Scenario Todo's

Inside your application:

Reference the AODL assembly.

Load your template file.

Find the corresponding placeholder.

Replace them with the data from your application.

Save the file.

A Real World Scenario - Result

Future Steps

Future steps will be ...

Support for presentation and draw documents ...

Performance optimization ...

Usability optimization ...

Synchronization with other modules like odf4j, ...

etc.

Presentation End
Now, Open Discussion ...

Lars Behrmann
Sun Microsystems

Page

Speaker Presentation Name

Sun Microsystems, Inc.

Click to Edit the Title Text format

Click to edit the outline text format

Second Outline Level

Third Outline Level

Fourth Outline Level

Fifth Outline Level

Sixth Outline Level

Seventh Outline Level

Eighth Outline Level

Ninth Outline Level

Click to Edit the Sub Title Text format

Click to edit the notes format

Sep 14, 2007

Speaker

Migration to StarOffice, Speaker Notes

Page

Click to edit the title text format

Presenters Name

Presenters Title

Presenters Company

Click to edit the notes format

Page