UBDomain

UBDomain

UnityBase domain object model. Construct new UBDomain instance based on getDomainInfo UB server method result

Usage sample:

UBDomain.get('uba_user').attr('name').caption;

Constructor

new UBDomain(domainInfo)

Arguments:
  1. domainInfo (Object)  getDomainInfo UB server method result
    Properties
    1. domain (Object)  raw entities collection
    2. entityMethods (Object)  entities methods access rights for current user
    3. models (Object)  information about domain models
    4. i18n (Object)  entities localization to current user language
    5. forceMIMEConvertors (Object)  list of registered server-side MIME converters for document type attribute content

Members

entities: Object.<String, UBEntity>

Collection of entities

models: Object.<String, UBModel>

Models collection

forceMIMEConvertors: Object readonly

ubDataTypes static readonly

UnityBase base attribute data types
Properties:
Name Type Description
Many
Entity
Int
BigInt
String
Boolean
Float
DateTime
Date
Currency
Document
ID
Text
Enum

ubMixins static readonly

UnityBase base mixins
Properties:
Name Type Description
dataHistory
mStorage
unity
treePath

ubServiceFields static readonly

Service attribute names
Properties:
Name Type Description
dateFrom
dateTo

Methods

get(entityCode, raiseErrorIfNotExistsopt)UBEntity

Get entity by code
Arguments:
  1. entityCode (String)
  2. [raiseErrorIfNotExists=false] (Boolean)  If true and entity does not exists throw error

eachEntity(callBack, scopeopt)

Call collBack function for each entity.
Arguments:
  1. callBack (function)
  2. [scope] (Object)

filterEntities(config)Array

Filter entities by properties
Arguments:
  1. config (Object|function)
Example
// sessionCachedEntites contains all entities with property cacheType equal Session
     var sessionCachedEntites = domain.filterEntities({cacheType: 'Session'});

getPhysicalDataType(dataType)String static

Return physical type by UBDataType
Arguments:
  1. dataType (String)