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

E22562-01

oracle.apps.fnd.applcore.moac
Class MOACUtil

java.lang.Object
  extended by oracle.apps.fnd.applcore.moac.MOACUtil

public class MOACUtil
extends java.lang.Object

MOACUtil class provides utility methods to initialize MOAC frame work and appending view Criteria to View Object. In addition, there are other helper methods to switch Access Mode and getting MOAC attributes. All publicly accessible methods are static.


Field Summary
static java.lang.String LAST_MOAC_PRIV
          Constant String litarals
static java.lang.String MOAC_QUERY_MODE
           
static java.lang.String MOAC_VC_ROW_NAME
           
 
Constructor Summary
MOACUtil()
           
 
Method Summary
static boolean checkAccess(java.lang.Long orgId)
          Checks if a given Org Id has access.
static boolean checkAccess(java.lang.Long orgId, Privilege priv)
          Checks if a given Org Id has access.
static void createBindAndApplyMOACVC(OAViewObjectImpl pVOImpl, Privilege priv)
          Sets view criteria for restricting data access based on Org Id list.
static oracle.jbo.ViewCriteria createVC(OAViewObjectImpl pVOImpl, java.lang.String accessType, java.lang.String vcName, java.lang.String orgIdAttrbName)
          Create View Criteria for MAOC
static void doMOACInit(Privilege priv, OAApplicationModuleImpl amImpl)
          This method initilizes MOAC.
static java.lang.Long[] getAccessibleBUIds()
          Return the list Org Ids.
static java.lang.Long[] getAccessibleBUIds(Privilege priv)
          Return the list Org Ids.
static java.lang.String[] getAccessibleBUNames()
          Return the list Org Names.
static java.lang.String[] getAccessibleBUNames(Privilege priv)
          Return the list Org Names.
static java.lang.String getAccessMode()
          Returns current access mode set During Init or set Mode switching.
static java.lang.String getAccessMode(Privilege priv)
          Returns current access mode set During Init or set Mode switching for a given privilege.
static java.lang.String getBUName(java.lang.Long orgId)
          Return the Org Name for a given OrgId.
static java.lang.String getBUName(java.lang.Long orgId, Privilege priv)
          Return the Org Name for a given OrgId.
static java.lang.Long getCurrentOrgId()
          Returns current Org Id, In case Single mode it will have valid value.
static java.lang.Long getCurrentOrgId(Privilege priv)
          Returns current Org Id, In case Single mode it will have valid value.
static java.lang.Long getDfltOrgId()
          Returns current Org Id, In case Single mode it will have valid value.
static java.lang.Long getDfltOrgId(Privilege priv)
          Returns current Org Id, In case Single mode it will have valid value.
static Privilege getMostRecentPrivilege()
          Returns most recent Privilege in use, not necessarily the last one used during MOAC init.
static java.lang.String getMultiModeQueryClause(oracle.jbo.ViewCriteriaItem vci)
           
static int getOrgCount()
          Returns Org Count set during MOAC init based on most recent privilege
static int getOrgCount(Privilege priv)
          Returns Org Count set during MOAC init using a given privilege
static java.lang.String getQueryClause(oracle.jbo.ViewCriteria vc)
          This required to set the Query Cluase in MOACCriteria Adapter Work around for bug # 7172280
static int getTotalOrgCount()
          Returns Total Org Count during MOAC init based on most recent privilege
static int getTotalOrgCount(Privilege priv)
          Returns Count of Org Ids during MOAC init using a given privilege
static java.lang.String initMOACplsql(Privilege priv, OAApplicationModuleImpl amImpl)
          This may be used initialize MOAC in PL SQL while calling PL SQL Program Unit from ADF.
static boolean isMOACInitialized(Privilege priv)
          Checks if MOAC is initialized for a given privilege.
static void printMOACAttributes(Privilege priv)
          Used for Testing to print MOAC Attributes
static void setAllOrgAccessMode(Privilege priv)
          Sets access mode to All Org Mode ("A").
static void setMultiOrgAccessMode()
          Sets access mode to Multi Org Mode ("M").
static void setMultiOrgAccessMode(Privilege priv)
          Sets access mode to Multi Org Mode ("M").
static void setSingleOrgAccessMode(java.lang.Long orgId)
           
static void setSingleOrgAccessMode(java.lang.Long orgId, Privilege priv)
          Pass OrgId to switch to Single Org Access Mode ("S").
static java.lang.String showSecurityPredicate(Privilege priv, OAApplicationModuleImpl amImpl)
          used for testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_MOAC_PRIV

public static final java.lang.String LAST_MOAC_PRIV
Constant String litarals

See Also:
Constant Field Values

MOAC_VC_ROW_NAME

public static final java.lang.String MOAC_VC_ROW_NAME
See Also:
Constant Field Values

MOAC_QUERY_MODE

public static final java.lang.String MOAC_QUERY_MODE
See Also:
Constant Field Values
Constructor Detail

MOACUtil

public MOACUtil()
Method Detail

doMOACInit

public static void doMOACInit(Privilege priv,
                              OAApplicationModuleImpl amImpl)
This method initilizes MOAC. Sets the list of Org Id based on privilege passed. List of Org id is cached in a session Hash Map as part of user data and reused for the session as long the privilege is in use.

Parameters:
priv - Privilege of the current user.
amImpl - Application Module to be used to call this method from AM it will be amImpl from VO use (OAApplicationModuleImpl)VOImpl.getRootApplicationModule()

getOrgCount

public static int getOrgCount()
Returns Org Count set during MOAC init based on most recent privilege

Returns:
Count of Accessible Org Ids

getOrgCount

public static int getOrgCount(Privilege priv)
Returns Org Count set during MOAC init using a given privilege

Parameters:
priv - Privilege of the user.
Returns:
Count of Accessible Org Ids

getTotalOrgCount

public static int getTotalOrgCount()
Returns Total Org Count during MOAC init based on most recent privilege

Returns:
Count of Org Ids in FUN_ALL_BUSINESS_UNITS_V when initalized

getTotalOrgCount

public static int getTotalOrgCount(Privilege priv)
Returns Count of Org Ids during MOAC init using a given privilege

Parameters:
priv - Privilege of the user.
Returns:
Count of Org Ids in FUN_ALL_BUSINESS_UNITS_V when initalized

getAccessMode

public static java.lang.String getAccessMode()
Returns current access mode set During Init or set Mode switching. This acces mode is for most recent privilege used to initialize MOAC.

Returns:
Current Acces Mode

getAccessMode

public static java.lang.String getAccessMode(Privilege priv)
Returns current access mode set During Init or set Mode switching for a given privilege.

Parameters:
priv - Privilege of the user.
Returns:
Current Acces Mode

getCurrentOrgId

public static java.lang.Long getCurrentOrgId()
Returns current Org Id, In case Single mode it will have valid value. In case of Multiple Org access mode this should return null. This value is based on most recent privilege used to initialize MOAC.

Returns:
Current Org Id

getCurrentOrgId

public static java.lang.Long getCurrentOrgId(Privilege priv)
Returns current Org Id, In case Single mode it will have valid value. In case of Multiple Org access mode this should return null. This value is for a given privilege.

Parameters:
priv - Privilege of the user.
Returns:
Current Org Id

getDfltOrgId

public static java.lang.Long getDfltOrgId()
Returns current Org Id, In case Single mode it will have valid value. In case of Multiple Org access mode this should return null. This value is based on most recent privilege used initialize the MOAC.

Returns:
Current Org Id

getDfltOrgId

public static java.lang.Long getDfltOrgId(Privilege priv)
Returns current Org Id, In case Single mode it will have valid value. In case of Multiple Org access mode this should return null. This value is based is for given privilege.

Parameters:
priv - Privilege of the user/role.
Returns:
Current Org Id

getMostRecentPrivilege

public static Privilege getMostRecentPrivilege()
Returns most recent Privilege in use, not necessarily the last one used during MOAC init. However, it may have used to initialize MOAC during this session.

Returns:
Most recent Privilege in use

setSingleOrgAccessMode

public static void setSingleOrgAccessMode(java.lang.Long orgId)

setSingleOrgAccessMode

public static void setSingleOrgAccessMode(java.lang.Long orgId,
                                          Privilege priv)
Pass OrgId to switch to Single Org Access Mode ("S"). For switching back Multi Mode call setMultiOrgAccessMode This setting will come into effect for the data returned from VO Query excuted after calling this. This can be done for given privilege

Parameters:
orgId - OrgId for which Single Access Mode will be set
priv - Privlege of the user

checkAccess

public static boolean checkAccess(java.lang.Long orgId)
Checks if a given Org Id has access. Should be called when MOAC is initialized. Checking is done based on most recent privilege.

Parameters:
orgId - Org Id for which access is being verified.
Returns:
True if user has access otherwise false

checkAccess

public static boolean checkAccess(java.lang.Long orgId,
                                  Privilege priv)
Checks if a given Org Id has access. Should be called when MOAC is initialized. Checking is done based on a gien privilege.

Parameters:
orgId - Org Id for which access is being verified.
priv - Privlege of the user
Returns:
True if user has access otherwise false

setAllOrgAccessMode

public static void setAllOrgAccessMode(Privilege priv)
Sets access mode to All Org Mode ("A"). Switch to All Org Access Mode comes into effect for the data returned from VO query executed after this is called. Setting will be done for a given privilege.


setMultiOrgAccessMode

public static void setMultiOrgAccessMode()
Sets access mode to Multi Org Mode ("M"). Switch to Multi Org Access Mode comes into effect for the data returned from VO query executed after this is called. Setting will be based most recent privilege used.


setMultiOrgAccessMode

public static void setMultiOrgAccessMode(Privilege priv)
Sets access mode to Multi Org Mode ("M"). Switch to Multi Org Access Mode comes into effect for the data returned from VO query executed after this is called. Setting will be done for a given privilege.


getAccessibleBUIds

public static java.lang.Long[] getAccessibleBUIds()
Return the list Org Ids. A valid list will be returned when MOAC is initialized. Org Id list is for most recent privilege used.

Returns:
an array of Org Ids

getAccessibleBUIds

public static java.lang.Long[] getAccessibleBUIds(Privilege priv)
Return the list Org Ids. A valid list will be returned when MOAC is initialized. Org Id list is for a given privilege.

Parameters:
priv - Privlege of the user
Returns:
An array of Org Ids

getAccessibleBUNames

public static java.lang.String[] getAccessibleBUNames()
Return the list Org Names. A valid list will be returned when MOAC is initialized. BU names are for amost recent privilege.

Returns:
an Array of Org names

getAccessibleBUNames

public static java.lang.String[] getAccessibleBUNames(Privilege priv)
Return the list Org Names. A valid list will be returned when MOAC is initialized. BU names are for a given privilege.

Parameters:
priv - Privilege of the user/role
Returns:
An Array of Org names

getBUName

public static java.lang.String getBUName(java.lang.Long orgId)
Return the Org Name for a given OrgId. A valid Org name is expected when MOAC is initialized.

Parameters:
orgId - A valid Org Id
Returns:
Org name for given Org Id

getBUName

public static java.lang.String getBUName(java.lang.Long orgId,
                                         Privilege priv)
Return the Org Name for a given OrgId. A valid Org name is expected when MOAC is initialized

Parameters:
orgId - A valid Org Id
Returns:
Org name for given Org Id

isMOACInitialized

public static boolean isMOACInitialized(Privilege priv)
Checks if MOAC is initialized for a given privilege.

Returns:
true if MOAC is initialized otherwise flase

createBindAndApplyMOACVC

public static void createBindAndApplyMOACVC(OAViewObjectImpl pVOImpl,
                                            Privilege priv)
Sets view criteria for restricting data access based on Org Id list. Normally invoked by overidding VOImpl object's getApplyAllViewCriteriasmethod

Parameters:
pVOImpl - Moac enabled View Object Impl.
priv - Privilege of the user

getQueryClause

public static java.lang.String getQueryClause(oracle.jbo.ViewCriteria vc)
This required to set the Query Cluase in MOACCriteria Adapter Work around for bug # 7172280

Parameters:
vc - View Criteria
Returns:
A Query Clause

getMultiModeQueryClause

public static java.lang.String getMultiModeQueryClause(oracle.jbo.ViewCriteriaItem vci)

createVC

public static oracle.jbo.ViewCriteria createVC(OAViewObjectImpl pVOImpl,
                                               java.lang.String accessType,
                                               java.lang.String vcName,
                                               java.lang.String orgIdAttrbName)
Create View Criteria for MAOC

Parameters:
pVOImpl - View Object Impl
accessType - MOAC access Type
vcName - View Criteria Name
orgIdAttrbName - VO attribute name for MOAC
Returns:

initMOACplsql

public static java.lang.String initMOACplsql(Privilege priv,
                                             OAApplicationModuleImpl amImpl)
This may be used initialize MOAC in PL SQL while calling PL SQL Program Unit from ADF. If MAOC is not initilized before calling this in ADF layer this method firat initalizes the MOAC for ADF environment and then initializes PL SQL environment for with same MOAC attributes.

Parameters:
priv - Privilege of the user/role
amImpl - ApplicationMOduleImpl object
Returns:

printMOACAttributes

public static void printMOACAttributes(Privilege priv)
Used for Testing to print MOAC Attributes

Parameters:
priv -

showSecurityPredicate

public static java.lang.String showSecurityPredicate(Privilege priv,
                                                     OAApplicationModuleImpl amImpl)
used for testing

Parameters:
priv - Privilege of the user
amImpl - Application Module Implementation
Returns:

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

E22562-01

Copyright © 2011 Oracle. All Rights Reserved.