Package org.silverpeas.core.webapi.admin
Class AbstractAdminResource
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.core.webapi.admin.AbstractAdminResource
-
- All Implemented Interfaces:
ProtectedWebResource
,WebAuthenticationValidation
,WebAuthorizationValidation
,SilverpeasWebResource
- Direct Known Subclasses:
ComponentResource
,ComponentsResource
,SpaceResource
public abstract class AbstractAdminResource extends RESTWebService
Centralizations of admin resource processings- Author:
- Yohann Chastagnier
-
-
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 AbstractAdminResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 AbstractTypeEntity
asWebEntity(Object object)
Converts the component into its corresponding web entity.protected ComponentEntity
asWebEntity(ComponentInstLight component)
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(Collection<T> data)
Converts the given list of data into their corresponding web entities.protected PersonalComponentEntity
asWebPersonalEntity(SilverpeasComponent component)
Converts the personal component into its corresponding web entity.protected PersonalComponentEntity
asWebPersonalEntity(SilverpeasComponentInstance component)
Converts the personal component into its corresponding web entity.protected PersonalToolEntity
asWebPersonalEntity(AbstractTool tool)
Converts the tool into its corresponding web entity.protected AdminPersonalWebDelegate
getAdminPersonalDelegate()
protected AdminWebService
getAdminServices()
protected LookWebDelegate
getLookDelegate()
protected boolean
isUserAuthorizedToAccessLookContext()
Indicates if the requester user is authorized to access the given spaceprotected ComponentInstLight
loadComponent(String componentId)
Loading data centralization of a spaceprotected Collection<ComponentInstLight>
loadComponents(String... componentIds)
Loading data centralization of componentsprotected SpaceInstLight
loadSpace(String spaceId)
Loading data centralization of a spaceprotected Collection<SpaceInstLight>
loadSpaces(String... spaceIds)
Loading data centralization of spacesprotected void
verifyUserAuthorizedToAccessLookContext()
Verifies the requester user is authorized to access the given spaceprotected void
verifyUserAuthorizedToAccessSpace(String spaceId)
Verifies the requester user is authorized to access the given space-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getResourceBasePath, 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.SilverpeasWebResource
getComponentId
-
Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
-
-
-
Method Detail
-
loadSpace
protected SpaceInstLight loadSpace(String spaceId)
Loading data centralization of a space- Parameters:
spaceId
- the space identifier- Returns:
- the space instance light representation
-
loadSpaces
protected Collection<SpaceInstLight> loadSpaces(String... spaceIds)
Loading data centralization of spaces- Parameters:
spaceIds
- the space identifiers- Returns:
- never null collection of spaces
-
loadComponent
protected ComponentInstLight loadComponent(String componentId)
Loading data centralization of a space- Parameters:
componentId
- the component instance identifier- Returns:
-
loadComponents
protected Collection<ComponentInstLight> loadComponents(String... componentIds)
Loading data centralization of components- Parameters:
componentIds
- the component instance identifiers- 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(Collection<T> data)
Converts the given list of data into their corresponding web entities.- Parameters:
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(SilverpeasComponent 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(SilverpeasComponentInstance 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:
object
- any object instance.- Returns:
- the corresponding component entity.
-
getAdminServices
protected AdminWebService getAdminServices()
- Returns:
- the common admin services
-
getAdminPersonalDelegate
protected AdminPersonalWebDelegate getAdminPersonalDelegate()
- Returns:
- the commin admin personal services
-
verifyUserAuthorizedToAccessSpace
protected void verifyUserAuthorizedToAccessSpace(String spaceId)
Verifies the requester user is authorized to access the given space- Parameters:
spaceId
- the space identifier
-
verifyUserAuthorizedToAccessLookContext
protected void verifyUserAuthorizedToAccessLookContext()
Verifies the requester user is authorized to access the given space
-
isUserAuthorizedToAccessLookContext
protected boolean isUserAuthorizedToAccessLookContext()
Indicates if the requester user is authorized to access the given space
-
getLookDelegate
protected LookWebDelegate getLookDelegate()
- Returns:
- the common look services for Web Services
-
-