Interface TemplateResource


@Path("/template") public interface TemplateResource
Resource used for loading, saving and manipulating GCN templates.
  • Method Details

    • list

      @GET TemplateInNodeResponse list(@QueryParam("nodeId") List<String> nodeIds, @BeanParam FilterParameterBean filterParams, @BeanParam SortParameterBean sortingParams, @BeanParam PagingParameterBean pagingParams, @BeanParam PermsParameterBean perms, @BeanParam TemplateListParameterBean listParams) throws Exception
      List templates assigned to the given list of nodes.
      The result can be filtered by
      • id
      • name
      • description
      and sorted by
      • id
      • name
      • description
      • cdate
      • edate
      Parameters:
      nodeIds - list of node IDs
      filterParams - filter parameters
      sortingParams - sorting parameters
      pagingParams - paging parameters
      perms - permissions parameters
      Returns:
      response containing the list of assigned templates
      Throws:
      Exception
    • create

      Create a new template
      Parameters:
      request - create request
      Returns:
      created template
      Throws:
      Exception
    • get

      @GET @Path("/{id}") TemplateLoadResponse get(@PathParam("id") String id, @QueryParam("nodeId") Integer nodeId, @QueryParam("update") @DefaultValue("false") boolean update, @QueryParam("construct") @DefaultValue("false") boolean construct) throws Exception
      Load the template with the given id and return it.
      Parameters:
      id - The template id (either local or global)
      nodeId - channel id
      update - true when the template shall be locked, false if not
      construct - if true, the construct info will be added to tags
      Returns:
      template load response
      Throws:
      Exception
    • update

      @POST @Path("/{id}") GenericResponse update(@PathParam("id") String id, TemplateSaveRequest request) throws Exception
      Update the template with given id
      Parameters:
      id - The template id (either local or global)
      request - template update request
      Returns:
      generic response
      Throws:
      Exception
    • unlock

      @POST @Path("/{id}/unlock") TemplateLoadResponse unlock(@PathParam("id") String id) throws Exception
      Unlock a template
      Parameters:
      id - template id (either local or global)
      Returns:
      template load response
      Throws:
      Exception
    • delete

      @DELETE @Path("/{id}") javax.ws.rs.core.Response delete(@PathParam("id") String id) throws Exception
      Delete the template with given id
      Parameters:
      id - The template id (either local or global)
      Returns:
      generic response
      Throws:
      Exception
    • folders

      @GET @Path("/{id}/folders") PagedFolderListResponse folders(@PathParam("id") String id, @BeanParam SortParameterBean sort, @BeanParam FilterParameterBean filter, @BeanParam PagingParameterBean paging) throws Exception
      Get the folders to which the template is assigned.
      The result can be filtered by
      • id
      • name
      • description
      and sorted by
      • id
      • name
      • description
      Parameters:
      id - template ID
      sort - sort parameters
      filter - filter parameters
      paging - paging parameters
      Returns:
      response containing a list of folders
      Throws:
      Exception
    • nodes

      @GET @Path("/{id}/nodes") NodeList nodes(@PathParam("id") String id, @BeanParam SortParameterBean sort, @BeanParam FilterParameterBean filter, @BeanParam PagingParameterBean paging) throws Exception
      Get the nodes to which the template is assigned.
      The result can be filtered by
      • id
      • name
      and sorted by
      • id
      • name
      Parameters:
      id - template ID
      sort - sort parameters
      filter - filter parameters
      paging - paging parameters
      Returns:
      response containing a list of nodes
      Throws:
      Exception
    • load

      @GET @Path("/load/{id}") @Deprecated TemplateLoadResponse load(@PathParam("id") String id, @QueryParam("nodeId") Integer nodeId) throws Exception
      Deprecated.
      Use GET /template/{id} instead
      Load the template with the given id and return it.
      Parameters:
      id - The template id
      nodeId - channel id
      Returns:
      Throws:
      Exception
    • getTags

      @GET @Path("/getTags/{id}") @Deprecated TagListResponse getTags(@PathParam("id") String id, @QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("sortby") @DefaultValue("name") TagSortAttribute sortBy, @QueryParam("sortorder") @DefaultValue("asc") SortOrder sortOrder, @QueryParam("search") String search) throws Exception
      Deprecated.
      because new endpoint exists. use #listTags(String, FilterParameterBean, SortParameterBean, PagingParameterBean) instead
      Get the list of templatetags for this template
      Parameters:
      id - id of the template. The local or global id
      Returns:
      response object
      Throws:
      Exception
    • listTags

      @GET @Path("/{id}/tag") TagList listTags(@PathParam("id") String id, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam EmbedParameterBean embed) throws Exception
      Get the list of template tags for this template
      Parameters:
      id - id of the template. The local or global id
      filter - filter parameters. Possible filter fields are (id, globalId, constructId, name, enabled)
      sorting - sorting parameters
      paging - paging parameters
      embed - optionally embed the referenced object (construct)
      Returns:
      List of template tags
      Throws:
      Exception - in case of errors
    • link

      @POST @Path("/link/{id}") GenericResponse link(@PathParam("id") String id, LinkRequest request) throws Exception
      Link the given template to the given folders. For linking templates to folders, the user must have the following permissions:
      • edit the template (which includes viewing the template)
      • link templates to all target folders (which includes viewing folder and viewing templates in the folder)
      If at least on of these permissions is not granted to the user, the method will fail.
      Parameters:
      id - id of the template
      request - request containing the list of folders and other data
      Returns:
      generic response
      Throws:
      Exception
    • link

      @POST @Path("/link") GenericResponse link(MultiLinkRequest request) throws Exception
      Link the given templates to the given folders. For linking templates to folders, the user must have the following permissions:
      • edit the template (which includes viewing the template)
      • link templates to all target folders (which includes viewing folder and viewing templates in the folder)
      If at least on of these permissions is not granted to the user, the method will fail.
      Parameters:
      request - request containing the list of folders and other data
      Returns:
      generic response
      Throws:
      Exception
    • unlink

      @POST @Path("/unlink/{id}") GenericResponse unlink(@PathParam("id") String id, LinkRequest request) throws Exception
      Unlink the given template from the given folders. For unlinking templates from folders, the user must have the following permissions:
      • edit the template (which includes viewing the template)
      • link templates to all target folders (which includes viewing folder and viewing templates in the folder)
      If at least on of these permissions is not granted to the user, the method will fail.
      Parameters:
      id - id of the template
      request - request containing the list of folders and other data
      Returns:
      generic response
      Throws:
      Exception
    • unlink

      @POST @Path("/unlink") GenericResponse unlink(MultiLinkRequest request) throws Exception
      Unlink the given templates from the given folders. For unlinking templates from folders, the user must have the following permissions:
      • edit the template (which includes viewing the template)
      • link templates to all target folders (which includes viewing folder and viewing templates in the folder)
      If at least on of these permissions is not granted to the user, the method will fail.
      Parameters:
      request - request containing the list of folders and other data
      Returns:
      generic response
      Throws:
      Exception
    • tagStatus

      @GET @Path("/{id}/tagstatus") TagStatusResponse tagStatus(@PathParam("id") String id, @BeanParam SortParameterBean sort, @BeanParam FilterParameterBean filter, @BeanParam PagingParameterBean paging) throws Exception
      Get the tag status for a template. The tag status will contain a list of all template tags, which are editable in pages together with the count of pages in sync, out of sync, incompatible or missing.
      The result can be filtered by
      • name
      and sorted by
      • name
      Parameters:
      id - template ID
      sort - sort parameters
      filter - filter parameters
      paging - paging parameters
      Returns:
      response
      Throws:
      Exception
    • copy

      @POST @Path("/{id}/copy") TemplateLoadResponse copy(@PathParam("id") String id, TemplateCopyRequest request) throws Exception
      Create a copy of the template
      Parameters:
      id - template id
      request - copy request
      Returns:
      response containing the generated copy
      Throws:
      Exception