Class sap.ui2.shell.User
An object representing various information about the user that is currently logged in
at the backend system.
Defined in: startup.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
You cannot call this constructor; a
sap.ui2.shell.User is created by the
framework in sap.ui2.shell.getUser(). |
| Method Attributes | Method Name and Description |
|---|---|
|
Returns the client of the system to which the user is logged on.
|
|
|
Returns the user's date format as defined by the domain "XUDATFM" in ABAP's data dictionary.
|
|
|
Returns the default error handler for this user.
|
|
|
getEmail()
Returns the user's e-mail address.
|
|
|
Returns the user's first name.
|
|
|
Returns the user's full name.
|
|
|
getId()
Returns the user ID.
|
|
|
Returns the user's language.
|
|
|
Returns the user's last name.
|
|
|
getMenu()
Returns the menu object.
|
|
|
Returns the user's number format as defined by the domain "XUDCPFM" in ABAP's data
dictionary.
|
|
|
Returns the ID of the system to which the user is logged on.
|
|
|
getTheme()
Returns the user's theme.
|
|
|
Returns the user's time format as defined by the domain "XUTIMEFM" in ABAP's data
dictionary.
|
|
|
Returns the user's time zone.
|
|
|
Returns the welcome message.
|
|
|
isRtl()
Tells whether the writing direction is right-to-left ("RTL").
|
|
|
isStub()
Tells whether the user is still stub or has already been loaded.
|
|
|
load(vOption, fnSuccess, fnFailure)
Loads the user from the backend system.
|
|
|
setDefaultErrorHandler(fnNewDefaultFailure)
Sets the default error handler for this user.
|
Class Detail
sap.ui2.shell.User()
You cannot call this constructor; a
sap.ui2.shell.User is created by the
framework in sap.ui2.shell.getUser().
- Since:
- 1.5.0
Method Detail
{string}
getClient()
Returns the client of the system to which the user is logged on.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the system client
{string}
getDateFormat()
Returns the user's date format as defined by the domain "XUDATFM" in ABAP's data dictionary.
SAPUI5 renders dates according to this format after calling
sap.ui.getCore().getConfiguration().getFormatSettings().setLegacyDateFormat().
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user's date format; possible values: 1-9 and A-C
{function (string)}
getDefaultErrorHandler()
Returns the default error handler for this user.
- Since:
- 1.5.0
- Returns:
- {function (string)} default error handler, taking an error message, may be
undefined
{string}
getEmail()
Returns the user's e-mail address.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user's email address.
{string}
getFirstName()
Returns the user's first name.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the first name
{string}
getFullName()
Returns the user's full name.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the full name
{string}
getId()
Returns the user ID.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user ID
{string}
getLanguage()
Returns the user's language.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user language
{string}
getLastName()
Returns the user's last name.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the last name
{sap.ui2.shell.Menu}
getMenu()
Returns the menu object.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {sap.ui2.shell.Menu} the menu object
{string}
getNumberFormat()
Returns the user's number format as defined by the domain "XUDCPFM" in ABAP's data
dictionary. SAPUI5 renders dates according to this format after calling
sap.ui.getCore().getConfiguration().getFormatSettings().setLegacyNumberFormat().
In ABAP this is called "decimal notation".
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user's number format; possible values: space, X or Y
{string}
getSystem()
Returns the ID of the system to which the user is logged on.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the system id
{string}
getTheme()
Returns the user's theme.
- Since:
- 1.7.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user's theme; either a simple theme name (like
sap_corbuorsap_hcb) or a combination of theme name and theme root URL separated by '@' (e. g.my_theme@http://uiserver.sap.corp/themes)
{string}
getTimeFormat()
Returns the user's time format as defined by the domain "XUTIMEFM" in ABAP's data
dictionary. SAPUI5 renders time values according to this format after calling
sap.ui.getCore().getConfiguration().getFormatSettings().setLegacyTimeFormat().
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user's time format; possible values: 0-4
{string}
getTimeZone()
Returns the user's time zone.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the user's time zone
{string}
getWelcomeMessage()
Returns the welcome message.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {string} the welcome message
{boolean}
isRtl()
Tells whether the writing direction is right-to-left ("RTL"). Languages with RTL are
for example Hebrew or Arabic.
- Since:
- 1.5.0
- Throws:
- Error if the user is still a stub
- Returns:
- {boolean}
trueif the RTL mode is set
{boolean}
isStub()
Tells whether the user is still stub or has already been loaded.
- Since:
- 1.5.0
- Returns:
- {boolean}
trueif the user is still a stub
load(vOption, fnSuccess, fnFailure)
Loads the user from the backend system. Afterwards the user is no stub anymore. This is an
asynchronous operation. When it is finished, either the success or the failure handler is
called.
Regarding the menu tree there are various options:
- The menu can be omitted.
- The menu can be loaded partially up to a given depth.
- The menu can be loaded completely.
- The menu can be loaded so that a given node including all nodes between it and the root are part of the response. Additionally for each of the nodes all direct children are loaded as stubs. This can be used in case a shell is configured to start by displaying a certain node. The result ensures that this node is known and that additionally a tree control is able to display the path to the node with all parent folders opened.
- Parameters:
- {number|object|string} vOption
- The options which influence the load operation. A number will be interpreted as
vOption.depthAtRoot, a string asvOption.nodeId. - {number} vOption.depthAtRoot Optional, Default: 0
- The menu is loaded starting from the root to the given depth. If it is
0, no menu (only the user) is loaded. If it isInfinitythe complete menu is loaded. IfvOption.nodeIdis given,0will yield the same result as1as the path to the root is loaded anyway. - {string} vOption.nodeId Optional
- The node with this ID is searched and the path to it is loaded as well as a subtree
starting at this node (cf.
vOption.depthAtNode) in case it is a folder. If it the ID missing, the menu is loaded at its root node only (cf.vOption.depthAtRoot). - {number} vOption.depthAtNode Optional, Default: 1
- If
vOption.nodeIdis given, this parameter determines the depth of the subtree (starting at the given node) which is loaded; else it is ignored. If it isInfinitythe complete subtree is loaded. - {function()} fnSuccess
- The parameterless success handler
- {function(string)} fnFailure Optional
- The failure handler which gets an error message. If missing, the user's default error handler is used.
- Since:
- 1.5.0
- Throws:
- Error if the folder is no longer a stub
setDefaultErrorHandler(fnNewDefaultFailure)
Sets the default error handler for this user.
- Parameters:
- {function (string)} fnNewDefaultFailure
- default error handler, taking an error message
- Since:
- 1.5.0