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 Glen Mazza <gl...@yahoo.com> on 2003/06/03 23:47:44 UTC

FOTreeBuilder/ElementMapping change ideas

I was looking at how the Driver class initializes its
FOTreeBuilder instance with formatting object
ElementMappings.  This currently occurs in three ways:

1.)  Driver explicitly adds three default element
mappings (FO, SVG, FOP extension) to its FOTreeBuilder
instance
2.)  Driver searches META-INF/services directory for
additional user-defined extension mappings, adds them
3.)  Driver provides two forms of addElementMapping()
functions for embedded users to explicitly add more
ElementMappings.

(Jeremias explained #2 and #3 process here: 
http://marc.theaimsgroup.com/?l=fop-user&m=104256122918946&w=2)


I see two possible changes for 1.0dev:

1.)  For standard reasons of encapsulation/modular
design, also potential future deprecation of the
Driver class, I would like to make the FOTreeBuilder
more standalone.  In particular, have (1) and (2) done
within the FOTreeBuilder code itself as part of its
responsibilities.  

For (3), we may still need to retain the Driver
addElementMapping() functions for backwards
compatibility.  But I would like to have them just
wrap new functions of the same name in the
FOTreeBuilder code:

i.e., Driver's:
    public void addElementMapping(ElementMapping
mapping) {
        mapping.addToBuilder(treeBuilder);
    }

will now be:
    public void addElementMapping(ElementMapping
mapping) {
        treeBuilder.addElementMapping(mapping);
    }


2.)  Moving forward, I would like to see the
ElementMapping interface deprecated, and instead have
the mapping classes extend an "ElementMap" base class.
 Features of this base class would be:  

a)  This base class would have two public member
variables:  (1) the URL and (2) its fOObjs HashMap,
for the FOTreeBuilder to use for attaching the
ElementMap.  

b)  Instead of the ElementMapping-implementing class
attaching itself to the FOTreeBuilder (via
"addToBuilder" function defined in the interface), the
FOTreeBuilder will do the attaching of the ElementMap
subclass.  (This will allow the FOTreeBuilder code to
do some error-checking prior to accepting the
extension class.)

c)  The ElementMap base class and its subclasses will
have no reference to an FOTreeBuilder object.  They
will be standalone, can be attached to things besides
an FOTreeBuilder, and will work even if the
FOTreeBuilder class is removed.

Let me know if this seems advisable--if desired, I can
try to submit patches on one or both of these.

Thanks,
Glen


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOTreeBuilder/ElementMapping change ideas

Posted by Glen Mazza <gl...@yahoo.com>.
BTW, how certain are we that alt.design will be ready
for 1.0?  Has there been agreement on switching the
alt.design by the committers yet--to the degree that
we should indeed forgo any improvement on the current
layout code?  

I didn't get the impression from Joerg's email
http://marc.theaimsgroup.com/?l=fop-dev&m=105121991624106&w=2,
that work on layout was frozen in preparation for
alt.design--such freezing  strikes me as premature
right now.

Glen


--- "Peter B. West" <pb...@powerup.com.au> wrote:
> Glen,
> 
> There is no element mapping in the push parser of
> alt.design, which we 
> are looking at integrating into the code for 1.0.
> 
> Peter
> 
> Glen Mazza wrote:
> > I was looking at how the Driver class initializes
> its
> > FOTreeBuilder instance with formatting object
> > ElementMappings.  This currently occurs in three
> ways:
> 
> ...
> 
> -- 
> Peter B. West 
> http://www.powerup.com.au/~pbwest/resume.html
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> fop-dev-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOTreeBuilder/ElementMapping change ideas

Posted by "Peter B. West" <pb...@powerup.com.au>.
No user defined mappings.  The semantics of such mappings have to be 
defined elsewhere anyway.

Extensions will have to be programmed in alongside the fo: elements and 
within the processing logic.

Peter

Glen Mazza wrote:
> That simplifies things!--just out of curiosity, no
> user-defined extension mappings either?  (Not that I
> was clear how those would work with the current code
> anyway...)

-- 
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOTreeBuilder/ElementMapping change ideas

Posted by Glen Mazza <gl...@yahoo.com>.
That simplifies things!--just out of curiosity, no
user-defined extension mappings either?  (Not that I
was clear how those would work with the current code
anyway...)

Thanks,
Glen


--- "Peter B. West" <pb...@powerup.com.au> wrote:
> Glen,
> 
> There is no element mapping in the push parser of
> alt.design, which we 
> are looking at integrating into the code for 1.0.
> 
> Peter
> 
> Glen Mazza wrote:
> > I was looking at how the Driver class initializes
> its
> > FOTreeBuilder instance with formatting object
> > ElementMappings.  This currently occurs in three
> ways:
> 
> ...
> 
> -- 
> Peter B. West 
> http://www.powerup.com.au/~pbwest/resume.html
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> fop-dev-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOTreeBuilder/ElementMapping change ideas

Posted by "Peter B. West" <pb...@powerup.com.au>.
Glen,

There is no element mapping in the push parser of alt.design, which we 
are looking at integrating into the code for 1.0.

Peter

Glen Mazza wrote:
> I was looking at how the Driver class initializes its
> FOTreeBuilder instance with formatting object
> ElementMappings.  This currently occurs in three ways:

...

-- 
Peter B. West  http://www.powerup.com.au/~pbwest/resume.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org