Need pointers on how report generation can happen in CQ5 - aem

We have created a set of forms in CQ5 and we have a requirement that the content of these forms should be stored at a specific node, our forms interact with third party services and get some data from there as well, this is also stored on the same nodes.
Now, we have to give authors the permission to go and download these reports based on ACLs. I also will have to provide them start and end date and upon selecting these dates the content placed in these nodes should be exportable in CSV format.
Can anybody guide me in how to achieve this functionality. I have gone through report generation but need better clarity on how this can be achieved like how will i be able to use QueryBuilder api/ how can i export and how do i provide the dates on the UI.

This was achieved as described.
I actually had to override the default report generation mechanism and i created my own custom report using report generation tutorial in cq documentation.
Once the report templates and components were written, i also override cq report page component and provided input dates in body.jsp using date component of granite.
once users selected dates, with the help of querybuilder api i used to search for nodes at path(specified by author, can be different for different form data) and i also created an artificial resource type at nodes where i was storing the data, this lead me to exact nodes where data was stored and this property was also passed to querybuilder. The json returned as response from querybuilder was then supplied to a JS which converted the data to csv format.

Related

AzureDevops - extract test steps to powerbi with odata query

I need to extract a table with test steps that correspond to each test case, from AzureDevops to PowerBI.
I was able to retrieve a list of tables that I can extract with odata, but none of them contains test steps. I’m attaching the metadata request and an extract of its results. extract
I’ve read that another possibility would be you to use an api query, but I’m not sure which one.
Does anyone know a possible solution?
Thank you.
According to the note in this documentation,
You can’t add fields with a data type of Plain Text (long text) or HTML (rich-text). These fields aren’t available from Analytics for the purposes of reporting.
And the type of the Steps field is Text (multiple lines), so they cannot be extract with odata.
You can try to use this REST API to get the detail of the testcase which will contain the Steps detail. Please refer the screenshot:

How to query domain in jaspersoft with Dynamic Parameters

I am new to jaspersoft reporting. I am currently designing and developing reports by considering following requirements.
I want to create template based reports where all dynamic parameters I need to pass in SQL query.
I was going through japsersoft reporting I found that we can create join views and cache data by creating domains. So that it reduces hits at db level.
While creating report I found that I cant execute SQL script on Domain objects.
Please advice whether I am on right track or not.
Basically I want to query on cached data such as domain view instead of hitting DB directly.
Please suggest if any workaround is available for this problem.
Please note, although JasperReports Server manages a cache for Ad Hoc Views and Ad Hoc Reports running on Domains, running a JRXML report (e.g. designed in Jaspersoft Studio) on a Domain does not guarantee hitting that cache.
You also have the option of using a layer that provides caching between JasperReports Server and your database. For example, support has been recently added for TIBCO Data Virtualization (not a free product) in v.7, see https://www.jaspersoft.com/introducing-jaspersoft-7.
In any case, Domains are not relational databases and therefore do not support straight SQL.
You can use the "Domain query language" though, which offers a subset of the features of SQL. The easiest way to write a query is using Jaspersoft Studio and selecting "domain" in the Language dropdown (top-left corner of the Dataset and Query Dialog, indicated by the red arrow in the screenshot below from Studio 6.4.0):
For example the design above (which uses the Supermart Domain, provided with the sample data) will generate this query and the required "dynamic" parameter as you requested – in this case a Collection as the filter is 'Is One Of' which can take multiple values:
<query>
<queryFields>
<queryField id="sales_fact_ALL.sales__product.sales__product__product_name"/>
<queryField id="sales_fact_ALL.sales_fact_ALL__store_sales_2013"/>
</queryFields>
<queryFilterString>sales_fact_ALL.sales__store.sales__store__region.sales__store__region__sales_country in sales__store__region__sales_country_0</queryFilterString>
</query>
See here for another example of a query (current version of docs based on 7.1.0 release), in this case for use with the REST API: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v710/queryexecutor-service
The queryFilterString tag follows the DomEL syntax as documented here (also for 7.1.0): https://community.jaspersoft.com/documentation/tibco-jasperreports-server-user-guide/v71/domel-syntax

XPages Dojo Data Grid and Custom REST Service

Can a custom REST service be used as a data source for a dojo data grid? I am needing to combine data from three different databases into one data grid. The column data will need to be sort-able. The response from the REST service looks to be correct. I have having trouble with binding the JSON data to the dojo grid columns.
Very interesting -- I tested and saw the same thing with a custom REST service -- it doesn't work when referenced as the storeComponentId of the grid.
I got it to work with the following steps:
Include two dojo modules in the page resources to set up the data store
A pass-thru script tag with code to set up a JSON data store for the grid (uses the dojo modules that the resources specify)
The grid’s store property is set to the variable set up for the data source in the tag. (storeComponentId needs an XPages component name)
Here are some snippets that show the changes:
<xp:this.resources>
<xp:dojoModule name="dojo.store.JsonRest"></xp:dojoModule>
<xp:dojoModule name="dojo.data.ObjectStore"></xp:dojoModule>
</xp:this.resources>
...
<xe:restService id="restService1" pathInfo="gridData">
...
<script>
var jsonStore = new dojo.store.JsonRest(
{target:"CURRENT_PAGE_NAME_HERE.xsp/gridData"}
);
var dataStore = dojo.data.ObjectStore({objectStore: jsonStore});
</script>
...
<xe:djxDataGrid id="djxDataGrid1" store="dataStore">
There's more information and a full sample here:
http://xcellerant.net/dojo-data-grid-33-reading-custom-rest-service/
The easiest way is to start with the extension library. There's a sample for a custom JSON-Rest service. While it pulls data from one source, it is easy to extend to pull data from more than one. I strongly suggest you watch out for all over performance.
What I would do:
create a bean that spits out the JSON to the grid
test it with one database
learn about threads in XPages and here
use one thread each for the databases, cuts down your load time
use a ConcurrentSkipListMap with a comparator so you have the initial JSON in the sort order most useful to the user (or the one from the preferences or the last run)
Memento bene: the Java Collections Framework is your friend (a sometimes difficult one).
Let us know how it goes!

Where does Tridion store Metadata values?

When we define custom metadata for the components, it is my understanding that this user-given metadata is stored in SQL server. And it is not visible in the component xml. Can anyone explain how exactly a metadata linked to a component will actually get stored?
A Component definition in Tridion has two types of fields: Content fields and Metadata fields. Both field types are stored in the Content Manager database (either SQL Server or Oracle). And both field types are retrieved whenever you read the Component back from Tridion through any of its APIs (TOM, TOM.NET or Core Service).
Only the Content fields are shown in the Source tab of a Component edit window, but the Metadata fields are visible on the Metadata tab of that same window.
If you want to have a single view of the XML of both Metadata and Content fields (as well as many other properties of you Component in Tridion), consider installing the PowerTools or the Item XML extension.
I think you may be confusing things a bit.
The Metadata is always stored as part of the component - under tcm:Metadata. When you publish this component, then the metadata fields will also be available for querying on the Content Delivery Data Store.
Whether these fields get displayed as part of the component presentation depends on your templates. There's nothing stopping you from including these values in the output of your template (typical use case for SEO, for instance).
In summary:
In the CM, the Metadata is stored together with the Component
In the CD, the Metadata is stored as part of the "CUSTOM_META"
associated with this component.
Just a note,
There is another metadata that is not stored as metadata fields, which is the system metadata, such as Last Modified Date or the user that last modified the component. That's metadata in the CMS. Also there is system metadata in the front-end (broker or file system metadata) that gets published when you publish a given component, such as Last Published Date.
You can leverage/use the system metadata in your templates as well.

Get URI of RSM Diagram Elements

I would like to be able to programmatically retrieve the same URI that is available through BIRT (getURI). I am developing an Rational Software Modeler plug-let and need to get the unique identifier for the diagram elements. This would enable the elements to be recognized in later database ETL processes.
I have found a URI available through EObject.eResource().getURI(), except it only returns half of what is returned in the BIRT reports. BIRT reports something like "platform:/resource/Common/S.efx#_c0KLYFImEd-iIqDctBy_JQ" while EObject.eResource().getURI() only returns "platform:/resource/Common/S.efx"
Any help would be appreciated.
You should be able to get the whole URI with ECoreUtil.getURI(EObject) function, it should also include the fragment part.
EObject.eResource().getURI() returns you the resource's URI where this object is located, so it will not include the Objects own unique ID there.
That fragment ending hash there is EObjects XMI-ID, that can be returned using ECoreUtil.getID(EObject) if needed. But that ECoreUtil.getURI(EObject) should be just ok.