Package org.dspace.rest
Class FilteredCollectionsResource
- java.lang.Object
-
- org.dspace.rest.Resource
-
- org.dspace.rest.FilteredCollectionsResource
-
@Path("/filtered-collections") public class FilteredCollectionsResource extends Resource
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeService
authorizeService
protected CollectionService
collectionService
protected ConfigurationService
configurationService
-
Fields inherited from class org.dspace.rest.Resource
servletContext
-
-
Constructor Summary
Constructors Constructor Description FilteredCollectionsResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilteredCollection
getCollection(String collection_id, String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, String filters, javax.ws.rs.core.HttpHeaders headers, javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
Return instance of collection with passed id.FilteredCollection[]
getCollections(String expand, Integer limit, Integer offset, String user_ip, String user_agent, String filters, String xforwardedfor, javax.servlet.ServletContext servletContext, javax.ws.rs.core.HttpHeaders headers, javax.servlet.http.HttpServletRequest request)
Return array of all collections in DSpace.-
Methods inherited from class org.dspace.rest.Resource
createContext, getActionString, mySplit, processException, processFinally, writeStats
-
-
-
-
Field Detail
-
authorizeService
protected AuthorizeService authorizeService
-
collectionService
protected CollectionService collectionService
-
configurationService
protected ConfigurationService configurationService
-
-
Method Detail
-
getCollections
@GET @Produces({"application/json","application/xml"}) public FilteredCollection[] getCollections(@QueryParam("expand") String expand, @QueryParam("limit") @DefaultValue("100") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("filters") @DefaultValue("is_item") String filters, @QueryParam("xforwardedfor") String xforwardedfor, @Context javax.servlet.ServletContext servletContext, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
Return array of all collections in DSpace. You can add more properties through expand parameter.- Parameters:
expand
- String in which is what you want to add to returned instance of collection. Options are: "all", "parentCommunityList", "parentCommunity", "topCommunity", "items", "license" and "logo". If you want to use multiple options, it must be separated by commas.limit
- Limit value for items in list in collection. Default value is 100.offset
- Offset of start index in list of items of collection. Default value is 0.user_ip
- User's IP address.user_agent
- User agent string (specifies browser used and its version).filters
- Comma separated list of Item Filters to use to evaluate against the items in a collectionxforwardedfor
- When accessed via a reverse proxy, the application sees the proxy's IP as the source of the request. The proxy may be configured to add the "X-Forwarded-For" HTTP header containing the original IP of the client so that the reverse-proxied application can get the client's IP.servletContext
- Context of the servlet container.headers
- If you want to access the collections as the user logged into the context. The value of the "rest-dspace-token" header must be set to the token received from the login method response.request
- Servlet's HTTP request object.- Returns:
- Return array of collection, on which has logged user permission to view.
- Throws:
javax.ws.rs.WebApplicationException
- It is thrown when was problem with database reading (SQLException) or problem with creating context(ContextException).
-
getCollection
@GET @Path("/{collection_id}") @Produces({"application/json","application/xml"}) public FilteredCollection getCollection(@PathParam("collection_id") String collection_id, @QueryParam("expand") String expand, @QueryParam("limit") @DefaultValue("1000") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwardedfor") String xforwardedfor, @QueryParam("filters") @DefaultValue("is_item") String filters, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request, @Context javax.servlet.ServletContext servletContext)
Return instance of collection with passed id. You can add more properties through expand parameter.- Parameters:
collection_id
- Id of collection in DSpace.expand
- String in which is what you want to add to returned instance of collection. Options are: "all", "parentCommunityList", "parentCommunity", "topCommunity", "items", "license" and "logo". If you want to use multiple options, it must be separated by commas.limit
- Limit value for items in list in collection. Default value is 100.offset
- Offset of start index in list of items of collection. Default value is 0.user_ip
- User's IP address.user_agent
- User agent string (specifies browser used and its version).xforwardedfor
- When accessed via a reverse proxy, the application sees the proxy's IP as the source of the request. The proxy may be configured to add the "X-Forwarded-For" HTTP header containing the original IP of the client so that the reverse-proxied application can get the client's IP.filters
- Comma separated list of Item Filters to use to evaluate against the items in a collectionheaders
- If you want to access the collection as the user logged into the context. The value of the "rest-dspace-token" header must be set to the token received from the login method response.request
- Servlet's HTTP request object.servletContext
- Context of the servlet container.- Returns:
- Return instance of collection. It can also return status code NOT_FOUND(404) if id of collection is incorrect or status code UNATHORIZED(401) if user has no permission to read collection.
- Throws:
javax.ws.rs.WebApplicationException
- It is thrown when was problem with database reading (SQLException) or problem with creating context(ContextException). It is thrown by NOT_FOUND and UNATHORIZED status codes, too.
-
-