Class FolderResource

  • All Implemented Interfaces:
    org.silverpeas.core.web.rs.ProtectedWebResource, org.silverpeas.core.web.rs.WebAuthenticationValidation, org.silverpeas.core.web.rs.WebAuthorizationValidation, org.silverpeas.core.web.SilverpeasWebResource

    @WebService
    @Authorized
    @Path("folders/{componentId}")
    public class FolderResource
    extends org.silverpeas.core.web.rs.RESTWebService
    A REST Web resource representing a given node. It is a web service that provides an access to a node referenced by its URL.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService

        org.silverpeas.core.web.rs.RESTWebService.WebProcess<R extends Object>, org.silverpeas.core.web.rs.RESTWebService.WebTreatment<R extends Object>
    • 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
      FolderResource()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.silverpeas.core.node.model.NodeDetail createFolderInto​(org.silverpeas.core.node.model.NodePK parentPK, org.silverpeas.core.webapi.node.NodeEntity nodeEntity)
      Creates a new folder as a child of the specified parent folder, on behalf of the user behind the current request.
      javax.ws.rs.core.Response createNode​(String path, org.silverpeas.core.webapi.node.NodeEntity nodeEntity)
      Creates a node corresponding to the given node entity and whose parent matches the specified path.
      org.silverpeas.core.webapi.node.NodeEntity[] getChildren​(String path, String language)
      Get all children of any node of the application.
      String getComponentId()  
      protected KmeliaService getKmeliaService()  
      org.silverpeas.core.webapi.node.NodeEntity getNode​(String path, String language)
      Get any node of the application and its children.
      org.silverpeas.core.webapi.node.NodeEntity[] getPath​(String path, String language)
      Get all children of any node of the application.
      protected String getResourceBasePath()  
      org.silverpeas.core.webapi.node.NodeEntity getRoot​(String language)
      Get the root of the application and its children.
      org.silverpeas.core.webapi.node.NodeEntity getTreeview​(String path, String language)
      Get all children of any node of the application.
      • Methods inherited from class org.silverpeas.core.web.rs.RESTWebService

        createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process
      • Methods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource

        validateUserAuthorization
      • Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation

        validateUserAuthentication
    • Constructor Detail

      • FolderResource

        public FolderResource()
    • Method Detail

      • getRoot

        @GET
        @Produces("application/json")
        public org.silverpeas.core.webapi.node.NodeEntity getRoot​(@QueryParam("lang")
                                                                  String language)
        Get the root of the application and its children.
        Returns:
        the application root and its children
      • getNode

        @GET
        @Path("{path: \\d+(/\\d+)*}")
        @Produces("application/json")
        public org.silverpeas.core.webapi.node.NodeEntity getNode​(@PathParam("path")
                                                                  String path,
                                                                  @QueryParam("lang")
                                                                  String language)
        Get any node of the application and its children.
        Returns:
        NodeEntity representing asking node
      • getPath

        @GET
        @Path("{path: \\d+(/\\d+)*/path}")
        @Produces("application/json")
        public org.silverpeas.core.webapi.node.NodeEntity[] getPath​(@PathParam("path")
                                                                    String path,
                                                                    @QueryParam("lang")
                                                                    String language)
        Get all children of any node of the application.
        Returns:
        an array of NodeEntity representing children
      • getChildren

        @GET
        @Path("{path: \\d+(/\\d+)*/children}")
        @Produces("application/json")
        public org.silverpeas.core.webapi.node.NodeEntity[] getChildren​(@PathParam("path")
                                                                        String path,
                                                                        @QueryParam("lang")
                                                                        String language)
        Get all children of any node of the application.
        Returns:
        an array of NodeEntity representing children
      • createNode

        @Path("{path: \\d+(/\\d+)*}")
        @POST
        @Produces("application/json")
        @Consumes("application/json")
        public javax.ws.rs.core.Response createNode​(@PathParam("path")
                                                    String path,
                                                    org.silverpeas.core.webapi.node.NodeEntity nodeEntity)
        Creates a node corresponding to the given node entity and whose parent matches the specified path.
        Parameters:
        path - The path of the parent node.
        nodeEntity - The description of the node to create.
        Returns:
        a response containing the entity describing the newly created node.
      • createFolderInto

        protected org.silverpeas.core.node.model.NodeDetail createFolderInto​(org.silverpeas.core.node.model.NodePK parentPK,
                                                                             org.silverpeas.core.webapi.node.NodeEntity nodeEntity)
        Creates a new folder as a child of the specified parent folder, on behalf of the user behind the current request.

        Only a folder administrator is allowed to create a sub-folder, as it is already required for the creation through the web navigation (see the ToAddTopic function of the request router). The creator of the folder is always the requester: any creator identifier carried by the given entity is ignored so that a user cannot usurp the identity of another one.

        Parameters:
        parentPK - the identifier of the parent folder into which the folder has to be created.
        nodeEntity - the description of the folder to create.
        Returns:
        the detail of the newly created folder.
      • getTreeview

        @GET
        @Path("{path: \\d+/treeview}")
        @Produces("application/json")
        public org.silverpeas.core.webapi.node.NodeEntity getTreeview​(@PathParam("path")
                                                                      String path,
                                                                      @QueryParam("lang")
                                                                      String language)
        Get all children of any node of the application.
        Returns:
        an array of NodeEntity representing children
      • getResourceBasePath

        protected String getResourceBasePath()
        Specified by:
        getResourceBasePath in class org.silverpeas.core.web.rs.RESTWebService
      • getComponentId

        public String getComponentId()