[OLINGO-557] Deactivate Function Imports for TecSvc
This commit is contained in:
parent
1b9d92e77f
commit
6e90b617ab
|
@ -84,6 +84,11 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor
|
||||||
@Override
|
@Override
|
||||||
public void readPrimitive(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
public void readPrimitive(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
||||||
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
||||||
|
if(isFunctionImport(uriInfo)) {
|
||||||
|
throw new ODataApplicationException("Function imports are not supported yet in technical scenario.",
|
||||||
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
|
}
|
||||||
|
|
||||||
readProperty(response, uriInfo, contentType, RepresentationType.PRIMITIVE);
|
readProperty(response, uriInfo, contentType, RepresentationType.PRIMITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +118,10 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor
|
||||||
@Override
|
@Override
|
||||||
public void readPrimitiveCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
public void readPrimitiveCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
||||||
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
||||||
|
if(isFunctionImport(uriInfo)) {
|
||||||
|
throw new ODataApplicationException("Function imports are not supported yet in technical scenario.",
|
||||||
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
|
}
|
||||||
readProperty(response, uriInfo, contentType, RepresentationType.COLLECTION_PRIMITIVE);
|
readProperty(response, uriInfo, contentType, RepresentationType.COLLECTION_PRIMITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +152,10 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor
|
||||||
@Override
|
@Override
|
||||||
public void readComplex(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
public void readComplex(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
||||||
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
||||||
|
if(isFunctionImport(uriInfo)) {
|
||||||
|
throw new ODataApplicationException("Function imports are not supported yet in technical scenario.",
|
||||||
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
|
}
|
||||||
readProperty(response, uriInfo, contentType, RepresentationType.COMPLEX);
|
readProperty(response, uriInfo, contentType, RepresentationType.COMPLEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +184,10 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor
|
||||||
@Override
|
@Override
|
||||||
public void readComplexCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
public void readComplexCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
|
||||||
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
final ContentType contentType) throws ODataApplicationException, SerializerException {
|
||||||
|
if(isFunctionImport(uriInfo)) {
|
||||||
|
throw new ODataApplicationException("Function imports are not supported yet in technical scenario.",
|
||||||
|
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
|
||||||
|
}
|
||||||
readProperty(response, uriInfo, contentType, RepresentationType.COLLECTION_COMPLEX);
|
readProperty(response, uriInfo, contentType, RepresentationType.COLLECTION_COMPLEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,6 +214,11 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor
|
||||||
deleteProperty(response, uriInfo);
|
deleteProperty(response, uriInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isFunctionImport(final UriInfo uriInfo) {
|
||||||
|
final List<UriResource> resourceParts = uriInfo.asUriInfoResource().getUriResourceParts();
|
||||||
|
return !resourceParts.isEmpty() && resourceParts.get(0).getKind() == UriResourceKind.function;
|
||||||
|
}
|
||||||
|
|
||||||
private void readProperty(final ODataResponse response, final UriInfo uriInfo, final ContentType contentType,
|
private void readProperty(final ODataResponse response, final UriInfo uriInfo, final ContentType contentType,
|
||||||
final RepresentationType representationType) throws ODataApplicationException, SerializerException {
|
final RepresentationType representationType) throws ODataApplicationException, SerializerException {
|
||||||
final UriInfoResource resource = uriInfo.asUriInfoResource();
|
final UriInfoResource resource = uriInfo.asUriInfoResource();
|
||||||
|
|
Loading…
Reference in New Issue