Package com.ads.services.webservice.rest
Class BusinessGlossaryResource
java.lang.Object
com.ads.services.webservice.rest.BusinessGlossaryResource
@RestController
@RequestMapping("/api/businessglossarymanager")
public class BusinessGlossaryResource
extends Object
Contains the methods related to perform the operations such as creation,
update, deletion and retrieval of Catalogs, AssetTypes, Business Objects
etc.
All the REST methods have return type ResponseEntity.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntitycreateAssetTypes(List<AssetType> assetTypes) Creates the assetType for the given assetType object in the form of JSON.org.springframework.http.ResponseEntitycreateBusinessAssets(List<BusinessObject> businessAssets) Creates the businessAssets for the given input list of assets.org.springframework.http.ResponseEntitycreateCatalogs(List<Catalog> catalogs, int fillOptions) Creates the list of catalogs for the given catalog objects list.org.springframework.http.ResponseEntitydeleteAssetTypes(String assetTypeIds) Deletes the list of assetTypes for the specified list of assetTypeIds.org.springframework.http.ResponseEntitydeleteCatalogs(Node.NodeType nodeType, String catalogIds) Deletes the catalogs for the specified list of catalogIds.org.springframework.http.ResponseEntitydeleteObjects(Node.NodeType nodeType, String businessAssetIds) Deletes the businessObjects for the specified list of businessAssetIds and nodeType.org.springframework.http.ResponseEntitygetAssetType(int assetTypeId) Returns the assetType object for the specified assetTypeId.org.springframework.http.ResponseEntitygetAssetTypeId(String assetTypeName) Returns the assetType Id for the specified assetTypeName.org.springframework.http.ResponseEntitygetAssetTypes(String assetTypeIds, int page, int per_page) Returns the list of asstetType objects for the given assetTypeIds.org.springframework.http.ResponseEntitygetBusinessAsset(Node.NodeType nodeType, int businessAssetId) Returns the businessAsset(Business object) for the specified businessAssetId and nodeType.org.springframework.http.ResponseEntitygetBusinessAssetId(String assetTypeName, String catalogPath, String businessAssetName) Returns the id of businessAsset(Business object) for the specified assetTypeName, catalogPath and businessAssetName.org.springframework.http.ResponseEntitygetBusinessAssets(Node.NodeType nodeType, String businessAssetIds, int page, int per_page) Returns the list of businessAsset((Business object) for the specified list of businessAssetIds and nodeType.org.springframework.http.ResponseEntitygetBusinessAssetsByCatalogId(Node.NodeType nodeType, int catalogId, int page, int per_page) org.springframework.http.ResponseEntitygetCatalog(int catalogId) Returns the catalog object for the specified catalogId.org.springframework.http.ResponseEntitygetCatalogId(String assetTypeName, String catalogPath) Returns the catalogId for the specified assetTypeName and catalogPath.org.springframework.http.ResponseEntitygetCatalogPath(String nodeType, int catalogId) Returns the catalog path for the specified nodeType and catalogId.org.springframework.http.ResponseEntitygetCatalogs(String catalogIds, int fillOptions, int page, int per_page) Returns the list of catalog objects for the given catalogIds.org.springframework.http.ResponseEntitygetCatalogsByAssetTypeId(int assetTypeId, int fillOptions, int page, int per_page) org.springframework.http.ResponseEntityupdateAssetTypes(List<AssetType> assetTypes) Updates the assetTypes for the specified list of assetType objects.org.springframework.http.ResponseEntityupdateBusinessAssets(List<BusinessObject> businessAssets) Updates the businessAssets for the given input list of assets(businessObjects list).org.springframework.http.ResponseEntityupdateCatalogs(List<Catalog> catalogs, int fillOptions) Updates the list of catalogs for the given catalog objects list.
-
Field Details
-
request
@Autowired public jakarta.servlet.http.HttpServletRequest request
-
-
Constructor Details
-
BusinessGlossaryResource
public BusinessGlossaryResource()
-
-
Method Details
-
createAssetTypes
@PostMapping(path="/assets/types", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity createAssetTypes(@RequestBody List<AssetType> assetTypes) throws Exception Creates the assetType for the given assetType object in the form of JSON. Specifying the name and title are mandatory, while creating the assetType. The created assetType is shown in Business Glossary Module only if enabled value in the given JSON is true.- Parameters:
assetTypes- List- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
createBusinessAssets
@PostMapping(path="/assets", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity createBusinessAssets(@RequestBody List<BusinessObject> businessAssets) throws Exception Creates the businessAssets for the given input list of assets. Here the businessAssets can be Business Terms, Business Policies, Business Rules or Custom Objects. Specifying the nodeType, objectName and catalogTypeId in each businessObject are mandatory.
NodeType can be either BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM. Depending upon the nodeType, catalogTypeId will be either BGM_TERM_CATALOG_ID, BGM_RULE_CATALOG_ID, BGM_POLICY_CATALOG_ID etc..- Parameters:
businessAssets- List- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
updateAssetTypes
@PutMapping(path="/assets/types", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity updateAssetTypes(@RequestBody List<AssetType> assetTypes) throws Exception Updates the assetTypes for the specified list of assetType objects. All the information pertaining to the assetTypes can be updated.
Specifying the id, name and title in each asseType object are mandatory to update the assetTypes.- Parameters:
assetTypes- List- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
updateBusinessAssets
@PutMapping(path="/assets", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity updateBusinessAssets(@RequestBody List<BusinessObject> businessAssets) throws Exception Updates the businessAssets for the given input list of assets(businessObjects list). Here the businessAssets can be Business Terms, Business Policies, Business Rules or Custom Objects.
All the information pertaining to the businessAssets can be updated. Specifying the businessAsset id and catalogId in each businessAsset object are mandatory to update the businessAssets.- Parameters:
businessAssets- List- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
deleteAssetTypes
@DeleteMapping(path="/assets/types", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity deleteAssetTypes(@RequestParam(name="assetTypeIds") String assetTypeIds) throws Exception Deletes the list of assetTypes for the specified list of assetTypeIds. Specifying the assetTypeIds with comma separator is mandatory.
If the assetTypes are deleted all its associated data will also be deleted.- Parameters:
assetTypeIds- String- Returns:
- Response
- Throws:
Exception- sample for assetTypeIds ==>1,2,3.- Since:
- 12.1
-
deleteCatalogs
@DeleteMapping(path="/catalogs", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity deleteCatalogs(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="catalogIds") String catalogIds) throws Exception Deletes the catalogs for the specified list of catalogIds. Specifying the catalogIds list with comma separator is mandatory to delete catalogs.
If the catalogs are deleted all its associated data will also be deleted.- Parameters:
catalogIds- StringnodeType- String- Returns:
- Response
- Throws:
Exception- sample for catalogIds ==>1,2,3.- Since:
- 12.1
-
deleteObjects
@DeleteMapping(path="/assets", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity deleteObjects(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="businessAssetIds") String businessAssetIds) throws Exception Deletes the businessObjects for the specified list of businessAssetIds and nodeType. Specifying the businessAssetIds list and nodeType are mandatory to delete businessObjects.
If the businessObjects are deleted all its associated data will also be deleted.
NodeType can be either BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM.Depending upon the nodeType, businessObjectId will be either BGM_TERM_ID, BGM_RULE_ID, BGM_POLICY_ID etc..- Parameters:
nodeType- Node.NodeType - valid types - BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM.businessAssetIds- String- Returns:
- Response
- Throws:
Exception- sample for businessAssetIds ==>1,2,3.- Since:
- 12.1
-
getAssetType
@GetMapping(path="/assets/types/{type_id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getAssetType(@PathVariable(name="type_id") int assetTypeId) throws Exception Returns the assetType object for the specified assetTypeId. Specifying the assetTypeId is mandatory.
It returns all the details of the assetType like id, name, description, title, objectTypeId and catalogTypeId.- Parameters:
assetTypeId- int- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
getAssetTypes
@GetMapping(path="/assets/types", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getAssetTypes(@RequestParam(name="assetTypeIds",required=false) String assetTypeIds, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception Returns the list of asstetType objects for the given assetTypeIds. Specifying the assetTypeIds with comma separator is mandatory.
It returns all the details like id, name, description, title, objectTypeId and catalogTypeId.
Note: Pagination is applied, and by default, 25 records are displayed per page.- Parameters:
assetTypeIds- Stringpage- The page number to retrieve (1-indexed).per_page- The number of records to display per page.- Returns:
- Response
- Throws:
Exception- sample for assetTypeIds ==> 1,2,3.- Since:
- 12.1
-
getCatalog
@GetMapping(path="/catalogs/{catalog_id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getCatalog(@PathVariable(name="catalog_id") int catalogId) throws Exception Returns the catalog object for the specified catalogId. Specifying the catalogId is mandatory.
It returns all the details like catalogName, description, parentCatalogId, catalogTypeId and auditHistory details.- Parameters:
catalogId- int- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
getCatalogs
@GetMapping(path="/catalogs", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getCatalogs(@RequestParam(name="catalogIds",required=false) String catalogIds, @RequestParam(name="fillOptions",defaultValue="0") int fillOptions, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception Returns the list of catalog objects for the given catalogIds. Specifying the catalogIds as like JsonArray is mandatory.
It returns all the details like catalogName, description, parentCatalogId, catalogTypeId and auditHistory details.
Here fillOptions parameter takes value ofAPIConstants.BGMFillOptions.CATALOG_EXTENDED_PROPERTIESBased on the fillOptions value passed, the fields(extended properties) are created along with the catalog object. The default integer value for fillOptions is 0(zero).
Note: Pagination is applied, and by default, 25 records are displayed per page.- Parameters:
fillOptions- intAPIConstants.BGMFillOptions.catalogIds- Stringpage- The page number to retrieve (1-indexed).per_page- The number of records to display per page.- Returns:
- Response
- Throws:
Exception- sample for catalogIds ==> 1,2,3.- Since:
- 12.1
-
getCatalogsByAssetTypeId
@GetMapping(path="/catalogs/assetTypeId", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getCatalogsByAssetTypeId(@RequestParam(name="assetTypeId") int assetTypeId, @RequestParam(name="fillOptions",defaultValue="0") int fillOptions, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception - Throws:
Exception
-
getBusinessAssetsByCatalogId
@GetMapping(path="/assets/catalogId", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getBusinessAssetsByCatalogId(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="catalogId") int catalogId, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception - Throws:
Exception
-
getCatalogPath
@GetMapping(path="/catalogs/{catalog_id}/path", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getCatalogPath(@RequestParam(name="nodeType") String nodeType, @PathVariable(name="catalog_id") int catalogId) throws Exception Returns the catalog path for the specified nodeType and catalogId. Specifying the nodeType and catalogId are mandatory.
NodeType can be either BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM. Depending upon the nodeType, catalogId will be either BGM_TERM_CATALOG_ID, BGM_RULE_CATALOG_ID, BGM_POLICY_CATALOG_ID etc..
It returns the complete catalogPath of the given catalogId.- Parameters:
nodeType- String - Valid values: BGM_TERM, BGM_POLICY, BGM_RULE and for Custom types it will be the name of asset type.catalogId- int- Returns:
- String
- Throws:
Exception- Since:
- 12.1
-
getBusinessAsset
@GetMapping(path="/assets/{asset_id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getBusinessAsset(@RequestParam(name="nodeType") Node.NodeType nodeType, @PathVariable(name="asset_id") int businessAssetId) throws Exception Returns the businessAsset(Business object) for the specified businessAssetId and nodeType. Specifying the businessAssetId and nodeType are mandatory.
NodeType can be either BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM. Depending upon the nodeType, businessAssetId will be either BGM_TERM_ID, BGM_RULE_ID, BGM_POLICY_ID etc..- Parameters:
nodeType- Node.NodeType - valid types - BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM.businessAssetId- int- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
getBusinessAssets
@GetMapping(path="/assets", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity getBusinessAssets(@RequestParam(name="nodeType") Node.NodeType nodeType, @RequestParam(name="businessAssetIds") String businessAssetIds, @RequestParam(name="page",defaultValue="1") int page, @RequestParam(name="per_page",defaultValue="25") int per_page) throws Exception Returns the list of businessAsset((Business object) for the specified list of businessAssetIds and nodeType. Specifying the list of businessAssetIds and nodeType are mandatory.
NodeType can be either BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM. Depending upon the nodeType, businessAssetId will be either BGM_TERM_ID, BGM_RULE_ID, BGM_POLICY_ID etc..
Note: Pagination is applied, and by default, 25 records are displayed per page.- Parameters:
nodeType- Node.NodeType - valid types - BGM_TERM, BGM_RULE, BGM_POLICY, BGM_CUSTOM.businessAssetIds- Stringpage- The page number to retrieve (1-indexed).per_page- The number of records to display per page.- Returns:
- Response
- Throws:
Exception- sample for businessAssetIds ==>1,2,3.- Since:
- 12.1
-
createCatalogs
@PostMapping(path="/catalogs", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity createCatalogs(@RequestBody List<Catalog> catalogs, @RequestParam(name="fillOptions",defaultValue="0") int fillOptions) throws Exception Creates the list of catalogs for the given catalog objects list. Specifying the catalogName and catalogTypeId in each catalog object are mandatory, while creating the catalogs. To create a sub catalog specifying the parentCatalogId is mandatory.
Here fillOptions parameter takes value ofAPIConstants.BGMFillOptions.CATALOG_EXTENDED_PROPERTIESBased on the fillOptions value passed, the fields(extended properties) are created along with the catalog object. The default integer value for fillOptions is 0(zero).- Parameters:
catalogs- ListfillOptions- intAPIConstants.BGMFillOptions.- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
updateCatalogs
@PutMapping(path="/catalogs", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity updateCatalogs(@RequestBody List<Catalog> catalogs, @RequestParam(name="fillOptions",defaultValue="0") int fillOptions) throws Exception Updates the list of catalogs for the given catalog objects list. All the information pertaining to the catalogs can be updated.
Specifying the catalogId and catalogName in each catalog object are mandatory to update the catalogs.
Here fillOptions parameter takes value ofAPIConstants.BGMFillOptions.CATALOG_EXTENDED_PROPERTIESBased on the fillOptions value passed, the fields(extended properties) are updated along with the catalog object. The default integer value for fillOptions is 0(zero).- Parameters:
catalogs- ListfillOptions- intAPIConstants.BGMFillOptions.- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
getAssetTypeId
@GetMapping(path="/assets/types/id") public org.springframework.http.ResponseEntity getAssetTypeId(@RequestParam(name="assetTypeName") String assetTypeName) throws Exception Returns the assetType Id for the specified assetTypeName. Specifying the assetTypeName is mandatory.
Here the assetName can be either Business Terms, Business Policies, Business Rules and for custom objects it will be the name given in settings while creating the assetType.- Parameters:
assetTypeName- String- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
getCatalogId
@GetMapping("/catalogs/id") public org.springframework.http.ResponseEntity getCatalogId(@RequestParam(name="assetTypeName") String assetTypeName, @RequestParam(name="catalogPath") String catalogPath) throws Exception Returns the catalogId for the specified assetTypeName and catalogPath. Specifying the assetTypeName and catalogPath are mandatory.
Here the assetName can be either Business Terms, Business Policies, Business Rules and for custom objects it will be the name given in settings while creating the assetType. The catalogPath value will be catalogPath+catalogName.
It returns the catalogId- Parameters:
assetTypeName- StringcatalogPath- String - ex: Catalog1/Catalog2/Catalog3- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-
getBusinessAssetId
@GetMapping("/assets/id") public org.springframework.http.ResponseEntity getBusinessAssetId(@RequestParam(name="assetTypeName") String assetTypeName, @RequestParam(name="catalogPath") String catalogPath, @RequestParam(name="businessAssetName") String businessAssetName) throws Exception Returns the id of businessAsset(Business object) for the specified assetTypeName, catalogPath and businessAssetName. Specifying the assetTypeName, catalogPath and businessAssetName are mandatory.
Here the assetTypeName can be either Business Terms, Business Policies, Business Rules and for custom objects it will be the name given in settings while creating the assetType. The catalogPath value will be catalogPath+catalogName.- Parameters:
assetTypeName- StringcatalogPath- String - ex: Catalog1/Catalog2/Catalog3businessAssetName- String- Returns:
- Response
- Throws:
Exception- Since:
- 12.1
-