Interface FolderResource
- All Superinterfaces:
AuthenticatedResource
Resource for loading and manipulating folders in GCN
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(FolderCreateRequest request) Delete a single folder.deleteFromWastebin
(IdSetRequest request, long waitMs) Delete folders denoted by the set of IDs from the wastebindeleteFromWastebin
(String id, long waitMs) Remove the folder denoted by the given id from the wastebin.findFiles
(Integer folderId, String query, Integer skipCount, Integer maxItems, LinksType links, boolean recursive) Deprecated.findPages
(Integer folderId, String query, Integer skipCount, Integer maxItems, LinksType links, boolean recursive) getBreadcrumb
(String id, Integer nodeId, boolean includeWastebin, boolean includeTags) Load the breadcrumb to the given foldergetExternalLinks
(Integer folderId, boolean recursive) Get externals links from all the pages inside the folder with id `folderId`.getFiles
(String folderId, InFolderParameterBean inFolder, FileListParameterBean fileListParams, LegacyFilterParameterBean filterParams, LegacySortParameterBean sortingParams, LegacyPagingParameterBean pagingParams, EditableParameterBean editableParams, WastebinParameterBean wastebinParams) getFolders
(FolderListRequest folderListRequest) Get the list of folders in this foldergetFolders
(String id, List<String> recursiveIds, boolean addPrivileges, InFolderParameterBean inFolder, FolderListParameterBean folderListParams, LegacyFilterParameterBean filterParams, LegacySortParameterBean sortParams, LegacyPagingParameterBean pagingParams, EditableParameterBean editableParams, WastebinParameterBean wastebinParams) getImages
(String folderId, InFolderParameterBean inFolder, FileListParameterBean fileListParams, LegacyFilterParameterBean filterParams, LegacySortParameterBean sortingParams, LegacyPagingParameterBean pagingParams, EditableParameterBean editableParams, WastebinParameterBean wastebinParams) getItems
(String folderId, List<ContentNodeItem.ItemType> types, Integer nodeId, boolean template, boolean languageVariants, String language, boolean langFallback, InFolderParameterBean inFolder, LegacyFilterParameterBean filter, LegacySortParameterBean sorting, LegacyPagingParameterBean paging, PublishableParameterBean publishParams) Get a list of items for this foldergetObjectCounts
(Integer id, Integer nodeId, String language, Boolean inherited, InFolderParameterBean inFolder, WastebinParameterBean wastebinParams) Get the object counts for objects in the specified foldergetPages
(String id, InFolderParameterBean inFolder, PageListParameterBean pageListParams, LegacyFilterParameterBean filterParams, LegacySortParameterBean sortingParams, LegacyPagingParameterBean pagingParams, PublishableParameterBean publishParams, WastebinParameterBean wastebinParams) getPrivileges
(Integer id) Get the privileges of the current user on the given foldergetTemplates
(String folderId, InFolderParameterBean inFolder, TemplateListParameterBean templateListParams, LegacyFilterParameterBean filterParams, LegacySortParameterBean sortingParams, LegacyPagingParameterBean pagingParams, EditableParameterBean editableParams, WastebinParameterBean wastebinParams) Get the templates which are linked into the given folderlist
(InFolderParameterBean inFolder, FolderListParameterBean folderListParams, FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, EditableParameterBean editable, WastebinParameterBean wastebin) Get the list of folders in this folder.
The result can be filtered byid
name
description
and sorted byid
name
description
publishDir
load
(MultiFolderLoadRequest request, boolean fillWithNulls) Load a list of folders specified in the givenrequest
.load
(String folderId, boolean update, boolean addPrivileges, boolean construct, Integer nodeId, String stagingPackageName) Load a single foldermove
(MultiFolderMoveRequest request) Move multiple folders to a different locationmove
(String id, FolderMoveRequest request) Move the folder with id to a different locationrestoreFromWastebin
(IdSetRequest request, long waitMs) Restore the denoted folders from the wastebinrestoreFromWastebin
(String id, long waitMs) Restore the given folder from the wastebinSanitize the given folder publish directory according to the configuration and settings of the given nodesave
(String id, FolderSaveRequest request) Save a single foldersetStartpage
(String id, StartpageRequest request) Request to set a startpage for a pageMethods inherited from interface com.gentics.contentnode.rest.resource.AuthenticatedResource
setSessionId
-
Method Details
-
create
-
load
@GET @Path("/load/{id}") FolderLoadResponse load(@PathParam("id") String folderId, @DefaultValue("false") @QueryParam("update") boolean update, @QueryParam("privileges") @DefaultValue("false") boolean addPrivileges, @QueryParam("construct") @DefaultValue("false") boolean construct, @QueryParam("nodeId") Integer nodeId, @QueryParam("package") String stagingPackageName) Load a single folder- Parameters:
folderId
- id of the folder to load. This can be either the localid or a globalidupdate
- 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 reponseconstruct
- if true, the construct information will be added to tagsnodeId
- id of the node (channel) for which the folder shall be loaded (when multichannelling is used)stagingPackageName
- name of a content staging package, to check the folder status in it- Returns:
- response containing the folder to load
-
load
@POST @Path("/load") MultiFolderLoadResponse load(MultiFolderLoadRequest request, @QueryParam("fillWithNulls") @DefaultValue("false") boolean fillWithNulls) Load a list of folders specified in the givenrequest
. Folder ids for which no folders exist, or the user does not have the necessary permissions, are silently ignored.- Parameters:
request
- The request with he list of folder 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 folders, for which the user has enough permissions.
-
getBreadcrumb
@GET @Path("/breadcrumb/{id}") LegacyFolderListResponse getBreadcrumb(@PathParam("id") String id, @QueryParam("nodeId") Integer nodeId, @QueryParam("wastebin") @DefaultValue("false") boolean includeWastebin, @QueryParam("tags") @DefaultValue("false") boolean includeTags) Load the breadcrumb to the given folder- Parameters:
id
- id of the folder. This can either be a localid or a globalidnodeId
- node id (for multichannelling)includeWastebin
- true to include folders from the wastebin, false (default) if notincludeTags
- true to include the folders tags, false (default)if not- Returns:
- list of folders. the first entry is the root folder of the node, the last one the requested folder.
-
getPages
@GET @Path("/getPages/{id}") LegacyPageListResponse getPages(@PathParam("id") String id, @BeanParam InFolderParameterBean inFolder, @BeanParam PageListParameterBean pageListParams, @BeanParam LegacyFilterParameterBean filterParams, @BeanParam LegacySortParameterBean sortingParams, @BeanParam LegacyPagingParameterBean pagingParams, @BeanParam PublishableParameterBean publishParams, @BeanParam WastebinParameterBean wastebinParams) Deprecated.get a list of pages for this folder- Parameters:
id
- id of the folder. This can be the local or global id of the folderinFolder
- folder parameterspageListParams
- page list paramsfilterParams
- filter parameterssortingParams
- sorting parameterspagingParams
- paging parameterspublishParams
- publishable paramswastebinParams
- wastebin params- Returns:
- list of pages
-
getFiles
@GET @Path("/getFiles/{folderId}") LegacyFileListResponse getFiles(@PathParam("folderId") String folderId, @BeanParam InFolderParameterBean inFolder, @BeanParam FileListParameterBean fileListParams, @BeanParam LegacyFilterParameterBean filterParams, @BeanParam LegacySortParameterBean sortingParams, @BeanParam LegacyPagingParameterBean pagingParams, @BeanParam EditableParameterBean editableParams, @BeanParam WastebinParameterBean wastebinParams) Deprecated.get a list of files for this folder- Parameters:
folderId
- id of the folderinFolder
- folder parametersfileListParams
- file list parametersfilterParams
- filter parameterssortingParams
- sorting parameterspagingParams
- paging parameterseditableParams
- editable parameterswastebinParams
- wastebin parameters- Returns:
- list of files
-
getImages
@GET @Path("/getImages/{folderId}") LegacyFileListResponse getImages(@PathParam("folderId") String folderId, @BeanParam InFolderParameterBean inFolder, @BeanParam FileListParameterBean fileListParams, @BeanParam LegacyFilterParameterBean filterParams, @BeanParam LegacySortParameterBean sortingParams, @BeanParam LegacyPagingParameterBean pagingParams, @BeanParam EditableParameterBean editableParams, @BeanParam WastebinParameterBean wastebinParams) Deprecated.get a list of images for this folder- Parameters:
folderId
- id of the folderinFolder
- folder parametersfileListParams
- file list parametersfilterParams
- filter parameterssortingParams
- sorting parameterspagingParams
- paging parameters * @param editableParams editable parameterswastebinParams
- wastebin parameters- Returns:
- list of iamges
-
getFolders
@POST @Path("/getFolders/") LegacyFolderListResponse getFolders(FolderListRequest folderListRequest) Get the list of folders in this folder- Parameters:
folderListRequest
-- Returns:
- list of folders
-
getFolders
@GET @Path("/getFolders/{id}") LegacyFolderListResponse getFolders(@PathParam("id") String id, @QueryParam("recId") List<String> recursiveIds, @QueryParam("privileges") @DefaultValue("false") boolean addPrivileges, @BeanParam InFolderParameterBean inFolder, @BeanParam FolderListParameterBean folderListParams, @BeanParam LegacyFilterParameterBean filterParams, @BeanParam LegacySortParameterBean sortParams, @BeanParam LegacyPagingParameterBean pagingParams, @BeanParam EditableParameterBean editableParams, @BeanParam WastebinParameterBean wastebinParams) Deprecated.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 itemsmaxItems
- maximum number of items to be returned, set to -1 for returning all itemsrecursive
- true when the folders shall be fetched recursivelysortBy
- name of the sorted attribute. It is possible to sort by name, cdate, edate, masterNode, excluded, deletedat. 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 folderssearch
- 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.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.privilegeMap
- true if the privileges shall be added to the folders as map, false if notaddPrivileges
- true if the privileges shall be added to the folders, false if noteditableParams
- filter params for creator/editor and created and edited timestampswastebinParams
- exclude (default) to exclude deleted objects, include to include deleted objects, only to return only deleted objects- Returns:
- list of folders
-
list
@GET FolderListResponse list(@BeanParam InFolderParameterBean inFolder, @BeanParam FolderListParameterBean folderListParams, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam EditableParameterBean editable, @BeanParam WastebinParameterBean wastebin) Get the list of folders in this folder.
The result can be filtered byid
name
description
id
name
description
publishDir
- Parameters:
inFolder
- Folder ID and recursive parametersfolderListParams
- further folder parametersfilter
- Search parameterssorting
- Sorting parameterspaging
- Paging parameterseditable
- Editable parameterswastebin
- Wastebin parameters- Returns:
- A list of folders
-
getTemplates
@GET @Path("/getTemplates/{folderId}") TemplateListResponse getTemplates(@PathParam("folderId") String folderId, @BeanParam InFolderParameterBean inFolder, @BeanParam TemplateListParameterBean templateListParams, @BeanParam LegacyFilterParameterBean filterParams, @BeanParam LegacySortParameterBean sortingParams, @BeanParam LegacyPagingParameterBean pagingParams, @BeanParam EditableParameterBean editableParams, @BeanParam WastebinParameterBean wastebinParams) Get the templates which are linked into the given folder- Parameters:
folderId
- id of the folder. This can either be a localid or a globalidinFolder
- folder parameterstemplateListParams
- template-specific list parametersfilterParams
- filter parameterssortingParams
- sorting parameterspagingParams
- paging parameterseditableParams
- editable parameterswastebinParams
- wastebin parameters- Returns:
- list of templates
-
getItems
@GET @Path("/getItems/{folderId}") ItemListResponse getItems(@PathParam("folderId") String folderId, @QueryParam("type") List<ContentNodeItem.ItemType> types, @QueryParam("nodeId") Integer nodeId, @QueryParam("template") @DefaultValue("false") boolean template, @QueryParam("langvars") @DefaultValue("false") boolean languageVariants, @QueryParam("language") String language, @QueryParam("langfallback") @DefaultValue("true") boolean langFallback, @BeanParam InFolderParameterBean inFolder, @BeanParam LegacyFilterParameterBean filter, @BeanParam LegacySortParameterBean sorting, @BeanParam LegacyPagingParameterBean paging, @BeanParam PublishableParameterBean publishParams) Get a list of items for this folder- Parameters:
folderId
- id of the foldertypes
- list of types to return, e.g. page, file and/or imagenodeId
- node id for this folder - for use with multichannelinglanguageVariants
- true when the language variants should be added to the pageslanguage
- 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 listinFolder
- (optional) folder parametersfilter
- (optional) filter parameterssorting
- (optional) sorting parameterspaging
- (optional) paging parameterspublishParams
- (optional) editable/publishable parameters- Returns:
- list of items
-
findPages
@GET @Path("/findPages") LegacyPageListResponse findPages(@QueryParam("folderId") @DefaultValue("0") Integer folderId, @QueryParam("query") String query, @QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("100") Integer maxItems, @QueryParam("links") @DefaultValue("backend") LinksType links, @QueryParam("recursive") @DefaultValue("true") boolean recursive) Deprecated.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 foldersquery
- string to be searched (currently, only page names are searched)skipCount
- number of items to be skipped, set to 0 for skipping no itemsmaxItems
- maximum number of items to be returned, set to -1 for returning all itemslinks
- 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
@GET @Path("/findFiles") FoundFilesListResponse findFiles(@QueryParam("folderId") @DefaultValue("0") Integer folderId, @QueryParam("query") String query, @QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("100") Integer maxItems, @QueryParam("links") @DefaultValue("backend") LinksType links, @QueryParam("recursive") @DefaultValue("true") boolean recursive) Deprecated.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 foldersquery
- string to be searched (currently, only page names are searched)skipCount
- number of items to be skipped, set to 0 for skipping no itemsmaxItems
- maximum number of items to be returned, set to -1 for returning all itemslinks
- 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
-
getExternalLinks
@GET @Path("/getExternalLinks/{folderId}") FolderExternalLinksResponse getExternalLinks(@PathParam("folderId") Integer folderId, @QueryParam("recursive") @DefaultValue("false") boolean recursive) Get externals links from all the pages inside the folder with id `folderId`.- Parameters:
folderId
- Id of the folder.recursive
- If true, pages in subfolders will be included in the response.- Returns:
- list of pages including its external links (see
FolderExternalLinksResponse
).
-
save
@POST @Path("/save/{id}") GenericResponse save(@PathParam("id") String id, FolderSaveRequest request) Save a single folder- Parameters:
id
- folder id. This can either be a local or globalidrequest
- folder save request- Returns:
- generic response
-
delete
@POST @Path("/delete/{id}") GenericResponse delete(@PathParam("id") String id, @QueryParam("nodeId") Integer nodeId, @QueryParam("disableInstantDelete") Boolean disableInstantDelete) 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 iddisableInstantDelete
- don't delete the item from the content repo immediately- Returns:
- generic response
-
deleteFromWastebin
@POST @Path("/wastebin/delete/{id}") GenericResponse deleteFromWastebin(@PathParam("id") String id, @QueryParam("wait") @DefaultValue("0") long waitMs) Remove the folder denoted by the given id from the wastebin.- Parameters:
id
- id of the folder to remove from the wastebin. This can either be a local or global idwaitMs
- 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) Delete folders denoted by the set of IDs from the wastebin- Parameters:
request
- request containing ID setwaitMs
- 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 folder from the wastebin- Parameters:
id
- id of the folder to restore from the wastebin. This can either be a local or global idwaitMs
- 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 denoted folders from the wastebin- Parameters:
request
- request containing ID setwaitMs
- time in ms for the request to be done in foreground- Returns:
- response object
-
getPrivileges
Get the privileges of the current user on the given folder- Parameters:
id
- id of the folder.- Returns:
- privileges response
-
getObjectCounts
@GET @Path("/count/{id}") FolderObjectCountResponse getObjectCounts(@PathParam("id") Integer id, @QueryParam("nodeId") Integer nodeId, @QueryParam("language") String language, @QueryParam("inherited") Boolean inherited, @BeanParam InFolderParameterBean inFolder, @BeanParam WastebinParameterBean wastebinParams) Get the object counts for objects in the specified folder- Parameters:
id
- id of the foldernodeId
- node idlanguage
- language codeinherited
- true to only count inherited objects, false to count not inherited objects, null (default) to count bothinFolder
- folder parameterswastebinParams
- wastebin search option- Returns:
- response containing the object counts
-
setStartpage
@POST @Path("/startpage/{id}") GenericResponse setStartpage(@PathParam("id") String id, StartpageRequest request) Request to set a startpage for a page- Parameters:
id
- folder IDrequest
- request containing the requested startpage- Returns:
- generic response
-
move
@POST @Path("/move/{id}") GenericResponse move(@PathParam("id") String id, FolderMoveRequest request) throws Exception Move the folder with id to a different location- Parameters:
id
- id of the folder to moverequest
- request containing target information- Returns:
- generic response
- Throws:
Exception
- in case of errors
-
move
Move multiple folders to a different location- Parameters:
request
- request containing source and target information- Returns:
- generic response
- Throws:
Exception
-
sanitizePubdir
@POST @Path("/sanitize/publishDir") FolderPublishDirSanitizeResponse sanitizePubdir(FolderPublishDirSanitizeRequest request) throws Exception Sanitize the given folder publish directory according to the configuration and settings of the given node- Parameters:
request
- request- Returns:
- response containing the sanitized publish directory
- Throws:
Exception
-
FileResource.list(InFolderParameterBean, FileListParameterBean, FilterParameterBean, SortParameterBean, PagingParameterBean, EditableParameterBean, WastebinParameterBean)
instead