Package org.compiere.util
Class Env
java.lang.Object
org.compiere.util.Env
Static constants for environment context attribute key.
Static methods for environment context and session manipulation.
Static methods for environment context and session manipulation.
- Version:
- $Id: Env.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- BF [ 1619390 ] Use default desktop browser as external browser
- BF [ 2017987 ] Env.getContext(TAB_INFO) should NOT use global context
- FR [ 2392044 ] Introduce Env.WINDOW_MAIN
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static int
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Context Language identifierstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
Context for multi factor authenticationstatic final String
New Linestatic final BigDecimal
Big Decimal 1static final BigDecimal
Big Decimal 100static final String
Context for POS IDstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final int
Tab No for Infostatic final String
static final String
static final String
static final int
Window No for Mainstatic final BigDecimal
Big Decimal 0 -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addEventListener
(IEnvEventListener listener) Add environment event listenerstatic void
Clean up all context (i.e. delete it)static void
clearContext
(Properties ctx) Clean up all context (i.e. delete it)static void
clearTabContext
(Properties ctx, int WindowNo, int TabNo) Clean up context for WindowNo and TabNo (i.e. delete it).
Please note that this method is not clearing the tab info context (i.e.static void
clearWinContext
(int WindowNo) Clean up context for WindowNo (i.e. delete it)static void
clearWinContext
(Properties ctx, int WindowNo) Clean up context for WindowNo (i.e. delete it)static void
exitEnv
(int status) Close session and reset environment upon exit/logout of system.static int
Get Login AD_Client_IDstatic String
getAD_Language
(Properties ctx) Get AD_Language value in context.
Fall back to base language if there's no AD_Language value in context.static int
getAD_Org_ID
(Properties ctx) Get Login AD_Org_IDstatic int
getAD_Role_ID
(Properties ctx) Get Login AD_Role_IDstatic int
getAD_User_ID
(Properties ctx) Get Login AD_User_IDstatic String
getContext
(Properties ctx, int WindowNo, int TabNo, String context) Get Value of Context for WindowNo and TabNo.
If not found, try global context.static String
getContext
(Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab) Get Value of Context for WindowNo and TabNo.
If not found, try global context.
If TabNo is TAB_INFO, only tab's context will be checked.static String
getContext
(Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab, boolean onlyWindow) Get Value of Context for WindowNo and TabNo.
If not found, try global context.static String
getContext
(Properties ctx, int WindowNo, String context) Get Value of Context for WindowNo.
If not found, try global context.static String
getContext
(Properties ctx, int WindowNo, String context, boolean onlyWindow) Get Value of Context for WindowNo.static String
getContext
(Properties ctx, String context) Get global Value of Contextstatic Timestamp
getContextAsDate
(Properties ctx, int WindowNo, String context) Get Context for WindowNo and convert it to Timestamp.
If error return today's date.static Timestamp
getContextAsDate
(Properties ctx, String context) Get Context and convert it to Timestamp.
If error return today's date.static int
getContextAsInt
(Properties ctx, int WindowNo, int TabNo, String context) Get Context for WindowNo and TabNo and convert it to an integer (0 if error)static int
getContextAsInt
(Properties ctx, int WindowNo, String context) Get Context for WindowNo and convert it to an integer (0 if error)static int
getContextAsInt
(Properties ctx, int WindowNo, String context, boolean onlyWindow) Get Context for WindowNo and convert it to an integer (0 if error)static int
getContextAsInt
(Properties ctx, String context) Get Context and convert it to an integer (0 if error)static ContextProvider
Get context providerstatic final Properties
getCtx()
Get Contextstatic String[]
Get Context as String array with format: key == valuestatic String
getHeader
(Properties ctx, int WindowNo) Get Header info (documentno, value, name, user name, tenant name and organization name)static ImageIcon
getImageIcon
(String fileNameInImageDir) Get ImageIcon.static ImageIcon
getImageIcon2
(String fileName) Get ImageIcon.static Language
getLanguage
(Properties ctx) Get Language from context.
Fall back to base language if there's no language value in context.static Locale
getLocale
(Properties ctx) Get locale value in contextstatic Language
Get language from locale value in contextstatic Language
Get Login LanguageGet list of active login languagesstatic GridWindowVO
getMWindowVO
(int WindowNo, int AD_Window_ID, int AD_Menu_ID) Get AD_Window value object modelstatic String
getPreference
(Properties ctx, int AD_Window_ID, int AD_InfoWindow, int AD_Process_ID_Of_Panel, String context) Get preference of process from environment contextstatic String
getPreference
(Properties ctx, int AD_Window_ID, int AD_InfoWindow, String context) Get preference of info window from environment contextstatic String
getPreference
(Properties ctx, int AD_Window_ID, String context, boolean system) Get Preference.static ProcessInfo
getProcessInfo
(Properties ctx) Get process info instance from contextstatic IProcessUI
getProcessUI
(Properties ctx) Get IProcessUI instancestatic Properties
Deprecated, for removal: This API element is subject to removal in a future version.static String
Get footer trademark text for reportGet list of language from AD_Message_Trl.static int
getZoomWindowID
(int AD_Table_ID, int Record_ID) Get zoom AD_Window_IDstatic int
getZoomWindowID
(int AD_Table_ID, int Record_ID, int windowNo) Get zoom AD_Window_IDstatic int
getZoomWindowID
(MQuery query) Get zoom AD_Window_IDstatic int
getZoomWindowUU
(int AD_Table_ID, String Record_UU) Get zoom AD_Window_IDstatic int
getZoomWindowUU
(int AD_Table_ID, String Record_UU, int windowNo) Get zoom AD_Window_IDstatic boolean
isAutoCommit
(Properties ctx) Is AutoCommitstatic boolean
isAutoCommit
(Properties ctx, int WindowNo) Is Window AutoCommit (if not set, use default)static boolean
isAutoNew
(Properties ctx) Is Auto New Recordstatic boolean
isAutoNew
(Properties ctx, int WindowNo) Is Window Auto New Record (if not set, use default)static boolean
isBaseLanguage
(String AD_Language, String tableName) Is AD_Language a Base Languagestatic boolean
isBaseLanguage
(Properties ctx, String tableName) Is login language Base Languagestatic boolean
isBaseLanguage
(Language language, String tableName) Is language a Base Languagestatic boolean
isBaseTranslation
(String tableName) Is Table in Base Translation (AD)static boolean
isGlobalVariable
(String variable) Verifies if a context variable name is global, this is, starting with: # Login $ Accounting + Role Injectedstatic boolean
isLogMigrationScript
(String tableName) Is log migration script for SQL statementstatic boolean
isMac()
Do we run on Applestatic boolean
Do we have Multi-Lingual Documents.static boolean
isPreference
(String variable) Verifies if a context variable name is a preference, this is, starting with: P| Preferencestatic boolean
Is read only session?static boolean
Is Show Technical Informationstatic boolean
isSOTrx
(Properties ctx) Is Sales Order Trxstatic boolean
isSOTrx
(Properties ctx, int WindowNo) Is Sales Order Trx for WindowNostatic boolean
isUseCentralizedId
(String tableName) Is use centralized id from id serverstatic boolean
Do we run on Windowsstatic void
logout()
Logout from the systemstatic String
parseContext
(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab) Parse expression and replaces global, window or tab context @tag@ with actual value.static String
parseContext
(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab, boolean ignoreUnparsable) Parse expression and replaces global, window or tab context @tag@ with actual value.static String
parseContext
(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab, boolean ignoreUnparsable, boolean keepEscapeSequence) Parse expression and replaces global, window or tab context @tag@ with actual value.static String
parseContext
(Properties ctx, int WindowNo, String value, boolean onlyWindow) Parse expression and replaces global or Window context @tag@ with actual value.static String
parseContext
(Properties ctx, int WindowNo, String value, boolean onlyWindow, boolean ignoreUnparsable) Parse expression and replaces global or Window context @tag@ with actual value.static String
parseContext
(Properties ctx, int WindowNo, String value, boolean onlyWindow, boolean ignoreUnparsable, boolean keepEscapeSequence) Parse expression and replaces global or Window context @tag@ with actual value.static String
parseVariable
(String expression, PO po, String trxName, boolean keepUnparseable) Parse expression, replaces global or PO properties @tag@ with actual value.static String
parseVariable
(String expression, PO po, String trxName, boolean useColumnDateFormat, boolean useMsgForBoolean, boolean keepUnparseable) Parse expression, replaces global or PO properties @tag@ with actual value.static String
parseVariable
(String expression, PO po, String trxName, boolean useColumnDateFormat, boolean useMsgForBoolean, boolean keepUnparseable, boolean keepEscapeSequence) Parse expression, replaces global or PO properties @tag@ with actual value.static String
parseVariable
(String expression, DefaultEvaluatee evaluatee, boolean keepUnparseable, boolean keepEscapeSequence) Parse expression, replaces global or PO properties @tag@ with actual value.static boolean
removeEventListener
(IEnvEventListener listener) Remove environment event listenerstatic void
reset
(boolean finalCall) Reset envronment contextstatic void
setAutoCommit
(Properties ctx, boolean autoCommit) Deprecated.static void
setAutoCommit
(Properties ctx, int WindowNo, boolean autoCommit) Set Auto Commit for WindowNostatic void
setAutoNew
(Properties ctx, boolean autoNew) Deprecated.static void
setAutoNew
(Properties ctx, int WindowNo, boolean autoNew) Set Auto New Record for WindowNostatic void
setContext
(Properties ctx, int WindowNo, int TabNo, String context, boolean value) Set Context for WindowNo and TabNo to Y/N Valuestatic void
setContext
(Properties ctx, int WindowNo, int TabNo, String context, int value) Set context value for WindowNo and TabNostatic void
setContext
(Properties ctx, int WindowNo, int TabNo, String context, String value) Set Context for WindowNo and TabNo to Valuestatic void
setContext
(Properties ctx, int WindowNo, String context, boolean value) Set Context for WindowNo to Y/N Valuestatic void
setContext
(Properties ctx, int WindowNo, String context, int value) Set Context for WindowNo to int Valuestatic void
setContext
(Properties ctx, int WindowNo, String context, String value) Set Context for WindowNo to Valuestatic void
setContext
(Properties ctx, int WindowNo, String context, Timestamp value) Set Context for WindowNo to Valuestatic void
setContext
(Properties ctx, String context, boolean value) Set Global Context to Y/N Valuestatic void
setContext
(Properties ctx, String context, int value) Set Global Context to (int) Valuestatic void
setContext
(Properties ctx, String context, String value) Set Global Context to Valuestatic void
setContext
(Properties ctx, String context, Timestamp value) Set Global Context to Valuestatic void
setContextProvider
(ContextProvider provider) Deprecated.static void
setCtx
(Properties ctx) Replace the contents of the current session/environment context.
Don't use this to setup a new session/process context, use ServerContext.setCurrentInstance instead.static void
setPredefinedVariables
(Properties ctx, int windowNo, String predefinedVariables) Add in context predefined variables with prefix +, coming from menu, window or role definition.static void
setSOTrx
(Properties ctx, boolean isSOTrx) Set IsSOTrx Y/N flagstatic void
sleep
(int sec) Sleepstatic void
startBrowser
(String url) Show url in Browserstatic void
verifyLanguage
(Properties ctx, Language language) Verify Language.
Check that language is supported by the system.
-
Field Details
-
AD_CLIENT_ID
- See Also:
-
AD_CLIENT_NAME
- See Also:
-
AD_ORG_ID
- See Also:
-
AD_ORG_NAME
- See Also:
-
AD_PRINTCOLOR_ID
- See Also:
-
AD_PRINTFONT_ID
- See Also:
-
AD_PRINTPAPER_ID
- See Also:
-
AD_PRINTTABLEFORMAT_ID
- See Also:
-
AD_ROLE_ID
- See Also:
-
AD_ROLE_NAME
- See Also:
-
AD_ROLE_TYPE
- See Also:
-
AD_SESSION_ID
- See Also:
-
AD_USER_ID
- See Also:
-
AD_USER_NAME
- See Also:
-
C_ACCTSCHEMA_ID
- See Also:
-
C_BANKACCOUNT_ID
- See Also:
-
C_BP_GROUP_ID
- See Also:
-
C_CASHBOOK_ID
- See Also:
-
C_CONVERSIONTYPE_ID
- See Also:
-
C_COUNTRY_ID
- See Also:
-
C_CURRENCY_ID
- See Also:
-
C_DOCTYPETARGET_ID
- See Also:
-
C_DUNNING_ID
- See Also:
-
C_PAYMENTTERM_ID
- See Also:
-
C_REGION_ID
- See Also:
-
C_TAXCATEGORY_ID
- See Also:
-
C_TAX_ID
- See Also:
-
C_UOM_ID
- See Also:
-
CLIENT_INFO_DESKTOP_HEIGHT
- See Also:
-
CLIENT_INFO_DESKTOP_WIDTH
- See Also:
-
CLIENT_INFO_MOBILE
- See Also:
-
CLIENT_INFO_ORIENTATION
- See Also:
-
CLIENT_INFO_TIME_ZONE
- See Also:
-
DATE
- See Also:
-
DB_TYPE
- See Also:
-
GL_CATEGORY_ID
- See Also:
-
HAS_ALIAS
- See Also:
-
IS_CAN_APPROVE_OWN_DOC
- See Also:
-
IS_CLIENT_ADMIN
- See Also:
-
IS_SSO_LOGIN
- See Also:
-
DEVELOPER_MODE
- See Also:
-
LANGUAGE
Context Language identifier- See Also:
-
LANGUAGE_NAME
- See Also:
-
LOCAL_HTTP_ADDRESS
- See Also:
-
LOCALE
- See Also:
-
M_PRICELIST_ID
- See Also:
-
M_PRODUCT_CATEGORY_ID
- See Also:
-
M_WAREHOUSE_ID
- See Also:
-
MFA_Registration_ID
Context for multi factor authentication- See Also:
-
POS_ID
Context for POS ID- See Also:
-
R_STATUSCATEGORY_ID
- See Also:
-
R_STATUS_ID
- See Also:
-
RUNNING_UNIT_TESTING_TEST_CASE
- See Also:
-
SALESREP_ID
- See Also:
-
SHOW_ACCOUNTING
- See Also:
-
SHOW_ADVANCED
- See Also:
-
SHOW_TRANSLATION
- See Also:
-
STANDARD_PRECISION
- See Also:
-
STANDARD_REPORT_FOOTER_TRADEMARK_TEXT
- See Also:
-
SYSTEM_NAME
- See Also:
-
THEME
- See Also:
-
UI_CLIENT
- See Also:
-
USER_LEVEL
- See Also:
-
adWindowDummyID
public static int adWindowDummyID -
WINDOW_MAIN
public static final int WINDOW_MAINWindow No for Main- See Also:
-
TAB_INFO
public static final int TAB_INFOTab No for Info- See Also:
-
ZERO
Big Decimal 0 -
ONE
Big Decimal 1 -
ONEHUNDRED
Big Decimal 100 -
NL
New Line -
PREFIX_PREDEFINED_VARIABLE
- See Also:
-
-
Constructor Details
-
Env
public Env()
-
-
Method Details
-
setContextProvider
Deprecated.- Parameters:
provider
-
-
addEventListener
Add environment event listener- Parameters:
listener
-
-
removeEventListener
Remove environment event listener- Parameters:
listener
-- Returns:
- boolean
-
exitEnv
public static void exitEnv(int status) Close session and reset environment upon exit/logout of system.- Parameters:
status
- System exit status (usually 0 for no error)
-
logout
public static void logout()Logout from the system -
reset
public static void reset(boolean finalCall) Reset envronment context- Parameters:
finalCall
- true to clear everything otherwise login data remains
-
getCtx
Get Context- Returns:
- Properties
-
getContextProvider
Get context provider- Returns:
- context provider for current environment
-
setCtx
Replace the contents of the current session/environment context.
Don't use this to setup a new session/process context, use ServerContext.setCurrentInstance instead.- Parameters:
ctx
- context
-
setContext
Set Global Context to Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
Set Global Context to Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
Set Global Context to (int) Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
Set Global Context to Y/N Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
Set Context for WindowNo to Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
Set Context for WindowNo to Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
Set Context for WindowNo to int Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
Set context value for WindowNo and TabNo- Parameters:
ctx
-WindowNo
-TabNo
-context
- context keyvalue
- context value
-
setContext
Set Context for WindowNo to Y/N Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, int WindowNo, int TabNo, String context, boolean value) Set Context for WindowNo and TabNo to Y/N Value- Parameters:
ctx
- contextWindowNo
- window noTabNo
-context
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, int WindowNo, int TabNo, String context, String value) Set Context for WindowNo and TabNo to Value- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context keyvalue
- context value
-
setAutoCommit
Deprecated.Set Auto Commit- Parameters:
ctx
- contextautoCommit
- auto commit (save)
-
setAutoCommit
Set Auto Commit for WindowNo- Parameters:
ctx
- contextWindowNo
- window noautoCommit
- auto commit (save)
-
setAutoNew
Deprecated.Set Auto New Record- Parameters:
ctx
- contextautoNew
- auto new record
-
setAutoNew
Set Auto New Record for WindowNo- Parameters:
ctx
- contextWindowNo
- window noautoNew
- auto new record
-
setSOTrx
Set IsSOTrx Y/N flag- Parameters:
ctx
- contextisSOTrx
- SO Context
-
getContext
Get global Value of Context- Parameters:
ctx
- contextcontext
- context key- Returns:
- value or ""
-
getContext
Get Value of Context for WindowNo. if not found global context if available and enabled- Parameters:
ctx
- contextWindowNo
- windowcontext
- context keyonlyWindow
- if true, no defaults are used unless explicitly asked for- Returns:
- value or ""
-
getContext
Get Value of Context for WindowNo.
If not found, try global context.- Parameters:
ctx
- contextWindowNo
- windowcontext
- context key- Returns:
- value or ""
-
getContext
Get Value of Context for WindowNo and TabNo.
If not found, try global context.
If TabNo is TAB_INFO, only tab's context will be checked.- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context key- Returns:
- value or ""
-
getContext
public static String getContext(Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab) Get Value of Context for WindowNo and TabNo.
If not found, try global context.
If TabNo is TAB_INFO, only tab's context will be checked.- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context keyonlyTab
- if true, no window value is searched- Returns:
- value or ""
-
getContext
public static String getContext(Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab, boolean onlyWindow) Get Value of Context for WindowNo and TabNo.
If not found, try global context.
If TabNo is TAB_INFO, only tab's context will be checked.- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context keyonlyTab
- if true, no window value is searchedonlyWindow
- if true, no global context will be searched- Returns:
- value or ""
-
getContextAsInt
Get Context and convert it to an integer (0 if error)- Parameters:
ctx
- contextcontext
- context key- Returns:
- value
-
getContextAsInt
Get Context for WindowNo and convert it to an integer (0 if error)- Parameters:
ctx
- contextWindowNo
- window nocontext
- context key- Returns:
- value or 0
-
getContextAsInt
Get Context for WindowNo and convert it to an integer (0 if error)- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyonlyWindow
- if true, do not try global context if context key not found with WindowNo- Returns:
- value or 0
-
getContextAsInt
Get Context for WindowNo and TabNo and convert it to an integer (0 if error)- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context key- Returns:
- value or 0
-
isAutoCommit
Is AutoCommit- Parameters:
ctx
- context- Returns:
- true if auto commit
-
isAutoCommit
Is Window AutoCommit (if not set, use default)- Parameters:
ctx
- contextWindowNo
- window no- Returns:
- true if auto commit
-
IsShowTechnicalInfOnHelp
Is Show Technical Information- Parameters:
ctx
- context- Returns:
- true if IsShowTechnicalInfOnHelp on User Preference
-
isAutoNew
Is Auto New Record- Parameters:
ctx
- context- Returns:
- true if auto new
-
isAutoNew
Is Window Auto New Record (if not set, use default)- Parameters:
ctx
- contextWindowNo
- window no- Returns:
- true if auto new record
-
isSOTrx
Is Sales Order Trx- Parameters:
ctx
- context- Returns:
- true if SO (default)
-
isSOTrx
Is Sales Order Trx for WindowNo- Parameters:
ctx
- contextWindowNo
- window no- Returns:
- true if SO (default)
-
getContextAsDate
Get Context and convert it to Timestamp.
If error return today's date.- Parameters:
ctx
- contextcontext
- context key- Returns:
- Timestamp
-
getContextAsDate
Get Context for WindowNo and convert it to Timestamp.
If error return today's date.- Parameters:
ctx
- contextWindowNo
- window nocontext
- context key- Returns:
- Timestamp
-
getAD_Client_ID
Get Login AD_Client_ID- Parameters:
ctx
- context- Returns:
- login AD_Client_ID
-
getAD_Org_ID
Get Login AD_Org_ID- Parameters:
ctx
- context- Returns:
- login AD_Org_ID
-
getAD_User_ID
Get Login AD_User_ID- Parameters:
ctx
- context- Returns:
- login AD_User_ID
-
getAD_Role_ID
Get Login AD_Role_ID- Parameters:
ctx
- context- Returns:
- login AD_Role_ID
-
getPreference
public static String getPreference(Properties ctx, int AD_Window_ID, String context, boolean system) Get Preference.0) Current Setting 1) Window Preference 2) Global Preference 3) Login settings 4) Accounting settings
- Parameters:
ctx
- contextAD_Window_ID
- window nocontext
- Entity to searchsystem
- System level preferences (vs. user defined)- Returns:
- preference value
-
getPreference
public static String getPreference(Properties ctx, int AD_Window_ID, int AD_InfoWindow, int AD_Process_ID_Of_Panel, String context) Get preference of process from environment context- Parameters:
ctx
-AD_Window_ID
-AD_InfoWindow
-AD_Process_ID_Of_Panel
-context
-- Returns:
- preference value
-
getPreference
public static String getPreference(Properties ctx, int AD_Window_ID, int AD_InfoWindow, String context) Get preference of info window from environment context- Parameters:
ctx
-AD_Window_ID
-AD_InfoWindow
-context
-- Returns:
- preference value
-
isBaseLanguage
Is login language Base Language- Parameters:
ctx
- contexttableName
- ignore- Returns:
- true if language value in ctx is base language
-
isBaseLanguage
Is AD_Language a Base Language- Parameters:
AD_Language
- languagetableName
- ignore- Returns:
- true if AD_Language is a base language
-
isBaseLanguage
Is language a Base Language- Parameters:
language
- languagetableName
- ignore- Returns:
- true if language is a base language
-
isBaseTranslation
Is Table in Base Translation (AD)- Parameters:
tableName
- table- Returns:
- true if table is in base trl
-
isMultiLingualDocument
Do we have Multi-Lingual Documents. Set in DB.loadOrgs.- Parameters:
ctx
- context- Returns:
- true if tenant is using multi lingual documents
-
getAD_Language
Get AD_Language value in context.
Fall back to base language if there's no AD_Language value in context.- Parameters:
ctx
- context- Returns:
- AD_Language eg. en_US
-
getLanguage
Get Language from context.
Fall back to base language if there's no language value in context.- Parameters:
ctx
- context- Returns:
- Language
-
getLoginLanguage
Get Login Language- Parameters:
ctx
- context- Returns:
- Login Language
-
getLocaleLanguage
Get language from locale value in context- Parameters:
ctx
- context- Returns:
- Language
-
getLocale
Get locale value in context- Parameters:
ctx
- context- Returns:
- Locale
-
getSupportedLanguages
Get list of language from AD_Message_Trl.- Returns:
- list of supported language
-
getLoginLanguages
Get list of active login languages- Returns:
- list of active login languages
-
verifyLanguage
Verify Language.
Check that language is supported by the system.- Parameters:
ctx
- might be updated with new AD_Languagelanguage
- language
-
getEntireContext
Get Context as String array with format: key == value- Parameters:
ctx
- context- Returns:
- context string array
-
getHeader
Get Header info (documentno, value, name, user name, tenant name and organization name)- Parameters:
ctx
- contextWindowNo
- window- Returns:
- Header String
-
clearWinContext
Clean up context for WindowNo (i.e. delete it)- Parameters:
ctx
- contextWindowNo
- window
-
clearTabContext
Clean up context for WindowNo and TabNo (i.e. delete it).
Please note that this method is not clearing the tab info context (i.e. _TabInfo).- Parameters:
ctx
- contextWindowNo
- windowTabNo
- tab
-
clearContext
Clean up all context (i.e. delete it)- Parameters:
ctx
- context
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, String value, boolean onlyWindow, boolean ignoreUnparsable) Parse expression and replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of Windowvalue
- Expression to be parsedonlyWindow
- if true, do not use global context valueignoreUnparsable
- If true, just skip context variable that's not resolvable. If false, return "" if there are context variable that's not resolvable.- Returns:
- parsed expression
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, String value, boolean onlyWindow, boolean ignoreUnparsable, boolean keepEscapeSequence) Parse expression and replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of Windowvalue
- Expression to be parsedonlyWindow
- if true, do not use global context valueignoreUnparsable
- If true, just skip context variable that's not resolvable. If false, return "" if there are context variable that's not resolvable.keepEscapeSequence
- if true, keeps the escape sequence '@@' in the parsed string. Otherwise, the '@@' escape sequence is used to keep '@' character in the string.- Returns:
- parsed expression
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab, boolean ignoreUnparsable) Parse expression and replaces global, window or tab context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of WindowtabNo
- Number of Tabvalue
- Expression to be parsedonlyTab
- if true, only context for tabNo are usedignoreUnparsable
- If true, just skip context variable that's not resolvable. If false, return "" if there are context variable that's not resolvable.- Returns:
- parsed expression
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab, boolean ignoreUnparsable, boolean keepEscapeSequence) Parse expression and replaces global, window or tab context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of WindowtabNo
- Number of Tabvalue
- Expression to be parsedonlyTab
- if true, only context for tabNo are usedignoreUnparsable
- If true, just skip context variable that's not resolvable. If false, return "" if there are context variable that's not resolvable.keepEscapeSequence
- if true, keeps the escape sequence '@@' in the parsed string. Otherwise, the '@@' escape sequence is used to keep '@' character in the string.- Returns:
- parsed expression
-
parseContext
Parse expression and replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of Windowvalue
- Expression to be parsedonlyWindow
- if true, no defaults are used- Returns:
- parsed expression or "" if not successful
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab) Parse expression and replaces global, window or tab context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of WindowtabNo
- Number of Tabvalue
- Expression to be parsedonlyTab
- if true, only context for tabNo are used- Returns:
- parsed String or "" if not successful
-
parseVariable
public static String parseVariable(String expression, PO po, String trxName, boolean keepUnparseable) Parse expression, replaces global or PO properties @tag@ with actual value.- Parameters:
expression
-po
-trxName
-keepUnparseable
-- Returns:
- String
-
parseVariable
public static String parseVariable(String expression, PO po, String trxName, boolean useColumnDateFormat, boolean useMsgForBoolean, boolean keepUnparseable) Parse expression, replaces global or PO properties @tag@ with actual value.- Parameters:
expression
-po
-useColumnDateFormat
-useMsgForBoolean
-trxName
-keepUnparseable
- true to keep original context variable tag that can't be resolved- Returns:
- Parsed expression
-
parseVariable
public static String parseVariable(String expression, PO po, String trxName, boolean useColumnDateFormat, boolean useMsgForBoolean, boolean keepUnparseable, boolean keepEscapeSequence) Parse expression, replaces global or PO properties @tag@ with actual value.- Parameters:
expression
-po
-useColumnDateFormat
-useMsgForBoolean
-trxName
-keepUnparseable
- true to keep original context variable tag that can't be resolvedkeepEscapeSequence
- if true, keeps the escape sequence '@@' in the parsed string. Otherwise, the '@@' escape sequence is used to keep '@' character in the string.- Returns:
- Parsed expression
-
parseVariable
public static String parseVariable(String expression, DefaultEvaluatee evaluatee, boolean keepUnparseable, boolean keepEscapeSequence) Parse expression, replaces global or PO properties @tag@ with actual value.- Parameters:
expression
-evaluatee
-keepUnparseable
- true to keep original context variable tag that can't be resolvedkeepEscapeSequence
- if true, keeps the escape sequence '@@' in the parsed string. Otherwise, the '@@' escape sequence is used to keep '@' character in the string.- Returns:
- Parsed expression
-
clearWinContext
public static void clearWinContext(int WindowNo) Clean up context for WindowNo (i.e. delete it)- Parameters:
WindowNo
- window
-
clearContext
public static void clearContext()Clean up all context (i.e. delete it) -
getImageIcon
Get ImageIcon.- Parameters:
fileNameInImageDir
- file name in images folder (e.g. Bean16.gif)- Returns:
- image
-
getImageIcon2
Get ImageIcon. This method different from getImageIcon where the fileName parameter is without extension. The method will first try .gif and then .png if .gif does not exists.- Parameters:
fileName
- file name in images folder without the extension(e.g. Bean16)- Returns:
- image
-
startBrowser
Show url in Browser- Parameters:
url
- url
-
isMac
public static boolean isMac()Do we run on Apple- Returns:
- true if Mac
-
isWindows
public static boolean isWindows()Do we run on Windows- Returns:
- true if windows
-
sleep
public static void sleep(int sec) Sleep- Parameters:
sec
- seconds
-
getRemoteCallCtx
Deprecated, for removal: This API element is subject to removal in a future version.Prepare the context for calling remote server (for e.g, ejb), only default and global variables are pass over. It is too expensive and also can have serialization issue if every remote call to server is passing the whole client context.- Parameters:
ctx
-- Returns:
- Properties
-
getMWindowVO
Get AD_Window value object model- Parameters:
WindowNo
- Window NoAD_Window_ID
- windowAD_Menu_ID
- menu- Returns:
- Model Window Value Object
-
getProcessUI
Get IProcessUI instance- Parameters:
ctx
-- Returns:
- IProcessUI instance or null
-
getProcessInfo
Get process info instance from context- Parameters:
ctx
- context- Returns:
- process info instance or null
-
getZoomWindowID
Get zoom AD_Window_ID- Parameters:
query
-- Returns:
- zoom AD_Window_ID
-
getZoomWindowUU
Get zoom AD_Window_ID- Parameters:
AD_Table_ID
-Record_UU
-- Returns:
- zoom AD_Window_ID
-
getZoomWindowUU
Get zoom AD_Window_ID- Parameters:
AD_Table_ID
-Record_UU
-windowNo
-- Returns:
- zoom AD_Window_ID
-
getZoomWindowID
public static int getZoomWindowID(int AD_Table_ID, int Record_ID) Get zoom AD_Window_ID- Parameters:
AD_Table_ID
-Record_ID
-- Returns:
- zoom AD_Window_ID
-
getZoomWindowID
public static int getZoomWindowID(int AD_Table_ID, int Record_ID, int windowNo) Get zoom AD_Window_ID- Parameters:
AD_Table_ID
-Record_ID
-windowNo
-- Returns:
- zoom AD_Window_ID
-
setPredefinedVariables
Add in context predefined variables with prefix +, coming from menu, window or role definition. Predefined variables must come separated by new lines in one of the formats: VAR=VALUE VAR="VALUE" VAR='VALUE' The + prefix is not required, is added here to the defined variables.
- Parameters:
ctx
-windowNo
- window number or -1 to global levelpredefinedVariables
-
-
isLogMigrationScript
Is log migration script for SQL statement- Parameters:
tableName
-- Returns:
- true if log migration script is turn on and should be used for tableName
-
isUseCentralizedId
Is use centralized id from id server- Returns:
- true if centralized id is turn on and should be used for tableName
-
isReadOnlySession
public static boolean isReadOnlySession()Is read only session? Based on user preference- Returns:
-
isGlobalVariable
Verifies if a context variable name is global, this is, starting with: # Login $ Accounting + Role Injected- Parameters:
variable
-- Returns:
-
isPreference
Verifies if a context variable name is a preference, this is, starting with: P| Preference- Parameters:
variable
-- Returns:
-