Class FolderResource
java.lang.Object
org.silverpeas.core.web.rs.RESTWebService
org.silverpeas.components.kmelia.web.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 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>, org.silverpeas.core.web.rs.RESTWebService.WebTreatment<R> -
Field Summary
Fields inherited from class org.silverpeas.core.web.rs.RESTWebService
RESPONSE_HEADER_ARRAYSIZEFields inherited from interface org.silverpeas.core.web.SilverpeasWebResource
BASE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.silverpeas.core.node.model.NodeDetailcreateFolderInto(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.jakarta.ws.rs.core.ResponsecreateNode(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.List<org.silverpeas.core.webapi.node.NodeEntity> getChildren(String path, String language) Get all children of any node of the application.protected KmeliaServiceorg.silverpeas.core.webapi.node.NodeEntityGet any node of the application and its children.List<org.silverpeas.core.webapi.node.NodeEntity> Get the path of any node of the application, from the root down to that node.protected Stringorg.silverpeas.core.webapi.node.NodeEntityGet the root of the application and its children.org.silverpeas.core.webapi.node.NodeEntitygetTreeview(String path, String language) Get the tree of the folders of the application, expanded down to the given folder.Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getLanguage, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, processMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource
validateUserAuthorizationMethods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
Constructor Details
-
FolderResource
public FolderResource()
-
-
Method Details
-
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 List<org.silverpeas.core.webapi.node.NodeEntity> getPath(@PathParam("path") String path, @QueryParam("lang") String language) Get the path of any node of the application, from the root down to that node.- Returns:
- a list of NodeEntity representing the path of the node
-
getChildren
@GET @Path("{path: \\d+(/\\d+)*}/children") @Produces("application/json") public List<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:
- a list of NodeEntity representing children
-
createNode
@Path("{path: \\d+(/\\d+)*}") @POST @Produces("application/json") @Consumes("application/json") public jakarta.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
ToAddTopicfunction 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 the tree of the folders of the application, expanded down to the given folder.- Returns:
- the root of the application with the branch leading to the given folder expanded
-
getResourceBasePath
- Specified by:
getResourceBasePathin classorg.silverpeas.core.web.rs.RESTWebService
-
getComponentId
-
getKmeliaService
-