ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert G." <...@mercon24.de>
Subject Re: Beanshell
Date Sun, 22 Jul 2012 22:21:51 GMT
please specify your problem, that we know for what to look.

thanks
G.Ben wrote
> 
> Hello everyone,
> 
> Please, can anyone tell me what is wrong with this script ? 
> 
> import org.ofbiz.base.location.FlexibleLocation;
> import freemarker.ext.beans.BeansWrapper;
> String scriptName = request.getParameter("scriptName");
> if (scriptName == null || scriptName.length() == 0) {
> return "success";
> }
> String lookInLocation =
> "component://learning/webapp/learning/WEB-INF/actions/entityaccess/";
> URL location = FlexibleLocation.resolveLocation(lookInLocation +
> scriptName);
> if (location == null) {
> context.put("errorMsg", "Script name \"" + scriptName + "\" not found at "
> + lookInLocation);
> return "success";
> }
> source(location);
> bw = BeansWrapper.getDefaultInstance();
> bw.setSimpleMapWrapper(true);
> Object massaged;
> if (data instanceof List) {
> massaged = new ArrayList();
> dataItr = data.iterator();
> while (dataItr.hasNext()) {
> record = (Map) dataItr.next();
> massaged.add(bw.wrap(record));
> }
> }
> else if (data instanceof Map) {
> massaged = bw.wrap(data);
> }
> if (massaged != null) {
> context.put("data", massaged);
> }
> return "success";
> 
> 
> 
> Thank you so much for your help,
> 
> Regards.
> 




--
View this message in context: http://ofbiz.135035.n4.nabble.com/Beanshell-tp4635129p4635130.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Mime
View raw message