Anpassung und Vervollständigung ResourceBundles sowie Sprachumschaltung abgeschlossen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2191 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
259f4dbc59
commit
1fff55e55e
|
|
@ -48,6 +48,7 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
|||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
@ -74,7 +75,8 @@ public class ImagePropertiesStep extends SimpleEditStep {
|
|||
private final String UPLOAD = "upload";
|
||||
private ImageUploadComponent uploadSheet;
|
||||
|
||||
public ImagePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public ImagePropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
|
|
@ -122,10 +124,12 @@ public class ImagePropertiesStep extends SimpleEditStep {
|
|||
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.name"), Image.NAME);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.title"), Image.TITLE);
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), Image.TITLE);
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
|
||||
Image.NAME);
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -137,19 +141,28 @@ public class ImagePropertiesStep extends SimpleEditStep {
|
|||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
} else {
|
||||
return (String) ImageGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
return (String) GlobalizationUtil
|
||||
.globalize("cms.ui.unknown")
|
||||
.localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.width"), Image.WIDTH);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.height"), Image.HEIGHT);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.caption"), Image.CAPTION);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.description"), Image.DESCRIPTION);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.artist"), Image.ARTIST);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.publishDate"), Image.PUBLISHDATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
sheet.add(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.width"), Image.WIDTH);
|
||||
sheet.add(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.height"), Image.HEIGHT);
|
||||
sheet.add(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.caption"), Image.CAPTION);
|
||||
sheet.add(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.description"), Image.DESCRIPTION);
|
||||
sheet.add(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.artist"), Image.ARTIST);
|
||||
sheet.add(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.publishDate"),
|
||||
Image.PUBLISHDATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
@Override
|
||||
public String format(DomainObject item, String attribute, PageState state) {
|
||||
|
|
@ -173,19 +186,39 @@ public class ImagePropertiesStep extends SimpleEditStep {
|
|||
return DateFormat.getDateInstance(DateFormat.LONG).format(image.getPublishDate());
|
||||
}
|
||||
} else {
|
||||
return (String) ImageGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
return (String) GlobalizationUtil
|
||||
.globalize("cms.ui.unknown")
|
||||
.localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.source"), Image.SOURCE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.media"), Image.MEDIA);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.copyright"), Image.COPYRIGHT);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.site"), Image.SITE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.license"), Image.LICENSE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.material"), Image.MATERIAL);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.technique"), Image.TECHNIQUE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.origin"), Image.ORIGIN);
|
||||
sheet.add(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.origSize"), Image.ORIGSIZE);
|
||||
});
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.source"),
|
||||
Image.SOURCE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.media"),
|
||||
Image.MEDIA);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.copyright"),
|
||||
Image.COPYRIGHT);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.site"),
|
||||
Image.SITE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.license"),
|
||||
Image.LICENSE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.material"),
|
||||
Image.MATERIAL);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.technique"),
|
||||
Image.TECHNIQUE);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.origin"),
|
||||
Image.ORIGIN);
|
||||
sheet.add(ImageGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.image.origSize"),
|
||||
Image.ORIGSIZE);
|
||||
|
||||
container.add(sheet);
|
||||
|
||||
|
|
@ -218,7 +251,9 @@ public class ImagePropertiesStep extends SimpleEditStep {
|
|||
}
|
||||
|
||||
// save only if save button was pressed
|
||||
if (image != null && uploadSheet.getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
if (image != null
|
||||
&& uploadSheet.getSaveCancelSection()
|
||||
.getSaveButton().isSelected(fse.getPageState())) {
|
||||
|
||||
image.setImage(imageAsset);
|
||||
}
|
||||
|
|
@ -255,8 +290,11 @@ public class ImagePropertiesStep extends SimpleEditStep {
|
|||
setEncType("multipart/form-data");
|
||||
|
||||
// Ignoring deprecated constructor.
|
||||
m_imageFile = new FileUploadSection("Image Type", "image", ImageAsset.MIME_JPEG);
|
||||
m_imageFile.getFileUploadWidget().addValidationListener(new NotNullValidationListener());
|
||||
m_imageFile = new FileUploadSection("Image Type",
|
||||
"image",
|
||||
ImageAsset.MIME_JPEG);
|
||||
m_imageFile.getFileUploadWidget().addValidationListener(
|
||||
new NotNullValidationListener());
|
||||
|
||||
add(m_imageFile, ColumnPanel.FULL_WIDTH);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
import com.arsdigita.cms.contenttypes.Image;
|
||||
import com.arsdigita.cms.contenttypes.util.ImageGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
|
|
@ -86,13 +87,18 @@ public class ImagePropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.caption")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.caption")));
|
||||
ParameterModel captionParam = new StringParameter(Image.CAPTION);
|
||||
captionParam.addParameterListener(new StringInRangeValidationListener(0, 400));
|
||||
TextField caption = new TextField(captionParam);
|
||||
add(caption);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.description")));
|
||||
/* Image doesn't use the description property part of the basic
|
||||
properties and persisted in cms-pages, but it's part of the type
|
||||
specific basic properties. */
|
||||
add(new Label(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.description")));
|
||||
ParameterModel descriptionParam = new StringParameter(Image.DESCRIPTION);
|
||||
descriptionParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextArea description = new TextArea(descriptionParam);
|
||||
|
|
@ -100,7 +106,8 @@ public class ImagePropertyForm
|
|||
description.setCols(60);
|
||||
add(description);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.artist")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.artist")));
|
||||
ParameterModel artistParam = new StringParameter(Image.ARTIST);
|
||||
artistParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||
TextField artist = new TextField(artistParam);
|
||||
|
|
@ -114,7 +121,8 @@ public class ImagePropertyForm
|
|||
Hidden skipMonth = new Hidden(skipMonthParam);
|
||||
add(skipMonth);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.publishDate")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.publishDate")));
|
||||
IncompleteDateParameter publishDateParam = new IncompleteDateParameter(Image.PUBLISHDATE);
|
||||
publishDateParam.allowSkipDay(true);
|
||||
publishDateParam.allowSkipMonth(true);
|
||||
|
|
@ -123,55 +131,64 @@ public class ImagePropertyForm
|
|||
GregorianCalendar.getInstance().get(Calendar.YEAR) + Image.getConfig().getEndYearDelta());
|
||||
add(publishDate);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.source")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.source")));
|
||||
ParameterModel sourceParam = new StringParameter(Image.SOURCE);
|
||||
sourceParam.addParameterListener(new StringInRangeValidationListener(0, 600));
|
||||
TextField source = new TextField(sourceParam);
|
||||
add(source);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.media")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.media")));
|
||||
ParameterModel mediaParam = new StringParameter(Image.MEDIA);
|
||||
mediaParam.addParameterListener(new StringInRangeValidationListener(0, 300));
|
||||
TextField media = new TextField(mediaParam);
|
||||
add(media);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.copyright")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.copyright")));
|
||||
ParameterModel copyrightParam = new StringParameter(Image.COPYRIGHT);
|
||||
copyrightParam.addParameterListener(new StringInRangeValidationListener(0, 400));
|
||||
TextField copyright = new TextField(copyrightParam);
|
||||
add(copyright);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.site")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.site")));
|
||||
ParameterModel siteParam = new StringParameter(Image.SITE);
|
||||
siteParam.addParameterListener(new StringInRangeValidationListener(0, 500));
|
||||
TextField site = new TextField(siteParam);
|
||||
add(site);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.license")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.license")));
|
||||
ParameterModel licenseParam = new StringParameter(Image.LICENSE);
|
||||
licenseParam.addParameterListener(new StringInRangeValidationListener(0, 300));
|
||||
TextField license = new TextField(licenseParam);
|
||||
add(license);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.material")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.material")));
|
||||
ParameterModel materialParam = new StringParameter(Image.MATERIAL);
|
||||
materialParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||
TextField material = new TextField(materialParam);
|
||||
add(material);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.technique")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.technique")));
|
||||
ParameterModel techniqueParam = new StringParameter(Image.TECHNIQUE);
|
||||
techniqueParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||
TextField technique = new TextField(techniqueParam);
|
||||
add(technique);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.origin")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.origin")));
|
||||
ParameterModel originParam = new StringParameter(Image.ORIGIN);
|
||||
originParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||
TextField origin = new TextField(originParam);
|
||||
add(origin);
|
||||
|
||||
add(new Label(ImageGlobalizationUtil.globalize("cms.contenttypes.ui.image.origSize")));
|
||||
add(new Label(ImageGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.image.origSize")));
|
||||
ParameterModel origSizeParam = new StringParameter(Image.ORIGSIZE);
|
||||
origSizeParam.addParameterListener(new StringInRangeValidationListener(0, 100));
|
||||
TextField origSize = new TextField(origSizeParam);
|
||||
|
|
@ -204,6 +221,11 @@ public class ImagePropertyForm
|
|||
data.put(Image.ORIGSIZE, image.getOriginalSize());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
@Override
|
||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||
super.validate(e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue