Re: PDF Transcoder patch

2004-01-26 Thread Chris Bowditch
Glen Mazza wrote:

I tried to do a complete switch from FOUserAgent to
logger in the images package, was not able to (there
are still other cases the FOUserAgent is actually
being used.)
Glen - I havent looked at this in detail, but my understanding of the 
FOUserAgent was the place holder for any user configuration, e.g. 
baseFontDir, baseImageDir, etc. So by changing all FOuserAgent arguments 
to loggers, are you excluding the possibility of code in the images 
package from accessing any user configuration, e.g. baseImageDir?

Chris




Re: PDF Transcoder patch

2004-01-26 Thread Glen Mazza
Chris,

Certain packages of our project--in this case, the
image package--are used both by the PDFTranscoder (a
separate application, if you will) and the FOP
application.  

The FOUserAgent is ultra-easy (?) to access from the
FOP Application, but not-so-easy (and, also,
not-so-relevant) for the PDFTranscoder.  (We also have
an SVGUserAgent, but I haven't researched it.)

Most of the methods in image are requesting a
FOUserAgent parameter, but are *only* using its logger
once it gets it:  ua.getLogger().warn(...); etc,
etc.  For several of those methods, I changed the
input parameter from FOUserAgent to Logger. 
(Which is probably correct, if all a certain method
needs is a logger, that's all it should get.)  Code
accessing those methods no longer send, say,
myFOUserAgent, but myFOUserAgent.getLogger().

Thomas DeWeese of Batik, in doing PDF Transcoder work
for us (or maybe something else graphics-related--I
really don't understand most of that stuff ;)  had
trouble accessing the FOUserAgent from his code.  I
changed the signatures as above for the methods in
question and created a logger instance for him to use
in his calling method, fixing the problem.

Should a method need FOUserAgent--and I couldn't find
any in Image *directly* using it (a call to the SVG
package did, however, but I don't know if that SVG
package also just wanted its logger, I stopped
researching to that degree)--well, then, we can't
change its signature.

My inclination is to make FOUserAgent a FOP-only
critter and save the PDFTranscoder from it where
possible.  I.e., in the example below of needing an
image baseDir, sending the
foUserAgent.getImageBaseDir() as a parameter instead,
so Thomas can just send myImageBaseDir to the same
method for his transcoder work, without needing to
bother with an FOUserAgent. 

Glen

--- Chris Bowditch [EMAIL PROTECTED] wrote:
 Glen Mazza wrote:
 
  I tried to do a complete switch from FOUserAgent
 to
  logger in the images package, was not able to
 (there
  are still other cases the FOUserAgent is actually
  being used.)
 
 Glen - I havent looked at this in detail, but my
 understanding of the 
 FOUserAgent was the place holder for any user
 configuration, e.g. 
 baseFontDir, baseImageDir, etc. So by changing all
 FOuserAgent arguments 
 to loggers, are you excluding the possibility of
 code in the images 
 package from accessing any user configuration, e.g.
 baseImageDir?
 
 Chris
 
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


Re: PDF Transcoder patch

2004-01-26 Thread Chris Bowditch
Glen Mazza wrote:

Thanks for taking the time to explain Glen. What youve said is mostly as 
I understood it. Some comments below.

snip/

The FOUserAgent is ultra-easy (?) to access from the
FOP Application, but not-so-easy (and, also,
not-so-relevant) for the PDFTranscoder.  (We also have
an SVGUserAgent, but I haven't researched it.)
Opportunity for a UserAgent super class? (see below)

snip/

Should a method need FOUserAgent--and I couldn't find
any in Image *directly* using it (a call to the SVG
package did, however, but I don't know if that SVG
package also just wanted its logger, I stopped
researching to that degree)--well, then, we can't
change its signature.
I wouldnt expect you to find any instances of FOUserAgent being used at 
this time, because AFAIK configuration hasnt yet been implemented in 
HEAD. I am just trying to make sure that before we delete all references 
to FOUserAgent from the images package that weve considered whether the 
images package will need access to configuration when its implemented in 
HEAD. Presumably such an implementation would start with a basic set of 
user config settings, and be expanded over time according to user demands.

My inclination is to make FOUserAgent a FOP-only
critter and save the PDFTranscoder from it where
possible.  I.e., in the example below of needing an
image baseDir, sending the
foUserAgent.getImageBaseDir() as a parameter instead,
so Thomas can just send myImageBaseDir to the same
method for his transcoder work, without needing to
bother with an FOUserAgent. 
I dont have any particular interest in this area, I just dont want to 
undo something that we may need to redo later. If you think its a non 
issue, then thats fair enough, just as long as its been thought through.

Thanks,

Chris




Re: PDF Transcoder patch

2004-01-25 Thread Glen Mazza
(Resending to FOP-DEV list...)

Please take a look at my most recent changes
today--comments welcome.  

In short, for the images package, as well as for
transcoder work, I don't care much about the UA
anymore.  I switched the signatures in question to
just request a logger instead, because that is the
only thing the image package's methods are doing with
FOUserAgent parameter anyway.  (Your package creates a
temporary ConsoleLogger instead of passing in
NULL--but I think I should update the package to be
able to handle a NULL parameter by not logging
anything at all.  Comments again welcome.)

There's a few more trivial FOUserAgent-Logger
conversions needed in the images package, but I'm
awaiting more comments before proceeding.

We can discuss the other issue in your original email
after this one.

Thanks,
Glen


--- Thomas DeWeese [EMAIL PROTECTED] wrote:
 Glen Mazza wrote:
 
  Applied, thanks!
 
 Thanks Glen, any comments on my comments?  In
 particular how
 to get the UA?
 
 Hi all,
 
 I've attached a patch for the PDF Transcoder
 that Batik uses.  
 
 
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


Re: PDF Transcoder patch

2004-01-25 Thread Thomas DeWeese
Glen Mazza wrote:

(Resending to FOP-DEV list...)

Please take a look at my most recent changes
today--comments welcome.  

In short, for the images package, as well as for
transcoder work, I don't care much about the UA
anymore.  I switched the signatures in question to
just request a logger instead, because that is the
only thing the image package's methods are doing with
FOUserAgent parameter anyway.  
  Ok, I knew that it only used it for logging, and
only for problems at that, otherwise I wouldn't have
tried passing in null.
(Your package creates a temporary ConsoleLogger instead 
of passing in NULL--but I think I should update the package 
to be able to handle a NULL parameter by not logging
anything at all.  Comments again welcome.)
   Well I think it is probably bad ignore the
things it is setup to log.  Does the logging
stuff have a sort of default 'err' Console logger?
You could have it use that if the one passed in is 'null'.
There's a few more trivial FOUserAgent-Logger
conversions needed in the images package, but I'm
awaiting more comments before proceeding.
We can discuss the other issue in your original email
after this one.
  Where the load call is made is probably less important,
part of it was that I didn't know what conventions (if any)
existed for calling it.  My preference is for these sorts of
things to take care of themselves - so the FopPDFImage
seemed ideal -it could call it before methods that were
likely to need the sort of information it loads.
Thanks,
Glen
--- Thomas DeWeese [EMAIL PROTECTED] wrote:

Glen Mazza wrote:


Applied, thanks!
   Thanks Glen, any comments on my comments?  In
particular how
to get the UA?

Hi all,

  I've attached a patch for the PDF Transcoder
that Batik uses.  





__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/





Re: PDF Transcoder patch

2004-01-25 Thread Glen Mazza
--- Thomas DeWeese [EMAIL PROTECTED] wrote:
 
 Well I think it is probably bad ignore the
 things it is setup to log.  Does the logging
 stuff have a sort of default 'err' Console logger?
 You could have it use that if the one passed in is
 'null'.
 

We don't have that yet--also, there are too many
public methods into the images package where this
would need to be trapped (i.e., a default logger
created), so I'll keep the code as-is right now.

I tried to do a complete switch from FOUserAgent to
logger in the images package, was not able to (there
are still other cases the FOUserAgent is actually
being used.)

Thanks,
Glen


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


Re: PDF Transcoder patch

2004-01-22 Thread Glen Mazza
Applied, thanks!
Glen

--- Thomas DeWeese [EMAIL PROTECTED] wrote:
 Hi all,
 
 I've attached a patch for the PDF Transcoder
 that Batik
 uses.  



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/