From c2072ab61e1b494ed35a20ceb199724cd9c58d33 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 8 Mar 2011 11:27:33 -0500 Subject: [PATCH] Implement system configurator parameter ZK_ROOT_FOLDER_BROWSER to indicate the root for zk folder browser --- .../adempiere/webui/component/FolderBrowser.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/FolderBrowser.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/FolderBrowser.java index 1d5d1e5d3f..4920b54c8f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/FolderBrowser.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/FolderBrowser.java @@ -17,7 +17,9 @@ import java.io.File; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.window.FDialog; +import org.compiere.model.MSysConfig; import org.compiere.util.Ini; +import org.compiere.util.Util; import org.compiere.util.ValueNamePair; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; @@ -35,9 +37,9 @@ import org.zkoss.zkex.zul.South; public class FolderBrowser extends Window implements EventListener { /** - * generated serial version id + * */ - private static final long serialVersionUID = -923063158885832812L; + private static final long serialVersionUID = 5477614056976038703L; private Textbox txtPath = new Textbox(); private Listbox listDir = new Listbox(); @@ -49,7 +51,7 @@ public class FolderBrowser extends Window implements EventListener public FolderBrowser() { - this(Ini.getAdempiereHome(), false); + this(null, false); } /** @@ -58,7 +60,7 @@ public class FolderBrowser extends Window implements EventListener */ public FolderBrowser(boolean browseForFolder) { - this(Ini.getAdempiereHome(), browseForFolder); + this(null, browseForFolder); } /** @@ -68,6 +70,9 @@ public class FolderBrowser extends Window implements EventListener */ public FolderBrowser(String rootPath, boolean browseForFolder) { + if (Util.isEmpty(rootPath)) { + rootPath = MSysConfig.getValue("ZK_ROOT_FOLDER_BROWSER", Ini.getAdempiereHome()); + } root = new File(rootPath); this.browseForFolder = browseForFolder;