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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Create or update the given reference data set.boolean
delete()
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
-
Method Details
-
setClientCode
Set 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
-
setName
Set the name of the reference data set.- Parameters:
name
- the name of the reference data- Returns:
- the service object
-
setLocale
Set the locale of the reference data set.- Parameters:
locale
- the locale of the reference data- Returns:
- the service object
-
setCacheTimeout
Set 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
-
setDataType
Set the data type of the reference data set [ CSV | JSON | XML ].- Parameters:
type
- the data type of the reference data- Returns:
- the service object
-
setValue
Set the value of the reference data set.- Parameters:
value
- the locale of the reference data- Returns:
- the service object
-
setFileValue
Set 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
-
createOrUpdate
public void createOrUpdate()Create or update the given reference data set. -
delete
public boolean delete()Delete the specified organization reference data set.- Returns:
- if the reference data set was found and deleted or false if not found
-