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
This commit is contained in:
kthiemann 2007-02-28 16:08:20 +00:00
parent a0ff348a76
commit f478a59fb5
1 changed files with 11 additions and 2 deletions

View File

@ -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<MAttachmentEntry> 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