Search the FirstSpirit Knowledge Base
Hi Community,
I have, as usual, a strange problem.
I have in template a beanshell script render
$CMS_RENDER(script:"generate_newsletter_html", newsletterId:#row.fs_id )$ |
the beanshell script
import de.itelligence.firstspirit.opt.webapp.utils.Newsletter;
try{
newsletterId = context.getVariableValue("newsletterId");
newsletterId = String.valueOf(newsletterId);
html = de.itelligence.firstspirit.opt.webapp.utils.Newsletter.getHtml(newsletterId, context);
return html;
} catch(ex){
return ex.toString();
}
everything is working ok on javaClient preview, I got my html, the Newsletter class work correct.
The problem come when I try to send teh newsletter, I got the page without my dynamic html generated from my Newsletter class.
preview:
generated html, no UM code, nothing....
Newsletter class is installed on Preview, Staging, Webedit...
I think something is missing on generation, looks like the Newsletter class is not installed.
If I return in beanshell script just the newsletterId as text, I got it on my generated html.
Any idea?
Best regards,
Antonio
The jar should be made available to the generation as "normal" resource, currently it's only available as web-resource:
<module>
<name>i-telligence-Mod</name>
<version>@VERSION@</version>
<description></description>
<vendor>i-telligence UG</vendor>
<class>de.itelligence.firstspirit.opt.webapp.configuration.WebAppModule</class>
<components>
<web-app>
<name>i-telligence WebApp</name>
<description></description>
<class>de.itelligence.firstspirit.opt.webapp.configuration.WebApp</class>
<configurable>de.itelligence.firstspirit.opt.webapp.configuration.WebAppConfiguration</configurable>
<web-xml>web.xml</web-xml>
<resources>
<resource>lib/webapp-@VERSION@.jar</resource>
</resources>
<web-resources>
<resource>itelligence.tld</resource>
<resource>configuration.properties</resource>
<resource>lib/webapp-@VERSION@-webapp.jar</resource>
<resource>lib/CoordinateTool.jar</resource>
</web-resources>
</web-app>
</components>
<resources>
<resource scope="server">lib/CoordinateTool.jar</resource>
</resources>
</module>
Do you get any error?
Hi Peter,
I forget everytime to check the log files, i just check my java console.
here we are
07.03.2013 13:44:52 {pID=80366} (de.espirit.firstspirit.generate.SiteProduction): at 0, 0: Script 'generate_newsletter_html' (id=141504) - Class or variable not found: de.itelligence.firstspirit.opt.webapp.utils.Newsletter : at Line: 7 : in file: inline evaluation of: ``__execute() { import de.itelligence.firstspirit.opt.webapp.utils.Newsletter; tr . . . '' : de .itelligence .firstspirit .opt .webapp .utils .Newsletter .getHtml ( newsletterId , context )
at line 7
what I have to do?
Could you post the module.xml of your module?
<module>
<name>i-telligence-Mod</name>
<version>@VERSION@</version>
<description></description>
<vendor>i-telligence UG</vendor>
<class>de.itelligence.firstspirit.opt.webapp.configuration.WebAppModule</class>
<components>
<web-app>
<name>i-telligence WebApp</name>
<description></description>
<class>de.itelligence.firstspirit.opt.webapp.configuration.WebApp</class>
<configurable>de.itelligence.firstspirit.opt.webapp.configuration.WebAppConfiguration</configurable>
<web-xml>web.xml</web-xml>
<resources>
<resource>lib/webapp-@VERSION@.jar</resource>
</resources>
<web-resources>
<resource>itelligence.tld</resource>
<resource>configuration.properties</resource>
<resource>lib/webapp-@VERSION@-webapp.jar</resource>
<resource>lib/CoordinateTool.jar</resource>
</web-resources>
</web-app>
</components>
</module>
The jar should be made available to the generation as "normal" resource, currently it's only available as web-resource:
<module>
<name>i-telligence-Mod</name>
<version>@VERSION@</version>
<description></description>
<vendor>i-telligence UG</vendor>
<class>de.itelligence.firstspirit.opt.webapp.configuration.WebAppModule</class>
<components>
<web-app>
<name>i-telligence WebApp</name>
<description></description>
<class>de.itelligence.firstspirit.opt.webapp.configuration.WebApp</class>
<configurable>de.itelligence.firstspirit.opt.webapp.configuration.WebAppConfiguration</configurable>
<web-xml>web.xml</web-xml>
<resources>
<resource>lib/webapp-@VERSION@.jar</resource>
</resources>
<web-resources>
<resource>itelligence.tld</resource>
<resource>configuration.properties</resource>
<resource>lib/webapp-@VERSION@-webapp.jar</resource>
<resource>lib/CoordinateTool.jar</resource>
</web-resources>
</web-app>
</components>
<resources>
<resource scope="server">lib/CoordinateTool.jar</resource>
</resources>
</module>
Is working...I have to write a new method with SiteProduction instead GenerationContext too, and is working.
thanks