From: Chris W. <ch...@cw...> - 2004-10-05 17:14:59
|
> I'm currently trying out Martin Kutters SOAP add on for OpenInteract2. > My idea is to use soap as remote API for OI2. Thus I would like to have > two content-generators for all packages, one giving the usual > html-response, and the other one giving a soap response. That's been my idea for SOAP as well. > When I understand the current implementation of OI correct, then it is > in principle possible to have several content generators in OI, but one > action has exactly one content generator, defined by the action.ini > file, not by the Response-type. I hope I'm wrong with this assumption, > so my question is, how do I enable different content-generators for one > action? Or is my understanding of an 'action' wrong? Your understanding is right. But I think what's missing is you can map multiple action specifications to the same class. For instance in an action.ini you might have: [foo] class = OpenInteract2::Action::Foo content_generator = TT [bar] class = OpenInteract2::Action::Foo content_generator = SOAP The same data are retrieved from the action + task, but they're passed off to a different content generator depending on how they were invoked. Make sense? The 'news' package has some commented-out examples of doing this with Text::Template and HTML::Template. > And in some packages, I haven't seen the content_generator flag in the > action.ini. Where is the default defined? In server.ini: [action_info default] controller = tt-template content_generator = TT Hope this helps, Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |