Skip to content

Commit

Permalink
Updated the annotations in QueryReportConfig fixing the query manager…
Browse files Browse the repository at this point in the history
… issue due to empty query language (#3296)

* Updated the annotations in QueryReportConfig fixing the query manager issue due to empty query language : Issue 3295

* Updating the annotations in reports sling models to fix the reports downloads on AEMaaCS : Issue 3295

---------

Co-authored-by: david g <[email protected]>
  • Loading branch information
ankit-gubrani and davidjgonzalez authored Mar 22, 2024
1 parent 7047719 commit 38c8e04
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)

- #3270 - Re-enable accidentally disabled JUnit3/4 tests
- #3200 - Remove useless public interface in Cloud Bundle to get javadocs to be built
- #3295 - Updated the annotations in QueryReportConfig fixing the query manager issue due to empty query language
- #3284 - Allow anonymous to read redirect caconfig options

## 6.4.0 - 2024-02-22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,25 @@
import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.inject.Inject;

import com.adobe.acs.commons.reports.internal.ExporterUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;

import com.adobe.acs.commons.reports.api.ReportCellCSVExporter;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

/**
* An exporter for exporting formatted string values
*/
@Model(adaptables = Resource.class)
public class DateReportCellCSVExporter implements ReportCellCSVExporter {

@Inject
@ValueMapValue
private String property;

@Inject
@ValueMapValue
@Optional
private String format;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@

import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;

import javax.inject.Inject;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

@Model(adaptables = Resource.class)
public interface PathListReportConfig {
@Inject
@ValueMapValue
int getPageSize();

@Inject
@ValueMapValue
String getPathArea();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@

import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;

import javax.inject.Inject;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

/**
* Sling Model used for rendering PredictedTags in reports
*/
@Model(adaptables = Resource.class)
public class PredictedTag {

@Inject
@ValueMapValue
private String name;
@Inject
@ValueMapValue
private Double confidence;
@Inject
@ValueMapValue
private Boolean isCustom;

public String getName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

import javax.inject.Inject;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -46,12 +46,12 @@ public class PredictedTagReportCellCSVExporter implements ReportCellCSVExporter
public static final String VALUE_SEPARATOR = ";";
public static final String SPACE_SEPARATOR = " ";

@Inject
@ValueMapValue
private String property;
@Inject @Optional
@ValueMapValue @Optional
private Double lowerConfidenceThreshold;

@Inject @Optional
@ValueMapValue @Optional
private boolean confidenceShown;

private PredictedTagsUtil predictedTagsUtil = new PredictedTagsUtil();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.sling.models.annotations.injectorspecific.Self;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

import javax.inject.Inject;
import java.util.List;

/**
Expand All @@ -43,10 +42,10 @@ public class PredictedTagsCellValue {
@ValueMapValue
private String property;

@Inject @Optional
@ValueMapValue @Optional
private Double lowerConfidenceThreshold;

@Inject @Optional
@ValueMapValue @Optional
private boolean confidenceShown;

private PredictedTagsUtil predictedTagsUtil = new PredictedTagsUtil();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
*/
package com.adobe.acs.commons.reports.models;

import javax.inject.Inject;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

/**
* Model for configuring a query-based report result.
*/
@Model(adaptables = Resource.class)
public interface QueryReportConfig {

@Inject
@ValueMapValue
int getPageSize();

@Inject
@ValueMapValue
String getQuery();

@Inject
@ValueMapValue
String getQueryLanguage();
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Optional;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.apache.commons.lang.StringUtils;
import org.apache.sling.api.resource.Resource;
Expand All @@ -36,11 +35,12 @@
import com.adobe.granite.references.Reference;
import com.adobe.granite.references.ReferenceAggregator;
import com.adobe.granite.references.ReferenceList;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

@Model(adaptables = Resource.class)
public class ReferencesModel implements ReportCellCSVExporter {

@Inject
@ValueMapValue
@OSGiService
private ReferenceAggregator aggregator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import com.adobe.acs.commons.reports.internal.ExporterUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.resource.Resource;
Expand All @@ -31,17 +29,18 @@

import com.adobe.acs.commons.reports.api.ReportCellCSVExporter;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

/**
* An exporter for exporting formatted string values
*/
@Model(adaptables = Resource.class)
public class StringReportCellCSVExporter implements ReportCellCSVExporter {

@Inject
@ValueMapValue
private String property;

@Inject
@ValueMapValue
@Optional
private String format;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
import java.util.List;
import java.util.Optional;

import javax.inject.Inject;

import com.adobe.acs.commons.reports.internal.ExporterUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -46,7 +45,7 @@ public class TagReportCellCSVExporter implements ReportCellCSVExporter {
@OSGiService
private DelimiterConfiguration delimiterConfiguration;

@Inject
@ValueMapValue
private String property;

public TagReportCellCSVExporter() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@org.osgi.annotation.versioning.Version("1.2.0")
@org.osgi.annotation.versioning.Version("1.2.1")
package com.adobe.acs.commons.reports.models;


Expand Down

0 comments on commit 38c8e04

Please sign in to comment.