org.silverpeas.mylinks.web
Class MyLinksResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.silverpeas.web.RESTWebService
RESTWebService.WebProcess<RETURN_VALUE>, RESTWebService.WebTreatment<RETURN_VALUE>
 
Field Summary
protected  OrganisationController organisationController
           
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
MyLinksResource()
           
 
Method Summary
 MyLinkEntity addAppLink(String applicationId)
           
 MyLinkEntity addLink(MyLinkEntity newLink)
           
 MyLinkEntity addSpaceLink(String spaceId)
           
static void checkMandatoryLinkData(MyLinkEntity myLink)
           
 javax.ws.rs.core.Response deleteLink(String linkId)
           
protected  List<LinkDetail> getAllUserLinks()
          Gets all the links of the current user.
 String getComponentId()
          Gets the identifier of the component instance to which the requested resource belongs to.
 MyLinkEntity getMyLink(String linkId)
          Gets the JSON representation of the user favorite links.
 List<MyLinkEntity> getMyLinks()
          Gets the JSON representation of the user favorite links.
protected  MyLinksBm getMyLinksBm()
           
protected  LinkDetail getUserLink(String linkId)
          Gets all the links of the current user.
 javax.ws.rs.core.Response saveUserLinksOrder(MyLinkPosition linkPosition)
           
 MyLinkEntity updateLink(MyLinkEntity updatedLink)
           
 
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
 

Field Detail

organisationController

@Inject
protected OrganisationController organisationController
Constructor Detail

MyLinksResource

public MyLinksResource()
Method Detail

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.