I haven't written to this blog for quite a long period of time...
Just to summarize: my official task for GSoC has been completed :)
now I will be working on another project for OpenOffice.org : implementing XForms model in UNO.
In any case, if I somehow return back to the AODL, I'll write here ;)
Wednesday, August 1, 2007
Thursday, July 19, 2007
Sunday, July 15, 2007
I've just released a new version of AODL.
Several major and minor bugs have been fixed and new tests were introduced.
Major bugs:
- When performing TextDocument.Forms.Remove or TextDocument.Forms.Clear the appropriate ODFControlRefs were not removed from the content collections. As a result, "placeholders" pointing to non-existent controls remained in the document
- The same for ODFForm.Controls
I will continue looking for new bugs :)
Several major and minor bugs have been fixed and new tests were introduced.
Major bugs:
- When performing TextDocument.Forms.Remove or TextDocument.Forms.Clear the appropriate ODFControlRefs were not removed from the content collections. As a result, "placeholders" pointing to non-existent controls remained in the document
- The same for ODFForm.Controls
I will continue looking for new bugs :)
Tuesday, July 3, 2007
We've been disputing about storing field references in a centralized container with my mentor Lars Behrmann :)
I've made some changes to the code to fit the exact needs:
1. I've added a base abstract class Field. It fully implements the
IContent interface and has a Value property (internal field value).
It also has an internal _collection property that defines the content
collection it is located in (paragraph etc.)
2. A typed FieldsCollection has been added and a Fields property to
the TextDocument class.
FieldsCollection has FindFieldByName method that helps to look up the desired
field in the collection; such methods as Add, Remove etc. are
overloaded in such a way that they support full synchronization with
the content collection the field snippet is _really_ stored in.
IContentCollection has also been modified to maintain this
synchronization.
for example think about this piece of code:
Paragraph p1 = new Paragraph(td);
p1.TextContent.Add(new SimpleText(td, "Insert text here: "));
Placeholder plch1 = new Placeholder(td, PlaceholderType.Text, "A text placeholder");
plch1.Value = "Text";
p1.Content.Add(plch1);
td.Content.Add(p1);
after executing this, td.Fields will contain the plch1 Placeholder
reference.
If we do this:
Field f = td.Fields.FindFieldByValue("Text");
td.Fields.Remove(f);
the field will also be removed from p1.Content.
And conversely, if we do
p1.Content.Remove(plch1),
the td.Fields collection will be empty :)
3. Of course, the TextDocument.Fields collection is properly filled
while doing import.
4. When exporting a document to HTML, any field is replaced with its
internal value.
Now I'm working on testing all these new features :)
I've made some changes to the code to fit the exact needs:
1. I've added a base abstract class Field. It fully implements the
IContent interface and has a Value property (internal field value).
It also has an internal _collection property that defines the content
collection it is located in (paragraph etc.)
2. A typed FieldsCollection has been added and a Fields property to
the TextDocument class.
FieldsCollection has FindFieldByName method that helps to look up the desired
field in the collection; such methods as Add, Remove etc. are
overloaded in such a way that they support full synchronization with
the content collection the field snippet is _really_ stored in.
IContentCollection has also been modified to maintain this
synchronization.
for example think about this piece of code:
Paragraph p1 = new Paragraph(td);
p1.TextContent.Add(new SimpleText(td, "Insert text here: "));
Placeholder plch1 = new Placeholder(td, PlaceholderType.Text, "A text placeholder");
plch1.Value = "Text";
p1.Content.Add(plch1);
td.Content.Add(p1);
after executing this, td.Fields will contain the plch1 Placeholder
reference.
If we do this:
Field f = td.Fields.FindFieldByValue("Text");
td.Fields.Remove(f);
the field will also be removed from p1.Content.
And conversely, if we do
p1.Content.Remove(plch1),
the td.Fields collection will be empty :)
3. Of course, the TextDocument.Fields collection is properly filled
while doing import.
4. When exporting a document to HTML, any field is replaced with its
internal value.
Now I'm working on testing all these new features :)
Tuesday, June 26, 2007
I've spent some time coding the initial implementation of the Fields.
Currently mostly all the features required by the official GSOC task are completed.
Fields that are fully functional:
- TextInput
- VariableSet
- PageNumber
- DateField
- Placeholder
I've also created a series of tests and made some improvements to the Forms.
At present time both export and import of Fields are supported :)
Currently mostly all the features required by the official GSOC task are completed.
Fields that are fully functional:
- TextInput
- VariableSet
- PageNumber
- DateField
- Placeholder
I've also created a series of tests and made some improvements to the Forms.
At present time both export and import of Fields are supported :)
Wednesday, June 20, 2007
Here is my preliminary vision of Fields:
- All the fields-related classes are located in AODL.Document.Fields namespace
- All the Fields classes that represent the appropriate 'content' snippets implement the IContent interface.
- Placeholder and TextInput classes stand for text:placeholder and text:text-input fields respectively.
- Placeholder class has such properties as PlaceholderType, Value, Description and some others. PlaceholderType is an enumeration.
- TextInput class has such Value, Descriptions properties etc.
- Implementation of text:variable-set will be separated in two classes: VariableDecl and VariableSet. VariableDeclCollection will be a class deriving from CollectionWithEvents to handle variable declaration lists.
- VariableDecl will stand for variable declaration snippet. Main properties besides Name and Node: Name and VariableValueType
- TextDocument is augmented with a variable declaration list property
- TextDocument has methods to find any VariableDecl. For example, by its name.
- VariableSet is a class that implements the text:variable-set. It has a series of properties bound to the possible attributes of text:variable-set tag.
- Of course, there will be some kind of synchronization between the two last mentioned classes
- Import/export handlers will support fields.
Saturday, June 16, 2007
Hi everybody who reads this blog,
this week I gonna be a little more busy than before because of my summer exams at the University. So I will probably be posting to this blog more rarely :)
My AODL Forms implementation (first part of my GSOC objective) is nearly finished. After some discussions with my mentor Lars Behrmann we decided that the thing I will concentrate now on is fixing bugs, writing tests and creating a demo application.
The first two points are in progress now. The third one is almost completed, but I've changed the initial goal - it was writing a demo application that loads any ODF file and creates a panel with controls corresponding to them. However, there could be a lot of problems with their positioning (ponder about a 100-page document with ODF Forms on every page). Of course, a scrollable panel could be created, but I decided to make a little bit simplier app that just creates a panel with a fixed set of controls and then "exports" and "imports" its values from the similar ODF Form.
Nevertheless, if I have enough time I will add extra features to it :)
The next step is ODF Fields - my second part of the GSoC!
I will be creating a detailed overview of their implementation soon.
Cheers!
Upd. I've just found a nasty bug producing an error while performing New-Load-Save, New-New-Save or Load-Load-Save with the same TextDocument instance.
It's already fixed :)
this week I gonna be a little more busy than before because of my summer exams at the University. So I will probably be posting to this blog more rarely :)
My AODL Forms implementation (first part of my GSOC objective) is nearly finished. After some discussions with my mentor Lars Behrmann we decided that the thing I will concentrate now on is fixing bugs, writing tests and creating a demo application.
The first two points are in progress now. The third one is almost completed, but I've changed the initial goal - it was writing a demo application that loads any ODF file and creates a panel with controls corresponding to them. However, there could be a lot of problems with their positioning (ponder about a 100-page document with ODF Forms on every page). Of course, a scrollable panel could be created, but I decided to make a little bit simplier app that just creates a panel with a fixed set of controls and then "exports" and "imports" its values from the similar ODF Form.
Nevertheless, if I have enough time I will add extra features to it :)
The next step is ODF Fields - my second part of the GSoC!
I will be creating a detailed overview of their implementation soon.
Cheers!
Upd. I've just found a nasty bug producing an error while performing New-Load-Save, New-New-Save or Load-Load-Save with the same TextDocument instance.
It's already fixed :)
Subscribe to:
Posts (Atom)