Interface TemplateResource
@Path("/template")
public interface TemplateResource
Resource used for loading, saving and manipulating GCN templates.
-
Method Summary
Modifier and TypeMethodDescriptioncopy
(String id, TemplateCopyRequest request) Create a copy of the templatecreate
(TemplateCreateRequest request) Create a new templatejavax.ws.rs.core.Response
Delete the template with given idfolders
(String id, SortParameterBean sort, FilterParameterBean filter, PagingParameterBean paging) Get the folders to which the template is assigned.
The result can be filtered byid
name
description
and sorted byid
name
description
Load the template with the given id and return it.getTags
(String id, Integer skipCount, Integer maxItems, TagSortAttribute sortBy, SortOrder sortOrder, String search) Deprecated.because new endpoint exists.link
(MultiLinkRequest request) Link the given templates to the given folders.link
(String id, LinkRequest request) Link the given template to the given folders.list
(List<String> nodeIds, FilterParameterBean filterParams, SortParameterBean sortingParams, PagingParameterBean pagingParams, PermsParameterBean perms, TemplateListParameterBean listParams) List templates assigned to the given list of nodes.
The result can be filtered byid
name
description
and sorted byid
name
description
cdate
edate
listTags
(String id, FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, EmbedParameterBean embed) Get the list of template tags for this templateDeprecated.UseGET /template/{id}
insteadnodes
(String id, SortParameterBean sort, FilterParameterBean filter, PagingParameterBean paging) Get the nodes to which the template is assigned.
The result can be filtered byid
name
and sorted byid
name
tagStatus
(String id, SortParameterBean sort, FilterParameterBean filter, PagingParameterBean paging) Get the tag status for a template.unlink
(MultiLinkRequest request) Unlink the given templates from the given folders.unlink
(String id, LinkRequest request) Unlink the given template from the given folders.Unlock a templateupdate
(String id, TemplateSaveRequest request) Update the template with given id
-
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 byid
name
description
id
name
description
cdate
edate
- Parameters:
nodeIds
- list of node IDsfilterParams
- filter parameterssortingParams
- sorting parameterspagingParams
- paging parametersperms
- 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 idupdate
- true when the template shall be locked, false if notconstruct
- 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 byid
name
description
id
name
description
- Parameters:
id
- template IDsort
- sort parametersfilter
- filter parameterspaging
- 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 byid
name
id
name
- Parameters:
id
- template IDsort
- sort parametersfilter
- filter parameterspaging
- 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.UseGET /template/{id}
insteadLoad the template with the given id and return it.- Parameters:
id
- The template idnodeId
- 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)
insteadGet 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 idfilter
- filter parameters. Possible filter fields are (id, globalId, constructId, name, enabled)sorting
- sorting parameterspaging
- paging parametersembed
- 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)
- Parameters:
id
- id of the templaterequest
- request containing the list of folders and other data- Returns:
- generic response
- Throws:
Exception
-
link
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)
- 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)
- Parameters:
id
- id of the templaterequest
- request containing the list of folders and other data- Returns:
- generic response
- Throws:
Exception
-
unlink
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)
- 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 byname
name
- Parameters:
id
- template IDsort
- sort parametersfilter
- filter parameterspaging
- 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 idrequest
- copy request- Returns:
- response containing the generated copy
- Throws:
Exception
-