Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Script Functions: how are Java objects handled in JS?
Script Functions: how are Java objects handled in JS? [message #831384] Wed, 28 March 2012 16:57 Go to next message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
Do Script Functions work as described in Rhino documentation? Or do they use some rules for translating Java objects into Javascript ones (and vice versa for arguments), like SWT BrowserFunctions? From examples in birt-functions-lib it certainly looks the first way, but better safe than sorry.
Re: Script Functions: how are Java objects handled in JS? [message #831729 is a reply to message #831384] Thu, 29 March 2012 05:07 Go to previous messageGo to next message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
Also, what are legal values for DataType element in plugin.xml? All functions in http://code.google.com/a/eclipselabs.org/p/birt-functions-lib/source/browse/branches/2.5.2/birt.functions.lib/plugin.xml have value="String".
Re: Script Functions: how are Java objects handled in JS? [message #831733 is a reply to message #831729] Thu, 29 March 2012 05:13 Go to previous messageGo to next message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
Are they the same as org.eclipse.birt.core.data.DataType?
Re: Script Functions: how are Java objects handled in JS? [message #832213 is a reply to message #831733] Thu, 29 March 2012 18:46 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Alexey,

That is correct. Here is the list of data type names.


package org.eclipse.birt.core.data;

import java.math.BigDecimal;
import java.sql.Blob;
import java.util.Date;

/**
* Defines constants for BIRT data types
*/
public abstract class DataType
{
public static final int UNKNOWN_TYPE = -1;
public static final int ANY_TYPE = 0;
public static final int BOOLEAN_TYPE = 1;
public static final int INTEGER_TYPE = 2;
public static final int DOUBLE_TYPE = 3;
public static final int DECIMAL_TYPE = 4;
public static final int STRING_TYPE = 5;
public static final int DATE_TYPE = 6;
public static final int BLOB_TYPE = 7;
public static final int BINARY_TYPE = 8;
public static final int SQL_DATE_TYPE = 9;
public static final int SQL_TIME_TYPE = 10;
public static final int JAVA_OBJECT_TYPE = 11;

private static final String[] names =
{
"Any",
"Boolean",
"Integer",
"Float",
"Decimal",
"String",
"DateTime",
"Blob",
"Binary",
"Date",
"Time",
"Java Object"
};


BTW you may be interested in :

http://www.informit.com/articles/article.aspx?p=1748986
http://birtworld.blogspot.com/2008/09/birt-231-adding-functions-to-expression.html

//aggregate extension
http://birtworld.blogspot.com/2010/10/birt-duplicate-rows.html
http://birtworld.blogspot.com/2006/09/optimistic-sums.html

Jason

On 3/29/2012 5:13 AM, Alexey Romanov wrote:
> Are they the same as
> http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.birt.doc.isv%2Fcore%2Fapi%2Forg%2Feclipse%2Fbirt%2Fcore%2Fdata%2FDataType.html?
>
Previous Topic:hiding labels for zero values using API
Next Topic:Use of XML DataSource with http security (JAAS auth-mode = BASIC)
Goto Forum:
  


Current Time: Mon Jul 28 06:30:49 EDT 2014

Powered by FUDForum. Page generated in 0.05686 seconds