Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Rhino warning setting parameter value in parameter task
Rhino warning setting parameter value in parameter task [message #368354] Fri, 22 May 2009 21:43 Go to next message
Russ Tennant is currently offline Russ TennantFriend
Messages: 12
Registered: July 2009
Junior Member
I have integrated BIRT into an application. We have a custom UI for
running/scheduling a report and when the parameters for a report are
captured and validated I get the following warning for datetime values.

"RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object 2009-05-28 21:02:00.0 of class
java.sql.Timestamp where it expected String, Number, Boolean or
Scriptable instance. Please check your code for missing
Context.javaToJS() call."

The code I am using to validate the parameters looks something like the
following.

final IGetParameterDefinitionTask parameterTask =
_reportGenerator.getParameterTask(
getLocaleContext().getLocale(),
getSession().getTimeZone());
try
{
for(final ModelValueHelper helper : _paramModelHelpers.values())
{
final String paramName = helper.getParam().getName();
final Object paramValue = helper.getParamValue();
parameterTask.setParameterValue(paramName, paramValue);
}
validParameters = parameterTask.validateParameters();
}
finally
{
parameterTask.close();
}


In the above code "paramValue" will be one of "Boolean, Date, Time,
Timestamp, Integer, Float, BigDecimal, or String".


Is this the correct way to validate parameters? Do I need to convert
...sql.(Date|Time)* and BigDecimal to a Scriptable? When I run the
report, I don't get these warnings. Also, I'm not sure if this is the
same issue as https://bugs.eclipse.org/bugs/show_bug.cgi?id=274500

Thanks for any help.

--
Russ
Re: Rhino warning setting parameter value in parameter task [message #368370 is a reply to message #368354] Tue, 26 May 2009 14:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Russ,

This does appear to be that same bug.
BTW on the runtask or runtandrendertask you can call
validateParameters(). Just wondering if the same issues happens if you
do it this way.

Jason

Russ Tennant wrote:
> I have integrated BIRT into an application. We have a custom UI for
> running/scheduling a report and when the parameters for a report are
> captured and validated I get the following warning for datetime values.
>
> "RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
> Rhino runtime detected object 2009-05-28 21:02:00.0 of class
> java.sql.Timestamp where it expected String, Number, Boolean or
> Scriptable instance. Please check your code for missing
> Context.javaToJS() call."
>
> The code I am using to validate the parameters looks something like the
> following.
>
> final IGetParameterDefinitionTask parameterTask =
> _reportGenerator.getParameterTask(
> getLocaleContext().getLocale(),
> getSession().getTimeZone());
> try
> {
> for(final ModelValueHelper helper : _paramModelHelpers.values())
> {
> final String paramName = helper.getParam().getName();
> final Object paramValue = helper.getParamValue();
> parameterTask.setParameterValue(paramName, paramValue);
> }
> validParameters = parameterTask.validateParameters();
> }
> finally
> {
> parameterTask.close();
> }
>
>
> In the above code "paramValue" will be one of "Boolean, Date, Time,
> Timestamp, Integer, Float, BigDecimal, or String".
>
>
> Is this the correct way to validate parameters? Do I need to convert
> ..sql.(Date|Time)* and BigDecimal to a Scriptable? When I run the
> report, I don't get these warnings. Also, I'm not sure if this is the
> same issue as https://bugs.eclipse.org/bugs/show_bug.cgi?id=274500
>
> Thanks for any help.
>
> --
> Russ
Re: Rhino warning setting parameter value in parameter task [message #368375 is a reply to message #368370] Tue, 26 May 2009 15:55 Go to previous message
Russ Tennant is currently offline Russ TennantFriend
Messages: 12
Registered: July 2009
Junior Member
I do not get this warning for the run task, just the parameter task. Thanks.

Jason Weathersby wrote:
> Russ,
>
> This does appear to be that same bug.
> BTW on the runtask or runtandrendertask you can call
> validateParameters(). Just wondering if the same issues happens if you
> do it this way.
>
> Jason
>
Previous Topic:Master page header and footer content visibility
Next Topic:Format Number using a Style
Goto Forum:
  


Current Time: Tue Apr 23 10:54:06 GMT 2024

Powered by FUDForum. Page generated in 0.03463 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top