Class PropertyTypeDao


  • public class PropertyTypeDao
    extends AbstractDao
    Provides a DAO for the PropertyType entity.
    See Also:
    PropertyType
    • Constructor Detail

      • PropertyTypeDao

        public PropertyTypeDao()
    • Method Detail

      • getPropertyType

        public PropertyType getPropertyType​(String propertyTypeId)
        Return the property type with the specified OID
        Parameters:
        propertyTypeId - the OID
        Returns:
        the matching property type, or null if not found
      • getPropertyTypesByScope

        public List<PropertyType> getPropertyTypesByScope​(String scope)
        Return a list of property types of a given scope, ordered by scope and name.
        Parameters:
        scope - the scope, one of PropertyType.SCOPES (optional)
        Returns:
        the list of matching property types
      • getPropertyTypeList

        public List<PropertyType> getPropertyTypeList​(String clientId,
                                                      String keyword,
                                                      String scope)
        Return the list of property types matching the specified search criteria
        Parameters:
        clientId - the OID of the client (optional); note that global property types are always also included
        keyword - the search keyword
        scope - the scope of the property, one of PropertyType.SCOPES (optional)
        Returns:
        the list of matching property types
      • getPropertyByName

        public PropertyType getPropertyByName​(String name,
                                              String scope)
        Return the property type for the given name and scope
        Parameters:
        name - the non-empty property name
        scope - the scope of the property PropertyType.SCOPES
        Returns:
        the property type for the given name and scope
      • getPropertyByName

        public PropertyType getPropertyByName​(String name,
                                              String scope,
                                              Object clientId)
        Return the property type for the given client, name and scope
        Parameters:
        name - the non-empty property name
        scope - the scope of the property PropertyType.SCOPES
        clientId - OID of the client associated with the property type (optional)
        Returns:
        the matching property type
      • getPropertyTypesForClient

        public List<PropertyType> getPropertyTypesForClient​(String clientId)
        Return property types that are available to the given client (includes global types as well as all types belonging to the client)
        Parameters:
        clientId - the OID of the client (optional)
        Returns:
        the list of matching property types
      • getUnsetClientPropertyTypes

        public List<PropertyType> getUnsetClientPropertyTypes​(String clientId)
        Return property types of scope PropertyType.SCOPE_Client that haven't already been defined for the given client
        Parameters:
        clientId - the valid OID of a client
        Returns:
        the list of all unset properties for the client
      • getUnsetPropertyTypesForVersion

        public List<PropertyType> getUnsetPropertyTypesForVersion​(String versionId,
                                                                  String clientId)
        Return property types that haven't already been defined for the given form and template version
        Parameters:
        versionId - the valid OID of a template version
        clientId - the valid OID of the form's client
        Returns:
        the list of all unset properties for the form and template version
      • hasProperty

        public boolean hasProperty​(String name,
                                   String scope,
                                   String clientId)
        Return whether a property type for the given name, scope and client exists
        Parameters:
        name - the non-empty property name
        scope - the scope, one of PropertyType.SCOPES
        clientId - the OID of the client (optional; if not set, will search for a global property type)
        Returns:
        if a property type for the given name and scope exists
      • loadDefaultProperties

        public void loadDefaultProperties()
        Load the set of pre-defined property types.
      • registerFormPropertyType

        protected void registerFormPropertyType​(String name,
                                                String scope,
                                                String description,
                                                String dataType)
      • registerFormPropertyType

        protected void registerFormPropertyType​(String name,
                                                String scope,
                                                String description,
                                                String dataType,
                                                boolean readonly)