Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Append Search Parameter entries to Result Columns in ACS Commons Report

Avatar

Level 3

I am using JCR-SQL2 to query results in ACS commons. For search parameter, I am using ACS Commons Basic Parameter as well as Select Parameter. I would like to append one more result column with the search parameters. I was wondering what's the syntax to include that?

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@aemUser2345 Looks like you cannot add the search parameter as columns. ACS Commons provides the predefined list to configure as column. To extend you need to write custom code as given below in the document

 

https://adobe-consulting-services.github.io/acs-aem-commons/features/report-builder/extending.html

 

Creating a Report Column

Report columns are used to render a particular cell of a report result. All of the provided Report Columns use Sling Resources, but this is not a hard requirement.

 

To create a custom Report Column:

  1. Register a component with the componentGroup “ACS Commons - Report Builder Column”
  2. If this column should be added to the CSV export, the component can write the property exporter upon saving the configuration. The value should be the fully qualified name of the Java used to export the result to CSV for this column. See the containing-page component for an example of this.
  3. Add a default script (e.g. {component-name}.jsp), this will be called when editing the report to render the column configuration. See containing-page/containing-page.jsp as an example.
  4. Add a results.jsp script, this will be called when the column is rendered for a result. This should render a Coral Table Cell with the results. See containing-page/results.jsp as an example.
  5. Register a Sling Model implementing the ReportCellCSVExporter interface. See the PathReportCellCSVExporter as an example.

 

 

You can see the ACS Common code done for other columns here.

https://github.com/Adobe-Consulting-Services/acs-aem-commons/tree/master/ui.apps/src/main/content/jc... 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@aemUser2345 Looks like you cannot add the search parameter as columns. ACS Commons provides the predefined list to configure as column. To extend you need to write custom code as given below in the document

 

https://adobe-consulting-services.github.io/acs-aem-commons/features/report-builder/extending.html

 

Creating a Report Column

Report columns are used to render a particular cell of a report result. All of the provided Report Columns use Sling Resources, but this is not a hard requirement.

 

To create a custom Report Column:

  1. Register a component with the componentGroup “ACS Commons - Report Builder Column”
  2. If this column should be added to the CSV export, the component can write the property exporter upon saving the configuration. The value should be the fully qualified name of the Java used to export the result to CSV for this column. See the containing-page component for an example of this.
  3. Add a default script (e.g. {component-name}.jsp), this will be called when editing the report to render the column configuration. See containing-page/containing-page.jsp as an example.
  4. Add a results.jsp script, this will be called when the column is rendered for a result. This should render a Coral Table Cell with the results. See containing-page/results.jsp as an example.
  5. Register a Sling Model implementing the ReportCellCSVExporter interface. See the PathReportCellCSVExporter as an example.

 

 

You can see the ACS Common code done for other columns here.

https://github.com/Adobe-Consulting-Services/acs-aem-commons/tree/master/ui.apps/src/main/content/jc...