Members
domain: UBDomain
readonly
code: String
readonly
attributes: Object.<string, UBEntityAttribute>
Entity attributes collection
mixins: Object.<String, UBEntityMixin>
Collection of entity mixins
entityMethods: Object.<String, Number>
readonly
Entity methods, allowed for current logged-in user in format {method1: 1, method2: 1}. 1 mean method is allowed
caption: string
Entity caption
description: string
Entity description
documentation: string
Documentation
descriptionAttribute: string
Name of attribute witch used as a display value in lookup
cacheType: String
readonly
Indicate how entity content is cached on the client side.
Possible cache types: None, "None", "Entity", "Session", "SessionEntity"
Methods
getEntityCaption() → string
Return an entity caption to display on UI
attr(attributeCode, simpleopt) → UBEntityAttribute
Get entity attribute by code. Return undefined if attribute does not found
Arguments:
getAttribute(attributeCode) → UBEntityAttribute
Get entity attribute by code. Throw error if attribute does not found.
Arguments:
-
attributeCode
eachAttribute(callBack, scopeopt)
Call collBack function for each attribute.
Arguments:
mixin(mixinCode) → UBEntityMixin
Get entity mixin by code. Returns "undefined" if the mixin is not found
Arguments:
-
mixinCode
(String)
hasMixin(mixinCode) → Boolean
Check the entity has mixin. Returns true
if the mixin is exist and enabled
Arguments:
-
mixinCode
(String)
checkMixin(mixinCode)
Check the entity has mixin. Throw error if mixin dose not exist or not enabled
Arguments:
-
mixinCode
(String)
filterAttribute(config) → Array
Filter attributes by properties
Arguments:
haveAccessToMethod(methodCode) → Boolean
Check current user have access to specified entity method
Arguments:
-
methodCode
(String)
haveAccessToAnyMethods(methods) → boolean
Check current user have access to AT LAST one of specified methods
Arguments:
-
methods
(Array)
haveAccessToMethods(Method) → Boolean
Check current user have access to ALL of specified methods
Arguments:
-
Method
(Array.<String>)
 names
getConvertRules(fieldList) → Array.<{index: number, convertFn: function()}>
return array of conversion rules for raw server response data
Arguments:
-
fieldList
(Array.<String>)
getDescriptionAttribute() → String
Return description attribute name (descriptionAttribute
metadata property)
This property may be empty or valid(validation performed by server)
If case property is empty - try to get attribute with code caption
getEntityAttributeInfo(attributeName, deepopt) → Object
Return information about attribute and attribute entity. Understand complex attributes like firmID.firmType.code
Arguments:
getEntityAttribute(attributeName, deepopt) → UBEntityAttribute
Return Entity attribute. Understand complex attributes like firmID.firmType.code
Arguments:
getAttributeNames(filteropt)
return attributes code list
Arguments:
getEntityRequirements(fieldListopt) → Array.<String>
Return requirements entity code list for field list
Arguments:
-
[fieldList]
(Array.<String>)
 (optional)
checkAttributeExist(attributeName, contextMessage)
Check the entity contains attribute(s) and throw error if not contains
Arguments:
getEntityDescription() → string
Return entity description.
Possible cache types: None, "None", "Entity", "Session", "SessionEntity"
getEntityCaption() → string
Return an entity caption to display on UI
attr(attributeCode, simpleopt) → UBEntityAttribute
Get entity attribute by code. Return undefined if attribute does not found
Arguments:
getAttribute(attributeCode) → UBEntityAttribute
Get entity attribute by code. Throw error if attribute does not found.
Arguments:
-
attributeCode
eachAttribute(callBack, scopeopt)
Call collBack function for each attribute.
Arguments:
mixin(mixinCode) → UBEntityMixin
Get entity mixin by code. Returns "undefined" if the mixin is not found
Arguments:
-
mixinCode
(String)
hasMixin(mixinCode) → Boolean
Check the entity has mixin. Returns
true
if the mixin is exist and enabled
Arguments:
-
mixinCode
(String)
checkMixin(mixinCode)
Check the entity has mixin. Throw error if mixin dose not exist or not enabled
Arguments:
-
mixinCode
(String)
filterAttribute(config) → Array
Filter attributes by properties
Arguments:
haveAccessToMethod(methodCode) → Boolean
Check current user have access to specified entity method
Arguments:
-
methodCode
(String)
haveAccessToAnyMethods(methods) → boolean
Check current user have access to AT LAST one of specified methods
Arguments:
-
methods
(Array)
haveAccessToMethods(Method) → Boolean
Check current user have access to ALL of specified methods
Arguments:
-
Method
(Array.<String>)
 names
getConvertRules(fieldList) → Array.<{index: number, convertFn: function()}>
return array of conversion rules for raw server response data
Arguments:
-
fieldList
(Array.<String>)
getDescriptionAttribute() → String
Return description attribute name (
descriptionAttribute
metadata property)
This property may be empty or valid(validation performed by server)
If case property is empty - try to get attribute with code caption
getEntityAttributeInfo(attributeName, deepopt) → Object
Return information about attribute and attribute entity. Understand complex attributes like firmID.firmType.code
Arguments:
getEntityAttribute(attributeName, deepopt) → UBEntityAttribute
Return Entity attribute. Understand complex attributes like firmID.firmType.code
Arguments:
getAttributeNames(filteropt)
return attributes code list
Arguments:
getEntityRequirements(fieldListopt) → Array.<String>
Return requirements entity code list for field list
Arguments:
-
[fieldList]
(Array.<String>)
 (optional)
checkAttributeExist(attributeName, contextMessage)
Check the entity contains attribute(s) and throw error if not contains
Arguments:
getEntityDescription() → string
Return entity description.