Package org.compiere.util
Class Env
- java.lang.Object
-
- org.compiere.util.Env
-
public final class Env extends Object
System Environment and static variables.- 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
-
Constructor Summary
Constructors Constructor Description Env()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addEventListener(IEnvEventListener listener)
static void
clearContext()
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 Window Tab (i.e. delete it).static void
clearWinContext(int WindowNo)
Clean up context for Window (i.e. delete it)static void
clearWinContext(Properties ctx, int WindowNo)
Clean up context for Window (i.e. delete it)static void
exitEnv(int status)
Exit Systemstatic int
getAD_Client_ID(Properties ctx)
Get Login AD_Client_IDstatic String
getAD_Language(Properties ctx)
Get System AD_Languagestatic 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 Window and Tab, if not found global context if available.static String
getContext(Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab)
Get Value of Context for Window and Tab, if not found global context if available.static String
getContext(Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab, boolean onlyWindow)
Get Value of Context for Window and Tab, if not found global context if available.static String
getContext(Properties ctx, int WindowNo, String context)
Get Value of Context for Window.static String
getContext(Properties ctx, int WindowNo, String context, boolean onlyWindow)
Get Value of Context for Window.static String
getContext(Properties ctx, String context)
Get global Value of Contextstatic Timestamp
getContextAsDate(Properties ctx, int WindowNo, String context)
Get Context and convert it to a Timestamp if error return today's datestatic Timestamp
getContextAsDate(Properties ctx, String context)
Get Context and convert it to a Timestamp if error return today's datestatic int
getContextAsInt(Properties ctx, int WindowNo, int TabNo, String context)
Get Context and convert it to an integer (0 if error)static int
getContextAsInt(Properties ctx, int WindowNo, String context)
Get Context and convert it to an integer (0 if error)static int
getContextAsInt(Properties ctx, int WindowNo, String context, boolean onlyWindow)
Get Context 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
getContextProvider()
static Properties
getCtx()
Get Contextstatic String[]
getEntireContext(Properties ctx)
Get Context as String array with format: key == valuestatic String
getHeader(Properties ctx, int WindowNo)
Get Header info (connection, org, user)static ImageIcon
getImageIcon(String fileNameInImageDir)
Get ImageIcon.static ImageIcon
getImageIcon2(String fileName)
Get ImageIcon.static Language
getLanguage(Properties ctx)
Get System Languagestatic Locale
getLocale(Properties ctx)
static Language
getLocaleLanguage(Properties ctx)
static Language
getLoginLanguage(Properties ctx)
Get Login Languagestatic ArrayList<String>
getLoginLanguages()
static GridWindowVO
getMWindowVO(int WindowNo, int AD_Window_ID, int AD_Menu_ID)
Get Window 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 envstatic String
getPreference(Properties ctx, int AD_Window_ID, int AD_InfoWindow, String context)
get preference of info window from envstatic String
getPreference(Properties ctx, int AD_Window_ID, String context, boolean system)
Get Preference.static ProcessInfo
getProcessInfo(Properties ctx)
static IProcessUI
getProcessUI(Properties ctx)
static Properties
getRemoteCallCtx(Properties ctx)
Prepare the context for calling remote server (for e.g, ejb), only default and global variables are pass over.static String
getStandardReportFooterTrademarkText()
static ArrayList<String>
getSupportedLanguages()
static int
getZoomWindowID(int AD_Table_ID, int Record_ID)
static int
getZoomWindowID(int AD_Table_ID, int Record_ID, int windowNo)
static int
getZoomWindowID(MQuery query)
static 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)
Check Base Languagestatic boolean
isBaseLanguage(Properties ctx, String tableName)
Check Base Languagestatic boolean
isBaseLanguage(Language language, String tableName)
Check Base Languagestatic boolean
isBaseTranslation(String tableName)
Table is in Base Translation (AD)static boolean
isMac()
Do we run on Applestatic boolean
isMultiLingualDocument(Properties ctx)
Do we have Multi-Lingual Documents.static boolean
isSOTrx(Properties ctx)
Is Sales Order Trxstatic boolean
isSOTrx(Properties ctx, int WindowNo)
Is Sales Order Trxstatic boolean
isWindows()
Do we run on Windowsstatic void
logout()
Logout from the systemstatic String
parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab)
Parse Context replaces global or Window context @tag@ with actual value.static String
parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab, boolean ignoreUnparsable)
Parse Context replaces global or Window context @tag@ with actual value.static String
parseContext(Properties ctx, int WindowNo, String value, boolean onlyWindow)
Parse Context replaces global or Window context @tag@ with actual value.static String
parseContext(Properties ctx, int WindowNo, String value, boolean onlyWindow, boolean ignoreUnparsable)
Parse Context 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 boolean
removeEventListener(IEnvEventListener listener)
static void
reset(boolean finalCall)
Reset Cachestatic void
setAutoCommit(Properties ctx, boolean autoCommit)
Deprecated.static void
setAutoCommit(Properties ctx, int WindowNo, boolean autoCommit)
Set Auto Commit for Windowstatic void
setAutoNew(Properties ctx, boolean autoNew)
Deprecated.static void
setAutoNew(Properties ctx, int WindowNo, boolean autoNew)
Set Auto New Record for Windowstatic void
setContext(Properties ctx, int WindowNo, int TabNo, String context, boolean value)
Set Context for Window to Y/N Valuestatic void
setContext(Properties ctx, int WindowNo, int TabNo, String context, int value)
static void
setContext(Properties ctx, int WindowNo, int TabNo, String context, String value)
Set Context for Window and Tab to Valuestatic void
setContext(Properties ctx, int WindowNo, String context, boolean value)
Set Context for Window to Y/N Valuestatic void
setContext(Properties ctx, int WindowNo, String context, int value)
Set Context for Window to int Valuestatic void
setContext(Properties ctx, int WindowNo, String context, String value)
Set Context for Window to Valuestatic void
setContext(Properties ctx, int WindowNo, String context, Timestamp value)
Set Context for Window 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/process context.static void
setPredefinedVariables(Properties ctx, int windowNo, String predefinedVariables)
Add in context predefined variables with prefix +, coming from menu or window 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 variablesstatic void
setSOTrx(Properties ctx, boolean isSOTrx)
Set SO Trxstatic void
sleep(int sec)
Sleepstatic void
startBrowser(String url)
Start Browserstatic void
verifyLanguage(Properties ctx, Language language)
Verify Language.
-
-
-
Field Detail
-
AD_CLIENT_ID
public static final String AD_CLIENT_ID
- See Also:
- Constant Field Values
-
AD_CLIENT_NAME
public static final String AD_CLIENT_NAME
- See Also:
- Constant Field Values
-
AD_ORG_ID
public static final String AD_ORG_ID
- See Also:
- Constant Field Values
-
AD_ORG_NAME
public static final String AD_ORG_NAME
- See Also:
- Constant Field Values
-
AD_PRINTCOLOR_ID
public static final String AD_PRINTCOLOR_ID
- See Also:
- Constant Field Values
-
AD_PRINTFONT_ID
public static final String AD_PRINTFONT_ID
- See Also:
- Constant Field Values
-
AD_PRINTPAPER_ID
public static final String AD_PRINTPAPER_ID
- See Also:
- Constant Field Values
-
AD_PRINTTABLEFORMAT_ID
public static final String AD_PRINTTABLEFORMAT_ID
- See Also:
- Constant Field Values
-
AD_ROLE_ID
public static final String AD_ROLE_ID
- See Also:
- Constant Field Values
-
AD_ROLE_NAME
public static final String AD_ROLE_NAME
- See Also:
- Constant Field Values
-
AD_SESSION_ID
public static final String AD_SESSION_ID
- See Also:
- Constant Field Values
-
AD_USER_ID
public static final String AD_USER_ID
- See Also:
- Constant Field Values
-
AD_USER_NAME
public static final String AD_USER_NAME
- See Also:
- Constant Field Values
-
C_ACCTSCHEMA_ID
public static final String C_ACCTSCHEMA_ID
- See Also:
- Constant Field Values
-
C_BANKACCOUNT_ID
public static final String C_BANKACCOUNT_ID
- See Also:
- Constant Field Values
-
C_BP_GROUP_ID
public static final String C_BP_GROUP_ID
- See Also:
- Constant Field Values
-
C_CASHBOOK_ID
public static final String C_CASHBOOK_ID
- See Also:
- Constant Field Values
-
C_CONVERSIONTYPE_ID
public static final String C_CONVERSIONTYPE_ID
- See Also:
- Constant Field Values
-
C_COUNTRY_ID
public static final String C_COUNTRY_ID
- See Also:
- Constant Field Values
-
C_CURRENCY_ID
public static final String C_CURRENCY_ID
- See Also:
- Constant Field Values
-
C_DOCTYPETARGET_ID
public static final String C_DOCTYPETARGET_ID
- See Also:
- Constant Field Values
-
C_DUNNING_ID
public static final String C_DUNNING_ID
- See Also:
- Constant Field Values
-
C_PAYMENTTERM_ID
public static final String C_PAYMENTTERM_ID
- See Also:
- Constant Field Values
-
C_REGION_ID
public static final String C_REGION_ID
- See Also:
- Constant Field Values
-
C_TAXCATEGORY_ID
public static final String C_TAXCATEGORY_ID
- See Also:
- Constant Field Values
-
C_TAX_ID
public static final String C_TAX_ID
- See Also:
- Constant Field Values
-
C_UOM_ID
public static final String C_UOM_ID
- See Also:
- Constant Field Values
-
DATE
public static final String DATE
- See Also:
- Constant Field Values
-
DB_TYPE
public static final String DB_TYPE
- See Also:
- Constant Field Values
-
GL_CATEGORY_ID
public static final String GL_CATEGORY_ID
- See Also:
- Constant Field Values
-
HAS_ALIAS
public static final String HAS_ALIAS
- See Also:
- Constant Field Values
-
LANGUAGE
public static final String LANGUAGE
Context Language identifier- See Also:
- Constant Field Values
-
LANGUAGE_NAME
public static final String LANGUAGE_NAME
- See Also:
- Constant Field Values
-
LOCAL_HTTP_ADDRESS
public static final String LOCAL_HTTP_ADDRESS
- See Also:
- Constant Field Values
-
LOCALE
public static final String LOCALE
- See Also:
- Constant Field Values
-
M_PRICELIST_ID
public static final String M_PRICELIST_ID
- See Also:
- Constant Field Values
-
M_PRODUCT_CATEGORY_ID
public static final String M_PRODUCT_CATEGORY_ID
- See Also:
- Constant Field Values
-
M_WAREHOUSE_ID
public static final String M_WAREHOUSE_ID
- See Also:
- Constant Field Values
-
POS_ID
public static final String POS_ID
Context for POS ID- See Also:
- Constant Field Values
-
R_STATUSCATEGORY_ID
public static final String R_STATUSCATEGORY_ID
- See Also:
- Constant Field Values
-
R_STATUS_ID
public static final String R_STATUS_ID
- See Also:
- Constant Field Values
-
RUNNING_UNIT_TESTING_TEST_CASE
public static final String RUNNING_UNIT_TESTING_TEST_CASE
- See Also:
- Constant Field Values
-
SALESREP_ID
public static final String SALESREP_ID
- See Also:
- Constant Field Values
-
SHOW_ACCOUNTING
public static final String SHOW_ACCOUNTING
- See Also:
- Constant Field Values
-
SHOW_ADVANCED
public static final String SHOW_ADVANCED
- See Also:
- Constant Field Values
-
SHOW_TRANSLATION
public static final String SHOW_TRANSLATION
- See Also:
- Constant Field Values
-
STANDARD_PRECISION
public static final String STANDARD_PRECISION
- See Also:
- Constant Field Values
-
STANDARD_REPORT_FOOTER_TRADEMARK_TEXT
public static final String STANDARD_REPORT_FOOTER_TRADEMARK_TEXT
- See Also:
- Constant Field Values
-
SYSTEM_NAME
public static final String SYSTEM_NAME
- See Also:
- Constant Field Values
-
UI_CLIENT
public static final String UI_CLIENT
- See Also:
- Constant Field Values
-
USER_LEVEL
public static final String USER_LEVEL
- See Also:
- Constant Field Values
-
adWindowDummyID
public static int adWindowDummyID
-
WINDOW_MAIN
public static final int WINDOW_MAIN
WindowNo for Main- See Also:
- Constant Field Values
-
TAB_INFO
public static final int TAB_INFO
Tab for Info- See Also:
- Constant Field Values
-
ZERO
public static final BigDecimal ZERO
Big Decimal 0
-
ONE
public static final BigDecimal ONE
Big Decimal 1
-
ONEHUNDRED
public static final BigDecimal ONEHUNDRED
Big Decimal 100
-
NL
public static final String NL
New Line
-
PREFIX_PREDEFINED_VARIABLE
public static final String PREFIX_PREDEFINED_VARIABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setContextProvider
public static void setContextProvider(ContextProvider provider)
Deprecated.- Parameters:
provider
-
-
addEventListener
public static void addEventListener(IEnvEventListener listener)
- Parameters:
listener
-
-
removeEventListener
public static boolean removeEventListener(IEnvEventListener listener)
- Parameters:
listener
-- Returns:
- boolean
-
exitEnv
public static void exitEnv(int status)
Exit 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 Cache- Parameters:
finalCall
- everything otherwise login data remains
-
getCtx
public static final Properties getCtx()
Get Context- Returns:
- Properties
-
getContextProvider
public static ContextProvider getContextProvider()
-
setCtx
public static void setCtx(Properties ctx)
Replace the contents of the current session/process context. Don't use this to setup a new session/process context, use ServerContext.setCurrentInstance instead.- Parameters:
ctx
- context
-
setContext
public static void setContext(Properties ctx, String context, String value)
Set Global Context to Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, String context, Timestamp value)
Set Global Context to Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, String context, int value)
Set Global Context to (int) Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, String context, boolean value)
Set Global Context to Y/N Value- Parameters:
ctx
- contextcontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, int WindowNo, String context, String value)
Set Context for Window to Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, int WindowNo, String context, Timestamp value)
Set Context for Window to Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, int WindowNo, String context, int value)
Set Context for Window to int Value- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyvalue
- context value
-
setContext
public static void setContext(Properties ctx, int WindowNo, int TabNo, String context, int value)
-
setContext
public static void setContext(Properties ctx, int WindowNo, String context, boolean value)
Set Context for Window 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 Window 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, String value)
Set Context for Window and Tab to Value- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context keyvalue
- context value
-
setAutoCommit
@Deprecated public static void setAutoCommit(Properties ctx, boolean autoCommit)
Deprecated.Set Auto Commit- Parameters:
ctx
- contextautoCommit
- auto commit (save)
-
setAutoCommit
public static void setAutoCommit(Properties ctx, int WindowNo, boolean autoCommit)
Set Auto Commit for Window- Parameters:
ctx
- contextWindowNo
- window noautoCommit
- auto commit (save)
-
setAutoNew
@Deprecated public static void setAutoNew(Properties ctx, boolean autoNew)
Deprecated.Set Auto New Record- Parameters:
ctx
- contextautoNew
- auto new record
-
setAutoNew
public static void setAutoNew(Properties ctx, int WindowNo, boolean autoNew)
Set Auto New Record for Window- Parameters:
ctx
- contextWindowNo
- window noautoNew
- auto new record
-
setSOTrx
public static void setSOTrx(Properties ctx, boolean isSOTrx)
Set SO Trx- Parameters:
ctx
- contextisSOTrx
- SO Context
-
getContext
public static String getContext(Properties ctx, String context)
Get global Value of Context- Parameters:
ctx
- contextcontext
- context key- Returns:
- value or ""
-
getContext
public static String getContext(Properties ctx, int WindowNo, String context, boolean onlyWindow)
Get Value of Context for Window. 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
public static String getContext(Properties ctx, int WindowNo, String context)
Get Value of Context for Window. if not found global context if available- Parameters:
ctx
- contextWindowNo
- windowcontext
- context key- Returns:
- value or ""
-
getContext
public static String getContext(Properties ctx, int WindowNo, int TabNo, String context)
Get Value of Context for Window and Tab, if not found global context if available. 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 Window and Tab, if not found global context if available. 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 Window and Tab, if not found global context if available. 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
public static int getContextAsInt(Properties ctx, String context)
Get Context and convert it to an integer (0 if error)- Parameters:
ctx
- contextcontext
- context key- Returns:
- value
-
getContextAsInt
public static int getContextAsInt(Properties ctx, int WindowNo, String context)
Get Context and convert it to an integer (0 if error)- Parameters:
ctx
- contextWindowNo
- window nocontext
- context key- Returns:
- value or 0
-
getContextAsInt
public static int getContextAsInt(Properties ctx, int WindowNo, String context, boolean onlyWindow)
Get Context and convert it to an integer (0 if error)- Parameters:
ctx
- contextWindowNo
- window nocontext
- context keyonlyWindow
- if true, no defaults are used unless explicitly asked for- Returns:
- value or 0
-
getContextAsInt
public static int getContextAsInt(Properties ctx, int WindowNo, int TabNo, String context)
Get Context and convert it to an integer (0 if error)- Parameters:
ctx
- contextWindowNo
- window noTabNo
- tab nocontext
- context key- Returns:
- value or 0
-
isAutoCommit
public static boolean isAutoCommit(Properties ctx)
Is AutoCommit- Parameters:
ctx
- context- Returns:
- true if auto commit
-
isAutoCommit
public static boolean isAutoCommit(Properties ctx, int WindowNo)
Is Window AutoCommit (if not set use default)- Parameters:
ctx
- contextWindowNo
- window no- Returns:
- true if auto commit
-
isAutoNew
public static boolean isAutoNew(Properties ctx)
Is Auto New Record- Parameters:
ctx
- context- Returns:
- true if auto new
-
isAutoNew
public static boolean isAutoNew(Properties ctx, int WindowNo)
Is Window Auto New Record (if not set use default)- Parameters:
ctx
- contextWindowNo
- window no- Returns:
- true if auto new record
-
isSOTrx
public static boolean isSOTrx(Properties ctx)
Is Sales Order Trx- Parameters:
ctx
- context- Returns:
- true if SO (default)
-
isSOTrx
public static boolean isSOTrx(Properties ctx, int WindowNo)
Is Sales Order Trx- Parameters:
ctx
- contextWindowNo
- window no- Returns:
- true if SO (default)
-
getContextAsDate
public static Timestamp getContextAsDate(Properties ctx, String context)
Get Context and convert it to a Timestamp if error return today's date- Parameters:
ctx
- contextcontext
- context key- Returns:
- Timestamp
-
getContextAsDate
public static Timestamp getContextAsDate(Properties ctx, int WindowNo, String context)
Get Context and convert it to a Timestamp if error return today's date- Parameters:
ctx
- contextWindowNo
- window nocontext
- context key- Returns:
- Timestamp
-
getAD_Client_ID
public static int getAD_Client_ID(Properties ctx)
Get Login AD_Client_ID- Parameters:
ctx
- context- Returns:
- login AD_Client_ID
-
getAD_Org_ID
public static int getAD_Org_ID(Properties ctx)
Get Login AD_Org_ID- Parameters:
ctx
- context- Returns:
- login AD_Org_ID
-
getAD_User_ID
public static int getAD_User_ID(Properties ctx)
Get Login AD_User_ID- Parameters:
ctx
- context- Returns:
- login AD_User_ID
-
getAD_Role_ID
public static int getAD_Role_ID(Properties ctx)
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 env- Parameters:
ctx
-AD_Window_ID
-AD_InfoWindow
-AD_Process_ID_Of_Panel
-context
-- Returns:
-
getPreference
public static String getPreference(Properties ctx, int AD_Window_ID, int AD_InfoWindow, String context)
get preference of info window from env- Parameters:
ctx
-AD_Window_ID
-AD_InfoWindow
-context
-- Returns:
-
isBaseLanguage
public static boolean isBaseLanguage(Properties ctx, String tableName)
Check Base Language- Parameters:
ctx
- contexttableName
- table to be translated- Returns:
- true if base language and table not translated
-
isBaseLanguage
public static boolean isBaseLanguage(String AD_Language, String tableName)
Check Base Language- Parameters:
AD_Language
- languagetableName
- table to be translated- Returns:
- true if base language and table not translated
-
isBaseLanguage
public static boolean isBaseLanguage(Language language, String tableName)
Check Base Language- Parameters:
language
- languagetableName
- table to be translated- Returns:
- true if base language and table not translated
-
isBaseTranslation
public static boolean isBaseTranslation(String tableName)
Table is in Base Translation (AD)- Parameters:
tableName
- table- Returns:
- true if base trl
-
isMultiLingualDocument
public static boolean isMultiLingualDocument(Properties ctx)
Do we have Multi-Lingual Documents. Set in DB.loadOrgs- Parameters:
ctx
- context- Returns:
- true if multi lingual documents
-
getAD_Language
public static String getAD_Language(Properties ctx)
Get System AD_Language- Parameters:
ctx
- context- Returns:
- AD_Language eg. en_US
-
getLanguage
public static Language getLanguage(Properties ctx)
Get System Language- Parameters:
ctx
- context- Returns:
- Language
-
getLoginLanguage
public static Language getLoginLanguage(Properties ctx)
Get Login Language- Parameters:
ctx
- context- Returns:
- Language
-
getLocaleLanguage
public static Language getLocaleLanguage(Properties ctx)
- Parameters:
ctx
-- Returns:
- Language
-
getLocale
public static Locale getLocale(Properties ctx)
- Parameters:
ctx
-- Returns:
- Locale
-
verifyLanguage
public static void verifyLanguage(Properties ctx, Language language)
Verify Language. Check that language is supported by the system- Parameters:
ctx
- might be updated with new AD_Languagelanguage
- language
-
getEntireContext
public static String[] getEntireContext(Properties ctx)
Get Context as String array with format: key == value- Parameters:
ctx
- context- Returns:
- context string
-
getHeader
public static String getHeader(Properties ctx, int WindowNo)
Get Header info (connection, org, user)- Parameters:
ctx
- contextWindowNo
- window- Returns:
- Header String
-
clearWinContext
public static void clearWinContext(Properties ctx, int WindowNo)
Clean up context for Window (i.e. delete it)- Parameters:
ctx
- contextWindowNo
- window
-
clearTabContext
public static void clearTabContext(Properties ctx, int WindowNo, int TabNo)
Clean up context for Window Tab (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
public static void clearContext(Properties ctx)
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 Context replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of Windowvalue
- Message to be parsedonlyWindow
- if true, no defaults are usedignoreUnparsable
- if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable- Returns:
- parsed context
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab, boolean ignoreUnparsable)
Parse Context replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of WindowtabNo
- Number of Tabvalue
- Message to be parsedonlyTab
- if true, only value from tabNo are usedignoreUnparsable
- if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable- Returns:
- parsed context
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, String value, boolean onlyWindow)
Parse Context replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of Windowvalue
- Message to be parsedonlyWindow
- if true, no defaults are used- Returns:
- parsed String or "" if not successful
-
parseContext
public static String parseContext(Properties ctx, int WindowNo, int tabNo, String value, boolean onlyTab)
Parse Context replaces global or Window context @tag@ with actual value.- Parameters:
ctx
- contextWindowNo
- Number of WindowtabNo
- Number of Tabvalue
- Message to be parsedonlyTab
- if true, no value from 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
-- Returns:
- String
-
clearWinContext
public static void clearWinContext(int WindowNo)
Clean up context for Window (i.e. delete it)- Parameters:
WindowNo
- window
-
clearContext
public static void clearContext()
Clean up all context (i.e. delete it)
-
getImageIcon
public static ImageIcon getImageIcon(String fileNameInImageDir)
Get ImageIcon.- Parameters:
fileNameInImageDir
- full file name in imgaes folder (e.g. Bean16.gif)- Returns:
- image
-
getImageIcon2
public static ImageIcon getImageIcon2(String fileName)
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 imgaes folder without the extension(e.g. Bean16)- Returns:
- image
-
startBrowser
public static void startBrowser(String url)
Start 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
public static Properties getRemoteCallCtx(Properties ctx)
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
public static GridWindowVO getMWindowVO(int WindowNo, int AD_Window_ID, int AD_Menu_ID)
Get Window Model- Parameters:
WindowNo
- Window NoAD_Window_ID
- windowAD_Menu_ID
- menu- Returns:
- Model Window Value Obkect
-
getProcessUI
public static IProcessUI getProcessUI(Properties ctx)
-
getProcessInfo
public static ProcessInfo getProcessInfo(Properties ctx)
-
getStandardReportFooterTrademarkText
public static String getStandardReportFooterTrademarkText()
- Returns:
- trademark text for standard report footer
-
getZoomWindowID
public static int getZoomWindowID(MQuery query)
-
getZoomWindowID
public static int getZoomWindowID(int AD_Table_ID, int Record_ID)
-
getZoomWindowID
public static int getZoomWindowID(int AD_Table_ID, int Record_ID, int windowNo)
-
setPredefinedVariables
public static void setPredefinedVariables(Properties ctx, int windowNo, String predefinedVariables)
Add in context predefined variables with prefix +, coming from menu or window 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
-predefinedVariables
-
-
-