Package com.avoka.fc.core.dao
Class VersionPropertyValueDao
- java.lang.Object
-
- com.avoka.core.dao.BaseDao
-
- com.avoka.fc.core.dao.AbstractDao
-
- com.avoka.fc.core.dao.VersionPropertyValueDao
-
public class VersionPropertyValueDao extends AbstractDao
Provides a DAO for the VersionMetadataValue entity.- See Also:
VersionMetadataValue
-
-
Field Summary
-
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description VersionPropertyValueDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description VersionPropertyValue
createVersionPropertyValue(TemplateVersion templateVersion, Form form, PropertyType propertyType, String value)
Creates a new VersionPropertyValue for the given form, version and property.VersionPropertyValue
createVersionPropertyValue(TemplateVersion templateVersion, Form form, PropertyType propertyType, String value, String longValue)
Deprecated.longValue no longer exists - usecreateVersionPropertyValue(TemplateVersion, Form, PropertyType, String)
instead.String
getClientPropertyValue(TemplateVersion version, String propertyName)
Return the value of a client scope property for the given template version Note: Property names are only unique within a scope.String
getFormPropertyValue(TemplateVersion version, String propertyName)
Return the value of a form scope property for the given template version Note: Property names are only unique within a scope.String
getPropertyValue(TemplateVersion version, String propertyName, String scope)
Return the value of a property for the given template version Note: Property names are only unique within a scope.List<VersionPropertyValue>
getPropertyValues(TemplateVersion version, String scope)
Return the list of property values for a form version.List<VersionPropertyValue>
getPropertyValues(String templateVersionId)
Return the list of property values for a form versionList<VersionPropertyValue>
getTemplateVersionPropertyValues(TemplateVersion templateVersion)
Return the TemplateVersions property value list.List<VersionPropertyValue>
getVersionProperties(String propertyName, String scope)
Gets the version properties who have defined the property name and scope.VersionPropertyValue
getVersionPropertyValue(TemplateVersion version, String propertyName)
Return the VersionPropertyValue object for the given template version, property name and scope.VersionPropertyValue
getVersionPropertyValue(TemplateVersion version, String propertyName, String scope)
Return the VersionPropertyValue object for the given template version, property name and scope.VersionPropertyValue
getVersionPropertyValueFromPk(Object id)
Return the VersionPropertyValue object with the given OID-
Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
-
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
-
-
-
Method Detail
-
getVersionPropertyValueFromPk
public VersionPropertyValue getVersionPropertyValueFromPk(Object id)
Return the VersionPropertyValue object with the given OID- Parameters:
id
- the OID- Returns:
- the matching VersionPropertyValue object, or null if none was found
-
getVersionPropertyValue
public VersionPropertyValue getVersionPropertyValue(TemplateVersion version, String propertyName, String scope)
Return the VersionPropertyValue object for the given template version, property name and scope. Note: Property names are only unique within a scope. Therefore, the results may be somewhat unpredictable if no scope is specified and multiple values exist (the same holds for properties of type List).- Parameters:
version
- the non-null template versionpropertyName
- a valid property namescope
- the scope (one ofPropertyType.SCOPES
, optional)- Returns:
- the matching VersionPropertyValue, or null if none were found
-
getVersionPropertyValue
public VersionPropertyValue getVersionPropertyValue(TemplateVersion version, String propertyName)
Return the VersionPropertyValue object for the given template version, property name and scope. Note: Property names are only unique within a scope. Therefore, the results may be somewhat unpredictable if no scope is specified and multiple values exist (the same holds for properties of type List).- Parameters:
version
- the template versionpropertyName
- a valid property name- Returns:
- the matching VersionPropertyValue, or null if none were found
-
getPropertyValue
public String getPropertyValue(TemplateVersion version, String propertyName, String scope)
Return the value of a property for the given template version Note: Property names are only unique within a scope. Therefore, the results may be somewhat unpredictable if no scope is specified and multiple values exist (the same holds for properties of type List).- Parameters:
version
- the non-null template versionpropertyName
- a valid property namescope
- the scope (one ofPropertyType.SCOPES
, optional)- Returns:
- the value of the property for the version, or null if none was found
-
getClientPropertyValue
public String getClientPropertyValue(TemplateVersion version, String propertyName)
Return the value of a client scope property for the given template version Note: Property names are only unique within a scope. Therefore, the results may be somewhat unpredictable if no scope is specified and multiple values exist (the same holds for properties of type List).- Parameters:
version
- the non-null template versionpropertyName
- a valid property name- Returns:
- the value of the property for the version, or null if none was found
-
getFormPropertyValue
public String getFormPropertyValue(TemplateVersion version, String propertyName)
Return the value of a form scope property for the given template version Note: Property names are only unique within a scope. Therefore, the results may be somewhat unpredictable if no scope is specified and multiple values exist (the same holds for properties of type List).- Parameters:
version
- the non-null template versionpropertyName
- a valid property name- Returns:
- the value of the property for the version, or null if none was found
-
createVersionPropertyValue
public VersionPropertyValue createVersionPropertyValue(TemplateVersion templateVersion, Form form, PropertyType propertyType, String value, String longValue)
Deprecated.longValue no longer exists - usecreateVersionPropertyValue(TemplateVersion, Form, PropertyType, String)
instead. This method may be removed in a future TM version.Creates a new VersionPropertyValue for the given form, version and property. Note that this method will NOT commit the new object. However, because it associates it with the TemplateVersion, Form and PropertyType objects, the new value will be part of the current data context.- Parameters:
templateVersion
- a non-null template versionform
- a non-null formpropertyType
- a non-null property typevalue
- the value to set the property tolongValue
- the value to set the property to (for properties of typePropertyType.DATA_TYPE_CSV
,PropertyType.DATA_TYPE_HTML
,PropertyType.DATA_TYPE_Image
,PropertyType.DATA_TYPE_JSON
orPropertyType.DATA_TYPE_LongText
)- Returns:
- the VersionPropertyValue object with template version, form, property type, name, type and scope set
-
createVersionPropertyValue
public VersionPropertyValue createVersionPropertyValue(TemplateVersion templateVersion, Form form, PropertyType propertyType, String value)
Creates a new VersionPropertyValue for the given form, version and property. Note that this method will NOT commit the new object. However, because it associates it with the TemplateVersion, Form and PropertyType objects, the new value will be part of the current data context.- Parameters:
templateVersion
- a non-null template versionform
- a non-null formpropertyType
- a non-null property typevalue
- the value to set the property to- Returns:
- the VersionPropertyValue object with template version, form, property type, name, type and scope set
- Since:
- 5.1.4
-
getPropertyValues
public List<VersionPropertyValue> getPropertyValues(String templateVersionId)
Return the list of property values for a form version- Parameters:
templateVersionId
- the template version OID (required)- Returns:
- the list of property values for the given form and template version
-
getPropertyValues
public List<VersionPropertyValue> getPropertyValues(TemplateVersion version, String scope)
Return the list of property values for a form version. Values will be grouped by name and ordered by scope descending. This means if any there are 'Form' and 'Client' scope properties with the same name then only the 'Form' scope property will be returned. This is landing pages and other scenarios where only one form property should bintended to support pre-filling form with property values.- Parameters:
version
- the template versionscope
- the scope to search- Returns:
- the list of property values for the given form and template version
-
getVersionProperties
public List<VersionPropertyValue> getVersionProperties(String propertyName, String scope)
Gets the version properties who have defined the property name and scope.- Parameters:
propertyName
- the property namescope
- the scope- Returns:
- the version properties
- Since:
- 4.0.0
-
getTemplateVersionPropertyValues
public List<VersionPropertyValue> getTemplateVersionPropertyValues(TemplateVersion templateVersion)
Return the TemplateVersions property value list.- Parameters:
templateVersion
- the form template version (required)- Returns:
- the TemplateVersions property value list
- Since:
- 5.1.0
-
-