Here is the theory behind the "guts" :)
transform()
Never throws an exception. Success/error messages
are returned as a string
transformGuts()
Throws an exception in the case of error. Returns
a string only in the success case
Making transformGuts part of the interface makes it possible
for someone to call this from another Zope Product that
wants to capture exceptions. For example: ZOODocument :-)
Alternatively, you might capture exceptions in a
PythonScript and display them in some other way (?)
Removing the method results in a loss of information
b/c there is no way to programmatically tell if an
error has happened.
Perhaps transformGuts() should instead be called
transformOrRaiseException() or something? It might be
simply a case of poor naming...
Is there a Zope3 convention that might be helpful here?
--Craeg
> +1
>
> Also, I think this transformGuts method is very ugly, especially because
> it's mentioned in the interface. Processors should only have a transform
> method. What they define beyond that internally should not be part of
> the API documentation. Or is there a use case where you would actually
> call transformGuts from outside a processor?
>
> Craeg Strong wrote:
> > +1
> >
> > --Craeg
> >
> >
> >>How would you guys feel about moving the calls to addParam() inside
> >>transformGuts() so that what gets passed to the XSL Processor is just a
> >>dictionary of parameters? Then each processor can do whatever
> >>manipulations are necessary to get the parameters into a digestible
> >>format. There doesn't seem to me to be a need to expose that
> >>implementation detail to XSLTMethod (or the rest of the world).
> >>
> >>--Brent
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > ZopeXMLMethods-devel mailing list
> > Zop...@li...
> > https://lists.sourceforge.net/lists/listinfo/zopexmlmethods-devel
> >
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> ZopeXMLMethods-devel mailing list
> Zop...@li...
> https://lists.sourceforge.net/lists/listinfo/zopexmlmethods-devel
>
|