Embedding Jaspersoft into your PHP
Application


Mariano Luna
Senior Sales Engineer, Jaspersoft
January 22, 2013
Session Overview

 REST API

 iFrame vs. REST API integration

 Overview of Single Sign On / User Management

 Working with Jasper Server Themes

 New PHP Wrapper in version 5.0



©2010 Jaspersoft Corporation. Proprietary and Confidential   2
Jaspersoft Detailed Architecture
              Web Standard Customizable Front-End with Service APIs
                     Jaspersoft UI Framework
                         Presentation (.css)
                                                                                       Web Service                                Extensions
                              Events (.js)                                        Integration Interfaces                           JSR-168 portlets

                           Structure (.jsp)


     Web Services REST and SOAP                          Java API                              HTTP API                        XML/A (OLAP)


                                                Business Logic: Service APIs
       Reporting         Ad Hoc           Report             OLAP                                   Object           User
                                                                            Repository
        Engine          Reporting       Scheduling           Engine                               Permission       Authority




     JasperReports      JasperReports                                              Hibernate                       Spring
                                             Scheduler        OLAP Engine
        Library            Server                                                    ORM                          Security


                      Back-End Implementations can be Configured and/or Replaced
    connect any data source                                                                                                    SSO
               JDBC

                                                                                         LDAP, JAAS, MS Active Directory,
                                                                                              IBM Tivoli, SiteMinder, CAS



XML, XML/A    RDBMS     TXT & CSV
REST API




©2010 Jaspersoft Corporation. Proprietary and Confidential   4
Deployment Scenario

                                                                                                     Jasper Reports Server
                                                                                              Apache Tomcat Application Server
                                                             PHP Application
                  Clients                                    Apache Webserver

                                                                                 REST API
                                                                                or HTTP API




                                                                                   RDBMS
                                                                                   Big Data
                                                                                   NoSQL




©2010 Jaspersoft Corporation. Proprietary and Confidential                                                                 5
How we use it

 Invoking the client




 Working with the Repository




©2010 Jaspersoft Corporation. Proprietary and Confidential   6
How we use it

 Retrieving an HTML Report



 Working with Input Controls




©2010 Jaspersoft Corporation. Proprietary and Confidential   7
iFrame vs. REST API integration

      Web Services                                           HTTP APIs
      REST API                                               IFRAME Embed functionality -
                                                                 like embedding Google Maps,
      Full programmatic control
                                                                 Video etc.
      Perfect for production or
       “canned” reports
                                                                Leverage Jasper Interactivity
                                                                 and UI




©2010 Jaspersoft Corporation. Proprietary and Confidential                                       8
Authentication: Spring Security

 A variety of authentication providers come with Spring
       Security, or are easily integrated:
               LDAP/Active Directory
               JAAS
               CA SiteMinder
               CAS (Central Authentication System)
               Tomcat realm
               Static
               Custom database lookup
               X509
               More
               Custom




©2010 Jaspersoft Corporation. Proprietary and Confidential   9
Single Sign-on Integration




                                                                Redirect to SSO login        SSO Authentication
                                                                                                Entry Point
     SSO
                                                             Redirect back after login
    Server                                                                               SSO Authentication Provider




©2012 Jaspersoft Corporation. Proprietary and Confidential                                                             10
Single Sign-on Integration




                                                                Redirect to SSO login        SSO Authentication
                                                                                                Entry Point
     SSO
                                                             Redirect back after login
    Server                                                                               SSO Authentication Provider



                                                             Validate ticket
                                                                                             SSO Ticket Validator




©2012 Jaspersoft Corporation. Proprietary and Confidential                                                             11
Single Sign-on Integration



                                                   JRS User DB


                                                                    Redirect to SSO login            SSO Authentication
                                                                                                        Entry Point
     SSO
                                                                 Redirect back after login
    Server                                                                                       SSO Authentication Provider



                                                                 Validate ticket
                                                                                                     SSO Ticket Validator




                                                                                                      Post Authentication
                                                                                                         Processors



                                                             Store User Information
                                                                                             Load Additional External User Details




©2012 Jaspersoft Corporation. Proprietary and Confidential                                                                           12
Presentation Layer:
Cascading Style Sheets and Themes




©2010 Jaspersoft Corporation. Proprietary and Confidential   13
Themes and UI Customization




©2010 Jaspersoft Corporation. Proprietary and Confidential   14
Additional Resources


 PHP Implementation Sample
       https://github.com/marianol/JasperServer-for-PHP

 JasperReports Server Documentation
       http://community.jaspersoft.com/documentation/
           Chapter 10 of the JasperReports Server Ultimate Guide
           Jaspersoft Web Services Guide (REST API Documentation).


 JasperReports Server Authentication
           Chapter 7 of the JasperReports Server Ultimate Guide
           Jaspersoft External Authentication Cookbook.




©2010 Jaspersoft Corporation. Proprietary and Confidential            15
Thank You

Embedding Jaspersoft into your PHP application

  • 1.
    Embedding Jaspersoft intoyour PHP Application Mariano Luna Senior Sales Engineer, Jaspersoft January 22, 2013
  • 2.
    Session Overview  RESTAPI  iFrame vs. REST API integration  Overview of Single Sign On / User Management  Working with Jasper Server Themes  New PHP Wrapper in version 5.0 ©2010 Jaspersoft Corporation. Proprietary and Confidential 2
  • 3.
    Jaspersoft Detailed Architecture Web Standard Customizable Front-End with Service APIs Jaspersoft UI Framework Presentation (.css) Web Service Extensions Events (.js) Integration Interfaces JSR-168 portlets Structure (.jsp) Web Services REST and SOAP Java API HTTP API XML/A (OLAP) Business Logic: Service APIs Reporting Ad Hoc Report OLAP Object User Repository Engine Reporting Scheduling Engine Permission Authority JasperReports JasperReports Hibernate Spring Scheduler OLAP Engine Library Server ORM Security Back-End Implementations can be Configured and/or Replaced connect any data source SSO JDBC LDAP, JAAS, MS Active Directory, IBM Tivoli, SiteMinder, CAS XML, XML/A RDBMS TXT & CSV
  • 4.
    REST API ©2010 JaspersoftCorporation. Proprietary and Confidential 4
  • 5.
    Deployment Scenario Jasper Reports Server Apache Tomcat Application Server PHP Application Clients Apache Webserver REST API or HTTP API RDBMS Big Data NoSQL ©2010 Jaspersoft Corporation. Proprietary and Confidential 5
  • 6.
    How we useit  Invoking the client  Working with the Repository ©2010 Jaspersoft Corporation. Proprietary and Confidential 6
  • 7.
    How we useit  Retrieving an HTML Report  Working with Input Controls ©2010 Jaspersoft Corporation. Proprietary and Confidential 7
  • 8.
    iFrame vs. RESTAPI integration  Web Services  HTTP APIs  REST API  IFRAME Embed functionality - like embedding Google Maps,  Full programmatic control Video etc.  Perfect for production or “canned” reports  Leverage Jasper Interactivity and UI ©2010 Jaspersoft Corporation. Proprietary and Confidential 8
  • 9.
    Authentication: Spring Security A variety of authentication providers come with Spring Security, or are easily integrated:  LDAP/Active Directory  JAAS  CA SiteMinder  CAS (Central Authentication System)  Tomcat realm  Static  Custom database lookup  X509  More  Custom ©2010 Jaspersoft Corporation. Proprietary and Confidential 9
  • 10.
    Single Sign-on Integration Redirect to SSO login SSO Authentication Entry Point SSO Redirect back after login Server SSO Authentication Provider ©2012 Jaspersoft Corporation. Proprietary and Confidential 10
  • 11.
    Single Sign-on Integration Redirect to SSO login SSO Authentication Entry Point SSO Redirect back after login Server SSO Authentication Provider Validate ticket SSO Ticket Validator ©2012 Jaspersoft Corporation. Proprietary and Confidential 11
  • 12.
    Single Sign-on Integration JRS User DB Redirect to SSO login SSO Authentication Entry Point SSO Redirect back after login Server SSO Authentication Provider Validate ticket SSO Ticket Validator Post Authentication Processors Store User Information Load Additional External User Details ©2012 Jaspersoft Corporation. Proprietary and Confidential 12
  • 13.
    Presentation Layer: Cascading StyleSheets and Themes ©2010 Jaspersoft Corporation. Proprietary and Confidential 13
  • 14.
    Themes and UICustomization ©2010 Jaspersoft Corporation. Proprietary and Confidential 14
  • 15.
    Additional Resources  PHPImplementation Sample https://github.com/marianol/JasperServer-for-PHP  JasperReports Server Documentation http://community.jaspersoft.com/documentation/  Chapter 10 of the JasperReports Server Ultimate Guide  Jaspersoft Web Services Guide (REST API Documentation).  JasperReports Server Authentication  Chapter 7 of the JasperReports Server Ultimate Guide  Jaspersoft External Authentication Cookbook. ©2010 Jaspersoft Corporation. Proprietary and Confidential 15
  • 16.