Java API for Designing Dataset Relationship

Java API for Designing Dataset Relationship

Applies to: Kyvos Enterprise  Kyvos Cloud (SaaS on AWS) Kyvos AWS Marketplace

Kyvos Azure Marketplace   Kyvos GCP Marketplace Kyvos Single Node Installation (Kyvos SNI)


Overview

  1. Create a DRD Object.

  2. Create the layout object by passing the dataset name and add this layout object to the DRD.

  3. Create the relation object and add Join to it.

  4. Save the DRD object in the repository.

  5. Delete dataset from DRD.

  6. Retrieve existing DRD object from repository by name.

  7. Update existing DRD object in repository.

Example

  1. Create the DRD Object.

    /*  * method to create new Dataset Relationship object in Repository Manager.  * @param requestorUserInfo: Object of type UserInfo.  * @return DRDObject: Object of type DRDObject. */ public DRDObject createDRDObject(UserInfo requestorUserInfo);
  2. Create the DRDDataSetLayout.

    /** * method to add dataset in DatasetRelationship. * @param doName: Name of Dataset/Registered File to be added. */ public void addDRDDataSetLayout(String doName); /** * method to add dataset inside folder to DatasetRelationship. * @param doName: Name of Dataset/Registered File to be added. * @param folderName: Name of the folder that contains dataset/register file. */ public void addDRDDataSetLayout(String doName, String folderName);
  3. Add the DRDRelation between two dataset fields.

    /*  * method to set relation between dataset fields in DatasetRelationship.  * @param srcDSName: Name of source dataset to be added.  * @param srcDSName: Name of destination dataset to be added.  * @param srcFieldName: Name of source field.  * @param destFieldName: Name of destination field.  * @return drdRelation: Object of type DRDRelation. */ public DRDRelation addDrdRelation(String srcDSName, String destDSName, String srcFieldName, String destFieldName);
  4. Save the DRD Object in the repository.

    /** * method to add new DatasetRelationship object in Repository Manager. * @param drdObject: Object of type DatasetRelationship. * @return ResponseStatus: Object of type ResponseStatus. */ public ResponseStatus addDatasetRelationshipObject(DatasetRelationship drdObject); /** * method to add new DatasetRelationship object inside a folder in Repository Manager. * @param drdObject: Object of type DatasetRelationship. * @param folderName: Name of the folder in which DatasetRelationship has to be added. * @return ResponseStatus: Object of type ResponseStatus. */ public ResponseStatus addDatasetRelationshipObject(DatasetRelationship drdObject, String folderName);
  5. API to delete dataset used in DRD.

    /** * method to delete dataset used in DatasetRelationship. * @param datasetName: Name of the dataset to be deleted. */ public void deleteDRDDataSetLayout(String datasetName);
  6. API to retrieve existing DRD object from repository by name.

    /** * method to get DatasetRelationship object by datasetRelationship name in Repository Manager. * @param drdName: Name of the datasetRelationship. * @param userInfo: Object of type UserInfo containing information about logged in user. * @return datasetRelationshipObj: Object of type DatasetRelationship. */ public DatasetRelationship getDatasetRelationshipByName(String drdName, UserInfo userInfo); /** * method to get DatasetRelationship object by datasetRelationship name and folder name in Repository Manager. * @param drdName: Name of the datasetRelationship. * @param folderName: Name of the folder that contains datasetRelationship. * @param userInfo: Object of type UserInfo containing information about logged in user. * @return datasetRelationshipObj Object of type DatasetRelationship. */ public DatasetRelationship getDatasetRelationshipByName(String drdName, String folderName, UserInfo userInfo);
  7. API to update existing DRD object in repository.

    /** * method to update existing DatasetRelationship object in Repository Manager. * @param datasetRelationshipObj: Object of type DatasetRelationship. */ public void updateDatasetRelationshipObject(DatasetRelationship datasetRelationshipObj);
  8. Set all the internal objects of the DRD.

    /** * DRDObject constructor with DRDObject xml - to create DatasetRelationship object with passed DRDObject xml * @param xml string xml of DRDObject */ public DRDObject(String xml)
  9. Set the view type of a DRD.

    /** * Method to set drd view type. * @param viewType */ public void setViewType(String viewType)
  10.  Add node in the DRD. 

    /** * Method to add a node into DRD. * @param nodeId * @param node */ public void addNode(String nodeId, DRDObject.DRDDatasetDetails node)
  11. Get the DRD join by a list

    /** * Method returns DRDJoinBy list which holds joins for a relation. * @return ArrayList<DRDJoinBy> */ public List<DRDJoinBy> getDRDJoinByList()

Sample code

public static void designDRD(RepositoryManager repManager, UserInfo userInfo) throws ReportObjectException { DatasetRelationship drd = repManager.createDatasetRelationshipObject(userInfo); drd.setName("APITest"); drd.addDRDDataSetLayout("FileName", "FileFolderName"); drd.addDrdRelation("SourceFileName", "DestFileName", "SourceFieldName", "DestFieldName"); repManager.addDatasetRelationshipObject(drd, "FolderNameToSaveDRD"); }

 

Copyright Kyvos, Inc. 2025. All rights reserved.