public class CommunitiesResource extends Resource
servletContext
Constructor and Description |
---|
CommunitiesResource() |
Modifier and Type | Method and Description |
---|---|
Collection |
addCommunityCollection(Integer communityId,
Collection collection,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Create collection in community.
|
Community |
addCommunityCommunity(Integer communityId,
Community community,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Create subcommunity in community.
|
Community |
createCommunity(Community community,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Create community at top level.
|
javax.ws.rs.core.Response |
deleteCommunity(Integer communityId,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Delete community from DSpace.
|
javax.ws.rs.core.Response |
deleteCommunityCollection(Integer communityId,
Integer collectionId,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Delete collection in community.
|
javax.ws.rs.core.Response |
deleteCommunityCommunity(Integer parentCommunityId,
Integer subcommunityId,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Delete subcommunity in community.
|
Community[] |
getCommunities(String expand,
Integer limit,
Integer offset,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Return all communities in DSpace.
|
Community |
getCommunity(Integer communityId,
String expand,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Returns community with basic properties.
|
Collection[] |
getCommunityCollections(Integer communityId,
String expand,
Integer limit,
Integer offset,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Return all collections of community.
|
Community[] |
getCommunityCommunities(Integer communityId,
String expand,
Integer limit,
Integer offset,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Return all subcommunities of community.
|
Community[] |
getTopCommunities(String expand,
Integer limit,
Integer offset,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Return all top communities in DSpace.
|
javax.ws.rs.core.Response |
updateCommunity(Integer communityId,
Community community,
String user_ip,
String user_agent,
String xforwardedfor,
javax.ws.rs.core.HttpHeaders headers,
javax.servlet.http.HttpServletRequest request)
Update community.
|
createContext, getActionString, getServletContextPath, getToken, getUser, mySplit, processException, processFinally, writeStats
public Community getCommunity(Integer communityId, String expand, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.expand
- String in which is what you want to add to returned instance
of community. Options are: "all", "parentCommunity",
"collections", "subCommunities" and "logo". If you want to use
multiple options, it must be separated by commas.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is throw when was problem with creating context or problem
with database reading. Also if id of community is incorrect
or logged user into context has no permission to read.public Community[] getCommunities(String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
expand
- String in which is what you want to add to returned instance
of community. Options are: "all", "parentCommunity",
"collections", "subCommunities" and "logo". If you want to use
multiple options, it must be separated by commas.limit
- Maximum communities in array. Default value is 100.offset
- Index from which will start array of communities.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It can be caused by creating context or while was problem
with reading community from database(SQLException).public Community[] getTopCommunities(String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
expand
- String in which is what you want to add to returned instance
of community. Options are: "all", "parentCommunity",
"collections", "subCommunities" and "logo". If you want to use
multiple options, it must be separated by commas.limit
- Maximum communities in array. Default value is 100.offset
- Index from which will start array of communities. Default
value is 0.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It can be caused by creating context or while was problem
with reading community from database(SQLException).public Collection[] getCommunityCollections(Integer communityId, String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.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
- Maximum collection in array. Default value is 100.offset
- Index from which will start array of collections. Default
value is 0.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It can be caused by creating context or while was problem
with reading community from database(SQLException).public Community[] getCommunityCommunities(Integer communityId, String expand, Integer limit, Integer offset, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.expand
- String in which is what you want to add to returned instance
of community. Options are: "all", "parentCommunity",
"collections", "subCommunities" and "logo". If you want to use
multiple options, it must be separated by commas.limit
- Maximum communities in array. Default value is 20.offset
- Index from which will start array of communities. Default
value is 0.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It can be caused by creating context or while was problem
with reading community from database(SQLException).public Community createCommunity(Community community, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
community
- Community which will be created at top level of communities.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It can be thrown by SQLException, AuthorizeException and
ContextException.public Collection addCommunityCollection(Integer communityId, Collection collection, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.collection
- Collection which will be added into community.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is thrown when was problem with database reading or
writing. Or problem with authorization to community. Or
problem with creating context.public Community addCommunityCommunity(Integer communityId, Community community, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace, in which will be created
subcommunity.community
- Community which will be added into community.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is thrown when was problem with database reading or
writing. Or problem with authorization to community. Or
problem with creating context.public javax.ws.rs.core.Response updateCommunity(Integer communityId, Community community, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.community
- Instance of community which will replace actual community in
DSpace.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is throw when was problem with creating context or problem
with database reading or writing. Or problem with writing to
community caused by authorization.public javax.ws.rs.core.Response deleteCommunity(Integer communityId, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is throw when was problem with creating context or problem
with database reading or deleting. Or problem with deleting
community caused by IOException or authorization.public javax.ws.rs.core.Response deleteCommunityCollection(Integer communityId, Integer collectionId, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
communityId
- Id of community in DSpace.collectionId
- Id of collection which will be deleted.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is throw when was problem with creating context or problem
with database reading or deleting. Or problem with deleting
collection caused by IOException or authorization.public javax.ws.rs.core.Response deleteCommunityCommunity(Integer parentCommunityId, Integer subcommunityId, String user_ip, String user_agent, String xforwardedfor, @Context javax.ws.rs.core.HttpHeaders headers, @Context javax.servlet.http.HttpServletRequest request) throws javax.ws.rs.WebApplicationException
parentCommunityId
- Id of community in DSpace.subcommunityId
- Id of community which will be deleted.headers
- If you want to access to community under logged user into
context. In headers must be set header "rest-dspace-token"
with passed token from login method.javax.ws.rs.WebApplicationException
- It is throw when was problem with creating context or problem
with database reading or deleting. Or problem with deleting
subcommunity caused by IOException or authorization.Copyright © 2015 DuraSpace. All Rights Reserved.