0.0
No commit activity in last 3 years
No release in over 3 years
JasperServer4r provides an easy way to access the JasperServer Web Services API in Ruby. Currently the following JasperServer Web Services are supported: * Report Scheduling
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

JasperServer4r Library¶ ↑

jasperserver4r is a ruby library for utilising the JasperServer web services API. jasperserver4r allows you to use all the methods defined by the report scheduling service. This library was developed and tested against JasperServer v3.5.0 so it may not work with earlier versions. Support for the repository service is under development. Documentation and comments are a work in progress.

Useful Web Resources¶ ↑

Installation¶ ↑

Install from rubyforge:

$ gem install jasperserver4r

The following gem libraries are required:

  • soap4r v1.5.8

  • httpclient v2.1.2 or greater

Using the client library¶ ↑

Basic example¶ ↑

It’s pretty easy to use. See docs.rubygems.org/read/chapter/3#page70 for how to set the rubygem environment. Then:

require 'jasperserver4r'
client = JasperServer::API.new( username, password )
schedule_service = client.get_report_scheduler_service( endpoint url )
scheduled_jobs = schedule_service.getAllJobs

creates a driver for the JasperServer web services API and retrieves a list of all schedules jobs currently defined in the JasperServer repository. Username and password are valid JasperServer portal credentials. The

get_report_scheduler_service endpoint url defaults to localhost:8080/jasperserver/services/ReportScheduler

Will be adding more examples asap. Check out the tests for sample usage of each available operation. The web services guide mentioned above is a good resource for detailed descriptions of available operations.

Logging¶ ↑

It is often useful to see a trace of the raw SOAP XML being sent and received. The quickest way of achieving this when debugging your application is by setting the JASPERSERVER4R_DEBUG environment variable to TRUE; e.g. in the bash shell:

$ export JASPERSERVER4R_DEBUG=TRUE

or from your Ruby code:

ENV['JASPERSERVER4R_DEBUG'] = 'TRUE'

This will output the SOAP XML to stderr, which will usually show up in your terminal window.

There’s also the option of logging requests and XML to files. In order to enable this, you should use the write_to_file method of the loggers inside your JasperServer::API object:

client = JasperServer::API.new
client.xml_logger.log_to_file

This logs the full SOAP XML being sent and received over the wire. These will be written to the current directory by default, but you can specify a path as an optional parameter to log_to_file:

client.xml_logger.log_to_file('/var/log/my_app')

The file will be named soap_xml.

Docs for Developers¶ ↑

$ rake rerdoc

to regenerate the project documentation if needed

$ rake build

to package the gem and create a release

$ rake test

to run unit tests on the library

$ rake -T

for a list of available tasks

Copyright/License Info¶ ↑

Copyright © 2009 all4miller. See MIT-LICENSE for details.