Class AbstractAdminResource

    • Constructor Detail

      • AbstractAdminResource

        public AbstractAdminResource()
    • Method Detail

      • loadSpace

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

        When calling this method to load space data, it is considered that verifyUserAuthorizedToAccessSpace(String) method has been called in order to verify user right access about the space.

        Parameters:
        spaceId - the space identifier.
        Returns:
        the space instance light representation.
      • loadSpaces

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

        When calling this method, the caller is loading massively space data. In a such context, the loading data are verified concerning the user authorizations.

        Parameters:
        spaceIds - the space identifiers.
        Returns:
        stream of SpaceInstLight instance.
      • loadComponent

        protected ComponentInstLight loadComponent​(String componentId)
        Loading data centralization of a component instance.

        When calling this method to load component instance data, it is considered that validateUserAuthorization(UserPrivilegeValidation) method has been called in order to verify user right access about the component instance (cf. Authorized class annotation).

        Parameters:
        componentId - the component instance identifier
        Returns:
        an instance of ComponentInstLight if any, null otherwise.
      • loadComponents

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

        When calling this method, the caller is loading massively component data. In a such context, the loading data are verified concerning the user authorizations.

        Parameters:
        componentIds - the component instance identifiers.
        Returns:
        stream of ComponentInstLight instance.
      • asWebEntities

        protected <T,​E extends AbstractTypeEntityCollection<E> asWebEntities​(Stream<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.
      • asWebEntities

        protected <T,​E extends AbstractTypeEntityCollection<E> asWebEntities​(Stream<T> data,
                                                                                     boolean forceGettingFavorite)
        Converts the given list of data into their corresponding web entities.
        Parameters:
        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 AbstractTypeEntityCollection<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.
      • 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
      • validateUserAuthorization

        public void validateUserAuthorization​(UserPrivilegeValidation validation)
        Description copied from interface: ProtectedWebResource
        Validates the authorization of the user to request this web service. For doing, the user must have the rights to access the component instance that manages this web resource. If no such component instance exists, a Not Found HTTP error is thrown (status code 404). Otherwise the validation is delegated to the validation service by passing it the required information.

        This method should be invoked for web service requiring an authorized access. For doing, the authentication of the user must be first valdiated. Otherwise, the annotation Authorized can be also used instead at class level for both authentication and authorization.

        Parameters:
        validation - the validation instance to use.
        See Also:
        UserPrivilegeValidator
      • 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