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.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
|
|
@ -49,7 +50,6 @@ import java.util.Date;
|
||||||
public abstract class BasicPageForm extends BasicItemForm {
|
public abstract class BasicPageForm extends BasicItemForm {
|
||||||
|
|
||||||
private FormSection m_widgetSection;
|
private FormSection m_widgetSection;
|
||||||
|
|
||||||
// public static final String DESCRIPTION = ContentPage.DESCRIPTION;
|
// public static final String DESCRIPTION = ContentPage.DESCRIPTION;
|
||||||
public static final String LAUNCH_DATE = ContentPage.LAUNCH_DATE;
|
public static final String LAUNCH_DATE = ContentPage.LAUNCH_DATE;
|
||||||
|
|
||||||
|
|
@ -78,7 +78,6 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
super(formName, columnPanel, itemModel);
|
super(formName, columnPanel, itemModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add various widgets to the form. Child classes should override
|
* Add various widgets to the form. Child classes should override
|
||||||
* this method to perform all their widget-adding needs
|
* this method to perform all their widget-adding needs
|
||||||
|
|
@ -95,11 +94,9 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
// add(description);
|
// add(description);
|
||||||
//
|
//
|
||||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||||
add(new Label(GlobalizationUtil.
|
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date")));
|
||||||
globalize("cms.ui.authoring.page_launch_date")));
|
|
||||||
ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE);
|
ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE);
|
||||||
com.arsdigita.bebop.form.Date launchDate
|
com.arsdigita.bebop.form.Date launchDate = new com.arsdigita.bebop.form.Date(launchDateParam);
|
||||||
= new com.arsdigita.bebop.form.Date(launchDateParam);
|
|
||||||
if (ContentSection.getConfig().getRequireLaunchDate()) {
|
if (ContentSection.getConfig().getRequireLaunchDate()) {
|
||||||
launchDate.addValidationListener(new LaunchDateValidationListener());
|
launchDate.addValidationListener(new LaunchDateValidationListener());
|
||||||
// if launch date is required, help user by suggesting today's date
|
// if launch date is required, help user by suggesting today's date
|
||||||
|
|
@ -144,6 +141,13 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
return item;
|
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
|
* Utility method to process the name/title widgets. Child classes
|
||||||
* may call this method from the process listener.
|
* may call this method from the process listener.
|
||||||
|
|
@ -195,8 +199,8 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
try {
|
try {
|
||||||
item = (ContentPage) m.createItem();
|
item = (ContentPage) m.createItem();
|
||||||
} catch (ServletException ex) {
|
} catch (ServletException ex) {
|
||||||
throw new
|
throw new FormProcessException((String) GlobalizationUtil.globalize(
|
||||||
FormProcessException((String)GlobalizationUtil.globalize("cms.ui.authoring.couldnt_create_contentpage").localize(), ex);
|
"cms.ui.authoring.couldnt_create_contentpage").localize(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the item will be remembered across requests
|
// Make sure the item will be remembered across requests
|
||||||
|
|
@ -221,6 +225,6 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue