org.silverpeas.mylinks.web
Class MyLinksResource
java.lang.Object
com.silverpeas.web.RESTWebService
org.silverpeas.mylinks.web.MyLinksResource
@Service
@RequestScoped
@Authorized
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.
Methods inherited from class com.silverpeas.web.RESTWebService |
getBundle, getBundleLocation, getGreaterUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getUriInfo, getUserDetail, getUserPreferences, getUserRoles, process, validateUserAuthentication, validateUserAuthorization |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
organisationController
@Inject
protected OrganisationController organisationController
MyLinksResource
public MyLinksResource()
getMyLinks
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.
getAllUserLinks
protected List<LinkDetail> getAllUserLinks()
- Gets all the links of the current user.
- Returns:
getUserLink
protected LinkDetail getUserLink(String linkId)
- Gets all the links of the current user.
- Returns:
- the
LinkDetail
associated to the given id.
- Throws:
javax.ws.rs.WebApplicationException
- Response.Status.NOT_FOUND
if no link exists with the
given identifier, Response.Status.FORBIDDEN
if the owner of the existing link is not the current
user.
getMyLink
public MyLinkEntity getMyLink(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
public MyLinkEntity addLink(MyLinkEntity newLink)
updateLink
public MyLinkEntity updateLink(MyLinkEntity updatedLink)
deleteLink
public javax.ws.rs.core.Response deleteLink(String linkId)
addSpaceLink
public MyLinkEntity addSpaceLink(String spaceId)
saveUserLinksOrder
public javax.ws.rs.core.Response saveUserLinksOrder(MyLinkPosition linkPosition)
addAppLink
public MyLinkEntity addAppLink(String applicationId)
checkMandatoryLinkData
public static void checkMandatoryLinkData(MyLinkEntity myLink)
getComponentId
public String getComponentId()
- Description copied from class:
RESTWebService
- Gets the identifier of the component instance to which the requested resource belongs to.
- Specified by:
getComponentId
in class RESTWebService
- Returns:
- the identifier of the Silverpeas component instance.
getMyLinksBm
protected MyLinksBm getMyLinksBm()
Copyright © 2016 Silverpeas. All Rights Reserved.