Improvment of the error message for an already attached file
git-svn-id: https://svn.libreccm.org/ccm/trunk@3116 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
055e31c990
commit
fa275828cd
|
|
@ -71,7 +71,7 @@ public class FileAttachmentGlobalize {
|
|||
"cms.contentassets.file_attachment.upload_new_file_label",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ cms.contentassets.file_attachment.upload_new_file_label=Upload a new file
|
|||
cms.contentassets.file_attachment.tableheader_file=File
|
||||
cms.contentassets.file_attachment.tableheader_description=Description
|
||||
cms.contentassets.file_attachment.list_label=File attachments
|
||||
cms.contentassets.file_attachment.already_attached=A file with the same name as the selected file has already been attached.
|
||||
cms.contentassets.file_attachment.already_attached=A file with the name {0} as already been attached.
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@ cms.contentassets.file_attachment.upload_new_file_label=Neue Datei hochladen
|
|||
cms.contentassets.file_attachment.tableheader_file=Datei
|
||||
cms.contentassets.file_attachment.tableheader_description=Beschreibung
|
||||
cms.contentassets.file_attachment.list_label=Dateianh\u00e4nge
|
||||
cms.contentassets.file_attachment.already_attached=Eine Datei mit dem Namen der ausgew\u00e4hlten Datei wurde bereits hinzugef\u00fcgt.
|
||||
cms.contentassets.file_attachment.already_attached=Eine Datei mit dem Namen {0} wurde bereits hinzugef\u00fcgt.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.arsdigita.cms.ContentItem;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.FileAttachment;
|
||||
import com.arsdigita.cms.contentassets.FileAttachmentGlobalize;
|
||||
import com.arsdigita.cms.contentassets.util.FileAttachmentGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.FileUploadSection;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
|
|
@ -159,7 +160,7 @@ public class FileAttachmentUpload extends Form
|
|||
final DataObject attachment = attachments.getDataObject();
|
||||
if (attachment.get(FileAttachment.NAME).equals(fileName)) {
|
||||
attachments.close();
|
||||
throw new FormProcessException(GlobalizationUtil.globalize(
|
||||
throw new FormProcessException(FileAttachmentGlobalizationUtil.globalize(
|
||||
"cms.contentassets.file_attachment.already_attached", new String[]{fileName}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.arsdigita.cms.contentassets.util;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter <jens@jp-digital.de>
|
||||
*/
|
||||
public class FileAttachmentGlobalizationUtil {
|
||||
|
||||
public static final String BUNDLE_NAME = "com.arsdigita.cms.contentassets.FileAttachmentResources";
|
||||
|
||||
public static GlobalizedMessage globalize(final String key) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
public static GlobalizedMessage globalize(final String key, final Object[] args) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME, args);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue