Class SpaceResource

    • Constructor Detail

      • SpaceResource

        public SpaceResource()
    • Method Detail

      • getAll

        @GET
        @Produces("application/json")
        public Collection<SpaceEntity> getAll​(@QueryParam("forceGettingFavorite")
                                              boolean forceGettingFavorite)
        Gets the JSON representation of root spaces. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        forceGettingFavorite - forcing the user favorite space search even if the favorite feature is disabled.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • get

        @GET
        @Path("{spaceId}")
        @Produces("application/json")
        public SpaceEntity get​(@PathParam("spaceId")
                               String spaceId,
                               @QueryParam("forceGettingFavorite")
                               boolean forceGettingFavorite)
        Gets the JSON representation of the given existing space. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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:
        spaceId - the id of space to process.
        forceGettingFavorite - forcing the user favorite space search even if the favorite feature is disabled.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • getUsersAndGroupsRoles

        @GET
        @Path("{spaceId}/usersAndGroupsRoles")
        @Produces("application/json")
        public Map<SilverpeasRole,​UsersAndGroupsRoleEntity> getUsersAndGroupsRoles​(@PathParam("spaceId")
                                                                                         String spaceId,
                                                                                         @QueryParam("roles")
                                                                                         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 authenticated, 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:
        spaceId - the id of space to process.
        roles - aimed roles (each one separated by comma). If empty, all roles are returned.
        Returns:
        the JSON response to the HTTP GET request.
      • update

        @PUT
        @Path("{spaceId}")
        @Produces("application/json")
        @Consumes("application/json")
        public SpaceEntity update​(@PathParam("spaceId")
                                  String spaceId,
                                  SpaceEntity spaceEntity)
        Updates the space data from its JSON representation and returns it once updated. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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:
        spaceId - the id of space to process.
        spaceEntity - space entity to update.
        Returns:
        the response to the HTTP PUT request with the JSON representation of the updated space.
      • getSpaces

        @GET
        @Path("{spaceId}/spaces")
        @Produces("application/json")
        public Collection<SpaceEntity> getSpaces​(@PathParam("spaceId")
                                                 String spaceId,
                                                 @QueryParam("forceGettingFavorite")
                                                 boolean forceGettingFavorite)
        Gets the JSON representation of spaces of the given existing space. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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:
        spaceId - the id of space to process.
        forceGettingFavorite - forcing the user favorite space search even if the favorite
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • getComponents

        @GET
        @Path("{spaceId}/components")
        @Produces("application/json")
        public Collection<ComponentEntity> getComponents​(@PathParam("spaceId")
                                                         String spaceId)
        Gets the JSON representation of components of the given existing space. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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:
        spaceId - the id of space to process.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • getContent

        @GET
        @Path("{spaceId}/content")
        @Produces("application/json")
        public javax.ws.rs.core.Response getContent​(@PathParam("spaceId")
                                                    String spaceId,
                                                    @QueryParam("forceGettingFavorite")
                                                    boolean forceGettingFavorite)
        Gets the JSON representation of content of the given existing space. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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:
        spaceId - the id of space to process.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • getAppearance

        @GET
        @Path("{spaceId}/appearance")
        @Produces("application/json")
        public SpaceAppearanceEntity getAppearance​(@PathParam("spaceId")
                                                   String spaceId)
        Gets the JSON representation of the given existing space. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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:
        spaceId - the id of space to process.
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • getPersonals

        @GET
        @Path("personal")
        @Produces("application/json")
        public javax.ws.rs.core.Response getPersonals​(@QueryParam("getNotUsedComponents")
                                                      boolean getNotUsedComponents,
                                                      @QueryParam("getUsedComponents")
                                                      boolean getUsedComponents,
                                                      @QueryParam("getUsedTools")
                                                      boolean getUsedTools)
        Gets the JSON representation of the content of user's personal space. When all query parameters are set at false then the service understands that it has to return all personal entities. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        getNotUsedComponents - boolean indicating if the not used components are concerned
        getUsedComponents - boolean indicating if the used components are concerned
        getUsedTools - a boolean indicating if the used tools are concerned
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space
      • useComponent

        @PUT
        @Path("personal/{componentName}")
        @Produces("application/json")
        public PersonalComponentEntity useComponent​(@PathParam("componentName")
                                                    String componentName)
        Instantiates the requested component in the user's personal space. It returns the JSON representation of the instantiated component. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        componentName - the name of component to add in the user's personal space
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • discardComponent

        @DELETE
        @Path("personal/{componentName}")
        @Produces("application/json")
        public PersonalComponentEntity discardComponent​(@PathParam("componentName")
                                                        String componentName)
        Removes from the user's personal space the instantiation of the requested component. It returns the JSON representation of WAComponent. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.
        Parameters:
        componentName - the name of component to add in the user's personal space
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked space.
      • getComponentId

        public String getComponentId()
        Description copied from interface: SilverpeasWebResource
        Gets the identifier of the component instance to which the requested resource belongs to.
        Returns:
        the identifier of the Silverpeas component instance.