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)
Can't get PropertyPrefix to populate SelectSingle Datum
dazzlad
All:
I am running TS 6.7.1 and LiveSite 3.0 on Windows server 2003.
I am trying to use PropertyPrefix to populate a Datum.
After lots of failed attempts I managed to get the IWOV provided sample working:
[PHP]
5
Loading
[/PHP]
This all works and in the servletd_out.log I see:
[PHP]2010-07-08 11:44:06,856 DEBUG com.interwoven.livesite.external.ExternalPojoManager - ExternalPojoManager.executePropertyPrefix: com.interwoven.livesite.external.runtime.Debugging::getDebugOptions[local][/PHP]
I've copied the getDebugOptions method from the Interwoven supplied impl.zip into one of my own classes in the LiveSite toolkit.
After a successful build of the toolkit I change the Object property of the PropertyPrefix to point at my class com.interwoven.livesite.external.runtime.Darren and the log then shows the following:
[PHP]2010-07-08 11:54:28,185 ERROR com.interwoven.livesite.runtime.model.component.Component - java.lang.RuntimeException: Unable to execute, no such method: com.darren.Test::getDebugOptions[local][/PHP]
(I know I should use my own namespace but I've been trying all sorts of variations to get this working!)
I know that the class is built into the livesite toolkit as I am using other methods of it sucessfully and I can see it's constructor being called in my logs. This is only when previewing a component however.
The error manifests itself when trying to save the component - the Error from the GUI is:
[PHP]Component update failed. Could not load component data XML into XMLDOM. Datum ID=[category]
Must have least one option [/PHP]
I assume that when I save the component livesite takes care of object instantiation etc?
Help!
Find more posts tagged with
Comments
dazzlad
Playing around some more:
If I add:
[PHP][/PHP]
My Object is instantiated and someOtherExternalCall - I can see this in the logs. So I know that my Object has been built and deployed into the webapp.
WTF!
AlexC
[html]
...
5
...
[/html]
What happened to /Datum typo or really missing?
dazzlad
Some strangeness with the devnet forum code formatter i guess.
The XML is valid as I can save the component using com.interwoven.livesite.external.runtime.Debugging
but not my own class.
Any tips. i'm getting desparate!
AlexC
Where does your code live and is it available to the LiveSite?
Also can you attach your .java file, I'd like to check the method and import if possible.
dazzlad
Hi Alex,
The class lives in my livesite toolkit.
It is accessible to livesite as I am calling two of it's other methods successfully:
[PHP]
com.darren.Test
allRecipesHQL[/PHP]
are working fine.
The complete content xml is:
[PHP]<Data>
<External>
<Parameters>
<Datum Exposed="true" ID="category" Name="moreOptions" Type="SelectSingle">
<PropertyPrefix Method="getDebugOptions" Object="com.darren.Test">
</PropertyPrefix>
<Option Selected="true">
<Display>Loading</Display>
<Value/>
</Option>
</Datum>
</Parameters>
<Prefix Method="someOtherExternalCall" Object="com.darren.Test" Scope="local"/>
<Object Scope="local">com.darren.Test</Object>
<Method>allRecipesHQL</Method>
</External>
</Data>
[/PHP]
I can't really give the complete class on a forum due to client confidentiality but essentially my class is:
[PHP]package com.darren;
....
public class Test {
private static final transient Log _logger = LogFactory.getLog(Test.class);
public Test() {
_logger.debug("Instaniate instance of " + this.getClass().toString());
}
.....
public Document getDebugOptions(Hashtable params)
{
Document doc = Dom4jUtils.newDocument();
doc.addElement("Options");
Element base = doc.getRootElement();
//a_Process parameters
String str = (String)params.get("basename");
String basename = (null == str ? "DebugItem" : str);
str = (String)params.get("start");
int startN = (null != str ? Integer.parseInt(str) : 3);
str = (String)params.get("count");
int countN = (null != str ? Integer.parseInt(str) : 3);
//a_Add N options
for (int i=startN; i
AlexC
I need to know the imprts which you left out, specifically which Hashtable and Document you are using.
dazzlad
com.interwoven.livesite.common.util.Hashtable
and
org.dom4j.Document
I am just taking a copy of debugging.java and dropping it into my toolkit under a new namespace to see whether i can get it working.....
dazzlad
OK - so that worked. I'm not sure why the version in my test class isn't....
AlexC
So it is working now?
dazzlad
yes - i've extracted it to a separate class - for some reason it doesn't work sat within my test class.
Not a bad idea to separate my propertyprefixes anyway.
Thanks for your help!
TeamsiteDev
Hi,
Does <PropertyPrefix> also work on runtime or only in Edit mode ??
Example If I want to pull a value from RequestContext , manipulate it and add that to my String Datum, will that updated value be passed to External call ??
Regards,
Ankit
tec_iwov
only in sitepub.
you'll need to do that via an external or prefix.