.net Module AODL: Forms and Fields implementation

From Apache OpenOffice Wiki
Revision as of 16:19, 20 June 2007 by Yegorov (Talk | contribs)

Jump to: navigation, search

This is the wiki page for the Google Summer_of_Code_2007 proposal by Oleg Yegorov and mentored by Dieter Löschky and Lars Behrmann.

Proposal

FORMS
The first part of my project is to implement Forms support for the AODL library. My vision of it (briefly):

  1. The main classes for Forms support are located in the AODL.Document.Forms namespace.
  2. Each form is represented by the ODFForm class; this class should contain such properties as Href, TargetFrame, Method and others (which are the attributes of a form:form tag). It should implement the IHtml interface (allows to export non-nested forms into HTML)
  3. Those properties that have several possible values should have an enum type.
  4. Boolean properties will have an XmlBoolean type (enum with possible values: True, False, NotSet).
  5. Properties listed in form:properties tag should be reflected in a Properties property of ODFForm (these properties are application-specific). There should be smart methods that return the required property.
  6. Each form should have a collection of child controls (Controls property of ODFControlsCollection type); ODFControlsCollection will be a class derived from CollectionWithEvents.
  7. Everything connected with controls will be located in AODL.Document.Forms.Controls
  8. A separate class will stand for each control type (such as ODFText, ODFTextArea, ODFButton, ODFCheckBox etc.).
  9. ODFForm will have methods that help to search for any child controls by ID or by Name (or form by name), including those controls that are located in nested forms.
  10. TextDocument will also have a series of methods to iterate through all the controls within it.
  11. Each form has a property that represents child (one level below) forms. We should also remember that top-level form is situated in office:forms tag (unlike for those that are nested)
  12. TextDocument, OpenDocumentTextExporter and OpenDocumentImporter should be expanded to handle forms correctly while saving/loading a document.
  13. A new class FormsProcessor will be added to the AODL.Document.Import.OpenDocument.NodeProcessors namespace;

I have decided to resolve the synchronization between the draw:control in the contents nodes and the appropriate form:form element in the following way:

  1. A new auxiliary class AODL.Document.Forms.Controls.OOControlRef will be added; this is an internal AODL class that stands for draw:control tag. It will have such properties as ID, X,Y,Width,Height,AnchorType, AnchorPageNumber,StyleName,TextStyleName and others that reflect draw:control attributes. And, of course, it will have a set of common properties such as Node.
  2. ODFFormControl will be a basic class for all form controls. All specific controls such as ODFButton will derive from it. ODFFormControl will have an internal variable _controlRef (ODFControlRef) that represents its reference; all the public properties of _controlRef will be accessible through public ODFFormControl properties.
  3. ODFFormControl will have a constructor taking parent form, content container and ID string as obligatory parameters. Of course, there will be other handy overloaded constructors with more parameters.
  4. ODFForm's controls collection will have appropriate Inserted and Removed events to implement the synchronization.
  5. I'll also add synchronous deletion of control in form:form tag when the reference is deleted.

FIELDS
The implementation of Fields is quite similar to the implementation of Forms (even less tricky).

Current Status

Current status: Implementing AODL Forms.
Project blog: http://soc-aodl.blogspot.com

Student Task List

  • Subscribe to ODF Toolkit mailing list. Done.
  • Submit a filled-out copy of the Joint Copyright Assignment form (JCA). Done.
  • Workout initial implementation details. Done

Forms:

  • Create a detailed Forms project proposal. Done
  • Implement the Forms support in the AODL. Done
  • Create tests. Done

Fields

  • Create a detailed Fields project proposal. In progress
  • Implement the Fields support in the AODL. Pending
  • Test AODL fields. Pending

Further information about the ODF Toolkit

AODL code AODL Wiki page
The ODF Toolkit Wiki page.
The ODF Toolkit project homepage on the OpenOffice.org website.

Personal tools