Infolge der Änderungen aus Revision 1807 funktionierten einige Formulare nicht mehr. An den entsprechenden Stelle Aufrufe

von super.validate(FormSectionEvent) wieder entfernt und Kommentar eingefügt, warum die super-Methoden nicht aufgerufen 
wird.


git-svn-id: https://svn.libreccm.org/ccm/trunk@1812 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2012-08-09 13:54:18 +00:00
parent 8aaac0b933
commit ee818077c1
7 changed files with 54 additions and 42 deletions

View File

@ -160,10 +160,13 @@ public class PublicPersonalProfileCreate extends PageCreate {
}
}
/**
* Ensure name uniqueness. Note: We can't call {@code super.validate(FormSectionEvent)} here
* because the super method {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)} tries
* to access things which on existing yet.
*/
@Override
public void validate(FormSectionEvent fse) throws FormProcessException {
super.validate(fse);
Folder folder = m_parent.getFolder(fse.getPageState());
Assert.exists(folder);
String id = (String) fse.getFormData().get(

View File

@ -149,7 +149,8 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
@Override
public void validate(FormSectionEvent e) throws FormProcessException {
super.validate(e);
//Calling super.validate(e) here causes an exception because the super method checks things which not available
//here.
final PageState state = e.getPageState();
final FormData data = e.getFormData();

View File

@ -179,7 +179,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
@Override
public void validate(FormSectionEvent e) throws FormProcessException {
super.validate(e);
//Calling super.validate(e) here causes an exception because the super method checks things which not available
//here.
final PageState state = e.getPageState();
final FormData data = e.getFormData();

View File

@ -125,9 +125,9 @@ public class GenericPersonAliasSetForm
}
@Override
public void validate(final FormSectionEvent fse)
throws FormProcessException {
super.validate(fse);
public void validate(final FormSectionEvent fse) throws FormProcessException {
//We don't call super.validate(fse) here because the super method checks for things which are not available
//here, causing an exception.
final PageState state = fse.getPageState();
final FormData data = fse.getFormData();

View File

@ -72,11 +72,13 @@ public class GenericPersonCreate extends PageCreate {
}
}
// Validate: ensure name uniqueness
/**
* Ensure name uniqueness. Note: We can't call {@code super.validate(FormSectionEvent)} here
* because the super method {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)} tries
* to access things which on existing yet.
*/
@Override
public void validate(FormSectionEvent e) throws FormProcessException {
super.validate(e);
Folder f = m_parent.getFolder(e.getPageState());
Assert.exists(f);
validateNameUniqueness(f, e, GenericPerson.urlSave(getItemName(e)));

View File

@ -34,7 +34,6 @@ import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.util.Assert;
import java.util.Date;
import org.apache.log4j.Logger;
/**
@ -48,8 +47,6 @@ import org.apache.log4j.Logger;
public class PageCreate extends BasicPageForm
implements FormSubmissionListener, CreationComponent {
private static final Logger s_log = Logger.getLogger(PageCreate.class);
protected final CreationSelector m_parent;
protected ApplyWorkflowFormSection m_workflowSection;
@ -105,13 +102,17 @@ public class PageCreate extends BasicPageForm
return m_workflowSection;
}
// Init: create a new item id
/** create a new item id
*
*/
public void init(FormSectionEvent e) throws FormProcessException {
// this is currently a no-op
}
// Submission: If the Cancel button was pressed, hide self and
// show the display component
/**
* If the Cancel button was pressed, hide self and
* show the display component
*/
public void submitted(FormSectionEvent e) throws FormProcessException {
PageState state = e.getPageState();
@ -124,14 +125,18 @@ public class PageCreate extends BasicPageForm
}
}
// Validate: ensure name uniqueness
/**
* Validate inputs to ensure name uniqueness. Note: We can't call {@code super.validate(FormSectionEvent)} here
* because the super method {@link BasicPageForm#validate(com.arsdigita.bebop.event.FormSectionEvent)} tries
* to access things which on existing yet.
*
* @param event
*/
@Override
public void validate(FormSectionEvent e) throws FormProcessException {
super.validate(e);
Folder f = m_parent.getFolder(e.getPageState());
Assert.exists(f);
validateNameUniqueness(f, e);
public void validate(final FormSectionEvent event) throws FormProcessException {
final Folder folder = m_parent.getFolder(event.getPageState());
Assert.exists(folder);
validateNameUniqueness(folder, event);
}
// Process: save fields to the database

View File

@ -18,7 +18,6 @@
*/
package com.arsdigita.cms.ui.templates;
import com.arsdigita.bebop.FormData;
import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.Label;
@ -133,7 +132,8 @@ public class TemplateEdit extends SimpleEditStep {
}
public void validate(FormSectionEvent event) throws FormProcessException {
super.validate(event);
//Calling super.validate(e) here causes an exception because the super method checks things which not available
//here.
PageState state = event.getPageState();
FormData data = event.getFormData();
@ -155,6 +155,6 @@ public class TemplateEdit extends SimpleEditStep {
Assert.exists(t);
return t;
}
}
}
}