You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Giuseppe Briotti <g....@gmail.com> on 2011/05/04 22:57:30 UTC

FormattingObjectsForIndexing - intermediate format or extension?

Hi all, I'm really interested on merge-pages-across-index-key-references /
merge-sequential-page-numbers / merge-ranges-across-index-key-references.

As per http://wiki.apache.org/xmlgraphics-fop/FormattingObjectsForIndexingit
seems that they are:

1) "Rather straightforward properties to implement on the FO tree side
(simple enums)."
2) "Of lesser importance for the base implementation."
3) "If FOP can get to the point where it correctly outputs a sequence of
page-numbers for a given index-key, these will be relatively easy features
to add. "

The point (1) suggests that this is not so complicated.
The point (2) suggests that this feature is not so close to complete.
The point (3) suggests that there is some kind of problem to correctly
outputs a sequence of page numbers.

I know that I can use a "double-pass" approach and act on Intermediate
Format. I can figure out if it possible to obtain the same result by a new
extension or implementing such feature in the FOP code.

I would like to try :-)

Any suggestion?

TIA

G.

-- 

Giuseppe Briotti
g.briotti@gmail.com

"Alme Sol, curru nitido diem qui
promis et celas aliusque et idem
nasceris, possis nihil urbe Roma
visere maius."
(Orazio)

Re: FormattingObjectsForIndexing - intermediate format or extension?

Posted by Giuseppe Briotti <g....@gmail.com>.
Thanks Andreas.

I'll "travel" the code a bit and then come back. If I'll success in such
coding, I'll write all on the wiki ("how I did it!")

G.


-- 

Giuseppe Briotti
g.briotti@gmail.com

"Alme Sol, curru nitido diem qui
promis et celas aliusque et idem
nasceris, possis nihil urbe Roma
visere maius."
(Orazio)

Re: FormattingObjectsForIndexing - intermediate format or extension?

Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 17 May 2011, at 00:58, Giuseppe Briotti wrote:

Hi Guiseppe

> 
> TKS Andreas, in the meanwhile I setup Eclipse and FOP packages in a project, and started to take a look at the code and structure. 
> 
> I didn't find a class diagram or some overview documentation (just a "bigpicture" page :-) ).

I see... and must admit that such diagrams have been neglected somewhat. :-/
I personally have tried to document a part on the Wiki that I came to understand quite well after spending some time in the code (= property handling).

I still have plans to do something similar for the FO tree parsing. I do remember having described this pretty thoroughly in a rather long rant on fop-dev in the past. If I succeed in locating it, I will post the link back here.
Some basics of the core logic used by the layout engine are documented pretty well on the Wiki, but a sort of comprehensive overview is still lacking. 

For now, if something is unclear, just chime back in here, and we'll see what we can offer. Should you feel the irresistible urge to further extend the Wiki, you are obviously very much invited to do so.

I personally learned a lot from simply debugging a few sessions, placing breakpoints at lines I was interested in, and following the flow from there.



Regards

Andreas

Re: FormattingObjectsForIndexing - intermediate format or extension?

Posted by Giuseppe Briotti <g....@gmail.com>.
2011/5/16 Andreas L. Delmelle <an...@telenet.be>

>
> If a standard feature covers your requirements, but is not implemented,
> then obviously from our perspective, you are very much encouraged to try and
> add this. :-)
>
> If some the above does not immediately make sense or raises further
> questions, just chime back in here.
>
> Thanks!
>
> Regards,
>
> Andreas


TKS Andreas, in the meanwhile I setup Eclipse and FOP packages in a project,
and started to take a look at the code and structure.

I didn't find a class diagram or some overview documentation (just a
"bigpicture" page :-) ).

I will check your suggestion.

G.

-- 

Giuseppe Briotti
g.briotti@gmail.com

"Alme Sol, curru nitido diem qui
promis et celas aliusque et idem
nasceris, possis nihil urbe Roma
visere maius."
(Orazio)

Re: FormattingObjectsForIndexing - intermediate format or extension?

Posted by "Andreas L. Delmelle" <an...@telenet.be>.
On 04 May 2011, at 22:57, Giuseppe Briotti wrote:

Hi Guiseppe

Apologies for the delayed response. 

> Hi all, I'm really interested on merge-pages-across-index-key-references / merge-sequential-page-numbers / merge-ranges-across-index-key-references.

You are addressing a feature that would greatly improve usability and basic compliance. It has been requested a couple of times now, but not enough to lead to action, unfortunately... 

> 
> As per http://wiki.apache.org/xmlgraphics-fop/FormattingObjectsForIndexing it seems that they are:

I had started to compile some basic ideas on that page, in an attempt to separate out the core functionality, i.e. the components that *definitely* need to be added to make even the smallest possible example work. 

> 1) "Rather straightforward properties to implement on the FO tree side (simple enums)."
> 2) "Of lesser importance for the base implementation."
> 3) "If FOP can get to the point where it correctly outputs a sequence of page-numbers for a given index-key, these will be relatively easy features to add. "
> 
> The point (1) suggests that this is not so complicated.

Well, it is ultimately still a challenge, as it is so comprehensive (= changes will affect multiple packages, requiring an understanding of different areas of the code and how they work together). 

> The point (2) suggests that this feature is not so close to complete.

Apart from having added the symbolic literals in org.apache.fop.fo.Constants --for the new properties, property enum values and FOs-- nothing is in place yet. 
Some properties can be quite straightforwardly implemented, if they are simple enum values. (see also: http://wiki.apache.org/xmlgraphics-fop/PropertyHandling)

However, the "merge-*" properties by themselves are useless. On the other hand, "(ref-)index-key" both are *required* for a minimal implementation. 

> The point (3) suggests that there is some kind of problem to correctly outputs a sequence of page numbers.

Not really a problem. As pointed out above, it requires understanding the FO tree part /and/ the layout engine. In that respect, the reference to the (ref-)id property-pair is, IMHO, rather crucial. Make sure to study closer how these are processed/passed, and you will get a lot closer to an implementation for (ref-)index-key.

Once a base implementation is in place to be able to produce a separated list of all page-numbers, the remaining non-essential stuff --whether to merge sequential page-numbers-- would be trivial to add. 

As for new FO objects, I think the first pair is all we need to get a proof-of-concept for such a base implementation working.
The second pair, related to index-ranges, only becomes relevant in the context of merge-*, so is considered non-essential.
The TBDs are really only cosmetics, although we might want to take care to make the separator replaceable (i.e. not a hard-coded comma or semi-colon or some such...)

> I know that I can use a "double-pass" approach and act on Intermediate Format. I can figure out if it possible to obtain the same result by a new extension or implementing such feature in the FOP code. 
> 
> I would like to try :-)
> 
> Any suggestion?

If a standard feature covers your requirements, but is not implemented, then obviously from our perspective, you are very much encouraged to try and add this. :-)

If some the above does not immediately make sense or raises further questions, just chime back in here.

Thanks!

Regards,

Andreas