Package org.mycore.restapi.v1.utils
Class MCRRestAPIObjectsHelper
java.lang.Object
org.mycore.restapi.v1.utils.MCRRestAPIObjectsHelper
main utility class that handles REST requests
to filter the XML output of showMCRObject, set the properties:
MCR.RestAPI.v1.Filter.XML
to your ContentTransformer-ID,
MCR.ContentTransformer.[your ContentTransformer-ID here].Class
to your ContentTransformer's class and
MCR.ContentTransformer.[your ContentTransformer-ID here].Stylesheet
to your filtering stylesheet.
- Version:
- $Revision: $ $Date: $
- Author:
- Robert Stephan, Christoph Neidahl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
hasChildren
(Path p) checks if the given path is a directory and contains childrenstatic jakarta.ws.rs.core.Response
listContents
(jakarta.ws.rs.core.UriInfo info, jakarta.ws.rs.core.Application app, jakarta.ws.rs.core.Request request, String mcrObjID, String mcrDerID, String format, String path, int depth) lists derivate content (file listing)static jakarta.ws.rs.core.Response
listDerivates
(jakarta.ws.rs.core.UriInfo info, String mcrObjID, String format, String sort) returns a list of derivate objectsstatic jakarta.ws.rs.core.Response
listObjects
(jakarta.ws.rs.core.UriInfo info, String format, String filter, String sort) returns a list of objectsstatic String
retrieveMaindocURL
(jakarta.ws.rs.core.UriInfo info, String mcrObjID, String mcrDerID, jakarta.ws.rs.core.Application app) returns the URL of the main document of a derivatestatic jakarta.ws.rs.core.Response
showMCRDerivate
(String pathParamMcrID, String pathParamDerID, jakarta.ws.rs.core.UriInfo info, jakarta.ws.rs.core.Application app, boolean withDetails) static jakarta.ws.rs.core.Response
showMCRObject
(String pathParamId, String queryParamStyle, jakarta.ws.rs.core.UriInfo info, jakarta.ws.rs.core.Application app)
-
Constructor Details
-
MCRRestAPIObjectsHelper
public MCRRestAPIObjectsHelper()
-
-
Method Details
-
showMCRObject
public static jakarta.ws.rs.core.Response showMCRObject(String pathParamId, String queryParamStyle, jakarta.ws.rs.core.UriInfo info, jakarta.ws.rs.core.Application app) throws MCRRestAPIException - Throws:
MCRRestAPIException
-
showMCRDerivate
public static jakarta.ws.rs.core.Response showMCRDerivate(String pathParamMcrID, String pathParamDerID, jakarta.ws.rs.core.UriInfo info, jakarta.ws.rs.core.Application app, boolean withDetails) throws MCRRestAPIException - Throws:
MCRRestAPIException
-
listObjects
public static jakarta.ws.rs.core.Response listObjects(jakarta.ws.rs.core.UriInfo info, String format, String filter, String sort) throws MCRRestAPIException returns a list of objects- Parameters:
info
- - the injected Jersey URIInfo objectformat
- - the output format ('xml'|'json')filter
- - a filter criteriasort
- - the sort criteria- Returns:
- a Jersey response object
- Throws:
MCRRestAPIException
- See Also:
-
listDerivates
public static jakarta.ws.rs.core.Response listDerivates(jakarta.ws.rs.core.UriInfo info, String mcrObjID, String format, String sort) throws MCRRestAPIException returns a list of derivate objects- Parameters:
info
- - the injected Jersey URIInfo objectmcrObjID
- - the MyCoRe Object IDformat
- - the output format ('xml'|'json')sort
- - the sort criteria- Returns:
- a Jersey response object
- Throws:
MCRRestAPIException
- See Also:
-
listContents
public static jakarta.ws.rs.core.Response listContents(jakarta.ws.rs.core.UriInfo info, jakarta.ws.rs.core.Application app, jakarta.ws.rs.core.Request request, String mcrObjID, String mcrDerID, String format, String path, int depth) throws MCRRestAPIException lists derivate content (file listing)- Parameters:
info
- - the Jersey UriInfo Objectrequest
- - the HTTPServletRequest objectmcrObjID
- - the MyCoRe Object IDmcrDerID
- - the MyCoRe Derivate IDformat
- - the output format ('xml'|'json')path
- - the sub path of a directory inside the derivatedepth
- - the level of subdirectories to be returned- Returns:
- a Jersey Response object
- Throws:
MCRRestAPIException
-
retrieveMaindocURL
public static String retrieveMaindocURL(jakarta.ws.rs.core.UriInfo info, String mcrObjID, String mcrDerID, jakarta.ws.rs.core.Application app) throws IOException returns the URL of the main document of a derivate- Parameters:
info
- - the Jersey UriInfo objectmcrObjID
- - the MyCoRe Object IDmcrDerID
- - the MyCoRe Derivate ID- Returns:
- the Resolving URL for the main document of the derivate
- Throws:
IOException
-
hasChildren
checks if the given path is a directory and contains children- Parameters:
p
- - the path to check- Returns:
- true, if there are children
-