Jump to content
Changes to the Jaspersoft community edition download ×

effrenchtibco.com

Members
  • Posts

    6
  • Joined

  • Last visited

effrenchtibco.com's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. In Jaspersoft with several different authentication solutions the key values are encrypted to ensure they are not readable. However any user values that are considered attributes will not be encoded by default and can be read by end users if they view the outgoing requsts. SolutionUsing the suffix "_ENC" on any attribute names tells the JRS that these value are encoded and need to be decoded before storing the value against the user. This suffix can be used against every attribute you with to encode. The example below show how to do this: <map> <entry key="username" value="u" /> <entry key="roles" value="r" /> <entry key="orgId" value="o" /> <entry key="expireTime" value="exp" /> <entry key="profile.attribs" > <map> <entry key="profileAttrib1_ENC" value="pa1" /> <entry key="profileAttrib2_ENC" value="pa2" /> </map> </entry> </map> This example is to encode the two attributes named "profileAttrib1" & "profileAttrib2" respectivly. Please note that the suffixes "_ENC" need to be uppercase. If they are lowercase JRS will think the values are the name and will not decode them.
  2. IntroductionIf there is a senario on which you want to give a user a curated list of items that they can chose from there is a number of ways to do this. This can be useful if you dont want to give access to the full system but want to give an end user a few different options. Or if you are giving a generic group of people access to specific parts of the TIBCO JaperReports® Server UI and want to limit what they can see on screen. [Put in image here] Hiding the navigation bar using CSS stylingsThe easiest way to remove elements from the UI is to change the CSS styling so that the element is not shown on screen. You can achieve this by creating a custom theme and adding the line: Passing a CSS theme in the URL you are requesting. Pros: Easiest to implement. Easy to revert. Cons: User will still have access to details within the HTML of the page if they go exploring. Have to make sure your application passes the correct theme. How to: Create 2 themes. 1 to hid the elements. And one standard one which the users will normally use. Then read this article on passing the theme in the URL:https://community.jaspersoft.com/wiki/set-theme-url (hint, the only two changes you need to make is to the div id "folder" to have display = none and "results" for "left = 0px".) Have the list in your own application URL and get a list of items from a rest callIf you dont want to use the TIBCO JaperReports® Server UI for this you can use the standard rest libary to get a selection of reports availailabe in different ways. There is a number of ways to configure your search using the TIBCO JaperReports® Server Rest Services so that you dont have to keep all the items in a single folder. For details on the Rest Services API please read here. The main benifit for this approach is the flexibility it gives you in searching through for what you are looking for. You can search for keywords or in more than one folder. However you will need to display the results set in your own application. Send a request to the library insteadIf you can create a generic user that only has access to the list of elements that you want to show and there is no other situations for that user to exist you can send the user to the libary instead of the repositry. This will show the user ALL the reports they have access too. The main drawback is that there is no way to hide any elements that the user may not need to be worried about. Because of this there can be a lot of adminitstration as opposed to the other apporaches that all the elements can be just stored in one folder. Hiding other elements on the TIBCO JaperReports® Server UISeveral other elements can be hidding on the UI using some other approaches. This ensures the user will not navigate aways from the page they are currently on unnecessarily. There is a few elements that need to be removed. This article covers all the steps involved in removing UI elements for specific users.
  3. To save time overall with configuring input controls for standard fields across multiple reports, you can make the same input control availabe across multiple reports to save time and effort. Using the below approach also means any future change to the input control will update all reports using this control. Input controls can be created at two different points on TIBCO JaperReports® Server. When configuring a report on the server there is the option to add an input control on the "Edit" screen. Just click this button on the "Controls & Resources" tab to quickly open the input control menu. This approach is used when you are currently working with a report and do not wish for this input control to be avaiable for other reports to use. It will open this window: If you chose the "Define an Input Control in the next step" it will only be avaiable for the report you were editing. Input controls across multiple reportsTo make input controls avaialbe across multiple reports. You need to open the repository and locate a folder you wish to store the input control in. Then right click the folder > Add Resrouce > Input control You will be brought thought the regular input control creation screens. More details can be found here on these. Once these input control is created it will be stored within the folder. From there when you go back to the "Controls & Resources" and select the "Add input control from repository" option and then it will be added to the report assuming the parameter name is similar (as with all input controls). Other links Configuring Input controls
  4. To Create a domain using rest v2 there is 4 steps that need to be used. Login with valid user who can create domainsConfigure the Schema file to outline how the domain how the files should look like. Configure the meta data file to display how the domain should be viewed on the server. (Name, authorisation ect.)Upload the files via a rest call. There is an example JSON file which can be uploaded to postman which creates a project going through all the steps outlined below at the bottom of this article. Login with valid userThe standard Rest call to login can be found here: Rest v2 login service The only thing to understand is the user you use needs to have permissions to execute the following commands: View and edit the folder that you want to upload the domain intoView the data source you want to build the domain onPostman example: Schema fileThe schema file is the structure of your domain. Critical information about the data source needs to be kept in here. Overall however none of the information kept within is used on the server to display the info. Details kept within: Joins between tablesFields being selected from the DatabaseFields names as they are displayed on Jaspersoft Reports ServerCalculated fieldsSummary calculations on fieldsThe file can be created in XML or json. The underlying structure of a file must mimic an XML or a json file or you will get errors. Depending on the format of the file you wish to use within your call to the server you need to put the header the parameter "Content-Type": XMLjsonapplication/repository.domain+XMLapplication/repository.domain+json**In the example screenshots we are using XML files. For using JSON it is the same approach but you need to change the XML references to JSON. Postman example: Meta Data fileOnce you have established your schema you need to upload the associated info for the server to create the domain. This info is the following: ParameterParameter purposeExampleversionThe current version of the domain. Used for version control."version": 1permissionMaskPermission setting for the domain See examples here: File Permissions"permissionMask": 1creationDateDate and time the domain was created in the first place"creationDate": "2020-01-01T00:00:01",updateDateDate and Time the domain was last updated"updateDate": "2020-01-01T00:00:01",labelThe name of the domain on the Server"label": "Rest_Create_Domain",descriptionThe desciption of the domain on the server"description": "Our created domain",dataSourceThe datasource on the system for the domain to use The example picks the datasource from the system "dataSource": { "dataSourceReference": { "uri": "/public/Samples/Data_Sources/FoodmartDataSource" } }schemaFileReferenceThe schema file you wish to use with this domain. This can be a location of the first file if it is on the server as the example to the right shows. "schemaFileReference": { "uri": '/public/schema.xml' }Once you have configured these parameters within a file you can upload it. You will need to upload it with the schema and the parameter "Content-Type:application/repository.semanticLayerDataSource+xml" domain will be created. Postman example: Example rest calls and files to upload to the serverOnce the above has been configured now you need to send the info onto the Jaspersoft Reports Server The rest calls you can use can look something like this: http://<your server URL>/jasperserver-pro/rest_v2/login?j_username=superuser&j_password=superuser*This logs in the user and keeps the cookie active for the next few callshttp://<your server URL>/jasperserver-pro/rest_v2/resources/public?Accept=application/xml*This uploads the schema file to the "/public" folder so the next step can call it from the serverhttp://localhost:8080/jasperserver-pro/rest_v2/resources/public?Accept=application/xml*This uploads the meta data file you have created[/code]In all the above examples it assumes that you want to upload the files to the "/public" folder on JRS. To change the location of the file you will need to uplate the URL to point to a different location if required. The sample files can be found below.
  5. This page explains how to pass and use data in TIBCO Jaspersoft® Studio CVC JavaScript files. This is outlined here: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v71/custom-visualization-component-0 By data, we mean anything in a report such Fields, Parameters, Variables, ect.. This article uses samples from the Custom Visualization Component article: https://community.jaspersoft.com/wiki/custom-visualization-component-v60x-how-run-samples Please refer to that article to understand how to run CVC components in general. Define data to pass into JavaScriptIn Studio, select the CVC properties > Data tab, then click the add button in the bottom right panel to define the data items you want to pass into your JavaScript. On the next screen click on "Add" again and fill in the below values. The "Property Name" will be what you will call in your JavaScript to get the values. "Property Value" will be the value you are passing from the report. Make sure to click the "Use Expression" checkbox. You can keep adding values until you have passed everything. The result should look like this: Using data within the JavaScript codeWithin your program, start by making sure you have a "instanceData" parameter set in your function. return function (instanceData)[/code]Then create a variable to hold the instanceData you passed in. var series = instanceData.series[0][/code]To get the first row of data, use index value 0 within instanceData (it is a zero-based array). Following rows will of course use sequential index numbers (for example in a loop as shown in the following screenshots). var record = series[0];[/code]Then to access your data you can use "<variable_name>.<fieldname>". record.value;[/code]Overall the program looks like this: return function (instanceData) { var series0 = instanceData.series[0] for (var index = 0; index < series0.length; ++index) { var record = series[index]; var holder = new string; if ( "value1" == record.subcategory ) { holder = record.value; } //Insert your code here }}[/code]Then customise the code as required based on your needs. Sample CVC filesBelow is some examples of CVC files that you can use to test parameter usage. https://community.jaspersoft.com/sites/default/files/wiki_attachments/cvc_samples_20150127.tgz
×
×
  • Create New...