From 38c8e0442de005a3c44c117b79784d79c7691c0c Mon Sep 17 00:00:00 2001 From: Ankit Gubrani Date: Fri, 22 Mar 2024 07:15:13 -0700 Subject: [PATCH] Updated the annotations in QueryReportConfig fixing the query manager 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 --- CHANGELOG.md | 1 + .../reports/models/DateReportCellCSVExporter.java | 7 +++---- .../acs/commons/reports/models/PathListReportConfig.java | 7 +++---- .../adobe/acs/commons/reports/models/PredictedTag.java | 9 ++++----- .../models/PredictedTagReportCellCSVExporter.java | 8 ++++---- .../commons/reports/models/PredictedTagsCellValue.java | 5 ++--- .../acs/commons/reports/models/QueryReportConfig.java | 9 ++++----- .../acs/commons/reports/models/ReferencesModel.java | 4 ++-- .../reports/models/StringReportCellCSVExporter.java | 7 +++---- .../commons/reports/models/TagReportCellCSVExporter.java | 5 ++--- .../adobe/acs/commons/reports/models/package-info.java | 2 +- 11 files changed, 29 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b544732bf4..15e00d6755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/DateReportCellCSVExporter.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/DateReportCellCSVExporter.java index 4ef51cc3e8..724b6425d6 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/DateReportCellCSVExporter.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/DateReportCellCSVExporter.java @@ -20,8 +20,6 @@ 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; @@ -29,6 +27,7 @@ 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 @@ -36,10 +35,10 @@ @Model(adaptables = Resource.class) public class DateReportCellCSVExporter implements ReportCellCSVExporter { - @Inject + @ValueMapValue private String property; - @Inject + @ValueMapValue @Optional private String format; diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PathListReportConfig.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PathListReportConfig.java index 72dd690739..a061c802bc 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PathListReportConfig.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PathListReportConfig.java @@ -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(); } diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTag.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTag.java index f737e2fc37..3f24f846bb 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTag.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTag.java @@ -21,8 +21,7 @@ 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 @@ -30,11 +29,11 @@ @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() { diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagReportCellCSVExporter.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagReportCellCSVExporter.java index 4834eb9c7a..d78537d54b 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagReportCellCSVExporter.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagReportCellCSVExporter.java @@ -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; @@ -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(); diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagsCellValue.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagsCellValue.java index bbebc4ea55..6da4d22a5b 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagsCellValue.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/PredictedTagsCellValue.java @@ -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; /** @@ -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(); diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/QueryReportConfig.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/QueryReportConfig.java index f81189e9d0..fb848d200d 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/QueryReportConfig.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/QueryReportConfig.java @@ -17,10 +17,9 @@ */ 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. @@ -28,12 +27,12 @@ @Model(adaptables = Resource.class) public interface QueryReportConfig { - @Inject + @ValueMapValue int getPageSize(); - @Inject + @ValueMapValue String getQuery(); - @Inject + @ValueMapValue String getQueryLanguage(); } diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/ReferencesModel.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/ReferencesModel.java index f57ce4f513..0de0c0bfbe 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/ReferencesModel.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/ReferencesModel.java @@ -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; @@ -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; diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/StringReportCellCSVExporter.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/StringReportCellCSVExporter.java index 7496c82f89..2fb62b87c2 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/StringReportCellCSVExporter.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/StringReportCellCSVExporter.java @@ -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; @@ -31,6 +29,7 @@ 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 @@ -38,10 +37,10 @@ @Model(adaptables = Resource.class) public class StringReportCellCSVExporter implements ReportCellCSVExporter { - @Inject + @ValueMapValue private String property; - @Inject + @ValueMapValue @Optional private String format; diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/TagReportCellCSVExporter.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/TagReportCellCSVExporter.java index 84a3c94d1f..880f307d0c 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/TagReportCellCSVExporter.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/TagReportCellCSVExporter.java @@ -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; @@ -46,7 +45,7 @@ public class TagReportCellCSVExporter implements ReportCellCSVExporter { @OSGiService private DelimiterConfiguration delimiterConfiguration; - @Inject + @ValueMapValue private String property; public TagReportCellCSVExporter() {} diff --git a/bundle/src/main/java/com/adobe/acs/commons/reports/models/package-info.java b/bundle/src/main/java/com/adobe/acs/commons/reports/models/package-info.java index a64ad9d062..c9916142c0 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/reports/models/package-info.java +++ b/bundle/src/main/java/com/adobe/acs/commons/reports/models/package-info.java @@ -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;