Class VersionPropertyValueDao


public class VersionPropertyValueDao extends AbstractDao
Provides a DAO for the VersionMetadataValue entity.
See Also:
  • Constructor Details

    • VersionPropertyValueDao

      public VersionPropertyValueDao()
  • Method Details

    • 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 version
      propertyName - a valid property name
      scope - the scope (one of PropertyType.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 version
      propertyName - 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 version
      propertyName - a valid property name
      scope - the scope (one of PropertyType.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 version
      propertyName - 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 version
      propertyName - 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 - use createVersionPropertyValue(TemplateVersion, Form, PropertyType, String) instead. This method may be removed in a future JM 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 version
      form - a non-null form
      propertyType - a non-null property type
      value - the value to set the property to
      longValue - the value to set the property to (for properties of type PropertyType.DATA_TYPE_CSV, PropertyType.DATA_TYPE_HTML, PropertyType.DATA_TYPE_Image, PropertyType.DATA_TYPE_JSON or PropertyType.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 version
      form - a non-null form
      propertyType - a non-null property type
      value - 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 only one form property should be intended to support pre-filling form with property values.
      Parameters:
      version - the template version
      scope - 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 name
      scope - 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