I am facing some issues with generators.
Before that even simple datum w.o generators as following does not work.
[html]
Content XML
Plan 2
Plan Valye
Plan
012345
[/html]
Error which I get when I try to save the component is:
Component update failed.
Could not load component data XML into XMLDOM.
com.interwoven.livesite.common.xml.ValidationError mColumn[10] mLine[4] mSystemID[null] mPublicID[null] mType[ERROR] mMessage[cvc-complex-type.2.4.a: Invalid content was found starting with element 'Options'. One of '{Font, Image, Date, Option, ContentTypes, DCR, Site, Generator, PropertyPrefix}' is expected.]
When I try to use generator
[html]
Content XML:
Plan
012345
[/html]
And I try with various JAVA code options but nothing works:
[html]
JAVA Code Option 1:
public Document getPopulateOptions(PropertyContext context)
{
Document doc = Dom4jUtils.newDocument("Display VValue Text 1Display V 2Value Text 2");
System.out.println(" Document Finally as XML " + doc.asXML() + " Raw Document " + doc);
return doc;
}
[/html]
[html]
JAVA Code Option 2:
public Document getPopulateOptions(PropertyContext context)
{
Document doc = Dom4jUtils.newDocument();
doc.addElement("Options");
Element base = doc.getRootElement();
for (int i=0; i<5; ++i)
{
Element option = doc.addElement("Option");
option.addElement("Display").addText("Display Text "+i);
option.addElement("Value").addText("Display Value "+i);
}
System.out.println(" Document Finally as XML " + doc.asXML() + " Raw Document " + doc);
return doc;
}
[/html]
[html]
JAVA Code Option 3:
public Document getPopulateOptions(PropertyContext context)
{
Document doc = Dom4jUtils.newDocument();
//doc.addElement("Options");
Element base = doc.getRootElement();
for (int i=0; i<5; ++i)
{
Element option = doc.addElement("Option");
option.addElement("Display").addText("Display Text "+i);
option.addElement("Value").addText("Display Value "+i);
}
System.out.println(" Document Finally as XML " + doc.asXML() + " Raw Document " + doc);
return doc;
}
[/html]
None of the above options work. Please let me know what I am missing here or Generator functionality works at all and if anyone was able to implement it successfully.
Error:
Component update failed.
Could not load component data XML into XMLDOM.
Datum ID=[category]
Must have least one option
Even the code provided in SitePublisher dev guide does not work and does not populate any options. It does not give any error but does not populate any options as well.
[html]
5
Plan
012345
[/html]
I also tried an example mentioned in the following post:
http://devnet.interwoven.com/forums_vb/showthread.php?t=31403&forumid=66&highlight=generator[html]
public Document getPopulateOptions(PropertyContext context)
{
Document doc = Dom4jUtils.newDocument();
Element options = doc.addElement("Options");
GeneratorUtils.addOption(options, "English", "en_US");
GeneratorUtils.addOption(options, "Spanish", "es_US");
GeneratorUtils.addOption(options, "French", "fr_CA");
System.out.println(" Document Finally as XML " + doc.asXML() + " Raw Document " + doc);
return doc;
}
[/html]
Content XML is
[html]
[/html]
Following is my XML from Logs:
[html]
Document Finally as XML
Englishen_USSpanishes_USFrenchfr_CA
[/html]
But it does not populate any options.

TS 7.1
LS 7.1
Windows 2003 Server