Package org.dspace.rest
Class FilteredItemsResource
- java.lang.Object
-
- org.dspace.rest.Resource
-
- org.dspace.rest.FilteredItemsResource
-
@Path("/filtered-items") public class FilteredItemsResource extends Resource
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionService
collectionService
protected ConfigurationService
configurationService
protected ItemService
itemService
protected MetadataFieldService
metadataFieldService
protected MetadataSchemaService
metadataSchemaService
protected SiteService
siteService
-
Fields inherited from class org.dspace.rest.Resource
servletContext
-
-
Constructor Summary
Constructors Constructor Description FilteredItemsResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemFilter
getItemQuery(String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, String filters, List<String> query_field, List<String> query_op, List<String> query_val, List<String> collSel, javax.ws.rs.core.HttpHeaders headers, javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
Return instance of collection with passed id.-
Methods inherited from class org.dspace.rest.Resource
createContext, getActionString, mySplit, processException, processFinally, writeStats
-
-
-
-
Field Detail
-
itemService
protected ItemService itemService
-
metadataFieldService
protected MetadataFieldService metadataFieldService
-
metadataSchemaService
protected MetadataSchemaService metadataSchemaService
-
collectionService
protected CollectionService collectionService
-
siteService
protected SiteService siteService
-
configurationService
protected ConfigurationService configurationService
-
-
Method Detail
-
getItemQuery
@GET @Produces({"application/json","application/xml"}) public ItemFilter getItemQuery(@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("xforwardedfor") String xforwardedfor, @QueryParam("filters") @DefaultValue("is_item,all_filters") String filters, @QueryParam("query_field[]") @DefaultValue("dc.title") List<String> query_field, @QueryParam("query_op[]") @DefaultValue("exists") List<String> query_op, @QueryParam("query_val[]") @DefaultValue("") List<String> query_val, @QueryParam("collSel[]") @DefaultValue("") List<String> collSel, @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:
expand
- String in which is what you want to add to returned instance of collection. Options are: "all", "parentCommunityList", "parentCommunity", "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 collectionquery_field
- List of metadata fields to evaluate in a metadata query. Each list value is used in conjunction with a query_op and query_field.query_op
- List of metadata operators to use in a metadata query. Each list value is used in conjunction with a query_field and query_field.query_val
- List of metadata values to evaluate in a metadata query. Each list value is used in conjunction with a query_value and query_op.collSel
- List of collections to query.headers
- 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.
-
-