Class Index | File Index

Classes


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.

Class Summary
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 Summary
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.
 
Returns the user's e-mail address.
 
Returns the user's first name.
 
Returns the user's full name.
 
Returns the user ID.
 
Returns the user's language.
 
Returns the user's last name.
 
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.
 
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.
 
Tells whether the writing direction is right-to-left ("RTL").
 
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_corbu or sap_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} true if 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} true if 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:

Parameters:
{number|object|string} vOption
The options which influence the load operation. A number will be interpreted as vOption.depthAtRoot, a string as vOption.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 is Infinity the complete menu is loaded. If vOption.nodeId is given, 0 will yield the same result as 1 as 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.nodeId is given, this parameter determines the depth of the subtree (starting at the given node) which is loaded; else it is ignored. If it is Infinity the 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

©Copyright (c) 2009-2014 SAP SE, All Rights Reserved
Documentation generated by JsDoc Toolkit 2.4.0 on Tue Mar 14 2017 08:48:21 GMT-0000 (UTC)