com.gentics.contentnode.rest.resource
Interface FolderResource

All Superinterfaces:
AuthenticatedResource

public interface FolderResource
extends AuthenticatedResource

Resource for loading and manipulating folders in GCN


Method Summary
 FolderLoadResponse create(FolderCreateRequest request)
           
 GenericResponse delete(String id, Integer nodeId)
          Delete a single folder.
 FoundFilesListResponse findFiles(Integer folderId, String query, Integer skipCount, Integer maxItems, LinksType links, boolean recursive)
          Deprecated. use #getFiles(String, int, int, Integer, String, boolean, String, String, String, String, int, int, Boolean) instead.
 PageListResponse findPages(Integer folderId, String query, Integer skipCount, Integer maxItems, LinksType links, boolean recursive)
          Deprecated. use #getPages(Integer, Integer, Integer, Integer, boolean, boolean, boolean, String, String, boolean, String, String, boolean, int, boolean, boolean) instead
 FolderListResponse getBreadcrumb(String id, Integer nodeId)
          Load the breadcrumb to the given folder
 FileListResponse getFiles(String folderId, int skipCount, int maxItems, Integer nodeId, String search, boolean recursive, String sortBy, String sortOrder, String editor, String creator, int editedSince, int createdSince, Boolean inherited, Boolean online)
          get a list of files for this folder
 FolderListResponse getFolders(String id, Integer nodeId, int skipCount, int maxItems, boolean recursive, String sortBy, String sortOrder, Boolean inherited, String search, String editor, String creator, int editedSince, int createdSince, boolean tree, List<String> recursiveIds)
          Get the list of folders in this folder
 FileListResponse getImages(String folderId, int skipCount, int maxItems, Integer nodeId, String search, boolean recursive, String sortBy, String sortOrder, String editor, String creator, int editedSince, int createdSince, Boolean inherited, Boolean online)
          get a list of images for this folder
 ItemListResponse getItems(String folderId, List<ContentNodeItem.ItemType> types, int skipCount, int maxItems, Integer nodeId, boolean languageVariants, String language, boolean langFallback, String search, boolean recursive, String sortBy, String sortOrder, String editor, String creator, int editedSince, int createdSince)
          Get a list of items for this folder
 LocalizationInfo getLocalizationInfo(String id, Integer nodeId, boolean recursive)
          Get localization info for a folder and all subitems for a given channel and all master channels
 FolderObjectCountResponse getObjectCounts(Integer id, Integer nodeId, String language)
          Get the object counts for objects in the specified folder
 PageListResponse getPages(String id, Integer skipCount, Integer maxItems, Integer nodeId, boolean template, boolean folder, boolean languageVariants, String language, boolean langFallback, String search, boolean searchContent, String filename, boolean recursive, String sortBy, String sortOrder, boolean isEditor, boolean isCreator, boolean isPublisher, String editor, String creator, String publisher, int timeDue, boolean workflowOwn, boolean workflowWatch, Boolean inSync, boolean translationStatus, List<PageStatus> status, int priority, List<Integer> templateIds, int editedSince, int createdSince, int publishedSince, Boolean inherited)
          get a list of pages for this folder
 PrivilegesResponse getPrivileges(Integer id)
          Get the privileges of the current user on the given folder
 TemplateListResponse getTemplates(String folderId, Integer nodeId, String search, boolean recursive, boolean reduce, String sortBy, String sortOrder, String editor, String creator, int editedSince, int createdSince, boolean checkPermission, Boolean inherited, Integer skipCount, Integer maxItems)
          Get the templates which are linked into the given folder
 FolderLoadResponse load(String folderId, boolean update, boolean addPrivileges, Integer nodeId)
          Load a single folder
 GenericResponse localize(Integer id, LocalizeRequest request)
          Localize the given folder
 GenericResponse pushToMaster(Integer id, PushToMasterRequest request)
          Push a folder from a channel into a master
 GenericResponse pushToMaster(MultiPushToMasterRequest request)
          Push a list of folders from a channel into a master
 GenericResponse save(String id, FolderSaveRequest request)
          Save a single folder
 GenericResponse setStartpage(String id, StartpageRequest request)
          Request to set a startpage for a page
 GenericResponse unlocalize(Integer id, UnlocalizeRequest request)
          Unlocalize the given folder
 GenericResponse unlocalize(MultiUnlocalizeRequest request)
          Unlocalize folders in a channel
 
Methods inherited from interface com.gentics.contentnode.rest.resource.AuthenticatedResource
setSessionId
 

Method Detail

create

FolderLoadResponse create(FolderCreateRequest request)

load

FolderLoadResponse load(String folderId,
                        boolean update,
                        boolean addPrivileges,
                        Integer nodeId)
Load a single folder

Parameters:
id - id of the folder to load. This can be either the localid or a globalid
update - true when the folder is fetched for updating. Currently, folders cannot be locked in the backend, but it is still recommended to set this parameter to true when the folder shall be modified.
addPrivileges - flag whether the privileges should be added to the reponse
nodeId - id of the node (channel) for which the folder shall be loaded (when multichannelling is used)
Returns:
response containing the folder to load

getBreadcrumb

FolderListResponse getBreadcrumb(String id,
                                 Integer nodeId)
Load the breadcrumb to the given folder

Parameters:
id - id of the folder. This can either be a localid or a globalid
nodeId - node id (for multichannelling)
Returns:
list of folders. the first entry is the root folder of the node, the last one the requested folder.

getPages

PageListResponse getPages(String id,
                          Integer skipCount,
                          Integer maxItems,
                          Integer nodeId,
                          boolean template,
                          boolean folder,
                          boolean languageVariants,
                          String language,
                          boolean langFallback,
                          String search,
                          boolean searchContent,
                          String filename,
                          boolean recursive,
                          String sortBy,
                          String sortOrder,
                          boolean isEditor,
                          boolean isCreator,
                          boolean isPublisher,
                          String editor,
                          String creator,
                          String publisher,
                          int timeDue,
                          boolean workflowOwn,
                          boolean workflowWatch,
                          Boolean inSync,
                          boolean translationStatus,
                          List<PageStatus> status,
                          int priority,
                          List<Integer> templateIds,
                          int editedSince,
                          int createdSince,
                          int publishedSince,
                          Boolean inherited)
get a list of pages for this folder

Parameters:
id - id of the folder. This can be the local or global id of the folder
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
nodeId - node id of the channel when used in multichannelling
template - true when the template information should be added to the pages
folder - true when the folder information should be added to the pages
languageVariants - true when the language variants should be added to the pages
language - code of the language in which the pages shall be fetched.
langFallback - true if the language fallback shall be done when getting pages in a language, false if not. If a page is not present in the given language and langFallback is true, the language variant with highest priority in the node is used instead, otherwise the page will not be present in the list
search - (optional) search string (may be empty for no search) - this will filter the results if either the ID, the name (partial match or the description (partial match) matches the given search string.
searchContent - (optional) true, if also the content shall be searched, false if not
filename - (optional) search string for filenames (may be empty)
recursive - (optional) true when the pages shall be fetched recursively, false if not. Defaults to false
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".
isEditor - (optional) true when only the pages last edited by the user shall be returned
isCreator - (optional) true when only the pages created by the user shall be returned
isPublisher - (optional) true when only the pages which were last published by the user shall be returned
editor - pattern for restricting pages by editor
creator - pattern for restricting pages by creator
publisher - pattern for restricting pages by publisher
timeDue - (optional) difference in seconds for searching pages, that will change their status due to timemanagement within the given timespan. When set to 0 (default), the timemanagement will not be considered.
workflowOwn - (optional) true to restrict to pages owned by the user in a workflow. Defaults to false.
workflowWatch - (optional) true to restrict to pages watched by the user in a workflow. Defaults to false.
inSync - (optional) Boolean.TRUE to restrict to pages that are currently in sync with their translation masters, Boolean.FALSE to restrict to pages that are currently not in sync with their translation masters, and NULL to not consider the translation status information at all. Setting this flag (to either true or false) will also add the translation status information.
translationStatus - true if the translationstatus information shall be added for every page, false if not.
status - list of page stati
priority - priority of the page
templateIds - list of template ids
editedSince - timestamp to search pages, which were edited since a given time (0 for all pages)
createdSince - timestamp to search pages, which were created since a given time (0 for all pages)
publishedSince - timestamp to search pages, which were published since a given time (0 for all pages)
inherited - true to only return inherited pages in the given node, false to only get local/localized pages, null to get local and inherited pages
Returns:
list of pages

getFiles

FileListResponse getFiles(String folderId,
                          int skipCount,
                          int maxItems,
                          Integer nodeId,
                          String search,
                          boolean recursive,
                          String sortBy,
                          String sortOrder,
                          String editor,
                          String creator,
                          int editedSince,
                          int createdSince,
                          Boolean inherited,
                          Boolean online)
get a list of files for this folder

Parameters:
folderId - id of the folder
skipCount - number of items to skip from the start of the list (paging). 0 to not skip items (default)
maxItems - maximum number of items to be returned (paging). -1 to return all items (default)
nodeId - node id for this folder - for use with multichannelling
search - (optional) string to search files for - this will filter the results if either the ID, the name (partial match or the description (partial match) matches the given search string.
recursive - (optional) true, if subfolders should be integrated into search
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".
editor - (optional) pattern for searching images by editor
creator - (optional) pattern for searching images by creator
editedSince - (optional) timestamp for searching images edited after a specific time
createdSince - (optional) timestamp for searching images created after a specific time
inherited - true to only return inherited files in the given node, false to only get local/localized files, null to get local and inherited files
online - true to only return online files, false to only get offline files, null to get both online and offline files
Returns:
list of files

getImages

FileListResponse getImages(String folderId,
                           int skipCount,
                           int maxItems,
                           Integer nodeId,
                           String search,
                           boolean recursive,
                           String sortBy,
                           String sortOrder,
                           String editor,
                           String creator,
                           int editedSince,
                           int createdSince,
                           Boolean inherited,
                           Boolean online)
get a list of images for this folder

Parameters:
folderId - id of the folder
skipCount - number of items to skip from the start of the list (paging). 0 to not skip items (default)
maxItems - maximum number of items to be returned (paging). -1 to return all items (default)
nodeId - node id for this folder - for use with multichannelling
search - (optional) string to search files for - this will filter the results if either the ID, the name (partial match or the description (partial match) matches the given search string.
recursive - (optional) true, if subfolders should be integrated into search
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".
editor - (optional) pattern for searching images by editor
creator - (optional) pattern for searching images by creator
editedSince - (optional) timestamp for searching images edited after a specific time
createdSince - (optional) timestamp for searching images created after a specific time
inherited - true to only return inherited images in the given node, false to only get local/localized images, null to get local and inherited images
online - true to only return online files, false to only get offline files, null to get both online and offline files
Returns:
list of iamges

getFolders

FolderListResponse getFolders(String id,
                              Integer nodeId,
                              int skipCount,
                              int maxItems,
                              boolean recursive,
                              String sortBy,
                              String sortOrder,
                              Boolean inherited,
                              String search,
                              String editor,
                              String creator,
                              int editedSince,
                              int createdSince,
                              boolean tree,
                              List<String> recursiveIds)
Get the list of folders in this folder

Parameters:
id - local id of the folder. This can either be the local or globalid.
nodeId - node id (for multichannelling)
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
recursive - true when the folders shall be fetched recursively
sortBy - name of the sorted attribute, defaults to "name"
sortOrder - sorting order, defaults to "asc"
inherited - true to only return inherited folders in the given node, false to only get local/localized folders, null to get local and inherited folders
search - search string to search for in name, null if not searching - this will filter the results if either the ID, the name (partial match or the description (partial match) matches the given search string.
editor - pattern for restricting folders by editor
creator - pattern for restricting folders by creator
editedSince - timestamp for restricting to folders that were edited since a given time, 0 for all folders
createdSince - timestamp for restricting to folders that were created since a given time, 0 for all folders
tree - true when folders shall be returned as tree(s). Subfolders will be attached to their mothers. This only makes sense, when recursive is true.
recursiveIds - optional list of folder ids, for which the children shall be fetched. if recursive is true (ignored if recursive is false). The ids might be composed as nodeId/folderId to get children for folders in specific channels only.
Returns:
list of folders
Throws:
NodeException

getTemplates

TemplateListResponse getTemplates(String folderId,
                                  Integer nodeId,
                                  String search,
                                  boolean recursive,
                                  boolean reduce,
                                  String sortBy,
                                  String sortOrder,
                                  String editor,
                                  String creator,
                                  int editedSince,
                                  int createdSince,
                                  boolean checkPermission,
                                  Boolean inherited,
                                  Integer skipCount,
                                  Integer maxItems)
Get the templates which are linked into the given folder

Parameters:
folderId - id of the folder. This can either be a localid or a globalid
nodeId - id of the channel, if the list shall be fetched for a channel
search - (optional) search string (may be empty for no search), defaults to null - this will filter the results if either the ID, the name (partial match or the description (partial match) matches the given search string.
recursive - (optional) true when the search shall be done recursively, false if not, defaults to false
reduce - (optional) true when each template shall only be returned once, even when searching recursively, defaults to false
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".
editor - (optional) pattern for searching images by editor
creator - (optional) pattern for searching images by creator
editedSince - (optional) timestamp for searching images edited after a specific time
createdSince - (optional) timestamp for searching images created after a specific time
checkPermission - (optional) flag to check for permissions. Optional, defaults to true
inherited - true to only return inherited templates in the given node, false to only get local/localized templates, null to get local and inherited templates
Returns:
list of templates
Throws:
NodeException

getItems

ItemListResponse getItems(String folderId,
                          List<ContentNodeItem.ItemType> types,
                          int skipCount,
                          int maxItems,
                          Integer nodeId,
                          boolean languageVariants,
                          String language,
                          boolean langFallback,
                          String search,
                          boolean recursive,
                          String sortBy,
                          String sortOrder,
                          String editor,
                          String creator,
                          int editedSince,
                          int createdSince)
Get a list of items for this folder

Parameters:
folderId - id of the folder
type - list of types to return
skipCount - number of items to skip from the start of the list (paging). 0 to not skip items (default)
maxItems - maximum number of items to be returned (paging). -1 to return all items (default)
nodeId - node id for this folder - for use with multichanneling
langvars - true when the language variants should be added to the pages
language - code of the language in which the pages shall be fetched.
langFallback - true if the language fallback shall be done when getting pages in a language, false if not. If a page is not present in the given language and langFallback is true, the language variant with highest priority in the node is used instead, otherwise the page will not be present in the list
search - (optional) string to search items for - this will filter the results if either the ID, the name (partial match or the description (partial match) matches the given search string.
recursive - (optional) true, if subfolders should be integrated into search
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".
editor - (optional) pattern for searching images by editor
creator - (optional) pattern for searching images by creator
editedSince - (optional) timestamp for searching images edited after a specific time
createdSince - (optional) timestamp for searching images created after a specific time
Returns:
list of items

findPages

PageListResponse findPages(Integer folderId,
                           String query,
                           Integer skipCount,
                           Integer maxItems,
                           LinksType links,
                           boolean recursive)
Deprecated. use #getPages(Integer, Integer, Integer, Integer, boolean, boolean, boolean, String, String, boolean, String, String, boolean, int, boolean, boolean) instead

Find pages by name, eventually starting with the given folder id

Parameters:
folderId - start folder id, if set to 0, the search is done over all folders
query - string to be searched (currently, only page names are searched)
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
links - type of the links to the page ("backend" for backend links, "frontend" for frontend links)
recursive - true when the search shall be done recursive, false if only flat in the given folder
Returns:
list of found pages

findFiles

FoundFilesListResponse findFiles(Integer folderId,
                                 String query,
                                 Integer skipCount,
                                 Integer maxItems,
                                 LinksType links,
                                 boolean recursive)
Deprecated. use #getFiles(String, int, int, Integer, String, boolean, String, String, String, String, int, int, Boolean) instead.

Find files by name, starting with the given folder id

Parameters:
folderId - start folder id, if set to 0, the search is done over all folders
query - string to be searched (currently, only page names are searched)
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
links - type of the links to the file ("backend" for backend links, "frontend" for frontend links)
recursive - true when the search shall be done recursive, false if only flat in the given folder
Returns:
list of found files

save

GenericResponse save(String id,
                     FolderSaveRequest request)
Save a single folder

Parameters:
id - folder id. This can either be a local or globalid
request - folder save request
Returns:
generic response

delete

GenericResponse delete(String id,
                       Integer nodeId)
Delete a single folder. Note that inherited or localized folders can't be deleted in a channel. However you can delete an inherited folder in the master and unlocalize a localized folder.

Parameters:
id - id of the folder to be deleted. This can either be local or global id
Returns:
generic response

getPrivileges

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

Parameters:
id - id of the folder.
Returns:
privileges response

getObjectCounts

FolderObjectCountResponse getObjectCounts(Integer id,
                                          Integer nodeId,
                                          String language)
Get the object counts for objects in the specified folder

Parameters:
id - id of the folder
nodeId - node id
language - language code
Returns:
response containing the object counts

pushToMaster

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

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

pushToMaster

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

Parameters:
request - request
Returns:
generic response

unlocalize

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

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

unlocalize

GenericResponse unlocalize(MultiUnlocalizeRequest request)
Unlocalize folders in a channel

Parameters:
request - request
Returns:
generic response

localize

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

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

getLocalizationInfo

LocalizationInfo getLocalizationInfo(String id,
                                     Integer nodeId,
                                     boolean recursive)
Get localization info for a folder and all subitems for a given channel and all master channels

Parameters:
id - id of the folder. This can either be the local or global id
nodeId - id of the node to start with
recursive - true if the localization info shall be fetched recursively, false if not
Returns:
localization info

setStartpage

GenericResponse setStartpage(String id,
                             StartpageRequest request)
Request to set a startpage for a page

Parameters:
id - id of the page
request - request containing the requested startpage
Returns:
generic response


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.