org.silverpeas.admin.web
Class AbstractAdminResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by org.silverpeas.admin.web.AbstractAdminResource
Direct Known Subclasses:
ComponentResource, SpaceResource

public abstract class AbstractAdminResource
extends RESTWebService

Centralizations of admin resource processings

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
AbstractAdminResource()
           
 
Method Summary
protected
<T,E extends AbstractTypeEntity>
Collection<E>
asWebEntities(Class<E> entityClass, Collection<T> data)
          Converts the given list of data into their corresponding web entities.
protected
<T,E extends AbstractTypeEntity>
Collection<E>
asWebEntities(Class<E> entityClass, Collection<T> data, boolean forceGettingFavorite)
          Converts the given list of data into their corresponding web entities.
protected  ComponentEntity asWebEntity(ComponentInstLight component)
          Converts the component into its corresponding web entity.
protected  AbstractTypeEntity asWebEntity(Object object)
          Converts the component into its corresponding web entity.
protected  SpaceEntity asWebEntity(SpaceInstLight space, boolean forceGettingFavorite)
          Converts the space into its corresponding web entity.
protected  SpaceAppearanceEntity asWebEntity(SpaceInstLight space, String look, String wallpaper, String css)
          Converts the space appearance into its corresponding web entity.
protected
<T,E extends AbstractTypeEntity>
Collection<E>
asWebPersonalEntities(Class<E> entityClass, Collection<T> data)
          Converts the given list of data into their corresponding web entities.
protected  PersonalToolEntity asWebPersonalEntity(AbstractTool tool)
          Converts the tool into its corresponding web entity.
protected  PersonalComponentEntity asWebPersonalEntity(ComponentInst component)
          Converts the personal component into its corresponding web entity.
protected  PersonalComponentEntity asWebPersonalEntity(WAComponent component)
          Converts the personal component into its corresponding web entity.
protected  AdminPersonalWebDelegate getAdminPersonalDelegate()
          Gets the commin admin personal services
protected  AdminWebService getAdminServices()
          Gets the common admin services
protected  LookWebDelegate getLookDelegate()
          Gets the common look services for Web Services
protected  boolean isUserAuthorizedToAccessLookContext()
          Indicates if the requester user is authorized to access the given space
protected  ComponentInstLight loadComponent(String componentId)
          Loading data centralization of a space
protected  Collection<ComponentInstLight> loadComponents(String... componentIds)
          Loading data centralization of components
protected  SpaceInstLight loadSpace(String spaceId)
          Loading data centralization of a space
protected  Collection<SpaceInstLight> loadSpaces(String... spaceIds)
          Loading data centralization of spaces
protected  void verifyUserAuthorizedToAccessLookContext()
          Verifies the requester user is authorized to access the given space
protected  void verifyUserAuthorizedToAccessSpace(String spaceId)
          Verifies the requester user is authorized to access the given space
 
Methods inherited from class com.silverpeas.web.RESTWebService
getBundle, getBundleLocation, getComponentId, 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

AbstractAdminResource

public AbstractAdminResource()
Method Detail

loadSpace

protected SpaceInstLight loadSpace(String spaceId)
Loading data centralization of a space

Parameters:
spaceId -
Returns:

loadSpaces

protected Collection<SpaceInstLight> loadSpaces(String... spaceIds)
Loading data centralization of spaces

Parameters:
spaceIds -
Returns:
never null collection of spaces

loadComponent

protected ComponentInstLight loadComponent(String componentId)
Loading data centralization of a space

Parameters:
componentId -
Returns:

loadComponents

protected Collection<ComponentInstLight> loadComponents(String... componentIds)
Loading data centralization of components

Parameters:
componentIds -
Returns:
never null collection of components

asWebEntities

protected <T,E extends AbstractTypeEntity> Collection<E> asWebEntities(Class<E> entityClass,
                                                                       Collection<T> data)
Converts the given list of data into their corresponding web entities.

Parameters:
entityClass - the entity class returned.
data - data to convert.
Returns:
an array with the corresponding web entities.

asWebEntities

protected <T,E extends AbstractTypeEntity> Collection<E> asWebEntities(Class<E> entityClass,
                                                                       Collection<T> data,
                                                                       boolean forceGettingFavorite)
Converts the given list of data into their corresponding web entities.

Parameters:
entityClass - the entity class returned.
data - data to convert.
forceGettingFavorite - forcing the user favorite space search even if the favorite feature is disabled
Returns:
an array with the corresponding web entities.

asWebPersonalEntities

protected <T,E extends AbstractTypeEntity> Collection<E> asWebPersonalEntities(Class<E> entityClass,
                                                                               Collection<T> data)
Converts the given list of data into their corresponding web entities.

Parameters:
entityClass - the entity class returned.
data - data to convert.
Returns:
an array with the corresponding web entities.

asWebEntity

protected SpaceEntity asWebEntity(SpaceInstLight space,
                                  boolean forceGettingFavorite)
Converts the space into its corresponding web entity.

Parameters:
space - the space to convert.
forceGettingFavorite - forcing the user favorite space search even if the favorite
Returns:
the corresponding space entity.

asWebEntity

protected SpaceAppearanceEntity asWebEntity(SpaceInstLight space,
                                            String look,
                                            String wallpaper,
                                            String css)
Converts the space appearance into its corresponding web entity.

Parameters:
space - the aimed space appearance to convert.
look - the look associated to the given space.
wallpaper - the wallpaper associated to the given space.
Returns:
the corresponding space appearance entity.

asWebEntity

protected ComponentEntity asWebEntity(ComponentInstLight component)
Converts the component into its corresponding web entity.

Parameters:
component - the component to convert.
Returns:
the corresponding component entity.

asWebPersonalEntity

protected PersonalComponentEntity asWebPersonalEntity(WAComponent component)
Converts the personal component into its corresponding web entity.

Parameters:
component - the personal component to convert.
Returns:
the corresponding personal component entity.

asWebPersonalEntity

protected PersonalComponentEntity asWebPersonalEntity(ComponentInst component)
Converts the personal component into its corresponding web entity.

Parameters:
component - the personal component to convert.
Returns:
the corresponding personal component entity.

asWebPersonalEntity

protected PersonalToolEntity asWebPersonalEntity(AbstractTool tool)
Converts the tool into its corresponding web entity.

Parameters:
tool - the tool to convert.
Returns:
the corresponding tool entity.

asWebEntity

protected AbstractTypeEntity asWebEntity(Object object)
Converts the component into its corresponding web entity.

Parameters:
component - the component to convert.
Returns:
the corresponding component entity.

getAdminServices

protected AdminWebService getAdminServices()
Gets the common admin services

Returns:

getAdminPersonalDelegate

protected AdminPersonalWebDelegate getAdminPersonalDelegate()
Gets the commin admin personal services

Returns:

verifyUserAuthorizedToAccessSpace

protected void verifyUserAuthorizedToAccessSpace(String spaceId)
Verifies the requester user is authorized to access the given space

Parameters:
spaceId -

verifyUserAuthorizedToAccessLookContext

protected void verifyUserAuthorizedToAccessLookContext()
Verifies the requester user is authorized to access the given space

Parameters:
spaceId -

isUserAuthorizedToAccessLookContext

protected boolean isUserAuthorizedToAccessLookContext()
Indicates if the requester user is authorized to access the given space

Parameters:
spaceId -

getLookDelegate

protected LookWebDelegate getLookDelegate()
Gets the common look services for Web Services

Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.