Class MyLinksResource
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.core.webapi.mylinks.MyLinksResource
-
- All Implemented Interfaces:
ProtectedWebResource
,WebAuthenticationValidation
,WebAuthorizationValidation
,SilverpeasWebResource
@WebService @Path("mylinks") @Authenticated public class MyLinksResource extends RESTWebService
A REST Web resource representing user favorite links. It is a web service that provides an access to user links referenced by its URL.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService
RESTWebService.WebProcess<R>, RESTWebService.WebTreatment<R>
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.web.rs.RESTWebService
RESPONSE_HEADER_ARRAYSIZE
-
Fields inherited from interface org.silverpeas.core.web.SilverpeasWebResource
BASE_PATH
-
-
Constructor Summary
Constructors Constructor Description MyLinksResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CategoryEntity
addCategory(CategoryEntity newCategory)
MyLinkEntity
addLink(MyLinkEntity newLink)
javax.ws.rs.core.Response
deleteCategory(String catId)
javax.ws.rs.core.Response
deleteLink(String linkId)
List<CategoryEntity>
getAllCategoriesOfUser()
Gets the JSON representation of all user categories of favorite links.CategoryEntity
getCategory(String catId)
Gets the JSON representation of the user category of favorite links.String
getComponentId()
Gets the identifier of the component instance to which the requested resource belongs to.MyLinkEntity
getLink(String linkId)
Gets the JSON representation of the user favorite links.List<MyLinkEntity>
getMyLinks()
Gets the JSON representation of the user favorite links.protected String
getResourceBasePath()
Gets the base path of the web resource relative to the root path of all the web resources in Silverpeas as given bySilverpeasWebResource.getBasePath()
.javax.ws.rs.core.Response
saveUserCategoriesOrder(CategoryPosition categoryPosition)
javax.ws.rs.core.Response
saveUserLinksOrder(MyLinkPosition linkPosition)
CategoryEntity
updateCategory(String catId, CategoryEntity updatedCategory)
MyLinkEntity
updateLink(String linkId, MyLinkEntity updatedLink)
-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource
validateUserAuthorization
-
Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
-
-
-
Method Detail
-
getResourceBasePath
protected String getResourceBasePath()
Description copied from class:RESTWebService
Gets the base path of the web resource relative to the root path of all the web resources in Silverpeas as given bySilverpeasWebResource.getBasePath()
.- Specified by:
getResourceBasePath
in classRESTWebService
- Returns:
- the relative path that identifies this REST web service among all other REST web services.
-
getAllCategoriesOfUser
@GET @Path("categories") @Produces("application/json") public List<CategoryEntity> getAllCategoriesOfUser()
Gets the JSON representation of all user categories of favorite links. Return only categories of the current user.- Returns:
- the response to the HTTP GET request with the JSON representation of all user categories.
-
getCategory
@GET @Path("categories/{catId}") @Produces("application/json") public CategoryEntity getCategory(@PathParam("catId") String catId)
Gets the JSON representation of the user category of favorite links. Return only category of the current user.- Returns:
- the response to the HTTP GET request with the JSON representation of the user categories.
-
addCategory
@POST @Path("categories") @Consumes("application/json") @Produces("application/json") public CategoryEntity addCategory(CategoryEntity newCategory)
-
updateCategory
@PUT @Path("categories/{catId}") @Consumes("application/json") @Produces("application/json") public CategoryEntity updateCategory(@PathParam("catId") String catId, CategoryEntity updatedCategory)
-
deleteCategory
@DELETE @Path("categories/{catId}") @Produces("application/json") public javax.ws.rs.core.Response deleteCategory(@PathParam("catId") String catId)
-
saveUserCategoriesOrder
@POST @Path("categories/saveLinesOrder") @Consumes("application/json") public javax.ws.rs.core.Response saveUserCategoriesOrder(CategoryPosition categoryPosition)
-
getMyLinks
@GET @Produces("application/json") public List<MyLinkEntity> getMyLinks()
Gets the JSON representation of the user favorite links.- Returns:
- the response to the HTTP GET request with the JSON representation of the user links.
-
getLink
@GET @Path("{id}") @Produces("application/json") public MyLinkEntity getLink(@PathParam("id") String linkId)
Gets the JSON representation of the user favorite links. Return only link of the current user.- Returns:
- the response to the HTTP GET request with the JSON representation of the user links.
-
addLink
@POST @Consumes("application/json") @Produces("application/json") public MyLinkEntity addLink(MyLinkEntity newLink)
-
updateLink
@PUT @Path("{linkId}") @Consumes("application/json") @Produces("application/json") public MyLinkEntity updateLink(@PathParam("linkId") String linkId, MyLinkEntity updatedLink)
-
deleteLink
@DELETE @Path("{linkId}") @Produces("application/json") public javax.ws.rs.core.Response deleteLink(@PathParam("linkId") String linkId)
-
saveUserLinksOrder
@POST @Path("saveLinesOrder") @Consumes("application/json") public javax.ws.rs.core.Response saveUserLinksOrder(MyLinkPosition linkPosition)
-
getComponentId
public String getComponentId()
Description copied from interface:SilverpeasWebResource
Gets the identifier of the component instance to which the requested resource belongs to.- Returns:
- the identifier of the Silverpeas component instance.
-
-