Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Scripting DS, Custom POJO and Classpath.
Scripting DS, Custom POJO and Classpath. [message #171685] Tue, 20 June 2006 13:34 Go to next message
Eclipse UserFriend
Originally posted by: ""z a r o u b i ( removespaces)\".q u an t risk . com"

Here is my setup :
1) Created my own viewer using the Engine API using a web interface
(Tomcat)
2) All my POJO's are in my webapp directory
3) I am trying to write daemons to create pdf reports that should be
generated once a day and use these POJO Objects.
4) When I follow the example in
http://download.eclipse.org/birt/downloads/examples/scriptin g/scripteddatasource/scripteddatasource.html
I don't have a problem. But as soon as I try to instanciate one of my
own objects that is in the my webapp, I have a problem.

Note: My CLASSPATH environment variable is set up correctly.
Question: Is there a way that I can, in javascript say: "Here is where
you have to look my java objects" ?

Thank you for your time.
Re: Scripting DS, Custom POJO and Classpath. [message #171702 is a reply to message #171685] Tue, 20 June 2006 14:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

What are the indications that you have a problem?

removespaces wrote:
> Here is my setup :
> 1) Created my own viewer using the Engine API using a web interface
> (Tomcat)
> 2) All my POJO's are in my webapp directory
> 3) I am trying to write daemons to create pdf reports that should be
> generated once a day and use these POJO Objects.
> 4) When I follow the example in
> http://download.eclipse.org/birt/downloads/examples/scriptin g/scripteddatasource/scripteddatasource.html
> I don't have a problem. But as soon as I try to instanciate one of my
> own objects that is in the my webapp, I have a problem.
>
> Note: My CLASSPATH environment variable is set up correctly.
> Question: Is there a way that I can, in javascript say: "Here is
> where you have to look my java objects" ?
>
> Thank you for your time.
Re: Scripting DS, Custom POJO and Classpath. [message #171717 is a reply to message #171702] Tue, 20 June 2006 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ""z a r o u b i ( removespaces)\".q u an t risk . com"

Thank you Mark for your prompt reply,
Following you will find, what I have tried, what worked and what failed.

1) Create a new datasource (scripted)
2) Create a new data set (Output columns: ID, date)

3) In the open of the dataset use:
// start of open method
d = new Packages.java.util.Date();
i = 0;
// end of open method

4) In the fetch of the DS
// start of fetch
if(i > 0){
return false;
}
row.ID = i;
row.date = Packages.java.lang.System.getenv("CLASSPATH")
i++;
return true;
//end of fetch.

I then dumped the DS as a table, clicked preview, and it correctly
dumped the classpath (Which contains the the path to my objects)

5) The I modified the open method:
To:
// START OF MODIFIED OPEN METHOD
d = new Packages.trader.main.com.quantrisk.DateConverter("2006-01-01 ",
3); // which is a valid constructor of the DateConverter object and is
in my classpath
i = 0;
// END OF MODIFIED OPEN METHOD


6) That didn't work.
The error message that I get is:
Error0 : Error.ScriptEvaluationError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are
errors evaluating script "<Insert my method body here>"


Things to note:
1) Birt Sees java objects as it can dump The env vars; and I get
instanciate a java.util.Date object
2) As soon as I change the 1 line of code to instatiate one of my custom
POJO Objects it stops working. (The object is infact in my classpath)


Mark wrote:
> What are the indications that you have a problem?
>
> removespaces wrote:
>> Here is my setup :
>> 1) Created my own viewer using the Engine API using a web
>> interface (Tomcat)
>> 2) All my POJO's are in my webapp directory
>> 3) I am trying to write daemons to create pdf reports that should
>> be generated once a day and use these POJO Objects.
>> 4) When I follow the example in
>> http://download.eclipse.org/birt/downloads/examples/scriptin g/scripteddatasource/scripteddatasource.html
>> I don't have a problem. But as soon as I try to instanciate one of my
>> own objects that is in the my webapp, I have a problem.
>>
>> Note: My CLASSPATH environment variable is set up correctly.
>> Question: Is there a way that I can, in javascript say: "Here is
>> where you have to look my java objects" ?
>>
>> Thank you for your time.
Re: Scripting DS, Custom POJO and Classpath. [message #171773 is a reply to message #171717] Tue, 20 June 2006 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Where do you have your classes located? Are they in the viewer's web lib?

Can you provide the whole error message? Or is that all you get?

removespaces wrote:
> Thank you Mark for your prompt reply,
> Following you will find, what I have tried, what worked and what failed.
>
> 1) Create a new datasource (scripted)
> 2) Create a new data set (Output columns: ID, date)
>
> 3) In the open of the dataset use:
> // start of open method
> d = new Packages.java.util.Date();
> i = 0;
> // end of open method
>
> 4) In the fetch of the DS
> // start of fetch
> if(i > 0){
> return false;
> }
> row.ID = i;
> row.date = Packages.java.lang.System.getenv("CLASSPATH")
> i++;
> return true;
> //end of fetch.
>
> I then dumped the DS as a table, clicked preview, and it correctly
> dumped the classpath (Which contains the the path to my objects)
>
> 5) The I modified the open method:
> To:
> // START OF MODIFIED OPEN METHOD
> d = new Packages.trader.main.com.quantrisk.DateConverter("2006-01-01 ",
> 3); // which is a valid constructor of the DateConverter object and is
> in my classpath
> i = 0;
> // END OF MODIFIED OPEN METHOD
>
>
> 6) That didn't work.
> The error message that I get is:
> Error0 : Error.ScriptEvaluationError ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: There are
> errors evaluating script "<Insert my method body here>"
>
>
> Things to note:
> 1) Birt Sees java objects as it can dump The env vars; and I get
> instanciate a java.util.Date object
> 2) As soon as I change the 1 line of code to instatiate one of my custom
> POJO Objects it stops working. (The object is infact in my classpath)
>
>
> Mark wrote:
>
>> What are the indications that you have a problem?
>>
>> removespaces wrote:
>>
>>> Here is my setup :
>>> 1) Created my own viewer using the Engine API using a web
>>> interface (Tomcat)
>>> 2) All my POJO's are in my webapp directory
>>> 3) I am trying to write daemons to create pdf reports that should
>>> be generated once a day and use these POJO Objects.
>>> 4) When I follow the example in
>>> http://download.eclipse.org/birt/downloads/examples/scriptin g/scripteddatasource/scripteddatasource.html
>>> I don't have a problem. But as soon as I try to instanciate one of
>>> my own objects that is in the my webapp, I have a problem.
>>>
>>> Note: My CLASSPATH environment variable is set up correctly.
>>> Question: Is there a way that I can, in javascript say: "Here is
>>> where you have to look my java objects" ?
>>>
>>> Thank you for your time.
Re: Scripting DS, Custom POJO and Classpath. [message #171782 is a reply to message #171773] Tue, 20 June 2006 15:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: "z_a_r_oub_i_remove_underscores)".q_u_an_t_risk_._com

Mark wrote:
> Where do you have your classes located? Are they in the viewer's web lib?
>
> Can you provide the whole error message? Or is that all you get?
>
> removespaces wrote:
>> Thank you Mark for your prompt reply,
>> Following you will find, what I have tried, what worked and what failed.
>>
>> 1) Create a new datasource (scripted)
>> 2) Create a new data set (Output columns: ID, date)
>>
>> 3) In the open of the dataset use:
>> // start of open method
>> d = new Packages.java.util.Date();
>> i = 0;
>> // end of open method
>>
>> 4) In the fetch of the DS
>> // start of fetch
>> if(i > 0){
>> return false;
>> }
>> row.ID = i;
>> row.date = Packages.java.lang.System.getenv("CLASSPATH")
>> i++;
>> return true;
>> //end of fetch.
>>
>> I then dumped the DS as a table, clicked preview, and it correctly
>> dumped the classpath (Which contains the the path to my objects)
>>
>> 5) The I modified the open method:
>> To:
>> // START OF MODIFIED OPEN METHOD
>> d = new Packages.trader.main.com.quantrisk.DateConverter("2006-01-01 ",
>> 3); // which is a valid constructor of the DateConverter object and is
>> in my classpath
>> i = 0;
>> // END OF MODIFIED OPEN METHOD
>>
>>
>> 6) That didn't work.
>> The error message that I get is:
>> Error0 : Error.ScriptEvaluationError ( 1 time(s) )
>> detail : org.eclipse.birt.report.engine.api.EngineException: There are
>> errors evaluating script "<Insert my method body here>"
>>
>>
>> Things to note:
>> 1) Birt Sees java objects as it can dump The env vars; and I get
>> instanciate a java.util.Date object
>> 2) As soon as I change the 1 line of code to instatiate one of my
>> custom POJO Objects it stops working. (The object is infact in my
>> classpath)
>>
>>
>> Mark wrote:
>>
>>> What are the indications that you have a problem?
>>>
>>> removespaces wrote:
>>>
>>>> Here is my setup :
>>>> 1) Created my own viewer using the Engine API using a web
>>>> interface (Tomcat)
>>>> 2) All my POJO's are in my webapp directory
>>>> 3) I am trying to write daemons to create pdf reports that
>>>> should be generated once a day and use these POJO Objects.
>>>> 4) When I follow the example in
>>>> http://download.eclipse.org/birt/downloads/examples/scriptin g/scripteddatasource/scripteddatasource.html
>>>> I don't have a problem. But as soon as I try to instanciate one of
>>>> my own objects that is in the my webapp, I have a problem.
>>>>
>>>> Note: My CLASSPATH environment variable is set up correctly.
>>>> Question: Is there a way that I can, in javascript say: "Here is
>>>> where you have to look my java objects" ?
>>>>
>>>> Thank you for your time.

Thank you again Mark for your reply (I reconfigured my news client to
display my name)

I was just able to get the thing to work.
What was wrong is that as I mentioned I have written Servlet to view the
rptdesign files. I was viewing the reports using the "preview" button,
as soon as I used my Servlet everything was fine. It found the classes.


My classes are in the c:/program
files/tomcat/webapps/sampleWeb/WEB-INF/classes
But my birt report designer is in : c:/birt/reportDesigner
I tried to move my classes directory into the report
designer/org.eclipse.birt.report.viewer_X.Y.Z\birt\WEB-INF\l ib

Restarted birt but viewing my reports in the viewer still didn't work.


The reason I can't sent you the complete dump of the error message is
that it's running on a computer that is not connected to the net. (It
would take a long time to re-type everything).
Re: Scripting DS, Custom POJO and Classpath. [message #171804 is a reply to message #171782] Tue, 20 June 2006 16:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

your classes should go in
designer/org.eclipse.birt.report.viewer_X.Y.Z\birt\WEB-INF\c lasses

Or was that just a typo?
Re: Scripting DS, Custom POJO and Classpath. [message #171812 is a reply to message #171804] Tue, 20 June 2006 16:19 Go to previous message
Eclipse UserFriend
Originally posted by: "z_a_r_oub_i_remove_underscores)".q_u_an_t_risk_._com

Mark wrote:
> your classes should go in
> designer/org.eclipse.birt.report.viewer_X.Y.Z\birt\WEB-INF\c lasses
>
> Or was that just a typo?

Yup just a typo.

Now I got my system to "see" (instantiate) some of my classes. But some
other one are just causing the system to crash ..

I will bash my head on this for another hour, if that doesn't work ...
Well I will hear the "I am paying you and you are not producing" line
from my boss. I guess at which point I will have to try to find another
solution to our problem.

Thank you again.
Previous Topic:Date Report Parameters only work in designer
Next Topic:Problem with multiple emf jar files?
Goto Forum:
  


Current Time: Thu Apr 25 01:36:23 GMT 2024

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

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

Back to the top