Using PDI transformation in Pentaho BI server as data source for report parameters - reporting

Any advice on how to use PDI transformation as data source for report parameters in BI server's console?
I've uploaded the prpt reports to BI server but the I get a message "Error parsing parameter information". The .prpt and .ktr files are both in the same directory.

Actually, just realized that the issue could be solved by adding Transformation (KTR) as a resource. In this case, one can use the File-Resources menu selection. In the dialog select the transformation you wish to import and pick text/xml format. Give the resource a name and save it. You must save your PRPT file again (File-Save).
The caveat here is that transformation should be in the same folder as PRPT file. Then in the data sources, don't select transformation via folder path, but use the name of the resource that was assigned during the previous step (there is no drop down menu for looking thorough the files). You have to know exact name of the resource in order to do so.

Check the logs carefully. I suspect it's not finding the KTR. When you select the KTR in the prpt it usually (annoyingly) saves the whole path, so it's probably the full path to the ktr as defined on your dev box.
This does work, so do persevere!

Related

check if file exist on Sharepoint Online by File Name with Power Automate

I am trying to create a flow in Power Automate Cloud that allows me to extract some files from Google Drive and copy them to a Sharepoint folder. But before copying it, it has to check by the file name, that the file does not already exist in the sharepoint folder. I have managed to do the whole flow, except the checking.
I would be very grateful for your help.
Thank you very much. Best regards.
A File exists action doesn't currently exist but you can use the Get file metadata using path action from the SharePoint connector to do the same sort of thing.
This flow below shows you an example of what you can do ...
For demonstration purposes, I've created an array with a list of file names (full path required) that I will then test the existence for.
One of those files doesn't exist.
I then loop through each one of those and try and get the metadata for each file.
If the resulting statusCode from the call to get the metadata is not equal to 200, then we know the file doesn't exist.
Examples ...
To make this work however, you need to make sure that the Condition step will execute after the metadata call no matter what the result.
Do this by making sure the Configure run after settings are correct ...
So after all of that, all you need to do is deal with the true and false sections of the condition.

Where to save application data in windows?

I am trying to make a windows application. In this application, some files get modified as a user add or delete an entry. I saved these files on the application folder itself.
But After making binary file I installed it, As I try to add a entry it get crashed.
So, I figured out the issue. The windows doesn't allow to modified files inside C:\Program Files.
So, I installed it in other drive and it works. It solved my issue temporarily but I want to know how other application works in windows.
Where do those applications save their data?
I am not talking about some data which get saved in "Documents" but something which is essential need to modified every time user makes change like theme, formates.
No user access is allowed to the "program folder", and that's for good: it is a system folder, and it should only be accessed for system related operations (like installing or uninstalling a program).
There are many places where "program data" can be stored depending on the situation, and QStandardPaths provides access to their paths, according to the category location. What you might be interested in are:
ConfigLocation: Returns a directory location where user-specific configuration files should be written. This may be either a generic value or application-specific, and the returned path is never empty.
AppDataLocation: Returns a directory location where persistent application data can be stored. This is an application-specific directory.
AppLocalDataLocation: As the previous one, but Windows specific.
AppConfigLocation: Returns a directory location where user-specific configuration files should be written. This is an application-specific directory, and the returned path is never empty.
Those paths (along with the others listed in the documentation) can be accessed using the following static methods:
standardLocations(locationType): returns a list of paths for the requested location type, in order of priority (the first is usually the preferred one);
writableLocation(locationType): returns the preferred path for which write access is allowed (usually the first of the standardLocations());
If you need to store the user configuration, you can use QStandardPaths.writableLocation(AppConfigLocation), while if you have some user-specific internal data that is used by the application (email database, document templates, etc) QStandardPaths.writableLocation(AppLocalDataLocation) should be a good choice.
In both cases, those paths may not exist, so you need to ensure that and eventually create them, possibly by using QDir(path):
dataPath = QtCore.QStandardPaths.writableLocation(AppLocalDataLocation)
dataPathDir = QtCore.QDir(dataPath)
if not dataPathDir.exists():
# create the directory (including parent directories if they don't exist);
# that the argument of mkpath is relative to the QDir's object path, so
# using '.' means that it will create the actual dataPath
dataPathDir.mkpath('.')
Note that for all of the above (especially the last 3) it's required that you correctly set both the organizationName and the applicationName.

Can I use ms flow "peek code"/json to setup new flows?

We use Sharepoint for our project files and that means there are often several layers of work to be done (project work, finances, administrative, etc) with different teams and working in different locations. There are some folders that I would like to keep "in sync" by copying files back and forth on change. I made some flows to do so, but it is pretty tedious as there are 6 sub directories for each project and a bunch of projects.
I noticed the peek code is pretty simple, it is just the name part of the directory that needs to change. Is there any way to manually define a flow or some way I can use the json/peek code to setup a flow?
For reference, I am using the sharepoint "when a file is created or modified (properties only)" and copy file flow. My directory structure looks like the following.
Thanks!
Projects Team:
ProjectNumber ProjectName
projNumber Administrative
projNumber invoices
projNumber Received
projNumber Sent
projNumber Requested
Accounting Team:
Invoices
projNumber projName
projNumber Received
projNumber Sent
projNumber Requested
It is possible, but still, it is not recommended. Because if you end up with some different hierarchy it may cause a severe impact. Anyway, let me put it in steps:-
Export your existing Flow.
Open the exported .zip file, it should have a file called definition.json.
Search for the exact hierarchy you are looking for and replace the hierarchy with what you have.
Compress it to .zip file.
Now go to https://us.flow.microsoft.com/
In the My Flows tab, click on import. import the compressed .zip file in step 4.
You are done. It should be working, if not -> Make sure you have followed JSON syntax throughout the file.

Exporting Sonarqube reports into Excel - based on major, minor and critical categories

Is there a way to export Sonarqube reports into Excel - based on major, minor and critical categories?
You can use the REST API, to query the data into JSON text and then export that JSON to a CSV file.
I used the command below to get a JSON response:
http://xxxxx.xx.xxxx.com:9000/api/issues/search?componentRoots=test_xxx_xx&statuses=OPEN,REOPENED&pageSize=500&pageIndex=1
Where componentRoots is the your sonar project name.
It gave all the issues in JSON and then I converted it in to a CSV.
The only way is to use the api/issues/search web service
Yes you can use the REST APIs provided with SonarQube to query. The documentation of APIs is also embedded into every Sonar instance as different versions expose different APIs.
We use Python for similar work as response will be in JSON and it will be easier to manipulate. Once you have arrived extracted issues of your liking, write them into .CSV or excel.
Link to web services will be in footer of Sonar Instance.
PS: Expanded answer to offset short-sighted answering. What is provided here is only abstract and not complete answer with query details.
Not recommended by community
With DB:- If you have been using Sonar for long and if you won't upgrade SQ too often you can choose to study table structure and understand how data is organised. We have done this too, but it gets messier with every passing upgrade (more inner queries). Cost of querying will be saved on bulk process of data as ES is not involved
Please try the following command to get all issues in JSON format. Then you may consider to parse output by using jason parser programs.
Replace "XXX:XXX" with Sonar Key defined in "sonar.projectKey" variable on "sonar-project.properties.txt" file
http://localhost:9000/api/issues/search?componentKeys=XXX:XXX
I used F12 developer tools to create the report. Here is step by step solution:
Before opening Sonar report, press F12 to open developer tools in the browser tab (Refer screenshot). Click on Network tab. Initially it'll be empty:
Open Sonar report in the same browser tab.
Now you have to select a request in URL column (Refer screenshot in point # 4). You've to select that request whose URL is of the format - https://sonar:8443/api/issues/search?. Base URL might be different depending upon the name of the server where you have hosted Sonar website.
Click on Response tab (Refer screenshot):
Copy the entire JSON data to clipboard. First press Ctrl + A and then Ctrl + C to copy the contents.
JSON data that you got is in below format:
Data of all the issues is present inside issues key. It is of array type as it contains a list of issues. Paste the entire JSON data into any notepad editor and get the value of issues node. A sample issues node data is shown below:
[
{
"key":"AYMBNpviy48WWZHdsU1Z"
,"rule":"OWASP:UsingComponentWithKnownVulnerability"
,"severity":"MAJOR"
,"component":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"project":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"flows":[]
,"status":"OPEN"
,"message":"Filename: jquery-ui-1.10.3.custom.js | Reference: CVE-2021-41184 | CVSS Score: 6.1 | Category: CWE-79 | jQuery-UI is the official jQuery user interface library. Prior to version 1.13.0, accepting the value of the `of` option of the `.position()` util from untrusted sources may execute untrusted code. The issue is fixed in jQuery UI 1.13.0. Any string value passed to the `of` option is now treated as a CSS selector. A workaround is to not accept the value of the `of` option from untrusted sources."
,"author":""
,"tags":["cve","cwe","cwe-937","owasp-a9","vulnerability"]
,"transitions":["confirm"]
,"actions":["set_tags","comment","assign"]
,"comments":[]
,"creationDate":"2022-08-18T06:35:49+0100"
,"updateDate":"2022-08-18T06:35:49+0100"
,"type":"VULNERABILITY"
,"branch":"sonarqubepr"
,"scope":"MAIN"
,"quickFixAvailable":false
},
{
"key":"AYMBNpviy48WWZHdsU1_"
,"rule":"OWASP:UsingComponentWithKnownVulnerability"
,"severity":"MAJOR"
,"component":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"project":"B91661CE-50F8-45CB-8F54-29CD044EF32D"
,"flows":[]
,"status":"OPEN"
,"message":"Filename: jquery.ui.datepicker-ml.min.js | Reference: CVE-2021-41183 | CVSS Score: 6.1 | Category: CWE-79 | jQuery-UI is the official jQuery user interface library. Prior to version 1.13.0, accepting the value of various `*Text` options of the Datepicker widget from untrusted sources may execute untrusted code. The issue is fixed in jQuery UI 1.13.0. The values passed to various `*Text` options are now always treated as pure text, not HTML. A workaround is to not accept the value of the `*Text` options from untrusted sources."
,"author":""
,"tags":["cve","cwe","cwe-937","owasp-a9","vulnerability"]
,"transitions":["confirm"]
,"actions":["set_tags","comment","assign"]
,"comments":[]
,"creationDate":"2022-08-18T06:35:49+0100"
,"updateDate":"2022-08-18T06:35:49+0100"
,"type":"VULNERABILITY"
,"branch":"sonarqubepr"
,"scope":"MAIN"
,"quickFixAvailable":false
}
]
The JSON array data obtained in previous step is of real use. Convert this JSON array data into an EXCEL file using any online converter. I used the following website - https://www.convertcsv.com/json-to-csv.htm
What if my report has more than one page?
Sonar loads 100 records per page. To get the next page you've to click on Show More button at the bottom:
Every time you click on the Show More button, a new request goes to the Sonar server which will show up in the F12 developer tool's Network tab. So for all subsequent pages, repeat same set of steps to create a new Excel sheet per page. Then merge all the Excel sheets manually to create single master report.
Note: While merging the Excel files, remember that every Excel file will have a header row at the top. While merging the files, you'll have to keep the header row from from the first Excel sheet and ignore from the rest.

Change the connection string in app.config with InstallShield 2011 setup

I'm creating an InstallShield 2011 basic MSI installer project.
I'm trying to change the connection string in my app.config according to the user selections from the database login dialog made in the setup. How can I apply these connection string settings to the connection string entry in the app.config of my windows application I'm trying to install?
XML File Change is the right place to start from. Since changing the connection string is a common task my hope was that there is a best practice to do exactly this task.
-- edit --
There are two main difficulties:
How do I reference a file in InstallShield which will be created on build? The App.config gets copied to MyAppName.config. I don't want to hardwire the application name into the setup at this place again.
The connection string in the config file is used by Entity framework, thus contains more information than given by the database selection from InstallShield. I have to patch an attribute within an element of the config file, if I just want to change the Server and InitialCatalog properties of the connection string. It looks like XML File Change only supports replacing of an entire element or attribute.
As far as I remember, the XML File Changes is designed for this purpose. You can place the user's choice as a property value when defining your XPath and element/attribute values. For me, it was one of the areas of InstallShield which worked quite good and as described.

Resources