Validierung auf doppelte URL beim Bearbeiten eingefügt (Ticket #1261).
git-svn-id: https://svn.libreccm.org/ccm/trunk@1682 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ec2f5b22ff
commit
f2a0bf9ba3
|
|
@ -32,6 +32,7 @@ import com.arsdigita.bebop.parameters.ParameterData;
|
|||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.Folder;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
|
@ -49,7 +50,6 @@ import java.util.Date;
|
|||
public abstract class BasicPageForm extends BasicItemForm {
|
||||
|
||||
private FormSection m_widgetSection;
|
||||
|
||||
// public static final String DESCRIPTION = ContentPage.DESCRIPTION;
|
||||
public static final String LAUNCH_DATE = ContentPage.LAUNCH_DATE;
|
||||
|
||||
|
|
@ -78,7 +78,6 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
super(formName, columnPanel, itemModel);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add various widgets to the form. Child classes should override
|
||||
* this method to perform all their widget-adding needs
|
||||
|
|
@ -95,11 +94,9 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
// add(description);
|
||||
//
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
add(new Label(GlobalizationUtil.
|
||||
globalize("cms.ui.authoring.page_launch_date")));
|
||||
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date")));
|
||||
ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE);
|
||||
com.arsdigita.bebop.form.Date launchDate
|
||||
= new com.arsdigita.bebop.form.Date(launchDateParam);
|
||||
com.arsdigita.bebop.form.Date launchDate = new com.arsdigita.bebop.form.Date(launchDateParam);
|
||||
if (ContentSection.getConfig().getRequireLaunchDate()) {
|
||||
launchDate.addValidationListener(new LaunchDateValidationListener());
|
||||
// if launch date is required, help user by suggesting today's date
|
||||
|
|
@ -144,6 +141,13 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final Folder folder = (Folder) getItemSelectionModel().getSelectedItem(fse.getPageState()).getParent();
|
||||
Assert.exists(folder);
|
||||
validateNameUniqueness(folder, fse);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to process the name/title widgets. Child classes
|
||||
* may call this method from the process listener.
|
||||
|
|
@ -195,8 +199,8 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
try {
|
||||
item = (ContentPage) m.createItem();
|
||||
} catch (ServletException ex) {
|
||||
throw new
|
||||
FormProcessException((String)GlobalizationUtil.globalize("cms.ui.authoring.couldnt_create_contentpage").localize(), ex);
|
||||
throw new FormProcessException((String) GlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.couldnt_create_contentpage").localize(), ex);
|
||||
}
|
||||
|
||||
// Make sure the item will be remembered across requests
|
||||
|
|
@ -221,6 +225,6 @@ public abstract class BasicPageForm extends BasicItemForm {
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue