Expand my Community achievements bar.

SOLVED

How to use Property Constraints during developing Reporting components

Avatar

Level 1

I'm working on creating a custom report report page on my CQ 5.6.1 instance. I've got my reportbase and columnbase components set up correctly, by following the steps listed here. I am able to, for instance, pick up all the pages that are available, by setting the property nodeTypes to cq:Page

I want to add a constraint to it, say for example pick up pages which have the title "test".  I created a node under querybuilder called propertyConstraints and added my constraints in the form of nodes below it, as described here. Property added to the node was jcr:title and the value was test.  However, this does not work for me at all. The output I get is "No rows to display"

What is the correct way to add constraints to the querybuildernode?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Your settings looks right to me. Not sure what you are missing. Make sure to take care of below

  • Hope you defined at baseroot and not at column. An example of audit report attached. [img]Report.png[/img]
  • Not sure how you are loading data because once report fetches it will serve from memory rather than reading disk every time.

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Your settings looks right to me. Not sure what you are missing. Make sure to take care of below

  • Hope you defined at baseroot and not at column. An example of audit report attached. [img]Report.png[/img]
  • Not sure how you are loading data because once report fetches it will serve from memory rather than reading disk every time.

Avatar

Level 1

thanks for your reply! it works now. I had defined my properties in propertyConstraints node incorrectly.


A final followup question :-

I need to fetch only certain pages that were created/modified "x" number of days from current system date. I was thinking of adding this check at the column component (have a column component which extracts jcr:created for each row, compare with system date and so forth.)  How can I get the system date? Should I use a pre-processor for this? I'm not able to find an OOTB example that does something like this, so I'm not sure how to proceed.

 

Avatar

Former Community Member

Hi Rohan

Could you solve the constraints?

I am trying a similar Query but I was not able to solve it.

I can add a preprocessing node with datedelta property.

But I don't know it how to apply a filter on it.

If you were able to solve this, can you share it?

 

Thanks

Avatar

Level 10

Rohan Bhaumik wrote...

thanks for your reply! it works now. I had defined my properties in propertyConstraints node incorrectly.


A final followup question :-

I need to fetch only certain pages that were created/modified "x" number of days from current system date. I was thinking of adding this check at the column component (have a column component which extracts jcr:created for each row, compare with system date and so forth.)  How can I get the system date? Should I use a pre-processor for this? I'm not able to find an OOTB example that does something like this, so I'm not sure how to proceed.

 

yes pre processor is right way. I am sure you have OOB example  auditreport with time column.