On 5/26/06, Jorge Godoy <[EMAIL PROTECTED]> wrote:
>
> >     So I am basically looking for some detailed suggestions on how to
> > approach this problem.  I can provide more samples if needed, but
> > would just like to get some interaction to decide on a good approach.
>
> I've read about ZSI a long time ago, and I don't remember much about it,
> but my suggestion would be for you to try to work with the expose
> decorator.  By using it you can offer multiple output formats.
>
> For example, today you can output (x)html + json by doing this:
>
> @turbogears.expose(format = 'html')
> @turbogears.expose(format = 'json', allow_json = True)
> def some_method(self, *args, **kwords):
>     # method implementation
>
>
> If you could add your implementation to it, then we'd end up with:
>
> @turbogears.expose(format = 'html')
> @turbogears.expose(format = 'json', allow_json = True)
> @turbogears.expose(format = 'wsdl', other_parameters = here)
> def some_method(self, *args, **kwords):
>     # method implementation
>
> I believe this is a great thing because you don't need separate methods to
> handle different output formats and you also don't need to worry about the
> dispatchers that are there.  TG takes care of that for you and it "simply
> works".  Also, using this approach, you can convert existing applications
> to use your new implementation with very little work.
>
> So...  Think about using the expose decorator.

Thanks for the tip.  I have never thought about stacking decorators.
That could come in useful for having one method serve the soap logic
and generating doc pages.  I looked at this somewhat though and the
expose method only seemed customizable through the template plugins,
but I didn't see a way to pass "other_parameters" to the template.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to