IDEMPIERE-4697 : temporary filename "adempiere_" (#2000)
* IDEMPIERE-4697 : get temp filename based on config "TEMP_FILENAME" if exists * IDEMPIERE-4697 : temporary filename "adempiere_" * IDEMPIERE-4697 : set default value and change from adempiere to idempiere
This commit is contained in:
parent
d665c2b051
commit
1efe7a4ac5
|
@ -0,0 +1,9 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Sep 17, 2023, 12:25:48 PM WIB
|
||||
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200234,0,0,TO_TIMESTAMP('2023-09-17 12:25:47','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2023-09-17 12:25:47','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','UPLOAD_TEMP_FILENAME_PREFIX','idempiere_','Prefix temporary filename for uploaded media','D','C','ecc709a7-8c32-4637-861f-9606a9de9751')
|
||||
;
|
||||
|
||||
-- IDEMPIERE-4697
|
||||
SELECT register_migration_script('202309171225_IDEMPIERE-4697.sql') FROM dual;
|
|
@ -0,0 +1,6 @@
|
|||
-- Sep 17, 2023, 12:25:48 PM WIB
|
||||
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200234,0,0,TO_TIMESTAMP('2023-09-17 12:25:47','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2023-09-17 12:25:47','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','UPLOAD_TEMP_FILENAME_PREFIX','idempiere_','Prefix temporary filename for uploaded media','D','C','ecc709a7-8c32-4637-861f-9606a9de9751')
|
||||
;
|
||||
|
||||
-- IDEMPIERE-4697
|
||||
SELECT register_migration_script('202309171225_IDEMPIERE-4697.sql') FROM dual;
|
|
@ -182,6 +182,7 @@ public class MSysConfig extends X_AD_SysConfig
|
|||
public static final String TRX_AUTOSET_DISPLAY_NAME = "TRX_AUTOSET_DISPLAY_NAME";
|
||||
public static final String TWOPACK_COMMIT_DDL = "2PACK_COMMIT_DDL";
|
||||
public static final String TWOPACK_HANDLE_TRANSLATIONS = "2PACK_HANDLE_TRANSLATIONS";
|
||||
public static final String UPLOAD_TEMP_FILENAME_PREFIX = "UPLOAD_TEMP_FILENAME_PREFIX";
|
||||
public static final String USE_EMAIL_FOR_LOGIN = "USE_EMAIL_FOR_LOGIN";
|
||||
public static final String USE_ESC_FOR_TAB_CLOSING = "USE_ESC_FOR_TAB_CLOSING";
|
||||
public static final String USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES = "USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES";
|
||||
|
|
|
@ -26,8 +26,10 @@ import org.adempiere.webui.component.FilenameBox;
|
|||
import org.adempiere.webui.event.ValueChangeEvent;
|
||||
import org.adempiere.webui.theme.ThemeManager;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.zkoss.util.media.Media;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
@ -171,7 +173,7 @@ public class WFilenameEditor extends WEditor
|
|||
String fileName = null;
|
||||
try {
|
||||
|
||||
File tempFile = File.createTempFile("adempiere_", "_"+file.getName());
|
||||
File tempFile = File.createTempFile(MSysConfig.getValue(MSysConfig.UPLOAD_TEMP_FILENAME_PREFIX, "idempiere", Env.getAD_Client_ID(Env.getCtx())), "_"+file.getName());
|
||||
fileName = tempFile.getAbsolutePath();
|
||||
|
||||
fos = new FileOutputStream(tempFile);
|
||||
|
|
Loading…
Reference in New Issue