|
List Info
Thread: odf4j text document classes
|
|
| odf4j text document classes |

|
2007-06-08 05:13:16 |
Hi Amit,
I think it would make the most sense if you work on the
refinement of
the text document API. For instance by adding methods to the
classes
that allow to access to useful properties. For example:
org.openoffice.odf.text.Element.getTextStyleName() return
the name of
the text-style that is applied to the given element.
Please try to think about what other information would be
good to make
available on which objects and than discuss this on the
list.
When implementing such methods, keep in mind that the
architecture is
scuh that all the actual state is kept in the DOM-node. For
instance,
the way to implement getTextStylename is not to add a
textStyleName
member with a getter method to the Element class which would
be
initialized together with the object instance. You would
rather pull the
information from the underlying XML whenever it is
requested.
You might than investigate adding more classes for text
documents,
representing footnotes, cross-references or links...
After that, or alternatively you may want to work on stlye
handling.
All the best,
Lars
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: odf4j text document classes |

|
2007-06-08 05:32:20 |
Hi Lars,
Great to See you back
> I think it would make the most sense if you work on the
refinement of
> the text document API. For instance by adding methods
to the classes
> that allow to access to useful properties. For
example:
> org.openoffice.odf.text.Element.getTextStyleName()
return the name of
> the text-style that is applied to the given element.
>
> Please try to think about what other information would
be good to make
> available on which objects and than discuss this on the
list.
As you must be knowing I am currently working on
OdtToText2.java which
currently supports extracting Headings, List Items,
Sections
Information from ODT documents.
Then I started off with providing "Frames"
support; But shelved the
plans since BE suggested that I go for simpler/easier things
first. So
currently I am working on adding support for other features
like -
Hyperlinks, Bold Text, Italics text , etc
So should I carry on with this, or start working on the
topics that
you have suggested now.
Regards
--
Amit krishna Saha
[URL]:http://amitsaha.in
.googlepages.com
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: Re: odf4j text document classes |

|
2007-06-08 06:31:08 |
Hi Amit,
You mentioned bold/italics. This information is stored in
the styles and
not in-line with the content. Thus, we will need to
introduce style
handling first.
Again, the style handling classes should use the XML DOM as
their
backing stor but provide a convenient means by which
programmers can
access the style information.
For instance, in class OpenDocument there will be a new
method:
public Styles getStyles();
The Styles class will provide access to the styles in the
doc:
class Styles {
public Style getStyle(String name);
public List getStyleNames();
}
The Style class will be tied to the actual XML node for the
given style
and provide access to that style's properties. It will also
take care of
style inheritance by getting properties from parent styles:
class Style {
public String getProperty(String name);
public Style getParentStyle();
public StyleFamily getStyleFamily();
...
}
This is for reading styles. In the future, methods should be
added to
modify existing styles and add new styles.
Content objects should than provide a new method by which to
query for
the style and its properties. E.g.
class Element {
...
public Style getStyle();
public String getStyleProperty(String name);
...
}
Amit krishna Saha wrote:
> Hi Lars,
>
> Great to See you back
>
>> I think it would make the most sense if you work on
the refinement of
>> the text document API. For instance by adding
methods to the classes
>> that allow to access to useful properties. For
example:
>> org.openoffice.odf.text.Element.getTextStyleName()
return the name of
>> the text-style that is applied to the given
element.
>>
>> Please try to think about what other information
would be good to make
>> available on which objects and than discuss this on
the list.
>
> As you must be knowing I am currently working on
OdtToText2.java which
> currently supports extracting Headings, List Items,
Sections
> Information from ODT documents.
>
> Then I started off with providing "Frames"
support; But shelved the
> plans since BE suggested that I go for simpler/easier
things first. So
> currently I am working on adding support for other
features like -
> Hyperlinks, Bold Text, Italics text , etc
>
> So should I carry on with this, or start working on the
topics that
> you have suggested now.
>
> Regards
>
--
Sun Microsystems Lars Oppermann
<lars.oppermann sun.com>
Nagelsweg 55 Software Engineer
20097 Hamburg, Germany Phone: +49 40 23646 959
http://www.sun.com/
Fax: +49 40 23646 550
------------------------------------------------------------
-----------
Sitz der Gesellschaft: Sun Microsystems GmbH, Sonnenallee
1,
D-85551 Kirchheim-Heimstetten, Amtsgericht Muenchen: HRB
161028
Geschaeftsfuehrer: Marcel Schneider, Wolfgang Engels, Dr.
Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: Re: odf4j text document classes |

|
2007-06-08 09:22:19 |
Hi Lars,
> You mentioned bold/italics. This information is stored
in the styles and
> not in-line with the content. Thus, we will need to
introduce style
> handling first.
I get the point,
But I am not going to able to start work on this now because
of my end
term exams. I shall resume only after 15th June. So please
bear with
me.
Thanks & Regards
--
Amit krishna Saha
[URL]:http://amitsaha.in
.googlepages.com
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: Re: odf4j text document classes |

|
2007-06-08 09:26:38 |
Sure, and all the best for your exams...
/Lars
Amit krishna Saha wrote:
> Hi Lars,
>
>> You mentioned bold/italics. This information is
stored in the styles and
>> not in-line with the content. Thus, we will need to
introduce style
>> handling first.
>
> I get the point,
>
> But I am not going to able to start work on this now
because of my end
> term exams. I shall resume only after 15th June. So
please bear with
> me.
>
> Thanks & Regards
>
--
Sun Microsystems Lars Oppermann
<lars.oppermann sun.com>
Nagelsweg 55 Software Engineer
20097 Hamburg, Germany Phone: +49 40 23646 959
http://www.sun.com/
Fax: +49 40 23646 550
------------------------------------------------------------
-----------
Sitz der Gesellschaft: Sun Microsystems GmbH, Sonnenallee
1,
D-85551 Kirchheim-Heimstetten, Amtsgericht Muenchen: HRB
161028
Geschaeftsfuehrer: Marcel Schneider, Wolfgang Engels, Dr.
Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: Re: odf4j text document classes |

|
2007-06-17 23:49:45 |
Hi Lars,
> For instance, in class OpenDocument there will be a new
method:
> public Styles getStyles();
>
> The Styles class will provide access to the styles in
the doc:
> class Styles {
> public Style getStyle(String name);
> public List getStyleNames();
> }
>
> The Style class will be tied to the actual XML node for
the given style
> and provide access to that style's properties. It will
also take care of
> style inheritance by getting properties from parent
styles:
> class Style {
> public String getProperty(String name);
> public Style getParentStyle();
> public StyleFamily getStyleFamily();
> ...
> }
>
>
> class Element {
> ...
> public Style getStyle();
> public String getStyleProperty(String name);
> ...
> }
I have added the classes "Style",
"Styles", "StyleFamily" with the
sample methods suggested by you, under odf.text.* . Should I
commit it
to the CVS ?
I got a few points to be clarified though:
1. Are we only going to deal with "content.xml"
and not "styles.xml"?
I understand that "styles.xml" deals with the
"global" style
declarations and "content.xml" has
element-specific style information,
and our requirement at this point is of element specific
style
information.
2. I guess the starting point for retrieving the
"style" information
is in class "ElementFactory". Here
"node.getAttributes( )" returns a
NamedNodeMap object which may be further manipulated to get
the
attribute-value pairs. Am I guessing right?
Regards
--
Amit krishna Saha
[URL]:http://amitsaha.in
.googlepages.com
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: Re: odf4j text document classes |

|
2007-06-21 11:49:52 |
Hi Lars,
> For instance, in class OpenDocument there will be a new
method:
> public Styles getStyles();
>
> The Styles class will provide access to the styles in
the doc:
> class Styles {
> public Style getStyle(String name);
> public List getStyleNames();
> }
>
> The Style class will be tied to the actual XML node for
the given style
> and provide access to that style's properties. It will
also take care of
> style inheritance by getting properties from parent
styles:
> class Style {
> public String getProperty(String name);
> public Style getParentStyle();
> public StyleFamily getStyleFamily();
> ...
> }
>
> This is for reading styles. In the future, methods
should be added to
> modify existing styles and add new styles.
>
> Content objects should than provide a new method by
which to query for
> the style and its properties. E.g.
>
> class Element {
> ...
> public Style getStyle();
> public String getStyleProperty(String name);
> ...
> }
I have added the classes "Style",
"Styles", "StyleFamily" with the
sample methods suggested by you, under odf.text.* . Should I
commit it
to the CVS ?
I got a few points to be clarified though:
1. Are we only going to deal with "content.xml"
and not "styles.xml"?
I understand that "styles.xml" deals with the
"global" style
declarations and "content.xml" has
element-specific style information,
and our requirement at this point is of element specific
style
information.
2. I guess the starting point for retrieving the
"style" information
is in class "ElementFactory". Here
"node.getAttributes( )" returns a
NamedNodeMap object which may be further manipulated to get
the
attribute-value pairs. Am I guessing right?
--
Amit krishna Saha
[URL]:http://amitsaha.in
.googlepages.com
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
| Re: Re: odf4j text document classes |

|
2007-06-21 14:52:14 |
Amit krishna Saha schrieb:
> Hi Lars,
>
>> For instance, in class OpenDocument there will be a
new method:
>> public Styles getStyles();
>>
>> The Styles class will provide access to the styles
in the doc:
>> class Styles {
>> public Style getStyle(String name);
>> public List getStyleNames();
>> }
>>
>> The Style class will be tied to the actual XML node
for the given style
>> and provide access to that style's properties. It
will also take care of
>> style inheritance by getting properties from parent
styles:
>> class Style {
>> public String getProperty(String name);
>> public Style getParentStyle();
>> public StyleFamily getStyleFamily();
>> ...
>> }
>>
>> This is for reading styles. In the future, methods
should be added to
>> modify existing styles and add new styles.
>>
>> Content objects should than provide a new method by
which to query for
>> the style and its properties. E.g.
>>
>> class Element {
>> ...
>> public Style getStyle();
>> public String getStyleProperty(String name);
>> ...
>> }
>
> I have added the classes "Style",
"Styles", "StyleFamily" with the
> sample methods suggested by you, under odf.text.* .
Should I commit it
> to the CVS ?
>
> I got a few points to be clarified though:
>
> 1. Are we only going to deal with
"content.xml" and not "styles.xml"?
> I understand that "styles.xml" deals with the
"global" style
> declarations and "content.xml" has
element-specific style information,
> and our requirement at this point is of element
specific style
> information.
Well basically itīs hard formatting and soft-formatting
hard-formatting
is where you used a bold button etc directly in
OpenOffice.org and
soft-formatting is where you created a named style and
applied that.
Hard-Formatting is in content.xml and soft formatting is in
styles.xml.
The "real" style of an higher level Element is a
merge of itīs
soft-formatting and hard-formatting attributes. Eg. a
paragraph may have
a soft-formatting style named "MyHeading1" which
contains the
information that font size is 14pt and in addition
hard-formatting may
have been used too on that paragraph making it bold. Text in
this
paragraph has too be rendered 14pt bold than. So in the end
we have too
deal with both, but itīs of course ok if we start with
hard-formatting
first.
>
> 2. I guess the starting point for retrieving the
"style" information
> is in class "ElementFactory". Here
"node.getAttributes( )" returns a
> NamedNodeMap object which may be further manipulated to
get the
> attribute-value pairs. Am I guessing right?
>
Well right the starting point is an attribute of an Element
like a
paragraph for example. Elements like paragraphs do have
attributes like
text:style-name with a name as itīs value which maps to an
style
elements name which contains the information about that
style. Those
style elements are declared in an office:styles or
office:automatic-stlyes section in content.xml or
styles.xml. In case of
"hard-formatting" the name is an autogenerated
temp-name. Have a look
into the ODF Specification for details.
Kind regards,
Bernd Eilers
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe odftoolkit.openoffice.org
For additional commands, e-mail: dev-help odftoolkit.openoffice.org
|
|
[1-8]
|
|