Package com.ads.services.webservice.rest
Class TagResource
java.lang.Object
com.ads.services.webservice.rest.TagResource
Contains the methods which performs the operations like creation, update,
deletion and retrieval of tags.
All the REST methods have return type ResponseEntity.
All the REST methods have return type ResponseEntity.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntityInserts list of tags for the specified list of tag objects.org.springframework.http.ResponseEntityassociateTags(Node.NodeType nodeType, String objectIds, String tagNames) List of tags are associated to the object for the specified nodeType and objectIds.org.springframework.http.ResponseEntityclearTags(Node.NodeType nodeType, String objectIds) Clears the tags for the specified nodeType and nodeId.org.springframework.http.ResponseEntitydeleteTags(String tagIds) Removes tags for the specified list of tagIds.org.springframework.http.ResponseEntitydissociateTags(Node.NodeType nodeType, String objectIds, String tagNames) List of tags are dissociated from the object for the specified nodeType, objectIds and list of tagNames.org.springframework.http.ResponseEntitygetAssociatedTags(Node.NodeType nodeType, int objectId, int page, int per_page) Returns the list of associated tags of the specified nodeType and objectId(nodeId).org.springframework.http.ResponseEntitygetTagAssociations(String tagName, boolean fillInfo, int page, int per_page) Returns the list of associated tags of the specified nodeType and nodeId.org.springframework.http.ResponseEntityReturns the tagId for the specified tagName.org.springframework.http.ResponseEntityReturns the list of all available tags in master configuration or a specific list for given tagIds.org.springframework.http.ResponseEntitypublishTags(String tagIds, boolean state) The tags are published or unpublished for the specified list of tagIds and state.org.springframework.http.ResponseEntityupdateTags(List<Tag> tags) Updates the list of tags for the specified list of tag objects.
-
Field Details
-
request
@Autowired public jakarta.servlet.http.HttpServletRequest request
-
-
Constructor Details
-
TagResource
public TagResource()
-
-
Method Details
-
addTags
@PostMapping(path="/tags", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity addTags(@RequestBody List<Tag> tags) throws Exception Inserts list of tags for the specified list of tag objects. Each tag object should contain all the details pertaining to tag such as tag name, description, scopeObjectTypes etc.. where Specification of tag name and scopeObjectTypes in each tag object is mandatory. The names of the objects in the scopeObjectTypes list should be the same as object names displayed in the master configuration of Enterprise tags.- Parameters:
tags- List- Returns:
- Response
- Throws:
Exception-
Sample 'Tag' JSON : [
{
"description": "",
"published": true,
"scopeObjectTypes": [],
"auditHistory": null
},
{
"name": "",
"description": "",
"published": true,
"scopeObjectTypes": [],
"auditHistory": null
}
]- Since:
- 14.0
-
updateTags
@PutMapping(path="/tags", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity updateTags(@RequestBody List<Tag> tags) throws Exception Updates the list of tags for the specified list of tag objects. All the information pertaining to the tags can be updated. Specifying the tag id and tag name scopeObjectTypes list are mandatory in each tag object to update the tags. The names of the objects in the scopeObjectTypes list should be the same as object names displayed in the master configuration of Enterprise tags.- Parameters:
tags- List- Returns:
- Response
- Throws:
Exception-
Sample 'Tag' JSON : [
{
"id": "",
"name": "",
"description": "",
"published": true,
"scopeObjectTypes": [],
"auditHistory": null
},
{
"id": "",
"name": "",
"description": "",
"published": true,
"scopeObjectTypes": [],
"auditHistory": null
}
]- Since:
- 14.0
-
deleteTags
@DeleteMapping(path="/tags", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity deleteTags(@RequestParam(name="tagIds") String tagIds) throws Exception Removes tags for the specified list of tagIds. Specifying the list of tagIds is mandatory. Tags are deleted only if they are not associated with any objects.
If the tags are deleted all its associated data will also be deleted- Parameters:
tagIds- String- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
publishTags
@PostMapping(path="/tags/publish", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity publishTags(@RequestParam(name="tagIds") String tagIds, @RequestParam(name="state") boolean state) throws Exception The tags are published or unpublished for the specified list of tagIds and state. Specifying the tagIds list and state is mandatory. If the value of state is true the tags are published, if it is false the tags are unpublished- Parameters:
tagIds- Stringstate- boolean- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
clearTags
@PostMapping(path="/tags/clear", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity clearTags(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="objectIds") String objectIds) throws Exception Clears the tags for the specified nodeType and nodeId. Specifying the nodeType and nodeId are mandatory to clear the tags. i.e.,it removes all the tags associated from the object.
If the tags are deleted all its associated data will also be deleted.- Parameters:
nodeType- Node.NodeTypeobjectIds- String- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
getTagId
@GetMapping(path="/tag/id", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getTagId(@RequestParam(name="tagName") String tagName) throws Exception Returns the tagId for the specified tagName. Specifying the tag name is mandatory, based on the tag name, method will return the tagId.- Parameters:
tagName- String- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
getTags
@GetMapping(path="/tags", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getTags(@RequestParam(name="tagIds",required=false) String tagIds, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception Returns the list of all available tags in master configuration or a specific list for given tagIds.
Each returned tag object contains all the details of tag such as tag id name, description, scopeObjectTypes, auditHistory etc..
Note: Pagination is applied, and by default, 25 records are displayed per page.- Parameters:
tagIds- Stringpage- intper_page- int- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
getAssociatedTags
@GetMapping(path="/object/tags", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getAssociatedTags(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="objectId") int objectId, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception Returns the list of associated tags of the specified nodeType and objectId(nodeId). Specifying the nodeType and objectId are mandatory.
Note: Pagination is applied, and by default, 25 records are displayed per page.- Parameters:
nodeType- Node.NodeTypeobjectId- intpage- intper_page- int- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
associateTags
@PostMapping(path="/tags/associate", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity associateTags(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="objectIds") String objectIds, @RequestParam(name="tagNames") String tagNames) throws Exception List of tags are associated to the object for the specified nodeType and objectIds. Specification of nodeType, objectIds and list of tagNames is mandatory.- Parameters:
nodeType- Node.NodeTypeobjectIds- StringtagNames- String- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
dissociateTags
@PostMapping(path="/tags/dissociate", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity dissociateTags(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="objectIds") String objectIds, @RequestParam(name="tagNames") String tagNames) throws Exception List of tags are dissociated from the object for the specified nodeType, objectIds and list of tagNames. Specification of nodeType, objectIds and list of tagNames is mandatory.- Parameters:
nodeType- Node.NodeTypeobjectIds- StringtagNames- String- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-
getTagAssociations
@GetMapping(path="/tags/associations", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getTagAssociations(@RequestParam(name="tagName") String tagName, @RequestParam(name="fillInfo",required=false) boolean fillInfo, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception Returns the list of associated tags of the specified nodeType and nodeId. Specifying the nodeType and nodeId are mandatory.
Note: Pagination is applied, and by default, 25 records are displayed per page.- Parameters:
tagName- STringfillInfo- booleanpage- intper_page- int- Returns:
- Response
- Throws:
Exception- Since:
- 14.0
-