Class TagResource

java.lang.Object
com.ads.services.webservice.rest.TagResource

@RestController @RequestMapping("/api/miscellaneous") public class TagResource extends Object
Contains the methods which performs the operations like creation, update, deletion and retrieval of tags.
All the REST methods have return type ResponseEntity.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    jakarta.servlet.http.HttpServletRequest
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity
    addTags(List<Tag> tags)
    Inserts list of tags for the specified list of tag objects.
    org.springframework.http.ResponseEntity
    associateTags(Node.NodeType nodeType, String objectIds, String tagNames)
    List of tags are associated to the object for the specified nodeType and objectIds.
    org.springframework.http.ResponseEntity
    clearTags(Node.NodeType nodeType, String objectIds)
    Clears the tags for the specified nodeType and nodeId.
    org.springframework.http.ResponseEntity
    Removes tags for the specified list of tagIds.
    org.springframework.http.ResponseEntity
    dissociateTags(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.ResponseEntity
    getAssociatedTags(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.ResponseEntity
    getTagAssociations(String tagName, boolean fillInfo, int page, int per_page)
    Returns the list of associated tags of the specified nodeType and nodeId.
    org.springframework.http.ResponseEntity
    getTagId(String tagName)
    Returns the tagId for the specified tagName.
    org.springframework.http.ResponseEntity
    getTags(String tagIds, int page, int per_page)
    Returns the list of all available tags in master configuration or a specific list for given tagIds.
    org.springframework.http.ResponseEntity
    publishTags(String tagIds, boolean state)
    The tags are published or unpublished for the specified list of tagIds and state.
    org.springframework.http.ResponseEntity
    Updates the list of tags for the specified list of tag objects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 - String
      state - 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.NodeType
      objectIds - 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 - String
      page - int
      per_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.NodeType
      objectId - int
      page - int
      per_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.NodeType
      objectIds - String
      tagNames - 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.NodeType
      objectIds - String
      tagNames - 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 - STring
      fillInfo - boolean
      page - int
      per_page - int
      Returns:
      Response
      Throws:
      Exception
      Since:
      14.0