Interface FolderResource

All Superinterfaces:
AuthenticatedResource

@Path("/folder") public interface FolderResource extends AuthenticatedResource
Resource for loading and manipulating folders in GCN
  • Method Details

    • create

      @POST @Path("/create") FolderLoadResponse create(FolderCreateRequest request)
    • 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 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
      construct - if true, the construct information will be added to tags
      nodeId - 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 given request. 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 globalid
      nodeId - node id (for multichannelling)
      includeWastebin - true to include folders from the wastebin, false (default) if not
      includeTags - 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)
      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
      inFolder - folder parameters
      pageListParams - page list params
      filterParams - filter parameters
      sortingParams - sorting parameters
      pagingParams - paging parameters
      publishParams - publishable params
      wastebinParams - 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)
      get a list of files for this folder
      Parameters:
      folderId - id of the folder
      inFolder - folder parameters
      fileListParams - file list parameters
      filterParams - filter parameters
      sortingParams - sorting parameters
      pagingParams - paging parameters
      editableParams - editable parameters
      wastebinParams - 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)
      get a list of images for this folder
      Parameters:
      folderId - id of the folder
      inFolder - folder parameters
      fileListParams - file list parameters
      filterParams - filter parameters
      sortingParams - sorting parameters
      pagingParams - paging parameters * @param editableParams editable parameters
      wastebinParams - 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)
      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. 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 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.
      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 not
      addPrivileges - true if the privileges shall be added to the folders, false if not
      editableParams - filter params for creator/editor and created and edited timestamps
      wastebinParams - 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 by
      • id
      • name
      • description
      and sorted by
      • id
      • name
      • description
      • publishDir
      Parameters:
      inFolder - Folder ID and recursive parameters
      folderListParams - further folder parameters
      filter - Search parameters
      sorting - Sorting parameters
      paging - Paging parameters
      editable - Editable parameters
      wastebin - 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 globalid
      inFolder - folder parameters
      templateListParams - template-specific list parameters
      filterParams - filter parameters
      sortingParams - sorting parameters
      pagingParams - paging parameters
      editableParams - editable parameters
      wastebinParams - 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 folder
      types - list of types to return, e.g. page, file and/or image
      nodeId - node id for this folder - for use with multichanneling
      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
      inFolder - (optional) folder parameters
      filter - (optional) filter parameters
      sorting - (optional) sorting parameters
      paging - (optional) paging parameters
      publishParams - (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)
      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

      @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)
      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
    • 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 globalid
      request - 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 id
      disableInstantDelete - 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 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)
      Delete folders denoted by the set of IDs from the wastebin
      Parameters:
      request - request containing ID set
      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 folder from the wastebin
      Parameters:
      id - id of the folder 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 denoted folders from the wastebin
      Parameters:
      request - request containing ID set
      waitMs - time in ms for the request to be done in foreground
      Returns:
      response object
    • getPrivileges

      @GET @Path("/privileges/{id}") PrivilegesResponse getPrivileges(@PathParam("id") Integer id)
      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 folder
      nodeId - node id
      language - language code
      inherited - true to only count inherited objects, false to count not inherited objects, null (default) to count both
      inFolder - folder parameters
      wastebinParams - 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 ID
      request - 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 move
      request - request containing target information
      Returns:
      generic response
      Throws:
      Exception - in case of errors
    • move

      @POST @Path("/move") GenericResponse move(MultiFolderMoveRequest request) throws Exception
      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