diff --git a/pom.xml b/pom.xml
index a073e074adf4..2614ac6b5b5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,16 +56,17 @@
2.9.1
2.0.30
2.1.5
-
- 9.4.53.v20231009
10.0.19
+ ${jetty.server.version}
${jetty.client.version}
4.1.105.Final
5.6.15.Final
3.3.5
1.4.2
- 8.11.2
+ 9.4.1
+ 9.8.0
+ 2.41
+ 2.6.1
3.9.1
@@ -750,99 +751,6 @@
4.2.1
-
-
- org.restlet.jse
- org.restlet.ext.jaxrs
- ${restlet.version}
-
-
-
- javax.xml.stream
- stax-api
-
-
-
- org.restlet.lib.org.json
- org.restlet.jse
-
-
-
- javax.mail
- mail
-
-
-
- javax.ws.rs
- javax.ws.rs-api
-
-
-
- jaxb-impl
- com.sun.xml.bind
-
-
-
- json
- org.json
-
-
-
-
-
- org.restlet.jse
- org.restlet.ext.jackson
- ${restlet.version}
- runtime
-
-
-
- org.codehaus.woodstox
- woodstox-core-asl
-
-
-
-
-
- org.restlet.jse
- org.restlet.ext.jaxb
- ${restlet.version}
- runtime
-
-
-
- stax-api
- javax.xml.stream
-
-
-
- jaxb-impl
- com.sun.xml.bind
-
-
-
-
- org.restlet.jse
- org.restlet
- ${restlet.version}
-
-
- org.restlet.jee
- org.restlet.ext.servlet
- ${restlet.version}
-
-
-
- org.restlet.jee
- org.restlet
-
-
-
-
com.google.re2j
@@ -1013,35 +921,16 @@
org.apache.solr
solr-solrj
${solr.version}
-
-
-
- org.codehaus.woodstox
- woodstox-core-asl
-
-
-
- org.eclipse.jetty
- *
-
-
- org.eclipse.jetty.http2
- *
-
-
org.apache.solr
solr-core
${solr.version}
-
+
- org.codehaus.woodstox
- woodstox-core-asl
+ org.glassfish.hk2.external
+ jakarta.inject
@@ -1060,10 +949,6 @@
io.dropwizard.metrics
metrics-jvm
-
- org.restlet.jee
- *
-
org.eclipse.jetty
*
@@ -1073,13 +958,9 @@
*
- org.apache.hadoop
+ org.eclipse.jetty.toolchain
*
-
- org.bitbucket.b_c
- jose4j
-
org.apache.logging.log4j
@@ -1087,6 +968,11 @@
+
+ org.apache.lucene
+ lucene-backward-codecs
+ ${lucene.version}
+
org.xerial.snappy
snappy-java
@@ -1124,6 +1010,112 @@
zookeeper-jute
${zookeeper.version}
+
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey.version}
+
+
+
+ org.glassfish.hk2.external
+ jakarta.inject
+
+
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey.version}
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ ${jersey.version}
+
+
+
+ org.glassfish.hk2.external
+ jakarta.inject
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey.version}
+
+
+
+ org.glassfish.hk2.external
+ jakarta.inject
+
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-jaxb
+ ${jersey.version}
+
+
+
+ org.glassfish.hk2.external
+ jakarta.inject
+
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-binding
+ ${jersey.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey.version}
+
+
+ org.glassfish.hk2
+ hk2-api
+ ${hk2.version}
+
+
+
+ org.glassfish.hk2.external
+ jakarta.inject
+
+
+ org.glassfish.hk2.external
+ aopalliance-repackaged
+
+
+
+
+ org.glassfish.hk2
+ hk2-locator
+ ${hk2.version}
+
+
+
+ org.glassfish.hk2.external
+ jakarta.inject
+
+
+ org.glassfish.hk2.external
+ aopalliance-repackaged
+
+
+
+
+ aopalliance
+ aopalliance
+ 1.0
+
@@ -1513,6 +1505,14 @@
org.apache.groovy:groovy-dateutil
org.codehaus.groovy:groovy-dateutil
+
+ javax.inject:javax.inject
+ org.glassfish.hk2.external:jakarta.inject
+
+
+ aopalliance:aopalliance
+ org.glassfish.hk2.external:aopalliance-repackaged
+
diff --git a/xwiki-platform-core/pom.xml b/xwiki-platform-core/pom.xml
index f1c2a2f43612..79d678b51904 100644
--- a/xwiki-platform-core/pom.xml
+++ b/xwiki-platform-core/pom.xml
@@ -125,9 +125,100 @@
Single justification example:
-->
-
-
-
+
+ Was never meant to be an API.
+ highlight
+
+ -
+ true
+
java.field.removed
+ field org.xwiki.search.solr.AbstractSolrCoreInitializer.fields
+
+ -
+ true
+
java.field.removed
+ field org.xwiki.search.solr.AbstractSolrCoreInitializer.types
+
+ -
+ true
+
java.field.visibilityReduced
+ field org.xwiki.search.solr.AbstractSolrCoreInitializer.solrSchemaUtils
+ field org.xwiki.search.solr.AbstractSolrCoreInitializer.solrSchemaUtils
+ protected
+ private
+
+
+
+
+ Should have never been public in the first place and is deprecated since 9.8RC1.
+ highlight
+
+ -
+ true
+
java.class.removed
+ class org.xwiki.rest.Constants
+
+
+
+
+ Not runtime breakages from REST API point of view and not supposed to be called in Java
+ highlight
+
+ -
+ true
+
java.method.numberOfParametersChanged
+ method javax.ws.rs.core.Response org.xwiki.notifications.rest.NotificationsResource::postNotifications() throws java.lang.Exception
+ method javax.ws.rs.core.Response org.xwiki.notifications.rest.NotificationsResource::postNotifications(java.lang.String, java.lang.String, java.lang.String, boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.lang.Exception
+
+ -
+ true
+
java.method.returnTypeChanged
+ method java.util.Map<java.lang.String, java.lang.String> org.xwiki.image.style.rest.ImageStylesResource::getDefaultStyleIdentifier(java.lang.String, java.lang.String) throws org.xwiki.image.style.ImageStyleException
+ method javax.ws.rs.core.Response org.xwiki.image.style.rest.ImageStylesResource::getDefaultStyleIdentifier(java.lang.String, java.lang.String) throws org.xwiki.image.style.ImageStyleException
+
+ -
+ true
+
java.annotation.added
+ parameter javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, ===javax.mail.Multipart===, java.lang.Boolean, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ parameter javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, ===java.lang.Boolean===, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ @javax.ws.rs.DefaultValue("false")
+
+ -
+ true
+
java.annotation.added
+ parameter javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, ===javax.mail.Multipart===, java.lang.Boolean, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ parameter javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, ===java.lang.Boolean===, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ @javax.ws.rs.QueryParam("prettyNames")
+
+ -
+ true
+
java.annotation.attributeValueChanged
+ parameter javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, javax.mail.Multipart, ===java.lang.Boolean===, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ parameter javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, ===java.lang.Boolean===) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ javax.ws.rs.QueryParam
+ value
+ "prettyNames"
+ "createPage"
+
+ -
+ true
+
java.method.numberOfParametersChanged
+ method javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, javax.mail.Multipart, java.lang.Boolean, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+ method javax.ws.rs.core.Response org.xwiki.rest.resources.attachments.AttachmentsResource::addAttachment(java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean) throws org.xwiki.rest.XWikiRestException, org.xwiki.attachment.validation.AttachmentValidationException
+
+
+
+
+ Very specific to Restlet and not supposed to be called in Java
+ highlight
+
+ -
+ true
+
java.method.removed
+ method java.lang.String org.xwiki.rest.XWikiResource::getUriTemplate()
+
+
+
diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AbstractAnnotationsRESTResource.java b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AbstractAnnotationsRESTResource.java
new file mode 100644
index 000000000000..e2971a6018b6
--- /dev/null
+++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AbstractAnnotationsRESTResource.java
@@ -0,0 +1,130 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.xwiki.annotation.rest.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import org.apache.commons.lang3.StringUtils;
+import org.xwiki.annotation.AnnotationServiceException;
+import org.xwiki.annotation.rest.model.jaxb.AnnotationAddRequest;
+import org.xwiki.annotation.rest.model.jaxb.AnnotationField;
+import org.xwiki.annotation.rest.model.jaxb.AnnotationFieldCollection;
+import org.xwiki.annotation.rest.model.jaxb.AnnotationRequest;
+import org.xwiki.annotation.rest.model.jaxb.AnnotationResponse;
+import org.xwiki.model.reference.DocumentReference;
+
+import com.xpn.xwiki.XWikiException;
+
+/**
+ * @version $Id$
+ * @since 16.2.0RC1
+ */
+public abstract class AbstractAnnotationsRESTResource extends AbstractAnnotationRESTResource
+{
+ /**
+ * Request parameter to request a field in an annotation request.
+ */
+ private static final String ANNOTATION_REQUEST_REQUESTED_FIELD_PARAMETER = "request_field";
+
+ /**
+ * Request parameter prefix for a filter in an annotation request.
+ */
+ private static final String ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX = "filter_";
+
+ protected Response getAnnotatedContent(DocumentReference documentReference)
+ {
+ try {
+ // Initialize the context with the correct value.
+ updateContext(documentReference);
+
+ String documentName = this.referenceSerializer.serialize(documentReference);
+
+ // check access to this function
+ if (!this.annotationRightService.canViewAnnotatedTarget(documentName, getXWikiUser())) {
+ throw new WebApplicationException(Status.UNAUTHORIZED);
+ }
+
+ // Manually construct the Annotation request entity
+ MultivaluedMap parameters = this.uriInfo.getQueryParameters();
+ AnnotationRequest request = new AnnotationRequest();
+ AnnotationFieldCollection fields = new AnnotationFieldCollection();
+ List annotationFields = new ArrayList<>();
+ AnnotationRequest.Request requestedFields = new AnnotationRequest.Request();
+ for (Map.Entry> entry : parameters.entrySet()) {
+ String name = entry.getKey();
+ if (StringUtils.startsWith(name, ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX)) {
+ for (String value : entry.getValue()) {
+ AnnotationField field = new AnnotationField();
+ field.setName(StringUtils.substringAfter(name, ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX));
+ field.setValue(value);
+ annotationFields.add(field);
+ }
+ } else if (StringUtils.equals(name, ANNOTATION_REQUEST_REQUESTED_FIELD_PARAMETER)) {
+ requestedFields.getFields().addAll(entry.getValue());
+ }
+ }
+ request.setRequest(requestedFields);
+ fields.getFields().addAll(annotationFields);
+ request.setFilter(fields);
+
+ AnnotationResponse response = getSuccessResponseWithAnnotatedContent(documentName, request);
+ return Response.ok(response).build();
+ } catch (AnnotationServiceException | XWikiException e) {
+ getLogger().error(e.getMessage(), e);
+ return Response.ok(getErrorResponse(e)).build();
+ }
+ }
+
+ protected AnnotationResponse postAnnotation(DocumentReference documentReference, AnnotationAddRequest request)
+ {
+ try {
+ // Initialize the context with the correct value.
+ updateContext(documentReference);
+
+ String documentName = this.referenceSerializer.serialize(documentReference);
+
+ // check access to this function
+ if (!this.annotationRightService.canAddAnnotation(documentName, getXWikiUser())) {
+ throw new WebApplicationException(Status.UNAUTHORIZED);
+ }
+
+ // add the annotation
+ Map annotationMetadata = getMap(request.getAnnotation());
+
+ this.handleTemporaryUploadedFiles(documentReference, annotationMetadata);
+ this.annotationService.addAnnotation(documentName, request.getSelection(), request.getSelectionContext(),
+ request.getSelectionOffset(), getXWikiUser(), annotationMetadata);
+ this.cleanTemporaryUploadedFiles(documentReference);
+
+ // and then return the annotated content, as specified by the annotation request
+ return getSuccessResponseWithAnnotatedContent(documentName, request);
+ } catch (AnnotationServiceException | XWikiException e) {
+ getLogger().error(e.getMessage(), e);
+ return getErrorResponse(e);
+ }
+ }
+}
diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsRESTResource.java b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsRESTResource.java
index d158e06261a9..5cd4c4501fe5 100644
--- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsRESTResource.java
+++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsRESTResource.java
@@ -19,37 +19,20 @@
*/
package org.xwiki.annotation.rest.internal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
-import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import org.apache.commons.lang3.StringUtils;
-import org.restlet.Request;
-import org.restlet.data.Form;
-import org.xwiki.annotation.AnnotationServiceException;
import org.xwiki.annotation.rest.model.jaxb.AnnotationAddRequest;
-import org.xwiki.annotation.rest.model.jaxb.AnnotationField;
-import org.xwiki.annotation.rest.model.jaxb.AnnotationFieldCollection;
-import org.xwiki.annotation.rest.model.jaxb.AnnotationRequest;
import org.xwiki.annotation.rest.model.jaxb.AnnotationResponse;
import org.xwiki.component.annotation.Component;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.rest.XWikiRestException;
-import com.xpn.xwiki.XWikiException;
-
/**
* @version $Id$
* @since 2.3M1
@@ -58,18 +41,8 @@
@Named("org.xwiki.annotation.rest.internal.AnnotationsRESTResource")
@Path("/wikis/{wikiName}/spaces/{spaceName: .+}/pages/{pageName}/annotations")
@Singleton
-public class AnnotationsRESTResource extends AbstractAnnotationRESTResource
+public class AnnotationsRESTResource extends AbstractAnnotationsRESTResource
{
- /**
- * Request parameter to request a field in an annotation request.
- */
- private static final String ANNOTATION_REQUEST_REQUESTED_FIELD_PARAMETER = "request_field";
-
- /**
- * Request parameter prefix for a filter in an annotation request.
- */
- private static final String ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX = "filter_";
-
/**
* @param wiki the wiki of the document to get annotations for
* @param space the space of the document to get annotations for
@@ -87,54 +60,6 @@ public Response doGetAnnotatedContent(@PathParam("spaceName") String space, @Pat
return getAnnotatedContent(documentReference);
}
- protected Response getAnnotatedContent(DocumentReference documentReference)
- {
- try {
- // Initialize the context with the correct value.
- updateContext(documentReference);
-
- String documentName = this.referenceSerializer.serialize(documentReference);
-
- // check access to this function
- if (!this.annotationRightService.canViewAnnotatedTarget(documentName, getXWikiUser())) {
- throw new WebApplicationException(Status.UNAUTHORIZED);
- }
-
- // Manually construct the Annotation request entity
- // Historically it used to be passed as method argument, but this only worked because of a bug in
- // earlier version of Restlet (1.1.x) ; the JAX-RS specification explicitly states that such entity
- // parameters "[are] mapped from the request entity body.", and thus cannot be passed to a GET resource.
- // See paragraph 3.3.2.1 "Entity Parameters" of JAX-RS 1.1 specification.
- Form form = Request.getCurrent().getResourceRef().getQueryAsForm();
- AnnotationRequest request = new AnnotationRequest();
- AnnotationFieldCollection fields = new AnnotationFieldCollection();
- List annotationFields = new ArrayList<>();
- AnnotationRequest.Request requestedFields = new AnnotationRequest.Request();
- for (String name : form.getNames()) {
- if (StringUtils.startsWith(name, ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX)) {
- for (String value : form.getValuesArray(name)) {
- AnnotationField field = new AnnotationField();
- field.setName(StringUtils.substringAfter(name, ANNOTATION_REQUEST_FILTER_PARAMETER_PREFIX));
- field.setValue(value);
- annotationFields.add(field);
- }
- } else if (StringUtils.equals(name, ANNOTATION_REQUEST_REQUESTED_FIELD_PARAMETER)) {
- requestedFields.getFields().addAll(Arrays.asList(form.getValuesArray(name)));
- }
- }
- request.setRequest(requestedFields);
- fields.getFields().addAll(annotationFields);
- request.setFilter(fields);
-
- AnnotationResponse response = getSuccessResponseWithAnnotatedContent(documentName, request);
- // make this content expire now because cacheControl is not implemented in this version of restlet
- return Response.ok(response).expires(new Date()).build();
- } catch (AnnotationServiceException | XWikiException e) {
- getLogger().error(e.getMessage(), e);
- return Response.ok(getErrorResponse(e)).build();
- }
- }
-
/**
* Add annotation to a given page.
*
@@ -146,40 +71,10 @@ protected Response getAnnotatedContent(DocumentReference documentReference)
* @throws XWikiRestException when failing to parse space
*/
@POST
- public AnnotationResponse doPostAnnotation(@PathParam("wikiName") String wiki,
- @PathParam("spaceName") String space, @PathParam("pageName") String page, AnnotationAddRequest request)
- throws XWikiRestException
+ public AnnotationResponse doPostAnnotation(@PathParam("wikiName") String wiki, @PathParam("spaceName") String space,
+ @PathParam("pageName") String page, AnnotationAddRequest request) throws XWikiRestException
{
DocumentReference documentReference = new DocumentReference(wiki, parseSpaceSegments(space), page);
return postAnnotation(documentReference, request);
}
-
- protected AnnotationResponse postAnnotation(DocumentReference documentReference, AnnotationAddRequest request)
- {
- try {
- // Initialize the context with the correct value.
- updateContext(documentReference);
-
- String documentName = this.referenceSerializer.serialize(documentReference);
-
- // check access to this function
- if (!this.annotationRightService.canAddAnnotation(documentName, getXWikiUser())) {
- throw new WebApplicationException(Status.UNAUTHORIZED);
- }
-
- // add the annotation
- Map annotationMetadata = getMap(request.getAnnotation());
-
- this.handleTemporaryUploadedFiles(documentReference, annotationMetadata);
- this.annotationService.addAnnotation(documentName, request.getSelection(), request.getSelectionContext(),
- request.getSelectionOffset(), getXWikiUser(), annotationMetadata);
- this.cleanTemporaryUploadedFiles(documentReference);
-
- // and then return the annotated content, as specified by the annotation request
- return getSuccessResponseWithAnnotatedContent(documentName, request);
- } catch (AnnotationServiceException | XWikiException e) {
- getLogger().error(e.getMessage(), e);
- return getErrorResponse(e);
- }
- }
}
diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsTranslationRESTResource.java b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsTranslationRESTResource.java
index 608c310d4ea3..9b53f2427294 100644
--- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsTranslationRESTResource.java
+++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/AnnotationsTranslationRESTResource.java
@@ -45,7 +45,7 @@
@Named("org.xwiki.annotation.rest.internal.AnnotationsTranslationRESTResource")
@Path("/wikis/{wikiName}/spaces/{spaceName: .+}/pages/{pageName}/translations/{language}/annotations")
@Singleton
-public class AnnotationsTranslationRESTResource extends AnnotationsRESTResource
+public class AnnotationsTranslationRESTResource extends AbstractAnnotationsRESTResource
{
/**
* @param wiki the wiki of the document to get annotations for
@@ -61,8 +61,8 @@ public class AnnotationsTranslationRESTResource extends AnnotationsRESTResource
public Response doGetAnnotatedContent(@PathParam("spaceName") String space, @PathParam("pageName") String page,
@PathParam("wikiName") String wiki, @PathParam("language") String language) throws XWikiRestException
{
- DocumentReference documentReference = new DocumentReference(wiki, parseSpaceSegments(space), page,
- LocaleUtils.toLocale(language, Locale.ROOT));
+ DocumentReference documentReference =
+ new DocumentReference(wiki, parseSpaceSegments(space), page, LocaleUtils.toLocale(language, Locale.ROOT));
return getAnnotatedContent(documentReference);
}
@@ -78,9 +78,8 @@ public Response doGetAnnotatedContent(@PathParam("spaceName") String space, @Pat
* @throws XWikiRestException when failing to parse space
*/
@POST
- public AnnotationResponse doPostAnnotation(@PathParam("wikiName") String wiki,
- @PathParam("spaceName") String space, @PathParam("pageName") String page,
- @PathParam("language") String language, AnnotationAddRequest request)
+ public AnnotationResponse doPostAnnotation(@PathParam("wikiName") String wiki, @PathParam("spaceName") String space,
+ @PathParam("pageName") String page, @PathParam("language") String language, AnnotationAddRequest request)
throws XWikiRestException
{
DocumentReference documentReference = new DocumentReference(wiki, parseSpaceSegments(space), page);
diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/representations/AbstractFormUrlEncodedAnnotationRequestReader.java b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/representations/AbstractFormUrlEncodedAnnotationRequestReader.java
index 0303700b7f1b..9a6f4d75910c 100644
--- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/representations/AbstractFormUrlEncodedAnnotationRequestReader.java
+++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/src/main/java/org/xwiki/annotation/rest/internal/representations/AbstractFormUrlEncodedAnnotationRequestReader.java
@@ -23,22 +23,19 @@
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
+import java.util.List;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
+import javax.inject.Inject;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
-import org.restlet.Request;
-import org.restlet.data.Form;
-import org.restlet.ext.servlet.ServletUtils;
-import org.restlet.representation.InputRepresentation;
-import org.restlet.representation.Representation;
import org.xwiki.annotation.rest.model.jaxb.AnnotationField;
import org.xwiki.annotation.rest.model.jaxb.AnnotationRequest;
import org.xwiki.annotation.rest.model.jaxb.ObjectFactory;
+import org.xwiki.rest.JAXRSUtils;
import org.xwiki.rest.XWikiRestComponent;
/**
@@ -64,6 +61,9 @@ public abstract class AbstractFormUrlEncodedAnnotationRequestReader type, Type genericType, Annotation[] annotations, Med
MultivaluedMap httpHeaders, InputStream entityStream)
throws IOException, WebApplicationException
{
+ MultivaluedMap form = this.jaxrs.readForm(mediaType, annotations, entityStream);
+
ObjectFactory objectFactory = new ObjectFactory();
T annotationRequest = getReadObjectInstance(objectFactory);
- Representation representation =
- new InputRepresentation(entityStream, org.restlet.data.MediaType.APPLICATION_WWW_FORM);
- Form form = new Form(representation);
-
- /*
- * If the form is empty then it might have happened that some filter has invalidated the entity stream. Try to
- * read data using getParameter()
- */
- if (!form.getNames().isEmpty()) {
- for (String paramName : form.getNames()) {
- for (String paramValue : form.getValuesArray(paramName)) {
- saveField(annotationRequest, paramName, paramValue, objectFactory);
- }
- }
- } else {
- HttpServletRequest httpServletRequest = ServletUtils.getRequest(Request.getCurrent());
-
- for (Map.Entry entry : httpServletRequest.getParameterMap().entrySet()) {
- // FIXME: this needs to be done right, it can interfere with the custom parameters names
- // skip method & media parameters, used by REST to carry its own parameters
- if ("method".equals(entry.getKey()) || "media".equals(entry.getKey())) {
- continue;
- }
-
- // save all the values of this field, one by one
- String[] paramValues = entry.getValue();
- for (String value : paramValues) {
- saveField(annotationRequest, entry.getKey(), value, objectFactory);
- }
+ for (Map.Entry> entry : form.entrySet()) {
+ for (String value : entry.getValue()) {
+ saveField(annotationRequest, entry.getKey(), value, objectFactory);
}
}
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml
index 295abe9eafd9..b3dfc5a70d2c 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml
@@ -37,8 +37,8 @@
- javax.ws.rs
- jsr311-api
+ jakarta.ws.rs
+ jakarta.ws.rs-api
org.xwiki.platform
@@ -67,5 +67,10 @@
${commons.version}
test
+
+ javax.servlet
+ javax.servlet-api
+ test
+
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/AttachmentValidationExceptionMapper.java b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/AttachmentValidationExceptionMapper.java
index 42d9da6b3526..230cfc5e3e96 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/AttachmentValidationExceptionMapper.java
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/AttachmentValidationExceptionMapper.java
@@ -21,6 +21,7 @@
import javax.inject.Named;
import javax.inject.Singleton;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
@@ -30,8 +31,6 @@
import org.xwiki.component.annotation.Component;
import org.xwiki.rest.XWikiRestComponent;
-import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-
/**
* Exception mapper for {@link AttachmentValidationException}.
*
@@ -55,7 +54,7 @@ public Response toResponse(AttachmentValidationException exception)
return Response
.serverError()
.entity(entity.toString())
- .type(APPLICATION_JSON)
+ .type(MediaType.APPLICATION_JSON_TYPE)
.status(exception.getHttpStatus())
.build();
}
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/DefaultAttachmentValidator.java b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/DefaultAttachmentValidator.java
index a12d46cde156..889446bd88dc 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/DefaultAttachmentValidator.java
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/DefaultAttachmentValidator.java
@@ -26,6 +26,7 @@
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
+import javax.ws.rs.core.Response;
import org.xwiki.attachment.AttachmentAccessWrapper;
import org.xwiki.attachment.validation.AttachmentValidationConfiguration;
@@ -38,8 +39,6 @@
import org.xwiki.component.manager.ComponentLookupException;
import org.xwiki.component.manager.ComponentManager;
-import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
-
/**
* Default implementation of {@link AttachmentValidator}. Check for the file size and mimetype of a given file. The
* configuration values are retrieved using {@link AttachmentValidationConfiguration}.
@@ -86,7 +85,8 @@ public void validateAttachment(AttachmentAccessWrapper wrapper) throws Attachmen
} catch (ComponentLookupException e) {
throw new AttachmentValidationException(
String.format("Failed to resolve the [%s] components.", AttachmentValidationStep.class), e,
- SC_INTERNAL_SERVER_ERROR, "attachment.validation.attachmentValidationStep.error");
+ Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
+ "attachment.validation.attachmentValidationStep.error");
}
}
}
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStep.java b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStep.java
index d6a7498a3c25..9dde2e9e74ec 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStep.java
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStep.java
@@ -25,6 +25,7 @@
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;
+import javax.ws.rs.core.Response;
import org.xwiki.attachment.AttachmentAccessWrapper;
import org.xwiki.attachment.validation.AttachmentValidationException;
@@ -35,7 +36,6 @@
import static com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.UPLOAD_DEFAULT_MAXSIZE;
import static com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.UPLOAD_MAXSIZE_PARAMETER;
-import static javax.servlet.http.HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE;
import static org.apache.commons.io.FileUtils.byteCountToDisplaySize;
/**
@@ -62,9 +62,9 @@ public void validate(AttachmentAccessWrapper wrapper) throws AttachmentValidatio
{
long uploadMaxSize = getUploadMaxSize();
if (wrapper.getSize() > uploadMaxSize) {
- throw new AttachmentValidationException("File size too big", SC_REQUEST_ENTITY_TOO_LARGE,
- "attachment.validation.filesize.rejected", List.of(byteCountToDisplaySize(uploadMaxSize)),
- "fileuploadislarge");
+ throw new AttachmentValidationException("File size too big",
+ Response.Status.REQUEST_ENTITY_TOO_LARGE.getStatusCode(), "attachment.validation.filesize.rejected",
+ List.of(byteCountToDisplaySize(uploadMaxSize)), "fileuploadislarge");
}
}
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStep.java b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStep.java
index 20dce2bc8925..ee395de609e2 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStep.java
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/main/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStep.java
@@ -27,6 +27,7 @@
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
+import javax.ws.rs.core.Response;
import org.slf4j.Logger;
import org.xwiki.attachment.AttachmentAccessWrapper;
@@ -36,8 +37,6 @@
import org.xwiki.component.annotation.Component;
import org.xwiki.tika.internal.TikaUtils;
-import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
-import static javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE;
import static org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage;
/**
@@ -75,12 +74,12 @@ public void validate(AttachmentAccessWrapper wrapper) throws AttachmentValidatio
if (hasAllowedMimetypes && !checkMimetype(allowedMimetypes, mimeType)
|| hasBlockerMimetypes && checkMimetype(blockerMimetypes, mimeType)) {
throw new AttachmentValidationException(String.format("Invalid mimetype [%s]", mimeType),
- SC_UNSUPPORTED_MEDIA_TYPE, "attachment.validation.mimetype.rejected",
+ Response.Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode(), "attachment.validation.mimetype.rejected",
List.of(allowedMimetypes, blockerMimetypes), null);
}
} catch (IOException e) {
throw new AttachmentValidationException(String.format("Failed to read the input stream for [%s]", wrapper),
- e, SC_INTERNAL_SERVER_ERROR, "attachment.validation.inputStream.error");
+ e, Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "attachment.validation.inputStream.error");
}
}
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStepTest.java b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStepTest.java
index 189c02e27af2..bb12b23a21a4 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStepTest.java
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/FileSizeAttachmentValidationStepTest.java
@@ -22,6 +22,7 @@
import java.util.List;
import javax.inject.Provider;
+import javax.ws.rs.core.Response;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,7 +38,6 @@
import static com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.UPLOAD_DEFAULT_MAXSIZE;
import static com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.UPLOAD_MAXSIZE_PARAMETER;
-import static javax.servlet.http.HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;
@@ -82,7 +82,7 @@ void validateAttachmentTooLarge()
() -> this.validationStep.validate(attachmentAccessWrapper));
assertEquals("File size too big", exception.getMessage());
- assertEquals(SC_REQUEST_ENTITY_TOO_LARGE, exception.getHttpStatus());
+ assertEquals(Response.Status.REQUEST_ENTITY_TOO_LARGE.getStatusCode(), exception.getHttpStatus());
assertEquals("attachment.validation.filesize.rejected", exception.getTranslationKey());
assertEquals(List.of("42 bytes"), exception.getTranslationParameters());
assertEquals("fileuploadislarge", exception.getContextMessage());
diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStepTest.java b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStepTest.java
index a6dd6570d2f3..7b8cee9d63f6 100644
--- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStepTest.java
+++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/src/test/java/org/xwiki/attachment/validation/internal/step/MimetypeAttachmentValidationStepTest.java
@@ -22,6 +22,8 @@
import java.io.InputStream;
import java.util.List;
+import javax.ws.rs.core.Response;
+
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@@ -34,7 +36,6 @@
import org.xwiki.test.junit5.mockito.InjectMockComponents;
import org.xwiki.test.junit5.mockito.MockComponent;
-import static javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -75,7 +76,7 @@ void validateMimetypePlainTextBlocked(String blockerMimetype) throws Exception
() -> this.validationStep.validate(wrapper));
assertEquals("Invalid mimetype [text/plain]", exception.getMessage());
- assertEquals(SC_UNSUPPORTED_MEDIA_TYPE, exception.getHttpStatus());
+ assertEquals(Response.Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode(), exception.getHttpStatus());
assertEquals("attachment.validation.mimetype.rejected", exception.getTranslationKey());
assertEquals(List.of(List.of(), List.of(blockerMimetype)), exception.getTranslationParameters());
assertNull(exception.getContextMessage());
@@ -97,7 +98,7 @@ void validateMimetypePlainTextAllowed(String blockerMimetype) throws Exception
() -> this.validationStep.validate(wrapper));
assertEquals("Invalid mimetype [text/plain]", exception.getMessage());
- assertEquals(SC_UNSUPPORTED_MEDIA_TYPE, exception.getHttpStatus());
+ assertEquals(Response.Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode(), exception.getHttpStatus());
assertEquals("attachment.validation.mimetype.rejected", exception.getTranslationKey());
assertEquals(List.of(List.of(blockerMimetype), List.of()), exception.getTranslationParameters());
assertNull(exception.getContextMessage());
diff --git a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-test/xwiki-platform-ckeditor-test-docker/src/test/it/org/xwiki/ckeditor/test/ui/ImageIT.java b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-test/xwiki-platform-ckeditor-test-docker/src/test/it/org/xwiki/ckeditor/test/ui/ImageIT.java
index aa4f9db2006a..b8b657f55ec7 100644
--- a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-test/xwiki-platform-ckeditor-test-docker/src/test/it/org/xwiki/ckeditor/test/ui/ImageIT.java
+++ b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-test/xwiki-platform-ckeditor-test-docker/src/test/it/org/xwiki/ckeditor/test/ui/ImageIT.java
@@ -65,7 +65,14 @@
* @version $Id$
* @since 14.7RC1
*/
-@UITest
+@UITest(
+ extraJARs = {
+ // It's currently not possible to install a JAR contributing a Hibernate mapping file as an Extension. Thus
+ // we need to provide the JAR inside WEB-INF/lib. See https://jira.xwiki.org/browse/XWIKI-8271
+ "org.xwiki.platform:xwiki-platform-notifications-filters-default"
+ },
+ resolveExtraJARs = true
+)
class ImageIT extends AbstractCKEditorIT
{
diff --git a/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/EventsSolrCoreInitializer.java b/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/EventsSolrCoreInitializer.java
index 59a435717ce8..798817ba7c1a 100644
--- a/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/EventsSolrCoreInitializer.java
+++ b/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/src/main/java/org/xwiki/eventstream/store/solr/internal/EventsSolrCoreInitializer.java
@@ -130,4 +130,10 @@ protected void migrateSchema(long cversion) throws SolrException
setStringField(Event.FIELD_REMOTE_OBSERVATION_ID, false, false);
}
}
+
+ @Override
+ protected int getMigrationBatchRows()
+ {
+ return 1000;
+ }
}
diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/src/main/java/org/xwiki/extension/index/internal/ExtensionIndexSolrCoreInitializer.java b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/src/main/java/org/xwiki/extension/index/internal/ExtensionIndexSolrCoreInitializer.java
index abb49e422b2a..a0d2f88a8698 100644
--- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/src/main/java/org/xwiki/extension/index/internal/ExtensionIndexSolrCoreInitializer.java
+++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/src/main/java/org/xwiki/extension/index/internal/ExtensionIndexSolrCoreInitializer.java
@@ -260,7 +260,7 @@ protected void migrateSchema(long cversion) throws SolrException
if (cversion >= SCHEMA_VERSION_15_6) {
// Cleanup previously required field from the index.
try {
- this.client.deleteByQuery("is_installed:[* TO *] OR is_from_environment:[* TO *]");
+ this.core.getClient().deleteByQuery("is_installed:[* TO *] OR is_from_environment:[* TO *]");
} catch (SolrServerException | IOException e) {
throw new SolrException("Failed to cleanup is_installed field", e);
}
diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-test/xwiki-platform-extension-test-tests/src/test/java/org/xwiki/test/ui/extension/ExtensionIT.java b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-test/xwiki-platform-extension-test-tests/src/test/java/org/xwiki/test/ui/extension/ExtensionIT.java
index 3db533a44ccc..0c9d534896e6 100644
--- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-test/xwiki-platform-extension-test-tests/src/test/java/org/xwiki/test/ui/extension/ExtensionIT.java
+++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-test/xwiki-platform-extension-test-tests/src/test/java/org/xwiki/test/ui/extension/ExtensionIT.java
@@ -210,15 +210,15 @@ public void testSimpleSearch()
+ "looking for, you can use the Advanced Search form above.", searchResults.getNoResultsMessage());
// Test a search query with only a few results (only one page).
- searchResults = searchBar.search("restlet");
+ searchResults = searchBar.search("groovy");
assertNull(searchResults.getNoResultsMessage());
assertNull(searchResults.getPagination());
assertTrue(searchResults.getDisplayedResultsCount() > 1);
ExtensionPane extension = searchResults.getExtension(0);
assertEquals("core", extension.getStatus());
- assertTrue("Can't find [restlet] in the name of the extension [" + extension.getId() + "] ("
- + extension.getName() + ")", extension.getName().toLowerCase().contains("restlet"));
+ assertTrue("Can't find [groovy] in the name of the extension [" + extension.getId() + "] ("
+ + extension.getName() + ")", extension.getName().toLowerCase().contains("groovy"));
}
/**
@@ -229,15 +229,15 @@ public void testAdvancedSearch()
{
ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoCoreExtensions();
- SearchResultsPane searchResults = adminPage.getSearchBar().search("restlet");
+ SearchResultsPane searchResults = adminPage.getSearchBar().search("groovy");
String version = searchResults.getExtension(0).getVersion();
- searchResults = new SimpleSearchPane().clickAdvancedSearch().search("org.restlet.jse:org.restlet", version);
+ searchResults = new SimpleSearchPane().clickAdvancedSearch().search("org.apache.groovy:groovy", version);
assertEquals(1, searchResults.getDisplayedResultsCount());
assertNull(searchResults.getNoResultsMessage());
ExtensionPane extension = searchResults.getExtension(0);
assertEquals("core", extension.getStatus());
- assertTrue(extension.getName().toLowerCase().contains("restlet"));
+ assertTrue(extension.getName().toLowerCase().contains("groovy"));
assertEquals(version, extension.getVersion());
searchResults = new SimpleSearchPane().clickAdvancedSearch().search("foo", "bar");
diff --git a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/pom.xml b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/pom.xml
index 9b06557a205c..87b9f04f631d 100644
--- a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/pom.xml
+++ b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/pom.xml
@@ -37,8 +37,8 @@
- javax.ws.rs
- jsr311-api
+ jakarta.ws.rs
+ jakarta.ws.rs-api
org.xwiki.commons
diff --git a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-default/pom.xml b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-default/pom.xml
index fb2b255270a7..ab5baf48e8d8 100644
--- a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-default/pom.xml
+++ b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-default/pom.xml
@@ -69,5 +69,10 @@
${commons.version}
test
+
+ org.glassfish.jersey.core
+ jersey-common
+ test
+
\ No newline at end of file
diff --git a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml
index 41408dce61f2..04ccc281f012 100644
--- a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml
+++ b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml
@@ -39,8 +39,8 @@
- javax.ws.rs
- jsr311-api
+ jakarta.ws.rs
+ jakarta.ws.rs-api
org.xwiki.commons
@@ -69,5 +69,15 @@
${commons.version}
test
+
+ org.glassfish.jersey.core
+ jersey-common
+ test
+
+
+ javax.servlet
+ javax.servlet-api
+ test
+
diff --git a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/ImageStylesResource.java b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/ImageStylesResource.java
index 3c346535f10e..66ac23380f86 100644
--- a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/ImageStylesResource.java
+++ b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/ImageStylesResource.java
@@ -19,12 +19,11 @@
*/
package org.xwiki.image.style.rest;
-import java.util.Map;
-
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
import org.xwiki.image.style.ImageStyleException;
import org.xwiki.image.style.rest.model.jaxb.Styles;
@@ -58,7 +57,6 @@ public interface ImageStylesResource
*/
@GET
@Path("/default")
- Map getDefaultStyleIdentifier(@PathParam("wikiName") String wikiName,
- @QueryParam("documentReference") String documentReference)
- throws ImageStyleException;
+ Response getDefaultStyleIdentifier(@PathParam("wikiName") String wikiName,
+ @QueryParam("documentReference") String documentReference) throws ImageStyleException;
}
diff --git a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/internal/DefaultImageStylesResource.java b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/internal/DefaultImageStylesResource.java
index 3dd53f47ca55..e71e04fefc8e 100644
--- a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/internal/DefaultImageStylesResource.java
+++ b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/src/main/java/org/xwiki/image/style/rest/internal/DefaultImageStylesResource.java
@@ -26,8 +26,8 @@
import javax.inject.Inject;
import javax.inject.Named;
-import javax.inject.Provider;
import javax.inject.Singleton;
+import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.xwiki.component.annotation.Component;
@@ -40,10 +40,6 @@
import org.xwiki.image.style.rest.model.jaxb.Styles;
import org.xwiki.rest.XWikiRestComponent;
-import com.xpn.xwiki.XWikiContext;
-
-import static javax.ws.rs.core.Response.Status.NO_CONTENT;
-
/**
* Default image style rest endpoint implementation.
*
@@ -61,9 +57,6 @@ public class DefaultImageStylesResource implements ImageStylesResource, XWikiRes
@Inject
private ImageStyleManager imageStyleManager;
- @Inject
- private Provider contextProvider;
-
@Override
public Styles getStyles(String wikiName) throws ImageStyleException
{
@@ -73,30 +66,25 @@ public Styles getStyles(String wikiName) throws ImageStyleException
}
@Override
- public Map getDefaultStyleIdentifier(String wikiName, String documentReference)
- throws ImageStyleException
+ public Response getDefaultStyleIdentifier(String wikiName, String documentReference) throws ImageStyleException
{
String defaultStyle = this.imageStyleConfiguration.getDefaultStyle(wikiName, documentReference);
boolean forceDefaultStyle = this.imageStyleConfiguration.getForceDefaultStyle(wikiName, documentReference);
- Map response;
+ Response response;
if (StringUtils.isEmpty(defaultStyle)) {
- this.contextProvider.get().getResponse().setStatus(NO_CONTENT.getStatusCode());
- response = Map.of();
+ response = Response.ok(Map.of()).build();
} else {
- response = Map.of(
- "defaultStyle", defaultStyle,
- "forceDefaultStyle", Boolean.toString(forceDefaultStyle)
- );
+ response = Response
+ .ok(Map.of("defaultStyle", defaultStyle, "forceDefaultStyle", Boolean.toString(forceDefaultStyle)))
+ .build();
}
+
return response;
}
private List