public class PropertyQuery
extends java.lang.Object
Provides a property value query service. Property values are cached in memory
for a period of 30 seconds to improve database performance. Examples Example
scripts are provided below.
Form Property Example
The example below get the "Product Codes" form version property value for the
form's current form version. The property value may be use in Form Prefill or
Dynamic Data services.
import com.avoka.tm.query.*
String value = new PropertyQuery()
.setName("Product Codes")
.setFormCode("PDS-12")
.getValue()
Organization Property Example
The example below will get the "Loan Types" Organization property value.
import com.avoka.tm.query.*
String value = new PropertyQuery()
.setName("Loan Types")
.setClientCode("maguire")
.getValue()
Form Space Property Example
The example below will get the "Locale Messages" Form Space property value.
import com.avoka.tm.query.*
String value = new PropertyQuery()
.setName("Locale Messages")
.setSpaceName("Work Space")
.getValue()
Transaction Property Lookup Example
The example below will get the "Saved Email" via the specified Txn value object.
This method will attempt to resolve the property value in the order: Form
Version Property Value Client Property Value Portal Property Value Deployment
Property Value
import com.avoka.tm.query.*
import com.avoka.tm.vo.*
Txn txn = ...
String value = new PropertyQuery()
.setName("Saved Email")
.setTxn(txn)
.getValue()
Cached Organization Reference Data Example
The example below will get the "maguire" organization's "Product Codes"
reference data. This query data will be cache the value in memory for a period
60 minutes.
import com.avoka.tm.query.*
String refData = new PropertyQuery()
.setName("Product Codes")
.setClientCode("maguire")
.setCacheTimeout(60)
.getValue()
- Since:
- 5.0.0
- See Also:
MemCache
Constructor Summary
Constructors
Constructor |
Description |
PropertyQuery() |
|
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type |
Method |
Description |
java.lang.String |
getValue() |
Return the property value for the query parameters.
|
PropertyQuery |
setCacheTimeout(int timeoutMins) |
Set the property query cache timeout in minutes.
|
PropertyQuery |
setClientCode(java.lang.String clientCode) |
Set the organization client code parameter.
|
PropertyQuery |
setFormCode(java.lang.String formCode) |
Set the form code parameter.
|
PropertyQuery |
setName(java.lang.String name) |
Set the property name parameter.
|
PropertyQuery |
setSpaceName(java.lang.String spaceName) |
Set the property space name parameter.
|
PropertyQuery |
setTxn(Txn txn) |
Set the transaction to resolve the property value against.
|
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString,
wait, wait, wait
Constructor Detail
PropertyQuery
public PropertyQuery()
Method Detail
setName
public PropertyQuery setName(java.lang.String name)
Set the property name parameter.
- Parameters:
name
- the property name
- Returns:
- the property query
setFormCode
public PropertyQuery setFormCode(java.lang.String formCode)
Set the form code parameter.
- Parameters:
formCode
- the property form code
- Returns:
- the property query
setClientCode
public PropertyQuery setClientCode(java.lang.String clientCode)
Set the organization client code parameter.
- Parameters:
clientCode
- the property client code
- Returns:
- the property query
setSpaceName
public PropertyQuery setSpaceName(java.lang.String spaceName)
Set the property space name parameter.
- Parameters:
spaceName
- the property space name
- Returns:
- the property query
setTxn
public PropertyQuery setTxn(Txn txn)
Set the transaction to resolve the property value against.
- Parameters:
txn
- the transaction to resolve the property against
- Returns:
- the property query
setCacheTimeout
public PropertyQuery setCacheTimeout(int timeoutMins)
Set the property query cache timeout in minutes.
- Parameters:
-
timeoutMins
- the query cache timeout in minutes, must be a
positive value.
- Returns:
- the property query
getValue
public java.lang.String getValue()
Return the property value for the query parameters.
- Returns:
- the property value for the query parameter