Re: User Agent

2002-12-01 Thread J.Pietschmann
Jeremias Maerki wrote:

I'd vote for an Avalon Configuration object which can be built easily
from XML and passed through from Cocoon which is also based on Avalon.
Configuration objects are also easily built by hand if necessary.


+1

Anybody having good relations with the Batik team? This could be used
there too.

J.Pietschmann


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: User Agent

2002-11-28 Thread Jeremias Maerki

On 28.11.2002 08:33:31 Keiron Liddle wrote:
 On Wed, 2002-11-27 at 19:19, Oleg Tkachenko wrote:
   There could be two ways to set these values. From the command line we
   want the config file to set values and when embedding they could extend
   the user agent to set the values.
  And what about the third one - set config file when embedding? That might be 
  convenient too.
 
 Config file or config data (eg. in cocoon sitemap, the data is in xml
 under the fop serializer which cocoon converts to config data).
 
 Yes, the other two make it possible.

I'd vote for an Avalon Configuration object which can be built easily
from XML and passed through from Cocoon which is also based on Avalon.
Configuration objects are also easily built by hand if necessary.

http://jakarta.apache.org/avalon/api/org/apache/avalon/framework/configuration/Configuration.html

The UserAgent should IMO implement the Configurable interface which
defines an Avalon standard contract how the object is configured.

http://jakarta.apache.org/avalon/api/org/apache/avalon/framework/configuration/Configurable.html

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: User Agent

2002-11-28 Thread Oleg Tkachenko
Jeremias Maerki wrote:


I'd vote for an Avalon Configuration object which can be built easily
from XML and passed through from Cocoon which is also based on Avalon.
Configuration objects are also easily built by hand if necessary.

Right. Lets stop reinventing the wheel (being diving into avalon).


The UserAgent should IMO implement the Configurable interface which
defines an Avalon standard contract how the object is configured.

The problem is that user agent properties are just part of FOP configuration 
properties. May be we should separate FOP config from User Agent config. Well, 
I need to avalonize my brain first.

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: User Agent

2002-11-28 Thread Jeremias Maerki

On 28.11.2002 15:48:40 Oleg Tkachenko wrote:
 Jeremias Maerki wrote:
 
  I'd vote for an Avalon Configuration object which can be built easily
  from XML and passed through from Cocoon which is also based on Avalon.
  Configuration objects are also easily built by hand if necessary.
 Right. Lets stop reinventing the wheel (being diving into avalon).

Cool.

  The UserAgent should IMO implement the Configurable interface which
  defines an Avalon standard contract how the object is configured.
 The problem is that user agent properties are just part of FOP configuration 
 properties. May be we should separate FOP config from User Agent config. Well, 
 I need to avalonize my brain first.

That's not a problem. A parent object can easily pass a subtree its own
Configuration to its child. For example, Driver could pass a subtree
(cfg.getChild(useragent)) to a newly instantiated UserAgent
(useragent.configure(cfg.getChild(useragent))).

Maybe separation of the config makes sense. I'll also look at this more
closely. But I've still got two or three little things in maint I'd like
to finish first.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: User Agent

2002-11-27 Thread Keiron Liddle
On Mon, 2002-11-25 at 20:40, Oleg Tkachenko wrote:
 Hello!
 
 What is the convention behind UserAgent class? afaiu, the class should 
 provide default values for all user-agent-related properties, which are 
 overridable through the configuration file.

There could be two ways to set these values. From the command line we
want the config file to set values and when embedding they could extend
the user agent to set the values.

 So, if I want to add auto values for page-height and page-width, how 
 should I do it?

So an auto value should be determined by the user agent, right?
Then just add the methods to the user agent.

Do you have any ideas of how to better specify the user agent config
data?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: User Agent

2002-11-27 Thread Oleg Tkachenko
Keiron Liddle wrote:


What is the convention behind UserAgent class? afaiu, the class should 
provide default values for all user-agent-related properties, which are 
overridable through the configuration file.


There could be two ways to set these values. From the command line we
want the config file to set values and when embedding they could extend
the user agent to set the values.

And what about the third one - set config file when embedding? That might be 
convenient too.

So, if I want to add auto values for page-height and page-width, how 
should I do it?


So an auto value should be determined by the user agent, right?

I think so. Spec says they should be determined, in the case of continuous 
media, from the size of the User Agent window, otherwise from the size of the 
media. At least Antenna exposes these as user agent parameters.

Then just add the methods to the user agent.

Do you have any ideas of how to better specify the user agent config
data?

Well, I've been thinking about a kind of JavaBeans naming convention, when for 
each propery there is setter and getter and config file parser then could 
populate UserAgent through reflection API. But that might add unnecessary 
complexity + reflection is not so fast, so another alternative could be usual 
hash table and a propery getter may then check hashtable key first and if it's 
not exists return default value:
public int getAutoPageHeigh() {
	String val;
	if ( (val = (String)hashtable.get(AUTO_PAGE_HEIGHT_KEY)) != null)
		return String.parseInt(val);
	else
		return DEFAULT_AUTO_PAGE_HEIGHT;
}
But actually number of UserAgent properties is pretty well limited and it's 
not going to extend, so its processing may be even less generic.

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Re: User Agent

2002-11-27 Thread Keiron Liddle
On Wed, 2002-11-27 at 19:19, Oleg Tkachenko wrote:
  There could be two ways to set these values. From the command line we
  want the config file to set values and when embedding they could extend
  the user agent to set the values.
 And what about the third one - set config file when embedding? That might be 
 convenient too.

Config file or config data (eg. in cocoon sitemap, the data is in xml
under the fop serializer which cocoon converts to config data).

Yes, the other two make it possible.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]