From f478a59fb55d3405bffda0f6697a090bfe7edb95 Mon Sep 17 00:00:00 2001 From: kthiemann Date: Wed, 28 Feb 2007 16:08:20 +0000 Subject: [PATCH] Bug [ 1671016 ] Attachment name should be different for Att. in file system Name of attachment entry in AD_Attachment is now xml (because the attachment description is an xml file) for Attachments stored in the file system --- dbPort/src/org/compiere/model/MAttachment.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dbPort/src/org/compiere/model/MAttachment.java b/dbPort/src/org/compiere/model/MAttachment.java index 13919c76c4..79417d3f78 100644 --- a/dbPort/src/org/compiere/model/MAttachment.java +++ b/dbPort/src/org/compiere/model/MAttachment.java @@ -140,6 +140,8 @@ public class MAttachment extends X_AD_Attachment public static final String NONE = "."; /** Indicator for zip data */ public static final String ZIP = "zip"; + /** Indicator for xml data (store on file system) */ + public static final String XML = "xml"; /** List of Entry Data */ private ArrayList m_items = null; @@ -789,8 +791,15 @@ public class MAttachment extends X_AD_Attachment */ protected boolean beforeSave (boolean newRecord) { - if (getTitle() == null || !getTitle().equals(ZIP)) - setTitle (ZIP); + if(isStoreAttachmentsOnFileSystem){ + if (getTitle() == null || !getTitle().equals(XML)) { + setTitle (XML); + } + } else { + if (getTitle() == null || !getTitle().equals(ZIP)) { + setTitle (ZIP); + } + } return saveLOBData(); // save in BinaryData } // beforeSave