On Feb 12, 2007, at 16:12, Vincenzo Mazzeo wrote:

Hi Vincenzo,

Sorry for the late reply. The reason I'm cc'ing fop-dev is because, while such an extension may turn out not to be necessary, it does again raise interesting questions. Some of them, I cannot confidently answer ATM, and I'm hoping to increase your chances of finding a nice solution to your problem.

as you suggested I'm developing a table-page-filler extension, but I have a question. I assume that the extension tag is inserted after the last <fo:table-row> tag (before the </fo:table-body>). So the FONode instance I receive in the "make" method is a TableBody object. How can I get the table height of the current page?

Not at that stage, you can't. That's precisely what makes implementing such an extension far from trivial, or quite a challenge anyway. Currently, there is no way to create that kind of extension without also patching FOP while doing so.

At the time Maker.make() is called, there is no page-context yet. Your extension element is no more than a node amongst other nodes, in what I guess could be called a FOP-specific DOM, or the fo tree. The layoutengine kicks in only much later, at the end of the page-sequence.

What you need is for a corresponding node to be created in the tree of LayoutManagers, a tree which does not exist yet when the FO node is 'made'. The creation of that tree is ultimately triggered by PageSequenceLMa.activateLayout(), which creates a FlowLM, and asks it to return its list of KnuthElements, which in turn triggers the creation of the descendant LMs etc.

The LayoutManager implementation itself could turn out to be fairly simple. The real tricky part would be to find a generic way of dealing with foreign layout managers. Something like that does not exist ATM. In this case, it's the TableContentLM that must create the foreign LM and add the returned block-sequence to its own returned list.

Note that this could also be hardcoded in TableContentLM, without the use of an additional LM, since there is access to the TableBody's ExtensionAttachments.

I know this may all be a bit unknown to you, so if you really want to have a go at this and get stuck somewhere, or any of the above doesn't make sense, just ask.

HTH!

Cheers,

Andreas

Reply via email to