Interface FileResource

All Superinterfaces:
AuthenticatedResource

@Path("/file") public interface FileResource extends AuthenticatedResource
Resource for loading and manipulating Files in GCN
Author:
norbert
  • Field Details

  • Method Details

    • list

      @GET FileListResponse list(@BeanParam InFolderParameterBean inFolder, @BeanParam FileListParameterBean fileListParams, @BeanParam FilterParameterBean filterParams, @BeanParam SortParameterBean sortingParams, @BeanParam PagingParameterBean pagingParams, @BeanParam EditableParameterBean editableParams, @BeanParam WastebinParameterBean wastebinParams)
      Get a list of files in the specified folder.
      The result can be filtered by
      • id
      • name
      • description
      • niceUrl
      • alternateUrls
      and sorted by
      • id
      • name
      • niceUrl
      • alternateUrls
      • fileSize
      • fileType
      Parameters:
      inFolder - Folder ID and recursive parameters
      fileListParams - Further file parameters
      filterParams - Filter parameters
      sortingParams - Sorting parameters
      pagingParams - Paging parameters
      editableParams - Editable parameters
      wastebinParams - Wastebin parameters
      Returns:
      A list of files
    • loadContent

      @GET @Path("/content/load/{id}") javax.ws.rs.core.Response loadContent(@PathParam("id") String id, @QueryParam("nodeId") Integer nodeId)
      Load the file with given id
      Parameters:
      id - file id. This can either be the localid or a globalid
      nodeId - id of the node (channel) for which the image shall be loaded (when multichannelling is used).
      Returns:
      response containing file binary data
    • load

      @GET @Path("/load/{id}") FileLoadResponse load(@PathParam("id") String id, @DefaultValue("false") @QueryParam("update") boolean update, @DefaultValue("false") @QueryParam("construct") boolean construct, @QueryParam("nodeId") Integer nodeId, @QueryParam("package") String stagingPackageName)
      Load the file (without data)
      Parameters:
      id - id of the file
      update - true when the file is fetched for updating. Currently, files cannot be locked in the backend, but it is still recommended to set this parameter to true when the file shall be modified.
      construct - if true, the construct information will be added to tags
      nodeId - id of the node (channel) for which the image shall be loaded (when multichannelling is used).
      stagingPackageName - name of a content staging package, to check the file status in it
      Returns:
      response containing the file
    • load

      @POST @Path("/load") MultiFileLoadResponse load(MultiObjectLoadRequest request, @QueryParam("fillWithNulls") @DefaultValue("false") boolean fillWithNulls)
      Load a list of files specified in the given request. File ids for which no files exist, or the user does not have the necessary permissions, are silently ignored.
      Parameters:
      request - The request with he list of file ids to load.
      fillWithNulls - flag to have items, which cannot be loaded returned as "null" objects in the response (instead of just omitting them)
      Returns:
      The list of found files, for which the user has enough permissions.
    • createSimpleMultiPartFallback

      @POST @Path("/createSimple") @Consumes("multipart/form-data") @Produces("application/json") FileUploadResponse createSimpleMultiPartFallback(org.glassfish.jersey.media.multipart.MultiPart multiPart, @Context javax.servlet.http.HttpServletRequest request, @QueryParam("folderId") String folderId, @QueryParam("nodeId") String nodeId, @QueryParam("databodypart") String customBodyPartName, @QueryParam("qqfile") String qqFileUploaderFileName, @QueryParam("description") String description, @QueryParam("overwrite") @DefaultValue("false") boolean overwrite)
      Create a new file handling simple post data
      Parameters:
      multiPart - multipart/form-data request data
      request - request with data for the file to be created
      folderId - Folder ID where to save the file in
      customBodyPartName - Custom name for the file data body part
      qqFileUploaderFileName - Meta data filename
      description - File description
      overwrite - Whether a file with the same name would be overwritten
      Returns:
      response containing the file meta data
    • createSimple

      @POST @Path("/createSimple") @Produces("application/json") FileUploadResponse createSimple(@Context javax.servlet.http.HttpServletRequest request, @QueryParam("folderId") int folderId, @QueryParam("nodeId") @DefaultValue("0") int nodeId, @QueryParam("databodypart") String customBodyPartKeyName, @QueryParam("qqfile") String fileName, @QueryParam("description") String description, @QueryParam("overwrite") @DefaultValue("false") boolean overwrite)
      Create a new file handling simple post data
      Parameters:
      request - request with data for the file to be created
      folderId - Folder ID where to save the file in
      nodeId - Node ID
      customBodyPartKeyName -
      fileName - File name
      description - File description
      overwrite - Whether a file with the same name would be overwritten
      Returns:
      response containing the file meta data
    • create

      @POST @Path("/create") @Consumes("multipart/form-data") @Produces("application/json") FileUploadResponse create(org.glassfish.jersey.media.multipart.MultiPart multiPart)
      Create a new file handling multipart form-data. The data and meta data is encoded within separate body parts.
      Parameters:
      multiPart - request with data for the file to be created
      Returns:
      response containing the file meta data
    • create

      @POST @Path("/create") @Consumes("application/json") @Produces("application/json") FileUploadResponse create(FileCreateRequest request)
      Create a new file with the binary data loaded from a URL
      Parameters:
      request - request
      Returns:
      response containing the file meta data
    • copyFile

      @POST @Path("/copy") FileUploadResponse copyFile(FileCopyRequest request)
      Create a copy of the given file.
      Parameters:
      request -
      Returns:
    • move

      @POST @Path("/move/{id}") GenericResponse move(@PathParam("id") String id, ObjectMoveRequest request)
      Mpve the given file to another folder
      Parameters:
      id - file id
      request - request
      Returns:
      generic response
    • move

      @POST @Path("/move") GenericResponse move(MultiObjectMoveRequest request)
      Move multiple files to another folder
      Parameters:
      request - request
      Returns:
      generic response
    • save

      @POST @Path("/save/{id}") @Produces("application/json") GenericResponse save(@PathParam("id") Integer id, FileSaveRequest request)
      Save the given file
      Parameters:
      request - request with the file to be saved
      Returns:
      generic response
    • save

      @POST @Path("/save/{id}") @Consumes("multipart/form-data") @Produces("application/json") GenericResponse save(@PathParam("id") Integer id, org.glassfish.jersey.media.multipart.MultiPart multiPart)
      Save the posted content into the given file
      Parameters:
      id - id of the file
      multiPart - request with data for the file to be created
      Returns:
      generic response
    • delete

      @POST @Path("/delete/{id}") GenericResponse delete(@PathParam("id") String id, @QueryParam("nodeId") Integer nodeId, @QueryParam("noSync") Boolean noCrSync)
      Delete the file denoted by id
      Parameters:
      id - id of the File to delete
      nodeId - id of the node (channel) of the file
      noCrSync - don't synchronize the deletion with the content repo
      Returns:
      response object
    • deleteFromWastebin

      @POST @Path("/wastebin/delete/{id}") GenericResponse deleteFromWastebin(@PathParam("id") String id, @QueryParam("wait") @DefaultValue("0") long waitMs)
      Remove the file denoted by the given id from the wastebin.
      Parameters:
      id - id of the file to remove from the wastebin. This can either be a local or global id
      waitMs - time in ms for the request to be done in foreground
      Returns:
      response object
    • deleteFromWastebin

      @POST @Path("/wastebin/delete") GenericResponse deleteFromWastebin(IdSetRequest request, @QueryParam("wait") @DefaultValue("0") long waitMs)
      Remove the given files from the wastebin
      Parameters:
      request - request containing the file IDs
      waitMs - time in ms for the request to be done in foreground
      Returns:
      response object
    • restoreFromWastebin

      @POST @Path("/wastebin/restore/{id}") GenericResponse restoreFromWastebin(@PathParam("id") String id, @QueryParam("wait") @DefaultValue("0") long waitMs)
      Restore the given file from the wastebin
      Parameters:
      id - id of the file to restore from the wastebin. This can either be a local or global id
      waitMs - time in ms for the request to be done in foreground
      Returns:
      response object
    • restoreFromWastebin

      @POST @Path("/wastebin/restore") GenericResponse restoreFromWastebin(IdSetRequest request, @QueryParam("wait") @DefaultValue("0") long waitMs)
      Restore the given files from the wastebin
      Parameters:
      request - request containing the file IDs
      waitMs - time in ms for the request to be done in foreground
      Returns:
      response object
    • getPrivileges

      PrivilegesResponse getPrivileges(@PathParam("id") Integer id)
      Get the privileges of the current user on the given file
      Parameters:
      id - id of the file
      Returns:
      privileges response
    • getTotalUsageInfo

      @GET @Path("/usage/total") TotalUsageResponse getTotalUsageInfo(@QueryParam("id") List<Integer> fileId, @QueryParam("nodeId") Integer nodeId)
      Get the total usage information for the given files.
      Parameters:
      nodeId - id of the node
      nodeId - id of the node
      Returns:
      response
    • getFolderUsageInfo

      @GET @Path("/usage/folder") FolderUsageListResponse getFolderUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> fileId, @QueryParam("nodeId") Integer nodeId, @QueryParam("folders") @DefaultValue("true") boolean returnFolders)
      Get the folders using one of the given files.
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      fileId - list of file ids, for which the usage shall be fetched
      nodeId - id of the node
      returnFolders - true (default) if the folders shall be returned, false for only returning the counts
      Returns:
      response
    • getPageUsageInfo

      @GET @Path("/usage/page") PageUsageListResponse getPageUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> fileId, @QueryParam("nodeId") Integer nodeId, @QueryParam("pages") @DefaultValue("true") boolean returnPages, @BeanParam PageModelParameterBean pageModel)
      Get the pages using one of the given files
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      fileId - list of file ids, for which the usage shall be fetched
      nodeId - id of the node
      returnPages - true (default) if the pages shall be returned, false for only returning the counts
      pageModel - page model parameters
      Returns:
      response
    • getTemplateUsageInfo

      @GET @Path("/usage/template") TemplateUsageListResponse getTemplateUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> fileId, @QueryParam("nodeId") Integer nodeId, @QueryParam("templates") @DefaultValue("true") boolean returnTemplates)
      Get the templates using one of the given files
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      fileId - list of file ids, for which the usage shall be fetched
      nodeId - id of the node
      returnTemplates - true (default) if the templates shall be returned, false for only returning the counts
      Returns:
      response
    • getImageUsageInfo

      @GET @Path("/usage/image") FileUsageListResponse getImageUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> fileId, @QueryParam("nodeId") Integer nodeId, @QueryParam("files") @DefaultValue("true") boolean returnImages)
      Get the images using one of the given files
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      fileId - list of file ids, for which the usage shall be fetched
      nodeId - id of the node
      returnImages - true (default) if the files shall be returned, false for only returning the counts
      Returns:
      response
    • getFileUsageInfo

      @GET @Path("/usage/file") FileUsageListResponse getFileUsageInfo(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") String sortBy, @QueryParam("sortorder") @DefaultValue("asc") String sortOrder, @QueryParam("id") List<Integer> fileId, @QueryParam("nodeId") Integer nodeId, @QueryParam("files") @DefaultValue("true") boolean returnFiles)
      Get the files using one of the given files
      Parameters:
      skipCount - number of items to be skipped, set to 0 for skipping no items
      maxItems - maximum number of items to be returned, set to -1 for returning all items
      sortBy - (optional) attribute to sort by. defaults to name
      sortOrder - (optional) result sort order - may be "asc" for ascending or "desc" for descending other strings will be ignored. defaults to "asc".
      fileId - list of file ids, for which the usage shall be fetched
      nodeId - id of the node
      returnFiles - true (default) if the files shall be returned, false for only returning the counts
      Returns:
      response