BIRT Runtime download / BIRT Viewer - birt

I'm new to BIRT and managed to create some reports using Eclipse. I can see the report through the "BIRT Viewer" from Eclipse.
But I couldn't deploy the report outside the Eclipse. The documentation describes the "birt.war" to be deployed to the application/web server prior to deploy the reports.
From where can I find the BIRT runtime which is supposed to have the "BIRT viewer".
Thx in advance,

The BIRT runtime must be downloaded seperatly, you can download it on the eclipse page:
http://download.eclipse.org/birt/downloads/#runtime
You will find the birt.war inside the archive.

The last version for birt runtime it's here http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4_4_2-201502171805/birt-runtime-4_4_2-20150217.zip
After download you put in the .war all the .rptdesign files and deploy in you java server. For example: In tomcat is webapps folder and in wildfly is standalone\deployments.
You can see in the url http://localhost:8080/birt/frameset?__report=YOU_REPORT.rptdesign

You could use BIRT Runtime or in the other hand you've the process for running from a java class. In this method you don't need to use the BIRT Runtime, you just need to add the .jar files to the project in the documentation you'll see more information.
Documentation from BIRT:
http://www.eclipse.org/birt/documentation/integrating/reapi.php
Just to start you will need to understand that the Runtime in Java Class is called EngineConfig().
EXAMPLE:
try{
final EngineConfig config = new EngineConfig( );
//BIRT provides two ways of doing the reports externally
//1.- BIRT Runtime is kind of difficult to configure
//2.- POJO It uses classes into a Java class (You need to import the emitters from the format you'll use and other libraries.
//config.setEngineHome( "C:\\birt-runtime-2_6_2\\birt-runtime-2_6_2\\ReportEngine" );
config.setLogConfig("c:/temp", Level.FINE);
Platform.startup( config );
//If using RE API in Eclipse/RCP application this is not needed.
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
engine.changeLogLevel( Level.WARNING );
}catch( Exception ex){
ex.printStackTrace();
}
// Run reports, etc.
...
//On the page it's the explanation to create the container and the properties for the report, like the selection of the rptdesign to be used, the parameters, the outputfile path, outputfile format, etc.
//IRunTask and IRunandRenderTask are the method to send the options to the Runtime class that will get the report, output, etc.
//EXACTLY ON THE EMITTERS CONFIGURATION'
// destroy the engine.
try
{
engine.destroy();
Platform.shutdown();
//Bugzilla 351052
RegistryProviderFactory.releaseDefault();
}catch ( EngineException e1 ){
// Ignore
}

To whomever coming here for using BIRT in production and/or included in your dependencies:
The only valid jar-option for you is version 4.4.2. Both 4.6.x and 4.5.x include bugs that prevent correct deployment and functionality. Older versions than 4.4.2 lack necessary features.
Click here to check out your build management link on mvnrepository.com.

I recommmend to include the runtime into your web projects as a maven dependency. This way you have full control and seamless integration.
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.4.1</version>
</dependency>

Make sure that you change the genReport.bat -
genReport.bat Changes

please download BIRT ENGINE and deploy it in your server .
and by changing .BAT file you make it flexible. i hope it helps you

Related

Vaadin 14 transitive NPM dependencies

I'm in the process of switching my Spring Boot + Vaadin application from Vaadin 14 in "Vaadin 13 compatibility mode" to "native Vaadin 14 mode". This is primarily because I want to use the Vaadin Gradle Plugin in order to be able to enable production mode. This also requires upgrading from Full Calendar web component to Full Calendar 4 web component, which now supports Vaadin 14+ and also wraps a newer version of FullCalendar. So lots of things needing to happen at the same time unfortunately.
The issue I'm now having, is that when the FullCalendar component is shown, I get this client-side error:
(ReferenceError) : moment is not defined
I see that the FullCalendar web component jar has these annotations on the FullCalendar class in the org.vaadin.stefan.fullcalendar package:
#NpmPackage(value = "moment", version = "2.24.0")
#NpmPackage(value = "moment-timezone", version = "0.5.28")
#NpmPackage(value = "#fullcalendar/moment", version = "4.4.0")
#NpmPackage(value = "#fullcalendar/moment-timezone", version = "4.4.0")
The reason that the first two are listed here is probably because they are defined as peer dependencies of the last two, so they are not installed automatically.
I also noticed that the FullCalendar 4 web component page mentions the following known issue:
Build problems / JS (client side) errors (V14+)
It might be, that the transitive dependencies are not resolved correctly.
If you are using Spring Boot please add the #EnableVaadin annotation to your application class. Add the package org.vaadin.stefan plus your root package as parameters. This should enable Spring to analyze all npm dependencies at runtime. Other CDI version should work the same.
So I've added this annotation to my application class:
#SpringBootApplication
#EnableVaadin({"org.vaadin.stefan", "com.mypackage"})
public class MyApplication {
But this doesn't seem to work.
I've also tried running the gradle task vaadinBuildFrontend instead of just vaadinPrepareFrontend, but that didn't make a difference.
What else should I do to make sure moment is loaded and initialized properly?
UPDATE: if I explicitly enable vaadin.productionMode in build.gradle, then the error is gone. Of course, I want to be able to run the application in development mode as well.
UPDATE 2: I've experimented with creating a clean Vaadin + Spring Boot + Gradle project from the provided base project. I noticed one difference: in my own application I get a warning logged:
dev-updater : Couldn't find dev dependencies file. Dev dependencies won't be locked
... which I don't get in the clean project. I get the following logging lines there which I don't get in my own project:
dev-updater : Visited 88 classes. Took 16 ms.
dev-updater : Skipping `pnpm install` because the frontend packages are already installed...
dev-updater : Copying frontend resources from jar files ...
dev-updater : Visited 13 resources. Took 84 ms.```
UDPATE 3: I found out that the moment() function is actually called from code that is executed using calendar.getElement().executeJs(...). Apparently the function is not known in that scope. Maybe due to strict mode? Not sure if that explains why it works in production mode.
I haven't used gradle with V14, so I cannot tell for sure, if it is maybe a gradle related reason or a Vaadin / addon issue. I just can tell, that I at least tried to setup a new project last week with the addon and it worked out of the box, so I assume, there are some tricky details burried somewhere.
Let's start with some usual question:
I assume, you use V14.3.x?
Has the moments library been downloaded (see project root > node_modules/moment and ./moment-timezone)? If not, is it listed in the package.json file?
Have you encountered this problem also with the clean Vaadin project?
And, not that I ask you to use it instead, but just for test purposes - have you tried the same setup with maven instead of gradle?
How are you using the calendar in Java. Can you show some example code of the implementation?
I was able to work around the issue because moment was used to create a parseable date string, but (at least the current version of) the library supports the ISO format returned by LocalDate#toString.
As I suspected, due to strict mode, the variable is not declared in global scope and therefore can't be used in executeJs. If it is necessary to do so, one needs to create a javascript file that adds the variable to window, and import that file using #JsModule. Then the variable in the window object can be used from executeJs.
See https://vaadin.com/forum/thread/17832455/how-to-use-external-javascript-libraries-correct-in-vaadin-14-npm and https://vaadin.com/forum/thread/17753553/can-t-use-frontend-js-with-vaadin-14.

Exception: org.exolab.castor.xml.ValidationException was not added to the list of sorted types

I am trying to deploy EAR file on Websphere Application Server but while deploying it's showing an error.
ERROR CODE:
SEVERER: Exception org.exolab.castor.xml.ValidationException was not added to the list of sorted types.
The project was not built since its build path is incomplete. Cannot find the class file for org.exolab.castor.xml.ValidationException. Fix the build path then try building this project.
I am using Castor in my project but it's there in classpath which i am setting through Shellscript.
Thanks for help in advance.
Your dependencies need to be expressed to the application server runtime, not added to some shell variable or standalone java invocation. Either package them in your application or create an isolated shared library and associate it with your dependent application.

where to place the external java jar when deploy birt report?

I use some java code to retrieve data from database, and export the java code as runnable jar, placed the jar in eclipse\plugins\org.eclipse.birt.report.viewer_3.7.1.v20110905\birt\scriptlib, then in the birt report I can use the jar to get the data. In eclipse all goes smoothly, I can see the correct data in preview.
but when I upload the myreport.rptdesign to the server, I don't know where to place the jar then the report can refer to it. In our team, they use grails to deploy birt report, all I need to do is upload the rptdesign file to a specified server directory, when there's no java jar to refer, that's enough. but when I need to refer to a java jar, I do not know how to deploy.
Please help and thanks a lot.
=========================================================
here is answer of my question. Just put the jar in directory lib of grails. It works!
Did you try to put the jar file in the server/lib directory? What kind of application server are you currently using?

Is it okay to use org.eclipse.birt imports in java file?

I am trying to integrate birt report Engine into my struts2 application, is it okay to have org.eclipse.birt imports ? will they create any problems in server side (when i push into main server)?? please elaborate i am new to this!
Yes, if you are trying to integrate BIRT into your application you can, and will need to, import those packages.
You will need to make sure that the appropriate jars (the one(s)) containing the imported packages) are available to the server at runtime.

Using FreeMarker with Apache Sling

I'm using a Content Repository (Adobe CQ5) that has Apache Sling underneath. I'd like to render web pages using FreeMarker instead of JSP.
For that to work should I upload the OSGi Freemarker extension to Sling, which is to be found in the contribution part of Sling source code, or should I upload an OSGi version of Freemarker instead? Both jars implement the interface javax.script.ScriptEngineFactory so I don't know which one to use, or to upload both.
I managed to get Freemarker working on CQ5.3 by doing the following:
get the source from svn checkout http://svn.apache.org/repos/asf/sling/trunk sling
go to the contrib/scripting/freemarker and remove all the logging and slf4j references from FreemarkerScriptEngine.java - it throws a 500 error due to NoClassDefFoundException - I think there is a conflict between CQ5 and a version of slf4j included in Freemarker (I didn't dig to find out what was wrong)
build it and install, it should appear in the Sling console under bundles and in the 'script engines' page, and let you use .ftl scripts now.
I did it slightly differently by creating the bundle inside CQ5, importing the code and adding a stock freemarker.jar into the bundle but this should work too as it's basically the same thing.
The problem I had was that the script engine does get listed but the logging prevents it from running, that's why you need to remove the log & slf4j from the engine.
I don't know about the OSGi version of Freemarker; we created our own bundling of Freemarker specially for Sling. If you have success using the OSGi version of Freemarker let us know ;-)
Testing is easy: Just install the bundle through the Web Console and check for the supported Script Engines in the Web Console Configuration Status. If you see the Freemarker Engine listed there, it should work.

Resources