Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Inline Java Datasource in DCT
markbernard
I want to use a Java Datasource in an inline tag in a DCT. I can't find any docs on how to do this from the Java side. The docs I have found just say how to use the inline tag but not what interface to implement or where the interface can be found. Can anyone help.
Thanks.
Find more posts tagged with
Comments
nipper
That is probably because everyone does it with a perl script instead of Java.
It has to dump out XML in a defined form. That form is well documented. You need to write something to do that. Then invoke it with the inline call.
vpatel
At a high level:
1. Define your CustomDataSource Java Class (there is a Java API doc on your TS server for this datasourcedoc.jar). At a high level something similar to this (NOTE: this is psuedo code for example purposes only)...Look at the API and you can implement one of the interfaces -- my example here implements MapDataSource.
[PHP]
public class CustomDataSource implements MapDataSource {
public Map execute(DataSourceContext context) {
...
Map map = new TreeMap();
...
map.put("something", "something");
...
return map;
}
}
[/PHP]
2. Configure your custom DataSource in the DataSourceConfig.xml file:
[PHP]
My Custom Data Source
com.mypackage.CustomDataSource
...
...
[/PHP]
3. Add your custom DataSource to your DCT item:
[PHP]
...
...
[/PHP]
HTH!