incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Weir <robw...@apache.org>
Subject Re: Proposal add a new API(Create Table of Content) to ODF toolKit Simple API
Date Thu, 09 Aug 2012 19:59:29 GMT
On Wed, Aug 8, 2012 at 9:40 PM, Liu Da Li <wawalovo@gmail.com> wrote:
> Dear all,
> I implement these CreateTOC apis.  Please help to review the codes and if
> the codes are ok, please help to check in them. Any comments are welcome.
> Patch and details information please refer to the comment in
> https://issues.apache.org/jira/browse/ODFTOOLKIT-329
>
> 2012/8/2 Liu Da Li <wawalovo@gmail.com>

I tested your patch.  It looks fine to me on Windows with JDK 1.6, so
I committed that patch.

Thanks for the code, and especially for including JavaDoc and test cases.

-Rob

>
>> Hi Rob
>> Thanks for your reply.
>> 2012/8/1 Rob Weir <robweir@apache.org>
>>
>>> On Wed, Aug 1, 2012 at 5:36 AM, Liu Da Li <wawalovo@gmail.com> wrote:
>>> > Dear all,
>>> > I want to generate a table of content by ODF toolkit Simple API. But it
>>> > seems that there doesn't exist such method.
>>> > So I proposal to add a new API createTOC to Simple API.
>>> > Specification: parameters for the new API are: 1. position/location of
>>> TOC,
>>> > 2. TOC style to be used
>>> > ODFToolkit API: TextDocument.createTOC(positionElement, TOCStyle).
>>> > Do anyone have the same requirement?
>>> > Should I create a new feature in the JIRA system?
>>>
>>> JIRA is a good place for this.
>>>
>>> I will create a new feature request in JIRA soon.
>>
>>
>>> Also, it would be good to discuss how you will enter a ToC.   If you
>>> do this operation in a word processor, like OpenOffice, you see it
>>> does two things:
>>>
>>> 1) Enter the markup for <text:table-of-content> that defines the
>>> structure and style relations for the table of contents.
>>>
>>> 2) Gather the header text from elsewhere in the document and enter
>>> that, along with page references, into a <text:index-body>
>>>
>>> Doing #1 is easy.  But #2 is very difficult.  Why?  Because until you
>>> do a full layout of the document, taking into account font metrics,
>>> line breaking algorithms, hyphenation, image positioning, "orphan and
>>> widow" rules, etc., you don't know what content is on which page.
>>>
>> yeah, you are right, the page number will be difficult issue.
>>
>>>
>>> So the easiest thing is to just do #1 and then have the user do an
>>> "Update Table" operation in the word process the next time the
>>> document is loaded.
>>>
>> I will try to do #1 first.
>>
>> Next easiest is to collect the header text to put in the ToC, but not
>>> try to calculate the page numbers, leaving that to be calculated when
>>> the document is loaded in a full word processor.
>>>
>>
>> After finish #1, will consider this.
>>
>>
>>> Regards,
>>>
>>> -Rob
>>>
>>
>>

Mime
View raw message