org.silverpeas.admin.web
Class ComponentResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by org.silverpeas.admin.web.AbstractAdminResource
          extended by org.silverpeas.admin.web.ComponentResource

@Service
@RequestScoped
@Authorized
public class ComponentResource
extends AbstractAdminResource

A REST Web resource giving component data.

Author:
Yohann Chastagnier

Nested Class Summary
 
Nested classes/interfaces inherited from class com.silverpeas.web.RESTWebService
RESTWebService.WebProcess<RETURN_VALUE>, RESTWebService.WebTreatment<RETURN_VALUE>
 
Field Summary
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
ComponentResource()
           
 
Method Summary
 ComponentEntity get()
          Gets the JSON representation of the specified existing ComponentInstLight.
 String getComponentId()
          Gets the identifier of the component instance to which the requested resource belongs to.
 Map<SilverpeasRole,UsersAndGroupsRoleEntity> getUsersAndGroupsRoles(String roles)
          Gets users and groups roles indexed by role names.
 
Methods inherited from class org.silverpeas.admin.web.AbstractAdminResource
asWebEntities, asWebEntities, asWebEntity, asWebEntity, asWebEntity, asWebEntity, asWebPersonalEntities, asWebPersonalEntity, asWebPersonalEntity, asWebPersonalEntity, getAdminPersonalDelegate, getAdminServices, getLookDelegate, isUserAuthorizedToAccessLookContext, loadComponent, loadComponents, loadSpace, loadSpaces, verifyUserAuthorizedToAccessLookContext, verifyUserAuthorizedToAccessSpace
 
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
 

Constructor Detail

ComponentResource

public ComponentResource()
Method Detail

get

public ComponentEntity get()
Gets the JSON representation of the specified existing ComponentInstLight. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If the user isn't authorized to access the component, a 403 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.

Returns:
the response to the HTTP GET request with the JSON representation of the asked ComponentInstLight.

getUsersAndGroupsRoles

public Map<SilverpeasRole,UsersAndGroupsRoleEntity> getUsersAndGroupsRoles(String roles)
Gets users and groups roles indexed by role names. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If the user isn't authorized to access the space, a 403 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.

Parameters:
roles - aimed roles (each one separated by comma). If empty, all roles are returned.
Returns:
the JSON response to the HTTP GET request.

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.


Copyright © 2016 Silverpeas. All Rights Reserved.