Extends
Members
attrs
static
Attributes defined in metadata. This property not exist in real life and added just for help
entity: UBEntity
Reference to entity metadata
Methods
addNew(ctx)
api
Create record with filled default values and return it to caller.
Newly created record is not inserted to database. For inserting record to the database insert
method should be called
Arguments:
-
ctx
(ubMethodParams)
- Mixes In:
-
mStorage.addNew   
delete(ctx)
api
Delete data
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams.execParams.ID
(number)
 element ID to be deleted
- Mixes In:
-
mStorage.delete   
insert(ctx)
api
Insert new row to the entity.
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
-
mStorage.insert   
select(ctx)
api
Read entity data
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams
(UBQL)
 ORM query in UBQL format
- Mixes In:
-
mStorage.select   
update(ctx)
api
Update data
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
-
mStorage.update   
changeLanguage(ctxt)
api
Change (or set) current user language.
After call to this method UI must logout user and reload itself.
Arguments:
-
ctxt
(ubMethodParams)
Properties
-
mParams.newLang
(String)
 new user language
changePassword(userID, userName, password, needChangePasswordopt, oldPwdopt)
Change user password
Arguments:
-
userID
(Number)
-
userName
(String)
 Either userName or userID must be specified
-
password
(String)
-
[needChangePassword=false]
(Boolean)
 If true the password will by expired
-
[oldPwd]
(String)
 Optional for optimisation
publicRegistration(fake, req, resp)
api
Two-step new user public registration rest endpoint. Optionaly can use google Re-captcha.
To enable re-captcha on server side provide a valid re-captcha SECRET
in serverConfig.application.customSettings.reCAPTCHA.secretKey
application config.
1-st step: web page pass a registration parameters as JSON:
POST /rest/uba_user/publicRegistration
{email: "<email>", phone: "", utmSource: '', utmCampaign: '', recaptca: "googleRecaptchaValue"}
Server will:
- create a new uba_user (in pending state isPending===true) and generate a password for user
- generate OTP, and put a optional
utmSource
and utmCampaign
parameters to the OTP uData
- create a e-mail using using report code, provided by
uba.user.publicRegistrationReportCode
ubs_setting key.
Report take a parameters {login, password, activateUrl, appConfig}
- schedule a confirmation e-mail for user
2-nd step: user follow the link from e-mail
GET /rest/uba_user/publicRegistration?otp=<one time pwd value>&login=<user_login>
Server will:
- check the provided OTP and if it is valud
- remove a
pending
from uba_user row
- fire a
registration
event for Session
Access to endpoint is restricted by default. To enable public registration developer should grant ELS access for
uba_user.publicRegistration
method to Anonymous
role.
Arguments:
-
fake
-
req
(THTTPRequest)
-
resp
(THTTPResponse)
addNew(ctx) api
Create record with filled default values and return it to caller.
Newly created record is not inserted to database. For inserting record to the database
insert
method should be called
Arguments:
-
ctx
(ubMethodParams)
- Mixes In:
- mStorage.addNew   
delete(ctx) api
Delete data
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams.execParams.ID
(number)
 element ID to be deleted
-
- Mixes In:
- mStorage.delete   
insert(ctx) api
Insert new row to the entity.
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
- mStorage.insert   
select(ctx) api
Read entity data
Arguments:
-
ctx
(ubMethodParams)
Properties
-
mParams
(UBQL)
 ORM query in UBQL format
-
- Mixes In:
- mStorage.select   
update(ctx) api
Update data
Arguments:
-
ctx
(ubMethodParams)
Properties
- Mixes In:
- mStorage.update   
changeLanguage(ctxt) api
Change (or set) current user language.
After call to this method UI must logout user and reload itself.
Arguments:
-
ctxt
(ubMethodParams)
Properties
-
mParams.newLang
(String)
 new user language
-
changePassword(userID, userName, password, needChangePasswordopt, oldPwdopt)
Change user password
Arguments:
-
userID
(Number)
-
userName
(String)
 Either userName or userID must be specified -
password
(String)
-
[needChangePassword=false]
(Boolean)
 If true the password will by expired -
[oldPwd]
(String)
 Optional for optimisation
publicRegistration(fake, req, resp) api
Two-step new user public registration rest endpoint. Optionaly can use google Re-captcha.
To enable re-captcha on server side provide a valid re-captcha SECRET
in
serverConfig.application.customSettings.reCAPTCHA.secretKey
application config.
1-st step: web page pass a registration parameters as JSON:
POST /rest/uba_user/publicRegistration
{email: "<email>", phone: "", utmSource: '', utmCampaign: '', recaptca: "googleRecaptchaValue"}
Server will:
- create a new uba_user (in pending state isPending===true) and generate a password for user
- generate OTP, and put a optional
utmSource
andutmCampaign
parameters to the OTP uData - create a e-mail using using report code, provided by
uba.user.publicRegistrationReportCode
ubs_setting key. Report take a parameters {login, password, activateUrl, appConfig} - schedule a confirmation e-mail for user
2-nd step: user follow the link from e-mail
GET /rest/uba_user/publicRegistration?otp=<one time pwd value>&login=<user_login>
Server will:
- check the provided OTP and if it is valud
- remove a
pending
from uba_user row - fire a
registration
event forSession
Access to endpoint is restricted by default. To enable public registration developer should grant ELS access for
uba_user.publicRegistration
method to Anonymous
role.
Arguments:
-
fake
-
req
(THTTPRequest)
-
resp
(THTTPResponse)