Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-05

oracle.apps.fnd.applcore.common
Class ApplSessionUtil

java.lang.Object
  extended by oracle.apps.fnd.applcore.common.ApplSessionUtil

public final class ApplSessionUtil
extends java.lang.Object

This is a utility class on top of the ApplSession class, which will likely be the primary window that product teams access ApplSession functionality through. All the API's are static, and allow product teams to retrieve and set information on whatever the current FND session is, without having to worry about retrieving or caching an actual FND session object.


Field Summary
static java.lang.String GLOBAL_ENTERPRISE_ID
          The enterprise ID for the base data in a multi-tenant enabled environment.
 
Constructor Summary
ApplSessionUtil()
           
 
Method Summary
static void attachConnectionToSession(java.lang.String sessionID, java.lang.String sessionCookie, java.sql.Connection conn)
          Almost identical to attachToSession, except this does NOT set the newly created session as the 'current' session.
static ApplSession attachToSession(java.lang.String sessionID, java.lang.String sessionCookie, java.sql.Connection conn)
          attachToSession is called to attach to an existing session.
static boolean currentAppStripeLoaded()
          Checks if the current application stripe has already had its roles loaded into the specified session.
static boolean currentAppStripeLoaded(ApplSession session)
          Checks if the current application stripe has already had its roles loaded into the specified session.
static java.lang.String fetchUserDisplayName(java.lang.String userName, java.lang.String displayNameLanguage)
           
static java.lang.String getAccessibilityMode()
          Fetch the ACCESSIBILITY_MODE.
static java.lang.String getAddtlCustomLevel()
          Fetch the current ADDTL_CUSTOM_LEVEL If no session is available, this throws a JboException.
static java.lang.Boolean getAnimationEnabled()
          Fetch the user preference attribute - AnimationEnabled.
static java.lang.Integer getApplicationID()
          Return the current application ID.
static java.lang.String getApplicationShortName()
          Return the current application short name.
static java.util.List<ApplRole> getApplRoles(javax.security.auth.Subject subject)
          Helper method to obtain the role info from the Subject.
static java.lang.String getClientEncoding()
          Fetch the CLIENT_ENCODING value.
static java.lang.String getColorContrast()
          Fetch the user preference attribute - ColorContrast.
static java.sql.Connection getConnection()
          Returns a database connection initialized to the current session.
static java.lang.String getCurrency()
          Fetch the CURRENCY value.
static java.lang.String getDateFormat()
          Fetch the DATE_FORMAT value.
static char getDecimalSeparator()
          Fetch the DECIMAL_SEPARATOR value.
static java.lang.String getDisplayNameLanguage()
          Fetch the DISPLAY_NAME_LANGUAGE value.
static java.lang.Boolean getEmbeddedHelpEnabled()
          Fetch the user preference attribute - EmbeddedHelpEnabled.
static java.lang.String getEnterpriseId()
          Deprecated. in favor of getEnterpriseID()
static java.lang.String getEnterpriseID()
          Return the current user's enterprise ID
static java.lang.String getFontSize()
          Fetch the user preference attribute - FontSize.
static java.lang.String getGlobal()
          Return the constant "GLOBAL"
static char getGroupingSeparator()
          Fetch the GROUPING_SEPARATOR value.
static java.lang.String getHCMUserId()
          Deprecated. in favor of getHCMUserID
static java.lang.String getHCMUserID()
           
static java.lang.String getHCMUserPersonId()
          Deprecated. in favor of getHCMUserPersonID
static java.lang.String getHCMUserPersonID()
           
static java.lang.String getHCMUserPrimaryAssignmentId()
          Deprecated. in favor of getHCMUserPrimaryAssignmentID
static java.lang.String getHCMUserPrimaryAssignmentID()
           
static java.lang.String getHCMUserPrimaryWorkTermsAssignmentId()
          Deprecated. in favor of getHCMUserPrimaryWorkTermsAssignmentID
static java.lang.String getHCMUserPrimaryWorkTermsAssignmentID()
           
static java.lang.String getHistoryOverrideUserName()
          Fetch the current HISTORY_OVERRIDE_USER_NAME, where applicable.
static java.lang.String getIndustry()
          Fetch the current INDUSTRY If no session is available, this throws a JboException.
static java.lang.String getIndustryInTerritory()
          Fetch the current INDUSTRY_IN_TERRITORY If no session is available, this throws a JboException.
static java.lang.String getIntegerFormat()
          Fetch the user preference attribute - IntegerFormat.
static java.lang.String getLanguage()
          Fetch the LANGUAGE value.
static java.lang.String getLogoutURL()
          Fetch the logout URL for this session, if defined.
static java.lang.String getNamespaceAttribute(java.lang.String namespaceName, java.lang.String attrName)
          Return the value from the specified namespace.
static java.lang.Integer getNamespaceAttributeNum(java.lang.String namespaceName, java.lang.String attrName)
          Return the value from the specified namespace as an Integer.
static java.sql.Connection getNewConnection()
          Establishes a new, vanilla database connection - first it checks for the presence of the "jdbc/ApplicationDBDS" datasource and pulls the connection from there.
static java.lang.String getNLSLang()
          Fetch the NLS_LANG value.
static java.lang.String getNLSLanguage()
          Fetch the NLS_LANGUAGE value.
static java.lang.String getNLSSort()
          Fetch the NLS_SORT value.
static java.lang.String getNumberFormat()
          Fetch the user preference attribute - NumberFormat.
static java.lang.String getProduct()
          Fetch the current PRODUCT If no session is available, this throws a JboException.
static java.lang.String getProductFamily()
          Fetch the current PRODUCT_FAMILY If no session is available, this throws a JboException.
static java.lang.String getProfileValue(java.lang.String profileName)
          Utility method to get the Profile Value for a given Profile Name using the ProfileServiceAM.
static java.lang.String getSandboxID()
          Return the current user's sandbox ID
static ApplSession getSession()
          Returns the current ApplSession object, or null if there is no session available.
static java.lang.String getSessionAttribute(java.lang.String name)
          Return the specified attribute from the FND_SESSION_NAMESPACE.
static java.lang.String getSessionAttribute(java.lang.String name, java.lang.String defaultValue)
          Return the specified attribute from the FND_SESSION_NAMESPACE.
static java.lang.String getSessionAttribute(java.lang.String name, java.lang.String defaultValue, boolean setIfDefaulted)
          Return the specified attribute from the FND_SESSION_NAMESPACE.
static java.lang.String getSessionCookie()
          Return the session cookie used to identify the current lightweight session.
static ApplSessionManagement getSessionFromSessionCookie(java.lang.String sessionID, java.lang.String sessionCookie, java.sql.Connection conn)
           
static java.lang.String getSessionID()
          Return the ID of the current lightweight session as a String.
static java.lang.String getSessionRolesKey()
           
static java.lang.String getSite()
          Return the hardcoded "SITE" value
static javax.security.auth.Subject getSubject()
          Version of getSubject that takes no arguments.
static javax.security.auth.Subject getSubject(java.security.Principal principal)
          Helper method to obtain the Subject.
static java.lang.String getTerritory()
          Fetch the current TERRITORY value.
static java.lang.String getTimeFormat()
          Fetch the TIME_FORMAT value.
static java.lang.String getTimeZone()
          Fetch the TIMEZONE value.
static java.lang.String getUserDisplayName()
          Fetch the DISPLAY_NAME value.
static java.lang.String getUserGuid()
          This returns the current applications user GUID.
static java.util.ArrayList<java.lang.String> getUserLocale(java.lang.String userName)
          Returns ArrayList containing 'name=value' pairs of LDAP preferences, which is passed along at session creation/conversion time to default the corresponding session attributes.
static java.lang.String getUserName()
          This returns the current applications user name.
static java.util.HashMap<java.lang.String,java.lang.String> getUserPrefsFromLdap(java.lang.String userName)
           
static ApplSession initializeElevatedSession(javax.security.auth.Subject subject, ApplUser submittingUser, java.sql.Connection conn)
          This variation of initializeSession takes in the Subject to create the session as, an optional connection to initialize, and a String representing the user whose context (eg language preferences, history columns) will be used by the session.
static ApplSession initializeElevatedSession(javax.security.auth.Subject subject, ApplUser submittingUser, java.sql.Connection conn, java.util.ArrayList<java.lang.String> attrs)
          This variation of initializeSession takes in the Subject to create the session as, an optional connection to initialize, and a String representing the user whose context (eg language preferences, history columns) will be used by the session.
static ApplSession initializeSession(java.lang.String sessionID, java.sql.Connection conn)
          This version of initializeSession takes in a session ID.
static ApplSession initializeSession(java.lang.String userName, java.lang.String password, java.sql.Connection conn)
          This calls the initializeSession that takes a username/password, but defaults the appName to the current app.
static ApplSession initializeSession(java.lang.String userGuid, java.lang.String userName, java.util.List<java.lang.String> roleGuids, java.util.List<java.lang.String> roleNames, java.sql.Connection conn)
          This version of initializeSession takes in the user and role information as Strings.
static ApplSession initializeSession(java.lang.String userName, java.lang.String password, java.lang.String appName, java.sql.Connection conn)
          This version of initializeSession takes in a username and password, and invokes the JAASAuthenticationService to authenticate the login info and create a Subject if authentication succeeds.
static ApplSession initializeSession(javax.security.auth.Subject subject, java.sql.Connection conn)
          When the code completes, the terminateSession method should be called to free up the session.
static ApplSession initializeSession(javax.security.auth.Subject subject, java.sql.Connection conn, java.util.ArrayList<java.lang.String> attrs)
          For J2EE code, all aspects of session handling are taken care of automatically.
static ApplSession initializeTrustedSession(java.lang.String userName, java.lang.String appName, java.sql.Connection conn)
          Variation of initializeSession that creates a Subject for the specified user without requiring the password.
static boolean isATGLiteApp()
           
static boolean isMultiTenantModeEnabled()
           
static java.lang.String parseNumberFormat(java.lang.String numberFormat)
          For internal use only, public only so we can invoke this from our test code.
static ApplUser populateSessionUser(java.lang.String userGuid, java.lang.String userName, java.sql.Connection conn)
          Called to prepopulate the FND_SESSION_USERS table with user info, rather than relying on the table being populated when the user logs in.
static void removeProfileValue(java.lang.String profileName, java.lang.String levelName, java.lang.String levelValue)
          Utility method to delte the Profile Value for a given Profile Name using the ProfileServiceAM.
static void returnConnection(java.sql.Connection conn)
          This should always be called after the caller is finished using the connection obtained by a call to ApplSessionUtil.getConnection();.
static java.lang.String setProfileValue(java.lang.String profileName, java.lang.String levelName, java.lang.String levelValue, java.lang.String profileValue)
          Utility method to set the Profile Value for a given Profile Name using the ProfileServiceAM.
static void terminateSession()
          The counterpart to initializeSession/attachToSession, this should be called after the code is finished with the session.
static void terminateSession(boolean destroyFlag)
          This version of terminateSession takes a boolean flag flag to indicate whether the session should be destroyed.
static void terminateSession(java.sql.Connection conn)
          The counterpart to initializeSession/attachToSession, this should be called after the code is finished with the session.
static void terminateSession(java.sql.Connection conn, boolean destroyFlag)
          This version of terminateSession takes both the Connection to close and a boolean flag indicating whether the session should be destroyed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_ENTERPRISE_ID

public static final java.lang.String GLOBAL_ENTERPRISE_ID
The enterprise ID for the base data in a multi-tenant enabled environment. The value is "1".

See Also:
Constant Field Values
Constructor Detail

ApplSessionUtil

public ApplSessionUtil()
Method Detail

initializeSession

public static ApplSession initializeSession(javax.security.auth.Subject subject,
                                            java.sql.Connection conn,
                                            java.util.ArrayList<java.lang.String> attrs)
For J2EE code, all aspects of session handling are taken care of automatically. But for standalone java code (for example, unit test code), the initializeSession api's can be called at the beginning of the code execution to initialize the session. When the code completes, the terminateSession method should be called to free up the session. If the initializeSession was called with no arguments, it will obtain a database connection on its own. If a connection is passed in as an argument, then the caller is responsible for closing it. This version of initializeSession takes in a Subject, which should contain all the necessary User and Role information. It also takes in a List of attributes that will get set on the session upon initialization. This list can only contain 'known' attributes, it does not allow for arbitrary session attributes to be passed. The list of 'known' attributes is not published as this is currently only for internal use - most product teams are expected to call the version of the API that does not use this argument. When the code completes, the terminateSession method should be called to free up the session.

Parameters:
subject - the Subject containing the user identity info
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
attrs - a List of attributes that will get set as session attributes upon initialization.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

initializeSession

public static ApplSession initializeSession(javax.security.auth.Subject subject,
                                            java.sql.Connection conn)
When the code completes, the terminateSession method should be called to free up the session. If the initializeSession was called with no arguments, it will obtain a database connection on its own. If a connection is passed in as an argument, then the caller is responsible for closing it. This version of initializeSession takes in a Subject, which should contain all the necessary User and Role information. When the code completes, the terminateSession method should be called to free up the session.

Parameters:
subject - the Subject containing the user identity info
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
initializeSession(javax.security.auth.Subject, java.sql.Connection, java.util.ArrayList), terminateSession()

initializeElevatedSession

public static ApplSession initializeElevatedSession(javax.security.auth.Subject subject,
                                                    ApplUser submittingUser,
                                                    java.sql.Connection conn,
                                                    java.util.ArrayList<java.lang.String> attrs)
This variation of initializeSession takes in the Subject to create the session as, an optional connection to initialize, and a String representing the user whose context (eg language preferences, history columns) will be used by the session.

Parameters:
subject - the Subject containing the user identity info
submittingUser - the user that is being represented by this request - used by ESS
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

initializeElevatedSession

public static ApplSession initializeElevatedSession(javax.security.auth.Subject subject,
                                                    ApplUser submittingUser,
                                                    java.sql.Connection conn)
This variation of initializeSession takes in the Subject to create the session as, an optional connection to initialize, and a String representing the user whose context (eg language preferences, history columns) will be used by the session.

Parameters:
subject - the Subject containing the user identity info
submittingUser - the user that is being represented by this request - used by ESS
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
initializeElevatedSession(javax.security.auth.Subject, oracle.apps.fnd.applcore.common.ApplUser, java.sql.Connection, java.util.ArrayList), terminateSession()

initializeSession

public static ApplSession initializeSession(java.lang.String userGuid,
                                            java.lang.String userName,
                                            java.util.List<java.lang.String> roleGuids,
                                            java.util.List<java.lang.String> roleNames,
                                            java.sql.Connection conn)
This version of initializeSession takes in the user and role information as Strings. It is generally only expected to be used for simple testcases. When the code completes, the terminateSession method should be called to free up the session.

Parameters:
userName - the name of the user to create the session for
userGuid - the GUID of the user to create the session for
roleGuids - an ordered list of role GUID's, or null
roleNames - the corresponding role names
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

initializeSession

public static ApplSession initializeSession(java.lang.String userName,
                                            java.lang.String password,
                                            java.lang.String appName,
                                            java.sql.Connection conn)
This version of initializeSession takes in a username and password, and invokes the JAASAuthenticationService to authenticate the login info and create a Subject if authentication succeeds. This calls into JPS to fetch the application roles associated with the specified user. It also takes in an application name, which defaults to the current app if left null. When the code completes, the terminateSession method should be called to free up the session.

Parameters:
userName - the name of the user to create the session for
password - the password of the user
appNames - the name of the application
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

initializeSession

public static ApplSession initializeSession(java.lang.String userName,
                                            java.lang.String password,
                                            java.sql.Connection conn)
This calls the initializeSession that takes a username/password, but defaults the appName to the current app. When the code completes, the terminateSession method should be called to free up the session.

Parameters:
userName - the name of the user to create the session for
password - the password of the user
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
initializeSession(java.lang.String, java.lang.String, java.lang.String, java.sql.Connection), terminateSession()

initializeTrustedSession

public static ApplSession initializeTrustedSession(java.lang.String userName,
                                                   java.lang.String appName,
                                                   java.sql.Connection conn)
Variation of initializeSession that creates a Subject for the specified user without requiring the password. It also takes in an application name (defaults to the current app if left null) and an optional connection. This calls into JPS to fetch the application roles associated with the specified* user. When the code completes, the terminateSession method should be called to free up the session. You will need to add the assertion login module to your jps-config.xml - see http://aseng-wiki.us.oracle.com/asengwiki/display/ASDevJPS/JPS+Login+Modules+for+WebLogic#JPSLoginModulesforWebLogic-USERASSERTION Additionally, code grants may be required depending on how this is invoked.

Parameters:
userName - the name of the user to create the session for
appName - the name of the application ID
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

initializeSession

public static ApplSession initializeSession(java.lang.String sessionID,
                                            java.sql.Connection conn)
This version of initializeSession takes in a session ID. This can be used to reconstitute an already created session on a different server, provided that server is connected to the same database. If the session is invalid or does not exist this returns null. If an exception is raised during initialization, a JboException is raised. When the code completes, the terminateSession method should be called to free up the session. This now has been changed to just call attachToSession, passing along the session ID.

Parameters:
sessionID - the session ID to reconstitute
conn - the connection to initialize. If this is null, a connection will be obtained automatically.
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

attachToSession

public static ApplSession attachToSession(java.lang.String sessionID,
                                          java.lang.String sessionCookie,
                                          java.sql.Connection conn)
attachToSession is called to attach to an existing session. Callers should pass in the session ID or the session cookie - only one argument is expected, if both are passed the session ID takes precedence. The connection that gets passed will be initialized with the session state, and the session that gets created will be get set as the 'current' session in the JVM. If the session is invalid or does not exist this returns null. If an exception is raised during initialization, a JboException is raised. When the code completes, the terminateSession method should be called to free up the session. If a connection is passed into this method, it is the responsibility of the caller to close it.

Parameters:
sessionID - the session ID to reconstitute
sessionCookie - the cookie representing the session ID to reconstitute, if the session ID is not available.
conn - the connection to initialize. If this is null, a connection will be obtained automatically,
Throws:
oracle.jbo.JboException - if session initialization fails.
See Also:
terminateSession()

attachConnectionToSession

public static void attachConnectionToSession(java.lang.String sessionID,
                                             java.lang.String sessionCookie,
                                             java.sql.Connection conn)
Almost identical to attachToSession, except this does NOT set the newly created session as the 'current' session.


getSessionFromSessionCookie

public static ApplSessionManagement getSessionFromSessionCookie(java.lang.String sessionID,
                                                                java.lang.String sessionCookie,
                                                                java.sql.Connection conn)

terminateSession

public static void terminateSession()
The counterpart to initializeSession/attachToSession, this should be called after the code is finished with the session. If you passed in a connection to initializeSession/attachSession, you should call the terminate that takes in a connection to properly free up the session, though you are responsible for actually closing the connection yourself.

See Also:
terminateSession(java.sql.Connection)

terminateSession

public static void terminateSession(boolean destroyFlag)
This version of terminateSession takes a boolean flag flag to indicate whether the session should be destroyed. If false is specified, the session can still be attached to.

See Also:
terminateSession(java.sql.Connection, boolean)

terminateSession

public static void terminateSession(java.sql.Connection conn)
The counterpart to initializeSession/attachToSession, this should be called after the code is finished with the session. If you passed in a connection to initializeSession/attachSession, if you want the connection to be detached properly pass it into this method. You still are responsible for actually closing the connection yourself.

Parameters:
conn - a connection that was initialized by a call to initializeSession or attachToSession
See Also:
terminateSession(java.sql.Connection)

terminateSession

public static void terminateSession(java.sql.Connection conn,
                                    boolean destroyFlag)
This version of terminateSession takes both the Connection to close and a boolean flag indicating whether the session should be destroyed. If false is specified, the session can still be attached to. This will free up the session associated with the connection, but the caller is still responsible for actually closing the connection themselves.

Parameters:
conn - Connection that was attached to in one by one of the ApplSessionUtil.attach api's
destroyFlag - boolean indicating whether to destroy the session being terminated
See Also:
initializeSession(javax.security.auth.Subject, java.sql.Connection)

getConnection

public static java.sql.Connection getConnection()
Returns a database connection initialized to the current session. The semantics of this api have changed - previously it would return the connection associated with the current ApplSession object. However, in the latest code ApplSession's are no longer tightly coupled with a database connection - connections are retrieved on demand when needed. This api now will always return a new database connection, and it is the responsibility of the caller of this api to release that connection. This is not a new requirement, as we have always documented that a call to ApplSessionUtil.returnConnection() is needed. However, failures to follow that rule will now result in much more noticeable connection leaks. To obtain the connection, this first tries looks for the datasource named in the ApplSession.APPLICATION_DB_DS variable. If that is not available then it manually searches for the ApplicationDB connection specified in the project's connections.xml file. As a last resort, it checks for the "APPCONNFILE" system property, and if it exists we load the specified file and use its properties to establish a database connection. Again, this should always be matched with a call to ApplSessionUtil.returnConnection(); which will close the connection. When unable to obtain a connection using any of the above means, this throws a JboException. If a connection cannot be obtained, this will throw a JboException.

Returns:
the current database Connection
See Also:
returnConnection(java.sql.Connection)

returnConnection

public static void returnConnection(java.sql.Connection conn)
This should always be called after the caller is finished using the connection obtained by a call to ApplSessionUtil.getConnection();. If the getConnection call ended up obtaining a new connection, this will close it. If the getConnection call just returns a pointer to the current session's connection, then this will do nothing. The call to this should be placed in a try.. finally block to guarantee it always executes, even if an exception is thrown.

Parameters:
conn - the connection that was obtained by the call to ApplSessionUtil.getConnection()
See Also:
getConnection()

getSession

public static ApplSession getSession()
Returns the current ApplSession object, or null if there is no session available.


getSessionID

public static java.lang.String getSessionID()
Return the ID of the current lightweight session as a String. For the J2SE case, if no session exists this should return null.

Returns:
the current session ID as an array of char's

getSessionCookie

public static java.lang.String getSessionCookie()
Return the session cookie used to identify the current lightweight session. For the J2SE case, if no session exists this should return null.

Returns:
the current session cookie as a String

getUserGuid

public static java.lang.String getUserGuid()
This returns the current applications user GUID. If no session is available, this throws a JboException.

Returns:
the current user GUID as a String
See Also:
ApplSession.getUserGuid()

getUserName

public static java.lang.String getUserName()
This returns the current applications user name. If no session is available, this throws a JboException.

Returns:
the current user name as a String
See Also:
ApplSession.getUserName()

getProductFamily

public static java.lang.String getProductFamily()
Fetch the current PRODUCT_FAMILY If no session is available, this throws a JboException.

Returns:
the Product Family as a String

getProduct

public static java.lang.String getProduct()
Fetch the current PRODUCT If no session is available, this throws a JboException.

Returns:
the Product as a String

getIndustry

public static java.lang.String getIndustry()
Fetch the current INDUSTRY If no session is available, this throws a JboException.

Returns:
the Industry as a String

getTerritory

public static java.lang.String getTerritory()
Fetch the current TERRITORY value. If no session is available, this throws a JboException.

Returns:
the TERRITORY as a String
See Also:
ApplSession.getTerritory()

getAddtlCustomLevel

public static java.lang.String getAddtlCustomLevel()
Fetch the current ADDTL_CUSTOM_LEVEL If no session is available, this throws a JboException.

Returns:
the Additional Custom Level as a String

getSite

public static java.lang.String getSite()
Return the hardcoded "SITE" value

Returns:
the String "SITE"

getIndustryInTerritory

public static java.lang.String getIndustryInTerritory()
Fetch the current INDUSTRY_IN_TERRITORY If no session is available, this throws a JboException.

Returns:
the Industry In Territory as a String

getGlobal

public static java.lang.String getGlobal()
Return the constant "GLOBAL"

Returns:
the String "GLOBAL"

getHistoryOverrideUserName

public static java.lang.String getHistoryOverrideUserName()
Fetch the current HISTORY_OVERRIDE_USER_NAME, where applicable.

Returns:
the GUID of the overriding user
See Also:
ApplSession.getHistoryOverrideUserName()

getApplicationID

public static java.lang.Integer getApplicationID()
Return the current application ID. If no session is available, this throws a JboException.

Returns:
the current application ID as an Integer
See Also:
ApplSession.getApplicationID()

getApplicationShortName

public static java.lang.String getApplicationShortName()
Return the current application short name. If no session is available, this throws a JboException.

Returns:
the current application short name as a String

getLanguage

public static java.lang.String getLanguage()
Fetch the LANGUAGE value. If no session is available, this throws a JboException.

Returns:
the LANGUAGE as a String
See Also:
ApplSession.getLanguage()

getNLSLang

public static java.lang.String getNLSLang()
Fetch the NLS_LANG value. If no session is available, this throws a JboException.

Returns:
the NLS_LANG as a String

getNLSLanguage

public static java.lang.String getNLSLanguage()
Fetch the NLS_LANGUAGE value. If no session is available, this throws a JboException.

Returns:
the NLS_LANGUAGE as a String

getNLSSort

public static java.lang.String getNLSSort()
Fetch the NLS_SORT value. If no session is available, this throws a JboException.

Returns:
the NLS_SORT as a String
See Also:
ApplSession.getNLSSort()

getDateFormat

public static java.lang.String getDateFormat()
Fetch the DATE_FORMAT value. If no session is available, this throws a JboException.

Returns:
the DATE_FORMAT as a String
See Also:
ApplSession.getDateFormat()

getTimeFormat

public static java.lang.String getTimeFormat()
Fetch the TIME_FORMAT value. If no session is available, this throws a JboException.

Returns:
the TIME_FORMAT as a String
See Also:
ApplSession.getTimeFormat()

getGroupingSeparator

public static char getGroupingSeparator()
Fetch the GROUPING_SEPARATOR value. If no session is available, this throws a JboException.

Returns:
the GROUPING_SEPARATOR as a char
See Also:
ApplSession.getGroupingSeparator()

getDecimalSeparator

public static char getDecimalSeparator()
Fetch the DECIMAL_SEPARATOR value. If no session is available, this throws a JboException.

Returns:
the DECIMAL_SEPARATOR as a char
See Also:
ApplSession.getDecimalSeparator()

getClientEncoding

public static java.lang.String getClientEncoding()
Fetch the CLIENT_ENCODING value. If no session is available, this throws a JboException.

Returns:
the CLIENT_ENCODING as a String
See Also:
ApplSession.getClientEncoding()

getCurrency

public static java.lang.String getCurrency()
Fetch the CURRENCY value. If no session is available, this throws a JboException.

Returns:
the CURRENCY as a String
See Also:
ApplSession.getCurrency()

getTimeZone

public static java.lang.String getTimeZone()
Fetch the TIMEZONE value. If no session is available, this throws a JboException.

Returns:
the TIMEZONE as a String
See Also:
ApplSession.getTimeZone()

getDisplayNameLanguage

public static java.lang.String getDisplayNameLanguage()
Fetch the DISPLAY_NAME_LANGUAGE value. If no session is available, this throws a JboException.

Returns:
the DISPLAY_NAME_LANGUAGE as a String
See Also:
ApplSession.getDisplayNameLanguage()

getUserDisplayName

public static java.lang.String getUserDisplayName()
Fetch the DISPLAY_NAME value. If no session is available, this throws a JboException.

Returns:
the USER_DISPLAY_NAME as a String
See Also:
ApplSession.getUserDisplayName()

getAccessibilityMode

public static java.lang.String getAccessibilityMode()
Fetch the ACCESSIBILITY_MODE. If no session is available, this throws a JboException.

Returns:
the ACCESSIBILITY_MODE as a String
See Also:
ApplSession.getAccessibilityMode()

getAnimationEnabled

public static java.lang.Boolean getAnimationEnabled()
Fetch the user preference attribute - AnimationEnabled.

Returns:
the current user's AnimationEnabled flag as Boolean

getEmbeddedHelpEnabled

public static java.lang.Boolean getEmbeddedHelpEnabled()
Fetch the user preference attribute - EmbeddedHelpEnabled.

Returns:
the current user's EmbeddedHelpEnabled flag as Boolean

getColorContrast

public static java.lang.String getColorContrast()
Fetch the user preference attribute - ColorContrast.

Returns:
the current user's ColorContrast flag as a String

getFontSize

public static java.lang.String getFontSize()
Fetch the user preference attribute - FontSize.

Returns:
the current user's FontSize flag as a String

getNumberFormat

public static java.lang.String getNumberFormat()
Fetch the user preference attribute - NumberFormat.

Returns:
the current user's Number Format as a String

getIntegerFormat

public static java.lang.String getIntegerFormat()
Fetch the user preference attribute - IntegerFormat.

Returns:
the current user's Integer Format as a String

getLogoutURL

public static java.lang.String getLogoutURL()
Fetch the logout URL for this session, if defined.

Returns:
the logout URL as a String

getEnterpriseID

public static java.lang.String getEnterpriseID()
Return the current user's enterprise ID

Returns:
the current user's enterprise ID as a String

getSandboxID

public static java.lang.String getSandboxID()
Return the current user's sandbox ID

Returns:
the current user's sandbox ID as a String

getHCMUserPersonID

public static java.lang.String getHCMUserPersonID()

getHCMUserPrimaryAssignmentID

public static java.lang.String getHCMUserPrimaryAssignmentID()

getHCMUserPrimaryWorkTermsAssignmentID

public static java.lang.String getHCMUserPrimaryWorkTermsAssignmentID()

getHCMUserID

public static java.lang.String getHCMUserID()

getEnterpriseId

public static java.lang.String getEnterpriseId()
Deprecated. in favor of getEnterpriseID()

See Also:
getEnterpriseID()

getHCMUserPersonId

public static java.lang.String getHCMUserPersonId()
Deprecated. in favor of getHCMUserPersonID

See Also:
getHCMUserPersonID()

getHCMUserPrimaryAssignmentId

public static java.lang.String getHCMUserPrimaryAssignmentId()
Deprecated. in favor of getHCMUserPrimaryAssignmentID

See Also:
getHCMUserPrimaryAssignmentID()

getHCMUserPrimaryWorkTermsAssignmentId

public static java.lang.String getHCMUserPrimaryWorkTermsAssignmentId()
Deprecated. in favor of getHCMUserPrimaryWorkTermsAssignmentID

See Also:
getHCMUserPrimaryWorkTermsAssignmentID()

getHCMUserId

public static java.lang.String getHCMUserId()
Deprecated. in favor of getHCMUserID

See Also:
getHCMUserID()

getSessionAttribute

public static java.lang.String getSessionAttribute(java.lang.String name)
Return the specified attribute from the FND_SESSION_NAMESPACE. If no session is available, this throws a JboException.

Parameters:
name - the name of the attribute to fetch
Returns:
the associated session attribute as a String

getSessionAttribute

public static java.lang.String getSessionAttribute(java.lang.String name,
                                                   java.lang.String defaultValue)
Return the specified attribute from the FND_SESSION_NAMESPACE. If the attribute is not set currently (for now, this means if the attribute is null), then this returns the 'defaultValue' passed. If no session is available, this throws a JboException.

Parameters:
name - the name of the attribute to fetch
defaultValue - the value that is returned if the attribute is not set. if null, the value is ignored.
Returns:
the associated session attribute as a String, or 'defaultValue' if the attribute is not set.

getSessionAttribute

public static java.lang.String getSessionAttribute(java.lang.String name,
                                                   java.lang.String defaultValue,
                                                   boolean setIfDefaulted)
Return the specified attribute from the FND_SESSION_NAMESPACE. If the attribute is not set currently (for now, this means if the attribute is null), then this returns the 'defaultValue' passed. If the default value is used, this will actually set the attribute to that value if the 'setIfDefaulted' flag is true. If no session is available, this throws a JboException.

Parameters:
name - the name of the attribute to fetch
defaultValue - the value that is returned if the attribute is not set. if null, the value is ignored.
setIfDefaulted - if the defaultValue is used, whether to set that attribute before returning
Returns:
the associated session attribute as a String, or 'defaultValue' if the attribute is not set.

getNamespaceAttribute

public static java.lang.String getNamespaceAttribute(java.lang.String namespaceName,
                                                     java.lang.String attrName)
Return the value from the specified namespace. Throws an exception if the session or the namespace do not exist. Currently returns null if the attribute passed in does not exist. ### do we want to return some constant indicating the parameter ### was undefined? or just provide a separate 'isdefined' method?

Parameters:
namespaceName - then namespace name
attrName - the attribute name
Returns:
the value of the attribute as a String

getNamespaceAttributeNum

public static java.lang.Integer getNamespaceAttributeNum(java.lang.String namespaceName,
                                                         java.lang.String attrName)
Return the value from the specified namespace as an Integer. Throws an exception if the session or the namespace do not exist. Currently returns null if the attribute passed in does not exist. ### do we want to return some constant indicating the parameter ### was undefined? or just provide a separate 'isdefined' method?

Parameters:
namespaceName - then namespace name
attrName - the attribute name
Returns:
the value of the attribute as an Integer

getSubject

public static javax.security.auth.Subject getSubject(java.security.Principal principal)
Helper method to obtain the Subject. If a Principal is passed, it will get added to the Subject's list of Principals. For internal use only.

Parameters:
principal - Principal to add to the Subject
Returns:
the current Subject

getSubject

public static javax.security.auth.Subject getSubject()
Version of getSubject that takes no arguments. For internal use only.


getSessionRolesKey

public static java.lang.String getSessionRolesKey()

getApplRoles

public static java.util.List<ApplRole> getApplRoles(javax.security.auth.Subject subject)
Helper method to obtain the role info from the Subject. For internal use only - the format of the List is proprietary and subject to change w/o notice.

Returns:
an array of ApplRole objects corresponding to the roles in the Subject

currentAppStripeLoaded

public static boolean currentAppStripeLoaded()
Checks if the current application stripe has already had its roles loaded into the specified session.


currentAppStripeLoaded

public static boolean currentAppStripeLoaded(ApplSession session)
Checks if the current application stripe has already had its roles loaded into the specified session.

Parameters:
session - the ApplSession to check against

getNewConnection

public static java.sql.Connection getNewConnection()
Establishes a new, vanilla database connection - first it checks for the presence of the "jdbc/ApplicationDBDS" datasource and pulls the connection from there. When running in J2SE mode, though, datasources are not available - in that case it manually establishes a connection using the info specified in the connections.xml file. As a last resort, it checks for the existence of the APPCONNFILE property for specifying the database connection info. The connection returned from this call will not have its application state initialized. It is the responsibility of the caller to close this connection.

Returns:
a database connection

getUserLocale

public static java.util.ArrayList<java.lang.String> getUserLocale(java.lang.String userName)
Returns ArrayList containing 'name=value' pairs of LDAP preferences, which is passed along at session creation/conversion time to default the corresponding session attributes. This also fetches the enteprise ID for the user, if available.

Parameters:
userName - the name of the current user
Returns:
ArrayList of String

fetchUserDisplayName

public static java.lang.String fetchUserDisplayName(java.lang.String userName,
                                                    java.lang.String displayNameLanguage)

getUserPrefsFromLdap

public static java.util.HashMap<java.lang.String,java.lang.String> getUserPrefsFromLdap(java.lang.String userName)

parseNumberFormat

public static java.lang.String parseNumberFormat(java.lang.String numberFormat)
For internal use only, public only so we can invoke this from our test code.


populateSessionUser

public static ApplUser populateSessionUser(java.lang.String userGuid,
                                           java.lang.String userName,
                                           java.sql.Connection conn)
Called to prepopulate the FND_SESSION_USERS table with user info, rather than relying on the table being populated when the user logs in. If the specified user already has been loaded, this is a no-op.

Parameters:
userGuid - the user's guid
userName - the user's name
enterpriseID - the enterprise ID to use. if null, will be defaulted
conn - the database connection to use
Returns:
an ApplUser object representing the specified userguid/username.

getProfileValue

public static java.lang.String getProfileValue(java.lang.String profileName)
Utility method to get the Profile Value for a given Profile Name using the ProfileServiceAM. ProfileServiceAM is used since we do not have any AM or VO's.

Parameters:
profileName -
Returns:
profileValue

setProfileValue

public static java.lang.String setProfileValue(java.lang.String profileName,
                                               java.lang.String levelName,
                                               java.lang.String levelValue,
                                               java.lang.String profileValue)
Utility method to set the Profile Value for a given Profile Name using the ProfileServiceAM. ProfileServiceAM is used since we do not have any AM or VO's.

Parameters:
profileName - Name of profile
levelName - Name of level. Must be a valid level for the profile hierarchy, for DEFAULT one of: SITE, PRODUCT, USER.
levelValue - Level value. Must be a valid value for this level.
profileValue - New profile value. Must be a valid value for this profile, and must be non-null. Use clearProfileValue() to remove a profile value.

removeProfileValue

public static void removeProfileValue(java.lang.String profileName,
                                      java.lang.String levelName,
                                      java.lang.String levelValue)
Utility method to delte the Profile Value for a given Profile Name using the ProfileServiceAM. ProfileServiceAM is used since we do not have any AM or VO's.

Parameters:
profileName - Name of profile
levelName - Name of level. Must be a valid level for the profile hierarchy, for DEFAULT one of: SITE, PRODUCT, USER.
levelValue - Level value. Must be a valid value for this level. Using clearProfileValue() to remove a profile value.

isATGLiteApp

public static boolean isATGLiteApp()

isMultiTenantModeEnabled

public static boolean isMultiTenantModeEnabled()

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-05

Copyright © 2012 Oracle. All Rights Reserved.