Hi,

I have just checked out the JFreeChartResult code on the wiki.

http://wiki.opensymphony.com/space/JFreeChartResult

What is the advantage of creating a new Result type in this case?  I thought
the sole purpose of separating the result type from the action was that your
actions were "view agnostic".  The JFreeChartResult forces your actions to
know that they are using JFreeChart.

You could remove this dependency by putting the necessary data into
view-independent structures, like a java.util.List or Array and let the
JFreeChartResult take this data and convert it into the JFreeChart specific
types.  That way you could change your result type without having to rewrite
your action.  (eg to a 3D chart, Flash chart, or a simple ASCII chart)

The other properties needed by the JFreeResultType (ie Title font,
background colour, axis type) could be set as parameters in xwork.xml and
also default to common values (ie white background, Number axis...).  The
key used to obtain the data from the value stack could also be redefined
here (eg instead of the default 'chart' use 'data').

Although you would have less "hands on" control over the JFreeChart object
it would fit with WW2's "view agnostic" policey and make your actions more
reusable.

What do you think?

John.

----- Original Message ----- 
From: "Bernard Choi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 6:06 PM
Subject: Re: [OS-webwork] How does one change the contentType in
theresponse?


> I've done a JFreeChartResult. Perhaps it is similar to what you require. I
> will be needing a PdfResult later on in my project development (perhaps in
> the next month), and I'll post what I've learnt online.
>
> Meanwhile, here is what I've got for the JFreeChartResult...
> http://wiki.opensymphony.com/space/JFreeChartResult
>
> Hope it helps.
>
> ----- Original Message -----
> From: "Philipp Meier" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 24, 2003 11:05 PM
> Subject: Re: [OS-webwork] How does one change the contentType in
> theresponse?
>
>
> On Wed, Sep 24, 2003 at 08:56:29AM -0600, Thompson, Kris wrote:
> > > Its in ServletActionContext, actually.
> >
> > Perfect!
> > >
> > > I know you said long story, but why would the PDF generation
> > > be in the
> > > Action instead of treating it as just another view?
> > >
> > I'm all ears!  I'm not familar with how this is done and I did not see
any
> docs on this.  Could someone point me in the direction where I could find
> this information? Would I be creating a new result-type?
>
> Look in the source for the jasperreports view. This should give you a
> hint on how to make a new result-type.
>
> -billy
>
> --
> Meisterbohne   Meisterbohne GbR, K�fner, Mekle, Meier   Tel: +49-731-399
> 499-0
>    eL�sungen   S�flinger Stra�e 100                     Fax: +49-731-399
> 499-9
>                89077 Ulm
> http://www.meisterbohne.de/
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
>


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to