Since Interwoven's LiveSite 3 (or SitePublisher 3, depending on your religion), there is the cool new functionality that allows you to use "Controllers".
We already had what was called Externals, which are used to call java classes that return xml. This xml is then in turn passed to the component's xslt in order to do some transformations and produce html, usually.
This type of call to external java classes had the disadvantage that they were executed too late in the processing to influence the response stream. That meant, for instance, that you couldn't use those to redirect to a different page should you encounter a condition that required this.
Now with Controllers, you can. Depending on whatever condition you define, you can react on that by returning a different forward url. And, should you not forward, still call an external java object after that.
In the appearance xslt, is looks like this;
<Data>
<Controllers>
<Controller Name="ActionName">
<Object>com.your.name.space.Class</Object>
<Method>methodtocall</Method>
<Param Name="CaseAUrl"/>
<Param Name="CaseBUrl"/>
<Param Name="CaseCUrl"/>
</Controller>
</Controllers>
</Data>
The documentation is slightly incomplete, however. What it doesn't say, is that if you don't add an External element within the Data element, the controller code won't get called :-(
I Don't know why this is so, but it is. I added a dummy External to get around that.
So if you ever decide to use these Controllers, and you can't get it to work; check if you have an external there.
Thursday, 26 June 2008
LiveSite Controllers & Externals
Posted by
Dries Germonprez
at
19:16:00
Labels: Interwoven, LiveSite, SitePublisher

0 comments:
Post a Comment