Jump to content
We've recently updated our Privacy Statement, available here ×

dgorbenk

Members
  • Posts

    3
  • Joined

  • Last visited

dgorbenk's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. In this article I'd like to describe the process of running TIBCO JasperReports® Server over HTTPS with the help of Tomcat server. Downloading Tomcat and JasperReports® ServerI believe you already have the JasperReports Server application, so the only step is to choose which Web server to run it on. For my case I'll be using Tomcat, and I think the process would slightly differs in small steps. So, let's download the Tomcat from official website: https://tomcat.apache.org/ I'll be using version 8.5.59. For this article I would name the folder where you'd place Tomcat is TOMCAT. So, once you download it, let's try to run it: $ cd TOMCAT/bin $ ./catalina.sh run depending in your computer in 5-10 seconds you may see a welcome message on a console, and you may try to open the page http://localhost:8080/ It's really so easy. Let be sure no one is using the same port 8080 on your machine, and you don't have firewall which blocks your requests. Deploying JasperReports ServerNow, let's deploy JasperReports Server into Tomcat server. One of the things we need to do before deploy is to have database server. I'd like to go with MySQL server, which is very simple. Don't worry, you don't need to configure one, you just need to put some parameters into the JasperReports Server configuration file. So, get to the JasperReports Server top folder, and run next command: $ cp -f buildomatic/sample_conf/mysql_master.properties buildomatic/default_master.properties Now, get to buildomatic/ folder and open file default_master.properties for editing. You may and should define some variables there, but the most important for our article are next ones: Now, save the file and run next command form the same buildomatic/ folder: ./js-ant install-normal-pro In 2-5 minutes the command would finish, and you may try to start your deployed JasperReports Server application. Get back to TOMCAT/bin directory and run again: $ ./catalina.sh run This time the startup would take much more time, and once it's finished try to open next page: http://localhost:8080/jasperserver-pro/login.html (the URL may be different depending on the variables you might changed in the default_master.properties file). I hope you see the page, now it's time to plug in the security ! Generating certificateIn case you have a certificate for your domain you may skip this section. If not, I'm going to use self-generated domain certificate, and self-generated root certificate to sign domain certificate. You can read on internet what is a root certificate, why it makes sense to create it, and so on. Shortly: you may install the root certificate into your browser and all domain certificated which you sign by this root cert would be valid for this browser. Generating root certificateTo make things simplier, I created a script which generates root certificate and asks for a password. It's attached to the page by name createRootCert.sh. Download it, examine its content to be sure everything is fine, and run it: Generating domain certificateLets say we want certificate for domain name "domain.com". Just for sample. You definitely want to change it to something more available, but lets keep this name in our article. Now, download the attached script createCertForDomain.sh and create a file domainDescription.txt with next content: Change the domain name in this file. Now, open the file createCertForDomain.sh, and change the domain name there as well. Now, run the script: You should get something like this: Installing certificates into TomcatTo do this create a folder TOMCAT/conf/cert folder, and copy there two files: certificate.crt and privateKey.key. Now, open file TOMCAT/conf/server.xml for editing and find a SSL section there. It should be disabled. You may want to insert a next section somewhere around: Save the file and run the Tomcat again. Now you should be able to open page https://localhost:8080/jasperserver-pro/ One note: your browser would alarm you that the certificate is unknown. It's true. But you may import root certificate into your browser and this problem would gone. Just don't pass to anyone key file for root certificate, or simply remove it immediately so no one can create a fake certificate for any existing domain and attack you. createrootcert.sh createcertfordomain.sh
  2. In this articale we are going to take a look of how we can embed some resources (AdHoc, Report, Dashboard) from JRS into your Vue.js based application with help of Visualize.js library. The zip file attached to this articale contains source code which I'm going to reffer to. So, download it, and unpack. Quick overviewTo launch this demo open file src/components/Visualize.vue and edit object jrsConfig: you need to specify credentials and URL to JRS instance. Then, run next commands: yarn installyarn serve[/code]or, if you prefer npm: npm installnpm serve[/code]More detailsIntegration of Visualize.JS library made through creating a vue.js component which accepts two properties: resourceType - one of the: adhoc, report, dashboard resourcePath - path to the resource inside JRSThen, components loads the Visualize.js library, initializes it with credentials and JRS path, and runs the specified resource type. The component uses hooks: created to start process of loading visualize.js librarymounted to start rendering the resource from JRSAlso, the component takes 100% of width and height of the container, so it's better to control the size of the rendered resource by its container. Sample usage:First of all, you need to import Visualize component: import Visualize from './components/Visualize.vue'[/code] then, you need to register this component in Vue.js subsystem. For this it's better to refer to Vue.js documents cause it depends ob where you want to use this component. In a simple case it can be something like this: export default { name: 'App', components: { Visualize } }[/code]then you may render it: <Visualize resourceType="adhoc" resourcePath="/public/Samples/Ad_Hoc_Views/09__Store_Segment_Performance"/>[/code]which would render the resource in-place. More complete example can be like this: <div class="containerClass"> <div class="title">Resource title</div> <Visualize resourceType="adhoc" resourcePath="/public/Samples/Ad_Hoc_Views/09__Store_Segment_Performance" /></div>[/code]How it worksLoading of Visualize.js libraryThe loading is done by appending script visualize.js into body DOM node. BWT, here is the list of some parameters to this script you may want to use: _opt - boolean, enables use of optimized source codeuserTimezone - timezone name, i.e. America/Los_AngelesuserLocale - locale name which is supported by JRS, some examples are: en, de, itso, in this case the full URL would be: client/visualize.js?_opt=false&userTimezone=America/Los_Angeles&userLocale=en open the file src/components/Visualize.vue, find the "client/visualize.js", and add any parameters there. Note: Visualize.js library injects itself into window object, like jQuery, and you can access it by window.visualize[/code] Creating a containerVisualize.js renders resources into containers, and it would be OK unless visualize.js currently accepts a container's reference as a selector. So, we need to tag the container of Visualize component with some id or name, or something. This is what we do in code: const containerName = 'container' + containerId; this.$el.setAttribute('name', containerName); containerId++;[/code]which later we pass to visualize.js library: container: `[name=${containerName}]`[/code]This is going to be changed and support of passing DOM nodes and jQuery elements will be provided soon. Passing custom options to visualize.js libraryVisualize.js library supports many options which you may find on this page: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-visualizejs-guide/v62/api-reference-visualizejs Also, here you can find some other tutorials about using Visualize.js: https://community.jaspersoft.com/wiki/visualizejs-tutorials
  3. Hi, Can you give more details about our case ? Is it vizualize.js or report viewer ? Because right now it's too wide question, need more details. Thanks
×
×
  • Create New...