Scripted Data Source (Java Object as Event Handler) How-to

View: New views
3 Messages — Rating Filter:   Alert me  

Scripted Data Source (Java Object as Event Handler) How-to

by Johnnie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have the following event handler:

...

public class ScriptedDataSetEventHandler extends ScriptedDataSetEventAdapter {

    ...

    private int currentCount;

    @Override
    public boolean fetch(IDataSetInstance dataSet, IUpdatableDataSetRow row) {

        if (currentCount++ < 11) {

            try {
                row.setColumnValue("cnt", currentCount);
            } catch (ScriptException e) {
               
            }

            return true;

        }

        return false;

    }

    public void open(IDataSetInstance dataSet) {

        super.open(dataSet);

    }

and my question is: where must I put this class so that BIRT can see it - both at development and deployment time?

Thank you for your attention,

Johnny

RE: Scripted Data Source (Java Object as Event Handler) How-to

by Schalk Neethling-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there Johnny,

For development within the designer, it is best to jar up all your ajava
handlers and place the jar in your resources folder.

For deployment, it needs to be in the WEB-INF/classes/ folder along with
all your other engine related classes, platform plugins etc.

HTH
Schalk

-----Original Message-----
From: birt-dev-bounces@... [mailto:birt-dev-bounces@...]
On Behalf Of Johnnie
Sent: 19 May 2008 12:38 PM
To: birt-dev@...
Subject: [birt-dev] Scripted Data Source (Java Object as Event Handler)
How-to


Hi,

I have the following event handler:

...

public class ScriptedDataSetEventHandler extends
ScriptedDataSetEventAdapter
{

    ...

    private int currentCount;

    @Override
    public boolean fetch(IDataSetInstance dataSet, IUpdatableDataSetRow
row)
{

        if (currentCount++ < 11) {

            try {
                row.setColumnValue("cnt", currentCount);
            } catch (ScriptException e) {
               
            }

            return true;

        }

        return false;

    }

    public void open(IDataSetInstance dataSet) {

        super.open(dataSet);

    }

and my question is: where must I put this class so that BIRT can see it
-
both at development and deployment time?

Thank you for your attention,

Johnny

--
View this message in context:
http://www.nabble.com/Scripted-Data-Source-%28Java-Object-as-Event-Handl
er%29-How-to-tp17189808p17189808.html
Sent from the Eclipse BIRT - Dev mailing list archive at Nabble.com.

_______________________________________________
birt-dev mailing list
birt-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-dev

This email and all content are subject to the following disclaimer:

http://content.momentum.co.za/content/legal/disclaimer_email.htm


_______________________________________________
birt-dev mailing list
birt-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-dev

Re: Scripted Data Source (Java Object as Event Handler) How-to

by portal on behalf of Scott Rosenbaum :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Johnnie,

This is technically a mailer for the developers of BIRT.  Since this is a relatively common question, I have answered it on the wiki.

You can find it here:  Java Event Handlers FAQ

Scott Rosenbaum


Johnnie wrote:
Hi,

I have the following event handler:

...

public class ScriptedDataSetEventHandler extends ScriptedDataSetEventAdapter
{

    ...

    private int currentCount;

    @Override
    public boolean fetch(IDataSetInstance dataSet, IUpdatableDataSetRow row)
{

        if (currentCount++ < 11) {

            try {
                row.setColumnValue("cnt", currentCount);
            } catch (ScriptException e) {
                
            }

            return true;

        }

        return false;

    }

    public void open(IDataSetInstance dataSet) {

        super.open(dataSet);

    }

and my question is: where must I put this class so that BIRT can see it -
both at development and deployment time?

Thank you for your attention,

Johnny

  

_______________________________________________
birt-dev mailing list
birt-dev@...
https://dev.eclipse.org/mailman/listinfo/birt-dev