- Neuer Versuch, Ticket #1261 zu lösen
- Verschiedene PropertyForms haben in ihrer validate(FormSectionEvent) Methode nicht super.validate(FormSectionEvent) aufgerufen. Dadurch wurde die validate(FormSectionEvent) Methode in BasicPageForm nicht ausgeführt. Möglicherweise ist dieses Problem noch bei weiteren CTs vorhanden. Vermutlich müssen von BasicPageForm abgeleiteteten Klassen darauf untersucht werden, ob sie super.validate(FormSectionEvent) aufrufen, s. Ticket #1272. git-svn-id: https://svn.libreccm.org/ccm/trunk@1687 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f4e6b8f5cb
commit
6b677b606c
|
|
@ -22,5 +22,5 @@ import com.arsdigita.web.Application;
|
||||||
// In contrast to other applications atoz_app is needed here and used in
|
// In contrast to other applications atoz_app is needed here and used in
|
||||||
// associations, e.g. AtoZProvider.
|
// associations, e.g. AtoZProvider.
|
||||||
object type AtoZ extends Application {
|
object type AtoZ extends Application {
|
||||||
reference key (atoz_app.application_id);
|
reference key (atoz_app.application_id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData d = e.getFormData();
|
super.validate(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/** Form initialisation hook. Fills widgets with data. */
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,8 @@ public class EventPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
|
super.validate(e);
|
||||||
|
|
||||||
FormData d = e.getFormData();
|
FormData d = e.getFormData();
|
||||||
java.util.Date startDate = d.getDate(START_DATE);
|
java.util.Date startDate = d.getDate(START_DATE);
|
||||||
java.util.Date endDate = d.getDate(END_DATE);
|
java.util.Date endDate = d.getDate(END_DATE);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ public class HTMLFormPropertyForm extends BasicPageForm implements FormProcessLi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData d = e.getFormData();
|
super.validate(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/** Form initialisation hook. Fills widgets with data. */
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ public class GenericArticlePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData d = e.getFormData();
|
super.validate(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/** Form initialisation hook. Fills widgets with data. */
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import com.arsdigita.bebop.parameters.DateParameter;
|
||||||
import com.arsdigita.bebop.parameters.ParameterData;
|
import com.arsdigita.bebop.parameters.ParameterData;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.cms.ContentBundle;
|
import com.arsdigita.cms.ContentBundle;
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
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.Folder;
|
||||||
|
|
@ -43,12 +44,12 @@ import javax.servlet.ServletException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A form for editing subclasses of ContentPage. This is just a convenience
|
* A form for editing subclasses of ContentPage. This is just a convenience class.
|
||||||
* class.
|
|
||||||
*
|
*
|
||||||
* @author Stanislav Freidin (stas@arsdigita.com)
|
* @author Stanislav Freidin (stas@arsdigita.com)
|
||||||
* @version $Revision: #22 $ $DateTime: 2004/08/17 23:15:09 $
|
* @version $Revision: #22 $ $DateTime: 2004/08/17 23:15:09 $
|
||||||
**/
|
*
|
||||||
|
*/
|
||||||
public abstract class BasicPageForm extends BasicItemForm {
|
public abstract class BasicPageForm extends BasicItemForm {
|
||||||
|
|
||||||
private FormSection m_widgetSection;
|
private FormSection m_widgetSection;
|
||||||
|
|
@ -59,8 +60,7 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
* Construct a new BasicPageForm
|
* Construct a new BasicPageForm
|
||||||
*
|
*
|
||||||
* @param formName the name of this form
|
* @param formName the name of this form
|
||||||
* @param itemModel The {@link ItemSelectionModel} which will
|
* @param itemModel The {@link ItemSelectionModel} which will be responsible for loading the current item
|
||||||
* be responsible for loading the current item
|
|
||||||
*/
|
*/
|
||||||
public BasicPageForm(String formName, ItemSelectionModel itemModel) {
|
public BasicPageForm(String formName, ItemSelectionModel itemModel) {
|
||||||
super(formName, itemModel);
|
super(formName, itemModel);
|
||||||
|
|
@ -71,8 +71,7 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
*
|
*
|
||||||
* @param formName the name of this form
|
* @param formName the name of this form
|
||||||
* @param columnPanel the columnpanel of the form
|
* @param columnPanel the columnpanel of the form
|
||||||
* @param itemModel The {@link ItemSelectionModel} which will
|
* @param itemModel The {@link ItemSelectionModel} which will be responsible for loading the current item
|
||||||
* be responsible for loading the current item
|
|
||||||
*/
|
*/
|
||||||
public BasicPageForm(String formName,
|
public BasicPageForm(String formName,
|
||||||
ColumnPanel columnPanel,
|
ColumnPanel columnPanel,
|
||||||
|
|
@ -81,8 +80,8 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
* this method to perform all their widget-adding needs
|
* needs
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
@ -109,13 +108,10 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility method to initialize the name/title widgets. Child classes
|
* Utility method to initialize the name/title widgets. Child classes may call this method from the init listener
|
||||||
* may call this method from the init listener
|
|
||||||
*
|
*
|
||||||
* @param e the {@link FormSectionEvent} which was passed to the
|
* @param e the {@link FormSectionEvent} which was passed to the init listener
|
||||||
* init listener
|
* @return the ContentPage instance which was extracted from the ItemSelectionModel
|
||||||
* @return the ContentPage instance which was extracted from the
|
|
||||||
* ItemSelectionModel
|
|
||||||
*/
|
*/
|
||||||
public ContentPage initBasicWidgets(FormSectionEvent e) {
|
public ContentPage initBasicWidgets(FormSectionEvent e) {
|
||||||
Assert.exists(getItemSelectionModel());
|
Assert.exists(getItemSelectionModel());
|
||||||
|
|
@ -143,9 +139,10 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||||
ACSObject parent = getItemSelectionModel().getSelectedItem(fse.getPageState()).getParent();
|
final ContentItem item = getItemSelectionModel().getSelectedItem(fse.getPageState());
|
||||||
|
ACSObject parent = item.getParent();
|
||||||
|
|
||||||
|
|
||||||
if (parent instanceof ContentBundle) {
|
if (parent instanceof ContentBundle) {
|
||||||
|
|
@ -154,16 +151,18 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
if (parent instanceof Folder) {
|
if (parent instanceof Folder) {
|
||||||
final Folder folder = (Folder) parent;
|
final Folder folder = (Folder) parent;
|
||||||
Assert.exists(folder);
|
Assert.exists(folder);
|
||||||
validateNameUniqueness(folder, fse);
|
final FormData data = fse.getFormData();
|
||||||
|
final String name = data.getString(NAME);
|
||||||
|
if (!item.getName().equals(name)) {
|
||||||
|
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.
|
|
||||||
*
|
*
|
||||||
* @param e the {@link FormSectionEvent} which was passed to the
|
* @param e the {@link FormSectionEvent} which was passed to the process listener
|
||||||
* process listener
|
|
||||||
*/
|
*/
|
||||||
public ContentPage processBasicWidgets(FormSectionEvent e) {
|
public ContentPage processBasicWidgets(FormSectionEvent e) {
|
||||||
Assert.exists(getItemSelectionModel());
|
Assert.exists(getItemSelectionModel());
|
||||||
|
|
@ -187,15 +186,11 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A utility method that will create a new item and tell the selection
|
* A utility method that will create a new item and tell the selection model to select the new item. Creation
|
||||||
* model to select the new item. Creation components may call this method
|
* components may call this method in the process listener of their form. See {@link PageCreate} for an example.
|
||||||
* in the process listener of their form. See {@link PageCreate} for
|
|
||||||
* an example.
|
|
||||||
*
|
*
|
||||||
* @param state the current page state
|
* @param state the current page state
|
||||||
* @return the new content item (or a proper subclass thereof)
|
* @return the new content item (or a proper subclass thereof) @pre state != null @post return != null
|
||||||
* @pre state != null
|
|
||||||
* @post return != null
|
|
||||||
*/
|
*/
|
||||||
public ContentPage createContentPage(PageState state)
|
public ContentPage createContentPage(PageState state)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
@ -220,7 +215,8 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <code>LaunchDateValidationListener</code>.
|
* Constructs a new
|
||||||
|
* <code>LaunchDateValidationListener</code>.
|
||||||
*/
|
*/
|
||||||
public class LaunchDateValidationListener implements ParameterListener {
|
public class LaunchDateValidationListener implements ParameterListener {
|
||||||
|
|
||||||
|
|
@ -235,6 +231,5 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@ public class PublisherCreate extends PageCreate {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||||
|
//We don't call super.validate(fse); here because the name (URL fragment) of a publisher is generated in a different manner
|
||||||
|
//than the name (URL fragment) of other content items.
|
||||||
Folder folder = m_parent.getFolder(fse.getPageState());
|
Folder folder = m_parent.getFolder(fse.getPageState());
|
||||||
Assert.exists(folder);
|
Assert.exists(folder);
|
||||||
validateNameUniqueness(folder, fse, Publisher.urlSave(getFullName(fse)));
|
validateNameUniqueness(folder, fse, Publisher.urlSave(getFullName(fse)));
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,9 @@ public class WebpagePropertiesForm
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData d = e.getFormData();
|
super.validate(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/** Form initialisation hook. Fills widgets with data. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue