Package com.avoka.tm.svc
Class RefDataSvc
java.lang.Object
com.avoka.tm.svc.RefDataSvc
Provides a Reference Data Service.
Examples
Please find the reference data service examples below.
Create CSV Reference Data with File Upload
This Groovy example shows how to create or update CSV reference data set using FileItem file upload value.
 import com.avoka.tm.svc.RefDataSvc
 import org.apache.commons.fileupload.FileItem
 // Uploaded CSV format product list
 FileItem productsFileItem = ...
 new RefDataSvc()
     .setName("Product List")
     .setLocale("en_US")
     .setDataType("CSV")
     .setFileValue(productsFileItem)
     .createOrUpdate() 
 Create JSON Reference Data
This Groovy example shows how to create or update JSON reference data set.
 import com.avoka.tm.svc.RefDataSvc
 String addressesJson = ...
 new RefDataSvc()
     .setName("Addresses")
     .setLocale("en_US")
     .setDataType("JSON")
     .setValue(addressesJson)
     .createOrUpdate() 
 Delete Reference Data Set
This Groovy example shows how to delete a reference data set.
 import com.avoka.tm.svc.RefDataSvc
 new RefDataSvc()
     .setName("Addresses")
     .setLocale("en_US")
     .delete() - Since:
- 17.10.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCreate or update the given reference data set.booleandelete()Delete the specified organization reference data set.setCacheTimeout(int timeout) Set the cache timeout is seconds for the reference data set.setClientCode(String clientCode) Set the reference data set organization client code.setDataType(String type) Set the data type of the reference data set [ CSV | JSON | XML ].setFileValue(org.apache.commons.fileupload.FileItem fileValue) Set the file item value for the reference data set.Set the locale of the reference data set.Set the name of the reference data set.Set the value of the reference data set.
- 
Constructor Details- 
RefDataSvcpublic RefDataSvc()
 
- 
- 
Method Details- 
setClientCodeSet the reference data set organization client code. Generally this is not required as the service executes in a client organization security context.- Parameters:
- clientCode- reference data organization client code
- Returns:
- the service object
 
- 
setNameSet the name of the reference data set.- Parameters:
- name- the name of the reference data
- Returns:
- the service object
 
- 
setLocaleSet the locale of the reference data set.- Parameters:
- locale- the locale of the reference data
- Returns:
- the service object
 
- 
setCacheTimeoutSet the cache timeout is seconds for the reference data set.- Parameters:
- timeout- the cache timeout is seconds for the reference data set
- Returns:
- the service object
 
- 
setDataTypeSet the data type of the reference data set [ CSV | JSON | XML ].- Parameters:
- type- the data type of the reference data
- Returns:
- the service object
 
- 
setValueSet the value of the reference data set.- Parameters:
- value- the locale of the reference data
- Returns:
- the service object
 
- 
setFileValueSet the file item value for the reference data set. If a FileItem value is specified this will be used in preference to a value parameter.- Parameters:
- fileValue- the file item value for the reference data
- Returns:
- the service object
 
- 
createOrUpdatepublic void createOrUpdate()Create or update the given reference data set.
- 
deletepublic boolean delete()Delete the specified organization reference data set.- Returns:
- if the reference data set was found and deleted or false if not found
 
 
-