Interface ImageResource


@Path("/image") public interface ImageResource
Resource for loading and manipulating Images in GCN
Author:
norbert
  • Method Details

    • list

      @GET ImageListResponse list(@BeanParam InFolderParameterBean inFolder, @BeanParam FileListParameterBean fileListParams, @BeanParam FilterParameterBean filterParams, @BeanParam SortParameterBean sortingParams, @BeanParam PagingParameterBean pagingParams, @BeanParam EditableParameterBean editableParams, @BeanParam WastebinParameterBean wastebinParams) throws Exception
      Get a list of images 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 images
      Throws:
      Exception
    • load

      @GET @Path("/load/{id}") ImageLoadResponse 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) throws Exception
      Load the image with given id
      Parameters:
      id - image id. This can either be a local or globalid
      update - true when the image is fetched for updating. Currently, images cannot be locked in the backend, but it is still recommended to set this parameter to true when the image 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 image status in it
      Returns:
      response containing the image meta data
      Throws:
      Exception
    • load

      @POST @Path("/load") MultiImageLoadResponse load(MultiObjectLoadRequest request, @QueryParam("fillWithNulls") @DefaultValue("false") boolean fillWithNulls) throws Exception
      Load a list of images specified in the given request. Image ids for which no images exist, or the user does not have the necessary permissions, are silently ignored.
      Parameters:
      request - The request with he list of image 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 images, for which the user has enough permissions.
      Throws:
      Exception
    • resize

      @POST @Path("/resize/") FileUploadResponse resize(ImageResizeRequest imageResizeRequest) throws Exception
      Rotate by 90° (optionally), crop (optionally) and resize an image (in this order).
      Parameters:
      imageResizeRequest - resize request
      Returns:
      response
      Throws:
      Exception
    • rotate

      @POST @Path("/rotate") ImageLoadResponse rotate(ImageRotateRequest request) throws Exception
      Rotate an image by 90°
      Parameters:
      request - rotate request
      Returns:
      response
      Throws:
      Exception
    • create

      Create a new image
      Parameters:
      request - request with data for the image to be created
      Returns:
      response containing the image meta data
      Throws:
      Exception
    • move

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

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

      @POST @Path("/save/{id}") GenericResponse save(@PathParam("id") Integer id, ImageSaveRequest request) throws Exception
      Save the given image
      Parameters:
      request - request with the image to be saved
      Returns:
      generic response
      Throws:
      Exception
    • delete

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

      @POST @Path("/wastebin/delete/{id}") GenericResponse deleteFromWastebin(@PathParam("id") String id, @QueryParam("wait") @DefaultValue("0") long waitMs) throws Exception
      Remove the image denoted by the given id from the wastebin.
      Parameters:
      id - id of the image 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
      Throws:
      Exception
    • deleteFromWastebin

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

      @POST @Path("/wastebin/restore/{id}") GenericResponse restoreFromWastebin(@PathParam("id") String id, @QueryParam("wait") @DefaultValue("0") long waitMs) throws Exception
      Restore the given image from the wastebin
      Parameters:
      id - id of the image 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
      Throws:
      Exception
    • restoreFromWastebin

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

      PrivilegesResponse getPrivileges(@PathParam("id") Integer id) throws Exception
      Get the privileges of the current user on the given image
      Parameters:
      id - id of the image
      Returns:
      privileges response
      Throws:
      Exception
    • getTotalFileUsageInfo

      @GET @Path("/usage/total") TotalUsageResponse getTotalFileUsageInfo(@QueryParam("id") List<Integer> imageId, @QueryParam("nodeId") Integer nodeId) throws Exception
      Get the total usage info for the given images.
      Parameters:
      imageId - list of image ids, for which the usage shall be fetched
      nodeId - id of the node
      Returns:
      Response which contains the total usage info
      Throws:
      Exception
    • 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> imageId, @QueryParam("nodeId") Integer nodeId, @QueryParam("folders") @DefaultValue("true") boolean returnFolders) throws Exception
      Get the folders using one of the given images.
      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".
      imageId - list of image 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
      Throws:
      Exception
    • 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> imageId, @QueryParam("nodeId") Integer nodeId, @QueryParam("pages") @DefaultValue("true") boolean returnPages, @BeanParam PageModelParameterBean pageModel) throws Exception
      Get the pages using one of the given images
      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".
      imageId - list of image 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
      Throws:
      Exception
    • 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> imageId, @QueryParam("nodeId") Integer nodeId, @QueryParam("templates") @DefaultValue("true") boolean returnTemplates) throws Exception
      Get the templates using one of the given images
      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".
      imageId - list of image 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
      Throws:
      Exception
    • 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> imageId, @QueryParam("nodeId") Integer nodeId, @QueryParam("images") @DefaultValue("true") boolean returnImages) throws Exception
      Get the images using one of the given images
      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".
      imageId - list of image ids, for which the usage shall be fetched
      nodeId - id of the node
      returnImages - true (default) if the images shall be returned, false for only returning the counts
      Returns:
      response
      Throws:
      Exception
    • 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> imageId, @QueryParam("nodeId") Integer nodeId, @QueryParam("files") @DefaultValue("true") boolean returnFiles) throws Exception
      Get the files using one of the given images
      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".
      imageId - list of image 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
      Throws:
      Exception