com.gentics.contentnode.rest.resource
Interface ImageResource

All Superinterfaces:
AuthenticatedResource

public interface ImageResource
extends AuthenticatedResource

Resource for loading and manipulating Images in GCN

Author:
norbert

Method Summary
 ImageLoadResponse create(ImageCreateRequest request)
          Create a new image
 GenericResponse delete(Integer id, Integer nodeId)
          Delete the image denoted by id
 FileUsageListResponse getFileUsageInfo(Integer skipCount, Integer maxItems, String sortBy, String sortOrder, List<Integer> imageId, Integer nodeId, boolean returnFiles)
          Get the files using one of the given images
 FolderUsageListResponse getFolderUsageInfo(Integer skipCount, Integer maxItems, String sortBy, String sortOrder, List<Integer> imageId, Integer nodeId, boolean returnFolders)
          Get the folders using one of the given images
 FileUsageListResponse getImageUsageInfo(Integer skipCount, Integer maxItems, String sortBy, String sortOrder, List<Integer> imageId, Integer nodeId, boolean returnImages)
          Get the images using one of the given images
 LocalizationInfo getLocalizationInfo(List<Integer> ids, Integer nodeId)
          Get localization info for a list of images for a given channel and all master channels
 LocalizationInfo getLocalizationInfo(String id, Integer nodeId)
          Get localization info for an image for a given channel and all master channels
 PageUsageListResponse getPageUsageInfo(Integer skipCount, Integer maxItems, String sortBy, String sortOrder, List<Integer> imageId, Integer nodeId, boolean returnPages, boolean template, boolean folder, boolean languageVariants)
          Get the pages using one of the given images
 PrivilegesResponse getPrivileges(Integer id)
          Get the privileges of the current user on the given image
 TemplateUsageListResponse getTemplateUsageInfo(Integer skipCount, Integer maxItems, String sortBy, String sortOrder, List<Integer> imageId, Integer nodeId, boolean returnTemplates)
          Get the templates using one of the given images
 ImageLoadResponse load(String id, boolean update, Integer nodeId)
          Load the image with given id
 javax.ws.rs.core.Response loadContent(Integer id)
          Get the content of the image with given id
 GenericResponse localize(Integer id, LocalizeRequest request)
          Localize the given image
 GenericResponse pushToMaster(Integer id, PushToMasterRequest request)
          Push an image from a channel into a master
 GenericResponse pushToMaster(MultiPushToMasterRequest request)
          Push a list of images from a channel into a master
 GenericResponse resize(ImageResizeRequest imageResizeRequest)
          This method will once invoked resize the image and update its binary data and properties.
 GenericResponse save(Integer id, ImageSaveRequest request)
          Save the given image
 GenericResponse saveContent(InputStream fileContent)
          Save the posted content into the given image
 GenericResponse unlocalize(Integer id, UnlocalizeRequest request)
          Unlocalize the given image
 GenericResponse unlocalize(MultiUnlocalizeRequest request)
          Unlocalize images in a channel
 
Methods inherited from interface com.gentics.contentnode.rest.resource.AuthenticatedResource
setSessionId
 

Method Detail

load

ImageLoadResponse load(String id,
                       boolean update,
                       Integer nodeId)
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.
nodeId - id of the node (channel) for which the image shall be loaded (when multichannelling is used).
Returns:
response containing the image meta data

resize

GenericResponse resize(ImageResizeRequest imageResizeRequest)
This method will once invoked resize the image and update its binary data and properties.


loadContent

javax.ws.rs.core.Response loadContent(Integer id)
Get the content of the image with given id

Parameters:
id - image id to get
Returns:
binary content of the image

create

ImageLoadResponse create(ImageCreateRequest request)
Create a new image

Parameters:
request - request with data for the image to be created
Returns:
response containing the image meta data

save

GenericResponse save(Integer id,
                     ImageSaveRequest request)
Save the given image

Parameters:
request - request with the image to be saved
Returns:
generic response

saveContent

GenericResponse saveContent(InputStream fileContent)
Save the posted content into the given image

Parameters:
fileContent - image content
Returns:
generic response

delete

GenericResponse delete(Integer id,
                       Integer nodeId)
Delete the image denoted by id

Parameters:
id - id of the image to delete
Returns:
response object

getPrivileges

PrivilegesResponse getPrivileges(Integer id)
Get the privileges of the current user on the given image

Parameters:
id - id of the image
Returns:
privileges response

getFolderUsageInfo

FolderUsageListResponse getFolderUsageInfo(Integer skipCount,
                                           Integer maxItems,
                                           String sortBy,
                                           String sortOrder,
                                           List<Integer> imageId,
                                           Integer nodeId,
                                           boolean returnFolders)
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

getPageUsageInfo

PageUsageListResponse getPageUsageInfo(Integer skipCount,
                                       Integer maxItems,
                                       String sortBy,
                                       String sortOrder,
                                       List<Integer> imageId,
                                       Integer nodeId,
                                       boolean returnPages,
                                       boolean template,
                                       boolean folder,
                                       boolean languageVariants)
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
template - true for adding template info to the pages, default is false
folder - true for adding folder info to the pages, default is false
languageVariants - true for adding the language variants to the pages, default is false
Returns:
response

getTemplateUsageInfo

TemplateUsageListResponse getTemplateUsageInfo(Integer skipCount,
                                               Integer maxItems,
                                               String sortBy,
                                               String sortOrder,
                                               List<Integer> imageId,
                                               Integer nodeId,
                                               boolean returnTemplates)
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

getImageUsageInfo

FileUsageListResponse getImageUsageInfo(Integer skipCount,
                                        Integer maxItems,
                                        String sortBy,
                                        String sortOrder,
                                        List<Integer> imageId,
                                        Integer nodeId,
                                        boolean returnImages)
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

getFileUsageInfo

FileUsageListResponse getFileUsageInfo(Integer skipCount,
                                       Integer maxItems,
                                       String sortBy,
                                       String sortOrder,
                                       List<Integer> imageId,
                                       Integer nodeId,
                                       boolean returnFiles)
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

pushToMaster

GenericResponse pushToMaster(Integer id,
                             PushToMasterRequest request)
Push an image from a channel into a master

Parameters:
id - id of the image
request - request
Returns:
generic response

pushToMaster

GenericResponse pushToMaster(MultiPushToMasterRequest request)
Push a list of images from a channel into a master

Parameters:
request - request
Returns:
generic response

unlocalize

GenericResponse unlocalize(Integer id,
                           UnlocalizeRequest request)
Unlocalize the given image

Parameters:
id - id of the image to unlocalize
request - request
Returns:
generic response

unlocalize

GenericResponse unlocalize(MultiUnlocalizeRequest request)
Unlocalize images in a channel

Parameters:
request - request
Returns:
generic response

localize

GenericResponse localize(Integer id,
                         LocalizeRequest request)
Localize the given image

Parameters:
id - id of the image to localize
request - request
Returns:
generic response

getLocalizationInfo

LocalizationInfo getLocalizationInfo(List<Integer> ids,
                                     Integer nodeId)
Get localization info for a list of images for a given channel and all master channels

Parameters:
ids - list of image ids
nodeId - id of the node to start with
Returns:
localization info

getLocalizationInfo

LocalizationInfo getLocalizationInfo(String id,
                                     Integer nodeId)
Get localization info for an image for a given channel and all master channels

Parameters:
id - id of the image. The id can either be the local or global id
nodeId - id of the node to start with
Returns:
localization info


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.