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)
Problem with Generators
anant_kr
Hi All,
I am using Teamsite 7.1 on linux server.
I am trying to populate a datum dynamically using Generator. The content XML is as follow:
[HTML]
5
[/HTML]
and the java method returns document:
[HTML]
public org.dom4j.Document someExternalCall(Hashtable params)
{
Document doc = Dom4jUtils.newDocument();
doc.addElement("Options");
Element base = doc.getRootElement();
for (int i=0; i<3; ++i)
{
Element option = base.addElement("Option");
option.addElement("Display").addText("Debug Item "+i);
option.addElement("Value").addText("debug_"+i);
}
return doc;
}
[/HTML]
But when I try to save the component or preview it, I get following error:
-------------------------------
Component preview failed.
Could not load component data XML into XMLDOM.
Datum ID=[category]
Must have least one option
--------------------------------
Please guide me how to use the generator.
Thanks
Find more posts tagged with
Comments
Stokes
Sounds like you're on the right track. Can you confirm that your Java method is being called? The part that looks suspect to me is the Hashtable signature of your method. As far as I know, that method has to have a single PropertyContext argument for the generator to call it.
If I'm right about that, I would be surprised if there's not a log message saying so. The UI is pretty bad about reporting generator errors properly, so you'll want to use the servletd log until you get it working.
Stokes.
AlexC
Make sure that Hashtable is from com.interwoven.livesite and not the one that comes with Java. This was a poor design decision made like 6 years ago that keeps getting people starting to write generators. If that is not the case, put a log trace into your generator to make sure it is being called.