Package org.compiere.util
Class Ini
java.lang.Object
org.compiere.util.Ini
- All Implemented Interfaces:
Serializable
Load and Save Settings from property file (idempiere.properties).
Initiated in
Initiated in
Adempiere.startup(boolean)- Version:
- $Id$
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- FR [ 1658127 ] Select charset encoding on import
- FR [ 2406123 ] Ini.saveProperties fails if target directory does not exist
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final booleanstatic final booleanstatic final StringSystem environment prefixstatic final StringSystem Property Value of IDEMPIERE_HOMEstatic final StringProperty file namestatic final StringAuto Commitstatic final StringAuto Loginstatic final StringAuto New Recordstatic final StringDictionary Maintenancestatic final StringCache Windowsstatic final StringCharsetstatic final StringClient Namestatic final StringConnection Detailsstatic final StringData Sourcestatic final StringIni File Namestatic final StringLanguagestatic final StringLoad tab fields meta data using background threadstatic final StringLog Migration Scriptstatic final StringOpen new windows as maximizedstatic final StringOrg Namestatic final StringPrinter Namestatic final StringPrint Previewstatic final StringApps Passwordstatic final StringRolestatic final StringShow Acct Tabsstatic final StringShow Translation Tabsstatic final StringSingle instance per window idstatic final StringStore Passwordstatic final StringTemp Directorystatic final StringCurrent Datestatic final StringTrace to Filestatic final StringTrace Levelstatic final StringLook and Feelstatic final StringUI Themestatic final StringApps User IDstatic final StringValidate connection on startupstatic final StringWarehouse Name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDelete Property filestatic StringFind iDempiere Homestatic StringGet iDempiere Home from Environmentstatic StringtoStringstatic Charset[]Get Available Encoding Charsetsstatic CharsetGet current charsetstatic intDeprecated.static StringgetFileName(boolean tryUserHome) Return File Name of INI filestatic PropertiesGet Propertiesstatic StringgetProperty(String key) Get Propertystatic StringGet property file namestatic StringGet value of a secret variablestatic DimensiongetWindowDimension(int AD_Window_ID) Deprecated.static PointgetWindowLocation(int AD_Window_ID) Deprecated.static booleanDeprecated.window is always cache for better performancestatic booleanisClient()Are we in Client Mode ?static booleanisLoaded()Are the properties loaded?static booleanisPropertyBool(String key) Get Property as Booleanstatic booleanIs show license dialog for new setupstatic voidloadProperties(boolean reload) Load INI parameters from diskstatic booleanloadProperties(String filename) Load INI parameters from filename.
Logger is on default level (INFO)static StringrunCommand(String[] command) Run shell commandstatic voidsaveProperties(boolean tryUserHome) Save INI parameters to diskstatic voidsetAdempiereHome(String idempiereHome) Set iDempiere Homestatic voidsetClient(boolean client) Set Client Modestatic voidsetDividerLocation(int dividerLocation) Deprecated.static voidsetProperty(String key, boolean value) Set Propertystatic voidsetProperty(String key, int value) Set Propertystatic voidsetProperty(String key, String value) Set Propertystatic voidsetShowLicenseDialog(boolean b) Set show license dialog for new setupstatic voidSet value of secret variablestatic voidsetWindowDimension(int AD_Window_ID, Dimension windowDimension) Deprecated.static voidsetWindowLocation(int AD_Window_ID, Point windowLocation) Deprecated.
-
Field Details
-
IDEMPIERE_PROPERTY_FILE
Property file name- See Also:
-
P_UID
Apps User ID- See Also:
-
P_PWD
Apps Password- See Also:
-
P_STORE_PWD
Store Password- See Also:
-
P_TRACELEVEL
Trace Level- See Also:
-
P_TRACEFILE
Trace to File- See Also:
-
P_LANGUAGE
Language- See Also:
-
P_INI
Ini File Name- See Also:
-
P_CONNECTION
Connection Details- See Also:
-
P_CONTEXT
Data Source- See Also:
-
P_UI_LOOK
Look and Feel- See Also:
-
P_UI_THEME
UI Theme- See Also:
-
P_A_COMMIT
Auto Commit- See Also:
-
P_A_LOGIN
Auto Login- See Also:
-
P_A_NEW
Auto New Record- See Also:
-
P_ADEMPIERESYS
Dictionary Maintenance- See Also:
-
P_LOGMIGRATIONSCRIPT
Log Migration Script- See Also:
-
P_SHOW_ACCT
Show Acct Tabs- See Also:
-
P_SHOW_TRL
Show Translation Tabs- See Also:
-
P_CACHE_WINDOW
Cache Windows- See Also:
-
P_TEMP_DIR
Temp Directory- See Also:
-
P_ROLE
Role- See Also:
-
P_CLIENT
Client Name- See Also:
-
P_ORG
Org Name- See Also:
-
P_PRINTER
Printer Name- See Also:
-
P_WAREHOUSE
Warehouse Name- See Also:
-
P_TODAY
Current Date- See Also:
-
P_PRINTPREVIEW
Print Preview- See Also:
-
P_VALIDATE_CONNECTION_ON_STARTUP
Validate connection on startup- See Also:
-
P_SINGLE_INSTANCE_PER_WINDOW
Single instance per window id- See Also:
-
DEFAULT_SINGLE_INSTANCE_PER_WINDOW
public static final boolean DEFAULT_SINGLE_INSTANCE_PER_WINDOW- See Also:
-
P_OPEN_WINDOW_MAXIMIZED
Open new windows as maximized- See Also:
-
DEFAULT_OPEN_WINDOW_MAXIMIZED
public static final boolean DEFAULT_OPEN_WINDOW_MAXIMIZED- See Also:
-
P_CHARSET
Charset- See Also:
-
P_LOAD_TAB_META_DATA_BG
Load tab fields meta data using background thread- See Also:
-
DEFAULT_LOAD_TAB_META_DATA_BG
- See Also:
-
ENV_PREFIX
System environment prefix- See Also:
-
IDEMPIERE_HOME
System Property Value of IDEMPIERE_HOME- See Also:
-
-
Constructor Details
-
Ini
public Ini()
-
-
Method Details
-
saveProperties
public static void saveProperties(boolean tryUserHome) Save INI parameters to disk- Parameters:
tryUserHome- true to try user home first
-
loadProperties
public static void loadProperties(boolean reload) Load INI parameters from disk- Parameters:
reload- reload
-
loadProperties
Load INI parameters from filename.
Logger is on default level (INFO)- Parameters:
filename- to load- Returns:
- true if first time
-
deletePropertyFile
public static void deletePropertyFile()Delete Property file -
getFileName
Return File Name of INI fileExamples: C:\WinNT\Profiles\jjanke\idempiere.properties D:\idempiere\idempiere.properties idempiere.propertiesCan be overwritten by -DPropertyFile=myFile allowing multiple configurations / property files.- Parameters:
tryUserHome- true to try user home first, ignore for server- Returns:
- file name
-
setProperty
Set Property- Parameters:
key- Keyvalue- Value
-
setProperty
Set Property- Parameters:
key- Keyvalue- Value
-
setProperty
Set Property- Parameters:
key- Keyvalue- Value
-
getProperty
Get Property- Parameters:
key- Key- Returns:
- Value
-
isPropertyBool
Get Property as Boolean- Parameters:
key- Key- Returns:
- Value
-
isCacheWindow
Deprecated.window is always cache for better performanceCache Windows- Returns:
- true if windows are cached
-
getProperties
Get Properties- Returns:
- Ini properties
-
getAsString
toString- Returns:
- String representation
-
isClient
public static boolean isClient()Are we in Client Mode ?- Returns:
- true if client
-
setClient
public static void setClient(boolean client) Set Client Mode- Parameters:
client- client
-
setShowLicenseDialog
public static void setShowLicenseDialog(boolean b) Set show license dialog for new setup- Parameters:
b-
-
isShowLicenseDialog
public static boolean isShowLicenseDialog()Is show license dialog for new setup- Returns:
- boolean
-
isLoaded
public static boolean isLoaded()Are the properties loaded?- Returns:
- true if properties loaded.
-
getAdempiereHome
Get iDempiere Home from Environment- Returns:
- idempiereHome or null
-
setAdempiereHome
Set iDempiere Home- Parameters:
idempiereHome- IDEMPIERE_HOME
-
findAdempiereHome
Find iDempiere Home- Returns:
- idempiere home or null
-
getWindowDimension
Deprecated.Get Window Dimension- Parameters:
AD_Window_ID- window no- Returns:
- dimension or null
-
setWindowDimension
Deprecated.Set Window Dimension- Parameters:
AD_Window_ID- windowwindowDimension- dimension - null to remove
-
getWindowLocation
Deprecated.Get Window Location- Parameters:
AD_Window_ID- window id- Returns:
- location or null
-
setWindowLocation
Deprecated.Set Window Location- Parameters:
AD_Window_ID- windowwindowLocation- location - null to remove
-
getDividerLocation
Deprecated.Get Divider Location- Returns:
- location
-
setDividerLocation
Deprecated.Set Divider Location- Parameters:
dividerLocation- location
-
getAvailableCharsets
Get Available Encoding Charsets- Returns:
- array of available encoding charsets
- Since:
- 3.1.4
-
getCharset
Get current charset- Returns:
- current charset
- Since:
- 3.1.4
-
getPropertyFileName
Get property file name- Returns:
- property file name
-
getVar
Get value of a secret variable- Parameters:
secretVar- secret variable name- Returns:
- value of secret variable
-
setVar
Set value of secret variable- Parameters:
secretVar-secretValue-
-
runCommand
Run shell command- Parameters:
command-- Returns:
- command output
-